/* ========== 基础 ========== */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2329;
  --muted: #86909c;
  --muted-strong: #4e5969;
  --border: #e8eaed;
  --border-soft: #f2f3f5;
  --brand: #534ab7;

  --c-zhiming: #534ab7;
  --c-zhiming-soft: #eeedfe;
  --c-opc: #8b1f1f;
  --c-opc-soft: #fae8e8;
  --c-course: #4a5d3a;
  --c-course-soft: #e8ece1;
  --c-astock: #1e40af;
  --c-astock-soft: #e6edf9;
  --c-audio: #ea580c;
  --c-audio-soft: #fceee2;

  --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ========== 折叠开关（kukuai 风格推拉手柄） ========== */
.nav-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rail-handle {
  position: fixed;
  top: 50%;
  left: var(--sidebar-w);
  transform: translateY(-50%);
  width: 18px;
  height: 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  box-shadow: 2px 0 6px rgba(0,0,0,0.05);
  transition: left .25s ease, background .15s, border-radius .25s, border-color .25s;
}
.rail-handle:hover { background: #fafbfc; }
.rail-handle svg {
  width: 8px;
  height: 12px;
  color: var(--muted-strong);
  transition: transform .25s ease;
}
.nav-input:checked ~ .rail-handle {
  left: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.nav-input:checked ~ .rail-handle svg { transform: rotate(180deg); }

@media (max-width: 900px) {
  .rail-handle { display: none; }
}

/* ========== 整体页面（侧栏 + 主区并排） ========== */
.page {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

/* ========== 左侧栏（流式布局 · 折叠时收起） ========== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: width .25s ease, border-color .25s ease;
}
.sidebar-inner {
  width: var(--sidebar-w);
  height: 100%;
  padding: 56px 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 4px;
}
.side-brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #534ab7 0%, #7f77dd 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.side-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.side-section { display: flex; flex-direction: column; gap: 10px; }
.side-title {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.5px;
  padding: 0 4px;
}

/* ========== 工具箱 ========== */
.toolbox { display: flex; flex-direction: column; gap: 2px; }
.toolbox .tool-group:nth-child(1) { order: 2; }
.toolbox .tool-group:nth-child(2) { order: 3; }
.toolbox .tool-group:nth-child(3) { order: 1; }
.toolbox .tool-group:nth-child(4) { order: 4; }
.toolbox .tool-group:nth-child(5) { order: 5; }
.tool-group summary {
  cursor: pointer;
  list-style: none;
  padding: 7px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
  user-select: none;
}
.tool-group summary::-webkit-details-marker { display: none; }
.tool-group summary::-moz-list-bullet { list-style: none; }
.tool-group summary:hover { background: #f7f8fa; }
.tool-group summary .dot { margin-top: 0; }

.tool-summary-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-caret {
  font-size: 10px;
  color: var(--muted);
  transition: transform .15s ease;
}
.tool-group:not([open]) .tool-caret { transform: rotate(-90deg); }

.tool-list {
  list-style: none;
  padding: 2px 0 6px 22px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tool-link {
  display: block;
  font-size: 12.5px;
  color: var(--muted-strong);
  padding: 5px 10px;
  border-radius: 5px;
  transition: background .12s, color .12s;
}
.tool-link:hover {
  background: #f2f3f5;
  color: var(--brand);
}

/* 客户信息 */
.side-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid var(--border-soft);
}
.side-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7f77dd 0%, #d85a30 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}
.side-user-text { min-width: 0; flex: 1; }
.side-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.side-user-meta {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 1px;
}

/* 客户历史 */
.side-history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.side-history-item:hover { background: #f7f8fa; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 7px;
}
.dot-zhiming { background: var(--c-zhiming); }
.dot-opc     { background: var(--c-opc); }
.dot-course  { background: var(--c-course); }
.dot-astock  { background: var(--c-astock); }
.dot-audio   { background: var(--c-audio); }

.hist-body { min-width: 0; flex: 1; }
.hist-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-time {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 1px;
}

.side-link {
  display: inline-block;
  font-size: 12.5px;
  color: var(--brand);
  padding: 4px 4px;
  align-self: flex-start;
}
.side-link:hover { text-decoration: underline; }

/* 底部登录按钮 */
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.btn-login {
  display: block;
  text-align: center;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
  border-radius: 8px;
  letter-spacing: 4px;
  transition: background .15s;
}
.btn-login:hover { background: #3c3489; }

/* ========== 主内容 ========== */
.main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

/* 折叠：勾选时收起侧栏 */
.nav-input:checked ~ .page .sidebar { width: 0; border-right-color: transparent; }

/* ========== 品牌区 ========== */
.brand {
  text-align: center;
  padding: 80px 24px 56px;
}
.brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #534ab7 0%, #7f77dd 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 28px;
  box-shadow: 0 6px 20px rgba(83, 74, 183, 0.25);
}
.brand-name {
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.brand-tag {
  font-size: 16px;
  color: var(--muted);
}

/* ========== 产品三件套 ========== */
.products {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.products-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 28px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 28px;
}
.products-main .card--course  { order: 1; }
.products-main .card--zhiming { order: 2; }
.products-main .card--opc     { order: 3; }
.products-side {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 28px 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-accent-soft, transparent);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.card > * { position: relative; }

.card--zhiming { --card-accent: var(--c-zhiming); --card-accent-soft: var(--c-zhiming-soft); }
.card--opc     { --card-accent: var(--c-opc);     --card-accent-soft: var(--c-opc-soft); }
.card--course  { --card-accent: var(--c-course);  --card-accent-soft: var(--c-course-soft); }
.card--astock  { --card-accent: var(--c-astock);  --card-accent-soft: var(--c-astock-soft); }
.card--audio   { --card-accent: var(--c-audio);   --card-accent-soft: var(--c-audio-soft); }

.card:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent);
  box-shadow: 0 12px 28px -8px var(--card-accent);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--card-accent-soft);
  color: var(--card-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card-icon svg { width: 28px; height: 28px; }

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.card-title-en {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 0.5px;
}

.card-desc {
  font-size: 14px;
  color: var(--muted-strong);
  margin-bottom: 22px;
  min-height: 44px;
}

.card-link {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--card-accent);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.card-link:hover { border-bottom-color: var(--card-accent); }

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer p {
  font-size: 12.5px;
  color: var(--muted);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  /* 移动端：侧栏在上方堆叠，可折叠 */
  .page { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-inner { width: 100%; padding: 16px; }
  .nav-input:checked ~ .page .sidebar { width: 100%; } /* 移动端不缩宽 */

  .brand { padding: 56px 24px 40px; }
  .brand-name { font-size: 26px; }
  .brand-tag { font-size: 14px; }

  .products {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 20px 56px;
  }
  .products-main { grid-template-columns: 1fr; padding-bottom: 18px; margin-bottom: 18px; }
  .products-side { grid-template-columns: 1fr; }
  .card-desc { min-height: 0; }
}

/* ========== 登录注册 / 会员中心 ========== */
.auth-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}
.auth-brand .brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #534ab7 0%, #7f77dd 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.auth-card-wide { max-width: 520px; padding: 32px 28px; }

.auth-tab-input,
.auth-tab-input + input[type="radio"],
input.auth-tab-input { position: absolute; opacity: 0; pointer-events: none; }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: -8px -8px 20px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: color .12s, border-color .12s;
}
#tab-login:checked ~ .auth-card .auth-tabs [for="tab-login"],
#tab-register:checked ~ .auth-card .auth-tabs [for="tab-register"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.auth-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.auth-subtab {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--muted);
  background: #f7f8fa;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
#mode-sms:checked ~ .auth-card .auth-subtabs [for="mode-sms"],
#mode-pwd:checked ~ .auth-card .auth-subtabs [for="mode-pwd"] {
  background: var(--brand);
  color: #fff;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-field input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .12s;
}
.auth-field input:focus { outline: none; border-color: var(--brand); }
.auth-row { display: flex; gap: 8px; }
.auth-row input { flex: 1; }
.auth-send {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.auth-send:hover:not(:disabled) { background: var(--brand); color: #fff; }
.auth-send:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-submit {
  height: 40px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 4px;
  transition: background .15s;
}
.auth-submit:hover { background: #3c3489; }

.auth-banner {
  background: #fff7e6;
  border: 1px solid #ffe7ba;
  color: #874d00;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-banner a { color: var(--brand); }

.auth-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-hint a { color: var(--brand); }
.auth-hint a:hover { text-decoration: underline; }

.auth-error {
  margin-top: 14px;
  text-align: center;
  color: #c5302c;
  font-size: 13px;
  background: #fef0ef;
  border: 1px solid #fcd2cf;
  border-radius: 6px;
  padding: 8px 12px;
}

/* 面板切换：基于 radio 的兄弟选择器 */
.auth-panel[data-panel="login"] { display: none; }
.auth-panel[data-panel="register"] { display: none; }
#tab-login:checked ~ .auth-wrap .auth-panel[data-panel="login"] { display: block; }
#tab-register:checked ~ .auth-wrap .auth-panel[data-panel="register"] { display: block; }

/* 登录子表单：默认显示 sms，pwd/reset 隐藏 */
[data-form="login-pwd"], [data-form="reset"] { display: none; }
#mode-pwd:checked ~ .auth-wrap [data-form="login-pwd"] { display: flex; flex-direction: column; gap: 14px; }
#mode-pwd:checked ~ .auth-wrap [data-form="login-sms"] { display: none; }
#mode-sms:checked ~ .auth-wrap [data-form="login-sms"] { display: flex; flex-direction: column; gap: 14px; }
#mode-sms:checked ~ .auth-wrap [data-form="login-pwd"] { display: none; }

/* 会员中心 */
.acct-title { font-size: 20px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.acct-banner {
  background: #fff7e6;
  border: 1px solid #ffe7ba;
  color: #874d00;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.acct-banner a { color: var(--brand); margin-left: auto; }
.acct-banner button {
  background: transparent;
  border: 0;
  color: #874d00;
  font-size: 16px;
  cursor: pointer;
}
.acct-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.acct-section:last-of-type { border-bottom: 0; }
.acct-h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--muted-strong); }
.acct-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
}
.acct-label { width: 80px; color: var(--muted); font-size: 13px; }
.acct-row input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
}
.acct-mini {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.acct-mini:hover { background: var(--brand); color: #fff; }

.acct-form { display: flex; flex-direction: column; gap: 12px; }
.acct-usage {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acct-usage li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  background: #fafbfc;
}
.acct-usage .muted { color: var(--muted); }
.acct-usage-empty { color: var(--muted); text-align: center; padding: 14px; background: transparent !important; }

.acct-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.acct-link { color: var(--brand); font-size: 13px; }
.acct-link:hover { text-decoration: underline; }
.acct-logout { width: auto; padding: 0 16px; letter-spacing: 2px; }

/* 已登录侧栏块 */
.sidebar-auth { padding: 8px 16px; border-top: 1px solid var(--border-soft); }
.sidebar-auth .side-user { margin: 0; }

/* 响应式 */
@media (max-width: 600px) {
  .auth-card-wide { max-width: 100%; }
  .auth-wrap { max-width: 100%; }
}

