/* 脱口 · 纸面：暖白底、墨色字，唯一强调色朱红。规则见 docs/2026-10-14_界面层次与配色方案.md：
   - 朱红只给「现在该你做的那一件事」：每屏唯一的主按钮、收音时状态行前的红点、点读时下一个该点的词按钮的细边框、进度里「现在」那一段、没对上的下划线。
     标题、正文、链接、选中项、说对（点到）的词、出错的说明一律不用朱红。
   - 浅底色 --paper-2 是「一个整体 / 可以点」的面：卡片、选项、提示气泡、按不了的按钮。
   - 字号五级：--f1 主角 → --f5 注脚；同一屏里主次靠字号、字重、墨色深浅三样拉开。 */
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #F7F5F0;
  --paper-2: #EEEAE1; /* 浅底色：纸面再深一档 */
  --ink: #1C1B19;
  --ink-2: #6B6760;
  --ink-3: #A9A49A;
  --line: #D8D3C9;
  --red: #C8452D;     /* 朱红：唯一强调色 */
  --red-deep: color-mix(in srgb, var(--red) 86%, var(--ink)); /* 主按钮指上去、按下去：朱红压一点墨，不是新颜色 */
  --hint: #8C877E;    /* 看提示时要照着说的英文：比「不可用」的浅灰深一档 */
  --en: "Newsreader", Georgia, "Times New Roman", serif;
  --zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --f1: 40px; /* 主角：练习页要说的那句、开始页书名（引导 1 的书名单独放大到 64px） */
  --f2: 28px; /* 标题：页面标题、卡片里的这件事 */
  --f3: 17px; /* 正文：主按钮、状态行、出错时那一句 */
  --f4: 14px; /* 辅助：元信息、次要按钮、选项、提示、下一步怎么做 */
  --f5: 12px; /* 注脚：键位、场景说明小字；隐私说明、页脚、分组小标题 13px 也算这一档 */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--zh);
  -webkit-font-smoothing: antialiased;
}
main { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; }
.screen { width: min(680px, 92vw); text-align: center; }
[hidden] { display: none !important; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { opacity: .4; cursor: default; }

/* 键位：画成一个小键帽，一看就知道是键盘上的键；手机上没有这些键，不显示 */
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 6px; margin-left: 10px;
  border: 1px solid var(--line); border-radius: 5px;
  font-family: var(--zh); font-size: var(--f5); font-weight: 400; line-height: 1; letter-spacing: .04em; color: var(--ink-3);
}
@media (hover: none) { kbd { display: none; } }

/* ---------- 按钮：三种，一屏只有一个主按钮 ---------- */
/* 主按钮：朱红实心。按不了是浅底灰字（和能按的一眼分开）；按下以后在等麦克风、服务器时还是朱红，字换成正在做什么，轻轻呼吸 */
.primary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 36px; border-radius: 999px;
  background: var(--red); color: #fff; /* 纯白：和朱红的对比度 4.8:1，达到正文可读的 4.5:1 */
  font-size: var(--f3); font-weight: 500; letter-spacing: .12em;
  transition: background-color .2s, color .2s;
}
.primary kbd {
  margin-left: 14px; letter-spacing: .04em;
  color: color-mix(in srgb, var(--paper) 82%, transparent); border-color: color-mix(in srgb, var(--paper) 45%, transparent);
}
@media (hover: hover) { .primary:not(:disabled):hover { background: var(--red-deep); } }
.primary:not(:disabled):active { background: var(--red-deep); transform: translateY(1px); }
.primary:disabled { opacity: 1; background: var(--paper-2); color: var(--ink-3); cursor: not-allowed; }
.card .primary:disabled { background: var(--line); color: var(--ink-2); } /* 卡片本身就是浅底：按不了的按钮再深一档，才看得出是个按钮 */
.primary:disabled kbd { display: none; }
.primary.busy, .primary.busy:disabled { background: var(--red); color: var(--paper); cursor: progress; animation: busy 1.6s ease-in-out infinite; }
@keyframes busy { 50% { opacity: .7; } }

/* 次要按钮：细线框的小胶囊（听示范、算我对、上一步、返回、随便） */
.ghost, .action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: var(--f4); letter-spacing: .04em; color: var(--ink-2); background: var(--paper);
  transition: border-color .2s, color .2s, background-color .2s;
}
.ghost kbd, .action kbd { margin-left: 8px; }
@media (hover: hover) { .ghost:not(:disabled):hover, .action:hover { border-color: var(--ink-2); color: var(--ink); } }

