/* 开口练表达 · H5 演示站（零构建、无外链资源）
 * 设计体系：shadcn 语义 token × 双主题（data-theme 由 index.html 早期脚本设置）
 * 品牌规范见 docs/UI-GUIDELINES.md；类名引用完整性由 scripts/ui_gate.py 把关
 * ============================================================ */

/* ---------------- 1. 设计 token ---------------- */
[data-theme="light"] {
  color-scheme: light;
  /* 表面 */
  --backdrop: #E9E7E1;          /* 桌面外壳底 */
  --background: #F4F3EF;        /* 页面底（暖纸） */
  --card: #FFFFFF;
  --card-2: #FAF9F5;            /* 卡内嵌套面 */
  --track: #EBE7DD;             /* 进度/柱状/分段控件底 */
  /* 文字 */
  --fg: #1B2620;                /* 正文（on card 13.9:1） */
  --fg-2: #3E4B44;              /* 次正文（8.9:1） */
  --muted-fg: #5C6961;          /* 辅助文字（4.7:1） */
  --faint-fg: #7A857D;          /* 仅装饰性图形/禁用（3.3:1，非正文） */
  /* 边框 */
  --border: #E5E2D9;
  --border-strong: #D3CFC3;
  /* 品牌绿：只用于主 CTA / 链接 / 当前态 / 进度 */
  --primary: #1F5C45;
  --primary-hover: #17482F;
  --primary-fg: #FFFFFF;
  --primary-text: #1F5C45;      /* 文字用绿（7.7:1） */
  --primary-soft: #E8F0EA;
  --primary-soft-text: #17432F;
  /* 琥珀：只用于成就/streak/会员语境 */
  --accent: #E8A33D;
  --accent-soft: #FBEEDA;
  --accent-text: #7A4E0B;       /* 琥珀语境的文字（6.3:1） */
  --accent-fg: #3D2A08;         /* 琥珀底上的字 */
  /* 危险 */
  --danger: #A93E2B;            /* 文字（6.6:1） */
  --danger-fill: #A93E2B;       /* 录音态实底 */
  /* 状态 */
  --ring: rgba(31, 92, 69, .32);
  --ring-soft: rgba(31, 92, 69, .13);
  /* 圆角阶 */
  --radius-sm: 10px;
  --radius: 14px;               /* 控件 */
  --radius-lg: 18px;            /* 卡片 */
  --radius-xl: 24px;            /* hero/壳内大面 */
  /* 阴影阶（低幅度） */
  --shadow-xs: 0 1px 2px rgba(27, 38, 32, .05);
  --shadow-sm: 0 1px 3px rgba(27, 38, 32, .06), 0 4px 12px rgba(27, 38, 32, .05);
  --shadow-md: 0 8px 28px rgba(27, 38, 32, .12);
  /* 字号阶 */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 17px;
  --text-xl: 21px;
  --text-num-md: 24px;
  --text-num: 30px;
  --text-num-lg: 44px;
  --text-num-xl: 58px;
  /* 分类宫格六色（降饱和） */
  --tint-1: #E7EFEA;
  --tint-2: #E5EAF2;
  --tint-3: #F0EADD;
  --tint-4: #E9EDF2;
  --tint-5: #EFE7EF;
  --tint-6: #EAE7DC;
  /* 雷达 */
  --radar-fill: rgba(31, 92, 69, .15);

  /* ---- 旧 token 别名（兼容 app.js 内联 var() 与历史引用，勿删） ---- */
  --green: var(--primary-text);
  --green-2: var(--primary);
  --green-deep: #143D2C;
  --green-soft: var(--primary-soft);
  --orange: var(--accent);
  --orange-deep: var(--accent-text);
  --orange-soft: var(--accent-soft);
  --cream: var(--background);
  --paper: var(--card-2);
  --line: var(--border);
  --ink: var(--fg);
  --ink-2: var(--fg-2);
  --muted: var(--muted-fg);
  --blue-soft: var(--tint-2);
  --shadow: var(--shadow-sm);
}

