/* ==========================================================================
   core stylesheet v1.0.1.1
   ========================================================================== */

:root {
  --blue-900: #00305e;
  --blue: #00479c;
  --blue-600: #1a5bb0;
  --blue-100: #e6edf7;
  --gold: #e6b82e;
  --gold-600: #c99c1c;
  --gold-100: #fbf1d7;
  --ink: #101826;
  --ink-soft: #4a5568;
  --line: #e2e6ed;
  --bg: #f5f7fb;
  --white: #ffffff;
  --danger: #d64545;
  --success: #1f9d55;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 43, 92, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 43, 92, 0.14);
  --font-zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-en: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-zh);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand-word {
  font-family: var(--font-zh);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--blue-900);
  margin: 0;
}

.en, .brand-en {
  font-family: var(--font-en);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Nav ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 32px;
  width: auto;
  display: block;
}

/* 独立的 300x65 宽版 logo（已含 TapFont 字样，无需再搭配 .brand-name 文字） */
#imgLogo {
  height: 40px;
  width: auto;
}

.brand-name {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 22px;
  color: var(--blue-900);
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--blue);
  border-color: var(--gold);
}

/* 汉堡菜单按钮：仅小屏显示，三条横线一眼可辨 */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue-900);
  transition: transform .2s ease, opacity .2s ease;
}

/* 展开时三横变 X */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-600) 100%);
  color: var(--blue-900);
  box-shadow: 0 10px 24px rgba(230, 184, 46, 0.35);
}

.btn-primary:hover { box-shadow: 0 14px 30px rgba(230, 184, 46, 0.45); }

.btn-outline {
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--blue);
}

.btn-outline:hover { background: var(--blue-100); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}

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

.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(1200px 480px at 15% -10%, rgba(230,184,46,0.14), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(0,71,156,0.12), transparent 60%),
    var(--white);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-100);
  color: var(--gold-600);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.25;
  margin-bottom: 18px;
}

.hero h1 .accent { color: var(--gold-600); }

.hero p.lead {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 480px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
}

.hero-stats div strong {
  display: block;
  font-size: 26px;
  color: var(--blue-900);
  font-weight: 900;
}

.hero-stats div span {
  font-size: 13px;
  color: var(--ink-soft);
}

.hero-visual {
  background: linear-gradient(160deg, var(--blue-900), var(--blue));
  border-radius: 24px;
  padding: 34px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-visual::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(230, 184, 46, 0.25);
}

.hero-visual .type-line {
  font-family: var(--font-en);
  font-size: 15px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.hero-visual .type-line .ok { color: var(--gold); }
.hero-visual .type-line .cursor { border-right: 2px solid var(--gold); }

/* ---------------- Sections ---------------- */
.section {
  padding: 64px 0;
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 40px;
}

.section-head h2 { font-size: 28px; margin-bottom: 10px; }
.section-head p { color: var(--ink-soft); font-size: 15px; }

/* ---------------- 页面头部：面包屑 + 广告图（letters.html 用） ---------------- */
.page-head {
  text-align: left;
  margin: -14px 0 24px; /* 上边距 -14px：抵消 .practice-shell 顶部 32px 内边距，
                            让面包屑上方间距(=18px)和它到广告图的间距保持一致 */
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}

.crumb a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .12s ease;
}

.crumb a:hover { color: var(--blue); }

.crumb-sep {
  color: #c3cad6;
  user-select: none;
}

.crumb-current {
  color: var(--blue-900);
  font-weight: 700;
}

.ad-banner {
  width: 100%;
  aspect-ratio: 1072 / 160; /* 广告图原始宽高比：高度随宽度自动变化，避免固定高度在窄屏下左右被裁切 */
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 22px;
}

.ad-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 容器比例与图片一致，cover 等价于完整显示 */
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------------- Mode cards ---------------- */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.mode-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
  display: block;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
}

.mode-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--blue-100);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.mode-card h3 { font-size: 17px; margin-bottom: 6px; }
.mode-card p { font-size: 13px; color: var(--ink-soft); margin: 0; }