/* 文字按钮：今天到这里、跳过 */
.quiet { font-size: 15px; letter-spacing: .04em; color: var(--ink-2); padding: 12px 16px; transition: color .2s; }
@media (hover: hover) { .quiet:hover { color: var(--ink); } }

/* 链接：带一道浅下划线 */
.link {
  color: var(--ink-2); letter-spacing: inherit;
  padding: 6px 0; margin: -6px 0; /* 点击范围大一些，但不把这一行撑高 */
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
}
@media (hover: hover) { .link:hover { color: var(--ink); text-decoration-color: var(--ink-2); } }

.fine { font-size: 13px; line-height: 1.7; letter-spacing: .04em; color: var(--ink-3); margin: 28px 0 0; text-wrap: balance; }
.fine.err { font-size: var(--f4); color: var(--ink); } /* 引导 3 读不到题库：最下面那句宽心话换成出错的那句 */

/* 按钮下面那一行：按了以后在做什么，或者为什么按不了。用不了时第一行墨色说怎么了，第二行说下一步 */
.note { margin: 14px 0 0; font-size: var(--f4); line-height: 1.65; letter-spacing: .04em; color: var(--ink-2); text-wrap: balance; }
/* 这些短句折行时尽量折在标点后面，不把「麦克风」拆成两行；实在放不下再随便折 */
.note, .card-sub, .card-title, .end-kicker, .group-hint, .tip span { word-break: keep-all; overflow-wrap: anywhere; }
.note b { display: block; margin-bottom: 2px; font-size: var(--f3); font-weight: 500; color: var(--ink); }
.note:empty { display: none; }

#onboard :focus-visible, #start :focus-visible, #end :focus-visible, #book :focus-visible, #practice :focus-visible { outline: 2px solid var(--ink-2); outline-offset: 3px; }
#onboard ::selection, #start ::selection, #end ::selection, #book ::selection { background: var(--line); }

/* ---------- 卡片：「接下来要做的那件事」（开始页、引导 4 同一张） ---------- */
.card {
  width: min(460px, 100%); margin: 0 auto; padding: 28px 28px 26px;
  background: var(--paper-2); border-radius: 16px;
}
.card-meta { margin: 0; min-height: 20px; font-size: 13px; line-height: 20px; letter-spacing: .1em; color: var(--ink-2); }
.card-title { margin: 8px 0 0; min-height: 38px; font-size: var(--f2); font-weight: 500; line-height: 38px; letter-spacing: .06em; color: var(--ink); text-wrap: balance; }
.card-sub {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px;
  margin: 10px 0 0; min-height: 20px; font-size: var(--f4); line-height: 20px; letter-spacing: .04em; color: var(--ink-2);
}
.card-sub:empty { display: none; }
/* 练法「点读 | 开口说」：三轮那一行下面一个两格开关（和练习页的提示开关一个样子；卡片是浅底，选中的那格反过来用纸色），
   下面一行小字说这种练法怎么练。题库没读到、用不了、这一档练完了时不放 */
.card .ways { display: flex; width: fit-content; margin: 16px auto 0; background: none; }
.card .ways button { padding: 5px 16px; font-size: var(--f4); }
.card .ways button.on { background: var(--paper); }
#start:not([data-state="ready"]) #startWay { display: none; }
/* 点读不用人机校验：验证框不放 */
body[data-way="tap"] #startTs, body[data-way="tap"] #obTs { display: none; }
/* 这一轮怎么练（点一点就能练 / 先说词组，再说整句）：练法开关下面一行小字 */
.card-how { margin: 8px 0 0; font-size: 13px; line-height: 20px; letter-spacing: .06em; color: var(--ink-2); }
.card-how:empty { display: none; }
.card .primary { margin-top: 22px; }
.card .note { margin-top: 12px; }

/* 三轮走到哪：一轮一小段，练过的墨色，现在这一轮朱红，没到的浅灰 */
.segs { display: inline-flex; gap: 4px; }
.segs i { width: 16px; height: 4px; border-radius: 2px; background: var(--line); }
.segs i.done { background: var(--ink-2); }
.segs i.now { background: var(--red); }
.card .segs i:not(.done, .now) { background: color-mix(in srgb, var(--line) 75%, var(--ink-3)); } /* 浅底上浅灰要深一点才看得见 */

/* ---------- 开始页、结束页：一页纸，页脚贴底；内容比窗口高时页脚跟在后面 ----------
   结束页内容略高于正中（上下留白约 4 : 5）。开始页从上往下排、上面留一段固定的白：卡片会在原地变（按下后多一行「浏览器在问…」、
   用不了时多两行说明），按钮不能跟着上下跳 */
#start, #end {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  padding: 32px 0 26px;
}
#end::before { content: ""; flex: 4 0 0; }
#start::before { content: ""; flex: 0 0 clamp(8px, 15vh - 32px, 140px); }