[data-theme="dark"] {
  color-scheme: dark;
  --backdrop: #0C0F0D;
  --background: #121714;
  --card: #1A211D;
  --card-2: #212924;
  --track: #262E29;
  --fg: #EAE9E4;                /* 12.0:1 */
  --fg-2: #C2C9C3;              /* 8.2:1 */
  --muted-fg: #9AA5A0;          /* 5.6:1 */
  --faint-fg: #76817B;          /* 装饰（3.4:1，非正文） */
  --border: #2A322D;
  --border-strong: #3A443E;
  --primary: #2E7D5B;
  --primary-hover: #38926A;
  --primary-fg: #FFFFFF;
  --primary-text: #6FC49A;      /* 6.6:1 on card */
  --primary-soft: #21332B;
  --primary-soft-text: #A9D9C1;
  --accent: #D9972F;
  --accent-soft: #332B18;
  --accent-text: #EDBE72;
  --accent-fg: #241A05;
  --danger: #E4796B;
  --danger-fill: #A93E2B;
  --ring: rgba(111, 196, 154, .40);
  --ring-soft: rgba(111, 196, 154, .16);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .30), 0 4px 12px rgba(0, 0, 0, .22);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .45);
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 17px;
  --text-xl: 21px;
  --text-num-md: 24px;
  --text-num: 30px;
  --text-num-lg: 44px;
  --text-num-xl: 58px;
  --tint-1: #1E2B25;
  --tint-2: #232C38;
  --tint-3: #2E2A20;
  --tint-4: #242E38;
  --tint-5: #2C2530;
  --tint-6: #2B2922;
  --radar-fill: rgba(111, 196, 154, .18);

  --green: var(--primary-text);
  --green-2: var(--primary);
  --green-deep: #0B241B;
  --green-soft: var(--primary-soft);
  --orange: var(--accent);
  --orange-deep: var(--accent-text);
  --orange-soft: var(--accent-soft);
  --cream: var(--background);
  --paper: var(--card-2);
  --line: var(--border);
  --ink: var(--fg);
  --ink-2: var(--fg-2);
  --muted: var(--muted-fg);
  --blue-soft: var(--tint-2);
  --shadow: var(--shadow-sm);
}

/* 注：token 由 index.html 内联脚本在 CSS 解析前同步设置 data-theme
   （SPA 无 JS 本就不渲染），故无需再做 prefers-color-scheme 媒体查询兜底。 */

:root {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
}

/* ---------------- 2. 基础 ---------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

a, button { touch-action: manipulation; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--fg);
  background: var(--backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease;
}

[hidden] { display: none !important; }

a { color: var(--primary-text); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; color: var(--fg); }
h1 { font-size: var(--text-xl); font-weight: 700; letter-spacing: .2px; }
h2 { font-size: var(--text-lg); font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: var(--text-base); font-weight: 600; }
p { margin: 0; }

::selection { background: var(--primary-soft); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.phone {
  position: relative;
  width: 390px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--fg);
  overflow: hidden;
  transition: background .2s ease;
}

@media (min-width: 520px) {
  .phone {
    height: min(860px, calc(100dvh - 48px));
    border-radius: 30px;
    box-shadow: var(--shadow-md), 0 0 0 1px var(--border-strong);
  }
}

/* ---------------- 3. 顶栏 / 主区 / 底部 Tab ---------------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--background);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  transition: background .2s ease;
}
.topbar .back {
  flex: none;
  width: 40px; height: 40px;
  margin: -4px 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease;
}
.topbar .back:active { transform: scale(.94); }
.topbar .tb-main { flex: 1; min-width: 0; }
.topbar .tb-title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .tb-sub {
  margin: 1px 0 0;
  font-size: var(--text-xs);
  color: var(--muted-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .tb-right { flex: none; display: flex; align-items: center; gap: 6px; }

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.streak-pill b { font-size: var(--text-md); }

.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 16px 28px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.main::-webkit-scrollbar { width: 4px; }
.main::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.main > * + * { margin-top: 14px; }

.tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px 6px 10px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--border);
}
@supports (backdrop-filter: blur(10px)) {
  .tabbar {
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px) saturate(1.3);
  }
  [data-theme="dark"] .tabbar { background: rgba(26, 33, 29, .88); }
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0 2px;
  color: var(--muted-fg);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color .15s ease;
}
.tab-ico {
  display: grid;
  place-items: center;
  width: 28px; height: 26px;
  border-radius: 9px;
  transition: background .15s ease;
}
.tab-ico svg { display: block; }
.tab-label { line-height: 1.2; }
.tab.active { color: var(--primary-text); font-weight: 600; }
.tab.active .tab-ico { background: var(--primary-soft); }

/* ---------------- 4. 工具类 ---------------- */
.muted { color: var(--muted-fg); }
.tiny { font-size: var(--text-sm); line-height: 1.5; color: var(--muted-fg); }
.small { font-size: var(--text-md); }
.block { display: block; }
.center { text-align: center; }
.mt6 { margin-top: 6px; }
.mt10 { margin-top: 10px; }
.mt14 { margin-top: 14px; }

