/* ==========================================================================
   CET-4 英语学习站 · 设计系统
   ========================================================================== */
:root {
  --bg: #f4f6fb;
  --bg-soft: #eaeef7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #12182b;
  --ink-2: #3d4761;
  --ink-3: #6b7691;
  --line: #e2e7f0;
  --line-2: #cfd7e6;
  --brand: #3355f0;
  --brand-2: #6d4df6;
  --brand-ink: #ffffff;
  --brand-soft: #e9edff;
  --accent: #ff7a45;
  --accent-soft: #fff0e9;
  --ok: #12a76a;
  --ok-soft: #e3f8ef;
  --warn: #e8a300;
  --warn-soft: #fff6e0;
  --danger: #e5484d;
  --danger-soft: #ffeced;
  --shadow-s: 0 1px 2px rgba(18, 24, 43, .06), 0 1px 3px rgba(18, 24, 43, .04);
  --shadow-m: 0 4px 14px rgba(18, 24, 43, .07), 0 1px 3px rgba(18, 24, 43, .05);
  --shadow-l: 0 18px 48px rgba(18, 24, 43, .13);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --r-full: 999px;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --maxw: 1220px;
  --nav-h: 62px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c1020;
  --bg-soft: #121832;
  --surface: #161d38;
  --surface-2: #1c2444;
  --ink: #eef2ff;
  --ink-2: #c2cbe8;
  --ink-3: #8e9bc0;
  --line: #29325a;
  --line-2: #354070;
  --brand: #7d92ff;
  --brand-2: #a98bff;
  --brand-ink: #0b1024;
  --brand-soft: #1e2750;
  --accent: #ff9a6a;
  --accent-soft: #3a2418;
  --ok: #3ed39b;
  --ok-soft: #14342a;
  --warn: #ffc94d;
  --warn-soft: #362c12;
  --danger: #ff7b81;
  --danger-soft: #3a1c22;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-m: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-l: 0 22px 54px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.72rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .9em; }
::selection { background: var(--brand); color: var(--brand-ink); }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(12px, 3vw, 26px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-s);
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.nav { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button {
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 8px 13px; border-radius: var(--r-full); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav button:hover { background: var(--bg-soft); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; display: grid; place-items: center;
  font-size: 16px; transition: background .15s, border-color .15s, transform .1s;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.95); }

/* ---------- 布局 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: clamp(16px, 3vw, 30px) clamp(12px, 3vw, 26px) 90px; }
.page { display: none; animation: fade .28s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.hidden { display: none !important; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 18px; box-shadow: var(--shadow-s);
}
.card.pad-lg { padding: 24px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { margin: 0; }
.hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 92%, #000) 0%, var(--brand-2) 100%);
  color: #fff; border: 0; border-radius: var(--r-l); padding: clamp(22px, 4vw, 40px);
  position: relative; overflow: hidden; box-shadow: var(--shadow-m);
}
.hero::after {
  content: ""; position: absolute; inset: auto -60px -90px auto; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 62%); border-radius: 50%;
}
.hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,.9); max-width: 62ch; margin-bottom: 0; }
.hero .stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; position: relative; }
.hero .stat-row b { display: block; font-size: 1.6rem; line-height: 1.2; }
.hero .stat-row span { font-size: 12.5px; color: rgba(255,255,255,.82); }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: var(--r-m); cursor: pointer; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-s); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.big { padding: 13px 24px; font-size: 15.5px; border-radius: 14px; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- 表单控件 ---------- */
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border-radius: var(--r-m);
  border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search-box { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-box .input { padding-left: 38px; }
.search-box::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.seg { display: inline-flex; background: var(--bg-soft); border-radius: var(--r-m); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); transition: .15s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-s); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-full);
  background: var(--bg-soft); color: var(--ink-2); font-size: 12.5px; font-weight: 600;
}
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- 标签页 / 字母导航 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; padding: 10px 15px; cursor: pointer; font-weight: 600;
  color: var(--ink-3); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.letters { display: flex; flex-wrap: wrap; gap: 4px; }