h1 {
  font-weight: 400; font-size: 64px; line-height: 1.2; margin: 0 0 20px;
  letter-spacing: .22em; padding-left: .22em; /* 补回末字后的字距，保持居中 */
}
.lead { color: var(--ink-2); font-size: var(--f3); line-height: 1.7; letter-spacing: .06em; margin: 0 0 52px; }

/* 开始页：书名退成页眉，卡片是主角 */
.masthead { margin-bottom: 30px; }
.masthead h1 { font-size: var(--f1); letter-spacing: .24em; padding-left: .24em; margin: 0 0 4px; }
.masthead .lead { font-size: var(--f4); margin: 0; }
#nextCard { min-height: 210px; }
/* 题库还没读到：几行先占着位置，按钮不跳 */
#start[data-state="loading"] .card-sub:empty { display: flex; }
/* 一读不到题库就用不了（浏览器不支持、连不上）：卡片里只有那一句话和下一步 */
#start[data-state="blocked"] #nextCard:has(#pickLabel:empty) { min-height: 0; }
#start[data-state="blocked"] #pickLabel:empty { display: none; }
#start[data-state="blocked"] #pickLabel:empty + .card-title { margin-top: 0; }
#start[data-state="blocked"] .segs i.now { background: var(--ink-3); } /* 用不了：没有「现在」，朱红那一段也收起来 */

.pick { margin: 16px 0 0; font-size: var(--f4); line-height: 1.7; letter-spacing: .04em; }

/* 「换场景、难度或任务」：三组，每组左边一个小标题；选中的是墨色实心，没上线的是虚线 */
.picker { width: min(560px, 100%); margin: 14px auto 0; text-align: left; border-bottom: 1px solid var(--line); }
.group { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.group h3 { margin: 0; font-size: 13px; font-weight: 500; line-height: 32px; letter-spacing: .16em; color: var(--ink-2); }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } /* 场景两行各四个；难度三个，和场景对齐 */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font-size: var(--f4); letter-spacing: .06em; color: var(--ink);
  transition: border-color .2s, background-color .2s, color .2s;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); cursor: default; }
.chip:disabled { opacity: 1; border-style: dashed; color: var(--ink-3); }
.chip small { font-size: 11px; letter-spacing: .04em; }
@media (hover: hover) { .chip:not(:disabled, .on):hover { border-color: var(--ink-2); } }
/* 任务：像书的目录——左边这件事，右边练到哪了（三小段；练完是 ✓）；接下来要练的那件加粗、标「接下来」。点一件直接开始 */
.group-hint { margin: 0; font-size: 13px; line-height: 32px; letter-spacing: .04em; color: var(--ink-3); }
.tasks { list-style: none; margin: 0 -12px; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 8px; }
.tasks .row {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px;
  font-size: 15px; line-height: 22px; letter-spacing: .04em; text-align: left; color: var(--ink);
  transition: background-color .2s;
}
.tasks .t { flex: 1; min-width: 0; }
.tasks .st { flex: none; display: inline-flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .04em; color: var(--ink-2); }
.tasks .st b { font-weight: 500; color: var(--ink); }
.tasks .done .t { color: var(--ink-2); }
.tasks .next .t { font-weight: 500; }
/* 整句复习：练完 3 轮的那件事行尾一个细线小胶囊，点了直接练 6 句整句 */
.tasks .review {
  flex: none; height: 28px; margin-right: 12px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-size: 13px; letter-spacing: .04em; color: var(--ink-2); transition: border-color .2s, color .2s;
}
@media (hover: hover) {
  .tasks .row:not(:disabled):hover { background: var(--paper-2); }
  .tasks .review:not(:disabled):hover { border-color: var(--ink-2); color: var(--ink); }
}
.replay { margin: 0; padding: 12px 0 14px 60px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; letter-spacing: .04em; }

/* 累计天数、收集册入口：和隐私说明并成一组小字；第一次来两样都没有，这一行就不出现 */
.stats { margin-top: 26px; }
.stats:not(:has(> :not([hidden]))) { display: none; }
.stats:has(> :not([hidden])) + .fine { margin-top: 2px; }
#days:not([hidden]) + #bookBtn { margin-left: 18px; }

/* 页脚：一行出处，贴在页面底部（开始页、结束页共用） */
footer {
  flex: 5 0 auto; display: flex; align-items: flex-end; justify-content: center;
  padding-top: 32px; font-family: var(--en); font-size: 14px; letter-spacing: .02em;
}
footer a { color: var(--ink-3); text-decoration: none; padding: 8px 4px; transition: color .2s; }
@media (hover: hover) { footer a:hover { color: var(--ink-2); } }