.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.divider { height: 1px; background: var(--border); border: 0; margin: 12px 0; }

.fade-in { animation: fadeIn .24s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.footer-note { text-align: center; font-size: var(--text-sm); color: var(--muted-fg); padding: 8px 0 2px; line-height: 1.6; }

/* ---------------- 5. 基础组件 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted-fg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.block { display: flex; width: 100%; }
.btn.ghost {
  background: var(--card);
  color: var(--primary-text);
  border-color: var(--border-strong);
}
.btn.ghost:hover { background: var(--card-2); }
.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border-strong);
}
.btn.accent {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn.small { min-height: 34px; padding: 6px 12px; font-size: var(--text-sm); border-radius: var(--radius-sm); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-soft-text);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.tag.plain { background: var(--track); color: var(--muted-fg); }
.tag.orange { background: var(--accent-soft); color: var(--accent-text); }

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px dashed var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.demo-badge::before { content: "●"; font-size: 8px; }

.progress { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

.field { display: block; margin-top: 10px; }
.field > span { display: block; font-size: var(--text-sm); color: var(--muted-fg); margin-bottom: 5px; }
.input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--fg);
  /* 16px：防 iOS Safari 聚焦自动放大（规范 §8 登记例外） */
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--faint-fg); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.input-group .btn { flex: none; }

/* 开关（主题切换等设置项） */
.switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 42px; height: 25px;
}
.switch input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--border-strong);
  transition: background .15s ease, border-color .15s ease;
  pointer-events: none;
}
.switch i::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform .15s ease;
}
.switch input:checked + i { background: var(--primary); border-color: var(--primary); }
.switch input:checked + i::before { transform: translateX(17px); background: #fff; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--ring); }

details.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
  padding: 0 13px;
}
details.disclosure > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--primary-text);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "＋"; color: var(--muted-fg); font-weight: 500; }
details.disclosure[open] > summary::after { content: "－"; }
details.disclosure .disclosure-body { padding: 0 0 13px; font-size: var(--text-md); line-height: 1.8; color: var(--fg-2); white-space: pre-wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tip-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }

.hint-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card-2);
  border: 1px dashed var(--border-strong);
  font-size: var(--text-sm);
  color: var(--fg-2);
  line-height: 1.65;
}
.hint-box b { color: var(--primary-text); }

.quote-block {
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--accent-text);
}
.quote-block::before { content: "“"; font-size: 22px; color: var(--accent-text); vertical-align: -4px; margin-right: 2px; }

.feedback { border-left: 3px solid var(--primary-text); padding-left: 11px; }
.feedback.orange { border-left-color: var(--accent); }
.feedback h3 { font-size: var(--text-sm); letter-spacing: .04em; color: var(--muted-fg); font-weight: 600; margin-bottom: 5px; }
.feedback p { font-size: 13.5px; line-height: 1.72; color: var(--fg); }

