/* ============================================================
   YourHelperType · 英语听写训练
   视觉体系：浅色暖米 · Georgia serif · 棕金 accent · TCM同款
   ============================================================ */
:root {
  --bg: #FAFAFA;
  --bg-soft: #F3F0EB;
  --card: #ffffff;
  --card-hi: #F7F4EE;
  --glass: rgba(255, 253, 248, 0.92);
  --text: #1A1A1A;
  --muted: #6B7280;
  --accent: #8B7355;
  --accent-2: #A0845C;
  --accent-soft: rgba(139, 115, 85, .12);
  --grad: linear-gradient(120deg, #8B7355, #C4A882);
  --grad-warm: linear-gradient(120deg, #8B7355, #D4A76A);
  --good: #3d7a5c;
  --warn: #c47c2b;
  --danger: #c0392b;
  --line: rgba(0, 0, 0, .08);
  --line-hi: rgba(0, 0, 0, .15);
  --radius: 18px;
  --font: 'Georgia', 'Times New Roman', serif, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --glow: 0 0 24px rgba(139, 115, 85, .2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { color-scheme: light; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(139, 115, 85, .25); }

/* ---------- 浅色暖米背景纹理 ---------- */
.aurora { display: none; }
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(139,115,85,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,115,85,.04) 1px, transparent 1px);
  background-size: 56px 56px;
}

#app {
  width: min(94vw, 1680px);
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 56px) 96px;
}

/* ---------- 首页/小结容器 ---------- */
.home { display: flex; flex-direction: column; gap: 20px; animation: fade .3s ease; max-width: 680px; margin: 0 auto; padding-top: 28px; }
.home.center { align-items: center; text-align: center; justify-content: center; min-height: 60vh; gap: 24px; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: -8px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 8px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: border-color .2s, transform .2s;
}
.stat:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.stat b { display: block; font-size: 22px; font-weight: 700; font-family: var(--mono); }
.stat b.due { color: var(--warn); }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.mode-cards { display: flex; flex-direction: column; gap: 12px; }
.mode-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; color: var(--text); text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform .18s cubic-bezier(.2,.9,.3,1.4), border-color .18s, background .18s, box-shadow .18s;
}
.mode-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px 120px at 50% 0%, rgba(124,92,255,.14), transparent 70%);
  opacity: 0; transition: opacity .2s;
}
.mode-card:hover { transform: translateY(-3px); border-color: rgba(139,115,85,.55); box-shadow: var(--glow); }
.mode-card:hover::after { opacity: 1; }
.mode-card.disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.mode-card.disabled:hover { transform: none; border-color: var(--line); }
.mode-card .mc-icon { font-size: 30px; }
.mode-card b { display: block; font-size: 17px; }
.mode-card small { color: var(--muted); font-size: 13px; }
.mode-card.feat { border-color: transparent; background:
  linear-gradient(var(--bg) 0 0) padding-box,
  linear-gradient(120deg, rgba(139,115,85,.75), rgba(196,168,130,.55)) border-box;
}
.mode-card.feat:hover { box-shadow: 0 8px 40px rgba(139,115,85,.3); }

/* ---------- 设置区 ---------- */
.settings {
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.set-selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.set-selects label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.settings select {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; width: 100%;
  font-family: var(--font); transition: border-color .15s;
}
.settings select:hover, .settings select:focus { border-color: var(--accent); outline: none; }
.set-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.set-toggles .chk {
  display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  color: var(--text); font-size: 14px; transition: border-color .15s;
}
.set-toggles .chk:hover { border-color: var(--line-hi); }
.set-toggles .chk span { display: flex; flex-direction: column; gap: 2px; }
.set-toggles .chk small { color: var(--muted); font-size: 12px; }
.settings input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }

/* ---------- 按钮 ---------- */
.btn-primary {
  position: relative; overflow: hidden;
  background: var(--grad); color: #fff; border: none; border-radius: 13px;
  padding: 14px 22px; font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: var(--font); letter-spacing: .01em;
  box-shadow: 0 4px 24px rgba(139, 115, 85, .3);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-primary:hover { box-shadow: 0 6px 34px rgba(139, 115, 85, .45); transform: translateY(-1px); }
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px 18px; font-size: 14px; cursor: pointer;
  font-family: var(--font);
  transition: color .15s, border-color .15s, box-shadow .15s;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(139,115,85,.55); box-shadow: 0 0 18px rgba(139,115,85,.15); }
