/* =========================================================================
   词遇 · 设计系统（沿用「知径 · 手账笔记」语言）
   方格纸底 + 墨线描边 + 错位实影；便利贴、和纸胶带、荧光笔；楷体批注；侧栏是活页本索引标签。
   页面私有样式写在各模板 <style> 中，用页面前缀命名。
   ========================================================================= */
:root {
  --bg: #fbfaf5; --bg-2: #f4f1e6;
  --panel: #ffffff; --panel-2: #fdfcf7; --panel-3: #f4f1e6;
  --line: #ebe6d6; --line-2: #dcd5c0; --line-3: #b9b19a;
  --ink: #23283b; --edge: #23283b;
  --text: #23283b; --text-2: #434a62; --text-3: #626880; --text-4: #9599ab;
  --brand: #3d6af2; --brand-ink: #2a50cf; --brand-soft: #e3ecff;
  --red: #ef4f5f; --red-soft: #ffe6ea;
  --ok: #1a9a6a; --ok-soft: #dcf7e8; --warn: #c97a0a; --warn-soft: #fff4cc; --bad: #e5484d; --bad-soft: #ffe3e6; --info: #2f7de1; --info-soft: #e0efff;
  --hl-y: #fff27a; --hl-p: #ffc2dc; --hl-g: #b8f0d2; --hl-b: #bfe1ff; --hl-o: #ffd5a8; --hl-v: #dcd0ff;
  --note-y: #fff6b8; --note-p: #ffe0ea; --note-g: #dcf7e8; --note-b: #e0efff; --note-o: #ffe9d4; --note-v: #ece6ff;
  --c-blue: #3d6af2; --c-indigo: #5b5ff0; --c-violet: #8a5cf5; --c-pink: #e45a9a; --c-coral: #ef4f5f;
  --c-orange: #ff8a3d; --c-amber: #e8a30c; --c-green: #1fa774; --c-teal: #14a39a; --c-sky: #2a9de0; --c-slate: #64748b;
  --sh-0: 2px 2px 0 var(--ink); --sh-1: 3px 3px 0 var(--ink); --sh-1h: 4px 4px 0 var(--ink); --sh-2: 5px 5px 0 var(--ink); --sh-3: 8px 8px 0 var(--ink);
  --bd: 2px solid var(--ink); --bd-s: 1.5px solid var(--ink); --paper: #fffef8; --grid-a: rgba(90, 120, 170, .085);
  --font: "Noto Sans SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI", var(--font);
  --kai: "STKaiti", "KaiTi", "楷体", "Kaiti SC", serif;
  --en: "Charter", "Georgia", "Cambria", "Times New Roman", serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --side-w: 236px; --top-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid-a) 1px, transparent 1px), linear-gradient(90deg, var(--grid-a) 1px, transparent 1px);
  background-size: 24px 24px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--hl-y); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6cfb8; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