/* ---------- 练习页 ----------
   从上到下：这一轮的小标题 → 中文 → 英文下划线 → 拾音波纹 → 状态一行（红点 = 麦克风开着，轮到你说）→ 新手提示 → 识别到的文字 → 求助/纠错。
   看提示（body.hint）：英文是主体，中文缩小放上方；首字母：中文是主体，英文每个词只露首字母、长度用下划线占着。 */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: color-mix(in srgb, var(--line) 55%, transparent); }
.progress i { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width .5s ease; }
/* 顶上一行：「← 返回」、这件事走到哪（试裤子换大一号 · 第 3/3 轮）、提示两档 */
.topbar { position: fixed; top: 16px; left: 24px; right: 24px; z-index: 1; display: flex; align-items: center; gap: 14px; text-align: left; }
.meta { flex: 1; min-width: 0; display: flex; align-items: baseline; font-size: 13px; letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.meta b { font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.meta span::before { content: "·"; margin: 0 .55em; }
/* 提示两档「看提示 | 首字母」：一个两格的开关，点哪格就是哪格；选中的那格是浅底墨字 */
.mode { flex: none; display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--paper); }
.mode button { padding: 4px 12px; border-radius: 999px; line-height: 18px; letter-spacing: .04em; color: var(--ink-3); transition: color .2s, background-color .2s; }
.mode button.on { font-weight: 500; background: var(--paper-2); color: var(--ink); cursor: default; }
@media (hover: hover) { .mode button:not(.on):hover { color: var(--ink); } }
.stage { transition: opacity .25s ease, transform .25s ease; }
.stage.out { opacity: 0; transform: translateY(-8px); }
.scene-lead { margin: 0 0 16px; min-height: 22px; font-size: var(--f4); line-height: 22px; letter-spacing: .06em; color: var(--ink-2); text-wrap: balance; }
/* 看中文、念英文：中文是主角（最大、墨色、加粗）；英文比中文小一档、浅灰，只是提示；说对的词变墨，但还是小一档、不加粗，不和中文抢 */
.zh { font-size: var(--f1); font-weight: 500; line-height: 1.4; letter-spacing: .04em; min-height: 56px; color: var(--ink); text-wrap: balance; }
.slots {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px;
  margin-top: 22px; min-height: 48px;
}
.slot {
  position: relative; display: inline-flex; justify-content: center; align-items: flex-end;
  height: 40px; font-family: var(--en); font-size: var(--f2); line-height: 1;
}
.slot::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--line); transition: background .2s;
}
.slot .w { opacity: 0; transform: translateY(-4px); transition: opacity .15s ease, transform .2s ease, color .15s ease; padding-bottom: 4px; }
.slot.on .w { opacity: 1; transform: none; color: var(--ink); animation: ink-in .3s ease-out; } /* 说对：词变墨时轻轻落一下 */
.slot.on::after { background: var(--ink-2); }
.slot.miss::after { background: var(--red); height: 3px; }
.slot.reveal .w { opacity: 1; transform: none; color: var(--ink-3); }
@keyframes ink-in { from { transform: translateY(-4px) scale(1.06); } }
.slot .w .r { transition: color .15s ease; }
/* 首字母档：还没说出来的词只露首字母和标点，后面的字母透明——还占着位置，下划线就是空格子（C__ y__ h___ m_?）；
   听示范、跟着说时整句露出来（.full），说对的词变成墨色 */
body:not(.hint) .slots:not(.full) .slot:not(.on, .sing) .w .r { color: transparent; }
.slot.sing .w { color: var(--ink); } /* 播示范：词随发音依次点亮 */
.slot.sing::after { background: var(--ink-2); }

/* 点读：英文是一排小按钮，一个词一个（浅底细边框圆角，字在里面）；不收音（没有拾音波纹、「听示范」、状态行的红点）。
   那一行哪里都能点：点到点过的按钮是重听它，别的地方都是下一个词。和进度小段一个规矩：没点的灰字、下一个该点的朱红细边框、
   点过的墨字深色边框；点完了播这一步，按钮先退回一点，跟着发音一个个再变墨（开口说时还是下划线） */
#practice.tap .wave { display: none; }
#practice.tap .slots {
  margin-top: 18px; padding: 6px 0; gap: 12px 10px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#practice.tap .slot {
  height: 52px; padding: 0 16px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2);
  transition: border-color .15s ease;
}
#practice.tap .slot::after { display: none; }
#practice.tap .slot .w { padding-bottom: 2px; }
#practice.tap .slot.next { border-color: var(--red); }
#practice.tap .slot.next .w { color: var(--ink-2); }
#practice.tap .slot.on { border-color: var(--ink-2); }
#practice.tap .slots.playing .slot.on:not(.sing) { border-color: var(--line); }
#practice.tap .slots.playing .slot.on:not(.sing) .w { color: var(--ink-2); }

