:root {
  --ink: #15171c;
  --ink-2: #4a4f5c;
  --ink-3: #8a90a0;
  --line: rgba(20, 24, 40, .08);
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --accent: #3b5bdb;
  --accent-rgb: 59 91 219;
  --accent-dark: #2d3a8c;
  --accent-light: #6d86f0;
  --accent-soft: rgb(var(--accent-rgb) / .10);
  --good: #1f9d6b;
  --good-soft: rgba(31, 157, 107, .12);
  --bad: #e0464e;
  --bad-soft: rgba(224, 70, 78, .10);
  --warn: #d98a1c;
  --radius: 22px;
  --shadow: 0 1px 1px rgba(20, 24, 40, .03), 0 8px 24px -8px rgba(30, 40, 80, .12), 0 24px 60px -24px rgba(30, 40, 80, .14);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino", Georgia, "Songti SC", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: #f4f6fb;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- 背景光斑 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(160deg, #fbfcff 0%, #f1f3fa 55%, #f7f3f1 100%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.bg .b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #c9d6ff; }
.bg .b2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 8vmax; background: #e6d9ff; animation-delay: -8s; }
.bg .b3 { width: 40vmax; height: 40vmax; left: 10vmax; bottom: -18vmax; background: #ffe2d4; animation-delay: -14s; opacity: .45; }
.bg .b4 { width: 26vmax; height: 26vmax; right: 12vmax; bottom: 6vmax; background: #cfeee6; animation-delay: -4s; opacity: .45; }
@keyframes drift { to { transform: translate(4vmax, 3vmax) scale(1.08); } }

/* ---------- 玻璃 ---------- */
.glass, .glass-chip {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.glass { border-radius: var(--radius); }
.glass-chip { border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink-2); box-shadow: 0 4px 14px -6px rgba(30, 40, 80, .15), inset 0 1px 0 #fff; }

/* ---------- 布局 ---------- */
#shell { max-width: 560px; margin: 0 auto; padding: 22px 16px 120px; }
.view { animation: fadeUp .45s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.top { display: flex; align-items: flex-end; justify-content: space-between; margin: 18px 4px 20px; }
.top h1 { margin: 2px 0 0; font: 600 32px/1.1 var(--serif); letter-spacing: -.01em; }
.eyebrow { margin: 0; font-size: 13px; color: var(--ink-3); letter-spacing: .02em; }
.streak span { font-weight: 600; color: var(--ink); }

/* hero */
.hero { display: flex; align-items: center; gap: 22px; padding: 22px; }
.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: rgba(20, 24, 40, .06); }
.ring-bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s var(--ease); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font: 600 34px/1 var(--serif); }
.ring-text span { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.ring-text em { font-style: normal; }
.ring-text small { font-size: 11px; color: var(--ink-3); margin-top: 6px; letter-spacing: .06em; }
.hero-stats { flex: 1; display: grid; gap: 14px; }
.hero-stats div { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.hero-stats div:last-child { border: 0; padding: 0; }
.hero-stats b { font: 600 22px var(--serif); }
.hero-stats span { font-size: 13px; color: var(--ink-3); }

/* actions */
.actions { display: grid; gap: 12px; margin: 14px 0; }
.action { display: flex; align-items: center; gap: 14px; padding: 18px; text-align: left; transition: transform .25s var(--ease), box-shadow .25s; }
.action:hover { transform: translateY(-2px); }
.action:active { transform: scale(.98); }
.a-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
#btn-review .a-icon { background: rgba(217, 138, 28, .12); color: var(--warn); }
.a-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.a-main b { font-size: 17px; font-weight: 600; }
.a-main small { font-size: 13px; color: var(--ink-3); }
.a-arrow { font-size: 26px; color: var(--ink-3); line-height: 1; }
.badge { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--warn); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.badge.zero { background: rgba(20, 24, 40, .08); color: var(--ink-3); }

/* forecast */
.curve, .card-pad { padding: 18px 20px; margin-bottom: 14px; }
.curve-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.curve-head b { font-size: 15px; font-weight: 600; }
.curve-head small { font-size: 12px; color: var(--ink-3); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 120px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar i { width: 100%; max-width: 28px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, rgb(var(--accent-rgb) / .55), rgb(var(--accent-rgb) / .18)); min-height: 3px; transition: height .8s var(--ease); }
.bar.today i { background: linear-gradient(180deg, var(--warn), rgba(217, 138, 28, .3)); }
.bar em { font-style: normal; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar small { font-size: 11px; color: var(--ink-3); }

/* tabbar */
.tabbar { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 999px; z-index: 10; }
.tabbar button { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; color: var(--ink-3); font-size: 14px; transition: all .3s var(--ease); }
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button.on { background: rgba(255, 255, 255, .95); color: var(--ink); box-shadow: 0 4px 12px -4px rgba(30, 40, 80, .2); }
.tabbar button:not(.on) span { display: none; }

/* ---------- 词库 ---------- */
.search { display: flex; align-items: center; gap: 10px; padding: 0 16px; margin-bottom: 12px; }
.search svg { color: var(--ink-3); flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: 16px; padding: 15px 0; color: var(--ink); }
.seg { display: flex; padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px 0; border-radius: 10px; font-size: 13px; color: var(--ink-2); transition: all .25s; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px -2px rgba(30, 40, 80, .15); }
.dict-list { display: grid; gap: 8px; }
.d-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .8); text-align: left; transition: background .2s, transform .2s; width: 100%; }
.d-item:hover { background: rgba(255, 255, 255, .8); }
.d-item .w { font: 600 17px var(--serif); min-width: 0; }
.d-item .m { flex: 1; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(20, 24, 40, .12); flex: none; }
.dot.s1 { background: #f3b1b4; } .dot.s2 { background: #f5c98a; } .dot.s3 { background: #b8c8f5; } .dot.s4 { background: #7c95e8; } .dot.m { background: var(--good); }
.more { text-align: center; color: var(--ink-3); font-size: 13px; padding: 14px; }

/* ---------- 统计 ---------- */
.progress-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-line b { font: 600 22px var(--serif); }
.pbar { height: 6px; border-radius: 3px; background: rgba(20, 24, 40, .07); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--accent-light), var(--accent)); transition: width .6s var(--ease); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; text-align: center; }
.grid4 b { display: block; font: 600 22px var(--serif); }
.grid4 span { font-size: 12px; color: var(--ink-3); }
.stages { display: grid; gap: 9px; }
.st-row { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.st-row .pbar { height: 8px; }
.st-row em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.settings .row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.settings .row:last-of-type { border: 0; }
.settings .row > span:first-child { display: flex; flex-direction: column; font-size: 15px; }
.settings small { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 4px; background: rgba(20, 24, 40, .05); border-radius: 12px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 9px; font-size: 18px; }
.stepper button:hover { background: #fff; }
.stepper b { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.pill { padding: 8px 16px; border-radius: 999px; background: rgba(20, 24, 40, .06); font-size: 13px; transition: background .2s; }
.pill:hover { background: rgba(20, 24, 40, .1); }
.pill.danger { color: var(--bad); background: var(--bad-soft); }
.btns { display: flex; gap: 8px; }
.switch { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: rgba(20, 24, 40, .14); position: relative; cursor: pointer; transition: background .25s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .3s var(--ease); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- 学习 / 复习层 ---------- */
.stage { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: rgba(246, 247, 252, .62); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); animation: fadeIn .3s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.stage-top { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 620px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 8px; }
.icon-btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.stage-progress { flex: 1; display: flex; align-items: center; gap: 10px; }
.stage-progress .pbar { flex: 1; }
.stage-progress small { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mode-chip { flex: none; }
.stage-body { flex: 1; overflow-y: auto; width: 100%; max-width: 620px; margin: 0 auto; padding: 8px 16px 32px; display: flex; flex-direction: column; }

.wcard { padding: 30px 26px 24px; animation: cardIn .45s var(--ease); }
.wcard.out-l { animation: cardOutL .22s ease-in forwards; }
.wcard.out-r { animation: cardOutR .22s ease-in forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes cardOutL { to { opacity: 0; transform: translateX(-30px); } }
@keyframes cardOutR { to { opacity: 0; transform: translateX(30px); } }
.w-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.w-word { font: 600 44px/1.05 var(--serif); letter-spacing: -.015em; margin: 0; word-break: break-word; }
.w-ph { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.speak { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; transition: transform .2s; }
.speak:hover { transform: scale(1.06); }
.speak.playing { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgb(var(--accent-rgb) / .08); } }
.speak svg { width: 18px; height: 18px; }
.w-tag { font-size: 11px; color: var(--ink-3); background: rgba(20, 24, 40, .05); border-radius: 6px; padding: 3px 7px; white-space: nowrap; }
.w-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.w-sec h4 { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.def { margin-bottom: 12px; }
.def:last-child { margin-bottom: 0; }
.def .zh { font-size: 18px; font-weight: 600; line-height: 1.45; }
.def .pos { display: inline-block; font: italic 500 14px var(--serif); color: var(--accent); margin-right: 8px; }
.def .en { font-size: 14px; color: var(--ink-3); line-height: 1.5; margin-top: 2px; }
.syn { display: flex; flex-wrap: wrap; gap: 6px; }
.syn span { font: 500 14px var(--serif); padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
/* 机经词（APP.synBig）：等价词放大，紧跟在释义下面 */
.sec-syn.big .syn { gap: 8px; }
.sec-syn.big .syn span { font: 600 20px/1.3 var(--serif); padding: 7px 14px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); border-color: rgb(var(--accent-rgb) / .25); }
.ex-en { font: 17px/1.55 var(--serif); color: var(--ink); }
.ex-en mark { background: linear-gradient(transparent 60%, rgb(var(--accent-rgb) / .18) 60%); color: inherit; font-weight: 600; }
.ex-zh { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-top: 6px; }

.controls { display: flex; gap: 10px; margin-top: 16px; }
.btn { flex: 1; padding: 16px; border-radius: 18px; font-size: 16px; font-weight: 600; transition: transform .15s, background .2s, box-shadow .2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -10px rgba(20, 24, 40, .5); }
.btn.primary:hover { background: #2a2e38; }
.btn.ghost { background: var(--glass-strong); border: 1px solid var(--glass-edge); color: var(--ink-2); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.btn.narrow { flex: 0 0 auto; padding: 16px 18px; }
.btn kbd { font: 11px var(--sans); opacity: .5; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.hint { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 14px; }
.hint kbd { font-family: var(--sans); border: 1px solid var(--line); background: rgba(255, 255, 255, .7); border-radius: 4px; padding: 0 5px; }

/* quiz */
.q-card { padding: 40px 24px 30px; text-align: center; animation: cardIn .4s var(--ease); }
.q-card .w-word { font-size: 48px; }
.q-card .w-ph { justify-content: center; }
.q-stage { display: inline-block; margin-bottom: 18px; font-size: 11px; letter-spacing: .1em; color: var(--ink-3); }
.opts { display: grid; gap: 10px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 15px; line-height: 1.45; transition: transform .2s var(--ease), background .25s, border-color .25s; animation: cardIn .4s var(--ease) backwards; }
.opt:nth-child(2) { animation-delay: .04s; } .opt:nth-child(3) { animation-delay: .08s; } .opt:nth-child(4) { animation-delay: .12s; }
.opt:hover:not(:disabled) { transform: translateX(3px); background: #fff; }
.opt .k { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12px; color: var(--ink-3); background: rgba(20, 24, 40, .05); }
.opt .t { flex: 1; }
.opt .t i { font: italic 500 13px var(--serif); color: var(--ink-3); font-style: italic; margin-right: 6px; }
.opt:disabled { cursor: default; }
.opt.correct { background: var(--good-soft); border-color: rgba(31, 157, 107, .45); }
.opt.correct .k { background: var(--good); color: #fff; }
.opt.wrong { background: var(--bad-soft); border-color: rgba(224, 70, 78, .4); animation: shake .4s; }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt.dim { opacity: .45; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.dunno { margin-top: 12px; align-self: center; font-size: 13px; color: var(--ink-3); padding: 8px 14px; border-radius: 999px; }
.dunno:hover { background: rgba(20, 24, 40, .05); }
.reveal { margin-top: 14px; padding: 20px 22px; animation: cardIn .35s var(--ease); }
.reveal .def .zh { font-size: 16px; }

/* done */
.done { margin: auto 0; padding: 40px 26px; text-align: center; animation: cardIn .5s var(--ease); }
.done .big { font: 600 56px/1 var(--serif); }
.done h2 { margin: 16px 0 6px; font: 600 24px var(--serif); }
.done p { color: var(--ink-2); margin: 0 0 6px; font-size: 14px; line-height: 1.6; }
.done .controls { margin-top: 26px; }
.check { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.check svg { width: 30px; height: 30px; stroke-width: 2.2; }

/* toast */
.toast { position: fixed; left: 50%; top: 24px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 50; padding: 10px 18px; border-radius: 999px; background: rgba(20, 24, 40, .86); color: #fff; font-size: 14px; transition: all .35s var(--ease); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modal for dict detail */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(20, 24, 40, .12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .25s; }
.sheet { width: 100%; max-width: 620px; max-height: 86vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 0 0 env(safe-area-inset-bottom); animation: sheetUp .4s var(--ease); background: rgba(255, 255, 255, .82); }
.sheet .wcard { animation: none; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 26px; } }

@media (max-width: 420px) {
  .hero { gap: 16px; padding: 18px; }
  .ring-wrap { width: 112px; height: 112px; }
  .w-word { font-size: 38px; }
  .q-card .w-word { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (hover: none) { .btn kbd, .hint kbd, .dunno kbd { display: none !important; } }

/* ---------- 三档记忆 ---------- */
.grades { gap: 8px; }
.grade { flex-direction: column; gap: 3px; padding: 13px 8px; border: 1px solid transparent; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.grade small { font-size: 11px; font-weight: 500; opacity: .7; }
.grade .g-label { display: flex; align-items: center; gap: 6px; }
.g-know { background: rgba(31, 157, 107, .10); color: #157a53; }
.g-fuzzy { background: rgba(217, 138, 28, .12); color: #a7650c; }
.g-forgot { background: rgba(224, 70, 78, .10); color: #c0343c; }
.grade:hover { filter: brightness(.97); transform: translateY(-1px); }
.grade.picked { border-color: currentColor; }
.grades .narrow { padding: 13px 16px; font-size: 20px; }
.again-tag { align-self: center; margin-bottom: 10px; font-size: 12px; color: var(--bad); background: var(--bad-soft); padding: 5px 12px; border-radius: 999px; animation: cardIn .3s var(--ease); }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 6px; }
.tally div { border-radius: 14px; padding: 10px 0; }
.tally b { display: block; font: 600 22px var(--serif); }
.tally span { font-size: 12px; }
@media (max-width: 420px) { .grade { padding: 12px 4px; font-size: 15px; } .grade kbd { display: none; } }

/* ---------- v2：先回想 / 题型 / 练习 / 日历 / 设置 ---------- */
.notice { margin: 12px 0 0; padding: 12px 16px; border-radius: 16px; font-size: 13px; line-height: 1.5; color: #8a5a10; background: rgba(217, 138, 28, .1); border: 1px solid rgba(217, 138, 28, .25); }
.sec-title { margin: 22px 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; }
.drills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.drill { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; text-align: left; position: relative; transition: transform .25s var(--ease); min-width: 0; }
.drill:hover { transform: translateY(-2px); }
.drill:active { transform: scale(.97); }
.drill b { font-size: 15px; }
.drill small { font-size: 11px; color: var(--ink-3); }
.drill em { font: italic 600 20px var(--serif); color: var(--accent); margin-top: 8px; font-style: normal; font-variant-numeric: tabular-nums; }

.w-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.tool-btn { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); transition: background .2s, color .2s; }
.tool-btn:hover { background: rgba(20, 24, 40, .06); color: var(--ink); }
.tool-btn svg { width: 16px; height: 16px; }
.speak.mini { width: 24px; height: 24px; display: inline-grid; vertical-align: middle; margin-left: 4px; }
.speak.mini svg { width: 13px; height: 13px; }
.w-sec h4 { display: flex; align-items: center; }
.reveal-btn { display: block; width: 100%; margin-top: 22px; padding: 30px 16px; border-radius: 16px; border: 1.5px dashed rgba(20, 24, 40, .14); color: var(--ink-3); font-size: 14px; transition: all .25s; }
.reveal-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.reveal-btn kbd, .hint-btn kbd { font: 11px var(--sans); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .6; }
.wcard.unfold .w-sec { animation: cardIn .4s var(--ease) backwards; }
.wcard.unfold .w-sec:nth-of-type(2) { animation-delay: .05s; } .wcard.unfold .w-sec:nth-of-type(3) { animation-delay: .1s; } .wcard.unfold .w-sec:nth-of-type(4) { animation-delay: .15s; }
.note { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 14px/1.5 var(--sans); color: var(--ink); background: rgba(255, 255, 255, .55); outline: none; transition: border-color .2s, background .2s; overflow: hidden; }
.note:focus { border-color: rgb(var(--accent-rgb) / .4); background: #fff; }

.q-stage.is-ok { color: var(--good); font-weight: 600; }
.q-stage.is-slow { color: var(--warn); font-weight: 600; }
.q-stage.is-bad { color: var(--bad); font-weight: 600; }
.q-sub { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.q-cloze { font: 20px/1.6 var(--serif); text-align: left; }
.blank { display: inline-block; min-width: 90px; border-bottom: 2px solid var(--accent); color: transparent; }
.hint-btn { margin-top: 14px; font-size: 13px; color: var(--accent); padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); }
.q-card .ex-zh { margin-top: 12px; text-align: left; }
.en-opt { font: 600 19px var(--serif); letter-spacing: -.005em; }
.opt-gloss { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; max-height: 0; overflow: hidden; transition: max-height .3s; }
.opt:disabled .opt-gloss { max-height: 40px; }
.dunno kbd { font: 11px var(--sans); opacity: .5; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.done .big small { font-size: 24px; }

.wcount { font-size: 11px; color: var(--bad); background: var(--bad-soft); padding: 2px 7px; border-radius: 6px; flex: none; }

/* 学习日历 */
.heat-wrap { overflow-x: auto; padding-bottom: 2px; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; min-width: 300px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: rgba(20, 24, 40, .06); }
.heat i.l1 { background: rgb(var(--accent-rgb) / .22); } .heat i.l2 { background: rgb(var(--accent-rgb) / .45); } .heat i.l3 { background: rgb(var(--accent-rgb) / .7); } .heat i.l4 { background: var(--accent); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; background: rgba(20, 24, 40, .06); }
.heat-legend i.l1 { background: rgb(var(--accent-rgb) / .22); } .heat-legend i.l2 { background: rgb(var(--accent-rgb) / .45); } .heat-legend i.l3 { background: rgb(var(--accent-rgb) / .7); } .heat-legend i.l4 { background: var(--accent); }
.st-row { grid-template-columns: 56px 1fr 36px 44px; }
.st-row .rate { font-size: 12px; text-align: right; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.st-row .rate.good { color: var(--good); } .st-row .rate.mid { color: var(--warn); } .st-row .rate.low { color: var(--bad); }

/* 设置 */
.set-title { margin: 18px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--ink-3); }
.set-title:first-child { margin-top: 0; }
.settings .row > label:first-child { display: flex; flex-direction: column; font-size: 15px; cursor: pointer; }
.select { appearance: none; border: 0; border-radius: 12px; padding: 9px 30px 9px 12px; font: 14px var(--sans); color: var(--ink); background: rgba(20, 24, 40, .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; cursor: pointer; max-width: 55%; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(20, 24, 40, .18); flex: none; }
.sync-dot.on { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.sync-dot.error, .sync-dot.quota { background: var(--warn); }

/* 编辑器 */
.editor { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 6px; }
.ed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ed-head h3 { margin: 0; font: 600 20px var(--serif); }
.ed-head h3 span { color: var(--accent); }
.editor label { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.editor label small { margin-left: 6px; opacity: .8; }
.editor input, .editor textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 15px/1.5 var(--sans); color: var(--ink); background: rgba(255, 255, 255, .7); outline: none; resize: vertical; }
.editor input:focus, .editor textarea:focus { border-color: rgb(var(--accent-rgb) / .45); background: #fff; }
.editor .controls { margin-top: 14px; }

:focus-visible { outline: 2px solid rgb(var(--accent-rgb) / .55); outline-offset: 2px; }
@media (max-width: 420px) {
  .drills { gap: 8px; }
  .drill { padding: 12px 10px; }
  .drill small { display: none; }
}

/* ---------- v3：今日任务 / 易混词 / 6 选 2 / Claude 记法 / 同步码 ---------- */
.task { display: flex; align-items: center; gap: 14px; width: 100%; margin: 14px 0 0; padding: 20px 20px 20px 22px; border-radius: var(--radius); text-align: left; color: #fff; background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 55%, var(--accent-light) 100%); box-shadow: 0 18px 40px -18px rgb(var(--accent-rgb) / .7), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .25s var(--ease), box-shadow .25s; position: relative; overflow: hidden; }
.task::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 90% 0%, rgba(255, 255, 255, .22), transparent 60%); pointer-events: none; }
.task:hover { transform: translateY(-2px); }
.task:active { transform: scale(.985); }
.task-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-main b { font: 600 22px var(--serif); letter-spacing: -.01em; }
.task-main small { font-size: 13px; opacity: .85; }
.task-go { flex: none; padding: 9px 18px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--accent); font-weight: 600; font-size: 14px; }
.task.done { background: linear-gradient(135deg, #e9f6f0, #f5faf7); color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--glass-edge); }
.task.done .task-go { background: var(--good-soft); color: var(--good); }
.task.done::after { display: none; }

.compare { padding: 16px 18px; margin-top: 12px; animation: cardIn .35s var(--ease); }
.compare h4 { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--warn); letter-spacing: .04em; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-side { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); min-width: 0; }
.cmp-side.mine { border-color: rgba(31, 157, 107, .35); background: var(--good-soft); }
.cmp-word { display: flex; align-items: center; gap: 4px; }
.cmp-word b { font: 600 19px var(--serif); word-break: break-word; }
.cmp-ph { font-size: 12px; color: var(--ink-3); margin: 2px 0 6px; }
.cmp-zh { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.leech-tag { color: #8a5a10; background: rgba(217, 138, 28, .12); }
.note.attn { border-color: rgba(217, 138, 28, .5); background: rgba(217, 138, 28, .06); }
.note.attn::placeholder { color: #a7650c; }

.opts.two { grid-template-columns: 1fr 1fr; }
.opts.two .opt { flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; }
.opt-ph { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.opts.multi { grid-template-columns: 1fr 1fr; }
.opts.multi .opt { padding: 14px; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.sel .k { background: var(--accent); color: #fff; }

.ai-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--accent); background: var(--accent-soft); transition: background .2s; }
.ai-btn:hover { background: rgb(var(--accent-rgb) / .18); }
.ai-btn svg { width: 13px; height: 13px; }
.ai-out { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgb(var(--accent-rgb) / .15); animation: cardIn .3s var(--ease); }
.ai-text { font-size: 14px; line-height: 1.65; white-space: pre-wrap; color: var(--ink); }
.ai-actions { display: flex; gap: 8px; margin-top: 10px; }

.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(20, 24, 40, .04); }
.code-box code { font: 600 19px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; color: var(--ink); user-select: all; }
.set-note { margin: 8px 0 4px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.code-form { display: flex; gap: 8px; padding-bottom: 12px; }
.code-in { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); font: 600 16px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; color: var(--ink); outline: none; text-transform: uppercase; }
.code-in:focus { border-color: rgb(var(--accent-rgb) / .45); background: #fff; }
.ds-key-in { text-transform: none; letter-spacing: 0; font-weight: 500; max-width: none; }
#ds-key-row { align-items: center; gap: 8px; }
#ds-key-row .code-in { flex: 1 1 180px; }
.sync-dot.busy { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
#sync-box .row { border-bottom: 1px solid var(--line); }

@media (max-width: 420px) {
  .task { padding: 18px; }
  .task-main b { font-size: 20px; }
  .opts.multi { grid-template-columns: 1fr; }
  .cmp-grid { gap: 8px; }
}

/* ---------- 考试倒计时 / 词条附加栏目 ---------- */
.notice.plan { color: var(--ink-2); background: var(--accent-soft); border-color: rgb(var(--accent-rgb) / .22); }
.notice.plan .plan-head { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.notice.plan b { color: var(--accent); font-variant-numeric: tabular-nums; }
.extra { font-size: 15px; color: var(--ink-2); line-height: 1.6; white-space: pre-line; }
.settings .row.off { opacity: .4; pointer-events: none; }

/* ---------- 栏目切换（专项词：等价词 / 熟词僻义 / 阅读 / 数学）---------- */
.sections { display: flex; gap: 6px; margin: -8px 0 16px; overflow-x: auto; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.sections button { flex: 1 0 auto; padding: 9px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85); white-space: nowrap; transition: background .2s, color .2s; }
.sections button:hover { color: var(--ink); background: rgba(255, 255, 255, .8); }
.sections button.on { color: #fff; font-weight: 600; background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 16px -8px rgb(var(--accent-rgb) / .8); }
.extra.root { font-size: 14px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }

/* 真题（机经词：填空机经 1900 题） */
.q-cloze .blank-n { font: 600 13px var(--sans); color: var(--accent); margin-right: 2px; }
.q-cloze .blank.filled { color: var(--accent); font-weight: 600; min-width: 0; padding: 0 4px; }
.tc-src { margin-top: 12px; font-size: 12px; color: var(--ink-3); text-align: left; }
.opts.tc-cols { grid-template-columns: repeat(var(--cols, 2), 1fr); align-items: start; }
.opts.tc-cols.g2 { --cols: 2; }
.opts.tc-cols.g3 { --cols: 3; }
.tc-col { display: grid; gap: 10px; }
.tc-h { font-size: 12px; color: var(--ink-3); padding-left: 4px; }
.tc-cols .opt { padding: 13px 14px; gap: 10px; }
@media (max-width: 560px) { .opts.tc-cols { grid-template-columns: 1fr; } .tc-col + .tc-col { margin-top: 6px; } }

/* 问 Claude：侧边对话框 */
.chat-fab { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: transform .2s var(--ease); }
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab svg { width: 20px; height: 20px; }
.chat { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(400px, 100vw); display: flex; flex-direction: column; background: rgba(250, 251, 255, .94); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(30, 40, 80, .35); transform: translateX(105%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s; }
.chat.open { transform: none; visibility: visible; transition: transform .3s var(--ease); }
.chat-top { display: flex; align-items: center; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 14px 12px 18px; border-bottom: 1px solid var(--line); }
.chat-top b { flex: 1; font-size: 16px; }
.chat-x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.chat-x:hover { background: var(--line); }
.chat-x svg { width: 18px; height: 18px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.chat-empty .pill { display: block; margin: 0 0 8px; text-align: left; }
.msg { max-width: 92%; }
.msg p { margin: 0; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; font-size: 11px; color: var(--ink-3); margin: 0 4px 4px; }
.msg.me { align-self: flex-end; text-align: right; }
.msg.me p { background: var(--accent); color: #fff; text-align: left; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; }
.msg.ai p { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.ai p:empty { display: none; }
.msg .err { color: var(--bad); margin-top: 4px; }
.chat-ctx { display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; font-size: 12px; color: var(--ink-3); }
.chat-ctx input { accent-color: var(--accent); margin: 0; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); }
.chat-form textarea { flex: 1; resize: none; font: 15px/1.5 var(--sans); color: var(--ink); padding: 10px 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; outline: none; max-height: 140px; }
.chat-form textarea:focus { border-color: var(--accent); }
.chat-form .btn { padding: 10px 16px; border-radius: 18px; flex: none; }
@media (max-width: 560px) { .chat-fab span { display: none; } .chat-fab { padding: 13px; bottom: max(84px, calc(env(safe-area-inset-bottom) + 66px)); } }
/* 宽屏上对话框推开内容，不挡住题目 */
@media (min-width: 960px) {
  #shell { transition: transform .3s var(--ease); }
  body.chat-open #shell { transform: translateX(-200px); }
  body.chat-open .tabbar { left: calc(50% - 200px); }
  body.chat-open .stage { right: min(400px, 100vw); }
}

/* 悬停查词 */
#hover-tip { position: fixed; z-index: 60; max-width: 300px; padding: 8px 12px 9px; border-radius: 12px; background: rgba(21, 23, 28, .94); color: #fff; font-size: 13px; line-height: 1.55; box-shadow: 0 10px 30px -10px rgba(20, 24, 40, .5); animation: fadeIn .15s; }
#hover-tip b { font: 600 15px var(--serif); margin-right: 6px; }
#hover-tip small { color: rgba(255, 255, 255, .55); margin-right: 6px; }
#hover-tip span { display: block; margin-top: 2px; }
#hover-tip .dim { color: rgba(255, 255, 255, .6); }
#hover-tip .tip-ask { display: block; margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; }
#hover-tip .tip-ask:hover { background: rgba(255, 255, 255, .24); }

/* ==========================================================================
   触屏（手机、平板）和 Mac 版共用的增强：html.enh 由 app.js 加上（Mac 外壳或 pointer: coarse）。
   电脑浏览器（鼠标）没有这个 class，外观不变。Mac 专有的版式在 mac/mac.css。
   辅助文字 --ink-3 在浅色、深色底上对比度都在 4.5:1 以上；深色主题跟随系统。
   ========================================================================== */
/* ---------- 颜色 ---------- */
html.enh {
  color-scheme: light;
  --ink-3: #5f6576;             /* 原 #8a90a0 对白底只有 3.2:1 */
  --good-text: #12704b;
  --bad-text: #b8303a;
  --warn-text: #8a5a10;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --stage-fade: rgba(246, 247, 252, .97);
  --sidebar: rgba(255, 255, 255, .45);
  --hover: rgba(20, 24, 40, .05);
  --field: rgba(20, 24, 40, .05);
  --track: rgba(20, 24, 40, .16);
  --sheet: rgba(255, 255, 255, .9);
}
@media (prefers-color-scheme: dark) {
  html.enh {
    color-scheme: dark;
    --ink: #e9ebf1;
    --ink-2: #c4c9d5;
    --ink-3: #a3aabb;
    --line: rgba(255, 255, 255, .09);
    --glass: rgba(34, 37, 47, .66);
    --glass-strong: rgba(40, 44, 56, .88);
    --glass-edge: rgba(255, 255, 255, .08);
    --accent: #8ea2ff;
    --accent-rgb: 142 162 255;
    --accent-dark: #3247b0;
    --accent-light: #9fb0ff;
    --accent-soft: rgba(142, 162, 255, .14);
    --good: #3cc28b;
    --good-soft: rgba(60, 194, 139, .16);
    --bad: #ff6d75;
    --bad-soft: rgba(255, 109, 117, .15);
    --warn: #f0a443;
    --good-text: #6fdcae;
    --bad-text: #ff9aa0;
    --warn-text: #f5c27e;
    --shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 10px 30px -12px rgba(0, 0, 0, .55);
    --surface: rgba(38, 41, 52, .78);
    --surface-solid: #23262f;
    --stage-fade: rgba(24, 26, 33, .97);
    --sidebar: rgba(28, 30, 38, .6);
    --hover: rgba(255, 255, 255, .06);
    --field: rgba(255, 255, 255, .07);
    --track: rgba(255, 255, 255, .2);
    --sheet: rgba(30, 33, 42, .95);
  }
  html.enh body { background: #15171d; }
  html.enh .bg { background: linear-gradient(160deg, #181a22 0%, #14161c 60%, #1a1720 100%); }
  html.enh .bg i { opacity: .16; }
  html.enh .glass, html.enh .glass-chip { box-shadow: var(--shadow); }
  html.enh .ring-track { stroke: rgba(255, 255, 255, .08); }
  html.enh .tabbar button.on, html.enh .seg button.on { background: rgba(255, 255, 255, .12); }
  html.enh .d-item { background: var(--surface); border-color: var(--glass-edge); }
  html.enh .d-item:hover, html.enh .opt:hover:not(:disabled) { background: var(--glass-strong); }
  html.enh .dot, html.enh .heat i, html.enh .heat-legend i { background: rgba(255, 255, 255, .08); }
  html.enh .heat i.l1, html.enh .heat-legend i.l1 { background: rgb(var(--accent-rgb) / .25); }
  html.enh .heat i.l2, html.enh .heat-legend i.l2 { background: rgb(var(--accent-rgb) / .45); }
  html.enh .heat i.l3, html.enh .heat-legend i.l3 { background: rgb(var(--accent-rgb) / .7); }
  html.enh .heat i.l4, html.enh .heat-legend i.l4 { background: var(--accent); }
  html.enh .pbar, html.enh .badge.zero { background: rgba(255, 255, 255, .08); }
  html.enh .stage { background: rgba(20, 22, 28, .72); }
  html.enh .btn.primary { background: var(--accent); color: #10142a; }
  html.enh .btn.primary:hover { background: var(--accent-light); }
  html.enh .stepper button:hover, html.enh .opt:hover:not(:disabled) .k { background: rgba(255, 255, 255, .1); }
  html.enh .note, html.enh .editor input, html.enh .editor textarea, html.enh .code-in, html.enh .syn span, html.enh .cmp-side { background: var(--field); }
  html.enh .note:focus, html.enh .editor input:focus, html.enh .editor textarea:focus, html.enh .code-in:focus { background: rgba(255, 255, 255, .1); }
  html.enh .sheet { background: var(--sheet); }
  html.enh .sheet-bg { background: rgba(0, 0, 0, .35); }
  html.enh .toast { background: rgba(240, 242, 248, .94); color: #15171c; }
  html.enh .g-know { background: rgba(60, 194, 139, .16); color: var(--good-text); }
  html.enh .g-fuzzy { background: rgba(240, 164, 67, .16); color: var(--warn-text); }
  html.enh .g-forgot { background: rgba(255, 109, 117, .15); color: var(--bad-text); }
  html.enh .notice { color: var(--warn-text); background: rgba(240, 164, 67, .1); border-color: rgba(240, 164, 67, .25); }
  html.enh .notice.plan { color: var(--ink-2); background: var(--accent-soft); border-color: rgb(var(--accent-rgb) / .25); }
  html.enh .task.done { background: linear-gradient(135deg, #1d3a2f, #1f2a26); color: var(--ink); }
  html.enh .leech-tag { color: var(--warn-text); }
  html.enh .reveal-btn { border-color: rgba(255, 255, 255, .18); }
  html.enh .select { background-color: var(--field); }
  html.enh .hint kbd, html.enh kbd { background: rgba(255, 255, 255, .06); }
  html.enh .switch::after { background: #f2f3f7; }
  html.enh .pill, html.enh .stepper, html.enh .code-box, html.enh .w-tag { background: var(--field); }
  html.enh .pill:hover { background: rgba(255, 255, 255, .13); }
  html.enh .pill.danger { background: var(--bad-soft); color: var(--bad-text); }
}

/* 阅读：英文释义也是学习内容，不用浅灰小字；常用辅助说明不小于 12.5–13px */
html.enh .def .en { font-size: 15px; color: var(--ink-2); }
html.enh .w-sec h4, html.enh .set-title { font-size: 12px; }
html.enh .a-main small, html.enh .curve-head small, html.enh .hint, html.enh .tc-src, html.enh .drill small, html.enh .bar small, html.enh .bar em { font-size: 12.5px; }
html.enh .settings small { font-size: 13px; line-height: 1.45; }
html.enh .d-item .m { font-size: 13.5px; }
html.enh .q-stage { font-size: 12px; }
html.enh .ex-zh { font-size: 15px; }

/* 设置行：说明文字自然换行，开关、下拉框、步进器不被挤压 */
html.enh .settings .row > span:first-child, html.enh .settings .row > label:first-child { flex: 1 1 auto; min-width: 0; }
html.enh .switch { flex: none; width: 48px; min-width: 48px; height: 28px; background: var(--track); }
html.enh .switch:checked { background: var(--good); }
html.enh .select { flex: none; max-width: 60%; }
html.enh .stepper, html.enh .btns, html.enh .mac-seg { flex: none; }
html.enh .settings .row.off { opacity: .55; }
html.enh #goal-row.off > span:first-child small::after { content: " · 已按考试日期自动安排；关掉上一项后可以手动设置"; }

/* 词库条目：英文一行、中文一行，最多两行 */
html.enh .d-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot w cnt" ". m m"; column-gap: 10px; row-gap: 3px; align-items: center; padding: 12px 14px; }
html.enh .d-item .dot { grid-area: dot; }
html.enh .d-item .w { grid-area: w; overflow-wrap: anywhere; }
html.enh .d-item .wcount { grid-area: cnt; }
html.enh .d-item .m { grid-area: m; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }
html.enh .more-btn { display: block; width: 100%; margin-top: 4px; border-radius: 14px; background: var(--field); color: var(--ink-2); }
html.enh .more-btn:hover { background: var(--hover); color: var(--ink); }
/* 评价按钮、显示释义、提交、继续：内容长时固定在底部 */
html.enh .stage-body > #grades, html.enh .stage-body > #pre, html.enh .stage-body > .mac-submit, html.enh #reveal-slot > .controls {
  position: sticky; bottom: 0; z-index: 2; margin-top: 12px; padding: 14px 0 8px;
  background: linear-gradient(to bottom, transparent, var(--stage-fade) 30%);
}
html.enh .grade { border-width: 1.5px; }

/* 真题和练习：多选题手动提交；正误除了颜色还有符号和文字 */
html.enh .mac-submit { display: flex; align-items: center; gap: 14px; }
html.enh .mac-submit span { flex: 1; font-size: 13.5px; color: var(--ink-2); }
html.enh .mac-submit .btn { flex: none; padding: 12px 22px; }
html.enh .mac-submit .btn:disabled { opacity: .4; cursor: default; transform: none; }
html.enh .opts.tc-cols:has(.opt:not(:disabled)) .tc-col:not(:has(.opt.sel)) .tc-h::after { content: " · 待选"; color: var(--warn-text); }
html.enh .opts.tc-cols:has(.opt:not(:disabled)) .tc-col:has(.opt.sel) .tc-h::after { content: " · 已选"; color: var(--good-text); }
html.enh .tc-h { font-size: 12.5px; }
html.enh .opt.correct .k, html.enh .opt.wrong .k { font-size: 0; }
html.enh .opt.correct .k::after { content: "✓"; font-size: 14px; font-weight: 700; }
html.enh .opt.wrong .k::after { content: "✗"; font-size: 14px; font-weight: 700; }
html.enh .opt.correct::after, html.enh .opt.wrong::after { flex: none; align-self: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
html.enh .opt.correct::after { content: "正确答案"; color: var(--good-text); background: var(--good-soft); }
html.enh .opt.wrong::after { content: "你的选择"; color: var(--bad-text); background: var(--bad-soft); }
html.enh .opt.dim { opacity: .55; }
html.enh .q-stage.is-ok { color: var(--good-text); }
html.enh .q-stage.is-ok::before { content: "✓ "; }
html.enh .q-stage.is-bad { color: var(--bad-text); }
html.enh .q-stage.is-bad::before { content: "✗ "; }
html.enh .q-stage.is-slow { color: var(--warn-text); }


/* 底部标签栏：left: 50% 时可用宽度只有半屏，窄手机上「今日」会折成两行 */
html.enh .tabbar button { white-space: nowrap; }
@media (max-width: 759px) { html.enh .tabbar { width: max-content; } }

/* ---------- 只在触屏 ---------- */
/* 首页：今日任务放最前（拇指最好按的位置），进度和考试计划在下面 */
html.touch #v-home:not([hidden]) { display: flex; flex-direction: column; }
html.touch #v-home > .top { order: 0; }
html.touch #v-home > #btn-task { order: 1; margin-top: 0; }
html.touch #v-home > .actions { order: 2; }
html.touch #v-home > #backlog { order: 3; margin-top: 0; }
html.touch #v-home > #plan { order: 4; margin-top: 0; }
html.touch #v-home > .hero { order: 5; margin-top: 14px; }
html.touch #v-home > .sec-title { order: 6; }
html.touch #v-home > .drills { order: 7; }
html.touch #v-home > .curve { order: 8; }
/* iOS 输入框字号小于 16px 时，点进去整页会放大 */
html.touch .note, html.touch .editor input, html.touch .editor textarea, html.touch .code-in, html.touch .chat-form textarea { font-size: 16px; }
/* 去掉双击放大的等待，点按更跟手 */
html.touch button, html.touch .opt, html.touch a { touch-action: manipulation; }
/* 手指点完 hover 状态会一直留着：触屏上不做 hover 位移 */
html.touch .opt:hover:not(:disabled), html.touch .action:hover, html.touch .drill:hover, html.touch .task:hover, html.touch .grade:hover, html.touch .speak:hover { transform: none; }
html.touch .opt:hover:not(:disabled) { background: var(--glass-strong); }
/* 长按查词：学习和做题区的文字不弹出系统的选择 / 拷贝菜单（输入框照常） */
html.touch .stage-body, html.touch .dict-list, html.touch .sheet { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.touch .stage-body textarea, html.touch .sheet textarea, html.touch .sheet input { -webkit-user-select: text; user-select: text; }
/* 底部固定的按钮避开 iPhone 底部横条 */
html.touch .stage-body > #grades, html.touch .stage-body > #pre, html.touch .stage-body > .mac-submit, html.touch #reveal-slot > .controls { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
html.touch .stage-body { padding-bottom: 0; }
html.touch .grade { padding: 14px 6px; }
/* 键盘提示（1 认识 · 2 模糊…）在手机上没有意义 */
html.touch .stage-body .hint { display: none; }
html.touch .mac-submit .btn { padding: 14px 24px; }
@media (prefers-color-scheme: dark) {
  html.touch body { background: #15171d; }
}

/* ---------- 词根（词库 → 词根，roots.js）---------- */
.root-intro { margin: 2px 4px 14px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.root-card { padding: 16px 18px; margin-bottom: 12px; }
.root-card header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 12px; }
.root-card header b { font: 600 19px var(--serif); }
.root-card header span { font-size: 14px; color: var(--accent); font-weight: 600; }
.root-card header small { font-size: 12px; color: var(--ink-3); }
.root-card .root-go { margin-left: auto; padding: 6px 14px; color: var(--accent); background: var(--accent-soft); }
.root-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.root-words .d-item.chip { padding: 9px 12px; border-radius: 12px; gap: 8px; }
.root-words .d-item.chip .w { font-size: 15px; }
.root-words .d-item.chip .m { font-size: 12px; }
.root-pre .pre-row { display: grid; grid-template-columns: minmax(150px, auto) 1fr auto; gap: 2px 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.root-pre .pre-row b { font: 600 15px var(--serif); }
.root-pre .pre-row span { font-size: 13px; color: var(--ink-2); }
.root-pre .pre-row em { font-style: normal; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.root-pre .pre-row small { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 480px) {
  .root-words { grid-template-columns: 1fr 1fr; }
  .root-pre .pre-row { grid-template-columns: 1fr auto; }
  .root-pre .pre-row span { grid-column: 1 / -1; grid-row: 2; }
}
/* 词库筛选多了「词根」，六个按钮在窄屏上挤：字号略小 */
#dict-filter button { white-space: nowrap; }
@media (max-width: 420px) { #dict-filter button { font-size: 12px; } }

/* ---------- 手机排版：整体小一档；单词不折行（放不下由 app.js 的 fitWords 自动缩小） ---------- */
.w-word { white-space: nowrap; word-break: normal; }
@media (max-width: 560px) {
  /* 标签和编辑按钮挪到单词上方一行，单词独占整行宽度 */
  .w-head { flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .w-tools { align-self: flex-end; margin: -8px -6px 0 0; }
  .wcard { padding: 22px 18px 20px; }
  .q-card { padding: 30px 18px 24px; }
  .w-word, .q-card .w-word { font-size: 32px; }
  .w-ph { font-size: 15px; margin-top: 8px; }
  .speak { width: 34px; height: 34px; }
  .w-sec { margin-top: 18px; padding-top: 14px; }
  .def .zh { font-size: 16px; }
  .def .pos { font-size: 13px; }
  .def .en, html.enh .def .en { font-size: 13.5px; }
  .sec-syn.big .syn span { font-size: 17px; padding: 6px 12px; }
  .ex-en { font-size: 15.5px; line-height: 1.5; }
  .ex-zh, html.enh .ex-zh { font-size: 14px; }
  .extra { font-size: 13.5px; }
  .opt { font-size: 14.5px; padding: 14px 15px; gap: 12px; }
  .en-opt { font-size: 17px; }
  .q-cloze { font-size: 17px; }
  .cmp-word b { font-size: 17px; }
  .top h1 { font-size: 27px; }
  .task-main b { font-size: 19px; }
  .a-main b { font-size: 16px; }
  .ring-text b { font-size: 30px; }
  .hero-stats b, .grid4 b, .progress-line b, .tally b { font-size: 20px; }
  .drill em { font-size: 18px; }
  .d-item .w { font-size: 16px; }
  .root-card header b { font-size: 17px; }
  .done h2 { font-size: 21px; }
}
