/* ═══════════════════════════════════════════════
   app.css — 学习平台 · 统一样式（Phase 1，按电脑浏览器设计）
   - 基础字号 20px，正文/按钮都比原来大
   - 宽屏：内容最宽 1280px，主题课左侧天数导航 + 右侧正文
   - 生字、课文、古诗用楷体（和课本字形一致，孩子照着写不走样）
   主题色由 engine.js 在运行时写入 --theme-*
   ═══════════════════════════════════════════════ */

:root {
  --bg: #f6f0e4;            /* 竹简米 */
  --card: #ffffff;
  --text: #2b2a33;
  --muted: #625d70;
  --line: #ece5d8;
  --brand: #3e654c;         /* 竹青：品牌主色（按钮、链接、logo 印章） */
  --coral: var(--brand);    /* 旧名字，等同品牌色 */
  --rec: #b8322a;           /* 录音按钮保留红色：大家熟悉的"正在录" */
  --sunny: #ffb703;
  --mint: #067e57;
  --sky: #3b82f6;
  --parent: #fff4d6;
  --parent-line: #f3d37a;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(43,42,51,0.06), 0 1px 2px rgba(43,42,51,0.04);

  --theme-primary: #3e654c;
  --theme-light: #e8edea;
  --theme-border: #bbc9c0;
  --theme-mid: #789382;
  --theme-bg: #f5f7f6;

  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "BiauKai", "Songti SC", serif;
}