.btn-ghost.sm { padding: 10px 14px; font-size: 13px; }
.danger-ghost { color: var(--danger); border-color: transparent; align-self: center; margin-top: 6px; background: transparent; }
.danger-ghost:hover { border-color: rgba(255,84,112,.5); color: var(--danger); box-shadow: none; }
.icon-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  width: 38px; height: 38px; border-radius: 11px; font-size: 16px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-hi); }

/* ============================================================
   答题界面 —— 专注打字台
   ============================================================ */
.quiz {
  display: flex; flex-direction: column; gap: 22px; animation: fade .25s ease;
  max-width: 680px; margin: 0 auto; width: 100%;
  min-height: calc(100vh - 80px); justify-content: center; padding: 28px 0;
}
.quiz-top { display: flex; align-items: center; gap: 12px; }
.progress-bar { flex: 1; height: 7px; background: var(--card); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; background: var(--grad); border-radius: 99px; transition: width .3s; box-shadow: 0 0 10px rgba(0,224,255,.5); }
.counter { font-size: 13px; color: var(--muted); min-width: 42px; text-align: right; font-family: var(--mono); }

.timer-bar { height: 6px; background: var(--card); border-radius: 99px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--grad); border-radius: 99px; transition: width .08s linear, background .3s; }

.stage {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px;
  min-height: 260px; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.type-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(139,115,85,.25);
  padding: 5px 14px; border-radius: 99px;
}
.speaker {
  background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--font);
}
.sp-icon {
  font-size: 52px; width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(139,115,85,.2), rgba(250,250,250,.9) 68%);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(139,115,85,.3);
  box-shadow: 0 0 0 0 rgba(139,115,85,.35);
  animation: pulse 2.6s ease-out infinite;
  transition: transform .15s;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(139,115,85,.3); }
  70%  { box-shadow: 0 0 0 22px rgba(139,115,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(139,115,85,0); }
}
.speaker:hover .sp-icon { transform: scale(1.06); }
.speaker:active .sp-icon { transform: scale(.96); }
.sp-hint { font-size: 12px; color: var(--muted); }
.hint { font-size: 15px; color: var(--muted); text-align: center; line-height: 1.5; }
.hint.hint-hidden { display: none; }
.hint-toggle {
  background: none; border: 1px dashed var(--line-hi); color: var(--muted);
  padding: 6px 14px; border-radius: 99px; cursor: pointer; font-size: 13px; font-family: var(--font);
  transition: color .15s, border-color .15s;
}
.hint-toggle:hover { color: var(--text); border-color: var(--accent); }

.answer-preview {
  font-size: 26px; font-weight: 700; letter-spacing: 1px; min-height: 32px;
  font-family: var(--mono); word-break: break-word; text-align: center;
}
.c-ok { color: var(--good); }
.c-bad { color: var(--danger); text-decoration: underline wavy var(--danger); }

.answer-input {
  background: var(--bg-soft); border: 2px solid var(--line); border-radius: 14px;
  padding: 18px 20px; font-size: 20px; color: var(--text); outline: none;
  transition: border-color .15s;
}
.answer-input:focus { border-color: var(--accent); }

.quiz-actions { display: flex; gap: 12px; }
.quiz-actions .btn-primary { flex: 1; }

/* ---------- 揭晓页 ---------- */
.reveal { align-items: center; text-align: center; justify-content: center; min-height: 60vh; }
.reveal-badge { font-size: 15px; font-weight: 700; padding: 6px 18px; border-radius: 99px; }
.reveal.good .reveal-badge { color: var(--good); background: rgba(61,220,151,.12); }
.reveal.bad .reveal-badge { color: var(--danger); background: rgba(255,84,112,.12); }
.reveal-answer {
  font-size: 40px; font-weight: 800; letter-spacing: 1px; word-break: break-word;
  font-family: var(--mono);
}
.reveal.good .reveal-answer { color: var(--good); }
.ipa { color: var(--muted); font-size: 18px; font-family: var(--mono); }
.reveal-zh { color: var(--text); font-size: 17px; }
.your-input { color: var(--muted); font-size: 15px; }
.your-input span { font-family: var(--mono); margin-left: 6px; }
.reveal-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- 小结 ---------- */
.summary-score { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 8px 0; }
.ring {
  --pct: 0;
  width: 136px; height: 136px; border-radius: 50%;
  background: conic-gradient(#8B7355 calc(var(--pct) * 1%), var(--card) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
  filter: drop-shadow(0 0 12px rgba(139,115,85,.25));
}
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; font-size: 30px; font-weight: 800; font-family: var(--mono); }
.summary-score p { color: var(--muted); }