.mode-card.disabled {
  opacity: 0.55;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--white), var(--white) 10px, #fafbfd 10px, #fafbfd 20px);
}

.badge-soon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--ink-soft);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------------- 首页：功能建议 CTA 横条 ---------------- */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
  padding: 20px 26px;
  background: linear-gradient(120deg, var(--blue-900), var(--blue));
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.cta-band:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cta-band .cta-title { font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.cta-band .cta-sub { font-size: 13px; opacity: .82; }

.cta-band .cta-btn {
  background: var(--gold);
  color: var(--blue-900);
  font-weight: 800;
  font-size: 15px;
  padding: 10px 22px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- 首页：键盘指法图 ---------------- */
.finger-chart {
  padding: 24px;
  background: #fdfff4; /* 与 tenfinger.jpeg 底色一致，卡片与图片无缝融合 */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.finger-img {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

/* ---------------- Footer ---------------- */
/* 底部版权行（.footer-note）的上下留白由下面两处控制：
   1) .footer-top 的 margin-bottom —— 版权行「上方」的间距
   2) .site-footer 的 padding-bottom —— 版权行「下方」的间距
   想调版权行与上/下的距离，改这两个值即可；不要在 HTML 里写负 margin 硬调 */
.site-footer {
  margin-top: auto;
  background: var(--white);
  border-top: 3px solid var(--gold);
  color: var(--ink-soft);
  padding: 48px 0 14px; /* 底部留白：原 24px，缩小以收紧版权行下方间距 */
}

.footer-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px; /* 版权行上方间距：原 20px，缩小到 10px */
}

.footer-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.footer-brand img {
  height: 44px;
  width: auto;
  display: block;
}

.footer-intro {
  flex: 1 1 320px;
  max-width: 720px;
}

.footer-intro p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.footer-note {
  margin: 0; /* 去掉 <p> 标签默认的上下边距（1em），别用负 margin */
  font-size: 12px;
  color: rgba(16, 24, 38, 0.45);
  text-align: center;
}

/* ---------------- Practice page ---------------- */
.practice-shell {
  padding: 32px 0 80px;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.mode-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.mode-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.mode-tab[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-tab .tag {
  font-size: 10px;
  background: var(--gold);
  color: var(--blue-900);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 6px;
}

.practice-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}

.practice-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.combo-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  transition: background .2s, border-color .2s, box-shadow .2s;
}

.combo-badge .combo-num {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink-soft);
}

.combo-badge .combo-label {
  font-size: 12px;
  color: var(--ink-soft);
}

.combo-badge[data-tier="1"] {
  background: var(--blue-100);
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(0, 71, 156, 0.08);
}
.combo-badge[data-tier="1"] .combo-num,
.combo-badge[data-tier="1"] .combo-label { color: var(--blue); }

.combo-badge[data-tier="2"] {
  background: var(--gold-100);
  border-color: var(--gold-600);
  box-shadow: 0 0 0 4px rgba(230, 184, 46, 0.16);
}
.combo-badge[data-tier="2"] .combo-num,
.combo-badge[data-tier="2"] .combo-label { color: var(--gold-600); }

.combo-badge[data-tier="3"] {
  background: linear-gradient(90deg, var(--gold), var(--danger));
  border-color: transparent;
  box-shadow: 0 0 0 5px rgba(214, 69, 69, 0.18);
  animation: combo-hot-pulse 1s ease-in-out infinite;
}
.combo-badge[data-tier="3"] .combo-num,
.combo-badge[data-tier="3"] .combo-label { color: #fff; }

.combo-badge.pop { animation: combo-pop .28s ease; }
.combo-badge[data-tier="3"].pop { animation: combo-pop .28s ease, combo-hot-pulse 1s ease-in-out infinite; }

@keyframes combo-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@keyframes combo-hot-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(214, 69, 69, 0.18); }
  50% { box-shadow: 0 0 0 9px rgba(214, 69, 69, 0.06); }
}