/* 说对的奖励：像老师在纸上盖的章，盖在这一步最后一个词旁边。完美：朱红章；不错：墨色章；过关：一行浅灰小字。
   整句（一句的最后一步）盖得大、留到下一句；中间步骤只是一个小字，一会儿就淡掉，不打断节奏 */
.stamp {
  position: absolute; left: 100%; z-index: 1; pointer-events: none; white-space: nowrap;
  font-family: var(--zh); font-weight: 600; line-height: 1; letter-spacing: .12em;
}
.stamp.perfect { color: var(--red); }
.stamp.good { color: var(--ink-2); }
.stamp.pass { color: var(--ink-3); font-weight: 500; }
/* 中间步骤：右上角一个小字（像上标），1 秒多就淡掉 */
.stamp.step { bottom: 62%; margin-left: 2px; font-size: 13px; animation: step-in .25s ease-out both, step-out .5s ease-in 1.2s forwards; }
/* 整句：紧挨着最后一个词右边盖一个斜一点的章（不高过这个词，换行时不压到上一行）；右边放不下就盖在这个词下面 */
.stamp.whole {
  bottom: 6px; margin-left: 10px;
  padding: 5px 6px 5px 8px; border: 2px solid currentColor; border-radius: 6px; font-size: 16px;
  background: color-mix(in srgb, var(--paper) 85%, transparent); transform: rotate(-8deg);
  animation: stamp-in .34s cubic-bezier(.2, .9, .3, 1.25) both;
}
.stamp.whole.below { left: auto; right: -6px; bottom: auto; top: calc(100% + 8px); margin: 0; }
.stamp.whole.pass { padding: 0; border: 0; background: none; transform: none; font-size: 14px; animation: step-in .3s ease-out both; }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-8deg) scale(1.9); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes step-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes step-out { to { opacity: 0; } }

.wave { display: block; width: 180px; height: 28px; margin: 24px auto 0; }
/* 状态一行：现在轮到谁。麦克风开着（照着说、请说、在听、再说一遍、跟着说一遍）前面一个朱红小点，开口说话时它跟着跳；
   放示范、暂停时没有点、字变灰——不在听 */
.cue {
  display: flex; justify-content: center; align-items: center; gap: 9px;
  margin-top: 8px; min-height: 26px; font-size: var(--f3); font-weight: 500; line-height: 26px; letter-spacing: .08em; color: var(--ink);
}
.cue::before { content: ""; display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.cue.live::before { display: block; }
.cue.voice::before { animation: rec .9s ease-in-out infinite; }
@keyframes rec { 50% { transform: scale(1.45); opacity: .75; } }
.cue.off { font-weight: 400; color: var(--ink-2); }
.cue.tap { font-weight: 400; color: var(--ink-2); } /* 点读：只是一句轻提示；电脑上后面跟着键位「空格」 */
.cue kbd { margin-left: 0; }
/* 新手提示：第一次练习的第一轮，状态行下面一个浅底气泡。这一轮先把位置留好，提示出现时下面的东西不跳 */
.tip { font-size: var(--f4); line-height: 20px; letter-spacing: .04em; color: var(--ink); }
body:not(.coach) .tip { display: none; }
body.coach .tip { min-height: 34px; margin-top: 10px; }
.tip span { display: inline-block; padding: 7px 16px; border-radius: 999px; background: var(--paper-2); animation: tip-in .4s ease both; }
@keyframes tip-in { from { opacity: 0; transform: translateY(3px); } }
.heard { margin-top: 6px; min-height: 22px; font-size: 15px; color: var(--ink-3); font-family: var(--en); }
.heard span { font-family: var(--zh); font-size: 13px; margin-right: 6px; }

.actions { margin-top: 22px; min-height: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.action { transition: color 1.2s ease, border-color 1.2s ease; }
.action.nudge { border-color: var(--ink-2); color: var(--ink); } /* 首字母档 4 秒没开口：「听示范」慢慢变深 */
.action.strong { border-color: var(--ink-3); color: var(--ink); }
.status {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 2;
  padding: 6px 16px; border-radius: 999px; background: var(--paper-2);
  font-size: 13px; line-height: 18px; letter-spacing: .04em; color: var(--ink); white-space: nowrap; pointer-events: none;
}
.status:empty { display: none; }
/* 两行：上面一句怎么了，下面一句灰字怎么办（开口说没开成、先接着点读） */
.status:has(small) { width: max-content; max-width: min(92vw, 520px); padding: 8px 18px; border-radius: 14px; white-space: normal; text-wrap: balance; }
.status small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
body.offline .slot::after { background: repeating-linear-gradient(90deg, var(--line) 0 5px, transparent 5px 9px); }
/* 暂停：这一步淡下去，盖上一张小卡片「已暂停」：继续（空格）/ 回到开始页 */
#practice.paused .stage, #practice.paused .wave, #practice.paused .cue, #practice.paused .tip, #practice.paused .heard, #practice.paused .actions { opacity: .25; }
.pause { position: fixed; inset: 0; z-index: 3; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--paper) 55%, transparent); }
.pause .card { width: min(340px, 100%); padding: 28px 24px 20px; box-shadow: 0 12px 40px -20px rgba(28, 27, 25, .4); }
.pause .card-title { margin: 0; }
.pause-leave { margin: 6px 0 0; }
.pause .fine { margin: 0; }