h1, h2, h3, h4 { font-weight: 900; margin: 0; letter-spacing: .3px; }
.kai { font-family: var(--kai); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.en { font-family: var(--en); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.grow { flex: 1; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- 框架 ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 0 14px 14px; background: #fff;
  border-right: var(--bd); box-shadow: 6px 0 0 -2px #efebdf; z-index: 30; overflow-y: auto; overflow-x: visible; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 16px 12px 4px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--hl-y); color: var(--ink);
  border: var(--bd); box-shadow: var(--sh-1); transform: rotate(-5deg); font-family: var(--kai); font-size: 24px; font-weight: 700; flex: none; }
.brand-name { font-weight: 900; font-size: 20px; letter-spacing: 3px; line-height: 1.15; }
.brand-sub { font-family: var(--kai); font-size: 13px; color: var(--text-3); }
.nav-group { margin-top: 4px; }
.nav-group-title { font-size: 12px; color: var(--text-3); padding: 2px 8px; }
.nav-group-title::before { content: "· "; }
.nav-item { --nc: var(--brand); --nb: var(--note-b); position: relative; display: flex; align-items: center; gap: 10px; padding: 2px 12px 2px 8px; margin: 0;
  border-radius: 12px 0 0 12px; font-weight: 700; font-size: 14.5px; color: var(--text-2); border: 2px solid transparent; border-right: 0; transition: background .2s, padding .2s; }
.nav-item .nav-ic { width: 27px; height: 27px; border-radius: 9px; display: grid; place-items: center; color: var(--nc); flex: none; transition: transform .25s var(--ease); }
.nav-item svg { width: 17px; height: 17px; stroke-width: 2.2; }
.nav-item:hover { background: #f6f3ea; padding-left: 11px; }
.nav-item:hover .nav-ic { transform: rotate(-8deg); }
.nav-item.active { background: var(--nb); color: var(--ink); border-color: var(--ink); margin-right: -2px; z-index: 2; font-weight: 800; }
.nav-item.active .nav-ic { background: #fff; border: var(--bd); }
.nav-badge { margin-left: auto; margin-right: 8px; font-size: 11.5px; padding: 0 7px; border-radius: 10px; background: var(--red); color: #fff; font-weight: 800; line-height: 19px; border: var(--bd-s); font-family: var(--num); }
.nav-item[data-key="home"] { --nc: var(--c-blue); --nb: var(--hl-y); }
.nav-item[data-key="library"] { --nc: var(--c-teal); --nb: var(--note-g); }
.nav-item[data-key="read"] { --nc: var(--c-indigo); --nb: var(--note-b); }
.nav-item[data-key="quiz"] { --nc: var(--c-orange); --nb: var(--note-o); }
.nav-item[data-key="review"] { --nc: var(--c-pink); --nb: var(--note-p); }
.nav-item[data-key="words"] { --nc: var(--c-violet); --nb: var(--note-v); }
.nav-item[data-key="wordbooks"] { --nc: var(--c-coral); --nb: var(--note-p); }
.nav-item[data-key="textbook"] { --nc: var(--c-green); --nb: var(--note-g); }
.nav-item[data-key="vtest"] { --nc: var(--c-sky); --nb: var(--note-b); }
.nav-item[data-key="polysemy"] { --nc: var(--c-amber); --nb: var(--note-y); }
.nav-item[data-key="cloze"] { --nc: var(--c-indigo); --nb: var(--note-v); }
.nav-item[data-key="dictation"] { --nc: var(--c-teal); --nb: var(--note-g); }
.nav-item[data-key="writing"] { --nc: var(--c-coral); --nb: var(--note-o); }
.nav-item[data-key="stats"] { --nc: var(--c-blue); --nb: var(--note-b); }
.nav-item[data-key="science"] { --nc: var(--c-violet); --nb: var(--note-v); }
.nav-item[data-key="settings"] { --nc: var(--c-slate); --nb: #eef0f4; }
.side-foot { margin: 12px 16px 0 0; padding: 9px 12px 8px; border-radius: 4px 4px 4px 18px; background: var(--note-y); box-shadow: 0 12px 18px -14px rgba(80, 60, 0, .6);
  transform: rotate(-1.5deg); font-family: var(--kai); font-size: 14px; color: var(--text-2); }
.side-foot .cd { font-family: var(--num); font-size: 28px; font-weight: 700; color: var(--red); line-height: 1.05; }
.sf-row { display: flex; align-items: baseline; gap: 6px; } .sf-sub { font-size: 12.5px; margin-top: 2px; }
.side-user { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0 4px; font-size: 13.5px; font-weight: 700; }
.side-user .av { width: 30px; height: 30px; border-radius: 50%; border: var(--bd); background: var(--hl-b); display: grid; place-items: center; font-weight: 900; }
.side-user .out { margin-left: auto; color: var(--text-3); }
.side-user .out svg { width: 16px; height: 16px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 25; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: rgba(251, 250, 245, .92); backdrop-filter: blur(6px); border-bottom: 2px dashed var(--line-2); }
.top-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.top-title h1 { font-size: 20px; white-space: nowrap; }
.top-title .crumb { font-family: var(--kai); font-size: 15px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { margin-left: auto; display: flex; align-items: center; gap: 9px; width: min(380px, 32vw); height: 40px; padding: 0 10px 0 14px; border-radius: 12px; background: #fff;
  border: var(--bd); color: var(--text-3); cursor: text; font-size: 14px; transition: box-shadow .15s, transform .15s; }
.top-search:hover { box-shadow: var(--sh-1); transform: translate(-1px, -1px); }
.top-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search svg { width: 17px; height: 17px; }
kbd { font-family: var(--mono); font-size: 11.5px; padding: 0 6px; border-radius: 6px; border: var(--bd-s); border-bottom-width: 2.5px; background: #fff; color: var(--text-2); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 30px 70px; width: 100%; max-width: 1560px; margin: 0 auto; }
.content > * { animation: fadeUp .55s var(--ease) backwards; }
.content > *:nth-child(2) { animation-delay: .05s; } .content > *:nth-child(3) { animation-delay: .1s; } .content > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
.demo-ribbon { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 8px; background: var(--hl-p);
  border: var(--bd-s); transform: rotate(-1.5deg); white-space: nowrap; }
.demo-ribbon svg { width: 14px; height: 14px; }

/* ---------- 标题 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .ph-main { flex: 1; min-width: 0; }
.page-head h2 { font-size: 30px; line-height: 1.3; letter-spacing: 1px; }
.page-head p { margin: 6px 0 0; color: var(--text-2); font-size: 15.5px; max-width: 900px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); background: var(--hl-y); padding: 3px 12px; transform: rotate(-1.5deg); font-weight: 800;
  font-size: 13px; letter-spacing: 1px; margin-bottom: 8px; border-radius: 2px;
  -webkit-mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent 0), repeating-linear-gradient(0deg, #000 0 3px, rgba(0,0,0,.85) 3px 5px); }
.eyebrow svg { width: 15px; height: 15px; }
.eyebrow.p { background: var(--hl-p); } .eyebrow.g { background: var(--hl-g); } .eyebrow.b { background: var(--hl-b); } .eyebrow.v { background: var(--hl-v); } .eyebrow.o { background: var(--hl-o); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; font-size: 20px; font-weight: 900; }
.section-title::after { content: ""; flex: 1; border-top: 2px dashed var(--line-2); }
.section-title .k { font-family: var(--kai); font-weight: 400; font-size: 15.5px; color: var(--text-3); order: 2; }
.section-title .n { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-size: 14px;
  background: var(--hl-y); border: var(--bd); transform: rotate(-6deg); }
.section-title > a, .section-title > .btn { order: 3; }
.hl-mark { background: linear-gradient(100deg, transparent 2%, var(--h, var(--hl-y)) 4%, var(--h, var(--hl-y)) 96%, transparent 98%) no-repeat 0 85% / 0 55%;
  animation: hlDraw .9s .3s var(--ease) forwards; padding: 0 4px; }
@keyframes hlDraw { to { background-size: 100% 55%; } }
.scrib { font-family: var(--kai); color: var(--red); font-size: 17px; transform: rotate(-3deg); display: inline-block; }

/* ---------- 卡片 ---------- */
.card { position: relative; background: #fff; border: var(--bd); border-radius: 16px; padding: 18px 20px; box-shadow: var(--sh-1); min-width: 0; }
.card.flat { box-shadow: none; }
.card.soft { border: 1.5px dashed var(--line-3); box-shadow: none; background: var(--panel-2); }
.card.hover { transition: transform .15s, box-shadow .15s; cursor: pointer; }
.card.hover:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-2); }
.card.taped::before, .card.taped::after { content: ""; position: absolute; top: -13px; width: 100px; height: 26px; z-index: 2;
  -webkit-mask: linear-gradient(90deg, transparent 0 4px, #000 4px calc(100% - 4px), transparent 0), repeating-linear-gradient(0deg, #000 0 3px, transparent 3px 5px); }
.card.taped::before { left: 36px; background: rgba(255, 194, 220, .9); transform: rotate(-4deg); }
.card.taped::after { right: 44px; width: 84px; background: rgba(184, 240, 210, .95); transform: rotate(5deg); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 19px; height: 19px; }
.card-head .sub { font-size: 13.5px; color: var(--text-3); }
.card-head .k { font-family: var(--kai); font-size: 15px; color: var(--text-3); }
.card-foot { border-top: 2px dashed var(--line-2); margin-top: 14px; padding-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note { position: relative; background: var(--note-y); padding: 22px 20px 18px; border-radius: 4px 4px 4px 22px; box-shadow: 0 16px 24px -16px rgba(80, 60, 0, .5); }
.note .pin { position: absolute; top: -9px; left: 50%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9aa8, var(--red)); box-shadow: 0 3px 4px rgba(0, 0, 0, .3); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- 指标：便利贴 ---------- */
.kpi { --nt: var(--note-y); position: relative; background: var(--nt); border-radius: 4px 4px 4px 22px; padding: 18px 18px 14px; box-shadow: 0 16px 22px -16px rgba(80, 60, 0, .55);
  transform: rotate(-1deg); transition: transform .25s var(--spring); min-width: 0; }
.kpi::after { content: ""; position: absolute; left: 50%; top: -9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9aa8, var(--red)); box-shadow: 0 3px 4px rgba(0, 0, 0, .25); }
.kpi:hover { transform: rotate(0) scale(1.03); }
.kpi:nth-child(4n+2) { --nt: var(--note-p); transform: rotate(1.2deg); }
.kpi:nth-child(4n+3) { --nt: var(--note-b); transform: rotate(-.6deg); }
.kpi:nth-child(4n+4) { --nt: var(--note-g); transform: rotate(1deg); }
.kpi .kl { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 800; color: var(--text-2); }
.kpi .kl svg { width: 16px; height: 16px; }
.kpi .kv { font-family: var(--num); font-size: 36px; font-weight: 700; line-height: 1.1; margin: 6px 0 2px; }
.kpi .kv small { font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 3px; font-family: var(--font); }
.kpi .kf { font-size: 12.5px; color: var(--text-2); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border: var(--bd); border-radius: 12px; background: #fff;
  color: var(--ink); font-weight: 800; font-size: 14.5px; box-shadow: var(--sh-0); cursor: pointer; white-space: nowrap; transition: transform .12s, box-shadow .12s, background .2s; }
.btn svg { width: 17px; height: 17px; stroke-width: 2.3; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--sh-1h); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: var(--sh-1); }
.btn.red { background: var(--red); color: #fff; box-shadow: var(--sh-1); }
.btn.yellow { background: var(--hl-y); } .btn.green { background: var(--hl-g); } .btn.pink { background: var(--hl-p); } .btn.blue { background: var(--hl-b); } .btn.violet { background: var(--hl-v); } .btn.orange { background: var(--hl-o); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hl-y); color: var(--ink); transform: none; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 10px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 8px; gap: 4px; box-shadow: var(--sh-0); }
.btn.xs svg { width: 14px; height: 14px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16.5px; border-radius: 14px; }
.btn.icon { width: 40px; padding: 0; } .btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- 标签 / 徽章 ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px; border: var(--bd-s); background: #fff;
  font-size: 12.5px; font-weight: 800; white-space: nowrap; line-height: 1; }
.tag svg { width: 13px; height: 13px; }
.tag.y { background: var(--hl-y); } .tag.p { background: var(--hl-p); } .tag.g { background: var(--hl-g); } .tag.b { background: var(--hl-b); } .tag.o { background: var(--hl-o); } .tag.v { background: var(--hl-v); }
.tag.line { border-style: dashed; color: var(--text-3); font-weight: 700; }
.tag.exam { height: 20px; padding: 0 6px; font-size: 11.5px; border-width: 1px; border-color: var(--line-3); color: var(--text-2); font-weight: 700; }
.st { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; border: var(--bd-s); white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); opacity: .6; }
.st.learn { background: var(--hl-y); } .st.choice { background: var(--hl-o); } .st.relearn { background: var(--hl-p); } .st.auto { background: var(--hl-g); }
.st.recall { background: var(--hl-v); } .st.pass { background: var(--hl-b); } .st.ok { background: #eef0f4; } .st.none { background: #fff; border-style: dashed; color: var(--text-3); }

/* 0~5 分刻度条：3 分选择题、5 分入骨架 */
.meter { position: relative; height: 12px; border: var(--bd); border-radius: 8px; background: #fff; overflow: hidden; min-width: 90px; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, 0) * 20%); background: var(--mc, var(--hl-y)); border-right: var(--bd); transition: width .6s var(--ease); }
.meter::before, .meter::after { content: ""; position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 2px dashed rgba(35, 40, 59, .45); z-index: 2; }
.meter::before { left: 60%; } .meter::after { left: calc(100% - 2px); border: 0; }
.meter.big { height: 18px; border-radius: 10px; }
.meter-lab { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-4); font-family: var(--num); margin-top: 2px; }
.bar { height: 10px; border-radius: 6px; background: var(--panel-3); border: var(--bd-s); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: var(--bc, var(--brand)); }
.bar > i + i { border-left: var(--bd-s); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field > .lab { font-weight: 800; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; height: 42px; border: var(--bd); border-radius: 12px; padding: 0 12px; background: #fff; outline: none; font-size: 14.5px; transition: box-shadow .15s; }
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.input:focus { box-shadow: 3px 3px 0 var(--brand); }
.seg { display: inline-flex; border: var(--bd); border-radius: 12px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg > a, .seg > button, .seg > label { padding: 6px 13px; font-weight: 800; font-size: 13.5px; border: 0; background: transparent; cursor: pointer; border-right: var(--bd-s); display: inline-flex; align-items: center; gap: 6px; }
.seg > *:last-child { border-right: 0; }
.seg > .on, .seg > label:has(input:checked) { background: var(--hl-y); }
.seg input { display: none; }
.seg .c { font-family: var(--num); font-size: 12px; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: var(--bd); border-radius: 999px; background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .15s, transform .15s; }
.chip:hover { transform: translateY(-1px); }
.chip:has(input:checked), .chip.on { background: var(--hl-y); box-shadow: var(--sh-0); }
.chip input { display: none; }
.switch { position: relative; width: 44px; height: 24px; border: var(--bd); border-radius: 20px; background: #fff; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: left .2s; }
input:checked + .switch { background: var(--hl-g); } input:checked + .switch::after { left: 22px; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--text-3); font-weight: 800; padding: 8px 10px; border-bottom: var(--bd); white-space: nowrap; background: var(--panel-2); }
.tbl td { padding: 9px 10px; border-bottom: 1.5px dashed var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fffdf2; }
.tbl .w { font-weight: 900; font-size: 15.5px; }
.tbl .ph { font-family: var(--en); color: var(--text-3); font-size: 13px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 0; border-bottom: var(--bd); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { position: relative; padding: 9px 18px 8px; font-weight: 800; border: 2px solid transparent; border-bottom: 0; border-radius: 12px 12px 0 0; margin-bottom: -2px; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 7px; }
.tabs a svg { width: 16px; height: 16px; }
.tabs a.on { background: #fff; border-color: var(--ink); color: var(--ink); }
.tabs a .c { font-family: var(--num); font-size: 12px; padding: 0 7px; border-radius: 10px; background: var(--red); color: #fff; border: var(--bd-s); }

/* ---------- 弹出 / 提示 ---------- */
.toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: #fff; border: var(--bd); border-radius: 14px; box-shadow: var(--sh-2); padding: 11px 16px; font-weight: 700; display: flex; align-items: center; gap: 10px;
  animation: toastIn .35s var(--spring); max-width: 420px; }
.toast.ok { background: var(--note-g); } .toast.bad { background: var(--note-p); } .toast.y { background: var(--note-y); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.modal-mask { position: fixed; inset: 0; background: rgba(35, 40, 59, .35); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(760px, 100%); max-height: 88vh; overflow: auto; background: #fff; border: var(--bd); border-radius: 18px; box-shadow: var(--sh-3); padding: 22px 24px; animation: toastIn .3s var(--spring); }
.modal h3 { font-size: 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cmdk .modal { width: min(620px, 100%); padding: 14px; }
.cmdk input { border: 0; outline: 0; font-size: 18px; width: 100%; padding: 8px 6px 12px; border-bottom: 2px dashed var(--line-2); }
.cmdk .res a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.cmdk .res a:hover, .cmdk .res a.on { background: var(--note-y); }
.cmdk .res b { font-size: 16px; } .cmdk .res .ph { font-family: var(--en); color: var(--text-3); font-size: 13px; } .cmdk .res .zh { color: var(--text-2); font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 34px 18px; color: var(--text-3); }
.empty .ic { width: 58px; height: 58px; border-radius: 16px; border: 2px dashed var(--line-3); display: grid; place-items: center; margin: 0 auto 12px; transform: rotate(-6deg); background: #fff; }
.empty .ic svg { width: 26px; height: 26px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.speak { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: var(--bd-s); background: #fff; cursor: pointer; vertical-align: middle; flex: none; }
.speak svg { width: 14px; height: 14px; }
.speak:hover { background: var(--hl-y); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 8px; border: var(--bd); border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: #fff; font-family: var(--num); }
.pager .on { background: var(--hl-y); }
.skel { background: linear-gradient(90deg, #f3f0e6 25%, #faf8f1 50%, #f3f0e6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 16px; height: 16px; border: 2.5px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart { width: 100%; height: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border: var(--bd-s); border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- 词条小卡（悬浮） ---------- */
.pop { position: absolute; z-index: 120; width: 300px; background: #fff; border: var(--bd); border-radius: 14px; box-shadow: var(--sh-2); padding: 12px 14px; font-size: 14px; animation: toastIn .2s var(--ease); }
.pop .pw { font-family: var(--en); font-size: 20px; font-weight: 700; }
.pop .pp { font-family: var(--en); color: var(--text-3); font-size: 13px; }

@media (max-width: 1280px) { .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; } .side { display: none; } .side.open { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 82vw); z-index: 80; box-shadow: 8px 0 30px rgba(20, 24, 40, .25); }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(20, 24, 40, .35); z-index: 70; }
  .side .side-close { position: absolute; top: 14px; right: 10px; }
  .g2, .g3 { grid-template-columns: 1fr; } .content { padding: 18px 16px 60px; } .top { padding: 0 16px; } .top-search { display: none; }
}
.only-mobile { display: none; } @media (max-width: 900px) { .only-mobile { display: inline-flex; } }

/* ---------- 界面风格切换（侧栏底部，三套主题共用） ---------- */
.side-theme { margin: 14px 16px 0 2px; }
.side-theme .st-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-4); letter-spacing: 1px; padding: 0 2px 6px; }
.side-theme .st-label svg { width: 13px; height: 13px; }
.st-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.st-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 5px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--text-3); font-size: 12px; font-weight: 700; cursor: pointer; font-family: var(--font); }
.st-opt:hover { border-color: var(--line-3); color: var(--text); }
.st-opt.on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.st-sw { display: block; width: 100%; max-width: 46px; height: 18px; border-radius: 5px; }
.st-sw-notebook { background: #fff27a; border: 1.5px solid #23283b; box-shadow: 2px 2px 0 #23283b; background-image: linear-gradient(transparent 8px, rgba(35, 40, 59, .25) 8px 9px, transparent 9px); }
.st-sw-bento { background: linear-gradient(90deg, #4f46e5 0 33%, #c6f24e 33% 66%, #ff6b57 66%); border-radius: 6px; }
.st-sw-minimal { background: #fff; border: 1px solid #ced3da; background-image: linear-gradient(#0b0d12, #0b0d12); background-size: 60% 2px; background-repeat: no-repeat; background-position: 6px 8px; }
.st-inline { display: inline-flex; gap: 6px; }
.st-inline .st-opt { flex-direction: row; padding: 5px 9px; gap: 6px; }
.st-inline .st-sw { width: 22px; height: 14px; }
.st-compact { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; border: var(--bd-s); border-radius: 12px; background: #fff; }
.st-compact .st-pal { width: 15px; height: 15px; color: var(--text-3); margin-right: 2px; }
.st-compact .st-opt { padding: 4px; border-radius: 8px; border-color: transparent; }
.st-compact .st-opt.on { border-color: var(--ink); }
.st-compact .st-sw { width: 26px; height: 16px; }
.top-search { margin-left: 0; }
.top .st-wrap { margin-left: auto; }