.score-display {
  font-size: 13px;
  color: var(--ink-soft);
}

.score-display > * {
  display: inline;
}

.score-display > * + * {
  margin-left: 6px;
}

.score-display strong {
  font-family: var(--font-en);
  font-size: 20px;
  color: var(--blue-900);
}

.practice-target-wrap {
  position: relative;
  margin-bottom: 18px;
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

.fx-pop {
  position: absolute;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 15px;
  color: var(--success);
  animation: fx-float-up .6s ease-out forwards;
}

@keyframes fx-float-up {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -32px) scale(1); }
}

.practice-target .ch.shake {
  display: inline-block;
  animation: ch-shake .32s ease;
}

@keyframes ch-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.level-pill-row {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.level-pill {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-900);
  background: var(--blue-100);
  border-radius: 999px;
  padding: 5px 14px;
}

.xp-bar {
  height: 6px;
  background: var(--blue-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.xp-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue));
  transition: width .3s ease;
}

.result-stars {
  font-size: 22px;
  color: var(--line);
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.result-stars .lit { color: var(--gold); }

.level-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--gold-100), var(--gold-100));
  border: 1px solid var(--gold-600);
  color: var(--gold-600);
  font-weight: 700;
  font-size: 14px;
}

.practice-target {
  font-size: 26px;
  letter-spacing: 0.06em;
  line-height: 2;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  min-height: 108px;
  font-family: var(--font-en);
  word-break: break-all;
}

.practice-target .ch {
  position: relative;
  color: #c3cad6;
}

.practice-target .ch.correct { color: var(--blue); }
.practice-target .ch.wrong {
  color: var(--danger);
  text-decoration: underline wavy var(--gold);
}
.practice-target .ch.current {
  border-bottom: 2px solid var(--gold);
}

.practice-target .ch.sp {
  border-bottom: 1px dotted #c3cad6;
  margin: 0 2px;
}

.practice-target .ch.gap {
  margin-right: 10px;
}

.wubi-hint {
  font-size: 13px;
  color: var(--gold-600);
  background: var(--gold-100);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
  display: none;
}

.practice-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  outline: none;
  transition: border-color .15s;
}

.practice-input:focus { border-color: var(--blue); }

.practice-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.practice-actions-buttons {
  display: flex;
  gap: 8px;
}

.sound-toggle-btn {
  width: 36px;
  padding: 0;
  font-size: 15px;
}

.stat-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.stat-row:last-child { border-bottom: none; }
.stat-row span { font-size: 13px; color: var(--ink-soft); }
.stat-row strong { font-size: 20px; color: var(--blue-900); font-family: var(--font-en); }
/* 「当前轮次」数字：字号 28px、金黄色。想改大小/颜色就改这一行 */
.stat-row strong.stat-round { font-size: 28px; color: var(--gold-600); }

.progress-bar {
  height: 8px;
  background: var(--blue-100);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-600));
  transition: width .15s ease;
}

/* ---------------- 练字母：下落式字母滚动 ----------------
   【改这里】以下都是练字母页（letters.html）专属样式，不影响其它页面。
   常用修改点：
   - 字母「未命中」颜色：.falling-letter 的 color（当前深藏青 var(--blue-900)）
   - 字母「命中后」颜色：.falling-letter.hit 的 color（当前暗金 #b8a23d）
   - 舞台最低/最高高度：.falling-stage 的 min-height（当前 300px）与 max-height（当前 420px，限制下拉长让键盘一屏可见）
   - 当前轮次数字颜色/大小：.stat-row strong.stat-round
   - 速度读数大小：.speed-readout 的 font-size
   - 轮数框字体大小：.stepper input[type="number"] 的 font-size
   ---------------------------------------------------------------- */
.falling-layout {
  grid-template-columns: 1fr 280px;
  align-items: stretch; /* 左右两栏等高：左（字母舞台）与右（设置面板）高度一致 */
}

.falling-card {
  display: flex;
  flex-direction: column;
}

