/* =========================================================
   键艺 KeyCraft — Design System
   纯色、描边、留白。全站不使用任何渐变。
   ========================================================= */

:root {
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Consolas",
    "Liberation Mono", monospace;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --container: 1240px;
  --header-h: 66px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* finger colors */
  --f-lp: #ff8068;
  --f-lr: #efb257;
  --f-lm: #67d2a5;
  --f-li: #7fa6ff;
  --f-th: #b9c0cc;
  --f-ri: #7fa6ff;
  --f-rm: #67d2a5;
  --f-rr: #efb257;
  --f-rp: #ff8068;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0e;
  --bg-soft: #0f1114;
  --panel: #121418;
  --panel-2: #171a1f;
  --panel-3: #1d2127;
  --line: #252a31;
  --line-strong: #353c46;
  --text: #f2f0ea;
  --text-soft: #d4d7dc;
  --muted: #9ba3ae;
  --dim: #69717c;
  --accent: #ff5c35;
  --accent-soft: rgba(255, 92, 53, 0.12);
  --accent-ink: #160d09;
  --blue: #7fa6ff;
  --green: #67d2a5;
  --red: #ff8068;
  --amber: #efb257;
  --violet: #b79bff;
  --correct: #67d2a5;
  --wrong: #ff8068;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(11, 12, 14, 0.86);
  /* keyboard deck */
  --kb-deck: #23262c;
  --kb-key: #14171b;
  --kb-key-hover: #1c2026;
  --kb-label: #f4f2ec;
  --kb-sub: #7f868f;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-soft: #ede9e0;
  --panel: #fffdf8;
  --panel-2: #f1ede5;
  --panel-3: #e7e2d8;
  --line: #dcd6ca;
  --line-strong: #c5beb0;
  --text: #17191c;
  --text-soft: #30343a;
  --muted: #646a73;
  --dim: #8d939c;
  --accent: #df451d;
  --accent-soft: rgba(223, 69, 29, 0.1);
  --accent-ink: #fffaf5;
  --blue: #3c67cf;
  --green: #1c8a61;
  --red: #c94833;
  --amber: #9b6a12;
  --violet: #6d4fc4;
  --correct: #1c8a61;
  --wrong: #c94833;
  --shadow: 0 18px 42px rgba(40, 32, 20, 0.09);
  --header-bg: rgba(244, 241, 234, 0.88);
  /* keyboard deck */
  --kb-deck: #e3ded2;
  --kb-key: #fffdf7;
  --kb-key-hover: #f4efe5;
  --kb-label: #1b1e22;
  --kb-sub: #8d8677;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

code {
  padding: 0.08em 0.35em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  font-size: 0.88em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.site-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  width: min(100% - 48px, var(--container));
  height: var(--header-h);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.brand-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.brand-name em {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--panel-2);
}

.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  position: absolute;
  right: 12px;
  bottom: 2px;
  left: 12px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.menu-toggle {
  display: none;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease),
    border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn:hover {
  border-color: var(--text);
  background: var(--panel-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-accent {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-accent:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--line);
  color: var(--text);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn .arrow {
  transition: transform 0.18s var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- shared bits ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
}

.eyebrow .slash {
  color: var(--dim);
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}

.cta-band h2 {
  margin-top: 12px;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.cta-band p {
  max-width: 560px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.note-band {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel);
}

.note-band p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.note-band strong {
  color: var(--text);
  font-weight: 600;
}

.note-band .eyebrow {
  flex-shrink: 0;
  padding-top: 3px;
}

.section-tight {
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.section-title {
  max-width: 760px;
  margin-top: 14px;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.section-sub {
  max-width: 480px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.section-index {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.accent {
  color: var(--accent);
}

.hr {
  height: 1px;
  background: var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tag-solid {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.status-dot.is-done {
  background: var(--green);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 78px 0 70px;
}

.hero::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100% - 48px, var(--container));
  height: 1px;
  background: var(--line);
  content: "";
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 86px);
}

.hero-copy {
  padding-top: 14px;
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-kicker .no-grad {
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 26px 0 24px;
  font-size: clamp(44px, 6.4vw, 84px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 .line {
  display: block;
  white-space: nowrap;
}

.hero h1 .accent-line {
  position: relative;
  display: inline-block;
  color: var(--accent);
}

.hero h1 .accent-line::after {
  position: absolute;
  right: 0.02em;
  bottom: 0.02em;
  width: 0.12em;
  height: 0.78em;
  background: var(--accent);
  content: "";
  animation: caret 1.05s steps(1) infinite;
}

@keyframes caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.hero-desc {
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-meta div {
  min-width: 104px;
  padding-right: 24px;
}

.hero-meta div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.hero-meta dt {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-meta dd {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-meta dd small {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
}

.hero-visual {
  position: relative;
}

.hero-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  top: -1px;
  right: 26px;
  width: 76px;
  height: 3px;
  background: var(--accent);
  content: "";
}

.hero-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 2px;
}

.hero-card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.hero-card-label .live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.hero-card-code {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.hero-typing-line {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 54px;
  margin: 2px 2px 18px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-typing-line .done {
  color: var(--dim);
}

.hero-typing-line .current {
  padding: 1px 2px;
  background: var(--accent);
  color: var(--accent-ink);
}

.hero-typing-line .rest {
  color: var(--text-soft);
}

.hero-typing-line .caret-block {
  display: inline-block;
  width: 2px;
  height: 20px;
  margin-left: 1px;
  background: var(--accent);
  animation: caret 1s steps(1) infinite;
}

.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.hero-card-foot strong {
  color: var(--text-soft);
  font-weight: 500;
}

.hero-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.hero-float--wpm {
  bottom: -22px;
  left: -26px;
}

.hero-float--acc {
  right: -18px;
  bottom: -20px;
}

.hero-float .big {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hero-float .label {
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.hero-float .up {
  color: var(--green);
  font-size: 9px;
}

.hero-float .mini-bar {
  display: flex;
  width: 74px;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.hero-float .mini-bar i {
  display: block;
  width: 5px;
  background: var(--line-strong);
}

.hero-float .mini-bar i:nth-child(1) {
  height: 35%;
}
.hero-float .mini-bar i:nth-child(2) {
  height: 55%;
}
.hero-float .mini-bar i:nth-child(3) {
  height: 45%;
}
.hero-float .mini-bar i:nth-child(4) {
  height: 75%;
  background: var(--accent);
}
.hero-float .mini-bar i:nth-child(5) {
  height: 62%;
}
.hero-float .mini-bar i:nth-child(6) {
  height: 90%;
}
.hero-float .mini-bar i:nth-child(7) {
  height: 78%;
}

/* ---------- strip ---------- */
.signal-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signal-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
  padding: 18px 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.signal-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.signal-strip span::before {
  width: 4px;
  height: 4px;
  background: var(--accent);
  content: "";
}

/* ---------- courses grid ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.course-card {
  --course: var(--blue);
  position: relative;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--course);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.course-card:hover {
  border-color: var(--line-strong);
  border-top-color: var(--course);
  background: var(--panel-2);
  transform: translateY(-4px);
}

.course-card[data-color="blue"] {
  --course: var(--blue);
}
.course-card[data-color="green"] {
  --course: var(--green);
}
.course-card[data-color="red"] {
  --course: var(--red);
}
.course-card[data-color="amber"] {
  --course: var(--amber);
}

.course-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.course-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.course-card-arrow {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 18px;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.course-card:hover .course-card-arrow {
  color: var(--course);
  transform: translate(2px, -2px);
}

.course-card h3 {
  margin-top: 24px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.course-card .course-en {
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.course-card p {
  max-width: 94%;
  margin-top: 15px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.course-card-bottom {
  margin-top: auto;
  padding-top: 24px;
}

.course-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.course-card-meta strong {
  color: var(--text-soft);
  font-weight: 500;
}

.course-card .progress {
  margin-top: 14px;
}

.course-watermark {
  position: absolute;
  right: 18px;
  bottom: 12px;
  color: transparent;
  font-family: var(--font-mono);
  font-size: 94px;
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
  opacity: 0.5;
  pointer-events: none;
  -webkit-text-stroke: 1px var(--line);
}

html[data-theme="light"] .course-watermark {
  opacity: 0.65;
}

/* progress */
.progress {
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.progress > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--course, var(--accent));
  transition: width 0.5s var(--ease);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* ---------- method ---------- */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.method-item {
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.method-num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.method-item h3 {
  margin-top: 20px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.method-item p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

/* ---------- keyboard section ---------- */
.keyboard-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

.keyboard-feature-visual {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.keyboard-feature-copy h2 {
  margin-top: 14px;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.keyboard-feature-copy p {
  max-width: 460px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.finger-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 24px 0;
}

.finger-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.finger-legend i {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--fc);
}

/* ---------- course map ---------- */
.map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.map-col {
  min-width: 0;
  padding: 22px;
  background: var(--panel);
}

.map-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.map-col-head strong {
  font-size: 14px;
  font-weight: 650;
}

.map-col-head span {
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.map-col ul {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.map-col li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.map-col li em {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.map-col .map-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 0 38px;
}

.footer-brand {
  max-width: 330px;
}

.footer-brand p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.footer-col h4 {
  margin-bottom: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-col a,
.footer-col span {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.18s var(--ease);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

/* ---------- page hero / inner pages ---------- */
.page-hero {
  padding: 66px 0 52px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb .sep {
  color: var(--line-strong);
}

.page-hero h1 {
  max-width: 880px;
  margin-top: 24px;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.page-hero .lead {
  max-width: 640px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.page-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 44px;
  border: 1px solid var(--line);
  background: var(--line);
}

.page-hero-stat {
  padding: 18px 20px;
  background: var(--panel);
}

.page-hero-stat span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.page-hero-stat strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

/* ---------- course index rows ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 40px 0 28px;
}

.filter-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  transition: all 0.18s var(--ease);
}

.filter-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.filter-btn.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.catalog {
  display: grid;
  gap: 18px;
}

.catalog-item {
  --course: var(--blue);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 260px;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--course);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.catalog-item:hover {
  border-color: var(--line-strong);
  border-left-color: var(--course);
  background: var(--panel-2);
}

.catalog-item[data-color="green"] {
  --course: var(--green);
}
.catalog-item[data-color="red"] {
  --course: var(--red);
}
.catalog-item[data-color="amber"] {
  --course: var(--amber);
}

.catalog-code {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 3px;
}

.catalog-code strong {
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.catalog-code span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.catalog-main h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.catalog-main .en {
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-main p {
  max-width: 620px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.catalog-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.catalog-chapters span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 10px;
}

.catalog-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.catalog-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.catalog-stats span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.catalog-stats strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

.catalog-side .btn {
  width: 100%;
}

/* ---------- course detail ---------- */
.course-hero {
  --course: var(--blue);
  padding: 54px 0 0;
  border-bottom: 1px solid var(--line);
}

.course-hero[data-color="green"] {
  --course: var(--green);
}
.course-hero[data-color="red"] {
  --course: var(--red);
}
.course-hero[data-color="amber"] {
  --course: var(--amber);
}

.course-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}

.course-title-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  margin-top: 26px;
}

.course-badge {
  display: flex;
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid var(--course);
  border-radius: var(--radius);
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.course-title-row h1 {
  font-size: clamp(38px, 4.6vw, 58px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.course-title-row .en {
  margin-top: 6px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.course-hero-desc {
  max-width: 680px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.85;
}

.course-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.course-hero-tags .tag {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.course-progress-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--course);
  border-radius: var(--radius);
  background: var(--panel);
}

.course-progress-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.course-progress-top span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.course-progress-top strong {
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.course-progress-card .progress {
  margin: 18px 0 18px;
}

.course-progress-card .btn {
  width: 100%;
}

.course-progress-note {
  margin-top: 14px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}

.course-hero-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.course-hero-bottom span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.course-hero-bottom .dot {
  width: 5px;
  height: 5px;
  background: var(--course);
}

/* chapter + lesson list */
.curriculum {
  padding: 54px 0 90px;
}

.chapter {
  margin-bottom: 46px;
}

.chapter-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: baseline;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.chapter-num {
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.chapter-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.chapter-head p {
  margin-top: 3px;
  color: var(--dim);
  font-size: 12px;
}

.chapter-count {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.lesson-list {
  border-left: 1px solid var(--line);
  margin-left: 26px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 24px;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.lesson-row:hover {
  background: var(--panel);
}

.lesson-row.is-current {
  background: var(--panel);
  box-shadow: inset 2px 0 0 var(--course, var(--accent));
}

.lesson-index {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.lesson-row-main h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.lesson-row-main p {
  margin-top: 3px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.55;
}

.lesson-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.lesson-row-meta .done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
}

.lesson-row-meta .done svg {
  width: 12px;
  height: 12px;
}

.lesson-row-arrow {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}

.lesson-row:hover .lesson-row-arrow {
  color: var(--course, var(--accent));
  transform: translateX(3px);
}

/* ---------- lesson page ---------- */
.lesson-page {
  padding: 46px 0 90px;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(36px, 6vw, 82px);
  align-items: start;
}

.lesson-head {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.lesson-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.lesson-head h1 {
  max-width: 860px;
  margin-top: 16px;
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.lesson-head .en {
  margin-top: 7px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lesson-head .summary {
  max-width: 700px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.lesson-focus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
}

.lesson-head-cta {
  display: none;
  margin-top: 22px;
}

.lesson-focus-label {
  margin-right: 5px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.keycap {
  display: inline-flex;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.goals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 30px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.goal {
  padding: 18px;
  background: var(--panel);
}

.goal span {
  display: block;
  color: var(--course, var(--accent));
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.goal p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.prose {
  max-width: 780px;
  margin-top: 40px;
}

.prose-section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.prose-section:first-child {
  border-top: 0;
  padding-top: 10px;
}

.prose-section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.prose-section h2 .num {
  color: var(--course, var(--accent));
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.prose-section p {
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.9;
}

.prose-section p:first-of-type {
  margin-top: 18px;
}

.prose-section strong {
  color: var(--text);
  font-weight: 650;
}

.prose-section ul,
.prose-section ol {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.prose-section ul li {
  position: relative;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.8;
}

.prose-section ul li::before {
  position: absolute;
  top: 0.78em;
  left: 0;
  width: 6px;
  height: 1px;
  background: var(--course, var(--accent));
  content: "";
}

.prose-section ol {
  counter-reset: ol;
}

.prose-section ol li {
  position: relative;
  padding-left: 28px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.8;
  counter-increment: ol;
}

.prose-section ol li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--course, var(--accent));
  font-family: var(--font-mono);
  font-size: 10px;
  content: counter(ol, decimal-leading-zero);
}

.prose-section table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 13px;
}

.prose-section th,
.prose-section td {
  padding: 11px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose-section th {
  background: var(--panel-2);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prose-section td {
  color: var(--text-soft);
  line-height: 1.65;
}

.prose-section td code,
.prose-section p code,
.prose-section li code {
  white-space: nowrap;
}

.lesson-tip {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--course, var(--accent));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.lesson-tip strong {
  color: var(--text);
}

.drill-preview {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--course, var(--accent));
  border-radius: var(--radius);
  background: var(--panel);
}

.drill-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.drill-preview-head h3 {
  font-size: 15px;
  font-weight: 650;
}

.drill-preview-head span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.drill-lines {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.drill-line {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 14px;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.drill-line span {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 9px;
}

.drill-line code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
}

.lesson-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
}

.lesson-cta .note {
  color: var(--dim);
  font-size: 11px;
}

.lesson-aside {
  position: sticky;
  top: calc(var(--header-h) + 26px);
}

.aside-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.aside-card + .aside-card {
  margin-top: 14px;
}

.aside-eyebrow {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.aside-card h3 {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.45;
}

.aside-card .btn {
  width: 100%;
  margin-top: 18px;
}

.aside-info {
  display: grid;
  gap: 11px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.aside-info div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dim);
  font-size: 11px;
}

.aside-info strong {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.aside-nav {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.aside-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--panel);
  transition: background 0.18s var(--ease);
}

.aside-nav a:hover {
  background: var(--panel-2);
}

.aside-nav span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.aside-nav strong {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.aside-nav em {
  color: var(--dim);
  font-style: normal;
}

.lesson-bottom-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
}

.lesson-nav-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.lesson-nav-card:hover {
  border-color: var(--line-strong);
  background: var(--panel);
}

.lesson-nav-card span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.lesson-nav-card strong {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.5;
}

.lesson-nav-card.next {
  text-align: right;
}

/* ---------- keyboard component ---------- */
.kb-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.kb {
  --kb-cols: 16;
  --kb-gap: clamp(3px, 0.36vw, 5px);
  --kb-pad: clamp(6px, 0.56vw, 10px);
  --kb-font: clamp(10px, 0.92vw, 13px);
  display: flex;
  width: 100%;
  min-width: 660px;
  flex-direction: column;
  gap: var(--kb-gap);
  padding: var(--kb-pad);
  border-radius: calc(var(--kb-pad) + 5px);
  background: var(--kb-deck);
  user-select: none;
}

.kb-row {
  display: flex;
  gap: var(--kb-gap);
}

.kb-key {
  --w: 1;
  position: relative;
  display: flex;
  height: clamp(28px, 2.95vw, 42px);
  min-width: 0;
  flex: 0 0 calc((100% - var(--kb-gap) * (var(--kb-cols) - 1)) / var(--kb-cols) * var(--w) + var(--kb-gap) * (var(--w) - 1));
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 0 4px;
  overflow: hidden;
  border: 0;
  border-radius: clamp(4px, 0.36vw, 6px);
  background: var(--kb-key);
  color: var(--kb-label);
  font-family: var(--font-sans);
  font-size: var(--kb-font);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  transition: background 0.1s var(--ease), color 0.1s var(--ease),
    box-shadow 0.1s var(--ease), transform 0.08s var(--ease);
}

.kb-key .label,
.kb-key .sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-key .sub {
  color: var(--kb-sub);
  font-size: 0.78em;
  font-weight: 550;
}

.kb-key--ghost {
  visibility: hidden;
}

.kb-key--modifier {
  padding: 0 2px;
  font-size: calc(var(--kb-font) * 0.82);
  font-weight: 550;
  letter-spacing: 0.01em;
}

.kb-key--modifier .sub {
  font-size: 0.82em;
}

.kb-key--home::after {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--kb-sub);
  content: "";
  transform: translateX(-50%);
}

.kb-key--interactive {
  cursor: pointer;
}

.kb-key--interactive:hover {
  background: var(--kb-key-hover);
}

.kb.is-colored .kb-key::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--key-finger, var(--line-strong));
  content: "";
}

.kb.is-mini {
  --kb-gap: clamp(2px, 0.24vw, 3px);
  --kb-pad: clamp(4px, 0.42vw, 7px);
  --kb-font: clamp(7px, 0.62vw, 9px);
  min-width: 0;
}

.kb.is-mini .kb-key {
  height: clamp(20px, 2.1vw, 30px);
  gap: 0.24em;
  padding: 0 2px;
  border-radius: clamp(3px, 0.32vw, 5px);
  font-weight: 600;
}

.kb.is-mini .kb-key .sub,
.kb.is-mini .kb-key .key-finger-dot {
  display: none;
}

.kb.is-mini .kb-key--home::after {
  bottom: 3px;
  width: 6px;
  height: 1px;
}

.kb.is-mini .kb-key::before {
  height: 2px;
}

.kb-key.is-next {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(1px);
}

.kb-key.is-next .sub {
  color: var(--accent-ink);
  opacity: 0.62;
}

.kb.is-colored .kb-key.is-next::before,
.kb.is-colored .kb-key.is-next-shift::before,
.kb.is-colored .kb-key.is-error::before {
  opacity: 0;
}

.kb-key.is-next-shift {
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
}

.kb-key.is-next-shift .sub {
  color: var(--accent);
}

.kb-key.is-down,
.kb-key.is-pressed {
  background: var(--kb-label);
  color: var(--kb-deck);
}

.kb-key.is-down .sub,
.kb-key.is-pressed .sub {
  color: var(--kb-deck);
}

.kb-key.is-error {
  background: var(--wrong);
  color: var(--accent-ink);
}

.kb-key.is-error .sub {
  color: var(--accent-ink);
  opacity: 0.72;
}

.kb-key.is-finger {
  background: var(--kb-key-hover);
}

.kb-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 16px;
}

.kb-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 10px;
}

.kb-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fc);
}

.kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.kb-toolbar span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.kb-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.kb-switch input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

/* ---------- keyboard page ---------- */
.keyboard-page {
  padding: 54px 0 90px;
}

.keyboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

.keyboard-layout > * {
  min-width: 0;
}

.keyboard-stage {
  max-width: 100%;
  padding: 26px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.keyboard-stage .kb {
  min-width: 780px;
}

.keyboard-detail {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.key-detail-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}

.key-detail-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.key-detail-value {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.key-detail-value strong {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.key-detail-value .finger-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.key-detail-value .finger-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fc);
}

.key-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 20px;
  border: 1px solid var(--line);
  background: var(--line);
}

.key-detail-grid div {
  padding: 12px;
  background: var(--panel-2);
}

.key-detail-grid span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.key-detail-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.finger-rule-list {
  display: grid;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.finger-rule {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.finger-rule i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--fc);
}

.finger-rule strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
}

.finger-rule span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.finger-rule em {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
}

.keyboard-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.keyboard-rule-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.keyboard-rule-card span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.keyboard-rule-card h3 {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 650;
}

.keyboard-rule-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

/* ---------- progress / records ---------- */
.records-page {
  padding: 54px 0 90px;
}

.record-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.record-stat {
  padding: 22px;
  background: var(--panel);
}

.record-stat span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.record-stat strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.record-stat small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
}

.record-section {
  margin-top: 42px;
}

.record-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.record-section-head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.record-section-head span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.record-courses {
  display: grid;
  gap: 10px;
}

.record-course {
  --course: var(--blue);
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 150px;
  gap: 20px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.record-course[data-color="green"] {
  --course: var(--green);
}
.record-course[data-color="red"] {
  --course: var(--red);
}
.record-course[data-color="amber"] {
  --course: var(--amber);
}

.record-course > strong {
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}

.record-course h3 {
  font-size: 14px;
  font-weight: 600;
}

.record-course p {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
}

.record-course .progress {
  margin-top: 4px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.history-table th,
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.history-table th {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-table td {
  color: var(--text-soft);
}

.history-table td.num {
  font-family: var(--font-mono);
  font-size: 11px;
}

.history-empty {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.record-actions p {
  color: var(--dim);
  font-size: 11px;
}

.danger-link {
  color: var(--red);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   Practice page
   ========================================================= */
.practice-page {
  min-height: 100vh;
  background: var(--bg);
}

.practice-topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.practice-topbar-inner {
  display: flex;
  width: min(100% - 40px, 1360px);
  height: 58px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.practice-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.18s var(--ease);
}

.practice-back:hover {
  color: var(--text);
}

.practice-back .arrow {
  font-family: var(--font-mono);
}

.practice-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.practice-title .badge {
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--course, var(--accent));
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.practice-title strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-title span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.practice-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.practice-controls .icon-btn {
  width: 34px;
  height: 34px;
}

.practice-controls .icon-btn.is-on {
  border-color: var(--accent);
  color: var(--accent);
}

.practice-progress {
  height: 3px;
  background: var(--panel-3);
}

.practice-progress > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--course, var(--accent));
  transition: width 0.18s linear;
}

.practice-wrap {
  width: min(100% - 40px, 1240px);
  margin-inline: auto;
  padding: 32px 0 70px;
}

.practice-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.practice-intro-left .eyebrow {
  font-size: 9px;
}

.practice-intro-left h1 {
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.practice-intro-left p {
  margin-top: 5px;
  color: var(--dim);
  font-size: 11px;
}

.practice-mode-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.practice-mode-tab {
  min-height: 31px;
  padding: 0 12px;
  border-radius: 3px;
  color: var(--dim);
  font-size: 11px;
  transition: all 0.18s var(--ease);
}

.practice-mode-tab:hover {
  color: var(--text);
}

.practice-mode-tab.is-active {
  background: var(--text);
  color: var(--bg);
}

.practice-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: 18px;
  align-items: start;
}

.typing-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.typing-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.typing-panel-head .left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.typing-panel-head .left .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.typing-panel-head .left .live-dot.is-live {
  background: var(--green);
  animation: pulse 1.8s infinite;
}

.typing-panel-head .right {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.typing-stage {
  position: relative;
  min-height: 300px;
  padding: 32px 30px;
  cursor: text;
}

.typing-stage:focus {
  outline: none;
}

.typing-text {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 8px;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 450;
  letter-spacing: 0.01em;
  line-height: 1.95;
  scrollbar-width: thin;
  white-space: pre-wrap;
  word-break: break-word;
}

.typing-text.is-cn {
  font-family: var(--font-sans);
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: 0.02em;
}

.typing-text .ch {
  position: relative;
  border-radius: 2px;
  color: var(--muted);
  transition: color 0.08s linear, background 0.08s linear;
}

.typing-text .ch.is-done {
  color: var(--dim);
}

.typing-text .ch.is-current {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent);
}

.typing-text .ch.is-wrong {
  background: var(--wrong);
  color: var(--accent-ink);
}

.typing-text .ch.is-wrong.is-current {
  box-shadow: 0 0 0 1px var(--wrong);
}

.typing-text .ch.is-space {
  display: inline-block;
  min-width: 0.56em;
}

.typing-text .ch.is-space.is-wrong {
  background: var(--wrong);
}

.typing-text .ch.is-enter {
  display: block;
  height: 0;
}

.typing-text.is-wubi {
  white-space: normal;
  font-family: var(--font-sans);
}

.wubi-board {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.wubi-item {
  display: flex;
  min-width: 78px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  opacity: 0.62;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease),
    opacity 0.15s var(--ease);
}

.wubi-item.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  opacity: 1;
}

.wubi-item.is-done:not(.is-current) {
  opacity: 0.36;
}

.wubi-char {
  display: block;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.12;
}

.wubi-code {
  display: inline-flex;
  gap: 1px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.wubi-code-ch {
  min-width: 0.74em;
  border-radius: 2px;
  text-align: center;
}

.wubi-code-ch.is-current {
  background: var(--accent);
  color: var(--accent-ink);
}

.wubi-code-ch.is-done {
  color: var(--dim);
}

.wubi-code-ch.is-wrong {
  background: var(--wrong);
  color: var(--accent-ink);
}

.wubi-board.hide-codes .wubi-code {
  visibility: hidden;
}

.typing-hidden-input {
  position: absolute;
  z-index: -1;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.typing-ime-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  opacity: 0.01;
}

.typing-stage.is-ime {
  cursor: text;
}

.typing-start {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--panel);
  text-align: center;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.typing-start[hidden] {
  display: none;
}

.typing-hidden-input[hidden],
.typing-ime-input[hidden] {
  display: none;
}

.typing-start .start-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 17px;
}

.typing-start strong {
  font-size: 16px;
  font-weight: 600;
}

.typing-start span {
  color: var(--dim);
  font-size: 11px;
}

.typing-start small {
  margin-top: 4px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.typing-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-height: 54px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}

.typing-hint .hint-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.typing-hint .hint-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
}

.typing-hint .hint-main .pinyin {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.typing-hint .hint-code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.typing-hint .hint-sub {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.typing-hint.is-hidden {
  display: none;
}

.typing-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.typing-foot .keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.typing-foot .keys kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--muted);
  font-size: 8px;
}

/* stats */
.practice-stats {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.stat-card {
  padding: 16px 18px;
  background: var(--panel);
}

.stat-card .stat-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-card .stat-value {
  margin-top: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-card .stat-value small {
  margin-left: 3px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
}

.stat-card .stat-note {
  margin-top: 5px;
  color: var(--dim);
  font-size: 9px;
}

.stat-card--primary {
  border-left: 2px solid var(--accent);
}

.stat-card--primary .stat-value {
  color: var(--accent);
}

.stat-accuracy-wrap {
  margin-top: 8px;
}

.stat-accuracy-bar {
  height: 3px;
  border-radius: 99px;
  background: var(--panel-3);
}

.stat-accuracy-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.2s linear;
}

/* keyboard in practice */
.practice-keyboard {
  margin-top: 18px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.practice-keyboard .kb {
  --kb-font: clamp(9px, 0.8vw, 11px);
}

.practice-keyboard .kb-key {
  height: clamp(30px, 2.9vw, 40px);
}

.practice-keyboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.practice-keyboard-head .label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.practice-keyboard-head .label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.practice-keyboard-head .next-label {
  color: var(--dim);
  font-size: 10px;
}

.practice-keyboard-head .next-label strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

/* results */
.result-overlay {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 7, 0.72);
  animation: fadeIn 0.2s var(--ease);
}

html[data-theme="light"] .result-overlay {
  background: rgba(35, 30, 22, 0.46);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.result-card {
  width: min(100%, 560px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: slideUp 0.26s var(--ease);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 0;
}

.result-head .eyebrow {
  font-size: 9px;
}

.result-head h2 {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.result-head p {
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
}

.result-badge {
  display: flex;
  width: 64px;
  height: 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.result-badge small {
  margin-top: 4px;
  color: var(--dim);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 22px 26px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.result-stat {
  padding: 14px;
  background: var(--panel-2);
}

.result-stat span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.result-stat strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}

.result-message {
  margin: 20px 26px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.result-weak {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 26px 0;
  color: var(--dim);
  font-size: 10px;
}

.result-weak .keycap {
  min-width: 24px;
  height: 24px;
  font-size: 9px;
  border-bottom-width: 2px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 22px 26px 26px;
}

.result-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* toast */
.toast {
  position: fixed;
  z-index: 300;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 12px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s var(--ease);
}

.toast.is-visible {
  transform: none;
  opacity: 1;
}

/* reveal animation */
.reveal {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-visual {
    max-width: 760px;
  }

  .hero-float--wpm {
    left: 10px;
  }

  .hero-float--acc {
    right: 10px;
  }

  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-hero-grid {
    grid-template-columns: 1fr;
  }

  .course-progress-card {
    max-width: 420px;
  }

  .keyboard-layout {
    grid-template-columns: 1fr;
  }

  .keyboard-detail {
    position: static;
  }

  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 40px;
  }

  .practice-main {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
}

@media (max-width: 920px) {
  .section {
    padding: 72px 0;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .keyboard-feature {
    grid-template-columns: 1fr;
  }

  .catalog-item {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .catalog-side {
    grid-column: 2;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-aside {
    position: static;
  }

  .lesson-head-cta {
    display: inline-flex;
  }

  .lesson-aside .aside-card:first-child {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
  }

  .lesson-aside .aside-card:first-child .btn {
    width: auto;
    margin-top: 0;
    grid-row: 1 / span 2;
    grid-column: 2;
  }

  .lesson-aside .aside-info {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .practice-main {
    grid-template-columns: 1fr;
  }

  .practice-stats {
    grid-template-columns: repeat(4, 1fr);
    order: 2;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-card .stat-value {
    font-size: 22px;
  }

  .typing-panel {
    order: 1;
  }

  .practice-keyboard {
    order: 3;
  }
}

@media (max-width: 760px) {
  .container,
  .header-inner {
    width: min(100% - 32px, var(--container));
  }

  .note-band {
    flex-direction: column;
    gap: 10px;
  }

  .aside-info {
    grid-template-columns: 1fr 1fr;
  }

  .site-nav {
    position: fixed;
    z-index: 99;
    top: var(--header-h);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px;
  }

  .nav-link.is-active::after {
    top: 12px;
    right: auto;
    bottom: 12px;
    left: 0;
    width: 2px;
    height: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-actions .btn {
    display: none;
  }

  .hero {
    padding: 54px 0 48px;
  }

  .hero h1 {
    font-size: clamp(44px, 13vw, 70px);
  }

  .hero-meta div {
    min-width: 50%;
    padding: 10px 0;
  }

  .hero-meta div + div {
    padding-left: 0;
    border-left: 0;
  }

  .hero-float {
    display: none;
  }

  .section-head {
    display: block;
    margin-bottom: 30px;
  }

  .section-title {
    font-size: 30px;
  }

  .page-hero {
    padding: 44px 0 38px;
  }

  .page-hero h1 {
    font-size: 38px;
  }

  .page-hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .catalog-side {
    grid-column: 1;
  }

  .catalog-code {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }

  .course-title-row {
    gap: 14px;
  }

  .course-badge {
    width: 56px;
    height: 56px;
    font-size: 15px;
  }

  .course-title-row h1 {
    font-size: 36px;
  }

  .chapter-head {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
  }

  .chapter-count {
    grid-column: 2;
  }

  .lesson-list {
    margin-left: 18px;
  }

  .lesson-row {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 16px 12px;
  }

  .lesson-row-meta {
    display: none;
  }

  .goals {
    grid-template-columns: 1fr;
  }

  .lesson-head h1 {
    font-size: 34px;
  }

  .lesson-bottom-nav {
    grid-template-columns: 1fr;
  }

  .keyboard-rules {
    grid-template-columns: 1fr;
  }

  .record-overview {
    grid-template-columns: 1fr 1fr;
  }

  .record-course {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .record-course > .progress-wrap {
    grid-column: 1 / -1;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: none;
  }

  .footer-main {
    flex-direction: column;
  }

  .footer-links {
    gap: 32px;
  }

  .practice-topbar-inner {
    width: calc(100% - 24px);
    gap: 10px;
  }

  .practice-back {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  .practice-back .back-label {
    display: none;
  }

  .practice-title {
    gap: 8px;
  }

  .practice-title span {
    display: none;
  }

  .practice-title strong {
    max-width: 132px;
  }

  .practice-wrap {
    width: calc(100% - 24px);
    padding-top: 20px;
  }

  .practice-intro-left h1 {
    font-size: 24px;
  }

  .typing-stage {
    min-height: 260px;
    padding: 24px 18px;
  }

  .typing-text {
    max-height: 230px;
  }

  .typing-panel-head {
    padding: 12px 16px;
  }

  .typing-hint {
    padding: 10px 16px;
  }

  .typing-foot {
    padding: 10px 16px;
  }

  .practice-stats {
    grid-template-columns: 1fr 1fr;
  }

  .practice-keyboard {
    padding: 14px;
  }

  .result-stats {
    grid-template-columns: 1fr 1fr;
  }

  .result-actions {
    padding: 18px 20px 22px;
  }

  .result-head,
  .result-stats,
  .result-message,
  .result-weak {
    margin-left: 20px;
    margin-right: 20px;
  }

  .result-head {
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
  }

  .result-head h2 {
    font-size: 25px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(40px, 11.4vw, 52px);
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-meta dd {
    font-size: 16px;
  }

  .course-card {
    padding: 20px;
    min-height: 280px;
  }

  .map-grid {
    grid-template-columns: 1fr;
  }

  .keyboard-feature-visual {
    padding: 14px;
  }

  .keyboard-stage {
    padding: 14px;
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    padding: 0 10px;
    font-size: 9px;
  }


  .practice-intro {
    margin-bottom: 16px;
  }

  .practice-mode-tabs {
    width: 100%;
  }

  .practice-mode-tab {
    flex: 1;
  }

  .typing-text {
    font-size: 19px;
  }

  .typing-text.is-cn {
    font-size: 21px;
  }

  .wubi-item {
    min-width: 64px;
    padding: 8px 9px 7px;
  }

  .wubi-char {
    font-size: 22px;
  }

  .wubi-code {
    font-size: 10px;
  }

  .result-actions .btn {
    flex-basis: 100%;
  }
}

@media (max-width: 380px) {
  .practice-title strong {
    max-width: 108px;
  }

  .practice-controls .icon-btn[data-practice-action="sound"] {
    display: none;
  }

  .practice-back {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   V2 — 工具页、练习页重做、游戏
   ========================================================= */

/* ---------- home toolkit ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.feature-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 24px;
  background: var(--panel);
  transition: background 0.2s var(--ease);
}

.feature-card:hover {
  background: var(--panel-2);
}

.feature-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-index {
  margin-top: 22px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.feature-card h3 {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.feature-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.feature-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: auto;
  padding-top: 20px;
}

.feature-stat strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.feature-stat span {
  color: var(--dim);
  font-size: 10px;
}

/* ---------- header: 6 nav items ---------- */
@media (max-width: 1080px) {
  .nav-link {
    padding: 8px 9px;
    font-size: 13px;
  }

  .brand-name em {
    display: none;
  }
}

@media (max-width: 980px) {
  .site-nav {
    position: fixed;
    z-index: 99;
    top: var(--header-h);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px;
  }

  .nav-link.is-active::after {
    top: 12px;
    right: auto;
    bottom: 12px;
    left: 0;
    width: 2px;
    height: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

/* ---------- practice v2 ---------- */
.practice-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.practice-top-actions.has-tabs {
  justify-content: space-between;
}

.practice-top-actions .practice-mode-tabs {
  background: var(--panel);
}

.practice-top-actions .practice-mode-tab {
  min-height: 28px;
  font-size: 10px;
}

.practice-wrap--v2 {
  width: min(100% - 48px, 1180px);
  padding: 22px 0 58px;
}

.practice-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.practice-context-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.context-course {
  color: var(--muted);
}

.context-meta {
  color: var(--dim);
}

.practice-context-right {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
}

.typing-sheet {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 2px solid var(--course, var(--accent));
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.typing-sheet.is-shaking {
  animation: sheetShake 0.2s var(--ease);
}

@keyframes sheetShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.sheet-status,
.sheet-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.sheet-status .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.sheet-status .live-dot.is-live {
  background: var(--green);
  animation: pulse 1.8s infinite;
}

.practice-wrap--v2 .typing-stage {
  min-height: 310px;
  padding: 38px 38px 56px;
}

.practice-wrap--v2 .typing-text {
  max-height: 300px;
  padding-right: 6px;
  font-family: var(--font-mono);
  font-size: 29px;
  font-weight: 450;
  letter-spacing: 0.015em;
  line-height: 2;
}

.practice-wrap--v2 .typing-text.is-cn {
  font-family: var(--font-sans);
  font-size: 33px;
  letter-spacing: 0.03em;
}

.practice-wrap--v2.typing-size-s .typing-text {
  font-size: 24px;
}

.practice-wrap--v2.typing-size-l .typing-text {
  font-size: 35px;
}

.practice-wrap--v2.typing-size-s .typing-text.is-cn {
  font-size: 28px;
}

.practice-wrap--v2.typing-size-l .typing-text.is-cn {
  font-size: 39px;
}

.practice-wrap--v2 .typing-text .ch {
  color: var(--muted);
}

.practice-wrap--v2 .typing-text .ch.is-done {
  border-radius: 2px;
  background: var(--correct-soft);
  color: var(--text);
}

.practice-wrap--v2 .typing-text .ch.is-current {
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent);
}

.practice-wrap--v2 .typing-text .ch.is-wrong {
  border-radius: 2px;
  background: var(--wrong);
  color: var(--accent-ink);
}

.practice-wrap--v2 .typing-start {
  position: absolute;
  z-index: 3;
  inset: auto auto 14px 50%;
  display: inline-flex;
  flex-direction: row;
  width: auto;
  max-width: calc(100% - 32px);
  align-items: center;
  gap: 10px;
  padding: 8px 15px 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  transform: translateX(-50%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.practice-wrap--v2 .typing-start .start-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.practice-wrap--v2 .typing-start .start-icon svg {
  width: 13px;
  height: 13px;
}

.practice-wrap--v2 .typing-start div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.practice-wrap--v2 .typing-start strong {
  font-size: 11px;
  font-weight: 600;
}

.practice-wrap--v2 .typing-start span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.practice-wrap--v2 .typing-hint {
  min-height: 50px;
  padding: 11px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}

.practice-wrap--v2 .typing-foot {
  padding: 10px 24px;
  border-top: 1px solid var(--line);
}

.stats-rail {
  display: grid;
  grid-template-columns: 1.35fr repeat(5, minmax(0, 1fr));
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  gap: 1px;
}

.rail-stat {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  background: var(--panel);
}

.rail-stat > span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.rail-stat strong {
  display: inline-block;
  margin-top: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  transform-origin: left center;
}

.rail-stat small {
  margin-left: 3px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 8px;
}

.rail-stat--speed {
  box-shadow: inset 2px 0 0 var(--accent);
}

.rail-stat--speed strong {
  color: var(--accent);
}

.rail-sparkline {
  width: 100%;
  height: 24px;
  margin-top: 4px;
  color: var(--accent);
  overflow: visible;
}

.rail-bar {
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.rail-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.2s linear;
}

.rail-stat strong.is-pop {
  animation: comboPop 0.16s var(--ease);
}

@keyframes comboPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); color: var(--accent); }
  100% { transform: scale(1); }
}

.practice-wrap--v2 .practice-keyboard {
  margin-top: 12px;
  padding: 13px 18px 12px;
  border-radius: 12px;
}

.practice-wrap--v2 .practice-keyboard-head {
  margin-bottom: 10px;
}

.practice-wrap--v2 .practice-keyboard .kb-key {
  height: clamp(30px, 2.9vw, 40px);
}

.practice-wrap--v2 #practice-legend .kb-legend {
  margin-top: 10px;
  gap: 7px 14px;
}

.practice-wrap--v2 #practice-legend .kb-legend span {
  font-size: 9px;
}

.practice-wrap--v2 .typing-text.is-wubi {
  white-space: normal;
}

/* correct highlight is a flat transparency, never a gradient */
html[data-theme="dark"] {
  --correct-soft: rgba(103, 210, 165, 0.13);
}

html[data-theme="light"] {
  --correct-soft: rgba(28, 138, 97, 0.12);
}

/* ---------- feature/daily/data/settings/games responsive shell ---------- */
@media (max-width: 1080px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-rail {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .practice-topbar-inner {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .practice-top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .practice-wrap--v2 {
    width: calc(100% - 24px);
    padding-top: 16px;
  }

  .practice-context {
    margin-bottom: 9px;
    font-size: 8px;
  }

  .practice-wrap--v2 .typing-stage {
    min-height: 280px;
    padding: 24px 18px 54px;
  }

  .practice-wrap--v2 .typing-text {
    font-size: 22px;
    line-height: 1.95;
  }

  .practice-wrap--v2 .typing-text.is-cn {
    font-size: 25px;
  }

  .practice-wrap--v2.typing-size-s .typing-text {
    font-size: 19px;
  }

  .practice-wrap--v2.typing-size-l .typing-text {
    font-size: 27px;
  }

  .practice-wrap--v2 .typing-text.is-wubi {
    font-size: 18px;
  }

  .practice-wrap--v2 .typing-start {
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 11px 6px 7px;
  }

  .practice-wrap--v2 .typing-start .start-icon {
    width: 24px;
    height: 24px;
  }

  .practice-wrap--v2 .typing-start span {
    display: none;
  }

  .practice-wrap--v2 .typing-hint {
    padding: 9px 16px;
  }

  .practice-wrap--v2 .typing-foot {
    padding: 9px 16px;
  }

  .typing-foot .keys kbd:nth-last-child(-n+2) {
    display: none;
  }

  .stats-rail {
    grid-template-columns: repeat(3, 1fr);
  }

  .rail-stat {
    padding: 10px 12px;
  }

  .rail-stat strong {
    font-size: 20px;
  }

  .rail-sparkline {
    display: none;
  }

  .practice-wrap--v2 .practice-keyboard {
    padding: 12px 14px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 220px;
  }
}

@media (max-width: 380px) {
  .practice-top-actions .practice-mode-tabs {
    width: 100%;
    order: 2;
  }

  .practice-top-actions {
    flex-wrap: wrap;
  }
}

/* =========================================================
   Daily practice
   ========================================================= */
.daily-hero-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.daily-hero-grid > div:first-child {
  max-width: 760px;
}

.daily-streak-card {
  min-width: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}

.daily-streak-card > span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.daily-streak-card strong {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 54px;
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.daily-streak-card small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
}

.daily-streak-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-top: 38px;
  border: 1px solid var(--line);
  background: var(--line);
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: var(--panel);
}

.week-day > span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.week-day strong {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

.week-day i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.week-day.is-done i {
  background: var(--green);
}

.week-day.is-today {
  background: var(--panel-2);
}

.week-day.is-today strong {
  color: var(--accent);
}

.daily-page {
  padding: 32px 0 84px;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.daily-card {
  position: relative;
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--course, var(--accent));
  border-radius: var(--radius);
  background: var(--panel);
}

.daily-card--en { --course: var(--violet); }
.daily-card--zh { --course: var(--green); }

.daily-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-status {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.daily-card h2 {
  margin-top: 22px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.daily-preview {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.daily-preview.mono {
  padding: 12px 14px;
  border-left: 2px solid var(--course);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
}

.daily-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: auto;
  padding: 18px 0 16px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
}

.daily-card .btn {
  width: 100%;
}

.daily-goal {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.daily-goal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.daily-goal-head h3 {
  margin-top: 7px;
  font-size: 20px;
  font-weight: 650;
}

.daily-goal-head strong {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.daily-goal-bar {
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.daily-goal-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}

.daily-goal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 10px;
}

.daily-goal-foot a {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
}

.daily-tip {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel);
}

.daily-tip p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

/* =========================================================
   Data
   ========================================================= */
.data-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.data-hero-row > div:first-child {
  max-width: 780px;
}

.data-tabs {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.data-tabs a {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 3px;
  color: var(--dim);
  font-size: 11px;
  line-height: 34px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.data-tabs a.is-active {
  background: var(--text);
  color: var(--bg);
}

.data-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 38px;
  border: 1px solid var(--line);
  background: var(--line);
}

.data-stat {
  padding: 18px 20px;
  background: var(--panel);
}

.data-stat span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.data-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--stat-color, var(--text));
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.data-stat small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 9px;
}

.data-page {
  padding: 34px 0 84px;
}

.data-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.data-section-head h2 {
  margin-top: 8px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.data-section-head > span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.course-data-card {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--course);
  border-radius: var(--radius);
  background: var(--panel);
}

.course-data-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.course-data-head .course-code {
  width: 32px;
  height: 32px;
  font-size: 10px;
}

.course-data-head h3 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 650;
}

.course-data-head p {
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
}

.course-data-head > strong {
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.data-progress {
  margin: 16px 0 22px;
}

.course-data-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  margin-bottom: 18px;
}

.chapter-progress {
  display: grid;
  gap: 9px;
}

.chapter-progress-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.chapter-progress-row strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.chapter-progress-row span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.mini-bar {
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--course, var(--accent));
}

.matrix-wrap {
  min-width: 0;
}

.matrix-label {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.lesson-matrix {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.matrix-cell {
  display: flex;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.matrix-cell:hover {
  border-color: var(--course);
  color: var(--text);
}

.matrix-cell.is-done {
  border-color: var(--course);
  background: var(--course);
  color: var(--accent-ink);
}

.matrix-cell.is-next {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-grid > *,
.data-two-col > *,
.data-panel,
.trend-chart-wrap,
.table-wrap {
  min-width: 0;
}

.trend-chart-wrap {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.trend-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trend-chart-head span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.trend-chart-head strong {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.trend-chart {
  width: 100%;
  height: 170px;
  overflow: visible;
}

.trend-chart-foot {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.chart-empty {
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.data-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  min-width: 0;
}

.data-panel {
  min-width: 0;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.data-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.data-panel-head h3 {
  font-size: 16px;
  font-weight: 650;
}

.data-panel-head span,
.data-panel-head a {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.data-panel-head a:hover {
  color: var(--text);
}

.data-panel--table {
  margin-top: 14px;
}

.error-heatmap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.error-heatmap .kb {
  --kb-font: 8px;
  min-width: 576px;
}

.error-heatmap .kb .kb-key {
  height: 27px;
}

.error-heatmap .kb-key .sub {
  display: none;
}

.kb-key.heat-1 { background: rgba(255, 128, 104, 0.16); }
.kb-key.heat-2 { background: rgba(255, 128, 104, 0.3); }
.kb-key.heat-3 { background: rgba(255, 128, 104, 0.48); color: var(--text); }
.kb-key.heat-4 { background: var(--wrong); color: var(--accent-ink); }

.error-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.error-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.error-key .keycap {
  min-width: 23px;
  height: 23px;
  border: 0;
  background: transparent;
  font-size: 9px;
}

.error-key em {
  color: var(--wrong);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 40px;
  gap: 12px;
  align-items: center;
  margin-bottom: 11px;
}

.mode-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mode-row strong {
  font-size: 11px;
  font-weight: 500;
}

.mode-row span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.mode-row em {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
  text-align: right;
}

.data-mini-stats {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.data-mini-stats span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.data-mini-stats strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 650;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* =========================================================
   Settings
   ========================================================= */
.settings-page {
  padding: 34px 0 84px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-col {
  display: grid;
  gap: 16px;
}

.settings-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.settings-card-head {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-card-head h2 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 650;
}

.setting-block {
  margin-bottom: 22px;
}

.setting-block:last-child {
  margin-bottom: 0;
}

.setting-block label {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
}

.setting-block p {
  margin: 4px 0 10px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.6;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 3px;
  color: var(--dim);
  font-size: 10px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.segmented button.is-active {
  background: var(--text);
  color: var(--bg);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.setting-row strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
}

.setting-row small {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}

.setting-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--panel-2);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--dim);
  content: "";
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}

.setting-row input:checked + .switch {
  border-color: var(--accent);
  background: var(--accent);
}

.setting-row input:checked + .switch::after {
  background: var(--accent-ink);
  transform: translateX(17px);
}

.settings-data-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: var(--line);
}

.settings-data-stats > div {
  padding: 12px;
  background: var(--panel-2);
}

.settings-data-stats span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.settings-data-stats strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 650;
}

.settings-note {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.7;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.danger-btn {
  border-color: rgba(255, 128, 104, 0.4);
  color: var(--wrong);
}

.danger-btn:hover {
  border-color: var(--wrong);
  background: var(--wrong);
  color: var(--accent-ink);
}

.about-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.about-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.about-list span {
  color: var(--dim);
  font-size: 10px;
}

.about-list strong {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-align: right;
}

.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.16s var(--ease);
}

.settings-link:hover {
  color: var(--text);
}

/* =========================================================
   Games
   ========================================================= */
.games-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.games-hero-row > div:first-child {
  max-width: 760px;
}

.games-record {
  min-width: 200px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}

.games-record span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.games-record strong {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.games-record p {
  margin-top: 8px;
  color: var(--dim);
  font-size: 10px;
}

.games-page {
  padding: 34px 0 84px;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.game-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.game-card-art {
  position: relative;
  display: flex;
  min-height: 330px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.game-card-art span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.game-card-art i {
  width: 60%;
  height: 2px;
  background: var(--line-strong);
}

.game-card-art i:nth-child(2) {
  transform: translateX(-18px);
}

.game-card-art i:nth-child(3) {
  transform: translateX(14px);
}

.game-card-art i:nth-child(4) {
  transform: translateX(-6px);
}

.game-card--rain .game-card-art {
  color: var(--blue);
}

.game-card--rain .game-card-art i {
  background: var(--blue);
  opacity: 0.55;
}

.game-card--rush .game-card-art {
  color: var(--amber);
}

.game-card--rush .game-card-art i {
  background: var(--amber);
  opacity: 0.55;
}

.game-card--rush .game-card-art i:nth-child(2) {
  transform: translateX(18px);
}

.game-card--rush .game-card-art i:nth-child(3) {
  transform: translateX(-14px);
}

.game-card--rush .game-card-art i:nth-child(4) {
  transform: translateX(6px);
}

.game-card-body {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.game-card-body h2 {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.game-card-body > p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: auto 0 16px;
  padding-top: 18px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.game-card .btn {
  width: 100%;
}

.game-rules {
  display: grid;
  grid-template-columns: 220px repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.game-rules > div {
  padding: 22px;
  background: var(--panel);
}

.game-rules h2 {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.game-rule strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.game-rule p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

/* game modal */
.game-overlay {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 7, 0.78);
  animation: fadeIn 0.18s var(--ease);
}

html[data-theme="light"] .game-overlay {
  background: rgba(35, 30, 22, 0.5);
}

.game-panel {
  width: min(100%, 920px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.game-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.game-panel-head h2 {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

#game-body {
  padding: 18px 22px 22px;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--line);
}

.game-hud > div {
  padding: 10px 14px;
  background: var(--panel-2);
}

.game-hud span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.game-hud strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.rain-stage,
.rush-stage {
  position: relative;
  height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.rain-stage.is-shaking,
.rush-stage.is-shaking {
  animation: sheetShake 0.2s var(--ease);
}

.rain-lanes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: none;
}

.rain-lanes i {
  border-right: 1px dashed var(--line);
  opacity: 0.55;
}

.rain-words {
  position: absolute;
  inset: 0;
}

.rain-word {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.02em;
  will-change: transform;
}

.rain-word.is-active {
  border-color: var(--accent);
  color: var(--text);
}

.rain-word .done {
  color: var(--accent);
}

.rain-buffer {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.game-start {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(11, 12, 14, 0.72);
  text-align: center;
}

html[data-theme="light"] .game-start {
  background: rgba(244, 241, 234, 0.84);
}

.game-start h3 {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.game-start p {
  max-width: 380px;
  color: var(--muted);
  font-size: 12px;
}

.game-start .btn {
  margin-top: 8px;
}

.game-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.game-result {
  position: absolute;
  z-index: 5;
  inset: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.game-result h3 {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.game-result p {
  max-width: 420px;
  color: var(--muted);
  font-size: 11px;
}

.game-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rush-stage {
  padding: 20px;
}

.rush-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 120px;
}

.rush-target span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.rush-target strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 76px;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
}

.rush-target em {
  color: var(--dim);
  font-size: 10px;
  font-style: normal;
}

.rush-keyboard {
  width: 100%;
  overflow-x: auto;
  padding-top: 8px;
}

.rush-keyboard .kb {
  --kb-font: 8px;
  min-width: 704px;
}

.rush-keyboard .kb-key {
  height: 30px;
}

.rush-keyboard .kb-key .sub {
  display: none;
}

.rush-result {
  display: none;
}

.rush-result.is-visible {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: block;
  background: var(--bg-soft);
}

.rush-result .game-result {
  inset: 0;
}

/* =========================================================
   V2 responsive
   ========================================================= */
@media (max-width: 1080px) {
  .daily-hero-grid,
  .games-hero-row,
  .data-hero-row {
    display: block;
  }

  .daily-streak-card,
  .games-record {
    margin-top: 24px;
    max-width: 320px;
  }

  .course-data-body {
    grid-template-columns: 1fr;
  }

  .lesson-matrix {
    grid-template-columns: repeat(12, 1fr);
  }

  .game-card {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .game-rules {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1000px) {
  .practice-topbar-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .practice-top-actions {
    width: auto;
    flex-shrink: 0;
  }

  .practice-top-actions.has-tabs {
    width: 100%;
  }
}

@media (max-width: 860px) {
  .daily-grid,
  .chart-grid,
  .data-two-col,
  .settings-layout,
  .game-cards {
    grid-template-columns: 1fr;
  }

  .data-summary {
    grid-template-columns: 1fr 1fr;
  }

  .games-record {
    margin-top: 20px;
  }

  .game-card {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .game-card-art {
    min-height: 280px;
  }

  .game-rules {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .daily-streak-card {
    max-width: none;
  }

  .week-strip {
    margin-top: 24px;
  }

  .daily-page,
  .games-page,
  .settings-page {
    padding: 24px 0 64px;
  }

  .daily-card {
    min-height: 290px;
    padding: 20px;
  }

  .daily-tip {
    flex-direction: column;
    gap: 8px;
  }

  .data-tabs {
    width: 100%;
    margin-top: 20px;
  }

  .data-tabs a {
    flex: 1;
    text-align: center;
  }

  .data-summary {
    margin-top: 24px;
  }

  .data-stat {
    padding: 14px;
  }

  .data-stat strong {
    font-size: 22px;
  }

  .lesson-matrix {
    grid-template-columns: repeat(8, 1fr);
  }

  .matrix-cell {
    height: 23px;
    font-size: 6px;
  }

  .course-data-card {
    padding: 18px;
  }

  .course-data-head > strong {
    font-size: 28px;
  }

  .trend-chart {
    height: 140px;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card-art {
    min-height: 120px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-card-body {
    padding: 20px;
  }

  .game-rules {
    grid-template-columns: 1fr;
  }

  .game-panel {
    max-height: calc(100vh - 24px);
  }

  .game-overlay {
    padding: 12px;
  }

  #game-body {
    padding: 12px;
  }

  .rain-stage,
  .rush-stage {
    height: 380px;
  }

  .game-hud strong {
    font-size: 18px;
  }

  .rush-target strong {
    font-size: 60px;
  }

  .settings-card {
    padding: 20px;
  }

  .settings-data-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .data-summary {
    grid-template-columns: 1fr;
  }

  .game-card-meta {
    margin-top: 18px;
  }

  .game-card-art {
    min-height: 100px;
  }

  .rush-stage {
    padding: 12px;
  }

  .rush-target {
    height: 100px;
  }

  .rain-word {
    font-size: 13px;
  }

  .game-result h3 {
    font-size: 40px;
  }

  .segmented {
    display: flex;
  }

  .segmented button {
    flex: 1;
  }
}

/* =========================================================
   V3 — 紧凑练习页、设置弹窗、数据仪表盘、游戏扩展
   ========================================================= */

.header-actions { gap: 6px; }
.header-tool {
  width: auto;
  gap: 6px;
  padding: 0 10px;
}
.header-tool-label {
  color: inherit;
  font-size: 11px;
}
.header-tool.is-active { border-color: var(--accent); color: var(--accent); }
.practice-title i { color: var(--dim); font-style: normal; }

@media (max-width: 1120px) {
  .header-tool-label { display: none; }
  .header-tool { width: 38px; padding: 0; }
}

/* compact practice */
.practice-wrap--v2 { width: min(100% - 32px, 980px); padding: 14px 0 32px; }
.practice-wrap--v2 .typing-sheet { border-radius: 12px; box-shadow: none; }
.practice-wrap--v2 .typing-stage { min-height: 300px; padding: 24px 30px; }
.practice-wrap--v2 .typing-text { max-height: 250px; font-size: 26px; line-height: 1.9; }
.practice-wrap--v2 .typing-text.is-cn { font-size: 31px; }
.practice-wrap--v2.typing-size-s .typing-text { font-size: 23px; }
.practice-wrap--v2.typing-size-l .typing-text { font-size: 32px; }
.practice-wrap--v2.typing-size-s .typing-text.is-cn { font-size: 26px; }
.practice-wrap--v2.typing-size-l .typing-text.is-cn { font-size: 36px; }

.typing-line-hint {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.hint-inline {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.hint-inline kbd {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}
.hint-inline b { color: var(--text); font-size: 15px; font-weight: 600; }
.hint-inline span { color: var(--dim); font-family: var(--font-mono); font-size: 10px; }
.hint-inline em {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
}
.hint-inline.is-error { color: var(--wrong); }
.hint-inline.is-error kbd { border-color: var(--wrong); color: var(--wrong); }
.hint-inline.is-error em { border-color: var(--wrong); color: var(--wrong); }
.hint-inline .hint-toggle {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}
.hint-count { flex-shrink: 0; color: var(--dim); font-family: var(--font-mono); font-size: 9px; }
.hint-count i { font-style: normal; }

.practice-pause {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(11, 12, 14, 0.9);
  text-align: center;
}
html[data-theme="light"] .practice-pause { background: rgba(244, 241, 234, 0.92); }
.practice-pause strong { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.practice-pause p { color: var(--dim); font-size: 11px; }
.practice-pause > div { display: flex; gap: 8px; margin-top: 8px; }

.practice-wrap--v2 .stats-rail { grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); margin-top: 10px; }
.practice-wrap--v2 .practice-keyboard { width: min(100%, 792px); margin: 10px auto 0; padding: 12px 16px; }
.practice-wrap--v2 .practice-keyboard .kb { width: 752px; min-width: 752px; margin: 0 auto; }
.practice-wrap--v2 .practice-keyboard .kb-key { height: 37px; }
.practice-wrap--v2 .typing-start--inline {
  position: static;
  inset: auto;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: none;
  transform: none;
  text-align: left;
}

.practice-wrap--v2 .typing-start--inline .start-icon {
  width: 20px;
  height: 20px;
}

.practice-wrap--v2 .typing-start--inline .start-icon svg {
  width: 9px;
  height: 9px;
}

.practice-wrap--v2 .typing-start--inline strong {
  color: var(--accent);
  font-size: 9px;
}

/* fixed-size keyboard */
.kb.is-mini { width: 100%; min-width: 0; }
.keyboard-stage .kb { width: 820px; min-width: 820px; }
.rush-keyboard .kb { width: 752px; min-width: 704px; }

/* settings modal */
.settings-overlay {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 7, 0.78);
  animation: fadeIn 0.16s var(--ease);
}
html[data-theme="light"] .settings-overlay { background: rgba(35, 30, 22, 0.5); }
.settings-dialog {
  width: min(100%, 760px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.settings-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.settings-dialog-head h2 { margin-top: 5px; font-size: 23px; font-weight: 700; letter-spacing: -0.03em; }
.settings-dialog-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.settings-section { min-width: 0; padding: 18px 22px; background: var(--panel); }
.settings-section-head { margin-bottom: 10px; color: var(--dim); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; }
.settings-section .setting-row { padding: 10px 0; }
.setting-row--stack { flex-direction: column; align-items: stretch; gap: 8px; }
.setting-row--stack > span { gap: 1px; }
.setting-row--stack .segmented { display: flex; align-self: stretch; }
.setting-row--stack .segmented button { flex: 1; }
.setting-volume { gap: 8px; }
.volume-control { display: grid; grid-template-columns: minmax(0, 1fr) 40px; width: 100%; align-items: center; gap: 10px; }
.volume-control input[type="range"] {
  width: 260px;
  max-width: 100%;
  min-width: 0;
  height: 4px;
  appearance: none;
  border-radius: 99px;
  background: var(--line);
  accent-color: var(--accent);
  outline: none;
}
.volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-control span { min-width: 38px; color: var(--dim); font-family: var(--font-mono); font-size: 9px; text-align: right; }
.settings-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--line);
}
.settings-mini-stats > div { padding: 10px; background: var(--panel-2); }
.settings-mini-stats span { display: block; color: var(--dim); font-family: var(--font-mono); font-size: 8px; }
.settings-mini-stats strong { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 18px; font-weight: 650; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.settings-actions .btn { flex: 1; min-width: 64px; }
.settings-about p { color: var(--dim); font-size: 10px; line-height: 1.7; }
.settings-dialog-foot {
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: right;
}

/* data dashboard */
.dash-page { padding: 28px 0 64px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.dash-head h1 { margin-top: 7px; font-size: 34px; font-weight: 750; letter-spacing: -0.04em; }
.dash-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.dash-updated { color: var(--dim); font-family: var(--font-mono); font-size: 9px; white-space: nowrap; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--line); }
.dash-kpi { padding: 14px 16px; background: var(--panel); }
.dash-kpi span { display: block; color: var(--dim); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.06em; }
.dash-kpi strong { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.dash-kpi em { margin-left: 4px; color: var(--dim); font-family: var(--font-sans); font-size: 9px; font-style: normal; font-weight: 400; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dash-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.dash-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.dash-card-head h2 { margin-top: 5px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.dash-card-head > a, .dash-card-head > span { color: var(--dim); font-family: var(--font-mono); font-size: 8px; }
.dash-card-head > a:hover { color: var(--text); }
.dash-course { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dash-course:last-child { border-bottom: 0; }
.dash-course-code {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--course);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}
.dash-course-main { min-width: 0; flex: 1; }
.dash-course-main > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dash-course-main strong { overflow: hidden; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.dash-course-main em { color: var(--dim); font-family: var(--font-mono); font-size: 8px; font-style: normal; white-space: nowrap; }
.dash-course-pct { width: 32px; color: var(--course); font-family: var(--font-mono); font-size: 10px; text-align: right; }
.mini-chart-stack { display: grid; gap: 10px; }
.mini-chart { min-width: 0; }
.mini-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.mini-chart-head span { color: var(--dim); font-family: var(--font-mono); font-size: 8px; }
.mini-chart-head em { color: var(--text-soft); font-family: var(--font-mono); font-size: 11px; font-style: normal; }
.mini-chart svg { width: 100%; height: 74px; overflow: visible; }
.chart-empty--small { padding: 16px; border: 0; font-size: 9px; }
.dash-card .error-heatmap .kb { --kb-font: 7px; width: 100%; min-width: 512px; }
.dash-card .error-heatmap .kb .kb-key { height: 23px; }
.dash-card .error-top { margin-top: 9px; }
.dash-recent-list { display: grid; gap: 1px; background: var(--line); }
.dash-recent-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 72px 40px; gap: 8px; align-items: center; padding: 9px 8px; background: var(--panel); font-size: 10px; }
.dash-recent-row:hover { background: var(--panel-2); }
.dash-recent-date { color: var(--dim); font-family: var(--font-mono); font-size: 8px; }
.dash-recent-row strong { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.dash-recent-row em { color: var(--accent); font-family: var(--font-mono); font-size: 8px; font-style: normal; text-align: right; }
.dash-recent-acc { color: var(--green); font-family: var(--font-mono); font-size: 8px; text-align: right; }

/* game additions */
.game-cards--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-cards--three .game-card { grid-template-columns: 1fr; }
.game-cards--three .game-card-art { min-height: 105px; border-right: 0; border-bottom: 1px solid var(--line); }
.game-card--sprint .game-card-art i { background: var(--green); opacity: 0.55; }
.game-custom {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.game-custom-copy h2 { margin-top: 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.game-custom-copy p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.game-custom-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.game-custom-form label { display: flex; min-width: 0; flex-direction: column; gap: 4px; color: var(--dim); font-size: 9px; }
.game-custom-form select, .game-custom-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text-soft);
  font-size: 11px;
}
.game-custom-form select { height: 34px; padding: 0 8px; }
.game-custom-form textarea { resize: vertical; padding: 8px; line-height: 1.5; }
.game-custom-form .custom-words { grid-column: 1 / -1; }
.game-custom-form button { grid-column: 1 / -1; }
.game-record-panel { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.game-record-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.game-record-head h2 { margin-top: 5px; font-size: 19px; font-weight: 650; }
.game-record-head > span { color: var(--dim); font-family: var(--font-mono); font-size: 8px; }

/* sprint game */
.sprint-stage {
  position: relative;
  display: flex;
  min-height: 380px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.sprint-stage.is-shaking { animation: sheetShake 0.18s var(--ease); }
.sprint-label { color: var(--dim); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.14em; }
.sprint-target { margin-top: 14px; font-family: var(--font-mono); font-size: clamp(34px, 6vw, 64px); font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; }
.sprint-target .is-done { color: var(--green); }
.sprint-target .is-current { border-radius: 3px; background: var(--accent); color: var(--accent-ink); }
.sprint-typed { min-height: 22px; margin-top: 10px; color: var(--dim); font-family: var(--font-mono); font-size: 11px; }

@media (max-width: 1080px) {
  .game-cards--three { grid-template-columns: 1fr; }
  .game-cards--three .game-card { grid-template-columns: 150px minmax(0, 1fr); }
  .game-cards--three .game-card-art { min-height: 230px; border-right: 1px solid var(--line); border-bottom: 0; }
  .game-custom { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .settings-dialog-body { grid-template-columns: 1fr; }
  .game-cards--three .game-card { grid-template-columns: 1fr; }
  .game-cards--three .game-card-art { min-height: 100px; border-right: 0; border-bottom: 1px solid var(--line); }
  .game-custom-form { grid-template-columns: 1fr 1fr; }
  .game-custom-form .custom-words, .game-custom-form button { grid-column: 1 / -1; }
}

.aside-note {
  margin-top: 6px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.65;
}

/* hand guide on keyboard page */
.hand-guide-section {
  padding: 44px 0 80px;
  border-top: 1px solid var(--line);
}

.hand-guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 34px;
  align-items: center;
}

.hand-guide-figure {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.hand-guide-figure img {
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  opacity: 0.9;
}

html[data-theme="dark"] .hand-guide-figure img {
  filter: invert(0.78) brightness(1.4);
  opacity: 0.9;
}

.hand-guide-figure figcaption {
  margin-top: 10px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.hand-guide-copy h2 {
  margin-top: 9px;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.hand-guide-copy > p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.hand-tip-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.hand-tip-list > div {
  padding: 12px;
  background: var(--panel-2);
}

.hand-tip-list strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
}

.hand-tip-list p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.hand-finger-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.hand-finger-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--fc);
  border-radius: 6px;
  background: var(--panel);
}

.hand-finger-keys {
  display: block;
  overflow: hidden;
  color: var(--fc);
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hand-finger-card strong {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 600;
}

.hand-finger-card p {
  margin-top: 4px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .hand-guide-grid {
    grid-template-columns: 1fr;
  }

  .hand-finger-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .practice-topbar-inner { min-height: 52px; height: auto; padding: 7px 0; }
  .practice-title strong { max-width: 150px; }
  .practice-wrap--v2 { width: calc(100% - 20px); padding-top: 12px; }
  .practice-wrap--v2 .typing-stage { min-height: 250px; padding: 20px 16px 44px; }
  .practice-wrap--v2 .typing-text { max-height: 220px; font-size: 21px; }
  .practice-wrap--v2 .typing-text.is-cn { font-size: 24px; }
  .practice-wrap--v2 .typing-text.is-wubi { font-size: 17px; }
  .typing-line-hint { padding: 7px 14px; }
  .hint-inline { font-size: 10px; }
  .practice-wrap--v2 .stats-rail { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .practice-wrap--v2 .rail-stat { padding: 8px 9px; }
  .practice-wrap--v2 .rail-stat strong { font-size: 18px; }
  .practice-wrap--v2 .practice-keyboard { width: 100%; padding: 10px; }
  .settings-overlay { padding: 10px; }
  .settings-dialog { max-height: calc(100vh - 20px); }
  .dash-page { padding: 20px 0 50px; }
  .dash-head { display: block; }
  .dash-updated { display: block; margin-top: 8px; }
  .dash-head h1 { font-size: 29px; }
  .dash-recent-row { grid-template-columns: 70px minmax(0, 1fr) 40px; }
  .dash-recent-row em { display: none; }
  .game-custom-form { grid-template-columns: 1fr; }
  .sprint-stage { min-height: 320px; }
  .sprint-target { font-size: 34px; }
}

/* 备案信息（占位） */
.footer-bottom .xw-beian{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 8px;flex-basis:100%;width:100%;padding-top:4px;font-size:9px;letter-spacing:.06em;color:var(--dim);}
.footer-bottom .xw-beian a{color:inherit;text-decoration:none;border-bottom:1px solid transparent;}
.footer-bottom .xw-beian a:hover{border-bottom-color:currentColor;}
.footer-bottom .xw-beian-sep{opacity:.45;}

.footer-bottom a{color:inherit;text-decoration:none;border-bottom:1px solid transparent;}
.footer-bottom a:hover{border-bottom-color:currentColor;}
