/* ============================================================
   小耳朵英语 · 样式
   布局：平板优先的单列应用，最宽 1040px；孩子用底部大图标导航，内容是浅天蓝纸面上的卡片。
   每个模块一种颜色（今天=珊瑚、看动画=葡萄紫、跟我说=草绿、磨耳朵=阳光黄、家长=天蓝），孩子靠颜色认模块。
   ============================================================ */
:root {
  --bg: #EDF3FB;
  --surface: #FFFFFF;
  --surface-2: #E3ECF8;
  --ink: #1B2541;
  --muted: #56637F;
  --line: #D2DCEB;

  --coral: #E5482F;
  --sky: #2B6FE6;
  --leaf: #0C8F63;
  --grape: #7A4EEF;
  --sun: #FFB21E;
  --coral-soft: #FFE3DD;
  --sky-soft: #DCE8FD;
  --leaf-soft: #D4F2E6;
  --grape-soft: #ECE4FF;
  --sun-soft: #FFF0C9;

  --on-accent: #FFFFFF;
  --on-sun: #3A2800;
  --sun-ink: #8A5A00;
  --star: #F5A300;
  --track: #DCE4F0;
  --shadow: 0 1px 0 rgba(27, 37, 65, .06), 0 10px 28px -16px rgba(27, 37, 65, .35);

  --font-display: "Grandstander", "Baloo 2", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-learn: "Andika", "Chalkboard SE", "Comic Sans MS", "PingFang SC", system-ui, sans-serif;
  --font-ui: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --tap: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1626;
    --surface: #18213A;
    --surface-2: #212C49;
    --ink: #EDF1FA;
    --muted: #A2ADCB;
    --line: #2D3959;
    --coral: #FF7D69;
    --sky: #6FA0FF;
    --leaf: #3FCB98;
    --grape: #A88BFF;
    --sun: #FFC64A;
    --coral-soft: #44261F;
    --sky-soft: #1D2E55;
    --leaf-soft: #163A31;
    --grape-soft: #2D2552;
    --sun-soft: #3B2F14;
    --on-accent: #0E1526;
    --on-sun: #2A1D00;
    --sun-ink: #FFD677;
    --star: #FFC64A;
    --track: #2A3654;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1626;
  --surface: #18213A;
  --surface-2: #212C49;
  --ink: #EDF1FA;
  --muted: #A2ADCB;
  --line: #2D3959;
  --coral: #FF7D69;
  --sky: #6FA0FF;
  --leaf: #3FCB98;
  --grape: #A88BFF;
  --sun: #FFC64A;
  --coral-soft: #44261F;
  --sky-soft: #1D2E55;
  --leaf-soft: #163A31;
  --grape-soft: #2D2552;
  --sun-soft: #3B2F14;
  --on-accent: #0E1526;
  --on-sun: #2A1D00;
  --sun-ink: #FFD677;
  --star: #FFC64A;
  --track: #2A3654;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* 模块色：组件只用 --m（填充）/ --m-soft（浅底）/ --m-on（填充上的字）/ --m-ink（浅底上的字） */
.m-today   { --m: var(--coral); --m-soft: var(--coral-soft); --m-on: var(--on-accent); --m-ink: var(--coral); }
.m-videos  { --m: var(--grape); --m-soft: var(--grape-soft); --m-on: var(--on-accent); --m-ink: var(--grape); }
.m-speak   { --m: var(--leaf);  --m-soft: var(--leaf-soft);  --m-on: var(--on-accent); --m-ink: var(--leaf); }
.m-listen  { --m: var(--sun);   --m-soft: var(--sun-soft);   --m-on: var(--on-sun);    --m-ink: var(--sun-ink); }
.m-parent  { --m: var(--sky);   --m-soft: var(--sky-soft);   --m-on: var(--on-accent); --m-ink: var(--sky); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; line-height: 1.1; white-space: nowrap; }
.brand-name small { display: block; font-family: var(--font-ui); font-weight: 700; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.top-stats { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 800; font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip svg { width: 20px; height: 20px; flex: none; }
.chip-stars svg { color: var(--star); }
.chip-timer { position: relative; overflow: hidden; }
.chip-timer .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--sky); transition: width .4s; }
.chip-timer.reached { background: var(--leaf-soft); border-color: transparent; }
.chip-timer.reached .bar { background: var(--leaf); }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }

/* 孩子档案：沿用原顶栏高度，手机不增加额外一行。 */
.profile-trigger {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  max-width: 210px; padding: 3px 10px 3px 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-weight: 800;
}
.profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chevron { color: var(--muted); }
.profile-avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: 50%; background: var(--profile-bg); color: var(--profile-ink);
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 800;
}
.profile-color-sky { --profile-bg: var(--sky-soft); --profile-ink: var(--sky); }
.profile-color-leaf { --profile-bg: var(--leaf-soft); --profile-ink: var(--leaf); }
.profile-color-grape { --profile-bg: var(--grape-soft); --profile-ink: var(--grape); }
.profile-color-sun { --profile-bg: var(--sun-soft); --profile-ink: var(--sun-ink); }
.profile-color-coral { --profile-bg: var(--coral-soft); --profile-ink: var(--coral); }
html:has(.profile-dialog[open]) { overflow: hidden; }
.profile-dialog {
  width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px);
  padding: 24px; border: 1px solid var(--line); color: var(--ink); overflow-y: auto;
  overscroll-behavior: contain;
}
.profile-dialog[open] { display: grid; gap: 18px; }
.profile-dialog::backdrop { background: color-mix(in srgb, var(--ink) 45%, transparent); }
.profile-dialog .section-head { flex-wrap: nowrap; align-items: center; }
.profile-dialog h2 { font-size: 1.5rem; }
.profile-dialog .help { color: var(--muted); font-size: .85rem; }
.profile-list { display: grid; gap: 10px; }
.profile-row { display: flex; align-items: center; border: 2px solid var(--line); border-radius: 18px; }
.profile-row.is-current { border-color: var(--sky); background: var(--sky-soft); }
.profile-pick {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;
  padding: 12px; background: transparent; border: 0; text-align: left;
}
.profile-pick .profile-avatar { width: 48px; height: 48px; }
.profile-details { display: grid; min-width: 0; overflow-wrap: anywhere; }
.profile-details b { font-size: 1.15rem; }
.profile-details small { color: var(--muted); }
.profile-edit { min-width: 44px; min-height: 44px; margin: 4px; padding: 6px 10px; border: 0; border-radius: 12px; background: var(--surface); color: var(--sky); font-weight: 800; }
.profile-colors { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-colors legend { margin-bottom: 8px; font-weight: 800; }
.profile-colors label { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 5px 10px; border: 2px solid transparent; border-radius: 12px; background: var(--profile-bg); color: var(--profile-ink); cursor: pointer; font-weight: 800; }
.profile-colors label:has(input:checked) { border-color: var(--profile-ink); }
.profile-colors input { margin: 0; accent-color: var(--profile-ink); }
.profile-delete-summary { display: flex; align-items: center; gap: 12px; font-size: 1.4rem; overflow-wrap: anywhere; }
.profile-dialog .input, #backupFile { width: 100%; min-width: 0; }

@media (max-width: 640px) {
  .brand-name { display: none; }
}
@media (max-width: 480px) {
  .topbar-in { gap: 6px; padding-inline: 12px; }
  .top-stats { gap: 5px; min-width: 0; }
  .profile-trigger { max-width: 128px; min-width: 0; gap: 4px; padding-right: 6px; font-size: .85rem; }
  .profile-trigger .profile-avatar { width: 30px; height: 30px; font-size: 1rem; }
  .chip { padding-inline: 7px; gap: 3px; font-size: .8rem; }
  .chip svg { width: 17px; height: 17px; }
  .profile-dialog { padding: 18px; }
  .profile-dialog[open] { gap: 14px; }
}

/* ---------- 主区域与底部导航 ---------- */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 20px 16px;
  display: grid;
  gap: 20px;
}
.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 16px calc(108px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}
.beian-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: center;
  margin: 0;
}
.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar-in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tab {
  display: grid; justify-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 16px;
  text-decoration: none; color: var(--muted);
  font-weight: 800; font-size: .82rem; line-height: 1.1;
}
.tab svg { width: 30px; height: 30px; }
.tab small { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.tab.active { background: var(--m-soft); color: var(--m-ink); }

/* ---------- 通用 ---------- */
.card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.35rem; }
.section-head p { color: var(--muted); font-size: .92rem; }
.eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--m-ink, var(--muted)); }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.center { justify-content: center; text-align: center; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.page-title .sub { color: var(--muted); font-weight: 700; }
.back {
  width: var(--tap); height: var(--tap); flex: none;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.back svg { width: 26px; height: 26px; }

/* 按钮颜色跟随所在模块（--m），不在模块里时用天蓝 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--m, var(--sky)); color: var(--m-on, var(--on-accent));
  font-weight: 800; font-size: 1.08rem;
  text-decoration: none;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--m, var(--sky)) 65%, #000);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--m, var(--sky)) 65%, #000); }
.btn:disabled { opacity: .4; cursor: default; }
.btn svg { width: 24px; height: 24px; }
.btn-lg { min-height: 68px; font-size: 1.3rem; padding: 0 34px; }
.btn-soft { background: var(--m-soft, var(--sky-soft)); color: var(--ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--m, var(--sky)) 35%, var(--line)); }
.btn-soft svg { color: var(--m-ink, var(--sky)); }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn-ghost:active { box-shadow: none; }
.btn-icon { width: var(--tap); padding: 0; }
.btn-emoji { font-family: var(--font-emoji); font-size: 1.3rem; line-height: 1; }

/* ---------- 图片（原型用 emoji 占位插图） ---------- */
.pic { font-family: var(--font-emoji); line-height: 1; display: inline-flex; align-items: center; justify-content: center; user-select: none; }
.pic-xl { font-size: clamp(80px, 20vw, 140px); }
.pic-lg { font-size: clamp(64px, 14vw, 104px); }
.pic-md { font-size: 56px; }
.pic-sm { font-size: 40px; }
.pic-count { flex-wrap: wrap; max-width: 6.2em; gap: .06em; }
.pic-xl.pic-count, .pic-lg.pic-count { font-size: clamp(34px, 7vw, 54px); max-width: 6.2em; }
.pic-md.pic-count { font-size: 22px; }
.pic-sm.pic-count { font-size: 16px; }
.pic-swatch { position: relative; }
.pic-swatch .swatch {
  width: 1.1em; height: 1.1em; border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%;
  background: var(--c); border: 3px solid var(--line);
}
.pic-swatch .on-swatch { position: absolute; right: -.08em; bottom: -.08em; font-size: .45em; }

/* ---------- 点读句子 ---------- */
.say-line { font-family: var(--font-learn); font-size: clamp(1.35rem, 3.4vw, 1.8rem); line-height: 1.45; }
.say-line.big { font-size: clamp(1.6rem, 4.6vw, 2.4rem); }
.say-line.word { font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 700; line-height: 1.1; }
.say-line .w { border-radius: 8px; padding: 0 2px; cursor: pointer; transition: background .15s; }
.say-line .w:hover { background: var(--surface-2); }
.say-line .w.on { background: var(--sun-soft); box-shadow: inset 0 -4px 0 var(--sun); }
.say-line.reading { color: var(--ink); }

/* ---------- 今天 ---------- */
.hero { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
.hero h1 button { all: unset; cursor: pointer; }
.hero h1 button:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 10px; }
.hero .lead { color: var(--muted); font-weight: 700; margin-top: 6px; }
.hero-pic { font-size: clamp(64px, 14vw, 110px); }
.hero-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px 14px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 700; }

.route { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step {
  position: relative;
  display: grid; gap: 6px; align-content: start;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 2px solid transparent;
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
}
.step .num {
  width: 38px; height: 38px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--m-soft); color: var(--m-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
}
.step .num svg { width: 22px; height: 22px; }
.step h3 { font-size: 1.12rem; margin-top: 4px; }
.step .zh { font-weight: 800; }
.step .meta { color: var(--muted); font-size: .85rem; font-weight: 700; }
.step.next { border-color: var(--m); }
.step.next::after {
  content: "下一步"; position: absolute; top: 14px; right: 14px;
  font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--m); color: var(--m-on);
}
.step.done { background: var(--surface-2); box-shadow: none; }
.step.done .num { background: var(--leaf); color: var(--on-accent); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .d { display: grid; justify-items: center; gap: 6px; font-size: .8rem; font-weight: 800; color: var(--muted); }
.week .dot {
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  border: 2px dashed var(--line); background: transparent;
}
.week .dot svg { width: 22px; height: 22px; }
.week .part .dot { border-style: solid; border-color: var(--sun); background: var(--sun-soft); }
.week .full .dot { border: 0; background: var(--leaf); color: var(--on-accent); }
.week .today { color: var(--ink); }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--sun-soft); color: var(--ink); font-weight: 600;
}
.notice a { font-weight: 800; }

