/* ============================================================
   styles.css — LEXORA 设计系统
   ------------------------------------------------------------
   浅色主题 · 卡片式 · 强视觉层级 · 专注阅读
   ============================================================ */

/* ========== 设计令牌 ========== */
:root {
  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --surface-2:   #f2f4f7;
  --surface-3:   #e7eaf0;
  --text:        #0f1219;
  --text-2:      #4a5364;
  --text-3:      #8b93a3;
  --border:      #e8ebf0;
  --border-2:    #dde1e8;

  --primary:     #4f46e5;
  --primary-2:   #6366f1;
  --primary-soft:#eef1ff;
  --accent:      #0891b2;
  --accent-soft: #e6f6fa;
  --success:     #10b981;
  --success-soft:#e7f8f1;
  --warning:     #f59e0b;
  --warning-soft:#fef5e7;
  --danger:      #ef4444;
  --danger-soft: #fdecec;

  --radius:      16px;
  --radius-sm:   11px;
  --radius-lg:   22px;

  --shadow-sm:   0 1px 2px rgba(16,20,32,.05);
  --shadow:      0 2px 10px rgba(16,20,32,.06);
  --shadow-md:   0 6px 22px rgba(16,20,32,.08);
  --shadow-lg:   0 14px 46px rgba(16,20,32,.14);

  --tabbar-h:    64px;
  --topbar-h:    56px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, Menlo, monospace;
}

/* ========== 基础 ========== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; font-size: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select { font-family: inherit; font-size: inherit; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

.muted  { color: var(--text-3); }
.tiny   { font-size: 12.5px; }
.empty  { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ========== 布局骨架 ========== */
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; position: relative; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,245,247,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px; margin-left: -4px; border-radius: 10px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(79,70,229,.28);
}
.brand-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub  { font-size: 10.5px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: transparent;
  transition: background .16s, color .16s;
}
.icon-btn:hover  { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

.main {
  padding: 18px 16px calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom));
}
.view { animation: viewIn .24s cubic-bezier(.22,.9,.3,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ========== 底部导航 ========== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 16px rgba(16,20,32,.04);
}
.tabbar-inner { max-width: 720px; margin: 0 auto; display: flex; }
.tab {
  flex: 1; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3);
  transition: color .16s;
  position: relative;
}
.tab-icon { display: flex; transition: transform .18s cubic-bezier(.2,.9,.3,1.3); }
.tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.tab.active { color: var(--primary); }
.tab.active .tab-icon { transform: translateY(-1px) scale(1.06); }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--primary);
}

/* ========== 卡片 / 区块 ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.card + .card { margin-top: -1px; }
.section-title {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .09em;
  margin: 22px 2px 10px;
}
.section-title:first-child { margin-top: 4px; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 11px;
  font-size: 14.5px; font-weight: 650;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2);
  transition: transform .12s, box-shadow .16s, background .16s, opacity .16s;
}
.btn:hover  { box-shadow: var(--shadow); }
.btn:active { transform: scale(.975); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff; border: none;
  box-shadow: 0 4px 14px rgba(79,70,229,.26);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79,70,229,.34); }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { padding: 14px 22px; font-size: 15.5px; border-radius: 13px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.danger-btn {
  width: 100%; padding: 13px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger);
  font-size: 14px; font-weight: 650;
}

/* ========== 首页 ========== */
.hello { font-size: 27px; font-weight: 800; letter-spacing: -.025em; margin: 6px 2px 2px; }
.hello-sub { font-size: 14px; color: var(--text-2); margin: 0 2px 20px; }

