/* 汉字小岛 · 打字。和汉字小岛、田字格同一套“岛屿纸本”：纸色、海青、暖黄、珊瑚色、楷体。
   孩子和大人同一张脸（浅色纸本）；令牌照抄小岛 :root，改颜色先改小岛再同步过来。 */
:root {
  --paper: #f7f2e7; --paper-2: #efe7d6; --card: #fffdf8; --ink: #2b3442; --muted: #6d624f; --line: #e6dccb;
  --sea: #1f6f68; --sea-ink: #175a54; --sea-soft: #e3f0ec; --leaf: #347a4d; --sun: #f2b84b; --sun-soft: #fff3d6; --coral: #d9775c; --coral-soft: #fdece5;
  --night-2: #2b3442; --glow: #b7791f;
  --shadow: 0 1px 0 rgba(120, 95, 50, .06), 0 8px 22px rgba(80, 62, 24, .06);
  color-scheme: only light;
  --kai: "Island Kai", "Kaiti SC", "STKaiti", "KaiTi", "Kaiti TC", "BiauKai", "DFKai-SB", serif;
  --sans: Inter, "PingFang SC", "PingFang TC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* 手指颜色和小岛键盘岛同一组 */
  --f0: #fbe3ea; --f1: #fde9d4; --f2: #fbf0c7; --f3: #dff1e3; --f4: #ddebf9; --f5: #fbf0c7; --f6: #fde9d4; --f7: #fbe3ea;
  --r: 18px;
  /* 字号只用这 5 档（照小岛 ds-t-*） */
  --t-xs: 13px; --t-sm: 15px; --t-md: 17px; --t-lg: 21px; --t-xl: 28px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: linear-gradient(180deg, #f9f5ec 0%, var(--paper) 62%, #e9f1ec 100%) fixed; color: var(--ink); font: 16px/1.55 var(--sans); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea); }
.kai { font-family: var(--kai); }

/* 顶栏 */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 650; font-size: 1.05rem; text-decoration: none; color: var(--ink); white-space: nowrap; min-height: 40px; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: #f6f0e4; border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 10px; padding: 5px 11px; font-size: 14px; min-height: 34px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--sea-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.icon-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; width: 34px; height: 34px; font-size: 16px; }
.icon-btn[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }

main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 8px 16px 32px; outline: none; }
.loading { text-align: center; color: var(--muted); margin-top: 20vh; }
h1, h2, h3 { font-weight: 650; line-height: 1.25; }
h1 { font-size: 28px; margin: 16px 0 8px; }
h2 { font-size: 21px; margin: 24px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
.spacer { flex: 1; }

/* 按钮和卡片 */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 20px; font-size: 16px; min-height: 44px; box-shadow: 0 2px 0 var(--line); }
.btn.primary { background: var(--sea); border-color: var(--sea); color: #fff; font-weight: 600; box-shadow: 0 3px 0 var(--sea-ink); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .choice:focus-visible, .cand:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 16px 0; }
.choice { text-align: left; border: 1px solid #ece7dc; background: var(--card); border-radius: var(--r); padding: 18px; display: block; width: 100%; box-shadow: var(--shadow); }
.choice strong { display: block; font-size: 19px; margin-bottom: 4px; }
.choice .big { font-family: var(--kai); font-size: 40px; line-height: 1.1; display: block; margin-bottom: 6px; }
.choice:hover { border-color: var(--sea); }
.choice[aria-pressed="true"] { border-color: var(--sea); box-shadow: 0 0 0 2px var(--sea) inset; }
.panel { background: var(--card); box-shadow: var(--shadow); border: 1px solid #ece7dc; border-radius: var(--r); padding: 16px 18px; margin: 12px 0; }

/* 灯笼（每打对一个点亮一盏） */
.sky { position: relative; height: 70px; margin: 0 0 6px; }
.lanterns { display: flex; justify-content: center; gap: 10px; }
.lantern { width: 22px; height: 30px; border-radius: 9px 9px 11px 11px; background: var(--paper-2); border: 1px solid var(--line); position: relative; transition: background .4s, box-shadow .4s, transform .4s; }
.lantern::before { content: ""; position: absolute; top: -8px; left: 10px; width: 1px; height: 8px; background: var(--line); }
.lantern.lit { background: radial-gradient(circle at 50% 40%, #fff3c9, var(--sun) 60%, var(--coral)); border-color: var(--sun); box-shadow: 0 0 14px 2px rgba(242, 184, 75, .45); }
.lantern.rise { animation: rise 1.2s ease-out; }
@keyframes rise { 0% { transform: translateY(26px) scale(.6); } 100% { transform: none; } }
.stars { display: none; }
.sea-waves { position: fixed; left: 0; right: 0; bottom: 0; height: 90px; pointer-events: none; z-index: -1; background: linear-gradient(transparent, rgba(31, 111, 104, .07)); }

/* 瓶子和题目 */
.stage { text-align: center; margin: 4px 0 10px; }
.bottle { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 26px 14px; border-radius: 40px 40px 26px 26px; background: var(--card); border: 1px solid #ece7dc; box-shadow: var(--shadow); animation: drift 1.4s ease-out; }
@keyframes drift { from { transform: translateX(-40px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.word { font-family: var(--kai); font-size: clamp(48px, 12vw, 76px); line-height: 1.15; letter-spacing: .06em; }
.word .slot { display: inline-block; min-width: 1em; border-bottom: 3px solid currentColor; opacity: .9; }
.word .slot.filled { border-bottom-color: transparent; }
.gloss { font-size: 15px; color: var(--muted); min-height: 1.5em; }
.sentence-q { font-family: var(--kai); font-size: clamp(26px, 6vw, 36px); line-height: 1.5; }
.sentence-q .slot { display: inline-block; min-width: 1.1em; border-bottom: 3px solid currentColor; text-align: center; }
.listen { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 15px; margin: 6px 4px; }
.pen { width: 120px; height: 120px; display: block; margin: 4px auto; }

/* 输入行和候选 */
.typebox { margin: 10px auto 6px; max-width: 520px; text-align: center; }
.typed { font: 30px/1.2 var(--mono); min-height: 44px; letter-spacing: .08em; padding: 4px 12px; border-bottom: 2px solid var(--line); display: inline-block; min-width: 180px; }
.typed .caret { display: inline-block; width: 2px; height: 1em; background: currentColor; vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.typed.wrong { color: var(--coral); border-bottom-color: var(--coral); }
.status { min-height: 1.6em; font-size: 15px; color: var(--muted); margin-top: 6px; }
.cands { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; min-height: 76px; }
.cand { font-family: var(--kai); font-size: 40px; width: 74px; height: 74px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); position: relative; animation: pop .25s ease-out; }
.cand small { position: absolute; top: 3px; left: 7px; font: 12px var(--sans); color: var(--muted); }
.cand.right { border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea) inset; }
body.kid .cand.right { border-color: var(--sun); box-shadow: 0 0 22px 2px rgba(242, 184, 75, .6), 0 0 0 3px var(--sun) inset; }
.cand.dim { opacity: .35; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.note { background: var(--sun-soft); color: var(--ink); border-radius: 12px; padding: 10px 14px; display: inline-block; margin-top: 6px; }

/* 屏幕键盘 */
.kb { margin: 14px auto 0; max-width: 620px; user-select: none; }
.kb-row { display: flex; justify-content: center; gap: 5px; margin: 5px 0; }
.kb-row:nth-child(2) { padding-left: 18px; }
.kb-row:nth-child(3) { padding-left: 40px; }
.key { width: clamp(26px, 8.4vw, 50px); height: clamp(38px, 10vw, 50px); border-radius: 9px; border: 1px solid rgba(43, 52, 66, .16); box-shadow: 0 2px 0 rgba(43, 52, 66, .12); font: 600 17px var(--mono); color: var(--ink); transition: transform .08s, box-shadow .2s; touch-action: manipulation; }
.key[data-f="0"], .key[data-f="7"] { background: var(--f0); } .key[data-f="1"], .key[data-f="6"] { background: var(--f1); }
.key[data-f="2"], .key[data-f="5"] { background: var(--f2); } .key[data-f="3"] { background: var(--f3); } .key[data-f="4"] { background: var(--f4); }
.key.wide { width: clamp(64px, 18vw, 96px); background: #e8e2d4; font-size: 14px; }
.key.hit { transform: translateY(2px); box-shadow: 0 0 0 3px #fff, 0 0 18px 4px rgba(242, 184, 75, .8); }
.key.hint { box-shadow: 0 0 0 3px var(--sea); }

/* 聊天 */
.chat { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-family: var(--kai); font-size: 24px; line-height: 1.4; animation: pop .25s ease-out; }
.msg.g { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.k { align-self: flex-end; background: #95ec69; color: #1b2a12; border-top-right-radius: 4px; }
.msg .who { display: block; font: 12px var(--sans); opacity: .7; }
.msg.k.draft { background: rgba(149, 236, 105, .18); color: inherit; border: 1px dashed rgba(149, 236, 105, .6); }
.msg .ghost { opacity: .35; }
.msg .cur { border-bottom: 3px solid var(--sun); }
.msg button.listen { font: 13px var(--sans); padding: 2px 10px; margin: 4px 0 0; }

/* 专注模式 */
.focus-line { font-family: var(--kai); font-size: clamp(30px, 7vw, 46px); line-height: 1.6; text-align: center; margin: 22px 0 6px; word-break: keep-all; }
.focus-line .u { position: relative; display: inline-block; min-width: .9em; }
.focus-line .u.todo { opacity: .4; }
.focus-line .u.hidden { opacity: .5; }
.focus-line .u.cur { opacity: 1; border-bottom: 3px solid var(--sea); }
.focus-line .u.done { opacity: 1; animation: ink .5s ease-out; }
.focus-line .u.slip { color: var(--coral); }
.focus-line .py { display: block; font: 13px var(--sans); color: var(--muted); height: 1.2em; }
@keyframes ink { from { filter: blur(3px); opacity: .2; } to { filter: none; opacity: 1; } }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0 0; }
.progress > i { display: block; height: 100%; background: var(--sea); transition: width .3s; }
body.kid .progress > i { background: var(--sun); }
.result { text-align: center; }
.stat { display: inline-block; margin: 8px 18px; }
.stat b { display: block; font-size: 42px; font-weight: 700; color: var(--sea); line-height: 1.1; }
.heat { display: inline-grid; grid-template-columns: repeat(10, 30px); gap: 4px; margin: 8px 0; }
.heat span { height: 30px; border-radius: 6px; font: 600 13px/30px var(--mono); text-align: center; background: var(--sea-soft); }

/* 报告 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--kai); font-size: 24px; min-width: 40px; text-align: center; padding: 2px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.chip.mix { font-size: 18px; }
.next { border-left: 4px solid var(--sun); }
label.opt { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
select { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 10px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 18px 16px 26px; }
.foot a { color: inherit; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; z-index: 9; animation: pop .2s; }
.letter-img { max-width: 100%; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); display: block; margin: 12px auto; }
.print-only { display: none; }

@media (max-width: 520px) {
  .brand { font-size: 17px; }
  .cand { width: 62px; height: 62px; font-size: 34px; }
  main { padding: 4px 12px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body, body.kid { background: #fff; color: #000; }
  .bar, .no-print, .kb, .foot, .stars, .sea-waves { display: none !important; }
  .print-only { display: block; }
  .panel { border-color: #ccc; break-inside: avoid; }
  main { max-width: none; }
}
.chips.centered { justify-content: center; }
.say-big { font-size: 26px; }
.progress > i { width: 0; }
/* 一屏放下（小岛原则 8）：游戏页压紧，退出按钮放在灯旁边 */
.sky.play { height: auto; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 0; }
.sky.play .quit { position: absolute; left: 0; top: 0; }
.stage { margin: 0 0 4px; }
.bottle { padding: 10px 22px 8px; }
.word { font-size: clamp(44px, 10vw, 66px); }
.pen { width: 96px; height: 96px; margin: 0 auto; }
.typebox { margin: 4px auto 0; }
.typed { font-size: 26px; min-height: 38px; }
.status { min-height: 1.4em; margin-top: 2px; }
.cands { margin: 6px 0; min-height: 70px; }
.cand { width: 66px; height: 66px; font-size: 36px; }
.kb { margin-top: 6px; }
.listen { margin: 2px 4px; padding: 4px 12px; }
.chat { max-height: 40vh; overflow-y: auto; padding: 4px; }
.letter-img { max-height: 62vh; width: auto; }
.bar { width: 100%; align-self: stretch; }
a.btn { text-decoration: none; display: inline-block; }

/* 品牌：小岛 Logo + 汉字小岛 · 打字（和田字格顶栏一样） */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.brand .dot { opacity: .5; margin: 0 -2px; }
.brand .dot, .brand .tool { color: var(--muted); font-weight: 500; }
@media (max-width: 420px) { .brand { font-size: 17px; gap: 6px; } .brand img { width: 28px; height: 28px; } }

/* 推荐和年龄 */
.choice { position: relative; }
.choice.suggest { border-color: var(--sun); box-shadow: 0 0 0 2px var(--sun) inset, 0 0 24px rgba(242, 184, 75, .25); }
.badge { position: absolute; top: 10px; right: 12px; background: var(--sun); color: var(--night-2); font-size: 13px; font-weight: 650; padding: 2px 10px; border-radius: 999px; }
.ages { display: grid; grid-template-columns: repeat(4, minmax(64px, 96px)); gap: 14px; justify-content: center; margin: 24px 0; }
.age { height: 84px; border-radius: 20px; border: 2px solid var(--line); background: var(--card); font: 700 40px var(--sans); }
.age:hover, .age:focus-visible { border-color: var(--sun); }
.listen.again { font-size: 14px; }
.listen.pulse { animation: pulse 1.2s ease-in-out 3; border-color: var(--sun); }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 16px rgba(242, 184, 75, .6); } }
.big-btn { font-size: 20px; padding: 14px 40px; min-height: 56px; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; }

/* 引导 */
.guide-top { margin-top: 4px; }
.steps { display: inline-flex; gap: 6px; }
.steps i { width: 26px; height: 6px; border-radius: 6px; background: var(--line); }
.steps i.on { background: var(--sun); }
.guide-text { font-size: 20px; max-width: 560px; margin: 6px auto 4px; line-height: 1.6; }
.key { position: relative; }
.key.bump::after { content: ""; position: absolute; left: 35%; right: 35%; bottom: 7px; height: 2px; border-radius: 2px; background: rgba(0, 0, 0, .45); }
.key .fl { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
.key .fl[data-fl="0"], .key .fl[data-fl="7"], .fleg li[data-f="0"] i, .fleg li[data-f="7"] i { background: var(--f0); }
.key .fl[data-fl="1"], .key .fl[data-fl="6"], .fleg li[data-f="1"] i, .fleg li[data-f="6"] i { background: var(--f1); }
.key .fl[data-fl="2"], .key .fl[data-fl="5"], .fleg li[data-f="2"] i, .fleg li[data-f="5"] i { background: var(--f2); }
.key .fl[data-fl="3"], .fleg li[data-f="3"] i { background: var(--f3); }
.key .fl[data-fl="4"], .fleg li[data-f="4"] i { background: var(--f4); }
.kb-row:nth-child(2) { margin-bottom: 14px; }
.key.done { box-shadow: 0 0 0 3px var(--sea); }
.key.hint { box-shadow: 0 0 0 3px var(--sun), 0 0 22px 6px rgba(242, 184, 75, .7); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 3px var(--sun), 0 0 8px 2px rgba(242, 184, 75, .4); } }
.key.glow { box-shadow: 0 0 0 3px var(--sea), 0 0 16px 4px rgba(31, 111, 104, .6); }
.fleg { list-style: none; padding: 0; margin: 8px auto; display: grid; grid-template-columns: repeat(4, auto); gap: 6px 16px; justify-content: center; font-size: 14px; }
.fleg li { display: flex; align-items: center; gap: 6px; opacity: .75; }
.fleg li.on { opacity: 1; font-weight: 700; }
.fleg li i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* 认识键盘 */
.keybig { display: inline-flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 26px; font: 700 72px var(--mono); background: var(--card); border: 2px solid var(--line); margin: 6px 0 2px; text-transform: lowercase; }
.keybig.got { border-color: var(--sun); box-shadow: 0 0 30px rgba(242, 184, 75, .55); }
.finger { font-size: 18px; min-height: 1.6em; margin: 6px 0 2px; }
.chip.mono { font: 600 22px var(--mono); }

/* 提示梯子：格子、淡淡的拼音、错的那个字母 */
.typed.slots { border-bottom-color: transparent; }
.typed .l { display: inline-block; min-width: .7em; text-align: center; }
.typed.slots .l { border-bottom: 2px solid var(--line); margin: 0 2px; min-width: .8em; }
.typed .l.ghost { opacity: .32; }
.typed .l.bad { color: var(--coral); border-bottom-color: var(--coral); }
.typed .l.tone { color: var(--sea); }

/* 手机：按系统键盘的比例，不分手指颜色（拇指打字没有手指分区） */
@media (pointer: coarse) and (max-width: 600px) {
  .key { width: calc((100vw - 24px - 9 * 5px) / 10); height: 46px; border-radius: 6px; font-size: 19px; }
  .key[data-f] { background: #f4f1ea; }
  .key .fl, .key.bump::after { display: none; }
  .kb-row:nth-child(2) { margin-bottom: 5px; }
  .kb-row:nth-child(2) { padding-left: calc((100vw - 24px) / 20); }
  .kb-row:nth-child(3) { padding-left: calc((100vw - 24px) / 7); }
}
.key .fl { width: 16px; height: 16px; bottom: -20px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.kb-row:nth-child(2) { margin-bottom: 22px; }
.hands { display: flex; justify-content: center; gap: 18%; font-size: 14px; color: var(--muted); margin: -4px 0 8px; }
.kb-row:nth-child(2) { margin-bottom: 5px; }
.kb.with-fingers .kb-row:nth-child(2) { margin-bottom: 22px; }
.kb .hands + .kb-row { padding-left: 40px; }

/* ===== 电脑、平板、手机三种屏幕 =====
   有屏幕键盘的页面（main.play）占满一屏：上面是题目，键盘贴在最下面。
   键的大小跟着屏幕走：平板上大（手指好点），电脑上小（有实体键盘，屏幕键盘只是参照），
   手机横屏和矮屏幕整体压紧（小岛原则 8：一屏放下，不滚动）。 */
main.play { display: flex; flex-direction: column; min-height: calc(100vh - 58px); min-height: calc(100dvh - 58px); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
main.play > .kb { margin-top: auto; padding-top: 10px; }
main.play > .chat { flex: 1 1 auto; max-height: none; min-height: 120px; }
.kb-row { gap: 6px; margin: 6px 0; }
.key { width: min(calc((100vw - 40px - 54px) / 10), 76px); height: clamp(40px, 6.6vh, 66px); font-size: clamp(16px, 2.4vh, 24px); border-radius: 10px; }
.key.wide { width: min(calc((100vw - 40px) / 4), 220px); }
.kb-row:nth-child(2) { padding-left: min(4vw, 34px); }
.kb .kb-row:nth-child(3), .kb .hands + .kb-row { padding-left: min(10vw, 80px); }
.word { font-size: clamp(44px, min(11vw, 8.5vh), 104px); }
.cand { width: clamp(58px, 9vh, 88px); height: clamp(58px, 9vh, 88px); font-size: clamp(32px, 5.4vh, 52px); }
.cands { min-height: clamp(64px, 10vh, 96px); }
.keybig { width: clamp(96px, 16vh, 170px); height: clamp(96px, 16vh, 170px); font-size: clamp(56px, 10vh, 104px); }
.pen { width: clamp(80px, 12vh, 140px); height: clamp(80px, 12vh, 140px); }
.lantern { width: clamp(18px, 2.6vh, 28px); height: clamp(26px, 3.6vh, 38px); }

/* 电脑（鼠标）：有实体键盘，屏幕键盘做参照，不用太大 */
@media (pointer: fine) {
  .key { width: min(calc((100vw - 40px - 54px) / 10), 54px); height: clamp(38px, 5.4vh, 50px); font-size: 17px; }
  .key.wide { width: min(calc((100vw - 40px) / 4), 140px); }
}
/* 手机竖屏：系统键盘的比例，铺满宽度，不分手指颜色 */
@media (pointer: coarse) and (max-width: 600px) {
  .key { width: calc((100vw - 24px - 54px) / 10); height: clamp(42px, 6vh, 52px); border-radius: 7px; font-size: 20px; }
  .key.wide { width: calc((100vw - 24px) / 3.4); }
  .kb-row { gap: 6px; margin: 7px 0; }
  .kb-row:nth-child(2) { padding-left: calc((100vw - 24px) / 20); }
  .kb .kb-row:nth-child(3), .kb .hands + .kb-row { padding-left: calc((100vw - 24px) / 7); }
  main { padding-left: 12px; padding-right: 12px; }
}
/* 手机横屏、矮屏幕：整体压紧 */
@media (max-height: 520px) {
  /* 页头压到 40px 以内：游戏页按“屏幕高度 − 40px”铺满 */
  .bar { padding: 4px 12px; }
  .brand img { width: 24px; height: 24px; }
  .brand { font-size: 16px; min-height: 0; }
  .seg { padding: 2px; }
  .seg button { min-height: 26px; padding: 2px 9px; font-size: 13px; }
  .icon-btn { width: 30px; height: 30px; }
  main.play { min-height: calc(100dvh - 40px); padding-top: 0; }
  .sky.play { padding: 0; }
  .lantern { width: 14px; height: 20px; }
  .lantern::before { display: none; }
  .bottle { padding: 4px 16px; border-radius: 22px; }
  .word { font-size: 38px; }
  .gloss { font-size: 13px; min-height: 0; }
  .sentence-q { font-size: 22px; }
  .listen { padding: 2px 10px; font-size: 13px; margin: 0 4px; }
  .typed { font-size: 20px; min-height: 28px; }
  .status { font-size: 13px; min-height: 1.2em; margin: 0; }
  .cands { min-height: 48px; margin: 2px 0; gap: 8px; }
  .cand { width: 48px; height: 48px; font-size: 28px; }
  .pen { width: 64px; height: 64px; }
  .keybig { width: 72px; height: 72px; font-size: 46px; }
  .finger { font-size: 15px; margin: 2px 0; }
  .key { height: 34px; font-size: 16px; }
  .kb-row { margin: 4px 0; }
  main.play > .kb { padding-top: 4px; }
  h1 { font-size: 22px; margin: 6px 0; }
  .guide-text { font-size: 15px; margin: 2px auto; }
  .kb.with-fingers .kb-row:nth-child(2) { margin-bottom: 16px; }
  .hands { font-size: 12px; margin: -6px 0 2px; }
  .chat { min-height: 60px; }
  .msg { font-size: 18px; padding: 6px 10px; }
  .focus-line { font-size: 26px; margin: 6px 0 2px; }
}
main.play > .stage, main.play > .keyq { margin-top: auto; }
main.play > .chat { margin-top: 0; }
/* 手机横屏：左边题目、右边键盘（两栏），一屏放下 */
@media (max-height: 520px) and (orientation: landscape) {
  main.play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: 18px; align-content: start; max-width: none; }
  main.play > * { grid-column: 1; }
  main.play > .stars, main.play > .sea-waves { grid-column: auto; }
  main.play > .kb { grid-column: 2; grid-row: 1 / span 30; align-self: center; margin: 0; padding: 0; }
  main.play > .stage, main.play > .keyq { margin-top: 0; }
  main.play .key { width: calc((57vw - 40px - 54px) / 10); height: 40px; }
  main.play .key.wide { width: calc(57vw / 4); }
  main.play .kb-row:nth-child(2) { padding-left: 2.4vw; }
  main.play .kb .kb-row:nth-child(3), main.play .kb .hands + .kb-row { padding-left: 6vw; }
  main.play > .chat { max-height: 34vh; }
}

/* 手指图 */
.hands-svg { width: clamp(180px, 34vh, 280px); height: auto; display: block; margin: 0 auto; }
.hands-svg .palm { fill: #f3e3d3; stroke: rgba(0, 0, 0, .12); }
.hands-svg .hf { stroke: rgba(0, 0, 0, .15); transition: opacity .2s; }
.hands-svg.dim .hf { opacity: .28; }
.hands-svg.dim .hf.on { opacity: 1; stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(242, 184, 75, .95)); }
.handhint { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 0; }
.handhint:empty { display: none; }
.handhint .hk { font: 700 34px var(--mono); width: 54px; height: 54px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #2b2a26; box-shadow: 0 0 0 3px var(--sun), 0 0 18px rgba(242, 184, 75, .6); }
.handhint .hk[data-f="0"], .handhint .hk[data-f="7"] { background: var(--f0); } .handhint .hk[data-f="1"], .handhint .hk[data-f="6"] { background: var(--f1); }
.handhint .hk[data-f="2"], .handhint .hk[data-f="5"] { background: var(--f2); } .handhint .hk[data-f="3"] { background: var(--f3); } .handhint .hk[data-f="4"] { background: var(--f4); }
.handhint .hands-svg { width: clamp(150px, 26vh, 220px); margin: 0; }
.finger.pic { margin: 4px 0; }
.guide-hands { margin: 6px 0; display: flex; justify-content: center; align-items: center; gap: 12px; }
@media (max-height: 520px) { .hands-svg { width: 150px; } .handhint .hands-svg { width: 120px; } .handhint .hk { width: 40px; height: 40px; font-size: 26px; } }

/* 第一次玩：编号步骤 */
.coach { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 2px auto 8px; padding: 6px 10px; max-width: 880px; border-radius: 14px; background: var(--sun-soft); color: var(--ink); font-size: 15px; }
.coach-label { font-weight: 700; margin-right: 4px; }
.coach li { opacity: .5; display: inline-flex; align-items: center; gap: 6px; }
.coach li b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-size: 13px; background: var(--line); color: var(--ink); }
.coach li.on { opacity: 1; font-weight: 700; }
.coach li.on b { background: var(--sun); color: var(--night-2); animation: pulse 1.2s ease-in-out infinite; }
.coach li.done { opacity: .7; }
.coach li.done b { background: var(--sea); color: #fff; }
.coach[hidden] { display: none; }
@media (max-height: 520px) { .coach { font-size: 12px; padding: 2px 8px; margin: 0 auto 2px; } }

/* 键的大小按键盘自己的宽度算（容器单位 cqw），放在哪一栏都不会溢出 */
.kb { container-type: inline-size; width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; }
.key { width: min(calc((100cqw - 54px) / 10), 76px); }
.key.wide { width: min(calc(100cqw / 3.4), 220px); }
.kb-row:nth-child(2) { padding-left: min(4cqw, 34px); }
.kb .kb-row:nth-child(3), .kb .hands + .kb-row { padding-left: min(11cqw, 90px); }
@media (pointer: fine) { .key { width: min(calc((100cqw - 54px) / 10), 54px); } .key.wide { width: min(calc(100cqw / 4), 140px); } }
@media (pointer: coarse) and (max-width: 600px) {
  .key { width: calc((100cqw - 54px) / 10); }
  .key.wide { width: calc(100cqw / 3.4); }
  .kb-row:nth-child(2) { padding-left: 5cqw; }
  .kb .kb-row:nth-child(3), .kb .hands + .kb-row { padding-left: 14cqw; }
}
@media (max-height: 520px) and (orientation: landscape) {
  main.play .key { width: calc((100cqw - 54px) / 10); height: 38px; }
  main.play .key.wide { width: calc(100cqw / 3.6); }
  main.play .kb-row:nth-child(2) { padding-left: 5cqw; }
  main.play .kb .kb-row:nth-child(3), main.play .kb .hands + .kb-row { padding-left: 14cqw; }
  main.play { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); }
  main.play > .sky.play .lanterns { gap: 6px; }
}
.handhint .hands-svg { width: clamp(180px, 30vh, 270px); }
.hands-svg.dim .hf { opacity: .35; }

/* 注音键盘（大千）：键上大字是注音符号，小字是英文字母；声调键用海青色 */
.key.zy { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; padding: 0; }
.key.zy b { font: 600 clamp(15px, 2.6vh, 22px) var(--sans); }
.key.zy small { font: 10px var(--mono); opacity: .55; margin-top: 2px; }
.key.zy.tone b { color: var(--sea); }
.zy-kb .key { width: min(calc((100cqw - 60px) / 11), 70px); }
@media (pointer: fine) { .zy-kb .key { width: min(calc((100cqw - 60px) / 11), 52px); } }
.zy-kb .kb-row:nth-child(2) { padding-left: min(3cqw, 26px); }
.zy-kb .kb-row:nth-child(3) { padding-left: min(6cqw, 52px); }
.zy-kb .kb-row:nth-child(4) { padding-left: min(9cqw, 78px); }
.keybig { flex-direction: column; }
.keybig small { display: block; font-size: 16px; opacity: .6; margin-top: -4px; }
.focus-en { font-size: 15px; min-height: 1.4em; margin: 0 0 4px; }
.zy-kb .key.wide { width: min(calc(100cqw / 3.4), 220px); }
@media (pointer: fine) { .zy-kb .key.wide { width: min(calc(100cqw / 4), 140px); } }

/* 这周来了几天 */
.week { margin: -4px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week .dots { display: inline-flex; gap: 7px; }
.week .dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.week .dots i.on { background: var(--sun); box-shadow: 0 0 10px rgba(242, 184, 75, .6); }
/* 家长门 */
.gate-q { font-size: 30px; font-weight: 700; margin: 14px 0; }
.gate .age { font-size: 26px; height: 64px; min-width: 84px; }

/* 欢迎页：和游戏页一样一屏放下，键盘贴底 */
.welcome-tag { margin: 2px 0 6px; }
main.play > #first { margin-top: auto; padding: 10px 14px; }
main.play > #first h2 { margin: 2px 0 4px; font-size: 18px; }
#first .word { font-size: clamp(40px, 9vh, 72px); }
#first .gloss, #first #fh { margin: 2px 0; }

/* 聊天页：整页固定一屏，聊天记录在中间自己滚动，键盘不会被挤出去 */
main.play:has(> .chat) { height: calc(100vh - 58px); height: calc(100dvh - 58px); min-height: 0; overflow: hidden; }
main.play > .chat { flex: 1 1 0; min-height: 60px; max-height: none; overflow-y: auto; }
main.play:has(> .chat) > h1 { margin: 2px 0; font-size: 20px; }
@media (max-height: 520px) { main.play:has(> .chat) { height: calc(100dvh - 40px); } }

/* 矮的电脑屏幕（小笔记本 720 高）：压紧一点，一屏放下 */
@media (max-height: 780px) and (min-height: 521px) {
  .bar { padding: 6px 16px; }
  .sky.play { padding: 0; }
  .coach { padding: 4px 10px; margin-bottom: 4px; font-size: 14px; }
  .word { font-size: clamp(40px, 7.5vh, 64px); }
  .bottle { padding: 6px 20px 6px; }
  .handhint .hands-svg { width: 150px; }
  .handhint .hk { width: 44px; height: 44px; font-size: 28px; }
  .kb-row { margin: 4px 0; }
}

/* 手机横屏的聊天页：聊天记录最多 30% 屏高（在里面滚动），大标题不显示，一屏放下 */
@media (max-height: 520px) and (orientation: landscape) {
  main.play:has(> .chat) > .chat { max-height: 24vh; min-height: 0; }
  main.play:has(> .chat) > h1 { display: none; }
  main.play:has(> .chat) { height: auto; overflow: visible; }
}

/* 手机竖屏的注音键盘：每排 11 个键，键间距收窄，键至少 30 像素宽 */
@media (pointer: coarse) and (max-width: 600px) {
  .zy-kb .kb-row { gap: 3px; }
  .zy-kb .key { width: calc((100cqw - 30px) / 11); }
  .zy-kb .kb-row:nth-child(2) { padding-left: 2cqw; }
  .zy-kb .kb-row:nth-child(3) { padding-left: 4cqw; }
  .zy-kb .kb-row:nth-child(4) { padding-left: 6cqw; }
  main { padding-left: 8px; padding-right: 8px; }
}

/* 键盘乐园 */
/* 键盘乐园和其他卡片同一种排法 */
.keybig.sound, .keybig.rhythm { width: auto; min-width: clamp(110px, 18vh, 180px); padding: 0 18px; font-family: var(--mono); text-transform: none; }
.word .hl { color: var(--sea); border-bottom: 3px solid var(--sun); }
.tones-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.tone-btn { width: clamp(72px, 18vw, 110px); height: clamp(72px, 12vh, 100px); border-radius: 18px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tone-btn b { font: 600 clamp(28px, 5vh, 40px) var(--sans); }
.tone-btn small { font-size: 12px; color: var(--muted); }
.tone-btn.right { border-color: var(--sun); box-shadow: 0 0 18px rgba(242, 184, 75, .6), 0 0 0 3px var(--sun) inset; }
.tone-btn.dim { opacity: .4; }

/* 注音键盘多一排：不太高的屏幕（平板横放等）把大字键缩小一点，整页不用滚动 */
@media (max-height: 900px) {
  main.play:has(> .zy-kb) .keybig { width: clamp(72px, 12vh, 120px); height: clamp(72px, 12vh, 120px); font-size: clamp(44px, 7.5vh, 72px); }
}

/* 一字开花：花心是这个字，花瓣是它组成的词 */
.word .kn, .kn { color: var(--sea); }
.word .kn { border-bottom: 3px dotted var(--sea); }
.kn-note { display: inline-block; margin-top: 8px; background: var(--sea-soft); color: var(--sea-ink); border-radius: 999px; padding: 1px 10px; font-size: 14px; }
.flower { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 440px; margin: 10px auto; }
.flower-core { grid-column: 2; grid-row: 2; display: grid; place-items: center; font-size: 64px; border-radius: 50%; background: var(--sun-soft); border: 2px solid var(--sun); aspect-ratio: 1; }
.petal { position: relative; border: 1px solid #ece7dc; background: var(--card); border-radius: 26px 26px 26px 8px; padding: 10px 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 84px; justify-content: center; }
.petal .pw { font-size: 30px; line-height: 1.1; }
.petal .pw b { color: var(--sea); font-weight: 400; }
.petal small { color: var(--muted); font-size: 12px; }
.petal .dot { position: absolute; top: -9px; right: -4px; line-height: 1.5; font-style: normal; font-size: 11px; background: var(--sea-soft); color: var(--sea-ink); border-radius: 999px; padding: 0 6px; }
.petal.cur { border-color: var(--sun); box-shadow: 0 0 0 2px var(--sun) inset; }
.petal.lit { background: var(--sun-soft); border-color: var(--sun); }
.flower .petal:nth-of-type(1) { grid-column: 1; grid-row: 1; } .flower .petal:nth-of-type(2) { grid-column: 2; grid-row: 1; }
.flower .petal:nth-of-type(3) { grid-column: 3; grid-row: 1; } .flower .petal:nth-of-type(4) { grid-column: 1; grid-row: 2; }
.flower .petal:nth-of-type(5) { grid-column: 3; grid-row: 2; } .flower .petal:nth-of-type(6) { grid-column: 2; grid-row: 3; }
main.play > .flower { margin-top: 4px; }
@media (max-height: 920px) { .flower { gap: 6px; max-width: 340px; margin: 4px auto; } .petal { min-height: 58px; padding: 4px; } .petal .pw { font-size: 22px; } .flower-core { font-size: 44px; } main.play:has(> .flower) .word { font-size: 44px; } main.play:has(> .flower) h1 { margin: 4px 0; font-size: 22px; } }

/* 每天一句 */
.diary-box { width: 100%; min-height: 64px; max-width: 620px; margin: 8px auto; padding: 12px 16px; background: var(--card); border: 1px solid #ece7dc; border-radius: var(--r); box-shadow: var(--shadow); font-size: clamp(24px, 5vw, 32px); line-height: 1.5; text-align: left; }
.diary-box .caret { display: inline-block; width: 2px; height: 1em; background: var(--sea); vertical-align: -4px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.cand.wide { width: auto; min-width: 74px; padding: 0 12px; }
.cand.known { border-color: var(--sea); }
.small-btn { padding: 6px 12px; min-height: 38px; font-size: 15px; }
.punct { display: inline-flex; gap: 6px; }
.diary-line { margin: 6px 0; }
#starters { margin: 4px 0; }

/* 图标：自绘 SVG（ui/icons.js），意思由旁边的文字说 */
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.28em; }
.choice > .ico { display: block; width: 60px; height: 60px; padding: 5px; margin-bottom: 10px; border-radius: 18px; background: #f6f0e4; }
.choice.suggest > .ico { background: var(--sun-soft); }
.listen .ico.sm { width: 18px; height: 18px; margin-right: 4px; vertical-align: -4px; }
.icon-btn { display: inline-grid; place-items: center; padding: 0; }
.icon-btn .ico { width: 20px; height: 20px; vertical-align: 0; }
.icon-btn[aria-pressed="false"] .ico { opacity: .4; }

/* 孩子首页：小岛插画 + 今天的灯笼 */
.hero { text-align: center; margin: 4px auto 0; max-width: 360px; }
.hero-art { width: 100%; height: auto; display: block; }
.hero .lanterns { margin-top: -6px; }
@media (max-height: 700px) { .hero { max-width: 240px; } }

/* 字体和字号：标题黑体、汉字内容楷体；只用 5 档字号 */
h1 { font-size: var(--t-xl); font-weight: 650; letter-spacing: .02em; }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
.choice strong { font-size: var(--t-lg); font-weight: 650; }
.choice .muted { font-size: var(--t-sm); line-height: 1.5; }
.muted.small, .small { font-size: var(--t-sm); }
.foot { font-size: var(--t-xs); }

/* 汉字小岛家族（家长和成人页面） */
.family .cards { margin: 10px 0 6px; }
a.choice { text-decoration: none; color: inherit; }

/* 今天的灯笼：和“还可以玩几轮”放在一起 */
.today { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 10px; text-align: left; }
.today p { margin: 0; }
.week .dots .day { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.week .dots small { font-size: 11px; color: var(--muted); line-height: 1; }

/* 找回码 */
.code-big { font: 600 clamp(20px, 5vw, 28px)/1.3 var(--mono); letter-spacing: .06em; text-align: center; background: var(--sun-soft); border-radius: 12px; padding: 10px; user-select: all; }
.restore input { flex: 1; min-width: 200px; font: 600 18px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cloud details { margin: 10px 0; }
.cloud summary { cursor: pointer; color: var(--sea); }

/* 留言 */
.fb textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; resize: vertical; margin: 6px 0 8px; }

/* 要打的空格：暖黄底线，轻轻闪，一眼看出“打这里” */
.word .slot:not(.filled), .sentence-q .slot:not(.filled) { border-bottom-color: var(--sun); background: linear-gradient(transparent 70%, rgba(242, 184, 75, .18) 70%); animation: slotpulse 1.6s ease-in-out infinite; }
@keyframes slotpulse { 50% { border-bottom-color: var(--coral); } }
@media (prefers-reduced-motion: reduce) { .word .slot, .sentence-q .slot { animation: none; } }

/* 返回：左上角，带文字（孩子看不懂单独的 ✕） */
.back-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: var(--t-sm); font-weight: 600; color: var(--ink); min-height: 38px; box-shadow: 0 2px 0 var(--line); }
.back-btn span { font-size: 22px; line-height: 1; margin-top: -2px; }
@media (max-height: 520px) { .back-btn { min-height: 30px; padding: 2px 10px 2px 8px; } }

/* 提示（2026-11-23 重做）：淡淡的拼音更清楚，下一个要按的字母亮起来；手指图轮廓清楚，下面写“用左手中指按 E” */
.typed .l.ghost { opacity: .5; }
.typed .l.ghost.next { opacity: 1; color: var(--sea); border-bottom-color: var(--sun) !important; border-bottom-width: 3px !important; animation: slotpulse 1.4s ease-in-out infinite; }
.hands-svg .hf, .hands-svg.dim .hf, .hands-svg.dim .hf.on { opacity: 1; filter: none; }
.hands-svg .hf.on { filter: drop-shadow(0 0 6px rgba(242, 184, 75, .9)); }
.hands-svg.all .hf { stroke-width: 1.6; }
.handhint { display: grid; grid-template-columns: auto auto; grid-template-areas: "key hands" "cap cap"; align-items: center; justify-content: center; column-gap: 14px; row-gap: 4px; }
.handhint .hk { grid-area: key; }
.handhint .hands-svg { grid-area: hands; }
.handhint .hcap { grid-area: cap; text-align: center; font-size: var(--t-md); font-weight: 600; color: var(--ink); }

/* 第一屏：拼音/注音切换；“你好”淡淡显示，照着选 */
.welcome-sch { margin: 6px 0 0; }
#fw .slot.ghost-c:not(.filled) { color: var(--ink); opacity: .28; }
.parent-note ol { margin: 6px 0 0; padding-left: 1.3em; }
.parent-note li { margin: 4px 0; }
.link-btn { border: 0; background: none; color: var(--sea); text-decoration: underline; cursor: pointer; font: inherit; }

/* 能点的小按钮（原来是一行带下划线的字，看不出能点）：白底、边框、图标、一点阴影 */
.pill, .link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 16px 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--sea-ink); font: 600 var(--t-sm)/1.2 var(--sans); text-decoration: none; box-shadow: 0 2px 0 var(--line); cursor: pointer; }
.pill:hover, .link-btn:hover { border-color: var(--sea); }
.pill:active, .link-btn:active { transform: translateY(2px); box-shadow: none; }
.pill .ico { width: 22px; height: 22px; }
.pills { gap: 10px; margin: 14px 0 6px; }
.listen .ico.sm, .listen.again .ico.sm { margin-right: 4px; }
.listen { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 6px 16px; border-color: var(--sun); background: var(--card); font-weight: 600; box-shadow: 0 2px 0 var(--line); }

/* 汉字小岛家族：显眼一点（暖黄底、彩色卡片、明显的“去认字 →”按钮） */
.panel.family { background: linear-gradient(135deg, var(--sun-soft), #fdf6e6); border: 2px solid var(--sun); }
.panel.family h3 { font-size: var(--t-lg); margin-top: 4px; }
.choice.fam { display: flex; flex-direction: column; gap: 4px; }
.choice.fam.island { background: var(--sea-soft); border-color: #bcd9cf; }
.choice.fam.tz { background: var(--coral-soft); border-color: #f0c9b9; }
.choice.fam .ico { background: #fff; }
.choice.fam .go { align-self: flex-start; margin-top: 10px; padding: 8px 18px; border-radius: 14px; background: var(--sea); color: #fff; font-weight: 650; box-shadow: 0 3px 0 var(--sea-ink); }
.choice.fam.tz .go { background: var(--coral); box-shadow: 0 3px 0 #b3583f; }
.choice.fam:hover { transform: translateY(-2px); }

/* 孩子首页的“今天 / 这周”：一个面板，两栏对齐（窄屏上下排） */
.panel.status { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 14px 10px; max-width: 640px; margin: 6px auto 14px; }
.panel.status .stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 0 10px; }
.panel.status .stat + .stat { border-left: 1px solid var(--line); }
.panel.status .lanterns { margin: 0; }
.panel.status .week { margin: 0; gap: 6px; }
.panel.status .week > .muted { font-size: var(--t-md); font-weight: 650; color: var(--ink); order: 2; }
@media (max-width: 520px) { .panel.status { grid-template-columns: 1fr; gap: 12px; } .panel.status .stat + .stat { border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } }

/* 卡片：图标在左、文字在右；一行两张（4 张正好两行，不会剩一张孤零零），窄屏一行一张 */
.cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.choice:has(> .ico) { display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; align-content: center; align-items: start; text-align: left; }
.choice:has(> .ico) > .ico { grid-row: 1 / span 3; margin: 0; align-self: center; }
.choice:has(> .ico) > strong, .choice:has(> .ico) > .muted, .choice:has(> .ico) > .go { grid-column: 2; }
.choice:has(> .ico) > strong { margin: 2px 0 2px; }

.choice.suggest .badge { top: -11px; right: 14px; box-shadow: 0 2px 0 rgba(0,0,0,.06); }
.cards { row-gap: 22px; }
.choice.fam { display: grid; }
.choice.more { border: 2px dashed var(--sun); background: var(--sun-soft); }

/* 一排按钮：一样高、垂直居中、整排居中（.btn 和 .pill 混排时也对齐） */
.row { align-items: center; }
.pill, .btn { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; }
.pills { justify-content: center; flex-wrap: wrap; }
.row.center > * { margin-top: 0; margin-bottom: 0; }

.choice.fam .go { justify-self: start; }

/* 孩子首页的问候（照汉字小岛首页“晚上好”） */
h1.greet { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0 12px; }
h1.greet .muted { font-size: var(--t-md); font-weight: 500; }

/* 9 个年龄排成 3×3，不剩一个孤零零的 */
.ages { grid-template-columns: repeat(3, minmax(64px, 104px)); }

/* 单选列表（中文水平）：一列竖排 */
.cards.list { grid-template-columns: 1fr; max-width: 560px; margin-left: auto; margin-right: auto; row-gap: 12px; }
h1.greet.left { align-items: flex-start; }
/* 报告里的三个数字 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stat-card { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--card); border: 1px solid #ece7dc; border-radius: var(--r); padding: 10px 6px; box-shadow: var(--shadow); text-align: center; }
.stat-card .ico { width: 34px; height: 34px; }
.stat-card b { font-size: var(--t-lg); }

/* 孩子首页底部的汉字小岛家族：看得见，点了先过家长门 */
.kid-family { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 18px auto 6px; padding: 12px 14px; max-width: 640px; border-radius: var(--r); background: #fffaf0; border: 1px dashed var(--sun); }
.kid-family > .muted:first-child { width: 100%; text-align: center; font-weight: 600; }
.fam-mini { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 16px; border: 1px solid #ece7dc; box-shadow: 0 2px 0 var(--line); cursor: pointer; text-align: left; }
.fam-mini.island { background: var(--sea-soft); }
.fam-mini.tz { background: var(--coral-soft); }
.fam-mini img, .fam-mini .ico { width: 36px; height: 36px; border-radius: 10px; background: #fff; }
.fam-mini span { display: flex; flex-direction: column; }
.fam-mini small { color: var(--muted); }
.kid-family .lock { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 4px; }
.kid-family .lock .ico { width: 18px; height: 18px; }

/* 手怎么放：重要的入口，做成显眼的卡片和暖黄按钮 */
.hands-card { max-width: 720px; margin: 0 auto 16px; background: var(--sun-soft); border: 2px solid var(--sun); }
.hands-card > .ico { background: #fff; }
.pill.strong { background: var(--sun-soft); border-color: var(--sun); color: var(--ink); }

/* 手机：灯笼小一点，不被左上角的“返回”压住 */
@media (max-width: 520px) { .sky.play .lanterns { gap: 5px; } .sky.play .lantern { width: 14px; height: 20px; border-radius: 6px 6px 8px 8px; } .sky.play .lantern::before { left: 6px; top: -6px; height: 6px; } }
/* 小标签（认识键盘：中间一排） */
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--sea-soft); color: var(--sea-ink); font-weight: 600; font-size: var(--t-sm); }
.pills.tight { margin: 4px 0; }
/* 触屏引导：往下指的大手指 */
.guide-point { display: flex; flex-direction: column; align-items: center; margin: 24px 0; animation: pointbob 1.4s ease-in-out infinite; }
.guide-point .ico { width: 84px; height: 84px; transform: rotate(180deg); }
.guide-point span { font-size: 34px; color: var(--sun); font-weight: 700; line-height: 1; }
@keyframes pointbob { 50% { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .guide-point { animation: none; } }

/* 矮屏幕（笔记本 1280×720 等）：练习页上下收紧，键盘不被挤出屏幕 */
@media (max-height: 780px) and (min-height: 521px) {
  main.play .coach { margin: 0 auto 4px; padding: 3px 10px; font-size: 13px; }
  main.play .coach li b { width: 18px; height: 18px; font-size: 11px; }
  main.play .keybig { width: clamp(72px, 13vh, 120px); height: clamp(72px, 13vh, 120px); font-size: clamp(44px, 8vh, 76px); }
  main.play > .stage, main.play > .keyq { margin-bottom: 2px; }
  main.play .typebox { margin: 4px auto 2px; }
  main.play .cands { margin: 6px 0; }
  #first h2 { margin: 4px 0; }
  .welcome-tag { margin: 2px 0; }
}

.pill.small-pill { min-height: 34px; padding: 4px 12px 4px 8px; font-size: 13px; }
.pill.small-pill .ico { width: 18px; height: 18px; }
.welcome-sch { gap: 8px 12px; }

/* 最下面一排：退格、空格写上字；空格键宽一些 */
.kb-row.bottom .key.wide { font: 600 15px var(--sans); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.kb-row.bottom .key.back { width: clamp(84px, 22vw, 120px); }
.kb-row.bottom .key.space { width: clamp(150px, 42vw, 260px); }
.kb-row.bottom .sym { font-size: 20px; line-height: 1; }

/* 手机首页：插画小一点、状态面板保持两栏，第一张玩法卡片在首屏就看得到 */
@media (max-width: 520px) {
  .hero { max-width: 190px; }
  h1.greet { font-size: 24px; margin: 2px 0 8px; }
  .panel.status { grid-template-columns: 1fr 1fr; gap: 0; padding: 10px 4px; }
  .panel.status .stat + .stat { border-left: 1px solid var(--line); border-top: 0; padding-top: 0; }
  .panel.status .stat { padding: 0 6px; gap: 4px; }
  .panel.status .lantern { width: 15px; height: 21px; }
  .panel.status .lanterns { gap: 5px; }
  .panel.status strong, .panel.status .week > .muted { font-size: 14px; }
  .panel.status .stat > .muted.small { font-size: 12px; line-height: 1.35; }
  .week .dots { gap: 4px; }
  .week .dots i { width: 10px; height: 10px; }
}

/* 手机：“怎么玩”只显示当前这一步，不挤掉题目 */
@media (max-width: 520px) { .coach li:not(.on) { display: none; } .coach { flex-wrap: nowrap; } }
#gear[hidden] { display: none; }

.no-title .panel > h3:first-child, .no-title > section > h3:first-child { display: none; }
/* 手机顶栏：放得下语言、声音、设置三个按钮 */
@media (max-width: 420px) {
  .bar { padding: 6px 10px; gap: 6px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .bar-right { gap: 4px; }
  .seg button { padding: 2px 7px; min-height: 30px; font-size: 13px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn .ico { width: 18px; height: 18px; }
}

/* 背景铺满整页（长页面下半截不再露白） */
html { background: var(--paper); }
body { background-attachment: scroll; background-size: 100% 100vh; background-repeat: no-repeat; background-color: #e9f1ec; }
/* 家长门的 4 个答案：2×2 */
.gate .row.center { display: grid; grid-template-columns: repeat(2, minmax(80px, 120px)); justify-content: center; gap: 12px; }
/* 声调题：高亮字下面的线和“听”按钮不挤在一起 */
.keyq .word { margin-bottom: 10px; }
/* 给长辈发消息：返回和标题一行；电脑上对话框宽一点 */
.chat-top { justify-content: center; position: relative; }
.chat-top .back-btn { position: absolute; left: 0; }
.chat-top h1 { margin: 4px 0; font-size: var(--t-lg); }
@media (min-width: 900px) { .chat { max-width: 680px; } .msg { font-size: 26px; } }
/* 每天一句：没打拼音时输入行不占一大块 */
#dbuf:empty { min-height: 0; border-bottom: 0; padding: 0; }
/* 专注练习的返回按钮和标题之间留点空 */
.row > .back-btn + strong { margin-left: 6px; }
.coach-label { white-space: nowrap; }
/* 一字开花在手机和矮屏幕上收紧：键盘不被挤出屏幕 */
@media (max-height: 920px), (max-width: 520px) {
  main.play:has(> .flower) .flower { max-width: 300px; gap: 5px; }
  main.play:has(> .flower) .petal { min-height: 50px; padding: 3px; }
  main.play:has(> .flower) .petal .pw { font-size: 20px; }
  main.play:has(> .flower) .petal small { font-size: 11px; }
  main.play:has(> .flower) .flower-core { font-size: 36px; }
  main.play:has(> .flower) > .stage .word { font-size: 36px; }
  main.play:has(> .flower) h1 { font-size: 20px; margin: 2px 0; }
}

.stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 520px) and (max-height: 900px) { main.play .keybig { width: 84px; height: 84px; font-size: 52px; } main.play .keybig.sound, main.play .keybig.rhythm { min-width: 84px; } }

/* 手机横放（高 ≤ 520）：一屏放下。提示条只留当前一步、标题缩小、开头按钮一行、大字母小一点 */
@media (max-height: 520px) and (orientation: landscape) {
  main.play .coach { flex-wrap: nowrap; margin: 0 0 2px; padding: 2px 8px; font-size: 12px; }
  main.play .coach li:not(.on), main.play .coach .coach-label { display: none; }
  main.play > h1 { font-size: 17px; margin: 0 0 2px; }
  main.play .keybig { width: 60px; height: 60px; font-size: 38px; margin: 2px 0; }
  main.play .keyq > p, main.play .stage > p.muted { margin: 2px 0; font-size: 13px; }
  main.play .listen { min-height: 32px; padding: 3px 12px; margin: 2px; }
  main.play .typed { font-size: 22px; min-height: 30px; }
  main.play #starters { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 2px 0; }
  main.play #starters .btn { min-height: 32px; padding: 3px 10px; white-space: nowrap; }
  main.play .diary-box { min-height: 44px; padding: 6px 10px; font-size: 20px; margin: 4px 0; }
  main.play .flower { max-width: 240px; }
  main.play .petal { min-height: 40px; }
  main.play .flower-core { font-size: 28px; }
  main.play .focus-line { font-size: 22px; margin: 2px 0; }
  main.play .focus-en { margin: 0; font-size: 12px; }
  main.play .progress { margin: 2px 0; }
  .welcome-tag, .welcome-sch .muted { display: none; }
  #first { padding: 6px 10px; margin: 2px 0; }
  #first h2 { font-size: 15px; margin: 0; }
  #first .word { font-size: 34px; }
  .guide-text { margin: 2px 0; font-size: 14px; }
  .guide-point { margin: 4px 0; }
  .guide-point .ico { width: 44px; height: 44px; }
  .guide-point span { font-size: 20px; }
  .chat-top h1 { font-size: 15px; }
}

/* 平板横放（高 ≤ 900）：练习页也收紧（之前只管到 780 高） */
@media (max-height: 900px) and (min-height: 781px) {
  main.play .coach { margin: 0 auto 4px; padding: 3px 10px; font-size: 13px; }
  main.play .keybig { width: clamp(80px, 12vh, 110px); height: clamp(80px, 12vh, 110px); font-size: clamp(48px, 7.5vh, 70px); }
  main.play .typebox { margin: 4px auto 2px; }
}
/* 手机横放的一字开花：花瓣里已经看得到要打的词，下面不再重复一遍 */
@media (max-height: 520px) and (orientation: landscape) {
  main.play:has(> .flower) > .stage { display: none; }
  main.play:has(> .flower) .flower { gap: 3px; }
  main.play:has(> .flower) .petal small { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) { main.play:has(> .flower) .petal { min-height: 34px; padding: 2px; } main.play:has(> .flower) .petal .pw { font-size: 18px; } main.play:has(> .flower) > h1 { font-size: 15px; margin: 0; } }

/* 平板横放 + 注音键盘（多一排）：键矮一点 */
@media (max-height: 900px) and (min-height: 521px) and (orientation: landscape) { main.play .zy-kb .key { height: 46px; } main.play .zy-kb .kb-row { margin: 3px 0; } main.play:has(> .zy-kb) .keybig { width: 80px; height: 80px; font-size: 48px; } }

/* 首页静态介绍（程序启动前、搜索引擎和 AI 看到的内容） */
.seo-intro { max-width: 760px; margin: 0 auto; }
.seo-intro h1 { margin-top: 18px; }
.seo-intro .lead { font-size: 18px; }
.seo-intro dt { font-weight: 650; margin-top: 10px; }
.seo-intro dd { margin: 2px 0 0; color: var(--muted); }