.falling-stage {
  position: relative;
  flex: 1 1 0;        /* 自动撑满左栏剩余高度：右侧面板比舞台高时，舞台跟着一起变高 */
  min-height: 300px;  /* 舞台最低高度：改这里可让字母滚动的距离更长/更短（调小可让下方键盘露出来） */
  max-height: 420px;  /* 舞台最高高度：限制下拉长，确保下面的键盘示意图一屏可见 */
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.falling-track {
  position: absolute;
  inset: 0;
}

/* 下落舞台空状态：游戏开始前居中显示图标 + 提示，点「开始练习」后隐藏 */
.stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  z-index: 1;
}
.stage-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold-100);
  color: var(--blue-900);
}
.stage-empty-icon svg {
  width: 28px;
  height: 28px;
}
.stage-empty-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-900);
}
.stage-empty-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.falling-stage.running .stage-empty {
  display: none;
}

.falling-letter {
  position: absolute;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 30px;         /* 字母字号，改这里 */
  color: var(--blue-900);  /* 未命中字母的颜色（改这里） */
  transform: translateX(-50%);
  transition: color .15s;
}

.falling-letter.hit {
  color: #b8a23d; /* 命中后字母的颜色：黄色带一点灰（改这里） */
}

.falling-tip {
  font-size: 13px;
  color: var(--ink-soft);
}

/* 操作提示高亮：动作短语（如「请按键盘上对应的字母键」「请点击下面的拼音」）
   做成淡金胶囊、字略大加粗，一眼看清该怎么操作。想调大小/颜色改这里。
   用独立类 .tip-action，跟读表等处也能复用（不依赖 .falling-tip 父级）。 */
.tip-action {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-900);
  background: var(--gold-100);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 1px 12px;
  margin: 4px 6px;
  white-space: nowrap;
}

.falling-panel {
  display: flex;
  flex-direction: column;
}

.falling-panel-head {
  margin-bottom: 18px;
}

.falling-panel-head h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.falling-panel-head p {
  font-size: 13px;
  color: var(--ink-soft);
}

.control-row {
  margin-bottom: 16px;
}

.control-row label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.control-row input[type="range"] {
  width: 100%;
}

.stepper {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.stepper input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  appearance: textfield;
  -moz-appearance: textfield;
  outline: none;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-en);
  text-align: center;
  color: var(--blue-900);
}

/* 隐藏 number 输入框自带的上下三角 */
.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 光标悬停/聚焦时保持原来的边框颜色，不变黑 */
.stepper input[type="number"]:hover,
.stepper input[type="number"]:focus {
  border-color: var(--line);
  outline: none;
}

.step-btn {
  width: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--blue);
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, border-color .12s ease;
}

.step-btn:hover { background: var(--blue-100); border-color: var(--blue); }
.step-btn:active { transform: translateY(1px); }
.step-btn:disabled { opacity: .4; cursor: not-allowed; }

.speed-readout {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  color: var(--blue-900);
  margin-bottom: 10px;
}

.round-hint {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--blue-100);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.round-hint.show { display: block; }

.falling-panel .btn-block {
  margin-bottom: 18px;
}

/* ============ 【共用组件】键盘（.keyboard / .keyboard-row / .key）============
   练字母 / 练拼音 / 练五笔 三处共用同一套键样式，改这里三处一起生效；
   练笔画是「键 + 笔画 + 名称」的特殊键盘，见下方 .stroke-keyboard，不并入这里。 */
.keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.keyboard-row {
  display: flex;
  gap: 6px;
}

.key {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}

/* F/J 定位键：底部画一条小凸点提示 */
.key.home::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-soft);
}

.key.active {           /* 下落中、待按的键：高亮 */
  background: var(--blue-100);
  border-color: var(--blue);
  color: var(--blue-900);
  transform: translateY(-2px);
}