.plan-card {
  background: linear-gradient(150deg, #4f46e5 0%, #4338ca 45%, #0e7490 130%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  box-shadow: 0 12px 34px rgba(67,56,202,.28);
}
.plan-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.plan-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .82; }
.plan-pct { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.progress-track { height: 7px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 99px; background: #fff;
  transition: width .45s cubic-bezier(.22,.9,.3,1);
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.stat-box {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 13px; padding: 11px 10px; text-align: center;
}
.stat-num { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-lbl { font-size: 11px; opacity: .82; margin-top: 3px; font-weight: 500; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 14px; padding: 6px 13px; border-radius: 99px;
  background: rgba(255,255,255,.17); font-size: 12.5px; font-weight: 650;
}

.task-list { display: flex; flex-direction: column; gap: 9px; }
.task-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 15px; text-align: left; width: 100%;
  transition: transform .14s, box-shadow .18s, border-color .18s;
}
.task-item:hover  { box-shadow: var(--shadow); border-color: var(--border-2); }
.task-item:active { transform: scale(.985); }
.task-item.done   { opacity: .55; }
.task-emoji {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: var(--surface-2);
}
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.task-name { font-size: 15px; font-weight: 650; }
.task-desc { font-size: 12.5px; color: var(--text-3); }
.task-arrow { color: var(--text-3); font-size: 19px; flex: none; }

/* 词汇总览 */
.vocab-overview { display: flex; align-items: center; gap: 18px; }
.ring-wrap { position: relative; flex: none; display: flex; }
.ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ring-pct { font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring-sub { font-size: 10px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.vo-meta { flex: 1; min-width: 0; }
.vo-total { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.vo-break { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.vo-break-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; }

/* 分布条 */
.dist-row { margin-bottom: 13px; }
.dist-row:last-child { margin-bottom: 0; }
.dr-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.dr-name { font-size: 13.5px; font-weight: 600; }
.dr-val  { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dr-track { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.dr-fill { height: 100%; border-radius: 99px; transition: width .5s cubic-bezier(.22,.9,.3,1); }

/* ========== 学习页 ========== */
.learn-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.learn-head .icon-btn { background: var(--surface); border: 1px solid var(--border); }
.learn-progress { flex: 1; }
.lp-track { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.lp-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .35s cubic-bezier(.22,.9,.3,1); }
.lp-text { font-size: 11.5px; color: var(--text-3); margin-top: 5px; font-weight: 600; }

.word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-md);
}
.wc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wc-word { font-size: 34px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.wc-pos  { font-size: 12.5px; color: var(--text-3); margin-top: 5px; font-weight: 500; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* 大号发音按钮 */
.speak-row { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; }
.speak-big {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff; font-size: 23px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(79,70,229,.32);
  transition: transform .16s cubic-bezier(.2,.9,.3,1.4), box-shadow .18s;
}
.speak-big:hover  { box-shadow: 0 9px 26px rgba(79,70,229,.4); }
.speak-big:active { transform: scale(.9); }
.speak-big.playing { animation: pulse .9s ease infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79,70,229,.42); }
  70%  { box-shadow: 0 0 0 15px rgba(79,70,229,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
}
.speak-meta { flex: 1; min-width: 0; }
.speak-ipa { font-family: var(--font-mono); font-size: 15px; color: var(--text-2); font-weight: 500; }
.speak-tag { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.speak-alt { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }

.phon-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.phon { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); }
.audio-btn {
  padding: 5px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: background .15s, color .15s, transform .12s;
}
.audio-btn:hover  { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.audio-btn:active { transform: scale(.94); }
.audio-btn.playing { background: var(--primary); color: #fff; border-color: var(--primary); }

.meaning-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.mb-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 7px;
}
.mb-cn { font-size: 16.5px; font-weight: 650; line-height: 1.5; color: var(--text); }
.mb-en { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }

.ex-item { padding: 10px 0; }
.ex-item + .ex-item { border-top: 1px dashed var(--border); }
.ex-en { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.ex-cn { font-size: 13px; color: var(--text-3); margin-top: 4px; line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
}
.chip-syn { background: var(--success-soft); border-color: transparent; color: #047857; }
.chip-ant { background: var(--danger-soft);  border-color: transparent; color: #b91c1c; }
.syn-row { display: flex; flex-direction: column; gap: 8px; }
.syn-label { font-size: 11px; color: var(--text-3); font-weight: 700; }
.syn-row > .syn-label + .chips { align-self: flex-start; }

/* 底部三档评级 */
.rate-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  margin-top: 18px;
  position: sticky; bottom: 0;
  padding: 12px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(244,245,247,0) 0%, var(--bg) 26%);
  z-index: 20;
}
.rate-btn {
  padding: 13px 6px; border-radius: 14px; color: #fff;
  font-size: 15.5px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .13s, box-shadow .18s, filter .18s;
}
.rate-btn:active { transform: scale(.96); }
.rb-sub { font-size: 10.5px; font-weight: 500; opacity: .85; }
.rate-forgot { background: linear-gradient(160deg, #ef4444, #dc2626); box-shadow: 0 5px 16px rgba(239,68,68,.28); }
.rate-fuzzy  { background: linear-gradient(160deg, #f59e0b, #d97706); box-shadow: 0 5px 16px rgba(245,158,11,.28); }
.rate-got    { background: linear-gradient(160deg, #10b981, #059669); box-shadow: 0 5px 16px rgba(16,185,129,.28); }

/* 完成页 */
.finish-box { text-align: center; padding: 12px 4px 4px; }
.finish-emoji { font-size: 46px; }
.finish-title { font-size: 21px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; }
.finish-desc  { font-size: 13.5px; color: var(--text-3); margin-top: 7px; line-height: 1.6; }
.finish-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.fs-item { background: var(--surface-2); border-radius: 12px; padding: 12px 4px; }
.fs-num { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.fs-lbl { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ========== 徽章 ========== */
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.badge-cet6    { background: #dbeafe; color: #1d4ed8; }
.badge-c1      { background: #ede9fe; color: #6d28d9; }
.badge-c2      { background: #fef3c7; color: #b45309; }
.badge-cet4    { background: #dcfce7; color: #15803d; }
.badge-new      { background: var(--surface-3); color: var(--text-3); }
.badge-learning { background: #dbeafe; color: #1d4ed8; }
.badge-review   { background: var(--warning-soft); color: #b45309; }
.badge-mastered { background: var(--success-soft); color: #047857; }

/* 记忆等级小竖条 */
.lvl-bar { display: inline-block; width: 3px; height: 11px; border-radius: 2px; background: var(--surface-3); margin-right: 2px; vertical-align: middle; }
.lvl-bar.on  { background: var(--primary-2); }
.lvl-bar.max { background: var(--success); }

/* ========== 测试 ========== */
.q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.q-mode-tag {
  padding: 5px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary);
}
.q-prompt {
  text-align: center; padding: 30px 16px 26px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.q-prompt-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.q-prompt-word  { font-size: 31px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; line-height: 1.25; }
.q-prompt-ipa   { font-family: var(--font-mono); font-size: 13.5px; color: var(--text-3); margin-top: 6px; }
.q-prompt-cn    { font-size: 17px; font-weight: 650; margin-top: 10px; }
.q-prompt-hint  { font-size: 12.5px; color: var(--text-3); margin-top: 12px; }

.opt-list { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.opt {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 15px; width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; font-size: 15px;
  transition: transform .13s, border-color .16s, background .16s, box-shadow .16s;
}
.opt:hover  { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.opt:active { transform: scale(.985); }
.opt-key {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: var(--surface-2); color: var(--text-3);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.opt-text { flex: 1; min-width: 0; font-weight: 550; }
.opt.correct { border-color: var(--success); background: var(--success-soft); }
.opt.correct .opt-key { background: var(--success); color: #fff; }
.opt.wrong   { border-color: var(--danger);  background: var(--danger-soft); }
.opt.wrong .opt-key { background: var(--danger); color: #fff; }
.opt.dim     { opacity: .5; }

/* 拼写输入 */
.spell-input {
  width: 100%; margin-top: 16px; padding: 15px 16px;
  border: 1.5px solid var(--border-2); border-radius: 14px;
  font-size: 18px; letter-spacing: .04em; text-align: center;
  outline: none; background: var(--surface);
  transition: border-color .16s, box-shadow .16s;
}
.spell-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.spell-input.correct { border-color: var(--success); background: var(--success-soft); color: #047857; }
.spell-input.wrong   { border-color: var(--danger);  background: var(--danger-soft);  color: #b91c1c; }

/* 结果反馈条 */
.q-feedback {
  margin-top: 14px; padding: 13px 15px; border-radius: 14px;
  font-size: 14px; font-weight: 650;
  display: flex; align-items: center; gap: 9px;
  animation: viewIn .2s ease;
}
.q-feedback.ok  { background: var(--success-soft); color: #047857; }
.q-feedback.bad { background: var(--danger-soft);  color: #b91c1c; }

/* 错题详解面板 */
.explain {
  margin-top: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  animation: viewIn .26s cubic-bezier(.22,.9,.3,1);
}
.ex-top {
  padding: 18px 18px 15px;
  background: linear-gradient(160deg, #fff5f5 0%, #fff 100%);
  border-bottom: 1px solid var(--border);
}
.ex-word { font-size: 27px; font-weight: 800; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-ipa  { font-family: var(--font-mono); font-size: 13.5px; color: var(--text-3); margin-top: 5px; }
.ex-cn   { font-size: 17px; font-weight: 650; margin-top: 8px; }
.ex-body { padding: 4px 18px 16px; }
.ex-sec  { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.ex-sec:last-of-type { border-bottom: none; }
.ex-sec-title {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 7px;
}
.ex-sec-body { font-size: 14px; line-height: 1.65; color: var(--text); }
.ex-sec-body .ex-cn-line { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.ex-conf-item { display: flex; gap: 8px; padding: 5px 0; font-size: 13.5px; line-height: 1.5; }
.ex-conf-word { font-weight: 700; color: var(--primary); flex: none; min-width: 96px; }
.ex-mnemonic {
  background: var(--primary-soft); border-radius: 11px;
  padding: 11px 13px; font-size: 13.5px; line-height: 1.6; color: #3730a3;
}
.ex-actions { padding: 0 18px 18px; display: flex; gap: 9px; }

/* 测试结果页 */
.result-box { text-align: center; padding: 14px 4px 4px; }
.result-pct { font-size: 52px; font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.result-pct-label { font-size: 12px; color: var(--text-3); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }

/* ========== 测试 v2（卡片式 · 5 模式） ========== */

/* 顶部模式切换 chips */
.q-chips { display: flex; gap: 6px; margin: 2px 0 12px; }
.q-chip {
  flex: 1; min-width: 0; padding: 8px 2px; border-radius: 11px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 12.5px; font-weight: 650; color: var(--text-2);
  text-align: center; transition: transform .13s, border-color .16s, background .16s, color .16s, box-shadow .16s;
}
.q-chip:hover { border-color: var(--border-2); }
.q-chip:active { transform: scale(.95); }
.q-chip.on {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
}
.q-chip .qc-sub { display: block; font-size: 9.5px; font-weight: 600; opacity: .72; margin-top: 1px; }

/* 顶部实时统计条 */
.q-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.qs-item { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 9px 4px; text-align: center; }
.qs-num { font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.qs-lbl { font-size: 10.5px; color: var(--text-3); margin-top: 2px; font-weight: 600; }

/* 大题卡片（听/拼写中央播放键等） */
.play-big {
  width: 96px; height: 96px; margin: 4px auto 0; border-radius: 50%;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff; font-size: 42px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(79,70,229,.34);
  transition: transform .14s, box-shadow .14s;
}
.play-big:hover { transform: scale(1.05); box-shadow: 0 12px 30px rgba(79,70,229,.44); }
.play-big:active { transform: scale(.94); }
.play-big.playing { animation: playPulse 1.1s ease infinite; }
@keyframes playPulse {
  0%   { box-shadow: 0 0 0 0 rgba(79,70,229,.38); }
  70%  { box-shadow: 0 0 0 20px rgba(79,70,229,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
}
.play-hint { font-size: 12.5px; color: var(--text-3); margin-top: 14px; text-align: center; }

/* 打字输入通用（沿用 spell-input 视觉，名字保留以兼容旧样式） */
.q-submit-row { margin-top: 12px; }
.q-input-caption { font-size: 11px; color: var(--text-3); font-weight: 650; margin: 16px 2px -10px; letter-spacing: .03em; }

/* 提交按钮在答完后保持可点击高度（防跳动） */
.q-actions { margin-top: 12px; }
.q-actions .btn + .btn { margin-top: 10px; }

/* 结果页错题清单 */
.wrong-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 2px;
}
.wrong-item + .wrong-item { border-top: 1px dashed var(--border); }
.wi-main { flex: 1; min-width: 0; }
.wi-word { font-size: 15.5px; font-weight: 750; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wi-ipa  { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.wi-cn   { font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.wi-action { flex: none; display: flex; align-items: center; gap: 6px; }
.wi-tag {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: var(--danger-soft); color: #b91c1c; white-space: nowrap;
}
.wi-tag.ok { background: var(--success-soft); color: #047857; }

/* ========== 速听 ========== */
.ls-card {
  background: linear-gradient(155deg, #1e1b4b 0%, #312e81 55%, #0e7490 140%);
  border-radius: var(--radius-lg); padding: 26px 20px 22px; color: #fff;
  box-shadow: 0 14px 40px rgba(49,46,129,.32);
  text-align: center;
}
.ls-progress-text { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.ls-word { font-size: 32px; font-weight: 800; letter-spacing: -.035em; margin-top: 14px; line-height: 1.2; word-break: break-word; }
.ls-ipa  { font-family: var(--font-mono); font-size: 14px; opacity: .78; margin-top: 7px; }
.ls-cn   { font-size: 15px; opacity: .92; margin-top: 10px; font-weight: 500; }
.ls-track { height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); margin-top: 20px; overflow: hidden; }
.ls-fill  { height: 100%; background: #fff; border-radius: 99px; transition: width .3s ease; }
.ls-count { font-size: 12.5px; opacity: .82; margin-top: 8px; font-variant-numeric: tabular-nums; }

.transport { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.tp-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.16);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 17px; transition: transform .14s, background .16s;
}
.tp-btn:hover  { background: rgba(255,255,255,.24); }
.tp-btn:active { transform: scale(.92); }
.tp-main {
  width: 62px; height: 62px; font-size: 22px;
  background: #fff; color: #312e81; border: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.tp-main:hover { background: #fff; }

.speed-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.speed-chip {
  padding: 7px 13px; border-radius: 10px;
  background: var(--surface-2); border: 1.5px solid transparent;
  font-size: 13px; font-weight: 650; color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, border-color .15s;
}
.speed-chip:hover { background: var(--surface-3); }
.speed-chip.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.ls-list { display: flex; flex-direction: column; gap: 2px; }
.ls-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px; width: 100%; text-align: left;
  transition: background .15s;
}
.ls-item:hover  { background: var(--surface-2); }
.ls-item.playing { background: var(--primary-soft); }
.ls-item-idx { width: 26px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.ls-item-word { font-size: 14.5px; font-weight: 650; }
.ls-item-cn { font-size: 12.5px; color: var(--text-3); }

/* ========== 设置 ========== */
.set-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.set-group-title {
  padding: 13px 16px 7px; font-size: 11px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .09em;
}
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 16px; border-top: 1px solid var(--border);
}
.set-row:first-of-type { border-top: none; }
.set-row-main { flex: 1; min-width: 0; }
.set-row-name { font-size: 14.5px; font-weight: 600; }
.set-row-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.set-row-ctl { flex: none; }

/* 开关 */
.switch {
  width: 46px; height: 27px; border-radius: 99px; padding: 0;
  background: var(--surface-3); position: relative;
  transition: background .22s cubic-bezier(.3,.8,.4,1);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .22s cubic-bezier(.3,.8,.4,1);
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(19px); }

/* ========== 账号与同步 ========== */
.txt-ctrl {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: var(--font);
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, background .15s;
}
.txt-ctrl:focus { border-color: var(--primary); background: var(--surface); }
.txt-ctrl::placeholder { color: var(--text-3); }

.acc-form { display: flex; flex-direction: column; gap: 10px; }
.acc-actions { display: flex; gap: 10px; }
.acc-actions .btn { flex: 1; }

/* 已登录状态条 */
.acc-id {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 13px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.acc-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff; font-weight: 750; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.acc-meta { flex: 1; min-width: 0; }
.acc-email {
  font-size: 14.5px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 同步状态点 */
.sync-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3); margin-right: 5px; vertical-align: 1px;
}
.sync-dot.ok      { background: var(--success); }
.sync-dot.pending { background: var(--warning); }
.sync-dot.err     { background: var(--danger); }
.sync-dot.busy    { background: var(--primary); animation: syncPulse 1s ease-in-out infinite; }
@keyframes syncPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.acc-note {
  font-size: 12px; line-height: 1.7; color: var(--text-3);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-top: 4px;
}
.acc-note.warn { background: var(--warning-soft); color: #8a5a06; }
.acc-note.err  { background: var(--danger-soft); color: #a32626; }

/* 分段选择器 */
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 11px; }
.seg-item {
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 650;
  color: var(--text-2); transition: background .16s, color .16s, box-shadow .16s;
}
.seg-item.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

select.select {
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border-2); background: var(--surface);
  font-size: 13.5px; font-weight: 600; outline: none; cursor: pointer;
}
select.select:focus { border-color: var(--primary); }
input.num-input {
  width: 72px; padding: 8px 11px; border-radius: 10px; text-align: center;
  border: 1px solid var(--border-2); background: var(--surface);
  font-size: 13.5px; font-weight: 650; outline: none;
}
input.num-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* 词库列表 */
.word-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; width: 100%; text-align: left;
  border-top: 1px solid var(--border);
  transition: background .15s;
}
.word-row:hover { background: var(--surface-2); }
.wr-main { flex: 1; min-width: 0; }
.wr-word { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.wr-cn { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-side { flex: none; text-align: right; font-size: 11.5px; color: var(--text-3); }

.filter-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px 4px; }
.filter-chip {
  padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover { background: var(--surface-3); }
.filter-chip.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ========== 统计 ========== */
.big-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.big-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}
.big-num { font-size: 28px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.big-lbl { font-size: 12px; color: var(--text-3); margin-top: 4px; font-weight: 600; }
.big-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.chart-box { padding: 4px 0 0; }
.chart-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; }
.cl-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); }

.lvl-dist { display: flex; align-items: flex-end; gap: 6px; height: 92px; margin-top: 10px; }
.lvl-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.lvl-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.lvl-bar-fill { width: 100%; border-radius: 5px 5px 2px 2px; min-height: 3px; transition: height .5s cubic-bezier(.22,.9,.3,1); }
.lvl-col-label { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.lvl-col-num { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.rec-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--border);
}
.rec-row:first-child { border-top: none; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-size: 14px; font-weight: 650; }
.rec-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ========== 搜索 ========== */
.search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,18,25,.36); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.search-panel {
  background: var(--bg); max-width: 720px; margin: 0 auto;
  height: 100%; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideDown .22s cubic-bezier(.22,.9,.3,1);
}
@keyframes slideDown { from { transform: translateY(-14px); opacity: .6; } to { transform: none; opacity: 1; } }
.search-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.search-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border-radius: 11px; padding: 10px 13px; color: var(--text-3);
  border: 1.5px solid transparent; transition: border-color .16s;
}
.search-input-wrap:focus-within { border-color: var(--primary); background: var(--surface); }
.search-input-wrap input { flex: 1; border: none; background: none; outline: none; font-size: 15px; color: var(--text); }
.search-results { flex: 1; overflow-y: auto; padding: 14px 16px 40px; }

.sr-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 15px; margin-bottom: 10px;
  text-align: left; width: 100%; display: block;
  transition: transform .13s, box-shadow .18s;
}
.sr-item:hover  { box-shadow: var(--shadow); }
.sr-item:active { transform: scale(.99); }
.sr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sr-word { font-size: 18.5px; font-weight: 750; letter-spacing: -.02em; }
.sr-phon { font-size: 12.5px; color: var(--text-3); font-family: var(--font-mono); }
.sr-cn { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.sr-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sr-status { font-size: 11.5px; color: var(--text-3); }

/* ========== Toast ========== */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 200;
  background: rgba(15,18,25,.93); color: #fff;
  padding: 11px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 550; max-width: 82vw; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn .26s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ========== 响应式 ========== */
@media (max-width: 400px) {
  .wc-word { font-size: 29px; }
  .hello { font-size: 24px; }
  .big-num { font-size: 24px; }
  .stat-num { font-size: 19px; }
  .rate-btn { font-size: 14.5px; }
}
@media (min-width: 720px) {
  .main { padding-left: 22px; padding-right: 22px; }
}
