/* ============================================================
   字词星球 · 设计系统
   ============================================================ */
:root {
  --paper: #f4efe3;
  --paper-deep: #e9dfcc;
  --card: #fffdf7;
  --ink: #17233b;
  --ink-soft: #47536b;
  --muted: #7a8194;
  --line: #d8cdb9;
  --line-soft: #ece3d3;
  --orange: #ff6b35;
  --orange-deep: #e34e1b;
  --yellow: #ffd166;
  --yellow-soft: #fff5d6;
  --green: #1f9d68;
  --green-soft: #e7f7ee;
  --red: #d9382a;
  --red-soft: #fff0ee;
  --blue: #315c9b;
  --blue-soft: #eaf0fb;
  --purple: #6c4bb6;
  --shadow: 6px 6px 0 rgba(23, 35, 59, .12);
  --shadow-small: 3px 3px 0 rgba(23, 35, 59, .16);
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 209, 102, .38), transparent 28rem),
    radial-gradient(circle at 96% 18%, rgba(255, 107, 53, .13), transparent 24rem),
    radial-gradient(circle at 40% 100%, rgba(49, 92, 155, .10), transparent 30rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
::selection { background: var(--yellow); color: var(--ink); }

.page-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .32;
  background-image: radial-gradient(rgba(23, 35, 59, .20) .8px, transparent .8px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}
#app { position: relative; z-index: 1; }

/* ------------------------------------------------------------
   基础组件
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 24px;
  transition: background .2s ease, box-shadow .2s ease, padding .2s ease;
}
.site-header.is-scrolled {
  padding: 12px 24px;
  background: rgba(244, 239, 227, .90);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line-soft);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  flex: none;
}
.logo-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--orange);
  color: #fff8ea;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  box-shadow: var(--shadow-small);
  transform: rotate(-3deg);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-size: 19px; letter-spacing: .04em; }
.logo-text small { color: var(--muted); font-size: 11px; letter-spacing: .12em; margin-top: 3px; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav-btn {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-btn:hover { background: rgba(23, 35, 59, .06); color: var(--ink); }
.nav-btn.is-active { background: var(--ink); color: var(--paper); }

.header-spacer { flex: 1; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--line);
  background: rgba(255, 253, 247, .72);
  border-radius: 999px;
  padding: 5px 6px 5px 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}
.user-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow-soft);
  font-size: 19px;
}
.user-chip .logout-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.user-chip .logout-btn:hover { background: var(--red-soft); color: var(--red); }

.view {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 24px 56px;
  outline: none;
}
.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 24px 28px;
}
.footer-dot { opacity: .5; }

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.card-soft {
  background: rgba(255, 253, 247, .78);
  border: 1.5px solid var(--line);
  border-radius: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-small);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  user-select: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(23, 35, 59, .18); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(23, 35, 59, .18); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-small); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: #ff7b4b; }
.btn-dark { background: var(--ink); color: #fff8ea; }
.btn-dark:hover { background: #263451; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn-ghost:hover { background: rgba(23, 35, 59, .05); box-shadow: none; }
.btn-lg { min-height: 56px; padding: 14px 24px; border-radius: 18px; font-size: 17px; }
.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 11px; font-size: 13px; box-shadow: none; }
.btn-block { width: 100%; }
.btn .arrow { font-size: 20px; line-height: 1; transform: translateY(-1px); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #7c5a00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-ink { background: var(--ink); color: #fff; }
.chip-soft { background: #f3ede0; color: var(--ink-soft); }

.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--orange-deep);
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--orange); border-radius: 2px; }
.hidden, [hidden] { display: none !important; }

.loading-panel {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 38px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rules-list { display: grid; gap: 9px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.rules-list b { color: var(--orange-deep); margin-right: 5px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   登录 / 注册
   ------------------------------------------------------------ */
.auth-layout {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: 1.05fr .9fr;
  gap: 54px;
  align-items: center;
  padding: 24px 0 40px;
}
.auth-hero { position: relative; }
.auth-hero h1 {
  margin: 16px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.8vw, 72px);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 800;
}
.auth-hero h1 .accent {
  position: relative;
  white-space: nowrap;
  color: var(--orange-deep);
}
.auth-hero h1 .accent::after {
  content: "";
  position: absolute;
  left: 2%; right: 0;
  bottom: 3px;
  height: 11px;
  background: var(--yellow);
  border-radius: 50%;
  z-index: -1;
  transform: rotate(-1.5deg);
}
.auth-hero p.lead {
  max-width: 520px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.8;
}
.feature-list {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
.feature-icon {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--yellow);
  font-size: 15px;
  box-shadow: 2px 2px 0 rgba(23, 35, 59, .12);
}
.auth-card { padding: 30px; }
.auth-card h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.auth-card .sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #f0eadf;
  border-radius: 13px;
  margin-bottom: 22px;
}
.auth-tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(23, 35, 59, .10); }
.form-grid { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 800; color: var(--ink-soft); letter-spacing: .04em; }
.field input {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fffcf5;
  padding: 10px 13px;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 209, 102, .45); }