.key.hit {              /* 按对：闪绿 */
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.key.miss {             /* 漏掉：闪红（暂未启用，预留） */
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* 练拼音键盘提示：已敲对的字母标「已完成」（深蓝），下一个要敲的键标「下一个」（金色醒目、会呼吸） */
.key.done {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
}
.key.next {
  background: var(--gold);
  border-color: var(--gold-600);
  color: #fff;
  box-shadow: 0 0 0 4px var(--gold-100);
  animation: key-next-pulse 1s ease-in-out infinite;
}
@keyframes key-next-pulse {
  0%, 100% { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--gold-100); }
  50%      { transform: translateY(-3px); box-shadow: 0 0 0 7px rgba(201, 156, 28, .12); }
}

/* ---------------- 练拼音（pinyin.html）专用 ---------------- */
.falling-pinyin {
  position: absolute;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 22px;
  color: var(--blue-900);       /* 未命中拼音卡片的颜色 */
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  transition: color .15s, background .15s, border-color .15s;
  cursor: default;
  user-select: none;
}

/* 键盘打字时当前匹配的目标卡片（前缀命中，蓝亮提示继续敲） */
.falling-pinyin.target { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }

.falling-pinyin.hit {
  color: #fff;
  background: var(--blue);      /* 命中后卡片变蓝（改这里） */
  border-color: var(--blue);
}

/* （原 .pinyin-buffer 输入回显已移除：输入提示改放到键盘上，见 .key.done / .key.next） */

/* 练习范围分组选择（全部/声母/韵母/整体认读） */
.pinyin-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pinyin-group-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pinyin-group-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pinyin-group-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 拼音跟读表（下方全宽卡片） */
.pinyin-reference {
  margin-top: 24px;
}

.pinyin-tabs {
  margin-bottom: 18px;
}

.pinyin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.pinyin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color .15s, background .15s, transform .12s;
}

.pinyin-card:hover {
  border-color: var(--gold);
  background: var(--gold-100);
  transform: translateY(-2px);
}

.pinyin-card:active { transform: translateY(0); }

.pinyin-card-py {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 20px;
  color: var(--blue-900);
}

.pinyin-card-hz {
  font-size: 13px;
  color: var(--ink-soft);
}

.pinyin-card-note {
  font-size: 11px;
  line-height: 1.2;
  color: var(--gold-600);
  margin-top: 1px;
}

/* ---------------- 练笔画（strokes.html）专用 ---------------- */
/* 笔画卡片字形（如 一 丨 ㇆ 乙）笔画较细，字号放大；下方标注名称方便认出笔画再按键 */
.falling-stroke {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-zh);
  min-width: 60px;
  text-align: center;
  color: var(--blue-900);       /* 未命中笔画卡片的颜色 */
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  transition: color .15s, background .15s, border-color .15s;
}

.fs-s {
  font-size: 40px;
  font-weight: 500;
  line-height: 1.05;
}

.fs-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-soft);
}

.falling-stroke.hit {
  color: #fff;
  background: var(--blue);      /* 命中后卡片变蓝（改这里） */
  border-color: var(--blue);
}

.falling-stroke.hit .fs-name { color: #fff; }

/* 练习范围分组选择（全部/基本笔画/折画/钩画） */
.stroke-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stroke-group-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.stroke-group-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.stroke-group-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 笔画跟读表（下方全宽卡片） */
.stroke-reference {
  margin-top: 24px;
}

.stroke-tabs {
  margin-bottom: 18px;
}

.stroke-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.stroke-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color .15s, background .15s, transform .12s;
}

.stroke-card:hover {
  border-color: var(--gold);
  background: var(--gold-100);
  transform: translateY(-2px);
}

.stroke-card:active { transform: translateY(0); }

.stroke-card-s {
  font-family: var(--font-zh);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.1;
  color: var(--blue-900);
}

.stroke-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.stroke-card-note {
  font-size: 12px;
  line-height: 1.2;
  color: var(--gold-600);
  margin-top: 1px;
}

/* 跟读表卡片上的「按 X」按键标注 */
.stroke-card-key {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-100);
  border-radius: 6px;
  padding: 1px 8px;
}