/* ---------------- 6. 首页 ---------------- */
.hero {
  background: linear-gradient(165deg, #27684F 0%, #1F5C45 48%, #153D2C 100%);
  border: 0;
  color: #EAF2EC;
  border-radius: var(--radius-xl);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -46px; bottom: -66px;
  width: 168px; height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 163, 61, .22), transparent 68%);
}
.hero .eyebrow { color: #CBDCD2; }
.hero h1 { font-size: var(--text-xl); color: #fff; }
.hero-sub { margin-top: 6px; font-size: var(--text-sm); color: #D5E3DA; }
.hero .streak-pill { background: rgba(232, 163, 61, .16); color: #FCE8C0; border: 1px solid rgba(232, 163, 61, .35); }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.hero-stat {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.hero-stat b { display: block; font-size: 19px; line-height: 1.2; color: #fff; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: var(--text-xs); color: #D5E3DA; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 2px 10px; }
.section-head h2 { font-size: 16px; }
.section-head a, .section-head button { font-size: var(--text-sm); color: var(--muted-fg); background: none; border: 0; padding: 0; cursor: pointer; }

.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.module-card {
  position: relative;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  color: var(--fg);
  font: inherit;
}
.module-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.module-card:active { transform: translateY(1px) scale(.985); }
.module-ico {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 9px;
}
.module-card:nth-child(2) .module-ico { background: var(--accent-soft); color: var(--accent-text); }
.module-card:nth-child(3) .module-ico { background: var(--tint-4); color: var(--fg-2); }
.module-card:nth-child(4) .module-ico { background: var(--tint-5); color: var(--fg-2); }
.module-card h3 { font-size: var(--text-base); }
.module-card p { margin-top: 3px; font-size: var(--text-sm); color: var(--muted-fg); line-height: 1.45; }
.module-arrow { position: absolute; right: 13px; top: 14px; color: var(--faint-fg); font-size: 14px; }

/* 八卡宫格（2026-12-03 批次C）：2 列 4 行，卡片更紧凑 */
.module-grid.eight { grid-template-columns: 1fr 1fr; gap: 9px; }
.module-grid.eight .module-card { padding: 13px 14px; min-height: 86px; }
.module-grid.eight .module-card h3 { font-size: 14.5px; }
.module-grid.eight .module-card p { font-size: 12px; }
.module-grid.eight .module-ico { width: 30px; height: 30px; font-size: 14px; }
.module-grid.eight .module-arrow { top: 12px; }
a.module-card.prac { display: block; text-decoration: none; color: inherit; }

.transcript-edit {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
}
.transcript-edit:focus { outline: none; border-color: var(--primary); }

.topic-card { background: var(--card); }
.topic-title { font-size: 18px; font-weight: 700; margin-top: 8px; letter-spacing: .2px; line-height: 1.5; }
.topic-body {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-actions { display: flex; gap: 8px; margin-top: 14px; }
.topic-actions .btn { flex: 1; }

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.banner-ico {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}
.banner h3 { font-size: 13.5px; color: var(--accent-text); }
.banner p { font-size: var(--text-sm); color: var(--accent-text); margin-top: 2px; }

.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-row .tiny { margin: 0; }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 15px 14px;
  background: var(--tint-1);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .12s ease, border-color .12s ease;
}
.cat-card:hover { border-color: var(--border-strong); }
.cat-card:active { transform: scale(.98); }
.cat-card:nth-child(6n + 2) { background: var(--tint-2); }
.cat-card:nth-child(6n + 3) { background: var(--tint-3); }
.cat-card:nth-child(6n + 4) { background: var(--tint-4); }
.cat-card:nth-child(6n + 5) { background: var(--tint-5); }
.cat-card:nth-child(6n + 6) { background: var(--tint-6); }
.cat-emoji { font-size: 22px; line-height: 1; display: block; }
.cat-card h4 { margin: 8px 0 4px; font-size: 15px; color: var(--primary-text); }
.cat-card p { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--fg-2); white-space: pre-line; }

.hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.hist-item:last-child { border-bottom: none; }
.hist-item h4 { margin: 0; font-size: var(--text-base); }
.hist-item .tiny { margin: 2px 0 0; }
.hist-score { font-weight: 700; color: var(--primary-text); font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------------- 7. 场景 ---------------- */
.scene-item { padding: 15px; }
.scene-item h3 { font-size: 15px; }
.scene-item .scene-desc { margin-top: 6px; font-size: var(--text-sm); line-height: 1.65; color: var(--fg-2); }
.opener {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-size: var(--text-sm);
  color: var(--primary-soft-text);
  line-height: 1.6;
}
.opener b { font-size: var(--text-xs); color: var(--primary-text); display: block; margin-bottom: 2px; }

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--track);
}
.segmented a {
  flex: 1;
  text-align: center;
  padding: 7px 4px;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted-fg);
}
.segmented a.active { background: var(--card); color: var(--primary-text); box-shadow: var(--shadow-xs); }

/* ---------------- 8. 准备 / 录音 ---------------- */
.countdown-wrap { text-align: center; padding: 10px 0 4px; }
.countdown {
  font-size: var(--text-num-xl);
  font-weight: 700;
  line-height: 1;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.countdown small { font-size: 16px; font-weight: 600; color: var(--muted-fg); margin-left: 2px; }

.record-card { text-align: center; padding: 20px 16px 18px; }
.record-timer {
  font-size: var(--text-num-lg);
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--primary-text);
  margin: 14px 0 2px;
}
.record-timer.warn { color: var(--accent-text); }
.record-sub { font-size: var(--text-sm); color: var(--muted-fg); }

.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 62px;
  margin: 14px 0 6px;
}
.wave i {
  display: block;
  width: 5px;
  height: 12%;
  border-radius: 4px;
  background: var(--track);
  transition: background .3s ease;
}
.wave i:nth-child(3n) { height: 22%; }
.wave i:nth-child(4n) { height: 34%; }
.wave i:nth-child(5n) { height: 16%; }
.wave.live i { background: var(--primary); animation: waveBeat .95s ease-in-out infinite; }
.wave.live i:nth-child(2n) { animation-duration: .78s; }
.wave.live i:nth-child(3n) { animation-duration: 1.18s; }
.wave.live i:nth-child(5n) { animation-duration: 1.4s; }
.wave.live i:nth-child(7n) { animation-duration: .64s; }
.wave.demo i { background: var(--accent); }
@keyframes waveBeat {
  0%, 100% { transform: scaleY(.55); opacity: .7; }
  50% { transform: scaleY(2.9); opacity: 1; }
}

