/* 小手打字 · Apple 式极简风格 */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --ink-4: #c7c7cc;
  --fill: #e8e8ed;
  --hair: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --ok: #34c759;
  --bad: #ff3b30;
  --star: #ff9f0a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC",
    "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; height: 1.75em; padding: 0 .5em;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair), 0 1px 0 1px rgba(0, 0, 0, 0.06);
  font-family: var(--font); font-weight: 500; font-size: .85em;
  color: var(--ink);
  vertical-align: .05em;
}

/* ================= 首页 ================= */
.home { max-width: 980px; margin: 0 auto; padding: 0 22px 56px; }
.home-nav {
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}
.logo { font-weight: 600; letter-spacing: -0.01em; }
.link-btn { color: var(--accent); font-size: 14px; padding: 6px 0; }
.link-btn:hover { text-decoration: underline; }

.hero { text-align: center; padding: 64px 0 48px; }
.hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.hero p {
  margin: 14px 0 30px;
  font-size: clamp(19px, 2.2vw, 24px);
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 132px; height: 46px; padding: 0 26px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 500;
  transition: background .2s, transform .2s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary kbd { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 24px;
  border-radius: 999px;
  background: var(--fill); color: var(--ink);
  font-size: 17px; font-weight: 500;
  transition: background .2s;
}
.btn-secondary:hover { background: #dedee3; }

.home-play { display: flex; flex-direction: column; align-items: center; margin: 0 -22px 24px; }
.try-hint { margin: 0 0 18px; font-size: 18px; color: var(--ink-2); min-height: 30px; display: flex; align-items: center; gap: 4px; }
.try-hint b { color: var(--ink); font-weight: 600; }
.home .kb-wrap { --kh: clamp(28px, min((100vw - 60px) / 16.5 - 6px, 50px), 50px); }

/* 关卡：TypingClub 式的课程格子 */
.levels { display: flex; flex-direction: column; gap: 44px; }
.level-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px 14px; }
.level-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.level-head p { margin: 4px 0 0; font-size: 15px; color: var(--ink-3); }
.group-eyebrow { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 2px; }
.group-count { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 132px; padding: 16px 16px 14px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 0, 0, .08), 0 0 0 1px var(--hair); }
.tile:active { transform: scale(.98); }
.tile-no { font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tile-title { flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.tile-stars { font-size: 20px; letter-spacing: 2px; line-height: 1; }
.tile-stars i { font-style: normal; color: var(--fill); }
.tile-stars i.on { color: var(--star); }
.tile.done .tile-no::after { content: ' ✓'; color: var(--ok); }
.tile.next { box-shadow: 0 0 0 2px var(--accent), 0 10px 28px rgba(0, 113, 227, .18); }
.tile.next::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 2px var(--accent);
  animation: ring 1.8s ease-out infinite; pointer-events: none;
}
@keyframes ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }
.tile-tag {
  position: absolute; top: 12px; right: 12px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
}

