/* 莱茵日语 · 样式 */
:root {
  --bg-deep: #061826;
  --bg-mid: #082338;
  --ink: #eaf7ff;
  --muted: #93b4c8;
  --line: rgba(140, 210, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --accent: #54e0c8;
  --accent-ink: #04241f;
  --accent-2: #7cc4ff;
  --ok: #59e0a0;
  --danger: #ff7a8a;
  --warn: #ffc46b;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(0, 10, 20, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(70, 150, 255, 0.26), transparent 62%),
    radial-gradient(900px 520px at 92% 2%, rgba(60, 220, 200, 0.15), transparent 55%),
    linear-gradient(180deg, #061826 0%, #082338 46%, #061a2b 100%);
  background-attachment: fixed;
}

button { font-family: inherit; }

a { color: var(--accent-2); }

/* 背景气泡 */
.ocean-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bubble {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  border: 1px solid rgba(140, 220, 255, 0.22);
  background: radial-gradient(circle at 32% 30%, rgba(190, 240, 255, 0.22), rgba(120, 200, 255, 0.02) 65%);
  animation: rise linear infinite;
}
.b1 { width: 90px; height: 90px; left: 6%; animation-duration: 26s; animation-delay: 0s; }
.b2 { width: 40px; height: 40px; left: 22%; animation-duration: 19s; animation-delay: 4s; }
.b3 { width: 130px; height: 130px; left: 44%; animation-duration: 34s; animation-delay: 2s; opacity: 0.55; }
.b4 { width: 26px; height: 26px; left: 63%; animation-duration: 16s; animation-delay: 7s; }
.b5 { width: 72px; height: 72px; left: 79%; animation-duration: 28s; animation-delay: 1s; opacity: 0.7; }
.b6 { width: 52px; height: 52px; left: 92%; animation-duration: 22s; animation-delay: 9s; }
@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  100% { transform: translateY(-120vh) translateX(40px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; }
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(6, 24, 38, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-penguin {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 24px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(84, 224, 200, 0.24), rgba(124, 196, 255, 0.16));
  border: 1px solid rgba(140, 235, 220, 0.32);
  box-shadow: 0 8px 24px rgba(20, 120, 110, 0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 18px; letter-spacing: 0.06em; }
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }

.main-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  cursor: pointer;
  transition: 0.2s ease;
}
.nav-btn span { font-size: 15px; }
.nav-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-btn.is-active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), #8ff0e2);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(84, 224, 200, 0.28);
}

/* 页面容器 */
.page {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px clamp(14px, 3.4vw, 28px) 64px;
}
.view { display: none; }
.view.is-active { display: block; animation: fadeUp 0.4s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-head { margin: 6px 0 22px; }
.view-head h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: 0.02em;
}
.view-head h1 .en {
  font-size: 0.56em;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-left: 6px;
}
.view-head p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* 面板 */
.panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: 0.03em;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 14.5px;
  cursor: pointer;
  transition: 0.18s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8ff0e2);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(84, 224, 200, 0.24);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* 分段控件 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.seg-btn {
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.18s ease;
}
.seg-btn.is-active {
  background: rgba(124, 196, 255, 0.2);
  color: var(--ink);
  font-weight: 700;
}
.progress-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 180px;
}
.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}
.progress-text { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* 单词卡 */
.card-area { min-height: 420px; }

.word-card {
  perspective: 1400px;
  max-width: 620px;
  margin: 0 auto;
  height: 350px;
  cursor: pointer;
}
.word-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.word-card.is-flipped .word-card-inner { transform: rotateY(180deg); }
.word-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(84, 224, 200, 0.12), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.word-face.back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  padding-top: 46px;
}
.card-tag {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.card-hint {
  position: absolute;
  bottom: 16px;
  font-size: 11.5px;
  color: rgba(147, 180, 200, 0.7);
}
.word-main {
  font-size: clamp(38px, 7vw, 56px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  word-break: break-word;
}
.word-kana { color: var(--accent); font-size: 17px; margin-top: 10px; }
.word-pos { color: var(--muted); font-size: 13px; margin-top: 16px; letter-spacing: 0.08em; }
.word-meaning {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  margin-bottom: 6px;
}
.word-example {
  margin-top: 18px;
  font-size: 15px;
  color: #d6ecfa;
  max-width: 480px;
}
.word-example-ec { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

.card-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* 读音模式 */
.spell-panel {
  max-width: 620px;
  margin: 0 auto;
  padding: 30px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  text-align: center;
}
.spell-prompt { font-size: 26px; font-weight: 700; }
.spell-pos { color: var(--muted); font-size: 13px; margin-top: 4px; }
.spell-hint { color: var(--muted); font-size: 13.5px; margin: 12px 0 18px; }
.spell-input {
  width: min(100%, 360px);
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font-size: 19px;
  letter-spacing: 0.06em;
  text-align: center;
  outline: none;
  transition: 0.18s ease;
}
.spell-input:focus { border-color: rgba(84, 224, 200, 0.6); box-shadow: 0 0 0 4px rgba(84, 224, 200, 0.12); }
.spell-feedback { min-height: 26px; margin-top: 12px; font-size: 14.5px; }
.spell-feedback.ok { color: var(--ok); }
.spell-feedback.bad { color: var(--danger); }
.spell-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 70px 20px;
}
.empty-state .big { font-size: 42px; display: block; margin-bottom: 10px; }

/* 口语 */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: 0.18s ease;
}
.chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.09); }
.chip.is-active {
  color: var(--accent);
  border-color: rgba(84, 224, 200, 0.5);
  background: rgba(84, 224, 200, 0.1);
  font-weight: 700;
}
.speak-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.dialog-head h3 { margin-bottom: 4px; }
.dialog-head p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.dialog-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dialog-line {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  transition: 0.18s ease;
}
.dialog-line:hover { background: rgba(255, 255, 255, 0.065); }
.dialog-line.is-speaking {
  border-color: rgba(84, 224, 200, 0.45);
  background: rgba(84, 224, 200, 0.08);
}
.line-index {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(84, 224, 200, 0.35);
  margin-top: 2px;
}
.line-body { flex: 1; min-width: 0; }
.line-en { font-size: 15.5px; color: var(--ink); }
.line-cn { font-size: 13px; color: var(--muted); margin-top: 2px; }
.play-line {
  flex: none;
  align-self: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
  transition: 0.18s ease;
}
.play-line:hover { background: rgba(84, 224, 200, 0.2); }
.tip-body { color: #cfe7f5; font-size: 14px; }
.tip-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.record-status { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }
.record-status.is-recording { color: var(--danger); }
.record-status.is-recording::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 7px;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }
.playback { width: 100%; margin-top: 12px; }