.mic-btn {
  /* em 缩放：textZoom 放大时按钮随文字等比变大，文案不溢出圆钮 */
  width: 6.4em; height: 6.4em;
  max-width: 100%;
  margin: 8px auto 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform .14s ease, background .2s ease;
}
.mic-btn.on { background: var(--danger-fill); color: #fff; }
.mic-btn:active { transform: scale(.96); }
.record-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.record-note {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
  text-align: left;
}

/* ---------------- 9. 试听 / 报告 ---------------- */
.audio-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card-2);
  border: 1px solid var(--border);
}
.audio-box .ab-ico {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
}
.audio-box audio { width: 100%; height: 34px; }

.transcript {
  margin-top: 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card-2);
  border-left: 3px solid var(--primary-soft);
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--fg-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow-y: auto;
}

.report-head { display: flex; align-items: center; gap: 16px; }
.score-ring {
  --p: 78;
  flex: none;
  /* em 缩放：微信 textZoom 放大字号时环体等比缩放，数字不压穿内圈 */
  font-size: var(--text-num);
  width: 3.2em; height: 3.2em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--track) 0);
}
.score-ring::after {
  content: "";
  position: absolute;
  top: 0.26em; right: 0.26em; bottom: 0.26em; left: 0.26em;
  border-radius: 50%;
  background: var(--card);
}
.score-ring .sr-inner { position: relative; z-index: 1; text-align: center; line-height: 1; }
.score-ring .sr-num { font-size: 1em; font-weight: 700; color: var(--primary-text); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.score-ring .sr-unit { display: block; margin-top: 0.14em; font-size: 0.34em; color: var(--muted-fg); font-weight: 600; }

.badge-text { font-size: var(--text-lg); font-weight: 700; color: var(--primary-text); }
.ai-note { font-size: var(--text-xs); color: var(--muted-fg); }

.dim-list { display: grid; gap: 11px; }
.dim-row { display: grid; grid-template-columns: 66px 1fr 36px; align-items: center; gap: 9px; font-size: var(--text-md); }
.dim-row .dim-label { color: var(--fg-2); }
.dim-bar { height: 7px; border-radius: 999px; background: var(--track); overflow: hidden; }
.dim-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.dim-row .dim-score { text-align: right; font-weight: 700; color: var(--primary-text); font-variant-numeric: tabular-nums; }

.report-actions { display: grid; gap: 9px; }

.radar-wrap { display: flex; justify-content: center; padding: 4px 0 2px; }
.radar-wrap svg { overflow: visible; max-width: 100%; height: auto; }
.rd-grid { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.rd-axis { stroke: var(--border); stroke-width: 1; }
.rd-area { fill: var(--radar-fill); stroke: var(--primary-text); stroke-width: 2; }
.rd-label { fill: var(--fg-2); font-size: 11px; }

/* ---------------- 10. 故事 ---------------- */
.story-item .story-top { display: flex; align-items: center; gap: 8px; }
.story-body { margin-top: 9px; font-size: var(--text-md); line-height: 1.78; color: var(--fg-2); }
.story-body p + p { margin-top: 7px; }
.q-list { margin: 8px 0 0; padding-left: 18px; font-size: var(--text-sm); color: var(--fg-2); line-height: 1.7; }
.q-list li + li { margin-top: 3px; }
.topic-full-body { font-size: 14.5px; color: var(--fg-2); line-height: 1.75; white-space: pre-wrap; }
.topic-title { line-height: 1.5; }

/* ---------------- 11. 成长 ---------------- */
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 8px;
  text-align: center;
}
.metric b { display: block; font-size: var(--text-num-md); font-weight: 700; color: var(--primary-text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric span { font-size: var(--text-xs); color: var(--muted-fg); }

.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 5px; }
.cal-head span { text-align: center; font-size: var(--text-xs); color: var(--muted-fg); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--fg-2);
  background: var(--track);
  font-variant-numeric: tabular-nums;
}
.cal-cell.blank { background: transparent; }
.cal-cell.inplan { background: var(--card); border: 1px dashed var(--border-strong); color: var(--primary-text); }
.cal-cell.checked { background: var(--primary); color: var(--primary-fg); font-weight: 600; border: 1px solid var(--primary); }
.cal-cell.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-cell.future { color: var(--muted-fg); background: var(--card-2); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: var(--text-xs); color: var(--muted-fg); }
.cal-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------------- 12. 我的 ---------------- */
.profile { display: flex; align-items: center; gap: 12px; }
.avatar {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 20px;
  font-weight: 700;
}
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: var(--text-sm); border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted-fg); }
.kv .v { color: var(--fg); font-weight: 600; text-align: right; word-break: break-all; }