.letters button {
  min-width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  padding: 0 7px;
}
.letters button:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.letters button.disabled { opacity: .32; cursor: default; }
.letters button.disabled:hover { background: var(--surface); color: var(--ink-2); border-color: var(--line); }

/* ---------- 单词列表 ---------- */
.word-list { display: grid; gap: 9px; }
.word-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 12px 15px; cursor: pointer; transition: .15s; display: flex; gap: 14px; align-items: center;
}
.word-item:hover { border-color: var(--brand); box-shadow: var(--shadow-m); transform: translateX(2px); }
.word-item .w-main { min-width: 0; flex: 1; }
.word-item .w-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.word-item .w-word { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
.word-item .w-ph { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.word-item .w-mean { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.word-item .w-side { display: flex; align-items: center; gap: 6px; flex: none; }
.star { border: 0; background: transparent; cursor: pointer; font-size: 17px; line-height: 1; padding: 2px; filter: grayscale(1); opacity: .45; }
.star.on { filter: none; opacity: 1; }
.pos-tag { font-style: italic; font-weight: 700; color: var(--brand); font-size: 12.5px; }

/* ---------- 单词详情 ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail-word { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.phon { font-family: var(--mono); color: var(--ink-3); font-size: 14px; }
.speak {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-full);
  padding: 5px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.speak:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.mean-line { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.mean-line:last-child { border-bottom: 0; }
.mean-line .pos-tag { flex: none; min-width: 44px; }
.sent { padding: 10px 0 10px 14px; border-left: 3px solid var(--brand-soft); margin-bottom: 8px; }
.sent .en { font-weight: 500; }
.sent .cn { color: var(--ink-3); font-size: 13.5px; }
.sent.mark { background: var(--brand-soft); border-radius: 0 var(--r-s) var(--r-s) 0; }
mark { background: color-mix(in srgb, var(--warn) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- 闪卡 ---------- */
.flash-wrap { max-width: 640px; margin: 0 auto; }
.flashcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  min-height: 340px; padding: 30px; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; box-shadow: var(--shadow-m); cursor: pointer;
  position: relative; transition: transform .18s, box-shadow .18s;
}
.flashcard:hover { box-shadow: var(--shadow-l); }
.flashcard:active { transform: scale(.995); }
.flashcard .fc-word { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 800; letter-spacing: -.03em; }
.flashcard .fc-phon { font-family: var(--mono); color: var(--ink-3); margin-top: 8px; }
.flashcard .fc-hint { position: absolute; bottom: 14px; font-size: 12px; color: var(--ink-3); }
.flashcard .fc-answer { margin-top: 20px; animation: fade .25s; }
.flashcard .fc-answer .pos { font-style: italic; color: var(--brand); font-weight: 700; }
.flashcard .fc-answer .cn { font-size: 1.1rem; margin-top: 4px; }
progress { width: 100%; height: 7px; border-radius: var(--r-full); overflow: hidden; appearance: none; border: 0; background: var(--bg-soft); }
progress::-webkit-progress-bar { background: var(--bg-soft); border-radius: var(--r-full); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: var(--r-full); }
progress::-moz-progress-bar { background: var(--brand); }

/* ---------- 测验 ---------- */
.quiz-q { font-size: 1.13rem; font-weight: 600; line-height: 1.7; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-m);
  padding: 13px 16px; cursor: pointer; transition: .15s; margin-bottom: 9px; font-size: 15px;
}
.opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.opt .key {
  width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: var(--ink-2);
}
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .key { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt.wrong .key { background: var(--danger); color: #fff; }
.opt:disabled { cursor: default; }
.feedback { border-radius: var(--r-m); padding: 13px 16px; margin-top: 12px; font-size: 14px; }
.feedback.ok { background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 72%, var(--ink)); }
.feedback.bad { background: var(--danger-soft); color: color-mix(in srgb, var(--danger) 72%, var(--ink)); }
.result-ring { display: grid; place-items: center; }
.result-score { font-size: 3rem; font-weight: 800; line-height: 1; }

/* ---------- 语法 ---------- */
.gram-layout { display: grid; grid-template-columns: 272px 1fr; gap: 20px; align-items: start; }
.gram-side { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 34px); overflow: auto; }
.gram-side .g-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 8px 11px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45;
  border-left: 3px solid transparent;
}
.gram-side .g-item:hover { background: var(--bg-soft); }
.gram-side .g-item[aria-current="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; border-left-color: var(--brand); }
.gram-side .g-group { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 12px 11px 5px; }
.rule { border: 1px solid var(--line); border-radius: var(--r-m); padding: 13px 15px; margin-bottom: 10px; background: var(--surface-2); }
.rule .rn { font-weight: 700; color: var(--ink); }
.formula {
  font-family: var(--mono); background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 82%, var(--ink));
  padding: 8px 12px; border-radius: var(--r-s); margin: 8px 0; font-size: 13px; overflow-x: auto; white-space: pre-wrap;
}
.ex { padding: 9px 0 9px 13px; border-left: 3px solid var(--line-2); margin-bottom: 7px; }
.ex .en { font-weight: 500; }
.ex .cn { color: var(--ink-3); font-size: 13.5px; }
.ex .note { font-size: 12.5px; color: var(--accent); margin-top: 3px; }
.pitfall { display: flex; gap: 9px; padding: 8px 0; font-size: 14px; color: var(--ink-2); }
.pitfall::before { content: "⚠"; flex: none; }
.tip { display: flex; gap: 9px; padding: 8px 0; font-size: 14px; color: var(--ink-2); }
.tip::before { content: "💡"; flex: none; }
.toc-mobile { display: none; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tbl th { background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--ink-2); position: sticky; top: 0; }
table.tbl tr:hover td { background: var(--surface-2); }
.table-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--r-m); }