.wrong-list h3, .book-list h3 { font-size: 15px; margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.wrong-list { display: flex; flex-direction: column; gap: 10px; }
.wrong-item, .book-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.wrong-item b { font-size: 17px; font-family: var(--mono); }
.wrong-item small { color: var(--muted); font-size: 13px; text-align: right; }
.all-good { color: var(--good); text-align: center; padding: 20px; }

/* ---------- 错题本卡片 ---------- */
.book-head { display: flex; align-items: center; gap: 14px; }
.book-list { display: flex; flex-direction: column; gap: 10px; }
.bi-main b { font-size: 17px; }
.bi-main small { display: block; color: var(--muted); font-size: 13px; }
.bi-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.dots { letter-spacing: 2px; color: var(--good); }
.wc { white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.tag-due { color: var(--warn); background: rgba(255,176,32,.12); padding: 2px 8px; border-radius: 99px; }
.tag-ok { color: var(--good); background: rgba(61,220,151,.12); padding: 2px 8px; border-radius: 99px; }
.tag-wait { color: var(--muted); background: var(--card-hi); padding: 2px 8px; border-radius: 99px; }
.mini-speak { background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; padding: 3px 7px; transition: border-color .15s; }
.mini-speak:hover { border-color: var(--accent); }

/* ---------- 打卡卡片 ---------- */
.streak-card {
  position: relative; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.streak-card::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 120%;
  background: radial-gradient(closest-side, rgba(255,176,32,.14), transparent);
  pointer-events: none;
}
.streak-card.met { border-color: rgba(61,220,151,.5); box-shadow: 0 0 24px rgba(61,220,151,.15); }
.streak-main { display: flex; align-items: center; gap: 10px; }
.streak-main .fire { font-size: 30px; filter: drop-shadow(0 0 10px rgba(255,140,0,.6)); }
.streak-main b { font-size: 22px; font-weight: 800; display: block; line-height: 1.1; font-family: var(--mono); }
.streak-main small { color: var(--muted); font-size: 12px; }
.streak-goal { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.streak-goal small { color: var(--muted); font-size: 12px; }
.goal-bar { height: 7px; background: var(--card); border-radius: 99px; overflow: hidden; }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--warn), var(--good)); border-radius: 99px; transition: width .3s; }
.week-dots { display: flex; gap: 5px; }
.week-dots .wd { width: 11px; height: 11px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.week-dots .wd.done { background: var(--good); border-color: var(--good); box-shadow: 0 0 8px rgba(61,220,151,.6); }
.week-dots .wd.today { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- 词库 chips ---------- */
.bank-select { display: flex; flex-direction: column; gap: 8px; }
.bank-select > label { font-size: 13px; color: var(--muted); }
.bank-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 8px 14px; border-radius: 99px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.chip:hover { border-color: rgba(124,92,255,.55); }
.chip small { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 2px 18px rgba(139,115,85,.3); }
.chip.on small { color: rgba(255,255,255,.85); }
.chip.add { color: var(--muted); border-style: dashed; }

/* ---------- 答题辅助按钮 ---------- */
.assist-row { display: flex; gap: 8px; flex-wrap: wrap; }
.assist {
  flex: 1; min-width: 88px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); border-radius: 13px; padding: 12px 8px; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font);
  backdrop-filter: blur(8px);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.assist:hover { border-color: rgba(139,115,85,.55); box-shadow: 0 0 14px rgba(139,115,85,.15); }
.assist.primary { background: var(--grad); border-color: transparent; color: #fff; flex: 1.4; box-shadow: 0 2px 18px rgba(139,115,85,.3); }
.assist.primary:hover { box-shadow: 0 4px 26px rgba(139,115,85,.45); }
.assist kbd {
  font-size: 10px; background: rgba(255,255,255,.14); border-radius: 4px;
  padding: 1px 5px; font-family: var(--mono);
}

/* ---------- 导入 ---------- */
.import-area {
  width: 100%; min-height: 220px; background: var(--bg-soft); color: var(--text);
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px;
  font-size: 15px; line-height: 1.6; resize: vertical; outline: none;
  font-family: var(--mono);
}
.import-area:focus { border-color: var(--accent); }
.imp-info { color: var(--muted); font-size: 13px; }

.mini-master {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; cursor: pointer; padding: 3px 8px; font-size: 12px; font-family: var(--font);
  transition: color .15s, border-color .15s;
}
.mini-master:hover { color: var(--good); border-color: var(--good); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--card); color: var(--text); border: 1px solid var(--line-hi);
  padding: 11px 20px; border-radius: 13px; font-size: 14px; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99;
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 打字机输入 ---------- */
.tw-wrap { display: flex; justify-content: center; padding: 4px 0; }
.tw-input {
  width: 100%; text-align: center; background: transparent;
  border: none; border-bottom: 2px solid var(--line-hi); border-radius: 0;
  color: var(--text); caret-color: var(--accent); outline: none;
  font-family: var(--mono);
  font-size: 28px; letter-spacing: 2px; padding: 10px 6px 12px;
  transition: border-color .15s, color .15s, text-shadow .15s;
  resize: none; overflow: hidden; line-height: 1.45;
  display: block; word-break: break-word;
}
.tw-input::placeholder { color: #bbb; font-size: 17px; letter-spacing: 0; font-family: var(--font); }
.tw-input:focus { border-bottom-color: var(--accent); }
.tw-input.good { color: var(--good); border-bottom-color: var(--good); }
.tw-input.bad  { color: var(--danger); border-bottom-color: var(--danger); }
.tw-input.shake { animation: shake .38s; }
@keyframes shake {
  10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-7px); } 40%,60% { transform: translateX(7px); }
}

.zh-prompt { font-size: 26px; font-weight: 700; text-align: center; line-height: 1.5; padding: 8px 4px; }

/* ---------- 结果/错误框 ---------- */
.err-box { min-height: 4px; text-align: center; opacity: 0; transition: opacity .18s; }
.err-box.show { opacity: 1; }
.err-box.ok { color: var(--good); font-size: 18px; font-weight: 700; padding: 6px; }
.err-box .ipa-inline { color: var(--muted); font-weight: 400; font-family: var(--mono); }
.err-box .cont-hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.err-box.wrong {
  background: rgba(255,84,112,.07); border: 1px solid rgba(255,84,112,.32);
  border-radius: 13px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.diag { color: var(--danger); font-size: 15px; }
.diag b { color: #fff; }
.your-diff { font-family: var(--mono); font-size: 22px; letter-spacing: 1px; word-break: break-word; }
.diag-hint { color: var(--muted); font-size: 12px; }

.err-box.reveal-inline {
  background: var(--glass); border: 1px solid var(--line); border-radius: 15px;
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  backdrop-filter: blur(12px);
}
.ans-line { font-size: 32px; font-weight: 800; color: var(--good); font-family: var(--mono); word-break: break-word; }
.ans-line.sub { color: var(--text); font-size: 26px; }
.btn-primary.block { width: 100%; margin-top: 8px; }

/* ============================================================
   网站布局：玻璃导航 / Hero / 分区 / 页脚
   ============================================================ */
.site { display: flex; flex-direction: column; animation: fade .3s ease; }

.site-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 2px;
  background: rgba(250,250,250,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer; letter-spacing: .01em; }
.nav-brand .brand-echo { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.nav-logo { font-size: 20px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); cursor: pointer; font-size: 15px; transition: color .12s; white-space: nowrap; position: relative; padding: 4px 0; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px;
  height: 2px; background: var(--grad); border-radius: 2px;
}

.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center;
  padding: clamp(48px, 7vw, 88px) 0 clamp(44px, 6vw, 72px);
}
.hero-title { font-size: clamp(32px, 3.6vw, 52px); line-height: 1.16; font-weight: 700; letter-spacing: -.01em; }
.hero-title em {
  font-style: normal;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(124,92,255,.45));
}
.hero-sub { color: var(--muted); font-size: 16px; margin-top: 16px; line-height: 1.65; max-width: 460px; }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn-primary.lg, .btn-ghost.lg { padding: 15px 26px; font-size: 16px; border-radius: 14px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-tags button {
  font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-family: var(--font);
  transition: color .12s, border-color .12s, box-shadow .12s;
}
.hero-tags button:hover { color: var(--text); border-color: rgba(124,92,255,.55); box-shadow: 0 0 12px rgba(124,92,255,.2); }
.hero-side { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 560px; margin-left: auto; }

.section { padding: clamp(40px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.section-title { font-size: clamp(22px, 2vw, 27px); font-weight: 700; margin-bottom: 12px; letter-spacing: -.01em; }
.section-sub { color: var(--muted); font-size: 15px; margin: 0 0 36px; max-width: 640px; line-height: 1.6; }
.section-title + .settings,
.section-title + .content-grid,
.section-title + .mode-grid,
.section-title + .bank-chips { margin-top: 34px; }

.mode-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.mode-grid .mode-card.feat { grid-column: 1 / -1; }
@media (min-width: 560px)  { .mode-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .mode-grid { grid-template-columns: repeat(4, 1fr); } }

.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.content-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px;
  backdrop-filter: blur(8px); transition: border-color .2s, transform .2s, box-shadow .2s;
}
.content-card:hover { border-color: var(--line-hi); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.content-card .cc-ico { font-size: 30px; }
.content-card h3 { font-size: 18px; margin: 16px 0 10px; }
.content-card p { color: var(--muted); font-size: 14px; line-height: 1.75; }

.backup-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- 二级页面外壳 ---------- */
.page { animation: fade .3s ease; padding-bottom: 48px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; padding: 30px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.page-head .icon-btn { margin-top: 4px; flex-shrink: 0; }
.page-title { font-size: clamp(23px, 2.2vw, 30px); font-weight: 700; }
.page-sub { color: var(--muted); font-size: 15px; margin-top: 8px; max-width: 680px; line-height: 1.6; }

/* 错题本 */
.book-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 520px; margin-bottom: 28px; }
.bstat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; backdrop-filter: blur(8px); }
.bstat b { display: block; font-size: 24px; font-weight: 800; font-family: var(--mono); }
.bstat b.due { color: var(--warn); }
.bstat span { font-size: 12px; color: var(--muted); }

.book-tabs { display: flex; gap: 10px; margin-bottom: 24px; }
.btab { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; border-radius: 99px; cursor: pointer; font-size: 14px; font-family: var(--font); transition: all .12s; }
.btab:hover { color: var(--text); }
.btab.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 2px 16px rgba(124,92,255,.4); }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(8px);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.wcard:hover { border-color: rgba(124,92,255,.5); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.wcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wcard-top b { font-size: 19px; font-family: var(--mono); word-break: break-word; }
.wcard-zh { color: var(--muted); font-size: 13px; line-height: 1.55; }
.wcard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.wcard-foot .mini-master { margin-left: auto; }

.empty-state { color: var(--muted); text-align: center; padding: 56px 20px; background: var(--bg-soft); border: 1px dashed var(--line-hi); border-radius: 16px; }
.book-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; align-items: center; }

.import-wrap { max-width: 900px; }
.import-wrap .import-area { margin-bottom: 14px; }

.browse-link { align-self: flex-start; margin-top: 14px; }

/* 词库浏览页 */
.dict-search { margin: 20px 0 14px; }
.dict-input {
  width: 100%; max-width: 440px; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; font-size: 15px; outline: none;
  font-family: var(--font); transition: border-color .15s, box-shadow .15s;
}
.dict-input:focus { border-color: var(--accent); box-shadow: 0 0 16px rgba(124,92,255,.2); }
.dict-count { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.wcard-ipa { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.wcard.mastered { opacity: .55; }
.wcard.mastered .wcard-top b { text-decoration: line-through; text-decoration-color: var(--muted); }

/* ---------- 统计页 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 40px; }
.scard {
  background: var(--card); border: 1px solid var(--line); border-radius: 17px; padding: 20px 16px;
  text-align: center; backdrop-filter: blur(8px); transition: border-color .2s, transform .2s;
}
.scard:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.scard .sc-ico { font-size: 24px; }
.scard b { display: block; font-size: 30px; font-weight: 800; margin: 6px 0 2px; font-family: var(--mono); }
.scard .sc-label { font-size: 12px; color: var(--muted); }
.section-title.stat-sec { font-size: 20px; margin-top: 8px; }

.heatmap { overflow-x: auto; padding: 8px 0 4px; }
.hm-inner { display: inline-block; min-width: 0; }
.hm-months { display: flex; margin-left: 28px; height: 16px; }
.hm-mcell { flex: 0 0 16px; font-size: 10px; color: var(--muted); }
.hm-row { display: flex; }
.hm-weekdays { display: flex; flex-direction: column; gap: 3px; width: 28px; }
.hm-wd { height: 13px; font-size: 10px; line-height: 13px; color: var(--muted); }
.hm-body { display: flex; gap: 3px; }
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-cell { width: 13px; height: 13px; border-radius: 3px; background: rgba(255,255,255,.05); }
.hm-cell.empty { background: transparent; }
.hm-cell.h0 { background: rgba(255,255,255,.05); }
.hm-cell.h1 { background: #d4c4a8; }
.hm-cell.h2 { background: #b89d72; }
.hm-cell.h3 { background: #8B7355; }
.hm-cell.h4 { background: #5c4a2a; }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; margin-left: 28px; font-size: 12px; color: var(--muted); }
.hm-legend .hm-cell { display: inline-block; }

/* ---------- 连击 / 撒花 / 徽章 / 星标 ---------- */
.star-btn { color: var(--muted); font-size: 18px; }
.star-btn.on { color: var(--warn); border-color: var(--warn); box-shadow: 0 0 12px rgba(255,176,32,.35); }

.combo-tag { color: var(--warn); font-weight: 700; }
.combo-pop {
  position: fixed; top: 26%; left: 50%; transform: translate(-50%, -50%) scale(.5);
  font-size: 42px; font-weight: 800; color: var(--warn);
  opacity: 0; pointer-events: none; z-index: 60; text-shadow: 0 0 26px rgba(255,140,0,.8);
}
.combo-pop.show { animation: comboPop .7s ease; }
@keyframes comboPop {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.5); }
  30%  { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
  70%  { opacity: 1; transform: translate(-50%,-58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-78%) scale(1); }
}

.ring.perfect { animation: ringPulse 1s ease infinite alternate; }
@keyframes ringPulse {
  from { filter: drop-shadow(0 0 8px rgba(61,220,151,.3)); }
  to   { filter: drop-shadow(0 0 26px rgba(61,220,151,.7)); }
}

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; animation: confFall linear forwards; }
@keyframes confFall { to { transform: translateY(106vh) rotate(720deg); opacity: .9; } }

.badge-count { font-size: 13px; color: var(--muted); font-weight: 500; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 17px; padding: 20px 14px; text-align: center; backdrop-filter: blur(8px); }
.badge-ico { font-size: 30px; display: block; }
.badge b { display: block; font-size: 15px; margin: 8px 0 4px; }
.badge small { color: var(--muted); font-size: 12px; }
.badge.locked { opacity: .35; filter: grayscale(1); }
.badge.got { border-color: rgba(255,176,32,.5); box-shadow: 0 0 20px rgba(255,176,32,.12), inset 0 0 0 1px rgba(255,176,32,.15); }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 0 6px; border-top: 1px solid var(--line); margin-top: 8px; line-height: 1.8; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ============================================================
   分享卡浮层
   ============================================================ */
.share-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(4,4,10,.7); backdrop-filter: blur(10px); animation: fade .2s ease; padding: 20px;
}
.share-box {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  max-width: min(420px, 92vw); width: 100%;
}
.share-box img, .share-box canvas {
  width: 100%; border-radius: 18px; border: 1px solid var(--line-hi);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(124,92,255,.25);
}
.share-actions { display: flex; gap: 10px; width: 100%; }
.share-actions button { flex: 1; }
.share-tip { color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 820px) {
  #app { padding: 0 16px 60px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 24px 0 18px; }
  .hero-title { font-size: 30px; }
  .hero-sub { font-size: 14px; margin-top: 10px; }
  .hero-cta { margin-top: 18px; }
  .hero-tags { margin-top: 16px; }
  .site-nav { padding: 12px 0; gap: 10px; }
  .nav-brand { font-size: 15px; gap: 5px; }
  .nav-logo { font-size: 16px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; }
  .nav-links a.active::after { bottom: -12px; }
  .streak-card { grid-template-columns: 1fr; gap: 12px; }
  .streak-card .week-dots { justify-content: flex-start; }
  .quiz { min-height: auto; justify-content: flex-start; padding-top: 16px; }
  .tw-input { font-size: 21px; letter-spacing: 1px; }
}

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

@media (max-width: 480px) {
  #app { padding: 18px 14px 40px; }
  h1 { font-size: 22px; }
  .stat b { font-size: 18px; }
  .reveal-answer { font-size: 30px; }
  .sp-icon { width: 96px; height: 96px; font-size: 46px; }
  .settings { grid-template-columns: 1fr 1fr; }
}