/* 字母跟读表（练字母：点字母听发音，标中文近似读音） */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.letter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color .15s, background .15s, transform .12s;
}

.letter-card:hover {
  border-color: var(--gold);
  background: var(--gold-100);
  transform: translateY(-2px);
}

.letter-card:active { transform: translateY(0); }

.letter-card-pair {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 38px;
  line-height: 1.1;
  color: var(--blue-900);
  letter-spacing: 1px;
}

.letter-card-zh {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-600);
}

/* 学习区 Tab 面板（跟读表 / 键盘示意图） */
.stroke-panel {
  margin-top: 18px;
}

.stroke-cat-tabs {
  margin-bottom: 18px;
}

.stroke-key-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.9;
}

/* 键盘示意图放在左栏舞台正下方：用一条上分隔线跟舞台区分，练习时舞台和键盘同时可见 */
.stroke-key-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* 键盘示意图的键位：笔画键更高，三行显示「键 + 笔画 + 名称」 */
.stroke-keyboard .key {
  width: 48px;
  height: 62px;
}

.stroke-key {
  flex-direction: column;
  gap: 1px;
  font-size: 0;
}

.stroke-key .key-letter {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-soft);
}

.stroke-key .key-stroke {
  font-family: var(--font-zh);
  font-size: 24px;
  line-height: 1.1;
  color: var(--blue-900);
}

.stroke-key .key-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-soft);
}

.stroke-keyboard .key-dim {
  opacity: .32;
}

/* 高亮 / 命中时，笔画键内部文字跟随变色 */
.stroke-key.hit .key-letter,
.stroke-key.hit .key-stroke,
.stroke-key.hit .key-name { color: #fff; }

/* 页面主 Tab（练笔画：练习打笔画 / 笔画跟读表 / 通过笔画来打字） */
.page-tabs {
  margin-bottom: 22px;
}

/* ---------------- 通过笔画来打字（左：汉字/键盘，右：设置） ---------------- */
.type-left {
  gap: 16px;
}

/* ============ 【共用组件】打字练习区（练拼音 / 练笔画 / 练五笔 共用）============
   .type-stage   舞台容器（垂直居中整块练习内容）
   .type-char    大字（汉字 / 笔画 / 字根）
   .type-py      大字下方的拼音 / 分区说明
   .type-slots + .type-slot  绿色区域 = 字母槽（下面单独一节） */
.type-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 0 20px;
}

.type-char {
  font-family: var(--font-zh);
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  color: var(--blue-900);
  margin-bottom: 6px;
}

/* 练五笔：多字词语整词显示时，按字数收敛字号，避免 4 个字太大溢出 */
.type-char[data-len="2"] { font-size: 68px; }
.type-char[data-len="3"] { font-size: 54px; }
.type-char[data-len="4"] { font-size: 46px; }

.type-py {
  font-size: 16px;
  color: var(--gold-600);
  margin-bottom: 22px;
}

/* ============ 【共用组件】绿色区域 = 字母槽（.type-slots 容器 + .type-slot 槽）============
   练拼音 / 练笔画 / 练五笔 三处共用同一套尺寸（槽 48×56、字号 30），改这里三处一起生效。
   槽内字体分两种：练拼音/练五笔放拉丁字母 → 用英文字体（.type-slots.latin）；
   练笔画放笔画字形（一丨丿丶乙）→ 保持默认中文字体。 */
.type-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
}

/* 拉丁字母槽（练拼音/练五笔）：英文字体让拉丁字母在框里水平垂直居中 */
.type-slots.latin .type-slot { font-family: var(--font-en); }

/* 打字玩法「正在取字」进度条：开始/切难度/打完再来时短暂出现，不显示失败文案 */
.type-load-bar {
  width: 100%;
  max-width: 260px;
  height: 6px;
  margin-top: 14px;
  border-radius: 3px;
  background: var(--blue-100);
  overflow: hidden;
}
.type-load-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-600) 100%);
  animation: type-load-bar-move 1.1s ease-in-out infinite;
}
@keyframes type-load-bar-move {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.type-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 56px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-zh);
  font-size: 30px;
  color: var(--blue-900);
}