/* ---------- 结束页 ---------- */
/* 标题上面一行：这件事三轮走到哪（练完一件事时换成这一档几件事走到哪）；标题开头的「只占半个字宽，整行才看得出是居中的 */
.end-kicker {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px;
  margin: 0 0 14px; min-height: 20px; font-size: 13px; line-height: 20px; letter-spacing: .08em; color: var(--ink-2);
}
.end-kicker:empty { display: none; }
h2 { font-weight: 400; font-size: var(--f2); line-height: 1.3; letter-spacing: .08em; padding-left: .08em; margin: 0 0 44px; text-spacing-trim: trim-start; text-wrap: balance; }
#end h2 { font-weight: 500; }
/* 整句连读练完：6 句里几句完美、几句不错（一行小字，不列过关） */
.end-grades { margin: -30px 0 36px; font-size: 13px; letter-spacing: .08em; color: var(--ink-2); }
/* 结束页每句后面：这句整句说对时盖的章 */
.end-list .stamp { position: static; display: inline-block; margin-left: .5em; vertical-align: .3em; font-size: 14px; text-decoration: none; }
.end-list { list-style: none; margin: 0 0 16px; padding: 0; }
.end-list:empty, .end-list:empty + .end-hint { display: none; } /* 收尾练完不列句子 */
.end-list li + li { margin-top: 28px; }
.end-list .en {
  font-family: var(--en); font-size: 32px; line-height: 1.3; text-wrap: balance;
  /* 平时就是印在纸上的句子；指上去下面出现一道墨线，点一下再听一遍 */
  text-decoration-line: underline; text-decoration-thickness: 1px;
  text-decoration-color: transparent; text-underline-offset: .3em;
  transition: text-decoration-color .2s;
}
.zh-small { margin-top: 8px; font-size: var(--f4); letter-spacing: .04em; color: var(--ink-2); }
.end-hint { margin: 0 0 40px; font-size: 13px; letter-spacing: .04em; color: var(--ink-3); }
#endNote { margin: -20px 0 28px; }
/* 主按钮（继续 / 整句连读一遍 / 下一件事）压在页面中轴上，「今天到这里」挂在它右边，「跳过，下一件事」在下面一行 */
.end-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 8px; }
#againBtn { grid-column: 2; }
#stopBtn { grid-column: 3; justify-self: start; }
#againBtn[hidden] + #stopBtn { grid-column: 2; justify-self: center; } /* 这一档都练完：只剩它，它就是主按钮 */
.skip { grid-column: 1 / -1; justify-self: center; margin-top: 2px; }
@media (hover: hover) { .end-list .en:hover { text-decoration-color: var(--ink); } }

/* ---------- 收集册：我练过的句子。整页随内容滚动；「返回」固定在左上角 ---------- */
#book { padding: 96px 0 80px; }
#book h2 { margin-bottom: 8px; }
#bookCount { margin: 0 0 32px; }
.book-list { width: min(560px, 100%); margin: 0 auto; }
.book-list li { padding: 18px 0 16px; border-top: 1px solid var(--line); }
.book-list li:last-child { border-bottom: 1px solid var(--line); }
.book-list li + li { margin-top: 0; }
.book-list .en { font-size: 24px; }
.book-list .zh-small { margin-top: 4px; font-size: 13px; }
.back { position: fixed; top: 18px; left: 24px; z-index: 1; }

/* ---------- 引导页（第一次打开）：四屏，一屏只问一件事 ----------
   内容略高于正中（上下留白约 4 : 5）；左上角「上一步」、顶上三道短线（引导 2～4 走到哪了，现在这一道朱红）钉在原处；
   换屏时这一屏淡出上移、下一屏从下方淡入，往回走反过来 */