.menu-list { padding: 4px 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
  color: var(--fg);
  cursor: pointer;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-ico {
  width: 28px; height: 28px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--card-2);
  font-size: var(--text-sm);
  color: var(--primary-text);
}
.menu-item .mi-arrow { color: var(--faint-fg); font-size: var(--text-md); }

/* 功能对照表（演示站自用，字号为登记过的例外） */
.checklist {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 8px;
  table-layout: fixed;
}
.checklist th, .checklist td {
  text-align: left;
  padding: 6px 5px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  word-break: break-word;
}
.checklist th { color: var(--muted-fg); font-weight: 600; font-size: 10.5px; background: var(--card-2); }
.checklist td:first-child { font-weight: 600; color: var(--primary-text); }
.checklist code { font-size: 10px; color: var(--fg-2); background: var(--track); padding: 1px 3px; border-radius: 4px; word-break: break-all; }

/* ---------------- 13. 状态 ---------------- */
.loading { display: grid; place-items: center; gap: 10px; padding: 90px 0; color: var(--muted-fg); font-size: var(--text-sm); }
.spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 3px solid var(--track);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: absolute;
  left: 50%;
  bottom: 78px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translate(-50%, 18px);
  max-width: calc(100% - 48px);
  padding: 10px 15px;
  border-radius: var(--radius);
  background: rgba(20, 28, 24, .94);
  color: #F2F1EC;
  font-size: var(--text-sm);
  line-height: 1.5;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 30;
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .toast { background: rgba(234, 233, 228, .96); color: #1B2620; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