/* 阅读 */
.read-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.read-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028));
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
}
.read-card:hover { transform: translateY(-4px); border-color: rgba(84, 224, 200, 0.4); }
.read-card h3 { margin: 10px 0 8px; font-size: 18.5px; line-height: 1.35; }
.read-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.badge {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 196, 255, 0.3);
  color: var(--accent-2);
  background: rgba(124, 196, 255, 0.08);
}
.read-meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 14px; }
.back-btn { margin-bottom: 16px; }
.article { padding: 30px clamp(20px, 4vw, 40px); }
.article-head h2 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 28px); }
.article-meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.read-timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--accent); }
.article-body { margin-top: 24px; font-size: 16.5px; line-height: 1.95; }
.article-body p { margin: 0 0 20px; }
.article-body .cn-trans {
  display: block;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid rgba(84, 224, 200, 0.35);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.v-word {
  border-bottom: 1.5px dashed rgba(124, 196, 255, 0.6);
  cursor: pointer;
  transition: 0.15s ease;
}
.v-word:hover { color: var(--accent); border-bottom-color: var(--accent); }
.article-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.word-pop {
  position: fixed;
  z-index: 50;
  max-width: 280px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(84, 224, 200, 0.4);
  background: #0b2b42;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 13.5px;
  pointer-events: none;
}
.word-pop strong { color: var(--accent); font-size: 15px; }
.word-pop .pop-kana { color: var(--muted); margin-left: 6px; font-size: 12.5px; }
.word-pop .pop-cn { color: var(--ink); margin-top: 3px; }

.quiz { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.quiz h3 { margin: 0 0 18px; font-size: 17px; }
.quiz-q { margin-bottom: 24px; }
.quiz-q .q-title { font-weight: 700; margin-bottom: 10px; font-size: 15px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.option {
  text-align: left;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 14.5px;
  cursor: pointer;
  transition: 0.16s ease;
}
.option:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }
.option.is-correct { border-color: var(--ok); background: rgba(89, 224, 160, 0.14); }
.option.is-wrong { border-color: var(--danger); background: rgba(255, 122, 138, 0.13); }
.option:disabled { cursor: default; }
.explain {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 2px solid rgba(84, 224, 200, 0.35);
}
.quiz-result {
  margin-top: 6px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(84, 224, 200, 0.35);
  background: rgba(84, 224, 200, 0.08);
  font-size: 14.5px;
}

/* 学习页 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  padding: 18px 20px;
}
.stat-value { font-size: clamp(24px, 2.1vw, 30px); font-weight: 800; color: var(--accent); line-height: 1.2; white-space: nowrap; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.study-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: 0.16s ease;
}
.task-item:hover { background: rgba(255, 255, 255, 0.07); }
.task-item.is-done { opacity: 0.62; }
.task-item.is-done .task-title { text-decoration: line-through; }
.task-check { font-size: 18px; line-height: 1.3; flex: none; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 600; }
.task-desc { color: var(--muted); font-size: 12.5px; }
.task-time {
  flex: none;
  font-size: 11.5px;
  color: var(--accent-2);
  border: 1px solid rgba(124, 196, 255, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.task-progress { color: var(--muted); font-size: 13px; margin: 16px 0 0; }

.timer-panel { display: flex; flex-direction: column; align-items: center; text-align: center; }
.timer-display {
  font-size: 54px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 6px 0 18px;
  color: var(--ink);
}
.timer-display.is-running { color: var(--accent); }
.timer-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.timer-hint { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }

.week-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 160px;
  padding: 10px 6px 0;
}
.week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.week-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.week-bar {
  width: min(100%, 42px);
  border-radius: 10px 10px 6px 6px;
  background: rgba(255, 255, 255, 0.1);
  transition: height 0.4s ease;
  min-height: 6px;
}
.week-bar.is-checked { background: linear-gradient(180deg, var(--accent), rgba(84, 224, 200, 0.35)); }
.week-day { font-size: 12px; color: var(--muted); }
.week-day.is-today { color: var(--accent); font-weight: 700; }

.plan-table-wrap { overflow-x: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.plan-table th, .plan-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.plan-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; }
.plan-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }

/* 补充：隐藏与表格小标题 */
.is-hidden { display: none !important; }
.read-library[hidden] { display: none; }
.tip-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.tip-list li { margin-bottom: 4px; }
.table-sub {
  margin: 22px 0 10px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.table-sub.first { margin-top: 0; }

/* 页脚 */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px clamp(14px, 3.4vw, 28px) 46px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: rgba(147, 180, 200, 0.7);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

/* 响应式 */
@media (max-width: 820px) {
  .speak-layout, .study-grid { grid-template-columns: 1fr; }
  .word-card { height: 330px; }
  .week-chart { height: 130px; }
  .main-nav { gap: 2px; }
  .nav-btn { padding: 8px 11px; font-size: 13px; }
  .brand-text small { display: none; }
}
@media (max-width: 520px) {
  .topbar {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .brand-penguin { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
  .brand-text strong { font-size: 15.5px; }
  .main-nav { width: 100%; justify-content: space-between; gap: 4px; }
  .nav-btn { flex: 1 1 0; justify-content: center; padding: 8px 4px; }
  .nav-btn span { display: none; }
  .page { padding-top: 22px; }
  .word-face { padding: 22px; }
  .word-card { height: 340px; }
  .progress-box { margin-left: 0; width: 100%; }
  .timer-display { font-size: 44px; }
  .view-head p { font-size: 13.5px; }
}

/* ================= 扩展模块：假名 / 语法 ================= */

.stat-value { font-size: 26px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h3 { margin: 0 0 4px; }
.panel-sub { margin: 0; color: var(--muted); font-size: 12.5px; }

.task-go {
  flex: none;
  align-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(84, 224, 200, 0.35);
  background: rgba(84, 224, 200, 0.1);
  color: var(--accent);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.15s ease;
}
.task-go:hover { background: rgba(84, 224, 200, 0.2); }

/* 假名 */
.kana-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.kana-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.kana-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  color: var(--ink);
  cursor: pointer;
  transition: 0.18s ease;
}
.kana-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }
.kana-card.is-selected {
  border-color: rgba(84, 224, 200, 0.65);
  box-shadow: 0 0 0 3px rgba(84, 224, 200, 0.12);
}
.kana-card.is-known { border-color: rgba(89, 224, 160, 0.42); }
.kana-symbol { font-size: 24px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.kana-type { font-size: 10.5px; color: var(--muted); }
.kana-example { font-size: 11px; color: rgba(147, 180, 200, 0.85); }
.kana-check { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--ok); }

.kana-detail { position: sticky; top: 84px; min-height: 280px; }
.empty-detail { color: var(--muted); font-size: 13px; text-align: center; padding: 48px 10px; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.detail-symbol { font-size: 34px; font-weight: 800; color: var(--accent); }
.detail-type { font-size: 13px; color: var(--ink); }
.detail-letters { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.detail-mouth { font-size: 13.5px; color: #cfe7f5; margin: 0 0 14px; }
.detail-words { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.word-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  font-size: 12.5px;
  transition: 0.15s ease;
}
.word-chip:hover { border-color: rgba(84, 224, 200, 0.4); background: rgba(255, 255, 255, 0.09); }
.word-en { font-weight: 700; color: var(--accent-2); }
.word-cn { font-size: 11px; color: var(--muted); }
.detail-tip { font-size: 12px; color: var(--warn); margin: 0 0 14px; }
.kana-detail .btn { width: 100%; }

.quiz-placeholder {
  color: var(--muted);
  font-size: 13.5px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
}
.quiz-progress { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.kana-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.question-word { font-size: 26px; font-weight: 800; }
.question-cn { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.kana-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.kana-option { text-align: center; font-size: 17px; padding: 12px; }
.kana-feedback { min-height: 22px; font-size: 13px; color: var(--muted); }
.kana-feedback.ok { color: var(--ok); }
.kana-feedback.bad { color: var(--danger); }
.quiz-actions { margin-top: 14px; }
.quiz-panel { margin-top: 18px; }

/* 语法 */
.grammar-list { display: flex; flex-direction: column; gap: 12px; }
.grammar-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  overflow: hidden;
  box-shadow: var(--shadow);
}
.grammar-card.is-open { border-color: rgba(84, 224, 200, 0.35); }
.grammar-card.is-done .grammar-title { color: var(--ok); }
.grammar-head {
  display: block;
  width: 100%;
  padding: 16px 18px;
  background: transparent;
  border: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: 0.15s ease;
}
.grammar-head:hover { background: rgba(255, 255, 255, 0.04); }
.grammar-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.grammar-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grammar-title { font-size: 16.5px; font-weight: 700; }
.done-tag {
  font-size: 11px;
  color: var(--ok);
  border: 1px solid rgba(89, 224, 160, 0.35);
  border-radius: 999px;
  padding: 1px 8px;
}
.grammar-arrow { margin-left: auto; color: var(--muted); font-size: 12px; }
.grammar-body { padding: 0 18px 20px; border-top: 1px solid var(--line); }
.grammar-body > p { margin: 14px 0 0; font-size: 14px; color: #d6ecfa; }
.grammar-examples { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.grammar-example {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid rgba(84, 224, 200, 0.4);
}
.ex-en { font-size: 14.5px; color: var(--ink); }
.ex-cn { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ex-note { font-size: 12px; color: var(--accent-2); margin-top: 4px; }
.grammar-tip { margin: 16px 0 0; font-size: 12.5px; color: var(--warn); }
.grammar-quiz { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.grammar-quiz h4 { margin: 0 0 12px; font-size: 14px; }
.grammar-result {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(84, 224, 200, 0.08);
  border: 1px solid rgba(84, 224, 200, 0.3);
  font-size: 13.5px;
}

@media (max-width: 820px) {
  .kana-layout { grid-template-columns: 1fr; }
  .kana-detail { position: static; }
  .kana-options { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  #bankSeg .seg-btn { padding: 6px 8px; font-size: 12px; }
  .task-time { display: none; }
  .grammar-head { padding: 14px; }
  .grammar-body { padding: 0 14px 16px; }
  .kana-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
}

/* 完整词库：长释义与缺省字段 */
.word-face.back { overflow-y: auto; }
.word-meaning { font-size: clamp(19px, 2.6vw, 26px); line-height: 1.45; max-width: 520px; }
.word-kana.is-empty { color: rgba(147, 180, 200, 0.6); font-style: italic; font-size: 14px; }
.word-example.is-empty { color: rgba(147, 180, 200, 0.65); font-size: 13.5px; }

/* 词卡背面单词与错题本 */
.word-back-word { font-size: 22px; font-weight: 800; color: var(--accent-2); margin-bottom: 4px; }
#readLevels { margin-top: -6px; }
.mistake-head { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; text-align: center; }
.mistake-list { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
.mistake-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.mistake-word { font-size: 26px; font-weight: 800; letter-spacing: 0.02em; }
.mistake-kana { color: var(--accent); font-size: 13.5px; margin-top: 2px; }
.mistake-meaning { color: var(--ink); font-size: 14px; margin-top: 6px; }
.mistake-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mistake-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}
.mistake-input:focus { border-color: rgba(84, 224, 200, 0.6); box-shadow: 0 0 0 3px rgba(84, 224, 200, 0.1); }
.mistake-feedback { min-height: 18px; font-size: 12.5px; margin-top: 6px; color: var(--muted); }
.mistake-feedback.ok { color: var(--ok); }
.mistake-feedback.bad { color: var(--danger); }

@media (max-width: 520px) {
  .mistake-item { padding: 14px; }
  .mistake-word { font-size: 22px; }
  .mistake-actions { flex-direction: column; align-items: stretch; }
  .mistake-actions .btn { width: 100%; }
}

/* ================= 日语适配 ================= */
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
}

.nav-kana {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* 词卡读音 */
.word-reading {
  margin-top: 12px;
  font-size: clamp(18px, 3vw, 23px);
  letter-spacing: 0.09em;
  color: var(--accent);
}
.word-romaji {
  margin-top: 1px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.word-back-reading {
  margin-bottom: 12px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.word-main,
.word-back-word,
.kana-symbol,
.kana-example,
.detail-symbol,
.word-jp,
.line-jp,
.line-kana,
.jp-text,
.para-kana,
.ex-jp,
.mistake-word,
.read-card h3,
.article-head h2 {
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", "Segoe UI", sans-serif;
}
.word-main { letter-spacing: 0.06em; }

/* 假名表 */
.kana-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.kana-card { min-height: 100px; padding: 12px 6px 10px; }
.kana-symbol {
  font-size: 34px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.15;
}
.kana-romaji {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent-2);
}
.kana-type { font-size: 10px; }
.kana-example { font-size: 10.5px; }
.detail-symbol {
  font-size: 54px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}
.word-jp { font-weight: 700; color: var(--accent-2); font-size: 15px; }
.kana-question .question-romaji {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.kana-option {
  font-size: 25px;
  padding: 10px;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
}
.kana-options { grid-template-columns: repeat(4, 1fr); }

/* 会话 */
.line-jp { font-size: 16px; color: var(--ink); letter-spacing: 0.02em; }
.line-kana {
  font-size: 12.5px;
  color: var(--accent-2);
  margin-top: 2px;
  line-height: 1.65;
  letter-spacing: 0.02em;
}
.line-cn { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* 语法例句 */
.ex-jp { font-size: 14.8px; color: var(--ink); line-height: 1.8; letter-spacing: 0.02em; }

/* 阅读 */
.read-title-cn { margin-top: -2px !important; color: var(--muted); font-size: 12.5px !important; }
.jp-text {
  display: block;
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.03em;
}
.para-kana {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.85;
  letter-spacing: 0.04em;
  color: rgba(147, 180, 200, 0.86);
}
.article-body .cn-trans { margin-top: 10px; }
.article-body { font-size: 16px; }
.reading-options { max-width: 470px; margin: 0 auto; }
.reading-options .option {
  text-align: center;
  font-size: 19px;
  letter-spacing: 0.08em;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
}
.spell-prompt.word-main { font-size: clamp(40px, 8vw, 60px); }

/* 错题本 */
.mistake-reading {
  color: var(--accent);
  font-size: 13.5px;
  margin-top: 3px;
  letter-spacing: 0.06em;
}
.mistake-bank { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

@media (max-width: 520px) {
  .kana-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .kana-card { min-height: 98px; }
  .kana-symbol { font-size: 30px; }
  .jp-text { font-size: 16.5px; line-height: 1.95; }
  .kana-option { font-size: 22px; }
  .word-main { font-size: clamp(34px, 10vw, 46px); }
}


/* 假名按行分组 */
.kana-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 -2px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.1em;
}
.kana-row-head:first-child { margin-top: 0; }
.kana-row-head span {
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* 会话角色 */
.line-role {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--accent-2);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.kana-grid.is-yoon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-title-cn { margin: 0 0 12px; color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }

@media (max-width: 820px) {
  .kana-detail { order: -1; width: 100%; }
}

/* ================= 升级版：N2 词库 / 五十音工具 / 完形 / 精读笔记 ================= */

/* 标题装饰 */
.view-head h1 { position: relative; padding-left: 14px; }
.view-head h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.16em;
  bottom: 0.16em;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(84, 224, 200, 0.45);
}

/* 长词卡 */
.word-main.is-long { font-size: clamp(26px, 5vw, 40px); letter-spacing: 0.04em; line-height: 1.25; }

/* 今日一句 */
.daily-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 18px 22px;
  border: 1px solid rgba(84, 224, 200, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(84, 224, 200, 0.15), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  box-shadow: 0 16px 44px rgba(0, 10, 20, 0.24);
  overflow: hidden;
}
.daily-strip::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(124, 196, 255, 0.14);
  box-shadow: 0 0 0 26px rgba(124, 196, 255, 0.035), 0 0 0 56px rgba(124, 196, 255, 0.02);
  pointer-events: none;
}
.daily-label {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}
.daily-quote strong {
  display: block;
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 21px;
  letter-spacing: 0.05em;
  line-height: 1.5;
}
.daily-quote em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-style: normal;
}
.daily-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  position: relative;
  z-index: 1;
}
.daily-meter-label { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.daily-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.daily-bar-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}
.daily-meter small { color: var(--accent); font-size: 11.5px; white-space: nowrap; }

/* 统计：七张卡 */
@media (min-width: 821px) {
  .stats { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .stat-card { padding: 16px 14px; }
  .stat-value { font-size: clamp(20px, 1.9vw, 26px); }
}

/* 五十音学习工具 */
.kana-tools { margin-top: 18px; }
.kana-tools .panel-head { align-items: center; }
.trace-layout,
.dictation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
}
.trace-kicker,
.dictation-kicker {
  color: var(--accent-2);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}
.trace-head { display: flex; align-items: center; gap: 16px; margin: 10px 0 16px; }
.trace-big {
  color: var(--accent);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
}
.trace-head strong { color: var(--ink); font-size: 22px; letter-spacing: 0.08em; }
.trace-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.trace-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.trace-picker select {
  min-width: 190px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.trace-picker select:focus { border-color: rgba(84, 224, 200, 0.55); }
.trace-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.trace-tip { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.trace-canvas-wrap { display: flex; justify-content: center; }
#traceCanvas {
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 34%, rgba(84, 224, 200, 0.07), transparent 62%),
    rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: crosshair;
}
.dictation-info h3 { margin: 10px 0 8px; font-size: 22px; }
.dictation-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.8; max-width: 480px; }
.dictation-stats { color: var(--muted); font-size: 13px; }
.dictation-stats strong { color: var(--accent); font-size: 18px; }
.dictation-stats span { color: var(--accent-2); }
.dictation-play { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.dictation-play .spell-input { width: 100%; }
.dictation-play .btn { width: 100%; }
#dictationFeedback { margin-top: 0; }

/* 语法详解 */
.grammar-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 196, 255, 0.18);
  background: rgba(124, 196, 255, 0.07);
}
.grammar-form-label {
  color: var(--accent-2);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}
.grammar-form code { color: var(--ink); font-family: inherit; font-size: 13px; }
.grammar-compare,
.grammar-mistakes {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.grammar-compare h4,
.grammar-mistakes h4 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.compare-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}
.compare-a { color: var(--accent-2); }
.compare-b { color: var(--warn); }
.compare-vs {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}
.compare-explain { margin: 4px 0 10px; color: var(--muted); font-size: 12.5px; }
.mistake-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(140, 210, 255, 0.1);
}
.mistake-pair:last-child { border-bottom: 0; }
.mistake-wrong { color: var(--danger); font-size: 13.5px; }
.mistake-right { color: var(--ok); font-size: 13.5px; }
.mistake-pair p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }

/* 精读笔记 */
.article-notes {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid rgba(124, 196, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(124, 196, 255, 0.07), rgba(255, 255, 255, 0.02));
}
.notes-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.notes-kicker { color: var(--accent-2); font-size: 10.5px; letter-spacing: 0.16em; }
.notes-head h3 { margin: 0; font-size: 16px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px; }
.note-item {
  padding: 12px 14px;
  border-radius: 12px;
  border-left: 3px solid rgba(84, 224, 200, 0.45);
  background: rgba(0, 0, 0, 0.16);
}
.note-pattern { color: var(--accent); font-size: 14px; font-weight: 700; }
.note-explain { margin: 4px 0; color: var(--muted); font-size: 12.5px; }
.note-example {
  color: #cfe7f5;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 12.5px;
}
.culture-note { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.culture-label { display: inline-block; margin-bottom: 4px; color: var(--warn); font-size: 10.5px; letter-spacing: 0.12em; }
.culture-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* 完形 */
.cloze-passage {
  margin: 24px 0 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 18px;
  line-height: 2.15;
  letter-spacing: 0.03em;
}
.cloze-passage p { margin: 0; }
.cloze-blank {
  display: inline-block;
  min-width: 3.6em;
  margin: 0 2px;
  padding: 0 4px;
  border-bottom: 2px solid rgba(124, 196, 255, 0.55);
  color: var(--accent-2);
  font-weight: 700;
  text-align: center;
}
.cloze-blank.is-filled { color: var(--ok); border-bottom-color: rgba(89, 224, 160, 0.55); }
.cloze-translation {
  margin-top: 10px;
  padding: 16px 18px;
  border-left: 3px solid rgba(84, 224, 200, 0.4);
  border-radius: 0 12px 12px 0;
  background: rgba(84, 224, 200, 0.05);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.cloze-questions { margin-top: 24px; }
.cloze-questions h3 { margin: 0 0 14px; font-size: 17px; }
.cloze-q { padding: 16px 0; border-top: 1px solid var(--line); }
.cloze-q .q-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cloze-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(84, 224, 200, 0.4);
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
}
.cloze-card:hover { border-color: rgba(255, 196, 107, 0.4); }

/* 等级徽章 */
.badge.level-N5 { color: #8fe3b0; border-color: rgba(89, 224, 160, 0.35); background: rgba(89, 224, 160, 0.08); }
.badge.level-N4 { color: #7cc4ff; border-color: rgba(124, 196, 255, 0.35); background: rgba(124, 196, 255, 0.08); }
.badge.level-N3 { color: #ffc46b; border-color: rgba(255, 196, 107, 0.35); background: rgba(255, 196, 107, 0.08); }
.badge.level-N2 { color: #ff9fb0; border-color: rgba(255, 159, 176, 0.35); background: rgba(255, 159, 176, 0.08); }

/* 七项导航在中等宽度下收紧 */
@media (max-width: 1120px) {
  .nav-btn { padding: 8px 12px; font-size: 14px; }
}

@media (max-width: 820px) {
  .trace-layout, .dictation-layout { grid-template-columns: 1fr; }
  .trace-canvas-wrap { order: -1; }
  .trace-info { order: 1; }
  .dictation-play { max-width: none; }
  .daily-meter { min-width: 0; width: 100%; }
}

@media (max-width: 520px) {
  .daily-strip { padding: 14px; gap: 12px; }
  .daily-quote strong { font-size: 18px; }
  .daily-meter { flex-wrap: wrap; }
  .daily-meter small { margin-left: auto; }
  .mistake-pair { grid-template-columns: 1fr; }
  .cloze-passage { padding: 16px; font-size: 16.5px; line-height: 2.05; }
  .notes-grid { grid-template-columns: 1fr; }
  .trace-big { font-size: 50px; }
  .trace-head strong { font-size: 19px; }
  .view-head h1 { padding-left: 12px; }
}

.kana-jump { margin-top: -8px; margin-bottom: 16px; }
.kana-jump .chip { padding: 7px 14px; font-size: 13px; }

@media (max-width: 520px) {
  .main-nav { gap: 2px; }
  .nav-btn { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 8px 0; font-size: 12.5px; }
}

#kanaChart, #kanaQuizPanel, #kanaToolsPanel { scroll-margin-top: 84px; }
#kanaToolSeg .seg-btn.is-active { background: rgba(84, 224, 200, 0.2); color: var(--accent); }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .main-nav { width: 100%; justify-content: space-between; gap: 2px; }
  .nav-btn { flex: 1 1 0; justify-content: center; padding: 8px 4px; }
  .nav-btn span { display: none; }
}


/* ================= 发音播报 ================= */
.narration-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(760px, calc(100vw - 28px));
  padding: 12px 16px;
  border: 1px solid rgba(84, 224, 200, 0.42);
  border-radius: 18px;
  background: rgba(8, 35, 56, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.narration-dock[hidden] { display: none; }
.dock-mark { font-size: 22px; flex: none; }
.dock-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.dock-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-rate { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.dock-rate select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 12px;
}
.article-body p.is-narrating {
  background: rgba(84, 224, 200, 0.08);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 rgba(84, 224, 200, 0.55);
}
.cloze-passage.is-narrating {
  border-color: rgba(84, 224, 200, 0.55);
  box-shadow: 0 0 0 3px rgba(84, 224, 200, 0.08);
}
.ex-jp { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.ex-play {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
}
.ex-play:hover { background: rgba(84, 224, 200, 0.16); }
@media (max-width: 640px) {
  .narration-dock { bottom: 10px; padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .dock-text { flex: 1 1 100%; order: -1; }
  .narration-dock .btn { flex: 1; }
  .dock-rate { margin-left: auto; }
}

.dialog-line.is-narrating { border-color: rgba(84, 224, 200, 0.5); background: rgba(84, 224, 200, 0.1); }

/* ================= 测试 / 模拟考试 ================= */
.exam-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  background:
    radial-gradient(700px 220px at 8% 0%, rgba(84, 224, 200, 0.16), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028));
}
.exam-kicker {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.exam-hero h3 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); letter-spacing: 0.02em; }
.exam-hero p { margin: 0; color: var(--muted); font-size: 14px; max-width: 720px; }
.exam-hero-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 8px;
}
.exam-hero-rules span {
  min-width: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.exam-hero-rules b { color: var(--accent); font-size: 23px; line-height: 1; }

.exam-player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
}
.exam-player-bar label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.exam-player-bar input {
  width: 180px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(3, 18, 30, 0.55);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.exam-player-bar input:focus { border-color: rgba(84, 224, 200, 0.55); box-shadow: 0 0 0 3px rgba(84, 224, 200, 0.1); }
.exam-player-bar #examPlayerHint { color: var(--muted); font-size: 12px; flex: 1; min-width: 180px; }
.exam-player-bar .btn { margin-left: auto; }

.exam-active {
  margin-bottom: 18px;
  border-color: rgba(84, 224, 200, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.exam-active strong { display: block; font-size: 16px; }
.exam-active small { color: var(--muted); }
.exam-active-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.exam-paper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.exam-paper-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.exam-paper-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -54px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(84, 224, 200, 0.15), transparent 68%);
  pointer-events: none;
}
.exam-paper-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.exam-paper-card h3 { margin: 0; font-size: 20px; }
.exam-paper-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.exam-paper-level {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(84, 224, 200, 0.35);
  background: rgba(84, 224, 200, 0.1);
  color: var(--accent);
  font-size: 11.5px;
  white-space: nowrap;
}
.exam-paper-sections { display: grid; gap: 6px; color: var(--muted); font-size: 12.5px; }
.exam-paper-sections span { display: flex; justify-content: space-between; gap: 8px; }
.exam-paper-sections b { color: var(--ink); font-weight: 600; }
.exam-paper-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.exam-paper-meta .exam-best { color: var(--ok); }
.exam-paper-actions { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.exam-paper-actions .btn { flex: 1; }
.exam-paper-card.is-done { border-color: rgba(89, 224, 160, 0.3); }

.exam-board { margin-top: 18px; }
.exam-board .panel-head { align-items: center; gap: 12px; }
.exam-rank-filter {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b2b42;
  color: var(--ink);
  font-size: 13px;
}
.exam-leaderboard { display: grid; gap: 4px; }
.exam-rank-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1.4fr) minmax(80px, 0.6fr) minmax(100px, 0.8fr) minmax(95px, 0.7fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
}
.exam-rank-row:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.exam-rank-row.is-header { color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; background: transparent; }
.exam-rank-row.is-me { border: 1px solid rgba(84, 224, 200, 0.4); background: rgba(84, 224, 200, 0.08); color: var(--ink); }
.exam-rank-no { font-weight: 800; color: var(--accent); }
.exam-rank-row.is-header .exam-rank-no { font-weight: 500; color: var(--muted); }
.exam-rank-name { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-rank-score { color: var(--accent); font-weight: 800; font-size: 16px; }
.exam-rank-score small { color: var(--muted); font-size: 11px; font-weight: 500; }
.exam-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; }

.exam-topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(18px);
  background: rgba(6, 24, 38, 0.88);
}
.exam-topbar .btn { flex: 0 0 auto; }
.exam-top-title { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.exam-top-title strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-top-title small { color: var(--muted); font-size: 11.5px; }
.exam-clock {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.exam-clock.is-warning { color: var(--danger); animation: examPulse 1.1s ease-in-out infinite; }
@keyframes examPulse { 50% { opacity: 0.48; } }
.exam-section-nav {
  position: sticky;
  top: 82px;
  z-index: 35;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
  margin-bottom: 6px;
  background: linear-gradient(180deg, rgba(6, 24, 38, 0.96), rgba(6, 24, 38, 0.76) 70%, transparent);
  backdrop-filter: blur(12px);
}
.exam-section-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
}
.exam-section-nav a:hover { color: var(--ink); border-color: rgba(84, 224, 200, 0.35); }
.exam-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px 0 12px;
}
.exam-section-title h3 { margin: 0; font-size: 20px; }
.exam-section-title span { color: var(--muted); font-size: 12.5px; }
.exam-question {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.038);
  margin-bottom: 12px;
  scroll-margin-top: 160px;
}
.exam-q-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.exam-q-num {
  flex: 0 0 auto;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(84, 224, 200, 0.13);
  border: 1px solid rgba(84, 224, 200, 0.3);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
}
.exam-q-main { flex: 1; min-width: 0; }
.exam-q-label { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; margin-bottom: 3px; }
.exam-q-text { font-size: 15px; font-weight: 650; line-height: 1.75; }
.exam-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.exam-option {
  text-align: left;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
  transition: 0.16s ease;
}
.exam-option:hover { background: rgba(255, 255, 255, 0.075); border-color: rgba(140, 210, 255, 0.3); }
.exam-option.is-selected { border-color: rgba(84, 224, 200, 0.7); background: rgba(84, 224, 200, 0.13); box-shadow: 0 0 0 2px rgba(84, 224, 200, 0.08); }
.exam-option.is-correct { border-color: var(--ok); background: rgba(89, 224, 160, 0.14); }
.exam-option.is-wrong { border-color: var(--danger); background: rgba(255, 122, 138, 0.12); }
.exam-audio-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.exam-audio-btn {
  border: 1px solid rgba(84, 224, 200, 0.35);
  background: rgba(84, 224, 200, 0.1);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  cursor: pointer;
}
.exam-audio-btn:hover { background: rgba(84, 224, 200, 0.18); }
.exam-audio-note { color: var(--muted); font-size: 11.5px; }
.exam-passage {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(140, 210, 255, 0.16);
  background: rgba(3, 18, 30, 0.35);
  margin: 12px 0;
  scroll-margin-top: 160px;
}
.exam-passage-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.exam-passage-head h4 { margin: 0; font-size: 16px; }
.exam-passage p { margin: 0 0 8px; line-height: 2; font-size: 14.5px; color: #dceef7; }
.exam-passage details { margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.exam-passage summary { cursor: pointer; color: var(--accent-2); }
.exam-question.is-correct { border-color: rgba(89, 224, 160, 0.35); }
.exam-question.is-wrong { border-color: rgba(255, 122, 138, 0.35); }
.exam-explain { margin-top: 10px; padding-left: 12px; border-left: 2px solid rgba(84, 224, 200, 0.3); color: var(--muted); font-size: 12.5px; }
.exam-transcript { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 12.5px; }

.exam-result-hero {
  padding: 26px;
  margin-bottom: 16px;
  background:
    radial-gradient(700px 320px at 8% 0%, rgba(84, 224, 200, 0.18), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}
.exam-result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.exam-result-top h2 { margin: 2px 0 4px; font-size: 24px; }
.exam-result-top p { margin: 0; color: var(--muted); font-size: 13px; }
.exam-score-box { text-align: right; }
.exam-score-value { display: block; font-size: clamp(46px, 8vw, 72px); font-weight: 900; line-height: 1; color: var(--accent); letter-spacing: -0.03em; }
.exam-score-value small { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.exam-score-note { color: var(--muted); font-size: 12px; }
.exam-result-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 12.5px; }
.exam-result-meta span { padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.exam-section-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.exam-section-result { padding: 12px 14px; border-radius: 13px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.exam-section-result-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.exam-section-result strong { display: block; margin-top: 4px; font-size: 22px; color: var(--ink); }
.exam-section-result .bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); margin-top: 8px; overflow: hidden; }
.exam-section-result .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.exam-result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.exam-review { margin-top: 18px; }
.exam-review > .panel-head { margin-bottom: 12px; }
.exam-review-section { margin-bottom: 14px; }
.exam-review-section h4 { margin: 16px 0 8px; font-size: 15px; }
.exam-review-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 7px; background: rgba(255, 255, 255, 0.03); }
.exam-review-item summary { cursor: pointer; padding: 10px 13px; font-size: 13px; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.exam-review-item summary .tag { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.exam-review-item.is-ok summary .tag { color: var(--ok); border-color: rgba(89, 224, 160, 0.4); }
.exam-review-item.is-bad summary .tag { color: var(--danger); border-color: rgba(255, 122, 138, 0.4); }
.exam-review-body { padding: 0 13px 12px; color: var(--muted); font-size: 12.5px; }
.exam-review-body .exam-review-q { color: var(--ink); font-size: 13.5px; margin-bottom: 7px; }
.exam-review-body .exam-review-answers { display: flex; gap: 14px; flex-wrap: wrap; }
.exam-review-body .exam-review-answers b { color: var(--ink); }
.exam-review-body .exam-review-answers .right { color: var(--ok); }
.exam-review-body .exam-review-answers .wrong { color: var(--danger); }
.exam-review-body .exam-transcript { color: var(--muted); }
.exam-result-board { margin-top: 18px; }

/* 八项导航在中等宽度下收紧 */
@media (max-width: 1180px) {
  .nav-btn { padding: 8px 11px; font-size: 13.5px; }
  .main-nav { gap: 4px; }
}
@media (max-width: 940px) {
  .exam-paper-grid { grid-template-columns: 1fr; }
  .exam-paper-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; }
  .exam-paper-card .exam-paper-sections { grid-column: 1; }
  .exam-paper-card .exam-paper-actions { grid-column: 1 / -1; }
  .exam-paper-card .exam-paper-meta { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .exam-hero { grid-template-columns: 1fr; }
  .exam-hero-rules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .exam-hero-rules span { min-width: 0; justify-content: center; padding: 8px 6px; }
  .exam-hero-rules b { font-size: 19px; }
  .exam-player-bar .btn { margin-left: 0; }
  .exam-topbar { position: sticky; top: 6px; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .exam-topbar .btn.btn-ghost { order: 3; padding: 6px 10px; font-size: 12px; }
  .exam-top-title { order: 1; flex: 1 1 100%; }
  .exam-clock { order: 2; margin-left: auto; font-size: 18px; }
  .exam-topbar #examSubmit { order: 2; }
  .exam-section-nav { top: 132px; overflow-x: auto; flex-wrap: nowrap; padding: 8px 0; }
  .exam-section-nav a { white-space: nowrap; }
  .exam-options { grid-template-columns: 1fr; }
  .exam-result-top { flex-direction: column; }
  .exam-score-box { text-align: left; }
  .exam-section-results { grid-template-columns: 1fr; }
  .exam-rank-row { grid-template-columns: 34px minmax(0, 1.2fr) minmax(60px, 0.6fr) minmax(80px, 0.7fr); font-size: 12px; }
  .exam-rank-row > :nth-child(4) { display: none; }
  .exam-rank-row.is-header > :nth-child(4) { display: none; }
}
@media (max-width: 520px) {
  .exam-paper-card { grid-template-columns: 1fr; }
  .exam-paper-card .exam-paper-actions, .exam-paper-card .exam-paper-meta { grid-column: 1; }
  .exam-paper-card .exam-paper-level { align-self: flex-start; }
  .exam-result-hero { padding: 20px; }
  .exam-score-value { font-size: 52px; }
  .exam-section-title h3 { font-size: 18px; }
  .exam-question { padding: 14px; }
  .exam-q-text { font-size: 14px; }
  .exam-option { font-size: 13.5px; }
  .exam-board .panel-head { align-items: flex-start; flex-direction: column; }
  .exam-rank-row { gap: 6px; padding: 8px 6px; }
  .exam-rank-name { font-size: 12px; }
  .exam-rank-score { font-size: 14px; }
}

/* ================= 语法点 / 助词专题 ================= */
.grammar-toolbar { align-items: flex-start; }
.grammar-toolbar .seg { flex: 0 0 auto; }
.grammar-toolbar #grammarLevels { flex: 1 1 420px; }
.particle-card .grammar-title-row { gap: 9px; }
.particle-reading {
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 196, 255, 0.09);
  border: 1px solid rgba(124, 196, 255, 0.25);
}
.particle-usages { display: grid; gap: 10px; margin-top: 10px; }
.particle-usage {
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}
.particle-usage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.particle-usage-head strong { font-size: 14px; color: var(--ink); }
.usage-index {
  width: 21px;
  height: 21px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(84, 224, 200, 0.12);
  border: 1px solid rgba(84, 224, 200, 0.28);
}
.usage-explain { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.particle-usage .ex-jp { margin-top: 2px; }
.particle-usage .ex-cn { margin-top: 1px; }
@media (max-width: 760px) {
  .grammar-toolbar { flex-direction: column; }
  .grammar-toolbar .seg { width: 100%; overflow-x: auto; }
  .grammar-toolbar #grammarLevels { width: 100%; flex: 1 1 auto; }
}

.exam-active[hidden] { display: none !important; }


@media (max-width: 520px) {
  .exam-hero-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-hero-rules span { justify-content: flex-start; }
}

/* ================= 账号 / 所有者 ================= */
.topbar { position: relative; }
.account-chip {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.account-chip:hover { color: var(--ink); border-color: rgba(84, 224, 200, 0.35); }
.account-chip.is-user { color: var(--accent); border-color: rgba(84, 224, 200, 0.4); background: rgba(84, 224, 200, 0.08); }

.exam-account { margin-bottom: 18px; }
.auth-loading, .auth-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.auth-local strong { display: block; color: var(--ink); margin-bottom: 4px; }
.auth-local p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-local code { color: var(--accent-2); }
.auth-head { margin-bottom: 12px; }
.auth-head h3 { margin: 0 0 3px; font-size: 18px; }
.auth-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.auth-tab.is-active { border-color: rgba(84, 224, 200, 0.55); background: rgba(84, 224, 200, 0.12); color: var(--accent); }
.auth-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 680px; }
.auth-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.auth-form input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(3, 18, 30, 0.55);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
}
.auth-form input:focus { border-color: rgba(84, 224, 200, 0.55); box-shadow: 0 0 0 3px rgba(84, 224, 200, 0.1); }
.auth-form .btn { justify-self: start; align-self: end; }
.auth-form .auth-check { display: flex; align-items: center; gap: 7px; grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.auth-form .auth-check input { width: auto; }
.auth-form .auth-status { grid-column: 1 / -1; margin: 0; font-size: 12.5px; }
.auth-status.is-ok { color: var(--ok); }
.auth-status.is-bad { color: var(--danger); }
.auth-terms { grid-column: 1 / -1; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.auth-terms summary { cursor: pointer; color: var(--accent-2); }
.auth-terms p { margin: 6px 0; }
.auth-signed { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.auth-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.auth-avatar { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(84, 224, 200, 0.12); border: 1px solid rgba(84, 224, 200, 0.3); }
.auth-user strong { display: block; font-size: 15px; }
.auth-user small { display: block; color: var(--muted); font-size: 11.5px; }
.owner-badge { padding: 3px 8px; border-radius: 999px; background: rgba(255, 196, 107, 0.13); border: 1px solid rgba(255, 196, 107, 0.35); color: var(--warn); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.owner-console { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 12.5px; }
.owner-console summary { cursor: pointer; color: var(--warn); }
.owner-console-body { margin-top: 8px; }
.owner-console-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.owner-danger { color: var(--danger); border-color: rgba(255, 122, 138, 0.3); }
.owner-danger.is-armed { background: rgba(255, 122, 138, 0.12); }
.owner-user-list { display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.owner-user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.035); align-items: center; }
.owner-user-row span:first-child { color: var(--ink); }
.owner-user-row code { color: var(--accent-2); font-size: 11px; }

.exam-player-bar[hidden] { display: none !important; }

@media (max-width: 700px) {
  .account-chip { order: 1; margin-left: auto; padding: 7px 10px; font-size: 11.5px; }
  .main-nav { order: 2; }
  .auth-form { grid-template-columns: 1fr; }
  .auth-form .btn { justify-self: stretch; }
  .auth-tabs { flex-wrap: wrap; }
}

/* 清音 / 浊音 / 半浊音 对照大表 */
.kana-grid.is-pair { display: block; }
.kana-pair-head { margin-bottom: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.kana-pair-head h3 { margin: 0 0 3px; font-size: 17px; }
.kana-pair-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.kana-script-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}
.kana-script-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 0.16s ease;
}
.kana-script-btn:hover { color: var(--ink); }
.kana-script-btn.is-active { background: rgba(84, 224, 200, 0.16); color: var(--accent); }
.kana-pair-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}
.kana-pair-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}
.kana-pair-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 8px;
  background: #0b273b;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.kana-pair-table th.kana-row-name {
  width: 68px;
  padding: 12px 7px 5px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid rgba(140, 210, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  vertical-align: top;
}
.kana-pair-table td {
  padding: 3px;
  border-right: 1px solid rgba(140, 210, 255, 0.07);
  border-bottom: 1px solid rgba(140, 210, 255, 0.07);
  vertical-align: middle;
}
.kana-pair-table td:last-child { border-right: 0; }
.kana-pair-empty { text-align: center; color: rgba(147, 180, 200, 0.32); font-size: 12px; }
.kana-cell {
  position: relative;
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 2px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.kana-cell:hover { background: rgba(84, 224, 200, 0.08); border-color: rgba(84, 224, 200, 0.25); }
.kana-cell.is-selected { border-color: rgba(84, 224, 200, 0.65); background: rgba(84, 224, 200, 0.11); }
.kana-cell.is-known { border-color: rgba(89, 224, 160, 0.32); }
.kana-cell-symbol { grid-row: 1 / 3; font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.kana-cell-romaji { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.kana-cell-word { color: rgba(147, 180, 200, 0.8); font-size: 10px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kana-cell-check { position: absolute; top: 4px; right: 5px; color: var(--ok); font-size: 10px; }
.kana-pair-note { margin: 9px 2px 0; color: var(--muted); font-size: 11.5px; }
@media (max-width: 820px) {
  .kana-pair-table { min-width: 520px; }
}

/* 词性筛选 */
.vocab-type-toolbar { margin-top: -8px; margin-bottom: 14px; align-items: center; }
.vocab-type-toolbar .seg { flex-wrap: wrap; }
.vocab-type-toolbar .seg-btn { padding: 7px 12px; font-size: 12.5px; }
.vocab-type-hint { color: var(--muted); font-size: 12px; margin-left: auto; }
@media (max-width: 700px) {
  .vocab-type-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .vocab-type-toolbar .seg { width: 100%; }
  .vocab-type-hint { margin-left: 0; }
}

