/* 哈珀未来学院 · 哈珀打字：样式（页头 / 选关 / 打字区 / 键盘 / 弹窗，电脑、平板、手机一套） */
:root {
  --teal: #2b6cb0; --teal-d: #173f63; --teal-l: #7db4e6; --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb; --bg: #f3f5f7;
  --head: #16324f; --gold: #f5b942; --gold-d: #e0961e; --ok: #2563eb; --bad: #ef4444; --brand: #225b8a;
  --f-l5: #f87171; --f-l4: #fb923c; --f-l3: #facc15; --f-l2: #22d3ee; --f-r2: #60a5fa; --f-r3: #6366f1; --f-r4: #c084fc; --f-r5: #f472b6; --f-th: #94a3b8;
  --mono: "Consolas", "Menlo", "SF Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
.soft-input { position: fixed; left: 0; top: 0; width: 10px; height: 10px; opacity: 0.01; font-size: 16px; border: none; outline: none; background: transparent; z-index: 0; pointer-events: none; }   /* 必须留在可视视口内（不能挪到屏幕外或负层级），部分安卓浏览器否则不弹系统键盘 */

/* ───── 顶部导航（首页 / 选关页）───── */
.nav { background: linear-gradient(90deg, #173f63, #2b6cb0); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.nav-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: none; }
.brand img { height: 42px; width: auto; display: block; }
.brand b { font-size: 22px; letter-spacing: 1px; line-height: 1.1; display: block; }
.brand small { font-size: 12px; opacity: .85; display: block; letter-spacing: 2px; }
.menu { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.menu a { padding: 8px 16px; border-radius: 999px; text-decoration: none; color: #fff; font-weight: 600; font-size: 17px; white-space: nowrap; }
.menu a.on, .menu a:hover { background: rgba(0,0,0,.18); }
.login-btn { background: #fff; color: #173f63; border: 0; border-radius: 10px; padding: 9px 18px; font-weight: 700; flex: none; }
.login-btn:hover { background: #e8f1fa; }
.user-chip { display: flex; align-items: center; gap: 8px; flex: none; font-size: 14px; }
.user-chip button { background: rgba(255,255,255,.2); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; }

/* ───── 首页 ───── */
.hero { background: radial-gradient(circle at 12% 18%, rgba(125,180,230,.35), transparent 38%), radial-gradient(circle at 88% 80%, rgba(99,102,241,.28), transparent 40%), linear-gradient(135deg, #0f3459 0%, #1b5a94 55%, #3a8ad0 100%); color: #fff; overflow: hidden; }
.hero-in { max-width: 1180px; margin: 0 auto; padding: 48px 20px 64px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: center; min-height: 480px; }
.hero h1 { font-size: 46px; margin: 0 0 18px; line-height: 1.2; }
.hero ul { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 22px; }
.hero ul li::before { content: "✓ "; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-gold { background: linear-gradient(#3b86cf, #225b8a); color: #fff; border: 0; border-radius: 10px; padding: 14px 34px; font-size: 20px; font-weight: 800; text-decoration: none; display: inline-block; box-shadow: 0 6px 16px rgba(23,63,99,.35); }
.hero .btn-gold { background: #fff; color: #173f63; }
.btn-line { border: 2px solid #fff; color: #fff; background: transparent; border-radius: 10px; padding: 12px 30px; font-size: 20px; font-weight: 700; text-decoration: none; display: inline-block; }
.features { max-width: 1180px; margin: 0 auto; padding: 36px 20px 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.feature h3 { margin: 0 0 6px; font-size: 20px; color: var(--teal-d); }
.feature p { margin: 0; color: var(--muted); }
.feature-new { position: relative; display: block; text-decoration: none; border: 2px solid var(--gold); background: linear-gradient(135deg, #fffaf0, #fff); }
.feature-new h3 { color: var(--brand); }
.feature-new:hover { transform: translateY(-3px); transition: transform .12s; }
.new-badge { position: absolute; top: -10px; right: 14px; background: linear-gradient(90deg, var(--gold), var(--gold-d)); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.hero .cta a.gram-cta { border-color: var(--gold); color: var(--gold); }
.hero .cta a.gram-cta:hover { background: rgba(245,185,66,.14); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 12px 34px; }

/* ───── 选关页 ───── */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.subtabs a { padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 15px; }
.subtabs a.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.resume { background: #fff; border: 1px solid #b7d3ee; border-left: 6px solid var(--teal); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.resume b { color: var(--teal-d); }
.resume a { margin-left: auto; }
.page h2 { margin: 6px 0 14px; display: inline-block; background: var(--head); color: #fff; padding: 6px 22px; transform: skewX(-12deg); font-size: 20px; }
.page h2 span { display: inline-block; transform: skewX(12deg); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: #fff; border: 3px solid #d7dde2; border-radius: 6px; text-decoration: none; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-3px); border-color: var(--teal); }
.card .no { font-size: 22px; font-weight: 800; color: #6b7280; padding: 4px 8px 0; display: flex; justify-content: space-between; align-items: center; }
.card .stars { font-size: 13px; color: var(--gold-d); letter-spacing: 1px; }
.card .thumb { height: 74px; margin: 2px 8px 6px; border-radius: 8px; display: grid; place-items: center; font: 800 28px var(--mono); color: #fff; letter-spacing: 3px; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.card .name { background: #e6effa; color: #173f63; text-align: center; font-size: 14px; padding: 6px 4px; min-height: 44px; display: flex; align-items: center; justify-content: center; line-height: 1.25; font-weight: 600; }
.card.done { border-color: #93c5fd; }
.card-wrap { display: flex; flex-direction: column; gap: 6px; }
.card-wrap .card { flex: 1; }
.card-gram { display: flex; align-items: center; justify-content: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; text-decoration: none; font-size: 12.5px; font-weight: 700; color: var(--teal-d); }
.card-gram:hover { border-color: var(--teal); color: var(--teal); }
.card-gram svg { width: 14px; height: 14px; flex: none; }

.stats-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.stats-table th, .stats-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.stats-table th { background: #f1f5f9; }

/* ───── 打字页 ───── */
.play-head { background: var(--head); color: #fff; display: flex; align-items: center; gap: 16px; padding: 14px 24px; box-shadow: 0 3px 10px rgba(0,0,0,.15); position: relative; }
.play-head .back, .play-head .redo { background: transparent; color: #fff; border: 2px solid #fff; border-radius: 8px; width: 52px; height: 40px; font-size: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.play-head .redo { border: 0; width: 44px; font-size: 30px; }
.play-head .back svg { width: 20px; height: 20px; }
.play-head .redo svg { width: 26px; height: 26px; }
.play-head h1 { flex: 1; min-width: 0; text-align: center; font-size: 26px; margin: 0; font-weight: 600; padding-right: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-head .brand img { height: 38px; }
.play-head .brand b { font-size: 20px; }
.play-head .tool.off { opacity: .5; }   /* 开关关状态：图标变暗（文字里仍写「关」，提示标签也还在） */
/* 顶栏按钮的提示标签：悬停快速淡入（不用原生 title 的 2 秒延迟），平板长按 0.45 秒也会显示（JS 加 .tip-show） */
.play-head button { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.play-head [data-tip] { position: relative; }
.play-head [data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%) translateY(-4px); background: #1f2937; color: #fff; font-size: 13px; font-weight: 400; padding: 5px 10px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.play-head [data-tip]:hover::after, .play-head [data-tip]:focus-visible::after, .play-head [data-tip].tip-show::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.play-head .head-tools [data-tip]:last-child::after, .play-head > [data-tip]:last-child::after { left: auto; right: 0; transform: translateY(-4px); }   /* 最右的按钮提示靠右对齐，不超出屏幕 */
.play-head .head-tools [data-tip]:last-child:hover::after, .play-head .head-tools [data-tip]:last-child.tip-show::after, .play-head > [data-tip]:last-child:hover::after, .play-head > [data-tip]:last-child.tip-show::after { transform: translateY(0); }
@media (max-width: 1360px) { .play-head .brand b { display: none; } .play-head { gap: 10px; } .play-head .tool { padding: 6px 8px; font-size: 13px; } .play-head .tool span { display: none; } .play-head .tool svg { margin-right: 0; } }   /* 平板：顶栏只留 logo，开关收成纯线性图标（明暗表示开关），把空间让给课名；640px 以下连 logo 一起藏，见下 */
.pbar { height: 6px; background: #10304f; }
.pbar i { display: block; height: 100%; width: 0; background: #60a5fa; transition: width .15s; }
.play-wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 30px; }
.typing-panel { background: #fff; border-radius: 6px; padding: 14px 26px 16px; min-height: 200px; max-height: 38vh; overflow: auto; position: relative; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.tip { position: absolute; left: 14px; top: -6px; background: #1f2937; color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 6px; z-index: 2; display: none; }
.sound-pick { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 4px; color: var(--muted); font-size: 13px; }
.sound-pick button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 14px; font-size: 13px; line-height: 1.5; }
.sound-pick button.on { background: var(--teal-d); border-color: var(--teal-d); color: #fff; }
.play-wrap.core .tip { left: 50%; top: auto; bottom: 8px; transform: translateX(-50%); }   /* 语法打字：中文在上方居中，提示挪到下面，别压在中文上 */
.line { font: 500 27px/1.3 var(--mono); letter-spacing: 3px; padding: 14px 0 12px; border-bottom: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; color: #374151; }
.line .cn { display: block; font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.line.done { color: #1d4ed8; }
.line .c.ok { color: #2563eb; background: #eaf2ff; }
.line .c.cur { color: #1d4ed8; border-bottom: 3px solid #2563eb; animation: blink 1s steps(2, start) infinite; }
.line .c.err { color: #fff; background: var(--bad); border-radius: 3px; }
@keyframes blink { to { border-bottom-color: transparent; } }
.hint-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px 2px 0; color: var(--muted); font-size: 14px; }
.hint-row b { color: var(--ink); }

/* 键盘 */
.kb-wrap { position: relative; container-type: inline-size; margin: 8px auto 0; max-width: 840px; background: #d9dde2; border-radius: 14px; padding: 12px 14px 14px; box-shadow: inset 0 0 0 2px #cdd2d8; user-select: none; }
.kb-row { display: flex; margin: 6px -3px 0; }
.kb-row:first-child { margin-top: 0; }
.key { flex: var(--w, 1) 1 0; min-width: 0; margin: 0 3px; height: 46px; height: calc(100cqw / 15 * .86); min-height: 28px; border-radius: 6px; background: #fff; border: 0; box-shadow: 0 2px 0 #b8bec6; color: #374151; font-size: clamp(11px, 2.1cqw, 16px); display: grid; place-items: center; position: relative; line-height: 1.05; text-align: center; padding: 0; }
.key small { display: block; font-size: .66em; color: #9ca3af; }
.key.f-l5 { --fc: var(--f-l5); } .key.f-l4 { --fc: var(--f-l4); } .key.f-l3 { --fc: var(--f-l3); } .key.f-l2 { --fc: var(--f-l2); }
.key.f-r2 { --fc: var(--f-r2); } .key.f-r3 { --fc: var(--f-r3); } .key.f-r4 { --fc: var(--f-r4); } .key.f-r5 { --fc: var(--f-r5); } .key.f-th { --fc: var(--f-th); }
.key::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 2px; background: var(--fc); opacity: .55; }
.key.next { background: var(--fc); color: #111827; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--fc); transform: translateY(-1px); z-index: 1; }
.key.next::after { opacity: 0; }
.key { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }   /* 屏幕键盘可点 / 可触摸输入 */
.key.press { transform: translateY(2px); box-shadow: 0 0 0 #b8bec6; }
.key.on { background: #bfdbfe; box-shadow: 0 0 0 2px #2563eb inset; }                                                                      /* Shift / Caps 开着 */
.key.hit { background: #93c5fd; }
.key.miss { background: #fca5a5; }
.key.home::before { content: ""; position: absolute; bottom: 8px; left: 50%; width: 12px; height: 2px; margin-left: -6px; background: #9ca3af; border-radius: 2px; }
/* 手形：肉粉色半透明的手盖在键盘上；手指从键盘下沿伸进来，只露出键盘上面的部分（超出键盘的裁掉），下沿轻轻渐隐 */
.kb-wrap { overflow: hidden; }
.hands-ov { position: absolute; left: 14px; top: 12px; width: calc(100% - 28px); height: auto; overflow: visible; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 40%, rgba(0,0,0,.35) 53%); mask-image: linear-gradient(to bottom, #000 0, #000 40%, rgba(0,0,0,.35) 53%); }
.hands-ov .skin { opacity: .62; filter: drop-shadow(0 0 1.4px #9c6f68) drop-shadow(0 4px 6px rgba(110, 60, 50, .25)); }       /* 整只手一个轮廓：边缘柔和描一圈，指根、掌心不出现多余的线 */
.hands-ov .skin .f { fill: url(#skinG); }
.hands-ov .hl { fill: transparent; stroke: none; transition: fill .12s; }
.hands-ov .cr { fill: none; stroke: #a87a73; stroke-width: 2.4; stroke-linecap: round; opacity: .32; }
.hands-ov .pad { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .22; }
.hands-ov .fg.on .hl { fill: var(--c, #2b6cb0); opacity: .78; filter: drop-shadow(0 0 6px var(--c, #2b6cb0)); }
.hands-ov .fg.on .cr { stroke: rgba(255, 255, 255, .6); opacity: .8; }
.hands-ov .fg.on .pad { opacity: .5; }
.finger-tip { text-align: center; color: var(--muted); font-size: 15px; margin-top: 10px; min-height: 24px; font-weight: 600; }
.play-wrap.no-kb .kb-wrap, .play-wrap.no-kb .finger-tip { display: none; }   /* 「键盘：关」：藏掉屏幕键盘和指法提示，打字内容能多看几句 */
.play-wrap.no-kb .typing-panel { max-height: calc(100vh - 190px); }   /* 藏了键盘后打字区吃满剩下的高度（顶栏+进度条+状态行约 190px），不留大片空白 */

/* ───── 语法打字（单行打字机：和「英文练习」同一套引擎，只是单行居中 + 还没打的字浅灰色提示）───── */
.play-wrap.core { --ghost-a: .28; }
.play-wrap.core .typing-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 220px; max-height: none; }
.play-wrap.core .line { display: none; position: relative; text-align: center; border-bottom: 0; padding-top: calc(var(--cn-h, 38px) + 16px); }
.play-wrap.core .line.show-line { display: block; }
.play-wrap.core .line .cn { position: absolute; top: 0; left: 0; right: 0; text-align: center; font: 700 26px/1.35 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; color: var(--ink); }   /* 中文提示固定在这一句上方（不改 DOM 顺序，charEl 靠 children 下标取字符，顺序不能变） */
.play-wrap.core .line .c { display: inline-block; margin: 0 1px; padding-bottom: 2px; }   /* 每个字一段独立样式，字符间留缝不连成一条线 */
.play-wrap.core .line .c.ok { color: #2563eb; background: none; border-bottom-color: transparent; }
.play-wrap.core .line .c.case { color: #8b5cf6; background: none; border-bottom-color: transparent; }   /* 大小写不同但不算错 */
.play-wrap.core .line .c.cur { color: rgba(55, 65, 81, var(--ghost-a)); border-bottom-color: #2563eb; }   /* 当前要打的这个字：只用蓝色下划线标位置，字母本身跟其它没打的字一样受"提示深浅"控制，不额外提前露出来 */
.play-wrap.core .line .c.err { color: #fff; background: var(--bad); border-bottom-color: transparent; border-radius: 3px; }
.play-wrap.core .line .gh { text-align: left; max-width: 560px; margin: 14px auto 0; }
.play-wrap.core .line .gh .ex { display: block; margin-top: 4px; color: #7aab87; font-style: normal; }
.play-wrap.core .line .wc { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px auto 0; max-width: 560px; }
.play-wrap.core .wc-chip { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 86px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.play-wrap.core .wc-chip i { font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--c, #64748b); border-radius: 999px; padding: 2px 9px; }
.play-wrap.core .wc-chip b { font: 700 17px var(--mono); margin-top: 2px; color: var(--ink); }
.play-wrap.core .wc-chip small { color: var(--muted); font-size: 12px; }
.play-wrap.core .wc-chip span { font-size: 13px; color: var(--teal-d); font-weight: 600; }
.ghost-slider { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.ghost-slider input[type="range"] { width: 140px; }
.ghost-hint { font-size: 12px; color: var(--muted); opacity: .8; }

/* 提示深浅 + 下划线：语法打字和英文练习共用一套
   深浅：还没打的字按 --ghost-a 显示（0 = 全隐，空白打字盲打；100 = 完全显示）
   下划线：默认关闭，打开后每个字下面一条淡灰线（当前要打的字始终是蓝色光标线） */
#playWrap .line .c:not(.ok):not(.err):not(.case):not(.skip) { color: rgba(55, 65, 81, var(--ghost-a, 1)); }
#playWrap.underline-on .line .c { border-bottom: 2px solid rgba(55, 65, 81, .3); }
#playWrap.underline-on .line .c.ok, #playWrap.underline-on .line .c.err, #playWrap.underline-on .line .c.case { border-bottom-color: transparent; }
#playWrap .line .c.case { color: #8b5cf6; background: none; }   /* 大小写不同但不算错：紫色提醒（两种模式一样） */
/* 下划线按单词等级着色（放在 .ok 规则之后，避免被“已打出”的透明线盖掉） */
#playWrap.underline-on .line .c[data-band="小学"] { border-bottom-color: #16a34a; }
#playWrap.underline-on .line .c[data-band="中学"] { border-bottom-color: #2563eb; }
#playWrap.underline-on .line .c[data-band="大学"], #playWrap.underline-on .line .c[data-band="四级"] { border-bottom-color: #ea580c; }
#playWrap.underline-on .line .c[data-band="雅思"] { border-bottom-color: #e11d48; }
.band-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.band-legend i { font-style: normal; color: var(--c, var(--muted)); }
.band-legend i::before { content: ''; display: inline-block; width: 12px; height: 2px; background: var(--c, #c3cad3); vertical-align: middle; margin-right: 4px; }
#playWrap .line .c.cur { border-bottom: 3px solid #2563eb; }   /* 放在最后：当前要打的字始终是蓝色光标线，不被上面的下划线规则盖掉 */
.case-switch { display: flex; align-items: center; gap: 5px; margin-left: 14px; cursor: pointer; }
.case-switch input { accent-color: #8b5cf6; }
.play-wrap { padding-bottom: 150px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden], .toast[hidden] { display: none; }
.dialog { background: #fff; border-radius: 16px; width: 100%; max-width: 440px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.dialog h3 { margin: 0 0 10px; font-size: 22px; }
.dialog .big-stars { font-size: 40px; color: var(--gold-d); text-align: center; letter-spacing: 6px; margin: 6px 0 12px; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.res-grid div { background: #f1f5f9; border-radius: 10px; padding: 10px; text-align: center; }
.res-grid b { display: block; font-size: 24px; color: var(--teal-d); }
.res-grid span { font-size: 12px; color: var(--muted); }
.dialog .row { display: flex; gap: 10px; flex-wrap: wrap; }
.dialog .row button, .dialog .row a { flex: 1; min-width: 110px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-align: center; text-decoration: none; font-weight: 700; color: var(--ink); }
.dialog .row .pri { background: var(--teal); border-color: var(--teal); color: #fff; }
.dialog label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.dialog input { width: 100%; padding: 11px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 16px; }
.dialog .tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.dialog .tabs button { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.dialog .tabs button.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.dialog .msg { min-height: 20px; margin: 8px 0; font-size: 13px; color: var(--bad); }
.dialog .note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(17,24,39,.92); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: 90vw; }

/* ───── 平板 / 手机 ───── */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; min-height: 0; padding: 30px 18px 40px; }
  .hero h1 { font-size: 34px; }
    .features { grid-template-columns: 1fr; }
  .nav-in { flex-wrap: wrap; gap: 10px 14px; }
  .menu { order: 3; flex-basis: 100%; }
  .menu a { font-size: 15px; padding: 6px 12px; }
}
@media (max-width: 640px) {
  .brand img { height: 34px; } .brand b { font-size: 18px; }
  .play-head { padding: 10px 12px; gap: 8px; }
  .play-head h1 { font-size: 17px; padding-right: 0; }
  .play-head .brand { display: none; }
  .play-head .back { width: 44px; height: 36px; }
  .line { font-size: 20px; letter-spacing: 1px; }
  .typing-panel { padding: 12px 14px; max-height: 42vh; }
  .key { min-height: 24px; }
  .kb-wrap { padding: 8px; border-radius: 10px; } .kb-row { margin-top: 3px; } .hands-ov { display: none; } .play-wrap { padding-bottom: 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .page { padding: 14px 12px 30px; }
  .hero .cta { gap: 10px; }
  .hero .cta a { font-size: 16px; padding: 11px 20px; }
  .card-gram { font-size: 11.5px; padding: 5px 8px; }
  .play-wrap.core .line { font-size: 22px; }
}

/* 页头工具按钮 + 手指提示开关 */
.head-tools { display: flex; gap: 8px; flex: none; }
.tool { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.tool:hover { background: rgba(255,255,255,.25); }
.tool[hidden] { display: none; }
.play-wrap.no-hands { padding-bottom: 30px; }
.play-wrap.no-hands .hands-ov { display: none; }
@media (max-width: 640px) { .head-tools { gap: 4px; } .tool { padding: 5px 7px; font-size: 12px; } .play-head .redo { width: 36px; } }
#lineReplay { border: 0; background: #dbeafe; color: #225b8a; border-radius: 999px; width: 34px; height: 34px; margin-left: 16px; vertical-align: middle; letter-spacing: 0; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.play-wrap.core #lineReplay { margin: 10px 0 0 18px; }
#lineReplay:hover { background: #bae6fd; }

/* 首页键盘插画（原创）：正面微透视的深蓝键盘，「HARPER」六个键位发光 */
.kb-hero { perspective: 1000px; order: -1; padding: 10px; }
.kb-hero-in { transform: rotateX(34deg) rotateZ(-5deg); transform-origin: 50% 70%; background: linear-gradient(160deg, #0b2745, #12365e); border-radius: 22px; padding: 18px 18px 22px; box-shadow: 0 40px 60px rgba(4,18,36,.5), inset 0 0 0 2px rgba(125,180,230,.35), inset 0 2px 0 rgba(255,255,255,.18); }
.kb-hero .r { display: flex; gap: 6px; margin-top: 6px; } .kb-hero .r:first-child { margin-top: 0; }
.kb-hero .k { flex: var(--w, 1) 1 0; aspect-ratio: var(--w, 1) / 1; min-width: 0; border-radius: 8px; background: linear-gradient(#ffffff, #dbe7f5); box-shadow: 0 4px 0 #8aa7c6, 0 6px 8px rgba(0,0,0,.3); color: #35506f; font: 700 15px var(--mono); display: grid; place-items: center; }
.kb-hero .k.d { background: linear-gradient(#35597f, #264866); color: #b9d4ee; box-shadow: 0 4px 0 #14293f, 0 6px 8px rgba(0,0,0,.3); }
.kb-hero .k.hl { background: linear-gradient(#cfe7ff, #6fb2f0); color: #0b2a4a; box-shadow: 0 4px 0 #3e7fc0, 0 0 22px 5px rgba(125,190,255,.8); }
@media (max-width: 900px) { .kb-hero { max-width: 520px; margin: 0 auto; } .kb-hero .k { font-size: 11px; } }
#lineReplay svg, .tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool svg { margin-right: 4px; vertical-align: -4px; }

/* 品牌：只显示「哈珀打字」 */
.brand b { font-size: 24px; letter-spacing: 2px; }
.play-head .brand b { font-size: 22px; }
.head-tools { flex-wrap: wrap; justify-content: flex-end; }
.tool:disabled { opacity: .55; cursor: default; }

/* 双语开关：关掉就不显示每句下面的译文 */
.play-wrap.no-cn .line .cn { display: none; }
.line.flash { background: #eaf2ff; transition: background .3s; }

/* 右侧单词卡（可收起）：宽屏在右边并排，窄屏变成底部抽屉 */
.play-body { display: block; }
.play-body.with-vpanel { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; max-width: 1480px; margin: 0 auto; padding-right: 16px; }
.play-body.with-vpanel .play-wrap { max-width: none; margin: 0; padding-right: 0; }
.vpanel { background: #fff; border-radius: 14px; margin-top: 18px; padding: 14px; box-shadow: 0 1px 8px rgba(0,0,0,.08); height: calc(100vh - 150px); position: sticky; top: 12px; display: flex; flex-direction: column; min-height: 320px; }
.vpanel[hidden] { display: none; }
.vp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.vp-head b { font-size: 17px; }
.vp-head button, .vp-tabs button, .vp-chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.vp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.vp-tabs button { padding: 9px; font-size: 14px; }
.vp-tabs button.on, .vp-chips button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.vp-tabs i, .vp-chips i { font-style: normal; opacity: .8; margin-left: 3px; }
.vp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.vp-list { flex: 1; overflow: auto; padding-right: 2px; }
.vp-empty { color: var(--muted); font-size: 14px; padding: 20px 6px; text-align: center; }
.vc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.vc.on { border-color: var(--teal); box-shadow: 0 0 0 2px #cfe1f5; background: #f5f9fe; }
.vc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vc-word { font: 700 20px/1.2 var(--serif, Georgia, "Songti SC", serif); word-break: break-all; }
.vc-ico-row { display: flex; gap: 6px; flex: none; }
.vc-ico-row button, .vc-spk { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: #475569; padding: 0; display: inline-grid; place-items: center; }
.vc-ico-row button.on { color: #e11d48; border-color: #fda4af; }
.vc-ico-row svg, .vc-spk svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vc-ico-row button.on svg { fill: currentColor; }
.vc-meta2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.vc .band { padding: 1px 8px; border-radius: 6px; background: #e8f1fa; color: #173f63; font-size: 11px; font-weight: 700; border: 1px solid #c4d9ee; }
.vc-ph { color: var(--muted); font-size: 13px; }
.vc-def { color: #4b5563; font-size: 13px; margin-top: 6px; line-height: 1.45; }
.vc-box { background: #f1f5fb; border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: 14px; line-height: 1.5; }
.vc-box small { display: block; color: #4a6fa5; font-weight: 700; font-size: 11.5px; margin-bottom: 2px; }
.vc-box.ex { background: #eef4ff; }
.vc-box .exen { font-weight: 700; } .vc-box .exzh { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* 底部语法注释：一行，不换行，点开看全文；贴在页面底部，不占键盘位置 */

@media (max-width: 1100px) {
  .play-body.with-vpanel { display: block; padding-right: 0; }
  .vpanel { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; height: 52vh; margin: 0; z-index: 40; box-shadow: 0 -6px 28px rgba(0,0,0,.28); }
  .play-wrap { padding-bottom: 60px; }
}

/* 每句译文下面的一行淡绿色语法提示（语法开关打开时显示） */
.line .gh { display: block; margin-top: 4px; padding: 0; background: none; border: 0; color: #5f9f74; font: 12.5px/1.65 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; white-space: normal; word-break: break-word; }
.line .gh b { margin-right: 6px; color: #4a8a60; font-weight: 600; }
/* 回车跳过的句子 */
.line .c.skip { color: #b6bec9; }
.line.skipped { color: #b6bec9; }
.line.skipped .cn { color: #c3cad3; }
.keyhint { margin-left: 12px; color: #94a3b8; font-size: 12px; }
.play-head .tool-home { display: inline-flex; align-items: center; justify-content: center; padding-left: 10px; padding-right: 10px; }
.nav .home-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.nav .home-ico:hover, .play-head .tool-home:hover { background: rgba(255,255,255,.28); }