#onboard {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  padding: 76px 0 48px;
}
#onboard[data-page="1"] { padding-top: 32px; }
#onboard::before { content: ""; flex: 4 0 0; }
#onboard::after { content: ""; flex: 5 0 0; }
.ob-step { transition: opacity .24s ease, transform .24s ease; }
.ob-step.out { opacity: 0; transform: translateY(-8px); transition-duration: .16s; }
.ob-step.out.back { transform: translateY(8px); }
.ob-step.in { opacity: 0; transform: translateY(8px); transition: none; }
.ob-step.in.back { transform: translateY(-8px); }
.ob-dots { position: fixed; top: 34px; left: 50%; display: flex; gap: 6px; transform: translateX(-50%); }
.ob-dots i { width: 18px; height: 3px; border-radius: 2px; background: var(--line); transition: background-color .3s; }
.ob-dots i.done { background: var(--ink-2); }
.ob-dots i.on { background: var(--red); }
.ob-step h2 { margin-bottom: 36px; }

/* 引导 1：书名、一句话；下面一张浅底小卡片是练习页的缩小版，里面的字号、灰字、下划线、波纹都和练习时一样 */
.ob-intro h1 { margin-bottom: 12px; }
.ob-intro .lead { margin-bottom: 30px; }
.demo { position: relative; width: min(440px, 100%); margin: 0 auto; padding: 24px 20px 16px; background: var(--paper-2); border-radius: 16px; overflow: hidden; }
.demo-zh { min-height: 34px; font-size: 24px; font-weight: 500; line-height: 34px; letter-spacing: .04em; color: var(--ink); }
#demo .slots { margin-top: 8px; min-height: 0; gap: 6px 10px; }
#demo .slot { height: 30px; font-size: 20px; }
#demo .slot.reveal .w { color: var(--ink-3); }
#demo .slot:not(.on)::after { background: color-mix(in srgb, var(--line) 75%, var(--ink-3)); }
/* 波纹只在示范「在听」时淡入；减少动态效果时不出现 */
.demo-wave { display: block; width: 120px; height: 20px; margin: 16px auto 0; opacity: 0; transition: opacity .3s ease; }
.demo-wave.on { opacity: 1; }
.demo-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* 三步说明：一行一条，整块压在中轴上；示范走到哪一步，哪一行就变成墨色、序号变朱红（「现在」） */
.how { list-style: none; counter-reset: how; width: fit-content; max-width: 100%; margin: 26px auto 30px; padding: 0; text-align: left; }
.how li {
  counter-increment: how; display: flex; align-items: baseline; gap: 14px;
  font-size: 15px; line-height: 30px; letter-spacing: .04em; color: var(--ink-2); transition: color .4s ease;
}
.how li::before { content: counter(how); flex: none; width: 10px; font-family: var(--en); font-size: 17px; font-weight: 500; color: var(--ink-3); transition: color .4s ease; }
.how li.on { color: var(--ink); }
.how li.on::before { color: var(--red); }

/* 引导 2：三档，一档一张浅底选项卡——上面一行「1 初级 能说单词和简单的短句」，下面是这一档的一句真实例句：
   平时是练习时那种要照着说的灰字，指上去（选中）变成墨色、框线变深，像是说出来了 */