/* 当前要敲的字母槽（蓝亮，提示打到哪里） */
.type-slot.current {
  border-style: solid;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}

/* 打错字母时当前槽红闪 */
.type-slot.miss {
  border-style: solid;
  border-color: var(--danger);
  background: #fff;
}

.type-slot.filled {
  border-style: solid;
  border-color: var(--success);
  background: #fff;
}

.type-slot.hinted {
  border-style: solid;
  border-color: var(--gold);
  background: var(--gold-100);
  color: var(--gold-600);
}

/* ---------------- 练五笔：压缩左右两栏，让练习区尽量一屏显示全（也更好适配小屏） ----------------
   只作用于练五笔页（wubi.html 的两个练习面板加了 .wubi-type），不影响练拼音/练笔画等其它页。 */
.wubi-type .practice-card,
.wubi-type .stat-panel { padding: 18px; }

.wubi-type .type-left { gap: 12px; }

.wubi-type .game-bar { margin-bottom: 10px; }

.wubi-type .type-stage { padding: 0; }

.wubi-type .type-char { font-size: 72px; }
.wubi-type .type-char[data-len="2"] { font-size: 56px; }
.wubi-type .type-char[data-len="3"] { font-size: 48px; }
.wubi-type .type-char[data-len="4"] { font-size: 44px; }

.wubi-type .type-py { font-size: 14px; margin-bottom: 12px; }

/* 键盘不再单独定尺寸：练五笔与练字母/练拼音共用同一套 .key（46px），统一大小方便统一管理 */

.wubi-type .falling-panel-head { margin-bottom: 12px; }
.wubi-type .falling-panel-head h3 { font-size: 16px; }
.wubi-type .control-row { margin-bottom: 12px; }
.wubi-type .control-row label { margin-bottom: 6px; }
.wubi-type .stat-row { padding: 8px 0; }
.wubi-type .stat-row strong { font-size: 18px; }
.wubi-type .stat-row strong.stat-round { font-size: 24px; }
.wubi-type .speed-readout { font-size: 22px; margin-bottom: 6px; }
.wubi-type .falling-panel .btn-block { margin-bottom: 12px; }

/* ---------------- Modal ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 38, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-mask.show { display: flex; }

.modal-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 { font-size: 22px; margin-bottom: 6px; }
.modal-card .result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.modal-card .result-grid div {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
}

.modal-card .result-grid strong {
  display: block;
  font-size: 22px;
  color: var(--blue);
  font-family: var(--font-en);
}

.modal-card .result-grid span { font-size: 12px; color: var(--ink-soft); }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; }

.field { margin-bottom: 16px; text-align: left; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }

/* ---------------- Error page ---------------- */
.error-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 480px at 15% -10%, rgba(230,184,46,0.16), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(0,71,156,0.14), transparent 60%),
    var(--bg);
}

.error-card {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 52px 40px 44px;
  position: relative;
}

.error-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-600) 100%);
}

.error-card .icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-100), #ffffff);
  border: 1px solid var(--gold-100);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(230, 184, 46, 0.25);
}

.error-card .icon svg {
  width: 32px;
  height: 32px;
  color: var(--gold-600);
}

.error-card h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.error-card p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

/* ---------------- Feedback page ---------------- */
.feedback-form-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.feedback-note {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--gold-100);
  border: 1px solid var(--gold-600);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.toast-levelup {
  background: linear-gradient(90deg, var(--gold-600), var(--gold));
  color: var(--blue-900);
  font-weight: 700;
}

/* ---------------- 五笔字根表（键盘式，照 五笔字根图 排版） ---------------- */
.radicals-table {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 6px 4px;
  width: 100%;
  min-width: 0;
}
.radicals-kb-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
/* 每排凑满 10 格：左右留白 spacer 与键等宽，既还原键盘阶梯错位，又让键随容器等比例缩放 */
.radicals-kb-spacer {
  flex: 1 1 0;
  min-width: 0;
}