.field .hint { color: var(--muted); font-size: 11px; line-height: 1.5; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 54px; }
.password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 7px;
  cursor: pointer;
  border-radius: 8px;
}
.password-toggle:hover { background: rgba(23, 35, 59, .06); color: var(--ink); }
.error-banner {
  display: none;
  padding: 11px 13px;
  border: 1.5px solid #f1b8b1;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  line-height: 1.55;
}
.error-banner.is-visible { display: block; animation: shake .35s ease; }
.auth-submit { margin-top: 4px; }
.auth-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}
.auth-note .panel-link { padding: 0; font-size: inherit; vertical-align: baseline; }
.auth-art {
  position: relative;
  min-height: 300px;
  margin-top: 28px;
  pointer-events: none;
}
.auth-art-card {
  position: absolute;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 12px 16px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(23, 35, 59, .14);
  font-size: 21px;
  font-weight: 700;
  animation: floaty 5s ease-in-out infinite;
}
.auth-art-card small { color: var(--muted); font-size: 12px; font-weight: 700; }
.auth-art-card:nth-child(1) { left: 2%; top: 8%; transform: rotate(-5deg); }
.auth-art-card:nth-child(2) { right: 1%; top: 0; transform: rotate(4deg); animation-delay: -1.2s; }
.auth-art-card:nth-child(3) { left: 14%; bottom: 4%; transform: rotate(3deg); animation-delay: -2.1s; }
.auth-art-card:nth-child(4) { right: 8%; bottom: 15%; transform: rotate(-4deg); animation-delay: -.7s; }

/* ------------------------------------------------------------
   首页
   ------------------------------------------------------------ */