.ob-levels { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ob-level {
  width: min(540px, 100%); display: flex; flex-direction: column; align-items: center;
  padding: 14px 20px 16px; border: 1.5px solid transparent; border-radius: 14px; background: var(--paper-2);
  transition: border-color .2s;
}
.ob-label { display: flex; align-items: center; gap: 10px; font-size: var(--f4); line-height: 22px; letter-spacing: .04em; color: var(--ink-2); }
.ob-label kbd { margin: 0; background: var(--paper); }
.ob-label b { font-weight: 500; font-size: 16px; letter-spacing: .08em; color: var(--ink); }
.ob-ex { margin-top: 6px; font-family: var(--en); font-size: 24px; line-height: 1.3; color: var(--hint); text-wrap: balance; transition: color .2s; }
.ob-level:disabled, .ob-any:disabled, .ob-scene:disabled { opacity: 1; cursor: default; }
.ob-level:disabled { background: transparent; border: 1.5px dashed var(--line); }
.ob-level:disabled b, .ob-level:disabled .ob-ex { color: var(--ink-3); }

/* 引导 3：「随便」是一个细线胶囊（让我们替你选），下面 8 个场景是浅底选项卡（电脑 4×2、手机 2×4）：名字、一行说明 */
.ob-any {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font-size: 15px; letter-spacing: .06em; color: var(--ink); transition: border-color .2s;
}
.ob-scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.ob-scene {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 82px; padding: 12px 8px; border: 1.5px solid transparent; border-radius: 14px; background: var(--paper-2);
  transition: border-color .2s;
}
.ob-scene b { font-weight: 500; font-size: 16px; line-height: 24px; letter-spacing: .06em; color: var(--ink); }
.ob-scene small { font-size: var(--f5); line-height: 18px; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; }
.ob-scene:disabled { background: transparent; border: 1.5px dashed var(--line); }
.ob-any:disabled, .ob-scene:disabled b, .ob-scene:disabled small { color: var(--ink-3); }
@media (hover: hover) {
  .ob-level:not(:disabled):hover, .ob-scene:not(:disabled):hover { border-color: var(--ink-3); }
  .ob-level:not(:disabled):hover .ob-ex { color: var(--ink); }
  .ob-any:not(:disabled):hover { border-color: var(--ink-2); }
}
/* 选中：框线墨色（点下去、或者从下一屏回来时） */
.ob-level.on, .ob-scene.on, .ob-any.on { border-color: var(--ink); }
.ob-level.on .ob-ex { color: var(--ink); }

/* 引导 4：开始页那张卡片；麦克风怎么点在按钮下面 */
#obTask { margin-top: 8px; }
/* 人机校验：放在卡片里按钮下面那一行的下面；平时看不见（高度 0），要人勾验证框时才露出来、和上面隔开一点 */
#turnstile { display: flex; justify-content: center; }
#turnstile.on { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .ob-step, .how li, .how li::before { transition: none; }
  .tip span, .primary.busy, .primary.busy:disabled, .cue.voice::before, .slot.on .w,
  .stamp.step, .stamp.whole, .stamp.whole.pass { animation: none; }
}

/* 窗口窄到场景排不成一行、结束页的按钮并排放不下时 */
@media (max-width: 640px) {
  .ob-scenes { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; } /* 引导 3：两列四行 */
  /* 结束页：按钮竖着排，主按钮在上；收尾那一页「跳过」排在「今天到这里」前面 */
  .end-actions { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  #againBtn { margin-bottom: 8px; }
  #skipBtn { order: 1; }
  #stopBtn { order: 2; }
  /* 换场景面板：小标题放到每组上面 */
  .group { grid-template-columns: 1fr; row-gap: 8px; }
  .group h3 { line-height: 20px; }
  .group-hint { line-height: 20px; margin-bottom: 4px; }
  .replay { padding-left: 0; text-align: center; }
}
/* 用手指点：选项和任务行高一些；没有数字键，引导 2 不标 1/2/3 */
@media (pointer: coarse) {
  .chip { height: 36px; }
  .tasks .row { padding: 11px 12px; }
  .tasks .review { height: 34px; }
}
@media (max-width: 480px) {
  h1 { font-size: 52px; }
  .lead { font-size: 16px; margin-bottom: 44px; }
  .masthead { margin-bottom: 24px; }
  .masthead h1 { font-size: 34px; }
  .masthead .lead { font-size: 13px; margin: 0; }
  .card { padding: 24px 18px 22px; border-radius: 14px; }
  .card-title { font-size: 24px; line-height: 34px; min-height: 34px; }
  h2 { font-size: 24px; margin-bottom: 36px; }
  .end-list .en { font-size: 27px; }
  #book { padding-top: 76px; }
  .back { top: 12px; left: 12px; }
  /* 顶上放不下四样：第一行「← 返回」和两个开关，第二行这件事走到哪 */
  .topbar { top: 12px; left: 12px; right: 12px; flex-wrap: wrap; gap: 6px 8px; }
  .topbar .ways { margin-left: auto; }
  .topbar .mode button { padding: 4px 10px; }
  .meta { order: 1; flex-basis: 100%; padding-left: 2px; }
  .status { top: auto; bottom: calc(24px + env(safe-area-inset-bottom)); }
  .ob-dots { top: 26px; }
  #onboard { padding-top: 64px; }
  .ob-step h2 { margin-bottom: 28px; }
  .ob-ex { font-size: 21px; }
  .demo-zh { font-size: 22px; }
  #demo .slot { height: 28px; font-size: 19px; }
  .book-list .en { font-size: 22px; }
  .zh { font-size: 34px; }
  .slot { height: 34px; font-size: 24px; }
  /* 点读的按钮：一行放不下就换行，按钮之间留够拇指的空 */
  #practice.tap .slots { gap: 10px 8px; }
  #practice.tap .slot { height: 46px; padding: 0 12px; border-radius: 9px; }
}