/* ---------- 测验/考试文章 ---------- */
.passage { line-height: 1.9; font-size: 15.5px; }
.passage p { margin-bottom: 14px; text-indent: 1.6em; }
.blank { display: inline-block; min-width: 78px; border-bottom: 2px solid var(--brand); text-align: center; font-weight: 700; color: var(--brand); }
.blank.filled { color: var(--ink); border-bottom-style: solid; }

/* ---------- 空状态 / 骨架 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .em-icon { font-size: 40px; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--line) 37%, var(--bg-soft) 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: var(--r-s); height: 14px; margin-bottom: 9px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 统计条 ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; }
.stat .v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat .k { font-size: 12.5px; color: var(--ink-3); }
.bar { height: 9px; border-radius: var(--r-full); background: var(--bg-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s; }
.bar.ok > i { background: linear-gradient(90deg, var(--ok), #4fd6a0); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(9, 13, 28, .55); backdrop-filter: blur(3px);
  z-index: 100; display: grid; place-items: center; padding: 18px; animation: fade .18s;
}
.modal {
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-l);
  width: min(720px, 100%); max-height: 88vh; overflow: auto; padding: 24px; position: relative;
  border: 1px solid var(--line);
}
.modal .x { position: absolute; top: 12px; right: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 600; z-index: 200; box-shadow: var(--shadow-l); animation: toastIn .22s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 底部 ---------- */
.footer { border-top: 1px solid var(--line); padding: 22px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .gram-layout { grid-template-columns: 1fr; }
  .gram-side { position: static; max-height: none; display: none; }
  .gram-side.open { display: block; }
  .toc-mobile { display: inline-flex; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .brand small { display: none; }
  .nav { margin-left: 0; }
  .nav button { padding: 7px 10px; font-size: 13px; }
  .word-item { padding: 11px 12px; gap: 10px; }
  .flashcard { min-height: 300px; padding: 22px; }
  .wrap { padding-bottom: 60px; }
}
@media print {
  .topbar, .nav, .btn, .icon-btn, .footer { display: none !important; }
}


/* ---------- 卡片上的快速记忆法 ---------- */
.fc-mnem {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-m, 12px);
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  border: 1px dashed color-mix(in srgb, var(--brand) 34%, transparent);
  text-align: left;
  cursor: default;
}
.fc-mnem-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 6px;
}
.fc-mnem-body { font-size: 14px; line-height: 1.65; }
.fc-mnem-loading { color: var(--muted, #888); font-size: 13px; }
.fc-mnem-btn { margin-top: 2px; }
.fc-mnem.has { border-style: solid; }


/* ---------- 小喇叭按钮（例句、短语共用） ---------- */
.speak-mini {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  padding: 0;
  border: 1px solid var(--line, #e3e6ee);
  border-radius: 8px;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background .15s, border-color .15s;
}
.speak-mini:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); border-color: var(--brand); }
.speak-mini.wide { width: auto; height: 32px; padding: 0 12px; font-size: 13px; }
.speak-mini.wide::after { content: " 朗读"; }
.speak-mini.in-chip {
  width: 20px; height: 20px;
  margin-left: 4px;
  font-size: 10px;
  border-radius: 6px;
  border-color: transparent;
}

/* 例句那行：文字和喇叭并排 */
.sent-head { display: flex; align-items: flex-start; gap: 8px; }
.sent-head .en { flex: 1; min-width: 0; }

.phrase-chip { display: inline-flex; align-items: center; gap: 2px; }

/* ---------- 拼写模式 ---------- */
.spell-card { text-align: center; padding: 30px 24px; cursor: default; }
.spell-ask { font-size: 13px; color: var(--muted, #888); margin-bottom: 14px; }
.spell-mean { font-size: 1.35rem; line-height: 1.7; font-weight: 600; }
.spell-mean .pos { color: var(--brand); font-weight: 500; }
.spell-input {
  width: min(340px, 100%);
  margin: 22px auto 0;
  display: block;
  height: 46px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: .5px;
}
.spell-input.wrong { border-color: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.14); }
.spell-input:disabled { background: color-mix(in srgb, var(--muted, #888) 8%, transparent); }

.spell-fb { margin-top: 16px; min-height: 24px; }
.spell-tip { font-size: 13px; color: var(--muted, #888); }
.spell-tip.bad { color: #b45309; }
.spell-ok { font-size: 1rem; font-weight: 600; color: #16a34a; }
.spell-bad { font-size: 1rem; font-weight: 600; color: #e5484d; margin-bottom: 8px; }
.spell-yours { font-size: 12.5px; color: var(--muted, #888); margin-top: 8px; }

/* 逐字母对比：对的绿、错的红、少了的虚框 */
.spell-diff {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 4px 0;
}
.spell-diff .ch {
  display: inline-grid;
  place-items: center;
  min-width: 26px; height: 34px;
  padding: 0 4px;
  border-radius: 7px;
  font-size: 1.15rem;
  font-weight: 600;
  font-family: ui-monospace, Consolas, monospace;
}
.spell-diff .ch.ok { background: rgba(22,163,74,.14); color: #15803d; }
.spell-diff .ch.bad { background: rgba(229,72,77,.14); color: #b91c1c; }
.spell-diff .ch.miss { background: transparent; border: 1px dashed #cbd5e1; }

.spell-reveal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, #e3e6ee); }
.spell-word {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 1.6rem; font-weight: 700; letter-spacing: .5px;
}

@media (max-width: 640px) {
  .spell-card { padding: 22px 14px; }
  .spell-mean { font-size: 1.15rem; }
  .spell-diff .ch { min-width: 22px; height: 30px; font-size: 1rem; }
  .spell-word { font-size: 1.35rem; }
}


/* ---------- 柱状图（HTML 版） ---------- */
.barchart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 18px 4px 0;
}
.bc-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bc-val {
  flex: 0 0 auto;
  height: 16px;
  font-size: 11.5px;
  line-height: 16px;
  color: var(--brand);
  font-weight: 600;
}
.bc-track {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bc-bar {
  width: 62%;
  max-width: 46px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--brand) 55%, transparent),
    var(--brand-2, var(--brand)));
  transition: height .3s;
}
.bc-bar.zero { background: var(--line, #e3e6ee); border-radius: 2px; }
.bc-label {
  flex: 0 0 auto;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted, #888);
  white-space: nowrap;
}


/* ---------- 朗读时显示的"实际用了哪个音色" ---------- */
.voice-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-size: 11.5px;
  vertical-align: middle;
  white-space: nowrap;
  animation: vt-in .18s ease;
}
@keyframes vt-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; } }