html { font-size: 20px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
/* 带 hidden 属性的元素一律不显示（按钮类的 display 样式会盖过浏览器默认的 hidden） */
[hidden] { display: none !important; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-width: 1024px;           /* 按电脑浏览器设计 */
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
/* 键盘焦点：用主题色画一圈，孩子和家长用 Tab 时看得清现在在哪 */
:focus-visible { outline: 3px solid var(--theme-primary); outline-offset: 3px; }
::selection { background: var(--theme-light); color: var(--text); }

/* ── 顶栏 ─────────────────────────────────── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--coral);
  color: #fff; display: grid; place-items: center; font-family: var(--font-kai); font-size: 1.3rem;
}
.topbar-spacer { flex: 1; }
.topbar-user { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 14px; }

.shell { max-width: 1280px; margin: 0 auto; padding: 32px 32px 80px; }

/* ── 按钮 ─────────────────────────────────── */
.btn-primary, .btn-soft, .btn-ghost, .btn-rec {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; font-weight: 700; text-decoration: none; transition: all .15s;
  border: 2px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--coral); color: #fff; padding: 12px 26px; font-size: 1rem; }
.btn-primary:hover { filter: brightness(0.95); transform: translateY(-1px); }
.btn-primary.big { padding: 16px 36px; font-size: 1.1rem; }
.btn-primary.done { background: var(--mint); }
.btn-soft { background: var(--theme-light); color: var(--theme-primary); padding: 9px 18px; font-size: 0.9rem; border-color: var(--theme-border); }
.btn-soft:hover:not(:disabled) { background: var(--theme-border); }
.btn-soft.sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-ghost { background: transparent; color: var(--muted); padding: 10px 20px; font-size: 0.9rem; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-rec { background: #fff; color: var(--rec); border-color: var(--rec); padding: 9px 18px; font-size: 0.9rem; }
.btn-rec:hover { background: #fff1ee; }
.btn-rec.recording { background: var(--rec); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,56,40,.45); } 50% { box-shadow: 0 0 0 10px rgba(201,56,40,0); } }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.btn-row.center { justify-content: center; }
.mini-speak {
  border: none; background: var(--theme-light); color: var(--theme-primary);
  border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; vertical-align: middle;
  position: relative;
}
/* 小喇叭看起来小，能点的范围放大到 44px 以上，孩子不用瞄准 */
.mini-speak::after { content: ""; position: absolute; inset: -10px -6px; }
.mini-speak:hover { background: var(--theme-border); }
.link-btn { background: none; border: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 0.85rem; padding: 10px 4px; }

/* ── 通用卡片 ─────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.card h2 { font-size: 1.3rem; margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.empty-note { color: var(--muted); background: #faf8f4; border: 1px dashed var(--line); border-radius: 14px; padding: 18px 22px; font-size: 0.9rem; grid-column: 1 / -1; }

/* ── 表单（注册/登录）────────────────────── */
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 40px 0 24px; }
/* 注意：别用 vh 定高度——宽屏时 fit.js 会把整页放大（CSS zoom），vh 也被放大，内容就被推到屏幕下面去了 */
.auth-hero h1 { font-size: 2.4rem; line-height: 1.25; margin-bottom: 18px; }
.auth-hero h1 em { font-style: normal; color: var(--coral); }
.auth-hero p { font-size: 1.05rem; color: var(--muted); margin-bottom: 26px; }
.auth-points { list-style: none; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 14px; align-items: flex-start; font-size: 0.95rem; }
.auth-points .ap-icon { width: 44px; height: 44px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.auth-points b { display: block; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
.field input:focus { outline: none; border-color: var(--coral); }
.form-error { color: #b8322a; font-size: 0.85rem; min-height: 1.3em; margin-top: 10px; }
.form-switch { margin-top: 16px; text-align: center; font-size: 0.85rem; color: var(--muted); }
.form-switch a, .text-link { color: var(--coral); font-weight: 700; cursor: pointer; background: none; border: none; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; }

/* ── 选等级 ───────────────────────────────── */
.level-pick-head { text-align: center; margin-bottom: 30px; }
.level-pick-head h1 { font-size: 1.8rem; margin-bottom: 8px; }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.level-card {
  background: var(--card); border: 3px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 22px; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: all .15s;
}
.level-card:hover { border-color: #e3d9c6; transform: translateY(-2px); }
.level-card.current { border-color: var(--coral); }
.level-code { font-weight: 900; font-size: 1.6rem; color: var(--coral); }
.level-name { font-weight: 800; font-size: 1rem; }
.level-desc { color: var(--muted); font-size: 0.85rem; flex: 1; }
.level-sample { font-family: var(--font-kai); font-size: 1.35rem; background: #fdf9f1; border-radius: 12px; padding: 12px 14px; line-height: 1.5; }
.level-sample-q { font-size: 0.75rem; color: var(--muted); }
.level-sample-en { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.mini-speak { display: inline-block; cursor: pointer; padding: 0 4px; border-radius: 6px; }
.mini-speak:hover, .mini-speak:focus-visible { background: var(--tc-soft, #efe7d6); outline: none; }
.voice-tip { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fbf6ea; font-size: 0.85rem; line-height: 1.6; color: var(--muted); }
.bt-en { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.level-note { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 22px; }

/* ── 首页 Dashboard ──────────────────────── */
/* 左栏：问候 + 两个大 tab（主题学习 / 故事单元）；右栏：怎么用 + 学习记录 */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.dash-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center;
  background: linear-gradient(120deg, #fff 0%, #fff6e5 100%);
  border-radius: 24px; box-shadow: var(--shadow); padding: 28px 32px; margin-bottom: 26px;
}
.dash-hero h1 { font-size: 1.5rem; margin-bottom: 4px; white-space: nowrap; }
.dash-hero .level-line { white-space: nowrap; }
.dash-hero .level-line { color: var(--muted); }
.dash-hero .level-line b { color: var(--coral); }
.continue-box { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.continue-box .cont-label { font-size: 0.8rem; color: var(--muted); }
.continue-box .btn-primary.big { padding: 14px 26px; font-size: 1rem; }

/* 大 tab：和下面的面板连在一起，像文件夹标签 */
.main-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.main-tab {
  border: none; border-radius: 20px 20px 0 0; padding: 18px 0; font-size: 1.15rem; font-weight: 900;
  background: #efe8dc; color: var(--muted); transition: background .15s;
}
.main-tab small { font-size: 0.75rem; font-weight: 700; margin-left: 8px; background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.main-tab:hover:not(.active) { background: #e7ddcc; color: var(--text); }
.main-tab.active { background: var(--card); color: var(--text); box-shadow: 0 -4px 12px rgba(43,42,51,0.05); }
.main-panel { background: var(--card); border-radius: 0 0 24px 24px; box-shadow: var(--shadow); padding: 26px 28px 30px; }

.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.level-tabs { display: flex; gap: 6px; background: #f4efe6; padding: 5px; border-radius: 999px; flex-shrink: 0; }
.level-tab { border: none; background: transparent; padding: 10px 18px; border-radius: 999px; font-weight: 800; color: var(--muted); font-size: 0.85rem; }
.level-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.level-tab small { font-weight: 400; margin-left: 4px; font-size: 0.75rem; }

/* 大块主题卡（沿用 James 版的风格：顶部色条 + 大 emoji + 字预览 + 进度点） */
.big-topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.big-topic {
  position: relative; display: block; text-decoration: none; background: #fff;
  border-radius: 20px; padding: 24px 24px 22px; border-top: 7px solid var(--tc);
  box-shadow: 0 3px 14px rgba(43,42,51,0.08); transition: transform .15s, box-shadow .15s;
}
.big-topic:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(43,42,51,0.12); }
.bt-emoji { font-size: 2.6rem; line-height: 1; }
.bt-title { font-size: 1.25rem; font-weight: 900; margin-top: 14px; }
.big-topic { min-width: 0; }
.bt-preview { font-family: var(--font-kai); font-size: 1.1rem; color: var(--muted); letter-spacing: 1px; margin-top: 4px; line-height: 1.5; }
.bt-dots { display: flex; gap: 6px; margin-top: 16px; }
.bt-dots span { width: 14px; height: 14px; border-radius: 50%; background: #ebe6f0; }
.bt-dots span.on { background: var(--tc); }
.bt-badge { position: absolute; top: 16px; right: 16px; background: var(--sunny); color: #5a3d00; font-size: 0.75rem; font-weight: 900; padding: 3px 10px; border-radius: 99px; }
.bt-badge.done { background: var(--mint); color: #fff; }
.big-topic.pending { border-top-color: #e4ddd2; box-shadow: none; border: 2px dashed #ece5d8; border-top: 7px solid #e4ddd2; cursor: default; }
.big-topic.pending:hover { transform: none; box-shadow: none; }
.big-topic.pending .bt-emoji { filter: grayscale(0.6); opacity: .6; }
.big-topic.pending .bt-title { color: #a9a3b3; }
.bt-status { font-size: 0.75rem; color: var(--muted); margin-top: 16px; }

/* 故事单元大卡 */
.big-unit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.big-unit { display: flex; flex-direction: column; text-decoration: none; background: #fff; border-radius: 22px; padding: 26px 28px; border-top: 8px solid var(--tc); box-shadow: 0 3px 14px rgba(43,42,51,0.08); transition: transform .15s, box-shadow .15s; }
.big-unit:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(43,42,51,0.12); }
.bu-head { display: flex; gap: 16px; align-items: center; }
.bu-head .bt-title { margin-top: 0; font-size: 1.4rem; }
.big-unit { position: relative; }
.big-unit .bt-badge { top: 18px; right: 20px; }
.big-unit.is-soon { background: #fbf8f1; box-shadow: none; }
.big-unit.is-soon:hover { transform: none; box-shadow: none; }
.big-unit.is-soon .bt-emoji, .big-unit.is-soon .bu-desc { opacity: 0.75; }
.bu-days { font-size: 0.8rem; color: var(--muted); }
.bu-desc { font-size: 0.9rem; color: var(--muted); margin: 14px 0; }
.bu-list { display: flex; flex-wrap: wrap; gap: 6px; }
.bu-list span { font-size: 0.78rem; background: #f6f2ea; color: var(--muted); padding: 3px 10px; border-radius: 99px; }
.bu-list span.on { background: color-mix(in srgb, var(--tc) 16%, white); color: var(--tc); font-weight: 800; }
.big-unit .bt-dots span { width: 10px; height: 10px; }
.bu-go { margin-top: 18px; font-weight: 900; color: var(--tc); }

/* 右栏 */
.side-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px; }
.side-card h2, .side-card h3 { font-size: 1.05rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-card p { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.how-list { list-style: none; display: grid; gap: 10px; font-size: 0.85rem; }
.how-list li { display: flex; gap: 10px; }
.how-list .hn { width: 24px; height: 24px; border-radius: 50%; background: var(--sunny); color: #5a3d00; font-weight: 900; font-size: 0.75rem; display: grid; place-items: center; flex-shrink: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid div { background: #faf7f1; border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat-grid b { display: block; font-size: 1.5rem; font-weight: 900; color: var(--coral); line-height: 1.2; }
.stat-grid span { font-size: 0.75rem; color: var(--muted); }
.record-review { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 16px; }
.rr-title { font-weight: 900; margin-bottom: 6px; }

/* ── 主题课页面：左侧天数导航 + 右侧正文 ───── */
.topic-hero { background: var(--theme-primary); color: #fff; }
.topic-hero-inner { max-width: 1280px; margin: 0 auto; padding: 22px 32px; display: flex; align-items: center; gap: 18px; }
.topic-hero .th-emoji { width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 2rem; }
.topic-hero h1 { font-size: 1.6rem; line-height: 1.2; }
.topic-hero .th-level { font-size: 0.85rem; }
.th-en { display: block; font-size: 0.8rem; font-weight: 500; opacity: 0.85; }
.topic-hero .th-progress { margin-left: auto; width: 260px; }
.th-track { height: 10px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; }
.th-fill { height: 100%; width: 0; background: #fff; border-radius: 99px; transition: width .4s; }
.th-label { font-size: 0.8rem; margin-top: 6px; text-align: right; }

.topic-layout { max-width: 1280px; margin: 0 auto; padding: 28px 32px 80px; display: grid; grid-template-columns: 270px 1fr; gap: 32px; align-items: start; }
.day-sidebar { position: sticky; top: 90px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.day-sidebar-title { font-size: 0.75rem; font-weight: 800; color: var(--muted); letter-spacing: .08em; padding: 6px 10px 10px; }
.day-link {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; background: transparent; padding: 9px 10px; border-radius: 12px; font-size: 0.82rem; color: var(--text);
}
.day-link:hover { background: var(--theme-bg); }
.day-link.active { background: var(--theme-light); font-weight: 800; }
.dl-num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--theme-border); display: grid; place-items: center; font-weight: 800; font-size: 0.78rem; flex-shrink: 0; color: var(--theme-primary); background: #fff; }
.day-link.active .dl-num { background: var(--theme-primary); border-color: var(--theme-primary); color: #fff; }
.dl-title { flex: 1; line-height: 1.35; }
.dl-check { color: var(--mint); font-weight: 900; visibility: hidden; }
.day-link.done .dl-check { visibility: visible; }
.sidebar-foot { border-top: 1px solid var(--line); margin-top: 10px; padding: 12px 10px 4px; font-size: 0.75rem; color: var(--muted); }
.sidebar-foot a { color: var(--theme-primary); font-weight: 700; }

.day-panel { display: none; }
.day-panel.active { display: block; }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.day-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.day-kicker { font-size: 0.8rem; font-weight: 800; color: var(--theme-primary); letter-spacing: .05em; }
.day-title { font-size: 1.8rem; line-height: 1.3; margin: 4px 0 8px; }
.day-intro { color: var(--muted); font-size: 1rem; }

/* 家长卡 */
.parent-card { background: var(--parent); border: 2px solid var(--parent-line); border-radius: var(--radius); margin-bottom: 30px; overflow: hidden; }
.parent-card-head { display: flex; align-items: center; gap: 14px; padding: 14px 24px 10px; }
.parent-badge { background: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 900; font-size: 0.85rem; color: #8a5a00; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.parent-title { font-weight: 700; color: #6b4a00; font-size: 0.95rem; flex: 1; }
.parent-card-body { padding: 0 28px 22px; }
/* 家长卡简洁版：只露出目标 + 前 3 条，其余点"看完整家长卡"再展开 */
.parent-card .more { display: none; }
.parent-card.expanded .more { display: block; }
.parent-more { margin-top: 10px; border: none; background: none; padding: 10px 0; color: #8a5a00; font-weight: 800; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; }
.parent-goal { background: rgba(255,255,255,.7); border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; font-size: 0.9rem; }
.parent-goal b { color: #8a5a00; margin-right: 10px; }
/* 只给"步骤"编号，"→ 孩子的回答"那几行不占号 */
.parent-script { list-style: none; counter-reset: pstep; display: grid; gap: 8px; font-size: 0.95rem; }
.parent-script li { position: relative; padding-left: 2em; }
.parent-script li:not(.answer) { counter-increment: pstep; }
.parent-script li:not(.answer)::before {
  content: counter(pstep); position: absolute; left: 0; top: 0.1em;
  width: 1.4em; height: 1.4em; border-radius: 50%; background: #fff; color: #8a5a00;
  font-size: 0.8em; font-weight: 800; display: grid; place-items: center;
}
.parent-script li.say { font-weight: 700; color: #3b2f12; }
.parent-script li.answer { color: #7c6b47; font-size: 0.88rem; margin-top: -4px; }
.parent-tip { margin-top: 16px; font-size: 0.85rem; color: #7a5b16; border-top: 1px dashed var(--parent-line); padding-top: 12px; }

.kid-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; font-size: 1.15rem; font-weight: 900; }
.kid-time { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

/* 孩子任务卡 */
.section-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.section-header { display: flex; align-items: center; gap: 14px; padding: 18px 26px 0; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--theme-light); color: var(--theme-primary); font-weight: 900; display: grid; place-items: center; font-size: 0.85rem; flex-shrink: 0; }
.section-header h2, .section-header h3 { font-size: 1.12rem; flex: 1; }
.time-badge { font-size: 0.75rem; color: var(--muted); background: #f6f2ea; padding: 3px 12px; border-radius: 999px; }
.sec-check { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: transparent; font-weight: 900; }
.sec-check:hover { border-color: var(--mint); }
.sec-check.checked { background: var(--mint); border-color: var(--mint); color: #fff; }
.section-body { padding: 16px 26px 26px 72px; }
.sec-intro { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.sec-note { color: var(--muted); font-size: 0.8rem; margin-top: 12px; }
.sec-question { margin-top: 14px; font-size: 0.95rem; }
.en-hint { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

.warmup-list { list-style: none; display: grid; gap: 10px; }
.warmup-list li { font-size: 1.05rem; display: flex; gap: 10px; align-items: center; }

.diagram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.diagram-item { background: var(--theme-bg); border-radius: 14px; padding: 16px 18px; }
.d-emoji { font-size: 2rem; }
.d-label { font-weight: 800; margin-top: 4px; }
.d-desc { color: var(--muted); font-size: 0.85rem; }

.fun-box { background: #fff9e8; border-radius: 14px; padding: 14px 18px; margin-top: 16px; font-size: 0.9rem; }
.fun-box p + p { margin-top: 8px; }

/* 生字卡 */
.flashcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.flashcard-grid.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.card-cell { display: flex; flex-direction: column; gap: 8px; }
.flashcard { perspective: 800px; height: 190px; cursor: pointer; display: block; width: 100%; border: none; background: none; padding: 0; color: inherit; border-radius: 16px; }
.flashcard-inner, .flashcard .char, .flashcard .hint, .flashcard .pinyin, .flashcard .meaning { display: block; }
.flashcard-grid.small .flashcard { height: 150px; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px;
}
/* 翻到一半（.45s 的一半）时直接切换显示哪一面：Safari 有时不认 backface-visibility，背面会镜像透出来，这样哪个浏览器都可靠 */
.flashcard-front, .flashcard-back { transition: visibility 0s linear .22s; }
.flashcard-back, .flashcard.flipped .flashcard-front { visibility: hidden; }
.flashcard.flipped .flashcard-back { visibility: visible; }
.flashcard-front { transform: rotateY(0deg); background: #fff; border: 3px solid var(--theme-border);
  background-image: linear-gradient(var(--theme-light) 1px, transparent 1px), linear-gradient(90deg, var(--theme-light) 1px, transparent 1px);
  background-size: 50% 50%; background-position: center; }
.flashcard-back { background: var(--theme-primary); color: #fff; transform: rotateY(180deg); }
.flashcard .char { font-family: var(--font-kai); font-size: 5.2rem; line-height: 1; color: var(--text); }
.flashcard-grid.small .flashcard .char { font-size: 3.8rem; }
.flashcard-back .char.sm { font-size: 2.4rem; color: #fff; }
.flashcard .hint { font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.flashcard .pinyin { font-size: 1.3rem; font-weight: 800; margin-top: 6px; }
.flashcard .meaning { font-size: 0.8rem; margin-top: 4px; line-height: 1.4; }
.card-actions { display: flex; gap: 6px; }
.card-actions button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 44px; padding: 6px 0; font-size: 0.8rem; color: var(--muted); }
.card-actions button:hover { border-color: var(--theme-mid); color: var(--theme-primary); }

/* 写字 */
.writing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.writing-card { background: var(--theme-bg); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hw-canvas { width: 120px; height: 120px; background: #fff; border: 2px solid var(--theme-border); border-radius: 10px; display: grid; place-items: center;
  background-image: linear-gradient(var(--theme-light) 1px, transparent 1px), linear-gradient(90deg, var(--theme-light) 1px, transparent 1px);
  background-size: 50% 50%; background-position: center; }
.w-char { font-family: var(--font-kai); font-size: 4.2rem; line-height: 1; }
.w-pinyin { font-weight: 800; color: var(--theme-primary); }
.write-count { display: flex; gap: 8px; }
.write-box { width: 44px; height: 44px; border: 2px solid var(--theme-border); border-radius: 8px; background: #fff; cursor: pointer; display: grid; place-items: center; font-weight: 900; color: #fff; }
.write-box.done-box { background: var(--mint); border-color: var(--mint); }
.challenge-chars { font-family: var(--font-kai); font-size: 2.6rem; letter-spacing: 18px; text-align: center; color: var(--theme-primary); background: var(--theme-bg); border-radius: 16px; padding: 18px; }

/* 小测验 */
.quiz-card { background: var(--theme-bg); border-radius: 18px; padding: 24px 28px; text-align: center; max-width: 720px; }
.quiz-wrap + .quiz-wrap, .flashcard-grid + .quiz-wrap { margin-top: 22px; }
.quiz-progress { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.q-kind { font-weight: 800; margin: 6px 0 14px; }
.q-char { font-family: var(--font-kai); font-size: 6rem; line-height: 1.1; margin-bottom: 12px; }
.q-listen { border: none; background: var(--theme-primary); color: #fff; font-size: 1.1rem; font-weight: 800; padding: 16px 34px; border-radius: 999px; margin-bottom: 18px; }
.quiz-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quiz-opt { background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 14px 8px; transition: all .12s; }
.quiz-opt:hover:not(.disabled) { border-color: var(--theme-mid); transform: translateY(-2px); }
.opt-char { font-family: var(--font-kai); font-size: 3.2rem; line-height: 1.1; }
.opt-py { font-size: 1.4rem; font-weight: 800; }
.quiz-opt.disabled { cursor: default; }
.quiz-opt.correct { border-color: var(--mint); background: #e7f9f1; }
.quiz-opt.wrong { border-color: #ef6a6a; background: #fdecec; }
.quiz-result { min-height: 1.6em; margin-top: 14px; font-weight: 700; }
.quiz-result.pass { color: var(--mint); }
.quiz-result.fail { color: #b02f2f; }
.quiz-next { display: none; margin-top: 12px; }
.quiz-next.show { display: inline-flex; }
.quiz-final { background: var(--theme-bg); border-radius: 18px; padding: 26px; text-align: center; max-width: 720px; }
.quiz-final .score { font-size: 2.4rem; font-weight: 900; color: var(--theme-primary); }
.quiz-final p { margin: 6px 0 14px; color: var(--muted); }

/* 古诗 */
.poem-box { background: linear-gradient(160deg, #fffdf7, var(--theme-bg)); border: 2px solid var(--theme-border); border-radius: 20px; padding: 28px 30px; text-align: center; max-width: 720px; }
.poem-title { font-family: var(--font-kai); font-size: 1.8rem; font-weight: 700; margin-bottom: 14px; }
.poem-title span { font-size: 0.95rem; color: var(--muted); margin-left: 12px; font-family: var(--font-ui); font-weight: 400; }
.poem-pinyin-line { font-size: 0.9rem; color: var(--theme-primary); letter-spacing: 1px; }
.poem-line { font-family: var(--font-kai); font-size: 2.3rem; letter-spacing: 8px; margin-bottom: 8px; }
.poem-meaning { display: none; margin-top: 16px; background: #fff; border-radius: 14px; padding: 14px 18px; text-align: left; font-size: 0.95rem; }
.poem-meaning.show { display: block; }

/* 故事/课文 */
.story-box { background: #fffdf8; border: 2px solid var(--line); border-radius: 20px; padding: 26px 30px; max-width: 820px; }
.story-title { font-family: var(--font-kai); font-size: 1.7rem; font-weight: 700; }
.source-note { font-size: 0.75rem; color: var(--muted); margin: 4px 0 14px; }
.story-body p { font-family: var(--font-kai); font-size: 1.75rem; line-height: 2.3; margin-bottom: 6px; }
.story-body ruby rt { font-family: var(--font-ui); font-size: 0.5em; color: var(--theme-primary); }
.listen-only-note { font-size: 0.85rem; color: var(--muted); margin-top: 12px; }
.qa-item { margin-top: 16px; padding: 14px 18px; background: var(--theme-bg); border-radius: 14px; max-width: 820px; }
.qa-q { font-weight: 700; font-size: 1.05rem; }
.qa-reveal-btn { border: none; background: none; color: var(--theme-primary); font-weight: 700; font-size: 0.85rem; margin-top: 0; padding: 10px 0; }
.qa-answer { display: none; margin-top: 6px; font-size: 1rem; }
.qa-answer.show { display: block; }
.english-parallel { margin-top: 16px; background: #eef5ff; border-radius: 14px; padding: 14px 18px; max-width: 820px; font-size: 0.88rem; }
.ep-label { font-weight: 800; color: #2d5fb3; font-size: 0.78rem; }
.ep-title { font-weight: 800; margin-top: 4px; }

.idiom-card { background: var(--theme-bg); border-radius: 16px; padding: 18px 22px; margin-bottom: 14px; }
.idiom-char { font-family: var(--font-kai); font-size: 2.2rem; letter-spacing: 6px; }
.idiom-pinyin { color: var(--theme-primary); font-weight: 700; }
.idiom-example { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* 开口说 */
.speak-list { display: grid; gap: 14px; }
.speak-item { background: var(--theme-bg); border: 2px solid var(--theme-border); border-radius: 16px; padding: 18px 22px; }
.speak-text { font-family: var(--font-kai); font-size: 2rem; line-height: 1.4; }
.speak-pinyin { color: var(--theme-primary); font-size: 0.9rem; margin-top: 2px; }
.speak-item .btn-row { margin-top: 12px; }
.rec-note { font-size: 0.8rem; color: var(--muted); margin-top: 8px; min-height: 1.2em; }
.talk-box { margin-top: 18px; background: #fff9e8; border-radius: 16px; padding: 16px 22px; }
.talk-title { font-weight: 900; margin-bottom: 8px; }
.talk-box ul { padding-left: 1.2em; display: grid; gap: 8px; }

/* 完成今天 */
.day-complete { text-align: center; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 32px; margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dc-emoji { font-size: 3rem; }
.day-complete h2, .day-complete h3 { font-size: 1.4rem; }
.day-complete p { color: var(--muted); max-width: 640px; }

/* 笔顺弹窗 */
.stroke-modal { display: none; position: fixed; inset: 0; background: rgba(30,28,40,.55); z-index: 1000; align-items: center; justify-content: center; }
.stroke-modal.open { display: flex; }
.stroke-modal-box { background: #fff; border-radius: 24px; padding: 28px 36px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.stroke-modal-box h3 { font-size: 1rem; color: var(--muted); margin-bottom: 14px; }
.stroke-modal-box h3 b { font-family: var(--font-kai); font-size: 1.6rem; color: var(--text); margin-left: 6px; }
#strokeCanvas { width: 260px; height: 260px; margin: 0 auto 18px; border: 2px solid var(--theme-border); border-radius: 16px;
  background-image: linear-gradient(var(--theme-light) 1px, transparent 1px), linear-gradient(90deg, var(--theme-light) 1px, transparent 1px);
  background-size: 50% 50%; background-position: center; }

#loadingMsg, #errorMsg { text-align: center; padding: 80px 20px; color: var(--muted); grid-column: 1 / -1; }
#errorMsg { display: none; }
#errorMsg a { color: var(--coral); font-weight: 700; }

/* ── 减少动画（系统设置里打开"减少动态效果"的孩子/家长）──
   状态变化照样有：卡片直接翻到背面、录音按钮照样变成"说完了，停"，只是不转、不跳、不闪 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
  .btn-rec.recording { animation: none; box-shadow: 0 0 0 4px rgba(201,56,40,.25); }
  .btn-primary:hover, .level-card:hover, .big-topic:hover, .big-unit:hover, .quiz-opt:hover:not(.disabled) { transform: none; }
}

/* ═══ 孩子模式（js/kid-mode.js）══════════════════════
   家长卡之后孩子一个人做：一屏一个环节，顶部步骤条，底部上一步/下一步。
   隐藏整页里给家长看的东西（主题横幅、10 天导航、家长卡、完成区）。 */
.sec-say { border: none; background: var(--theme-light); color: var(--theme-primary); border-radius: 999px; padding: 10px 16px; font-weight: 800; font-size: 0.8rem; white-space: nowrap; }
.sec-say:hover { background: var(--theme-border); }
.section-header h3:focus { outline: none; }

body.kid-mode .topic-hero,
body.kid-mode .day-head,
body.kid-mode .parent-card,
body.kid-mode .kid-head,
body.kid-mode .day-complete { display: none; }
/* 闯关时左边 10 天导航收起来（顶栏里点"第 N 天 ▾"展开），每一关占满整个宽度 */
body.kid-mode .day-sidebar { display: none; }
body.kid-mode .topic-layout { grid-template-columns: 1fr; padding-top: 18px; padding-bottom: 150px; }
/* 整页里各关的完整内容都藏着，只在孩子模式里一次显示一关 */
.day-panel > .section-card { display: none; }
body.kid-mode .level-list { display: none; }
body.kid-mode .day-panel.active .section-card.kid-current { display: block; border-left: none; margin: 0; min-height: 560px; }
body.kid-mode .section-card .step-num,
body.kid-mode .section-card .sec-check { display: none; }
body.kid-mode .section-header { padding: 28px 40px 0; }
body.kid-mode .section-header h3 { font-size: 1.6rem; }
body.kid-mode .section-body { padding: 20px 40px 36px; }
body.kid-mode .sec-intro { font-size: 1.05rem; }
/* 一屏只有一个环节，生字卡可以更大 */
body.kid-mode .flashcard-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
body.kid-mode .flashcard { height: 230px; }
body.kid-mode .flashcard .char { font-size: 6.4rem; }
body.kid-mode .flashcard-grid.small .flashcard { height: 190px; }
body.kid-mode .flashcard-grid.small .flashcard .char { font-size: 4.8rem; }
body.kid-mode .quiz-card, body.kid-mode .quiz-final, body.kid-mode .poem-box, body.kid-mode .story-box { max-width: none; }

.section-card.kid-enter { animation: kid-in .32s cubic-bezier(.16, 1, .3, 1); }
@keyframes kid-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* 顶部步骤条：钉在顶栏下面 */
.kid-bar { position: sticky; top: 0; z-index: 40; background: var(--card); border-bottom: 1px solid var(--line); }
body.kid-mode .kid-bar { order: -1; }
.kid-bar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 32px; display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 24px; align-items: center; }
.kid-bar-inner .kb-parent { justify-self: end; }
.kid-nav-inner { max-width: 1280px; margin: 0 auto; padding: 12px 32px; }
.kn-main { display: flex; align-items: center; gap: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 顶栏中间：整个主题 10 天的进度，点一下展开 10 天列表 */
.kd-wrap { position: relative; }
.kd-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid transparent; background: none; border-radius: 16px; padding: 6px 18px; color: var(--text); }
.kd-btn:hover, .kd-btn[aria-expanded="true"] { background: var(--theme-bg); border-color: var(--theme-border); }
.kd-label { font-weight: 800; font-size: 0.95rem; }
.kd-caret { color: var(--theme-primary); }
.kd-dots { display: flex; gap: 7px; }
.kd-dot { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid #cfc5b4; }
.kd-dot.on { background: var(--theme-primary); border-color: var(--theme-primary); }
.kd-dot.half { background: linear-gradient(90deg, var(--sunny) 50%, #fff 50%); border-color: #c98f00; }
.kd-dot.now { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--theme-primary); }
.kd-panel { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: 420px; background: #fff; border-radius: 20px; box-shadow: 0 18px 50px rgba(43,42,51,.18); padding: 14px; z-index: 60; }
.kd-panel-head { font-size: 0.8rem; font-weight: 800; color: var(--muted); padding: 4px 10px 10px; }
.kd-panel ol { list-style: none; display: grid; gap: 4px; }
.kd-row { width: 100%; display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 12px; border: none; background: none; border-radius: 12px; padding: 10px 10px; text-align: left; color: var(--text); font-size: 0.95rem; }
.kd-row:hover, .kd-row:focus-visible { background: var(--theme-bg); }
.kd-row.now { background: var(--theme-light); font-weight: 800; }
.kd-num { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--theme-border); display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; color: var(--theme-primary); background: #fff; }
.kd-row.now .kd-num { background: var(--theme-primary); border-color: var(--theme-primary); color: #fff; }
.kd-tick { color: var(--mint); font-weight: 900; }

/* 今天的关卡条：紧贴在这一关内容上面（范围越小离内容越近） */
.kid-levels { display: flex; justify-content: center; margin: -18px -32px 16px; padding: 14px 32px 12px; position: sticky; top: 150px; z-index: 30; background: var(--bg); }
.kb-step.just button { animation: kb-star .8s cubic-bezier(.16, 1, .3, 1); }
.kb-step.just .kb-tick { animation: kc-pop .6s cubic-bezier(.16, 1, .3, 1) .1s both; }
@keyframes kb-star { 0% { transform: scale(1); } 35% { transform: scale(1.35); box-shadow: 0 0 0 10px var(--theme-light); } 100% { transform: scale(1.12); } }

/* "⭐ 过关！" */
.kid-toast { position: fixed; z-index: 70; transform: translateX(-50%); background: var(--theme-primary); color: #fff; font-size: 1.05rem; font-weight: 900; padding: 8px 18px; border-radius: 999px; box-shadow: 0 8px 20px rgba(43,42,51,.18); pointer-events: none; opacity: 0; white-space: nowrap; }
.kid-toast.show { animation: kid-toast 1.5s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes kid-toast { 0% { opacity: 0; transform: translate(-50%, -8px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.06); } 28% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -4px); } }

/* 闯关时"听说明"变成标题前面的大喇叭（进每一关也会自动读一遍） */
body.kid-mode .sec-say { order: -1; width: 56px; height: 56px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
body.kid-mode .sec-say .ss-icon { font-size: 1.5rem; }
body.kid-mode .sec-say .ss-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.kid-mode .section-header h3 { order: 0; }

/* 写字格：空格里有淡淡的铅笔，写好一个点一下；三个都点满，这个字冒一颗星 */
.write-hint { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
body.kid-mode .write-box { width: 56px; height: 56px; border-style: dashed; font-size: 1.3rem; }
.write-box:not(.done-box)::before { content: "✏️"; font-size: 1.1rem; opacity: .3; }
body.kid-mode .write-box.done-box { border-style: solid; animation: kc-pop .35s cubic-bezier(.16, 1, .3, 1); }
.writing-card { position: relative; }
.writing-card.all-done::after { content: "⭐"; position: absolute; top: -12px; right: -12px; font-size: 2rem; animation: kc-pop .6s cubic-bezier(.16, 1, .3, 1) both; }
body.kid-mode .writing-grid { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 22px; }
body.kid-mode .writing-card { padding: 20px 18px; }

/* 庆祝画面：今天拿到的星星 */
.kc-stars { font-size: 2rem; letter-spacing: 6px; margin-top: 4px; }
.kc-stars span { filter: grayscale(1); opacity: .25; }
.kc-stars span.on { filter: none; opacity: 1; }
.kb-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kb-title > span:last-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.kb-title b { color: var(--theme-primary); font-size: 1rem; }
.kb-title small { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-emoji { font-size: 1.6rem; }
.kb-steps { list-style: none; display: flex; align-items: center; flex: 1; justify-content: center; gap: 0; }
.kb-step { display: flex; align-items: center; }
.kb-step + .kb-step::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--line); margin: 0 4px; }
.kb-step.done + .kb-step::before { background: var(--theme-mid); }
.kb-step button, .kb-finish .kb-icon { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--line); background: #fff; display: grid; place-items: center; padding: 0; }
.kb-icon { font-size: 1.35rem; line-height: 1; }
.kb-finish .kb-icon { font-size: 1.2rem; opacity: .7; }
.kb-step.done button { border-color: var(--theme-mid); background: var(--theme-light); }
.kb-step.current button, .kb-finish.current .kb-icon { border-color: var(--theme-primary); box-shadow: 0 0 0 5px var(--theme-light); transform: scale(1.12); opacity: 1; }
.kb-step button { transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s; }
.kb-tick { position: absolute; right: -9px; bottom: -9px; font-size: 1.15rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.kb-parent { flex-shrink: 0; border: 2px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 10px 18px; font-size: 0.85rem; font-weight: 700; }
.kb-parent:hover { border-color: var(--muted); color: var(--text); }

/* 底部导航：始终看得见 */
.kid-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(43,42,51,.06); }
.kn-prev { border: 2px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 12px 24px; font-weight: 800; font-size: 0.95rem; }
.kn-prev:hover:not(:disabled) { border-color: var(--muted); color: var(--text); }
.kn-count { flex: 1; text-align: center; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.kn-next { min-width: 240px; font-size: 1.2rem; padding: 18px 40px; background: var(--theme-primary); }

/* 庆祝画面 */
.kid-celebrate { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 30px 48px 32px; text-align: center; }
.kc-burst { font-size: 3rem; line-height: 1; animation: kc-bounce .7s cubic-bezier(.16, 1, .3, 1); }
.kid-celebrate h2 { font-size: 2.1rem; margin: 8px 0 4px; outline: none; }
.kc-label { color: var(--muted); font-size: 1rem; }
.kc-chars { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 12px auto 22px; max-width: 900px; }
.kc-char { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 104px; height: 116px; border-radius: 18px; background: var(--theme-bg); border: 3px solid var(--theme-border);
  animation: kc-pop .55s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
.kc-char b { font-family: var(--font-kai); font-size: 3.9rem; line-height: 1.05; font-weight: 400; }
.kc-char small { font-size: 1rem; font-weight: 800; color: var(--theme-primary); }
.kc-progress p { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }
.kc-pills { display: flex; justify-content: center; gap: 8px; }
.kc-pill { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: #f4efe6; color: var(--muted); }
.kc-pill.on { background: var(--theme-primary); color: #fff; }
.kc-pill.now { animation: kc-pop .6s cubic-bezier(.16, 1, .3, 1) .5s both; box-shadow: 0 0 0 4px var(--theme-light); }
.kc-actions { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 30px; }
.kc-actions .btn-primary { background: var(--theme-primary); }
.kc-missed { margin: 14px auto 6px; max-width: 760px; background: #fff8e6; border-radius: 18px; padding: 14px 18px; }
.kc-missed p { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.kc-missed div { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kc-miss { border: 2px solid var(--theme-border); background: var(--theme-bg); color: var(--theme-primary); border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 0.9rem; }
@keyframes kc-pop { from { opacity: 0; transform: translateY(14px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes kc-bounce { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .section-card.kid-enter, .kc-burst, .kc-char, .kc-pill.now, .kb-step.just button, .kb-step.just .kb-tick,
  .write-box.done-box, .writing-card.all-done::after { animation: none; }
  .kid-toast.show { animation: none; opacity: 1; }
  .kb-step.current button { transform: none; }
}

/* ── 今天的 N 关（整页）：一关一行，点哪关从哪关开始 ── */
.level-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px 16px; }
.ll-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.ll-head h3 { font-size: 1.25rem; }
.ll-rows { list-style: none; display: grid; gap: 8px; }
.ll-row { width: 100%; display: grid; grid-template-columns: 68px 40px 1fr auto 34px 20px; align-items: center; gap: 12px;
  border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 18px; text-align: left; color: var(--text);
  transition: border-color .15s, background .15s; }
.ll-row:hover { border-color: var(--theme-border); background: var(--theme-bg); }
.ll-num { font-size: 0.85rem; font-weight: 800; color: var(--theme-primary); }
.ll-emoji { font-size: 1.5rem; line-height: 1; }
.ll-title { font-size: 1.05rem; font-weight: 700; }
.ll-time { font-size: 0.8rem; color: var(--muted); background: #f6f2ea; padding: 3px 12px; border-radius: 999px; }
.ll-tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); color: transparent; display: grid; place-items: center; font-weight: 900; font-size: 0.85rem; }
.ll-go { color: var(--muted); font-size: 1.4rem; line-height: 1; }
.ll-row.done .ll-tick { background: var(--mint); border-color: var(--mint); color: #fff; }
.ll-row.here { border-color: var(--theme-primary); box-shadow: 0 0 0 4px var(--theme-light); }
.ll-row.here .ll-title::after { content: "上次做到这里"; margin-left: 12px; font-size: 0.75rem; font-weight: 800; color: var(--theme-primary); background: var(--theme-light); padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
.ll-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 0.9rem; min-height: 44px; }
.ll-foot .link-btn { margin-left: auto; }

/* ── 首页：今天的课 + 上次做到哪 ── */
.today-btn { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 24px 14px 18px; }
.continue-box .btn-primary.big.today-btn { padding: 14px 24px 14px 18px; }
.tb-emoji { font-size: 2rem; line-height: 1; }
.tb-text { display: flex; flex-direction: column; line-height: 1.3; }
.tb-text b { font-size: 1.05rem; }
.tb-text small { font-size: 0.85rem; font-weight: 600; opacity: .95; }
.tb-go { font-size: 1.3rem; margin-left: 6px; }
.last-line { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
.last-line b { color: var(--text); margin-right: 8px; }
.stat-grid.two { grid-template-columns: 1fr 1fr; }
.stat-grid.two b { font-size: 2rem; }
.stat-grid.two span { font-size: 0.8rem; line-height: 1.4; display: block; }
.stat-note { font-size: 0.8rem !important; color: var(--muted); margin: 10px 0 0 !important; }

/* ── 课程页瘦身 ── */
/* 每张卡先只有"读音"；翻过一次才出现"笔顺" */
.card-cell:not(.seen) .ca-stroke { display: none; }
/* 超过 8 张的卡先收起来 */
.flashcard-grid .more-card { display: none; }
.flashcard-grid.show-all .more-card { display: flex; }
.cards-more { grid-column: 1 / -1; justify-self: center; border: 2px dashed var(--theme-border); background: var(--theme-bg); color: var(--theme-primary); border-radius: 999px; padding: 12px 26px; font-weight: 800; font-size: 0.95rem; }
.cards-more:hover { border-style: solid; }

/* 混合复习：没字时的出路；顶部白色的"换一批字" */
.empty-state { text-align: center; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 44px 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { color: var(--muted); max-width: 560px; }
.hero-ghost { margin-left: auto; color: #fff; border-color: rgba(255,255,255,.6); }
.hero-ghost:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.12); }

/* ── 第二次评审后：闯关时收起网站顶栏，只留一条细栏；部分完成；过关要做对 ── */
body.kid-mode .topbar { display: none; }
.kid-levels { top: var(--kidbar-h, 82px); }
.kb-h1 { font-size: 1rem; color: var(--theme-primary); line-height: 1.3; }
.kid-start { background: var(--theme-primary); }
/* 部分完成的一天：黄色半圆 */
.day-link.partial .dl-num { background: linear-gradient(90deg, #fff1c2 50%, #fff 50%); border-color: #c98f00; }
.kd-row.half .kd-tick { color: #a87600; }
.kc-pill.half { background: #fff1c2; color: #7a5600; }
.kc-miss { background: #fff; }
.kc-progress { margin-top: 22px; }
/* 测验没过：给出回生字卡的路 */
.quiz-final .btn-row { justify-content: center; gap: 12px; }
.quiz-final.again .score { color: var(--muted); }
/* 主题页里（整页和闯关）主按钮统一用这个主题的颜色；首页等其他页仍用品牌红 */
body.kid-mode .btn-primary { background: var(--theme-primary); }
/* 生字关的图标："文"字小方块（主题色底、白色楷体），大小跟着周围的 emoji 走 */
.ico-zi { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border-radius: .28em; background: var(--theme-primary); color: #fff;
  font-family: var(--font-kai); font-size: .9em; font-weight: 400; line-height: 1; vertical-align: -0.12em; }

/* ── 第三次评审后 ── */
/* 关卡标题旁的进度："🃏 3 / 8"，满了"⭐ 过关" */
.kid-prog { display: none; }
body.kid-mode .kid-prog { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 6px 14px; border-radius: 999px; background: #f6f2ea; color: var(--muted); font-weight: 800; font-size: 0.95rem; white-space: nowrap; }
body.kid-mode .kid-prog.done { background: #fff1c2; color: #7a5600; }
body.kid-mode .kid-prog[hidden] { display: none; }
/* 翻过的卡片角上留个小勾（翻回正面也看得出翻过） */
.card-cell { position: relative; }
.card-cell.seen::after { content: "✓"; position: absolute; top: 8px; right: 8px; pointer-events: none; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 0.75rem; font-weight: 900; display: grid; place-items: center; z-index: 2; }
/* 没做完就点"下一关"：温和提醒一次 */
.kn-main { position: relative; }
.kid-nudge { position: absolute; right: 0; bottom: calc(100% + 14px); background: #fff8e6; color: #6b4a00; border: 2px solid var(--parent-line); border-radius: 16px; padding: 10px 18px; font-weight: 800; font-size: 1rem; box-shadow: 0 8px 24px rgba(43,42,51,.12); white-space: nowrap; }
.kid-nudge.show { animation: kc-pop .4s cubic-bezier(.16, 1, .3, 1); }
/* 测验没过时，底部"下一关"变淡，让"回去看生字卡"更显眼 */
body.kid-mode .kn-next.kn-soft { background: #fff; color: var(--muted); border: 2px solid var(--line); }
/* 首页：今天已完成 */
.today-done { display: flex; align-items: center; gap: 14px; background: #e9f7f0; border: 2px solid #bfe6d3; border-radius: 20px; padding: 14px 24px; }
.td-check { width: 44px; height: 44px; border-radius: 50%; background: var(--mint); color: #fff; font-weight: 900; font-size: 1.3rem; display: grid; place-items: center; }
.today-done span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.today-done b { font-size: 1.1rem; }
.today-done small { color: var(--muted); font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
.link-inline { color: var(--coral); font-weight: 700; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .kid-nudge.show { animation: none; } }

/* ── 竹简：首页主题卡顶部色条用柔色（--tcs），文字/圆点仍用墨色（--tc） ── */
.big-topic { border-top-color: var(--tcs, var(--tc)); }
.big-unit { border-top-color: var(--tcs, var(--tc)); }

/* ── 家长语言：English ── */
.lang-switch { border: 2px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 0.85rem; }
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }
/* 家长卡英文版：要念给孩子的中文句子 = 楷体中文 + 🔊 + 拼音，下面一行英文 */
.parent-card.is-en .parent-script li { padding-left: 2em; }
.pc-says { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 4px; }
.pc-say { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; background: rgba(255,255,255,.75); border-radius: 12px; padding: 6px 12px; }
.pc-zh { font-family: var(--font-kai); font-size: 1.25rem; color: #3b2f12; font-weight: 400; }
.pc-py { flex-basis: 100%; font-size: 0.85rem; color: #6b5420; letter-spacing: .02em; }
.pc-en { display: block; }
.parent-card.is-en .parent-script li.say .pc-en { font-weight: 400; color: #4a3d1f; }
.ll-note { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.ll-title small { font-weight: 600; color: var(--muted); font-size: 0.85rem; margin-left: 8px; }

/* ── 试用版：顶栏标记、设备提示、页脚、备份（js/site.js）── */
.beta-tag { margin-left: 10px; font-size: 0.75rem; font-weight: 800; letter-spacing: .04em; color: var(--brand); background: #e7efe6; border-radius: 99px; padding: 3px 9px; vertical-align: 3px; }
.device-notice { display: flex; gap: 16px; align-items: center; justify-content: center; background: #fbf3dc; border-bottom: 1px solid #eadcb2; padding: 10px 24px; font-size: 0.9rem; line-height: 1.5; color: #5a4a22; }
.device-notice button { flex: none; border: 1px solid #d9c48a; background: #fff; border-radius: 99px; padding: 5px 16px; font: inherit; font-weight: 700; cursor: pointer; }
body.kid-mode .device-notice { display: none; }
.site-foot { margin: 36px auto 28px; padding-top: 18px; border-top: 1px solid rgba(43,42,51,.1); text-align: center; color: var(--muted); font-size: 0.85rem; line-height: 1.7; }
.site-foot .sf-links { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.site-foot a { color: var(--muted); text-underline-offset: 3px; }
.site-foot .link-btn { padding: 0; }
.save-note { margin-top: 14px; font-size: 0.8rem; line-height: 1.6; color: var(--muted); }
.save-note .link-btn { padding: 0; font-size: inherit; color: var(--brand); }
.modal-back { position: fixed; inset: 0; background: rgba(30,28,40,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 20px; padding: 28px 32px 18px; width: min(520px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-box h3 { font-size: 1.25rem; margin-bottom: 10px; }
.modal-box p { font-size: 0.95rem; line-height: 1.7; color: #444; }
.bk-actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 6px; }
.bk-actions label { cursor: pointer; text-align: center; }
.bk-close { display: block; margin: 0 auto; }