/* 奖章墙 */
.badges { margin-top: 52px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 18px 10px 14px; border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair);
}
.badge-ic {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: var(--fill); margin-bottom: 6px;
}
.badge.on .badge-ic { background: linear-gradient(145deg, #fff4d6, #ffe08a); box-shadow: 0 4px 12px rgba(255, 159, 10, .25); }
.badge:not(.on) .badge-ic { font-size: 22px; filter: grayscale(1); opacity: .5; }
.badge-name { font-size: 15px; font-weight: 600; }
.badge-desc { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.badge:not(.on) .badge-name { color: var(--ink-3); }

.home-foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 56px; }
.nav-btns { display: inline-flex; gap: 18px; }

@media (max-width: 760px) {
  .home { padding: 0 16px 40px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 课程页 ================= */
.lesson {
  position: relative;
  height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: 20px;
  overflow: hidden;
}
.topbar {
  position: relative;
  width: 100%; height: 52px; flex: none;
  display: grid; grid-template-columns: 140px 1fr 140px; align-items: center;
  padding: 0 22px;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
}
.back { justify-self: start; color: var(--accent); font-size: 16px; display: inline-flex; align-items: center; gap: 4px; }
.back span { font-size: 24px; line-height: 1; margin-top: -3px; }
.back:hover { text-decoration: underline; }
.crumb { text-align: center; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb span { color: var(--ink-3); font-weight: 400; margin-right: 8px; }
.count { justify-self: end; color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; }
.bar { width: 100%; height: 3px; background: var(--fill); flex: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s cubic-bezier(.2, .8, .2, 1); }

.upper {
  position: relative;
  flex: 1; min-height: 0;
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.stage {
  position: relative;
  flex: 1; min-height: 0;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  padding: 16px 24px 4px;
}
.card { text-align: center; }
.target {
  font-size: clamp(64px, 15vh, 168px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.target.long { font-size: clamp(60px, 13vh, 128px); }
.target.word { font-size: clamp(52px, 11vh, 104px); letter-spacing: 0; }
/* 带声调的音节：拼音在上，汉字在下，音节之间空开 */
.target.syls { display: flex; justify-content: center; align-items: flex-start; gap: .5em; font-size: clamp(56px, 12vh, 120px); line-height: 1.25; }
.target.syls.long { font-size: clamp(48px, 10vh, 100px); }
.syl { display: inline-flex; flex-direction: column; align-items: center; }
.syl .hz { font-size: .5em; font-weight: 500; color: var(--ink-2); line-height: 1.2; margin-top: .05em; }
.card.done .syl .hz { color: var(--ok); }
/* 声调：画在字母正上方 */
.ch[data-t]::before {
  content: attr(data-t);
  position: absolute; left: 50%; top: .16em;
  transform: translateX(-50%);
  font-size: .9em; line-height: 1; font-weight: 700;
}
.ch[data-hi]::before { top: .02em; }
.ch { position: relative; display: inline-block; padding: 0 .02em; transition: color .2s; }
.ch.typed { color: var(--ok); }
.ch.todo { color: var(--ink-4); }
.ch.cur { color: var(--ink); }
.ch.cur::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: -.06em;
  height: max(4px, .045em); border-radius: 4px;
  background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}
.target.word .ch.cur::after { display: none; }
.card.done .ch { color: var(--ok); }
.caption { font-size: clamp(22px, 3.4vh, 30px); color: var(--ink-2); margin-top: 4px; }
.caption:empty { display: none; }
.hint { min-height: 30px; text-align: center; font-size: 19px; color: var(--ink-2); line-height: 1.6; }
.hint b { color: var(--ink); font-weight: 600; }
.hint-extra { color: var(--accent); font-weight: 500; }
.fchip { display: inline-flex; align-items: center; gap: 7px; margin: 0 2px; }
.fchip i { width: 10px; height: 10px; border-radius: 50%; background: var(--fc); }

.shake { animation: shake .35s; }
.pop { animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes pop { 0% { transform: scale(.94); opacity: .6; } 100% { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- 叠在键盘上的双手 ---------- */
.hand-layer { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 2; }
.hand-fill { fill: #fff; opacity: .55; }
/* 外轮廓：只露出描边的外半边，所以宽度取两倍 */
.hand-line { fill: none; stroke: #4b5361; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.hand-line.thumb-line { stroke-width: 1.6; }
.hand-active .ha-fill path { fill: var(--fc); fill-opacity: .12; stroke: none; }
.hand-active .ha-line path { fill: none; stroke: var(--fc); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.hand-active { animation: fingerIn .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes fingerIn { from { opacity: 0; } }

/* ---------- 虚拟键盘 ---------- */
.kb-wrap {
  flex: none;
  /* 键盘下方留出放手掌的位置，键盘因此处于页面中下部 */
  padding-bottom: calc(var(--kh) * 1.7);
  --kh: clamp(34px, min((100vw - 80px) / 16.2 - 6px, (100vh - 400px) / 6.4), 70px);
}
.kb {
  position: relative;
  width: min(calc(100vw - 32px), calc((var(--kh) + 6px) * 15 * 1.1 + 20px));
  padding: 10px;
  border-radius: 20px;
  background: #e4e4e9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.kb-row { display: grid; grid-template-columns: repeat(60, 1fr); }
.key {
  position: relative;
  height: var(--kh);
  margin: 3px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: calc(var(--kh) * .38);
  font-weight: 500;
  color: var(--ink);
  transition: transform .06s, background .15s, color .15s, box-shadow .15s;
}
/* 手指颜色：键帽底部一条细线 */
.key::before {
  content: ''; position: absolute; left: 34%; right: 34%; bottom: 12%;
  height: 3px; border-radius: 2px;
  background: var(--c);
  opacity: .9;
}
.key.wide { font-size: calc(var(--kh) * .27); color: var(--ink-2); }
.key.wide::before { left: 42%; right: 42%; }
.key .lo {
  position: absolute; left: 7px; top: 4px;
  font-size: calc(var(--kh) * .22); color: var(--ink-3);
  display: none;
}
.kb.show-lower .key .lo { display: block; }
.key.bump::after {
  content: ''; position: absolute; left: 50%; top: 68%;
  width: 22%; height: 2px; border-radius: 1px;
  background: var(--ink-4);
  transform: translateX(-50%);
}
.key.down { transform: translateY(1px); background: #f0f0f3; box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.key.target {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22), 0 6px 16px rgba(0, 113, 227, 0.35);
  z-index: 1;
  animation: pulse 1.4s ease-in-out infinite;
}
.key.target .lo { color: rgba(255, 255, 255, .8); }
.key.target::before { background: #fff; opacity: .85; }
.key.target.bump::after { background: rgba(255, 255, 255, .7); }
.key.ok { background: var(--ok) !important; color: #fff !important; animation: none; box-shadow: none; }
.key.bad { background: var(--bad) !important; color: #fff !important; animation: shake .35s; box-shadow: none; }
.key.ok::before, .key.bad::before { background: #fff; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22), 0 6px 16px rgba(0, 113, 227, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(0, 113, 227, 0.10), 0 6px 16px rgba(0, 113, 227, 0.35); }
}

/* ---------- 开始 / 完成 卡片 ---------- */
.overlay {
  position: absolute; inset: 55px 0 0;
  display: none; align-items: center; justify-content: center;
  padding: 16px 0;
  background: rgba(245, 245, 247, 0.6);
  backdrop-filter: saturate(180%) blur(6px);
  overflow: auto;
  z-index: 5;
}
.overlay.show { display: flex; }
.ov-card {
  width: min(520px, 92vw);
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 28px 36px 28px;
  text-align: center;
  animation: pop .35s cubic-bezier(.2, .8, .2, 1);
}
.ov-tag { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.ov-card h2 { font-size: 34px; margin: 6px 0 10px; font-weight: 700; letter-spacing: -0.03em; }
.ov-card p { font-size: 18px; color: var(--ink-2); line-height: 1.6; margin: 0 0 22px; }
.start, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 28px;
  border-radius: 999px;
  font-size: 17px; font-weight: 500;
  transition: background .2s, transform .2s;
}
.start { background: var(--accent); color: #fff; }
.start:hover { background: var(--accent-hover); }
.start kbd { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
.start kbd.big { padding: 0 1.2em; }
.ghost { background: var(--fill); color: var(--ink); }
.ghost:hover { background: #dedee3; }
.ghost kbd { box-shadow: none; }
.start:active, .ghost:active { transform: scale(.98); }
.ov-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.big-stars { font-size: 56px; letter-spacing: 10px; line-height: 1; margin-bottom: 8px; }
.big-stars span { color: var(--fill); display: inline-block; }
.big-stars span.on { color: var(--star); animation: starIn .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes starIn { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; top: 64px; left: 50%;
  transform: translate(-50%, -20px); opacity: 0;
  background: rgba(29, 29, 31, 0.88);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 12px 22px; border-radius: 999px; font-size: 16px;
  transition: transform .3s, opacity .3s; z-index: 20;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 连对 & 表扬 ---------- */
.streak {
  position: absolute; top: 18px; right: 24px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair);
  font-size: 16px; color: var(--ink-2);
  opacity: 0; transform: translateY(-6px) scale(.96);
  transition: opacity .25s, transform .25s;
}
.streak.show { opacity: 1; transform: none; }
.streak b { color: #ff6b00; font-size: 18px; font-variant-numeric: tabular-nums; }
.streak.bump { animation: bump .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes bump { 40% { transform: scale(1.18); } }

.praise {
  position: fixed; z-index: 30; pointer-events: none;
  transform: translate(-50%, -100%);
  font-size: 28px; font-weight: 700; color: var(--ok); letter-spacing: -0.01em;
  animation: floatUp 1.1s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -110%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }

.pills { display: inline-flex; gap: 10px; margin-left: 14px; vertical-align: top; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 46px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair);
  font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.pill b { font-size: 17px; }
.c-star { color: var(--star); }
@media (max-width: 760px) { .pills { margin: 14px 0 0; display: flex; } }

/* 成绩单 & 新奖章 */
.stats { display: flex; justify-content: center; gap: 10px; margin: -6px 0 22px; }
.stats div { flex: 1; max-width: 130px; padding: 12px 6px; border-radius: 16px; background: var(--bg); }
.stats b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--ink-3); }
.new-badges { margin: 0 0 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nb-title { width: 100%; font-size: 14px; font-weight: 600; color: var(--star); }
.nb {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100px;
  animation: badgeIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
.nb .badge-ic { background: linear-gradient(145deg, #fff4d6, #ffe08a); box-shadow: 0 4px 12px rgba(255, 159, 10, .3); margin-bottom: 4px; }
.nb b { font-size: 15px; }
.nb small { font-size: 12px; color: var(--ink-3); }
@keyframes badgeIn { 0% { opacity: 0; transform: scale(.3) rotate(-20deg); } 70% { transform: scale(1.12) rotate(4deg); } 100% { opacity: 1; transform: none; } }

/* 立体小手的画布 */
.hand-3d { position: absolute; pointer-events: none; z-index: 2; opacity: .7; }

/* ================= 章节 ================= */
.hero-actions { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.home main .level-head p b { color: var(--ink); }
.chaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.chap {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px 18px; border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.chap:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 0, 0, .08), 0 0 0 1px var(--hair); }
.chap.next { box-shadow: 0 0 0 2px var(--accent), 0 10px 28px rgba(0, 113, 227, .16); }
.chap-no { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.chap-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.chap-desc { font-size: 14px; color: var(--ink-3); margin-bottom: 8px; }
.chap-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.chap-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.chap-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }

.chapter .back { color: var(--accent); font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.chapter .back span { font-size: 22px; line-height: 1; margin-top: -2px; }
.chap-hero { padding: 40px 4px 28px; }
.chap-hero h1 { margin: 2px 0 6px; font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.03em; }
.chap-hero p { margin: 0; color: var(--ink-2); font-size: 18px; }
.rule { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 18px; }
.rule span { padding: 8px 14px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair); font-size: 13px; color: var(--ink-2); }
.rule b { color: var(--ink); }
.c-ok { color: var(--ok) !important; }
.units { display: flex; flex-direction: column; gap: 12px; }
.unit {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px 14px 22px; border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair);
}
.unit-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.unit-title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.mtag { height: 24px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; }
.mtag.fluent { background: rgba(52, 199, 89, .14); color: #1f8f3d; }
.mtag.master { background: rgba(255, 159, 10, .16); color: #b86e00; }
.unit-lessons { display: flex; gap: 8px; flex: none; }
.ul {
  position: relative; width: 104px; padding: 10px 10px 9px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg); transition: background .15s, transform .15s;
}
.ul:hover { background: #ececf0; transform: translateY(-2px); }
.ul-tag { font-size: 14px; font-weight: 600; }
.ul.test .ul-tag::before { content: '📝 '; }
.ul .tile-stars { font-size: 15px; }
.ul-sub { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ul.next { box-shadow: 0 0 0 2px var(--accent); background: #fff; }
@media (max-width: 760px) {
  .unit { flex-direction: column; align-items: stretch; }
  .unit-lessons { justify-content: space-between; }
  .ul { flex: 1; width: auto; }
}

/* ================= 测验 ================= */
.part-tag {
  position: absolute; top: 18px; left: 24px;
  height: 32px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair); font-size: 14px; color: var(--ink-2);
}
.part-tag:empty { display: none; }
/* 听音题：还没打出来的字母藏起来，只留下划线 */
.target.listen .ch.todo, .target.listen .ch.cur { color: transparent; }
.target.listen .ch.todo::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: -.06em;
  height: max(4px, .045em); border-radius: 4px; background: var(--ink-4);
}
.target.listen .ch[data-t].todo::before, .target.listen .ch[data-t].cur::before { color: transparent; }
.target.listen .hz { visibility: hidden; }
.card.done .target.listen .hz { visibility: visible; }
.caption.listen-tip { color: var(--accent); font-size: clamp(18px, 2.6vh, 22px); }
.verdict { margin: -6px 0 20px; padding: 12px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 2px; }
.verdict b { font-size: 20px; }
.verdict span { font-size: 13px; color: var(--ink-2); }
.verdict.fluent { background: rgba(52, 199, 89, .12); }
.verdict.fluent b { color: #1f8f3d; }
.verdict.master { background: rgba(255, 159, 10, .14); }
.verdict.master b { color: #b86e00; }
.verdict.todo { background: var(--bg); }