.home-hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 20px;
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 209, 102, .58), transparent 17rem),
    linear-gradient(135deg, #fffdf7 0%, #fff8e9 100%);
  position: relative;
}
.home-hero::after {
  content: "字";
  position: absolute;
  right: 30%;
  bottom: -64px;
  font-family: var(--font-display);
  font-size: 210px;
  line-height: 1;
  color: rgba(23, 35, 59, .035);
  pointer-events: none;
}
.hero-copy { padding: 36px 16px 34px 36px; position: relative; z-index: 1; }
.hero-copy h1 {
  margin: 12px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 800;
}
.hero-copy h1 em {
  font-style: normal;
  color: var(--orange-deep);
  position: relative;
  white-space: nowrap;
}
.hero-copy h1 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 9px;
  background: var(--yellow);
  z-index: -1;
  border-radius: 50%;
  transform: rotate(-1deg);
}
.hero-copy p {
  max-width: 540px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta b { color: var(--ink-soft); }
.hero-art { position: relative; min-height: 340px; }
.float-word {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(23, 35, 59, .14);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  animation: floaty 5.5s ease-in-out infinite;
}
.float-word small { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .08em; }
.float-word:nth-child(1) { left: 14%; top: 11%; transform: rotate(-6deg); }
.float-word:nth-child(2) { right: 8%; top: 3%; transform: rotate(5deg); animation-delay: -1.6s; background: #fff4d2; }
.float-word:nth-child(3) { left: 4%; bottom: 15%; transform: rotate(4deg); animation-delay: -2.8s; background: #eaf5ff; }
.float-word:nth-child(4) { right: 15%; bottom: 3%; transform: rotate(-3deg); animation-delay: -.8s; background: #e9f8ef; }
.float-word:nth-child(5) { left: 42%; top: 41%; transform: rotate(2deg); animation-delay: -3.4s; background: #fff; }
.float-word:nth-child(5) small { color: var(--orange-deep); }

.active-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--blue-soft);
  border: 1.5px solid #b8c9e6;
  border-radius: 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.active-callout .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(49, 92, 155, .13); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.stat-card {
  padding: 18px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, .78);
}
.stat-card .stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card .stat-value { margin-top: 8px; font-family: var(--font-display); font-size: 31px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.stat-card .stat-value small { font-family: var(--font-sans); font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0; margin-left: 4px; }
.stat-card .stat-foot { margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-icon { font-size: 16px; }

.section-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  margin-top: 18px;
}
.panel { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-link { border: 0; background: none; color: var(--orange-deep); font-size: 12px; font-weight: 800; cursor: pointer; padding: 4px; }
.panel-link:hover { text-decoration: underline; }

.grade-bars { display: grid; gap: 12px; }
.grade-row { display: grid; grid-template-columns: 62px 1fr 36px; gap: 12px; align-items: center; }
.grade-row .g-label { color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.grade-row .g-track { display: block; height: 12px; background: #f0e9dc; border-radius: 999px; overflow: hidden; }
.grade-row .g-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), var(--yellow)); min-width: 4px; }
.grade-row:nth-child(2n) .g-fill { background: linear-gradient(90deg, var(--blue), #6ea0da); }
.grade-row:nth-child(3n) .g-fill { background: linear-gradient(90deg, var(--green), #6ac59e); }
.grade-row .g-count { color: var(--muted); font-size: 11px; text-align: right; font-weight: 700; }

.mini-leader { display: grid; gap: 4px; }
.mini-row {
  display: grid;
  grid-template-columns: 28px 30px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
}
.mini-row:last-child { border-bottom: 0; }
.mini-rank { color: var(--muted); font-weight: 800; font-size: 12px; text-align: center; }
.mini-rank.top { color: var(--orange-deep); font-size: 15px; }
.mini-avatar { font-size: 18px; text-align: center; }
.mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mini-score { color: var(--orange-deep); font-weight: 800; font-size: 12px; }
.empty-state { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-emoji { display: block; font-size: 28px; margin-bottom: 6px; }

.history-list { display: grid; gap: 6px; }
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
}
.history-row:last-child { border-bottom: 0; }
.history-date { color: var(--muted); font-size: 11px; margin-top: 2px; }
.history-score { font-weight: 800; color: var(--orange-deep); font-size: 17px; }
.history-score small { color: var(--muted); font-size: 10px; font-weight: 700; }
.history-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: 3px; }

/* ------------------------------------------------------------
   答题
   ------------------------------------------------------------ */
.quiz-view { width: min(1060px, 100%); margin: 0 auto; }
.quiz-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}
.quiz-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0;
  text-align: left;
}
.quiz-back:hover { color: var(--ink); }
.progress-wrap { min-width: 0; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.progress-label b { color: var(--ink); font-size: 12px; }
.progress-track { height: 10px; background: #e8dfcf; border-radius: 999px; overflow: hidden; border: 1px solid rgba(23, 35, 59, .08); }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), var(--yellow)); transition: width .35s ease; }
.quiz-score { display: flex; align-items: center; gap: 8px; }
.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 2px 2px 0 rgba(23, 35, 59, .14);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}
.score-pill small { font-size: 10px; color: var(--muted); font-weight: 700; }
.combo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--yellow-soft);
  color: #7c5a00;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.quiz-card { padding: 26px; }
.question-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.question-no { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.stem { margin: 0 0 6px; font-size: clamp(19px, 2.4vw, 23px); line-height: 1.55; letter-spacing: -.01em; font-weight: 800; }
.quiz-hint { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.options { display: grid; gap: 10px; }
.option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 17px;
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.option:hover:not(:disabled) { border-color: var(--ink); background: #fff; transform: translateY(-1px); box-shadow: 3px 3px 0 rgba(23, 35, 59, .08); }
.option:focus-visible { outline: 3px solid rgba(255, 107, 53, .45); outline-offset: 2px; }
.option:disabled { cursor: default; }
.option.is-selected { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--ink), 3px 3px 0 rgba(23, 35, 59, .10); }
.option.is-correct { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.option.is-wrong { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.option.is-answer { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.option.is-dim { opacity: .64; }
.option-label {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #f7f1e5;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 800;
}
.option.is-selected .option-label { background: var(--ink); color: #fff; border-color: var(--ink); }
.option.is-correct .option-label { background: var(--green); color: #fff; border-color: var(--green); }
.option.is-wrong .option-label { background: var(--red); color: #fff; border-color: var(--red); }
.option.is-answer .option-label { background: var(--green); color: #fff; border-color: var(--green); }
.option-words {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}
.word-chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-height: 54px;
  padding: 8px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 253, 247, .9);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.word-chip .word-text { overflow: hidden; text-overflow: ellipsis; }
.word-chip .pinyin { margin-left: 2px; font-size: 13px; line-height: 1; color: #4d566a; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.target-char { position: relative; display: inline-block; }
.target-char::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
  transform: translateX(-50%);
}
.option.is-correct .word-chip,
.option.is-answer .word-chip { border-color: rgba(31, 157, 104, .28); }
.option.is-wrong .word-chip { border-color: rgba(217, 56, 42, .26); }
.word-chip.is-error {
  background: #fff;
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
.word-chip.is-error .pinyin { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.word-chip.is-fixed { border-color: var(--green); background: #fff; }
.option-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 900; }
.option-mark.correct { background: var(--green); color: #fff; }
.option-mark.wrong { background: var(--red); color: #fff; }
.option-mark.answer { background: #fff; border: 1.5px solid var(--green); color: var(--green); }
.option-mark.empty { color: transparent; }

.quiz-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.quiz-actions.is-done { display: none; }
.key-hint { color: var(--muted); font-size: 11px; line-height: 1.6; }
.key-hint kbd {
  display: inline-block;
  min-width: 19px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 10px;
  text-align: center;
}

.feedback-tray {
  margin-top: 16px;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(120deg, #fffdf7, #fff8e5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: rise .3s ease;
}
.feedback-tray.is-wrong { background: linear-gradient(120deg, #fffdf7, #fff0ee); }
.feedback-copy { display: flex; align-items: center; gap: 14px; min-width: 0; }
.feedback-medal {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 15px;
  background: var(--yellow);
  font-size: 22px;
  box-shadow: 3px 3px 0 rgba(23, 35, 59, .14);
}
.feedback-tray.is-wrong .feedback-medal { background: var(--red-soft); }
.feedback-title { margin: 0; font-family: var(--font-display); font-size: 23px; line-height: 1.1; font-weight: 800; }
.feedback-sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.feedback-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.combo-burst {
  position: fixed;
  left: 50%;
  top: 38%;
  z-index: 70;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  animation: burst 1.15s cubic-bezier(.2, .8, .3, 1) forwards;
}
.combo-burst .burst-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1;
  font-weight: 900;
  color: var(--orange);
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 rgba(255, 209, 102, .55);
  letter-spacing: -.05em;
  white-space: nowrap;
}
.combo-burst .burst-sub { margin-top: 10px; font-size: 14px; font-weight: 900; letter-spacing: .2em; color: var(--ink); }
.combo-burst.legend .burst-title { color: var(--yellow); text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 var(--orange); }

/* ------------------------------------------------------------
   20 秒错题学习
   ------------------------------------------------------------ */
.study-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 35, 59, .64);
  backdrop-filter: blur(8px);
  animation: fade .2s ease;
  overflow: auto;
}
.study-card {
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, .25);
  padding: 24px;
  animation: rise .3s ease;
}
.study-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.study-head h2 { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.15; letter-spacing: -.03em; }
.study-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.study-lock { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 800; }
.study-lock.is-done { background: var(--green-soft); color: var(--green); }
.timer-ring {
  --progress: 100%;
  position: relative;
  width: 102px;
  height: 102px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--orange) 0 var(--progress), #eadfce var(--progress) 100%);
  display: grid;
  place-items: center;
  transition: background .2s linear;
}
.timer-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--line-soft);
}
.timer-ring .timer-num { position: relative; z-index: 1; font-family: var(--font-display); font-size: 32px; font-weight: 900; line-height: 1; }
.timer-ring .timer-unit { position: relative; z-index: 1; display: block; text-align: center; color: var(--muted); font-size: 10px; font-weight: 800; margin-top: 2px; }
.timer-ring.is-done { background: var(--green); }
.timer-ring.is-done::before { border-color: var(--green); }

.study-message {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}
.study-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.study-option { border: 1.5px solid var(--line); border-radius: 16px; background: #fbf7ee; padding: 13px; min-width: 0; }
.study-option.is-correct { border-color: var(--green); background: var(--green-soft); }
.study-option.is-selected { border-color: var(--red); background: var(--red-soft); }
.study-option h3 { margin: 0 0 9px; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.study-option h3 .label-badge {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.study-option.is-correct h3 .label-badge { background: var(--green); }
.study-option.is-selected h3 .label-badge { background: var(--red); }
.study-items { display: grid; gap: 5px; }
.study-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 253, 247, .7);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}
.study-item.is-error { background: #fff; box-shadow: inset 0 0 0 1.5px var(--red); }
.study-item .study-correct { flex: none; color: var(--green); font-size: 12px; font-weight: 800; white-space: nowrap; }
.study-item .study-wrong-mark { color: var(--red); font-size: 11px; font-weight: 800; }
.study-item .pinyin { font-size: 12px; color: var(--muted); margin-left: 2px; }
.study-item .pinyin.is-wrong-pinyin {
  color: var(--red);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.study-item.is-error .target-char::after { background: var(--red); }
.study-item.is-error .word-text { color: var(--red); }
.study-item .study-correct .word-text { color: var(--green); }
.study-item .study-correct .target-char::after { background: var(--green); }
.study-explain { margin-top: 14px; display: grid; gap: 9px; }
.study-explain-box {
  padding: 13px 14px;
  border-radius: 13px;
  border: 1.5px solid #efc2bc;
  background: #fff8f6;
  color: #7e2a20;
  font-size: 13px;
  line-height: 1.7;
}
.study-explain-box strong { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: .08em; color: var(--red); }
.tip-box {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1.5px solid #ecd28d;
  background: var(--yellow-soft);
  color: #6f5200;
  font-size: 13px;
  line-height: 1.65;
}
.tip-box strong { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: .08em; color: #9a7100; }
.study-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.study-actions .lock-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.study-actions .lock-note b { color: var(--red); }

/* ------------------------------------------------------------
   结算
   ------------------------------------------------------------ */
.result-card { padding: 30px; overflow: hidden; position: relative; }
.result-card::before {
  content: "";
  position: absolute;
  right: -80px; top: -120px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, .55), transparent 68%);
  pointer-events: none;
}
.result-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; position: relative; z-index: 1; }
.result-hero h1 { margin: 8px 0 8px; font-family: var(--font-display); font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -.04em; }
.result-hero p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.score-ring {
  --score: 0;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--score) * 1%), #eadecb 0);
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); }
.score-ring .score-inner { position: relative; z-index: 1; text-align: center; }
.score-ring .score-num { font-family: var(--font-display); font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -.06em; }
.score-ring .score-total { color: var(--muted); font-size: 11px; font-weight: 800; margin-top: 4px; }
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.result-stat { padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; background: rgba(255, 253, 247, .8); }
.result-stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.result-stat b { display: block; margin-top: 4px; font-size: 20px; letter-spacing: -.02em; }
.rank-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.rank-banner .rank-big { font-family: var(--font-display); font-size: 24px; font-weight: 900; }
.new-best { background: var(--yellow-soft); color: #7c5a00; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.result-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.result-list { padding: 18px; }
.result-list h3 { margin: 0 0 10px; font-size: 15px; }
.result-list .mini-row { grid-template-columns: 24px 28px 1fr auto; }

/* ------------------------------------------------------------
   排行榜
   ------------------------------------------------------------ */
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.board-head h1 { margin: 4px 0 4px; font-family: var(--font-display); font-size: clamp(32px, 4vw, 46px); letter-spacing: -.04em; line-height: 1.1; }
.board-head p { margin: 0; color: var(--muted); font-size: 13px; }
.board-tabs { display: flex; gap: 5px; padding: 5px; background: #eee6d7; border-radius: 14px; flex-wrap: wrap; }
.board-tab { border: 0; background: transparent; padding: 8px 13px; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.board-tab.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(23, 35, 59, .10); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; align-items: end; }
.podium-card {
  position: relative;
  padding: 18px 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.podium-card.first { background: linear-gradient(160deg, #fff9e4, #fff1ba); transform: translateY(-10px); grid-column: 2; grid-row: 1; }
.podium-card.second { background: linear-gradient(160deg, #fffdf7, #f1f4f8); grid-column: 1; grid-row: 1; align-self: end; }
.podium-card.third { background: linear-gradient(160deg, #fffdf7, #fbeee5); grid-column: 3; grid-row: 1; align-self: end; }
.podium-card.is-me { outline: 2px dashed var(--orange); outline-offset: 3px; }
.podium-medal { font-size: 30px; line-height: 1; }
.podium-avatar { font-size: 38px; line-height: 1.2; margin-top: 6px; }
.podium-name { margin-top: 4px; font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { margin-top: 6px; font-family: var(--font-display); font-size: 26px; font-weight: 900; color: var(--orange-deep); }
.podium-score small { font-family: var(--font-sans); font-size: 10px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.podium-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.board-panel { padding: 8px 18px 14px; overflow: hidden; }
.board-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.board-table th { text-align: left; color: var(--muted); font-size: 10px; letter-spacing: .08em; font-weight: 800; padding: 12px 8px 8px; border-bottom: 1px solid var(--line-soft); }
.board-table td { padding: 11px 8px; border-bottom: 1px dashed var(--line-soft); }
.board-table tr:last-child td { border-bottom: 0; }
.board-table tr.is-me td { background: var(--yellow-soft); }
.board-table tr.is-me td:first-child { border-radius: 10px 0 0 10px; }
.board-table tr.is-me td:last-child { border-radius: 0 10px 10px 0; }
.board-rank { font-weight: 900; color: var(--muted); width: 44px; }
.board-rank.top1 { color: #b8860b; }
.board-rank.top2 { color: #708090; }
.board-rank.top3 { color: #b06a3b; }
.board-user { display: flex; align-items: center; gap: 8px; min-width: 120px; font-weight: 800; }
.board-user .avatar { font-size: 19px; }
.board-num { font-weight: 800; }
.board-num.highlight { color: var(--orange-deep); }
.board-empty { padding: 38px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.my-rank-note { margin-top: 12px; padding: 11px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; }
.board-footnote { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* ------------------------------------------------------------
   错题本
   ------------------------------------------------------------ */
.mistakes-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-group { display: flex; gap: 5px; padding: 4px; background: #eee6d7; border-radius: 12px; }
.filter-btn { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.filter-btn.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(23, 35, 59, .10); }
.mistake-list { display: grid; gap: 10px; }
.mistake-card { padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.mistake-main { min-width: 0; }
.mistake-word { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 22px; font-weight: 800; }
.mistake-word .wrong { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; }
.mistake-word .arrow { color: var(--muted); font-size: 14px; }
.mistake-word .right { color: var(--green); }
.mistake-note { margin-top: 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.mistake-tip { margin-top: 7px; color: #7c5a00; background: var(--yellow-soft); border-radius: 8px; padding: 7px 9px; font-size: 12px; line-height: 1.55; }
.mistake-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }

/* ------------------------------------------------------------
   弹窗 / 提示 / 五彩纸屑
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 35, 59, .55);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.modal-card {
  width: min(440px, 100%);
  padding: 24px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .20);
  animation: rise .22s ease;
}
.modal-card h2 { margin: 0 0 8px; font-size: 21px; }
.modal-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast {
  padding: 11px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 4px 4px 0 rgba(23, 35, 59, .18);
  animation: rise .22s ease;
  text-align: center;
}
.toast.is-error { background: var(--red); border-color: #8c2117; }
.toast.is-success { background: var(--green); border-color: #146b47; }

#confetti-root { position: fixed; inset: 0; z-index: 75; pointer-events: none; overflow: hidden; }
.confetti-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--paper); color: var(--ink); font-size: 16px; text-align: center; z-index: 999; }

/* ------------------------------------------------------------
   动效
   ------------------------------------------------------------ */
@keyframes floaty {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-4deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(1deg); }
  32% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; transform: translate(-50%, -56%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -72%) scale(.96); }
}
@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; gap: 28px; min-height: 0; }
  .auth-hero { order: 1; }
  .auth-card { order: 2; }
  .auth-art { display: none; }
  .home-hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 30px 24px 12px; }
  .hero-art { min-height: 240px; margin-bottom: 10px; }
  .section-grid { grid-template-columns: 1fr; }
  .result-lower { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .option-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word-chip { justify-content: flex-start; }
  .result-hero { grid-template-columns: 1fr; }
  .score-ring { margin: 4px auto 0; }
}

@media (max-width: 720px) {
  .site-header { gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
  .site-header.is-scrolled { padding: 10px 14px; }
  .logo-badge { width: 38px; height: 38px; font-size: 22px; border-radius: 12px; }
  .logo-text strong { font-size: 15px; }
  .logo-text small { display: none; }
  .site-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .nav-btn { padding: 7px 11px; font-size: 12px; white-space: nowrap; }
  .user-chip { margin-left: auto; }
  .user-chip .user-name { display: none; }
  .view { padding: 14px 14px 44px; }
  .hero-copy { padding: 24px 18px 8px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-copy p { font-size: 14px; }
  .hero-art { min-height: 200px; }
  .float-word { font-size: 17px; padding: 9px 11px; }
  .float-word small { font-size: 9px; }
  .float-word:nth-child(1) { left: 4%; top: 8%; }
  .float-word:nth-child(2) { right: 2%; top: 0; }
  .float-word:nth-child(3) { left: 0; bottom: 8%; }
  .float-word:nth-child(4) { right: 3%; bottom: 0; }
  .float-word:nth-child(5) { display: none; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-card .stat-value { font-size: 25px; }
  .quiz-top { grid-template-columns: 1fr auto; gap: 9px; }
  .quiz-back { grid-column: 1 / -1; padding: 0; }
  .quiz-score { gap: 6px; }
  .combo-pill { display: none; }
  .quiz-card { padding: 18px 18px 92px; }
  .stem { font-size: 18px; }
  .option { grid-template-columns: 34px minmax(0, 1fr) 22px; gap: 8px; padding: 8px; border-radius: 14px; }
  .option-label { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
  .word-chip { min-height: 48px; padding: 6px 7px; font-size: 16px; border-radius: 9px; }
  .word-chip .pinyin { font-size: 12px; }
  .quiz-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    margin: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 247, .97);
    border-top: 1.5px solid var(--line);
    box-shadow: 0 -6px 18px rgba(23, 35, 59, .08);
    backdrop-filter: blur(8px);
  }
  .quiz-actions .key-hint { display: none; }
  .quiz-actions .btn { width: 100%; }
  .quiz-actions.is-done { display: none; }
  .feedback-tray { padding: 13px; }
  .feedback-medal { width: 44px; height: 44px; font-size: 19px; }
  .feedback-title { font-size: 19px; }
  .study-card { padding: 17px; border-radius: 20px; }
  .study-head h2 { font-size: 24px; }
  .timer-ring { width: 82px; height: 82px; }
  .timer-ring .timer-num { font-size: 25px; }
  .study-grid { grid-template-columns: 1fr; }
  .study-item { font-size: 17px; }
  .study-actions .btn { width: 100%; }
  .result-card { padding: 20px; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .result-hero h1 { font-size: 34px; }
  .score-ring { width: 154px; height: 154px; }
  .score-ring .score-num { font-size: 44px; }
  .podium { grid-template-columns: 1fr; gap: 8px; }
  .podium-card.first, .podium-card.second, .podium-card.third { grid-column: auto; grid-row: auto; transform: none; }
  .podium-card.first { order: -1; }
  .podium-card { display: grid; grid-template-columns: 38px 46px 1fr auto; align-items: center; text-align: left; gap: 8px; padding: 12px; }
  .podium-medal { font-size: 23px; }
  .podium-avatar { margin: 0; font-size: 28px; }
  .podium-name { margin: 0; }
  .podium-score { margin: 0; font-size: 22px; }
  .podium-meta { display: none; }
  .board-panel { padding: 4px 10px 10px; overflow-x: auto; }
  .board-table { min-width: 580px; }
  .board-head { align-items: flex-start; }
  .board-tabs { width: 100%; }
  .board-tab { flex: 1; }
  .mistake-card { grid-template-columns: 1fr; }
  .mistake-side { flex-direction: row; align-items: center; }
  .auth-card { padding: 22px; }
  .auth-hero h1 { font-size: 40px; }
  .auth-hero p.lead { font-size: 14px; }
  .site-footer { font-size: 10px; padding-bottom: 18px; }
}

@media (max-width: 430px) {
  .hero-copy h1 { font-size: 31px; }
  .hero-actions .btn { width: 100%; }
  .hero-meta { gap: 5px 10px; font-size: 10px; }
  .option-words { gap: 5px; }
  .word-chip { font-size: 15px; min-height: 42px; }
  .score-pill { padding: 6px 9px; font-size: 13px; }
  .study-head { gap: 10px; }
  .study-head h2 { font-size: 21px; }
  .study-head p { max-width: 200px; }
  .feedback-copy { gap: 9px; }
  .feedback-actions { width: 100%; }
  .feedback-actions .btn { width: 100%; }
}

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