/* ---------- 活动舞台（跟我说 / 磨耳朵 / 今日路线共用） ---------- */
.stage { display: grid; gap: 16px; justify-items: center; text-align: center; padding: 26px 20px; }
.stage-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots i { width: 12px; height: 12px; border-radius: 999px; background: var(--track); }
.dots i.on { background: var(--m); }
.dots i.cur { background: var(--m); box-shadow: 0 0 0 4px var(--m-soft); }
.stage-body { width: 100%; display: grid; gap: 16px; }
.col-pic, .col-act { display: grid; gap: 14px; justify-items: center; align-content: center; min-width: 0; }
@media (min-width: 820px) {
  .stage-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 28px; }
}
.pic-stage {
  width: min(100%, 380px); aspect-ratio: 4 / 3; max-width: 100%;
  border-radius: var(--r-xl);
  background: var(--m-soft);
  display: grid; place-items: center;
  border: 0; padding: 0;
}
.zh-hint { color: var(--muted); font-weight: 800; font-size: 1.05rem; }
.stage-nav { width: 100%; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stage-nav .btn:only-child { margin-left: auto; }

.bubble {
  position: relative; max-width: 100%;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  padding: 14px 18px; border-radius: 24px;
  background: var(--surface-2); text-align: left;
}
.bubble .who { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); width: 100%; text-align: center; }
.bubble.answer { background: var(--m-soft); }
.mode-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--m-soft); color: var(--ink); font-weight: 800; font-size: .85rem; }