.radicals-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 5px 10px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.radicals-key-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.radicals-key-letter {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border-radius: 5px;
}
.radicals-key-loc {
  font-size: 10px;
  color: var(--ink-soft);
  font-family: var(--font-zh);
  white-space: nowrap;
}
.radicals-key-name {
  font-family: var(--font-zh);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--blue-900);
}
.radicals-key-chars {
  font-family: var(--font-zh);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  letter-spacing: 1px;
  color: var(--ink);
}
.radicals-key-mn {
  margin-top: auto;
  font-family: var(--font-zh);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
  color: var(--ink-soft);
}
/* Z 万能键：空键、虚线框 */
.radicals-key.is-wild {
  background: var(--bg);
  border-style: dashed;
  justify-content: flex-start;
  gap: 8px;
}
.radicals-key.is-wild .radicals-key-letter { background: var(--ink-soft); }
.radicals-key-wild {
  font-size: 11px;
  color: var(--ink-soft);
  writing-mode: vertical-rl;
  letter-spacing: 1px;
}
/* 键盘下方：五个区的起笔口诀 */
.radicals-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
  padding: 10px 6px 4px;
  border-top: 1px dashed var(--line);
}
.radicals-legend-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.radicals-legend-tag {
  font-weight: 700;
  color: var(--gold-600);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .practice-layout { grid-template-columns: 1fr; }

  /* 小屏：隐藏横向菜单，改用汉堡按钮展开下拉菜单 */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 14px 24px;
    font-size: 16px;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .nav-links a.active {
    color: var(--blue);
    border-left-color: var(--gold);
    background: var(--blue-100);
  }
}

/* 广告图：视口宽度 < 1024px 隐藏，>= 1024px 显示（占地方、窄屏显示效果不佳，与其它断点无关，单独判断） */
@media (max-width: 1023px) {
  .ad-banner { display: none; }
}

@media (max-width: 560px) {
  .mode-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .modal-card .result-grid { grid-template-columns: 1fr; }

  /* 练习页左右留白、卡片内边距收紧：省出空间让键盘能做大一些 */
  .practice-shell .container { padding: 0 12px; }
  .practice-card { padding: 14px; }

  .key { width: 36px; height: 42px; font-size: 16px; }
  .keyboard-row { gap: 4px; }

  /* QWERTY 键盘（练字母/练拼音）：键改为弹性宽度，保证首行 10 键在窄屏不横向溢出 */
  .keyboard { width: 100%; }
  .keyboard .keyboard-row { width: 100%; justify-content: center; gap: 3px; }
  .keyboard .key { width: auto; flex: 1 1 0; max-width: 36px; height: 42px; font-size: 16px; }

  .stroke-keyboard .key { width: 28px; height: 46px; }
  .stroke-keyboard .keyboard-row { gap: 3px; }
  .stroke-key .key-stroke { font-size: 16px; }
  .stroke-key .key-letter { font-size: 9px; }
  .stroke-key .key-name { font-size: 9px; }
  .wubi-type .type-char { font-size: 52px; }
  .wubi-type .type-char[data-len="2"] { font-size: 42px; }
  .wubi-type .type-char[data-len="3"] { font-size: 36px; }
  .wubi-type .type-char[data-len="4"] { font-size: 32px; }

  /* 字根表小屏：键更紧凑，隐藏口诀和区位码，只留 键字母 + 键名 + 字根 */
  .radicals-table { gap: 6px; padding: 4px 2px; }
  .radicals-kb-row { gap: 4px; }
  .radicals-key { min-height: 0; padding: 5px 3px 7px; gap: 2px; border-bottom-width: 2px; }
  .radicals-key-letter { width: 16px; height: 16px; font-size: 10px; }
  .radicals-key-loc { display: none; }
  .radicals-key-name { font-size: 18px; }
  .radicals-key-chars { font-size: 11px; letter-spacing: 0; }
  .radicals-key-mn { display: none; }
}