/* 录音组件 */
.rec { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
.mic {
  width: 92px; height: 92px; border-radius: 999px; border: 0;
  background: var(--coral); color: var(--on-accent);
  display: grid; place-items: center;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--coral) 60%, #000);
  position: relative; flex: none;
}
.mic svg { width: 42px; height: 42px; }
.mic:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--coral) 60%, #000); }
.mic.recording::before {
  content: ""; position: absolute; inset: -8px; border-radius: 999px;
  border: 4px solid var(--coral); animation: pulse 1.1s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.rec-side { display: grid; gap: 10px; justify-items: start; text-align: left; min-width: 0; }
.rec-status { font-weight: 800; }
@keyframes pop { from { transform: scale(.3); } 70% { transform: scale(1.2); } to { transform: scale(1); } }

/* 进度条（看到第几集、学到第几课） */
.bar-track { display: block; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: var(--m, var(--sky)); }
.prog-line { font-weight: 800; }
.prog-line b { font-family: var(--font-display); font-size: 1.3em; font-variant-numeric: tabular-nums; }

/* 今天 · 我学到哪里了 */
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.progress-card { display: grid; gap: 12px; align-content: start; }
.progress-card h3 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; color: var(--m-ink); }
.progress-card h3 svg { width: 24px; height: 24px; }
.prog-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; text-decoration: none; color: var(--ink); }
.prog-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
.prog-name { font-weight: 800; overflow-wrap: anywhere; }
.prog-num { color: var(--muted); font-size: .85rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson-dots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.lesson-dots i { aspect-ratio: 1; max-width: 100%; border-radius: 8px; background: var(--track); }
.lesson-dots i.on { background: var(--m); }

/* 看动画 */
.art { border-radius: 14px; display: grid; place-items: center; max-width: 100%; }
.tone-sky   { background: linear-gradient(180deg, var(--sky-soft), var(--surface-2)); }
.tone-sun   { background: linear-gradient(180deg, var(--sun-soft), var(--surface-2)); }
.tone-leaf  { background: linear-gradient(180deg, var(--leaf-soft), var(--surface-2)); }
.tone-berry { background: linear-gradient(180deg, var(--coral-soft), var(--surface-2)); }
.tone-grape { background: linear-gradient(180deg, var(--grape-soft), var(--surface-2)); }
.continue-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
  text-decoration: none; color: var(--ink); border: 3px solid var(--m);
}
.continue-card .art { width: 120px; aspect-ratio: 1; }
.continue-text { display: grid; gap: 2px; min-width: 0; }
.continue-text b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; }
.continue-text span:last-child { color: var(--muted); font-weight: 700; }
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.series-card {
  display: grid; gap: 8px; align-content: start; padding: 12px 12px 16px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.series-card .art { aspect-ratio: 4 / 3; }
.series-card h3 { font-size: 1.15rem; }
.meta { color: var(--muted); font-size: .85rem; font-weight: 700; }
.stage-title { font-size: 1.1rem; margin-top: 6px; }
.backup-note { color: var(--muted); font-weight: 800; font-size: .9rem; margin-top: 4px; }
.rec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.rec-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
}
.rec-item .art { width: 72px; aspect-ratio: 1; }
.rec-main { display: grid; gap: 6px; min-width: 0; }
.rec-main h4 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.rec-main p { color: var(--muted); font-size: .92rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: .75rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag-ok { background: var(--leaf-soft); color: var(--leaf); }
.tag-cur { background: var(--grape-soft); color: var(--grape); }
a.link { font-weight: 800; color: var(--m-ink, var(--sky)); text-decoration: none; }
a.link svg { width: 16px; height: 16px; vertical-align: -2px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ep-tile {
  display: grid; justify-items: center; gap: 2px; padding: 14px 6px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); border: 3px solid transparent;
}
.ep-tile b { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ep-tile span { font-size: .78rem; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.ep-tile span svg { width: 14px; height: 14px; }
.ep-tile.seen { background: var(--m-soft); box-shadow: none; }
.ep-tile.seen span { color: var(--m-ink); }
.ep-tile.next { border-color: var(--m); }

.watch { display: grid; gap: 14px; }
.player-wrap { position: relative; }
.player { display: block; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; max-height: 62vh; border: 0; border-radius: var(--r-lg); background: #000; }
.listen-cover {
  position: absolute; inset: 0; border-radius: var(--r-lg);
  display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 16px;
  background: var(--grape-soft); color: var(--ink);
}
.listen-cover p { color: var(--muted); font-weight: 700; }
.watch-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.watch-title { display: grid; gap: 2px; min-width: 0; }
.watch-title h2 { font-size: 1.35rem; }
.watch-hint { font-size: .88rem; }
.ep-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.ep {
  flex: none; width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); font-weight: 800; font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
}
.ep svg { width: 20px; height: 20px; }
.ep.seen { background: var(--m-soft); border-color: transparent; color: var(--m-ink); }
.ep.cur { border-color: var(--m); box-shadow: 0 0 0 3px var(--m-soft); }
.tips { display: grid; gap: 8px; padding-left: 1.2em; margin: 0; }

/* 跟我说 · 课程表 */
.lesson-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lesson-tile {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 16px 10px 14px; text-align: center;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); border: 3px solid transparent;
}
.lesson-tile .num {
  position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums;
}
.lesson-tile .num svg { width: 18px; height: 18px; }
.lesson-tile b { font-family: var(--font-learn); font-size: 1.1rem; line-height: 1.25; }
.lesson-tile.done { background: var(--m-soft); box-shadow: none; }
.lesson-tile.done .num { background: var(--m); color: var(--m-on); }
.lesson-tile.next { border-color: var(--m); }
.lesson-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lesson-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .88rem;
}
.lesson-chip svg { width: 16px; height: 16px; }
.lesson-chip.done { background: var(--leaf-soft); color: var(--ink); }

/* 磨耳朵 */
.options { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .options { max-width: 860px; grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.option {
  aspect-ratio: 1; max-width: 100%;
  border-radius: var(--r-xl); border: 3px solid var(--line); background: var(--surface);
  display: grid; place-items: center; padding: 8px;
  transition: transform .15s, border-color .15s, background .15s;
}
.option:active { transform: scale(.97); }
.option.right { border-color: var(--leaf); background: var(--leaf-soft); animation: pop .4s; }
.option.wrong { border-color: var(--coral); animation: shake .4s; opacity: .55; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.hub-card { display: grid; gap: 10px; align-content: start; padding: 20px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.hub-card .art { border-radius: var(--r-lg); background: var(--m-soft); padding: 18px; }
.hub-card h3 { font-size: 1.3rem; }
.hub-card p { color: var(--muted); }
.hub-card .meta { color: var(--m-ink); }

/* 完成 */
.done-panel { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 30px 20px; }
.done-panel .badge { width: 96px; height: 96px; border-radius: 999px; display: grid; place-items: center; background: var(--leaf); color: var(--on-accent); }
.done-panel .badge svg { width: 56px; height: 56px; }
.done-panel h2 { font-size: 1.8rem; }

/* 贴纸墙 */
.sticker-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.sticker {
  aspect-ratio: 1; max-width: 100%; border-radius: 26px; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow); font-family: var(--font-emoji); font-size: 48px;
}
.sticker.locked { background: var(--surface-2); box-shadow: none; color: var(--muted); font-family: var(--font-display); font-size: 28px; font-weight: 800; }

/* 遮罩 / 庆祝 / 提示 */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  display: grid; place-items: center; padding: 16px;
}
.celebrate { position: relative; overflow: hidden; width: min(440px, 100%); }
.celebrate .sticker-big { font-family: var(--font-emoji); font-size: 120px; line-height: 1; animation: pop .6s ease-out; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.6s linear forwards; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: .2; } }
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 800; box-shadow: var(--shadow);
}

/* 家长中心 */
.parent-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: var(--r-lg); padding: 14px 16px; }
.kpi b { display: block; font-family: var(--font-display); font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-weight: 700; font-size: .85rem; }
.chart { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 200px; padding: 18px 4px 0; border-bottom: 1px solid var(--line); }
.chart .goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--line); pointer-events: none; }
.chart .goal span { position: absolute; right: 0; top: -22px; font-size: .75rem; font-weight: 800; color: var(--muted); background: var(--surface); padding: 0 4px; }
.chart .col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; border: 0; background: none; padding: 0; }
.chart .bar { width: min(36px, 70%); border-radius: 4px 4px 0 0; background: var(--sky); min-height: 2px; }
.chart .col.today .bar { background: var(--sky); }
.chart .col:not(.today) .bar { background: color-mix(in srgb, var(--sky) 55%, var(--track)); }
.chart .val { position: absolute; bottom: calc(var(--h) + 6px); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart .tip {
  position: absolute; bottom: calc(var(--h) + 30px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--bg);
  font-size: .78rem; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2;
}
.chart .col:hover .tip, .chart .col:focus-visible .tip { opacity: 1; }
.chart-x { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 6px 4px 0; text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.theme-rows { display: grid; gap: 12px; }
.theme-row { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.theme-row .name { font-weight: 800; }
.theme-row .nums { color: var(--muted); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; font-weight: 800; color: var(--muted); }
.theme-row .bar-track { --m: var(--grape); }

/* 视频管理 */
.series-edit { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.series-edit summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  list-style: none; color: var(--ink); font-weight: 700;
}
.series-edit summary::-webkit-details-marker { display: none; }
.series-edit summary .pic { font-size: 34px; }
.se-title { flex: 1; min-width: 160px; }
.series-edit[open] summary { border-bottom: 1px solid var(--line); }
.series-edit .form { padding: 16px; gap: 14px; }
textarea.input { min-height: 88px; padding: 10px 14px; width: 100%; resize: vertical; font-family: var(--font-ui); font-size: .95rem; }

/* 设备检查：状态同时用符号和颜色表示 */
.checks { display: grid; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; padding-top: 4px; }
.check-state {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 800; background: var(--surface-2); color: var(--muted);
}
.check-state[data-state="ok"] { background: var(--leaf); color: var(--on-accent); }
.check-state[data-state="warn"] { background: var(--sun); color: var(--on-sun); }
.check-state[data-state="info"] { background: var(--sky-soft); color: var(--sky); }
.check-main { display: grid; gap: 6px; min-width: 0; }
.check-main h3 { font-size: 1.05rem; }
.check-act:empty { display: none; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > label, .field > .label { font-weight: 800; }
.field .help { color: var(--muted); font-size: .85rem; }
.input, select.input {
  min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); max-width: 100%;
}
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 800;
}
.seg button[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); color: var(--on-accent); }
.danger { --m: var(--coral); }
.gate { max-width: 420px; margin: 0 auto; width: 100%; display: grid; gap: 16px; justify-items: center; text-align: center; }
.gate .q { font-family: var(--font-display); font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.gate .input { text-align: center; font-size: 1.6rem; width: 160px; }

@media (max-width: 560px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-pic { display: none; }
  .brand-name small { display: none; }
  .chip-timer .label-long { display: none; }
  .theme-row { grid-template-columns: minmax(0, 1fr) auto; }
  .theme-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .continue-card { grid-template-columns: auto minmax(0, 1fr); }
  .continue-card .art { width: 80px; }
  .continue-card .btn { grid-column: 1 / -1; }
  .stage { padding: 20px 14px; }
}
@media (max-width: 640px) {
  .route { grid-template-columns: minmax(0, 1fr); }
  .lesson-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .pic-stage { aspect-ratio: 16 / 10; }
  .step.next::after { top: 10px; right: 10px; }
  .watch-bar .row { width: 100%; }
  .watch-bar .btn-lg { flex: 1; }
}

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

/* 首次使用：三步家庭准备。 */
.guide-open { overflow: hidden; }
.onboarding-dialog {
  width: min(440px, 100%); max-height: 88vh; max-height: 88dvh;
  overflow-y: auto; display: grid; gap: 14px;
}
.onboarding-dialog h2 { font-size: 1.5rem; }
.onboarding-dialog > .btn { width: 100%; }
.guide-art { font-size: 58px; text-align: center; }
.guide-dots { display: flex; gap: 8px; }
.guide-dots span { width: 32px; height: 6px; border-radius: 99px; background: var(--line); }
.guide-dots .current { background: var(--sky); }
.guide-dots .done { background: var(--leaf); }
.onboarding-banner { display: grid; gap: 10px; border: 2px solid var(--sky); }

/* 只压缩手机首页；平板和电脑沿用原布局。 */
@media (max-width: 480px) {
  #view.home-view { gap: 12px; padding-top: 12px; }
  .home-view > section { order: 2; }
  .home-view > .hero { order: 0; gap: 10px; padding: 16px; }
  .home-view > .home-route { order: 1; gap: 10px; }
  .home-view > .notice { order: 3; }
  .home-view .hero h1 { font-size: 1.45rem; margin-top: 5px; overflow-wrap: anywhere; }
  .home-view .hero .lead { font-size: .8rem; line-height: 1.4; }
  .home-view .hero-actions { gap: 8px; }
  .home-view .hero-actions .btn { min-height: 44px; font-size: .9rem; padding: 0 16px; }
  .home-view .stats { gap: 8px; }
  .home-view .stat { padding: 9px 6px; text-align: center; border-radius: 14px; min-width: 0; }
  .home-view .stat b { font-size: 1.25rem; white-space: nowrap; }
  .home-view .stat span { display: block; margin-top: 3px; font-size: .74rem; line-height: 1.3; white-space: nowrap; }
  .home-view .home-route .section-head h2 { font-size: 1.15rem; }
  .home-view .home-route .section-head p { font-size: .76rem; }
  .home-view .route { gap: 10px; }
  .home-view .step { grid-template-columns: 32px minmax(0, 1fr); gap: 4px 10px; padding: 12px; }
  .home-view .step .num { grid-row: 1 / 4; width: 32px; height: 32px; }
  .home-view .step h3 { margin: 0; padding-right: 60px; font-size: 1rem; }
  .home-view .step .meta { grid-column: 2; font-size: .75rem; line-height: 1.4; overflow-wrap: anywhere; }
  .home-view .step .meta:not(:last-child) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .onboarding-dialog { padding: 20px; gap: 12px; }
}
