@import url('https://fonts.font.im/css2?family=Nunito:wght@600;700;800;900&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&family=Cinzel:wght@600;700;800&display=swap');
/* vibe单词 —— 移动端优先样式（底部四键 + 顶部查词） */
:root {
  --bg: #f4f6fb;
  /* 环境光斑：磨砂皮肤的身份感，页面底层与全屏引导页共用同一份 */
  --ambient:
    radial-gradient(52rem 30rem at 88% -8%, rgba(86, 102, 245, .08), transparent 62%),
    radial-gradient(40rem 26rem at -14% 24%, rgba(20, 154, 104, .05), transparent 60%),
    radial-gradient(46rem 30rem at 50% 118%, rgba(217, 119, 6, .04), transparent 62%);
  --card: rgba(255, 255, 255, .66);
  --card-solid: #ffffff;
  --card-line: rgba(255, 255, 255, .65);
  --ink: #1a2032;
  --ink-body: #3a4258;
  --ink2: #667089;
  --ink3: #c2c7d6;
  --brand: #5666f5;
  --brand-soft: rgba(86, 102, 245, .10);
  --green: #149a68;  --green-soft: rgba(20, 154, 104, .12);
  --amber: #d97706;  --amber-soft: rgba(217, 119, 6, .12);
  --red: #ef5350;    --red-soft: rgba(239, 83, 80, .11);
  --violet: #6b4de6; --violet-soft: rgba(107, 77, 230, .10);
  --note-bg: rgba(255, 241, 180, .6);
  --note-border: #e2c67a;
  --note-ink: #97700a;
  --soft: rgba(23, 28, 46, .045);
  --soft2: rgba(23, 28, 46, .08);
  --toast-bg: rgba(23, 28, 46, .92);
  --tabbar-bg: rgba(255, 255, 255, .72);
  --topbar-bg: rgba(244, 246, 251, .7);
  --line: rgba(23, 28, 46, .09);
  --boot-rule: #b9c2d8;
  --boot-dot: #848fae;
  /* 统一圆角刻度：控件 12 / 列表项与小面板 16 / 卡片 20（胶囊仍 999） */
  --r-ctl: 12px;
  --r-item: 16px;
  --r-card: 20px;
  --radius: var(--r-card);
  --shadow: 0 1px 2px rgba(23, 28, 46, .04), 0 12px 32px -16px rgba(23, 28, 46, .10);
  --shadow-lift: 0 2px 4px rgba(23, 28, 46, .06), 0 18px 40px -18px rgba(23, 28, 46, .18);
  --ease: cubic-bezier(.22, .8, .32, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.42, .55, 1);
  --tab-h: 62px;
  --tabbar-pad: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  color-scheme: light;

  /* ===== 风格轴令牌（data-style）=====
     上面是「薄雾留白」的取值，它同时是回退值：JS 没跑起来时页面仍是完整可用的界面。
     另外三套皮肤在文件末尾只改这些令牌 + 少量结构覆写，不复制规则集。 */
  --font-custom: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-ui: var(--font-custom);
  --font-disp: var(--font-ui);   /* 词条、大数字等展示位 */
  --font-num: var(--font-ui);
  --font-label: var(--font-ui);
  --blur: blur(18px) saturate(160%);
  --on-brand: #ffffff;
  --btn-sh: 0 4px 12px -6px rgba(86, 102, 245, .32);
  --btn-sh-hover: 0 6px 16px -6px rgba(86, 102, 245, .38);
  --rule: var(--line);
  --pad-card: 18px;
  --pad-word: 24px 18px;
  --wc-align: center;
  --wc-justify: center;
  --r-pill: 999px;
  --num-w: 800;
  --num-track: -.5px;
  --label-w: 700;
  --label-track: .5px;
  --label-tf: none;
  --tag-tf: none;
  --tag-track: 0px;
  --hw-size: 40px;
  --hw-w: 800;
  --hw-track: .5px;
}
/* 深色模式：只覆写变量，规则集完全共用 */
:root[data-theme="dark"] {
  --bg: #0e1220;
  --ambient:
    radial-gradient(52rem 30rem at 88% -8%, rgba(125, 138, 255, .09), transparent 62%),
    radial-gradient(40rem 26rem at -14% 24%, rgba(56, 199, 144, .045), transparent 60%),
    radial-gradient(46rem 30rem at 50% 118%, rgba(157, 139, 255, .05), transparent 62%);
  --card: rgba(255, 255, 255, .075);
  --card-solid: #171c2e;
  --card-line: rgba(255, 255, 255, .11);
  --ink: #e9ecf6;
  --ink-body: #c3c9dd;
  --ink2: #8f97b2;
  --ink3: #565e7a;
  --brand: #7d8aff;
  --brand-soft: rgba(125, 138, 255, .15);
  --green: #38c790;  --green-soft: rgba(56, 199, 144, .15);
  --amber: #f0a13c;  --amber-soft: rgba(240, 161, 60, .15);
  --red: #f2635f;    --red-soft: rgba(242, 99, 95, .14);
  --violet: #9d8bff; --violet-soft: rgba(157, 139, 255, .15);
  --note-bg: rgba(240, 200, 90, .10);
  --note-border: rgba(240, 200, 90, .35);
  --note-ink: #d9b95c;
  --soft: rgba(255, 255, 255, .05);
  --soft2: rgba(255, 255, 255, .10);
  --toast-bg: rgba(56, 62, 86, .96);
  --tabbar-bg: rgba(15, 19, 33, .78);
  --topbar-bg: rgba(14, 18, 32, .72);
  --line: rgba(255, 255, 255, .09);
  --boot-rule: #414b6e;
  --boot-dot: #6f7aa4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 12px 32px -16px rgba(0, 0, 0, .5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .34), 0 18px 40px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
/* 底色光斑只在这一层，卡片半透明+模糊后才透出层次 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: var(--ambient);
}
/* 磨砂质感统一加在主要容器上（只有薄雾留白保留模糊，其余皮肤把 --blur 设为 none） */
.card, .task-btn, .wordcard, .popup, .setup-card, .noise-panel {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 固定视口：html/body 不滚动（手机上拖不动页面），滚动只发生在 main 容器内部 */
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15.5px; line-height: 1.65;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
::selection { background: var(--brand-soft); }
input, textarea, select, button { font-size: 16px; } /* 防止 iOS 聚焦缩放 */

/* ================= 动画 ================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }

/* 视图入场：轻微上移 + 放大，比纯 fadeUp 更「跟手」 */
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
/* 卡片切换：新词从右侧滑入，旧词向左滑出 */
@keyframes cardIn { from { opacity: 0; transform: translate3d(34px, 0, 0) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cardOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(-30px, 0, 0) scale(.97); } }
/* 翻面展开：带一点 3D 透视，弱化 display 切换的生硬感 */
@keyframes unfold { from { opacity: 0; transform: perspective(700px) rotateX(-10deg) translateY(10px); } to { opacity: 1; transform: none; } }
/* 弹层 / 区块左右滑入（列表 ↔ 文章） */
@keyframes slideFromRight { from { opacity: 0; transform: translate3d(26px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes slideFromLeft { from { opacity: 0; transform: translate3d(-26px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translate3d(0, 100%, 0); } to { transform: none; } }
@keyframes sheetDown { from { transform: none; } to { transform: translate3d(0, 100%, 0); } }
@keyframes maskOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes icoPop { 0% { transform: translateY(0) scale(.82); } 60% { transform: translateY(-3px) scale(1.1); } 100% { transform: translateY(-1px) scale(1); } }
@keyframes okPulse { 0% { transform: scale(.97); } 55% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* 仅动画 transform/opacity（合成层），避免逐帧重绘阴影。
   入场统一用 backwards：动画结束后释放 transform，:active / :hover 反馈才不会被终值锁死 */
.el-in { animation: fadeUp .32s var(--ease-out) backwards; }
.el-in-r { animation: slideFromRight .34s var(--ease-out) backwards; }
.el-in-l { animation: slideFromLeft .34s var(--ease-out) backwards; }
.el-pop { animation: popIn .3s var(--spring) backwards; }
/* 列表交错入场：JS 用 --i 指定序号 */
.stagger > * { animation: fadeUp .34s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 42ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .stagger > * { animation-delay: 0ms !important; }
  .boot, .boot *, .boot *::before, .boot *::after { animation: none !important; transition: none !important; }
}

/* ================= 顶栏：品牌 + 查词搜索框 ================= */
.topbar {
  flex-shrink: 0; position: relative; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.theme-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--r-ctl);
  background: var(--card-solid); color: var(--ink2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  transition: transform .16s var(--spring), background-color .25s var(--ease), color .25s;
}
.theme-btn:active { transform: scale(.88); }
.theme-btn svg { width: 18px; height: 18px; display: block; }
.brand { display: flex; align-items: center; gap: 6px; font-size: 16px; flex-shrink: 0; }
.topsearch {
  flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 4px 4px 10px;
  transition: border-color .2s, box-shadow .2s;
}
.topsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.topsearch .ts-ico { display: flex; color: var(--ink2); }
.topsearch .ts-ico svg { width: 15px; height: 15px; }
.topsearch input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 15px; padding: 6px 0; -webkit-appearance: none; appearance: none;
}
.topsearch input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ts-clear {
  border: none; background: rgba(125, 125, 125, .16); color: var(--ink2); padding: 4px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 50%; width: 22px; height: 22px; flex-shrink: 0;
  transition: color .15s, background-color .15s, transform .12s;
}
.ts-clear:hover { color: var(--ink); background: rgba(125, 125, 125, .28); }
.ts-clear:active { transform: scale(.9); }
.ts-clear svg { width: 12px; height: 12px; display: block; }
.ts-go {
  border: none; background: var(--brand); color: var(--on-brand); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; padding: 7px 13px; flex-shrink: 0;
}
.ts-go:active { transform: scale(.95); }

/* 桌面悬浮微 Dock：默认移动端隐藏，>=768px 在媒体查询中激活 */
.desktop-dock { display: none; }

/* ================= 底部四键导航 ================= */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--tabbar-bg);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -18px rgba(23, 28, 46, .4);
}
/* 软键盘弹起（app.js 探测后挂 html.kbd-open）：收起底部导航栏，
   把键盘上方的整条空间让给输入区；键盘收起后自动还原 */
html.kbd-open .tabbar { display: none; }
html.kbd-open main { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
/* 滑动指示胶囊：跟随当前 tab 的图标，用 transform 位移 */
.tab-ind {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
  border-radius: var(--r-pill); background: var(--brand-soft); opacity: 0;
  will-change: transform, width, height;
  transition: transform .34s var(--spring), width .34s var(--spring), height .34s var(--spring), opacity .2s;
}
.tab {
  position: relative; z-index: 1; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tab-h); color: var(--ink2); padding: 6px 0;
  transition: color .22s var(--ease), transform .12s var(--ease);
}
.tab:active { transform: scale(.92); }
.tab .ico { font-size: 20px; line-height: 1; filter: grayscale(.35); transition: filter .24s var(--ease); }
.tab .ico svg { width: 21px; height: 21px; display: block; }
.tab .lb { font-family: var(--font-label); font-size: 11.5px; font-weight: 600; letter-spacing: var(--label-track); transition: color .22s var(--ease); }
.tab.active { color: var(--brand); }
.tab.active .ico { filter: none; transform: translateY(-1px); animation: icoPop .38s var(--spring) backwards; }
.badge {
  position: absolute; top: 8px; right: calc(50% - 24px);
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 999px;
  font-size: 11px; font-style: normal; line-height: 17px; text-align: center;
  animation: popIn .3s var(--spring) backwards;
}
.badge:empty { display: none; }

main {
  flex: 1; min-height: 0; width: 100%;
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 12px 14px calc(var(--tabbar-pad) + 18px);
}
.view { display: none; }
.view.active { display: block; flex: 1 0 auto; }
.view.active > * { animation: viewIn .4s var(--ease-out) backwards; }
.view.active > *:nth-child(2) { animation-delay: .06s; }
.view.active > *:nth-child(3) { animation-delay: .12s; }
.view.active > *:nth-child(4) { animation-delay: .18s; }
.view.active > *:nth-child(n + 5) { animation-delay: .22s; }
/* 首页：上半区签到，下半区 新词/复习，撑满固定视口
   （用 flex 逐级拉伸撑满，不依赖百分比高度：滚动容器里 min-height:100% 不可靠） */
#view-home.active { display: flex; flex-direction: column; }
#homeMain { flex: 1 0 auto; display: flex; flex-direction: column; gap: 16px; }
.home-top { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* 每日一句：压在报头之上的一句英文 + 汉译。不成卡片，只靠字阶与留白分层 */
.dq { text-align: center; }
.dq-en { margin: 0; font-family: var(--font-disp); font-size: 15px; line-height: 1.55; color: var(--ink-body); }
.dq-by { font-style: normal; margin-left: 5px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.dq-zh { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink2); }

/* ================= 卡片 / 按钮 ================= */
.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--pad-card); margin-bottom: 14px;
  animation: viewIn .4s var(--ease-out) backwards;
}
.card h3 { margin: 0 0 12px; font-size: 15.5px; }
.btn {
  position: relative;
  border: none; border-radius: var(--r-ctl); padding: 13px 20px; min-height: 46px;
  font-size: 15.5px; font-weight: 600;
  transition: transform .16s var(--spring), box-shadow .22s var(--ease), opacity .2s, filter .2s;
}
.btn:active { transform: scale(.955); }
.btn.primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--btn-sh); }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.note { background: var(--note-bg); color: var(--note-ink); }
.btn.star { background: var(--soft); color: var(--ink2); }
.btn.star.on { background: var(--amber-soft); color: var(--amber); }
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: max(0px, calc(var(--r-ctl) - 2px)); min-height: 40px; }
.btn.reveal { width: 100%; background: var(--brand-soft); color: var(--brand); margin-top: 18px; animation: popIn .3s var(--spring) backwards; transition: opacity .18s, transform .18s var(--ease); }
.btn.reveal.hiding { opacity: 0; transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-actions.center { justify-content: center; }
.hero-actions .btn { flex: 1; min-width: 150px; }
.hint { color: var(--ink2); font-size: 13px; margin: 8px 0 0; }
kbd { background: var(--soft2); border-radius: 4px; padding: 0 5px; font-size: 11px; }
code { background: var(--soft); border-radius: 6px; padding: 1px 6px; font-size: 13px; }

/* ================= 首页：签到（上半） ================= */
.checkin-hero {
  width: 100%; text-align: center;
  padding: 30px 20px 22px; margin-bottom: 0;
  animation: fadeUp .38s var(--ease-out) backwards;
}
.ci-date { color: var(--ink2); font-size: 13px; }
.ci-big { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 12px; }
.ci-big b { font-family: var(--font-num); font-size: 56px; line-height: 1; font-weight: var(--num-w); color: var(--brand); font-variant-numeric: tabular-nums; letter-spacing: var(--num-track); }
.ci-big i { font-style: normal; color: var(--ink2); font-size: 13px; }
.ci-big.bump b { display: inline-block; animation: fireBump .62s var(--spring); }
@keyframes fireBump { 0% { transform: scale(.7); } 55% { transform: scale(1.3) translateY(-4px); } 100% { transform: scale(1); } }
.checkin-hero .ci-btn { margin-top: 22px; min-width: 210px; border-radius: var(--r-pill); padding: 14px 20px; font-size: 16.5px; }
.checkin-hero .ci-btn:disabled { background: var(--green-soft); color: var(--green); opacity: 1; box-shadow: none; }
.ci-hint { color: var(--ink2); font-size: 12.5px; margin-top: 14px; }
.ci-days { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.ci-dot {
  width: 19px; height: 19px; border-radius: 7px; background: var(--soft2); color: var(--bg);
  font-size: 11px; font-style: normal; line-height: 19px; text-align: center; flex-shrink: 0;
  animation: popIn .26s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 22ms);
}
.ci-dot.on { background: var(--green); color: #fff; }
.ci-dot.today { box-shadow: 0 0 0 2px var(--brand); }
.ci-cap { color: var(--ink2); font-size: 11.5px; width: 100%; text-align: center; margin-top: 2px; }

/* ================= 首页：新词 / 复习（下半） ================= */
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.task-btn {
  border: 1px solid var(--card-line); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: 24px 12px 22px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform .18s var(--spring), box-shadow .25s var(--ease);
  animation: popIn .42s var(--spring) backwards; animation-delay: calc(.15s + var(--i, 0) * .1s);
}
.task-btn:active { transform: scale(.94); }
.task-btn .tb-count { font-family: var(--font-num); font-size: 40px; font-weight: var(--num-w); line-height: 1.25; color: var(--brand); font-variant-numeric: tabular-nums; letter-spacing: var(--num-track); }
.task-btn .tb-label { font-family: var(--font-label); font-size: 16px; font-weight: var(--label-w); letter-spacing: var(--label-track); text-transform: var(--label-tf); }
.task-btn .tb-sub { font-size: 11.5px; color: var(--ink2); }
.tb-review .tb-count { color: var(--green); }
.task-btn.zero .tb-count, .task-btn.zero .tb-sub { color: var(--green); }

/* ================= 首页：下半区（词书进度 + 今日阅读，共用一张卡） ================= */
.home-foot { margin-bottom: 0; }
.home-foot .hp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hp-book { font-family: var(--font-label); font-size: 13px; letter-spacing: var(--label-track); color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-num { font-family: var(--font-num); font-size: 14px; font-weight: var(--num-w); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: var(--num-track); flex-shrink: 0; }
.home-foot .progress { margin-top: 9px; }
.hr {
  display: block; width: 100%; margin-top: 12px; padding: 12px 0 0;
  border: 0; border-top: 1px solid var(--rule); background: none;
  text-align: left; color: var(--ink); transition: transform .18s var(--spring);
}
.hr:active { transform: scale(.985); }
/* 右下角常驻白噪音浮标（46px，占 x 330–376 / y 722–768），磨砂与硬壳两套皮肤里首页阅读行正好走到它上方，给文字留出避让区 */
.hr-t { display: block; max-width: calc(100% - 32px); font-family: var(--font-disp); font-size: 15.5px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-m { display: block; max-width: calc(100% - 32px); font-size: 11.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-go { color: var(--brand); margin-left: 6px; }

/* ================= 背单词（首页内嵌） ================= */
/* 撑满固定视口：卡片自动长高吸收大屏空白，评分键贴在卡片下沿 */
#studyWrap { flex: 1 0 auto; display: flex; flex-direction: column; }
#studyCard { flex: 1 0 auto; display: flex; flex-direction: column; }
#wordCard { flex: 1 0 auto; }
#studyEmpty, #studyDone { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
.study-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; animation: fadeUp .3s var(--ease-out) backwards; }
.study-head .progress { flex: 1; }
.study-head .progress-text { flex-shrink: 0; }
.progress { height: 7px; background: var(--soft2); border-radius: 99px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .55s var(--ease-out); }
.progress-text { color: var(--ink2); font-size: 12px; transition: color .2s; min-width: 92px; text-align: right; }

.wordcard {
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card);
  padding: var(--pad-word); text-align: var(--wc-align); box-shadow: var(--shadow);
  min-height: 320px; display: flex; flex-direction: column; justify-content: center;
  will-change: transform, opacity; backface-visibility: hidden;
}
.wordcard.in { animation: cardIn .36s var(--ease-out) backwards; }
.wordcard.out { animation: cardOut .17s var(--ease) forwards; }
/* 出牌衔接：评分提交后旧卡 + 评分行 + 提示整组左滑淡出，再渲染下一张（!important 覆盖行内动画） */
#studyCard.leaving > * { animation: cardOut .19s var(--ease) forwards !important; pointer-events: none; }
.wc-tags { display: flex; gap: 6px; justify-content: var(--wc-justify); margin-bottom: 12px; }
.tag { font-size: 11px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand); font-weight: 600; text-transform: var(--tag-tf); letter-spacing: var(--tag-track); }
.tag:empty { display: none; }
.tag.review { background: var(--amber-soft); color: var(--amber); }
.tag.extra { background: var(--violet-soft); color: var(--violet); }
.tag.stage { background: var(--soft2); color: var(--ink2); font-weight: 400; }
.wc-word { font-family: var(--font-disp); font-size: var(--hw-size); font-weight: var(--hw-w); letter-spacing: var(--hw-track); word-break: break-word; transition: filter .25s var(--ease); }
.wc-phon { color: var(--ink2); font-size: 15px; margin-top: 4px; }
.wc-front-sent {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--r-ctl);
  background: var(--soft); color: var(--ink); font-size: 13.5px; line-height: 1.55;
  text-align: left; display: flex; flex-direction: column;
  animation: fadeIn .24s var(--ease-out); max-height: 130px; overflow-y: auto;
}
.wc-front-sent-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%;
}
.wc-front-sent-text { flex: 1; word-break: break-word; }
.wc-front-sent-text .tw.cur { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.wc-front-sent .sent-tts { flex-shrink: 0; margin-top: -1px; width: 26px; height: 26px; }
.wc-front-sent .cn {
  display: none; margin-top: 6px; color: var(--ink2); font-size: 13px; line-height: 1.5;
  border-top: 1px dashed var(--line); padding-top: 6px; width: 100%;
}
.wordcard.open .wc-front-sent .cn { display: block; animation: fadeIn .28s var(--ease-out); }
.wc-body { display: grid; grid-template-rows: 0fr; grid-auto-rows: 0fr; margin-top: 0; transition: grid-template-rows .42s var(--ease-out), margin-top .42s var(--ease-out); }
.wc-body > * { min-height: 0; overflow: hidden; }
.wordcard.open .wc-body { grid-template-rows: 1fr; grid-auto-rows: 1fr; margin-top: 16px; }
.wcb-in { overflow: hidden; min-height: 0; font-size: 16px; text-align: left; }
.wordcard.open .wcb-in { overflow-y: auto; max-height: 46vh; }
.wordcard.open .wcb-in > * { animation: fadeUp .34s var(--ease-out) backwards; animation-delay: .1s; }
.wc-trans .pos { color: var(--ink2); font-style: italic; margin-right: 5px; }
.wc-sent { margin-top: 12px; background: var(--soft); border-radius: var(--r-ctl); padding: 12px 14px; font-size: 14px; }
.wc-sent .cn { color: var(--ink2); font-size: 13px; margin-top: 4px; }
.wc-sent b { color: var(--brand); }
.wc-extra { margin-top: 12px; font-size: 13px; color: var(--ink2); text-align: left; }
.wc-extra .sec { margin-top: 8px; }
.wc-extra .sec b { color: var(--ink2); }
.wc-exam { margin-top: 12px; background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; text-align: left; }
.wc-exam .q { font-weight: 600; }
.wc-exam .choices { margin: 8px 0 4px; }
.wc-exam .choices div { padding: 3px 0; }
.wc-exam .right { color: var(--green); font-weight: 700; }
.wc-exam .explain { color: var(--ink2); font-size: 13px; margin-top: 6px; }
.wc-exam .showAns { border: none; background: none; color: var(--brand); font-size: 13px; padding: 0; }
.wc-trans .none, .popup-body .none { color: var(--ink2); font-size: 13px; }

.grade-row { display: flex; gap: 10px; margin-top: 14px; transition: gap .22s var(--ease-out); }
.btn.grade { flex: 1; padding: 15px 0; font-size: 15.5px; min-height: 54px; }
.grade-row.on { animation: cardIn .3s var(--ease-out) backwards; }   /* 评分行随卡片从右滑入（衔接） */
.grade-row.on .btn.grade { animation: popIn .32s var(--spring) backwards; }
.grade-row.on .btn.grade:nth-child(2) { animation-delay: .06s; }
.grade-row.on .btn.grade:nth-child(3) { animation-delay: .12s; }
/* 二段式标记：点「忘记」后忘记键动画收起、「继续」拉长占满整行 */
.btn.grade.forget { transition: flex-grow .22s var(--ease-out), opacity .18s var(--ease-out); overflow: hidden; white-space: nowrap; }
.grade-row.mark-forget { gap: 0; }
.grade-row.mark-forget .btn.forget { flex-grow: 0; opacity: 0; border: 0; pointer-events: none; }
.btn.forget { background: var(--red-soft); color: var(--red); }
.btn.fuzzy { background: var(--amber-soft); color: var(--amber); }
.btn.know { background: var(--green-soft); color: var(--green); }
.btn.grade.sel { transform: scale(.94); }
.study-note { text-align: center; color: var(--ink2); font-size: 12.5px; margin-top: 10px; min-height: 18px; transition: color .25s; }
.study-note.flash { animation: noteFlash .5s var(--ease-out) backwards; }
@keyframes noteFlash { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- TTS 播放 ---------- */
.wc-wordline { display: flex; align-items: center; justify-content: var(--wc-justify); gap: 10px; }
.tts-btn {
  border: none; background: var(--brand-soft); color: var(--brand);
  width: 34px; height: 34px; min-width: 34px; border-radius: 50%; font-size: 15px; line-height: 1;
  transition: transform .12s var(--ease), background .2s;
}
.tts-btn:active { transform: scale(.86); }
.tts-btn svg { width: 16px; height: 16px; display: block; margin: 0 auto; }
.wc-sent .tts-btn { width: 26px; height: 26px; min-width: 26px; font-size: 12px; margin-left: 6px; vertical-align: middle; }
.wc-sent .tts-btn svg { width: 13px; height: 13px; }
.wordcard.blur-word .wc-word { filter: blur(14px); user-select: none; }

/* ---------- 拼写默写 ---------- */
.spell-row { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.spell-row.on { animation: popIn .28s var(--spring) backwards; }
.spell-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px;
  font-size: 16px; outline: none; text-align: center; letter-spacing: 2px; background: var(--card-solid);
  transition: border-color .2s, box-shadow .2s;
}
.spell-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.spell-result { text-align: center; font-size: 13.5px; margin-top: 8px; min-height: 20px; line-height: 1.7; }
.spell-result .sr-ok { color: var(--green); font-weight: 700; }
.spell-result .sr-bad { color: var(--red); font-weight: 700; }
.spell-result .sr-hint { color: var(--ink2); }
.spell-result .sr-diff { font-size: 17px; font-weight: 800; letter-spacing: 2px; }
.spell-result .sr-diff b.bad { color: var(--red); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
.spell-row input.shake { animation: shake .3s var(--ease); border-color: var(--red); }

.empty { text-align: center; padding: 40px 18px; }
.empty p { color: var(--ink2); }
.empty-ico { width: 56px; height: 56px; color: var(--green); margin-bottom: 8px; animation: popIn .4s var(--spring) backwards; }

/* ================= 阅读 ================= */
/* 左滑删除：红底删除键垫在卡片底下，滑过阈值才淡入
   （磨砂卡片是半透明的，删除键不藏好会隔着卡片透出来） */
.art-row { position: relative; margin-bottom: 10px; }
.art-swipe-del {
  position: absolute; top: 0; right: 0; bottom: 0; width: 84px;
  border: none; background: var(--red); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  border-radius: var(--r-item);
  opacity: 0; pointer-events: none;
  transition: opacity .18s var(--ease);
}
.art-row.revealed .art-swipe-del { opacity: 1; pointer-events: auto; }
.art-swipe-del:active { filter: brightness(.92); }
.read-list .art-item {
  position: relative;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-item); padding: 15px 16px; margin-bottom: 0;
  cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s var(--spring), box-shadow .25s var(--ease);
  will-change: transform;
}
.art-item.swiped { box-shadow: var(--shadow-lift); }
.art-item:active { transform: scale(.985); }
.art-item .t { font-weight: 700; font-size: 16px; padding-right: 30px; }
/* 触屏设备用左滑，不显示右上角 ✕；桌面鼠标保留点按删除 */
.art-item .art-del {
  display: none;
  position: absolute; top: 6px; right: 6px; z-index: 1;
  width: 32px; height: 32px; border: none; background: none;
  color: var(--ink3); font-size: 15px; line-height: 32px; border-radius: 9px;
  transition: color .2s, background-color .2s, transform .16s var(--spring);
}
.art-item .art-del:active { color: var(--red); background: var(--red-soft); transform: scale(.9); }
.art-item .m { color: var(--ink2); font-size: 12px; margin-top: 5px; display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.art-item .m .ok { color: var(--green); }
.art-item .m .warn { color: var(--red); font-weight: 700; }
.gen-top { text-align: center; }
.gen-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gen-btns .btn { width: 100%; }
.gen-hint { color: var(--ink2); font-size: 12px; margin-top: 8px; transition: opacity .25s; }
.read-head { margin-bottom: 10px; }
.exam-flag {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 3px 12px; margin-bottom: 8px;
}
.exam-flag:empty { display: none; }

.article h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.35; }
.art-meta { color: var(--ink2); font-size: 12px; margin-bottom: 10px; display: flex; gap: 8px 10px; flex-wrap: wrap; }
.art-outside { font-size: 12.5px; color: var(--ink2); background: var(--soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; line-height: 1.7; }
.art-outside:empty { display: none; }
.art-outside .ow { color: var(--red); }
.art-text { font-size: 16.5px; line-height: 1.95; color: var(--ink-body); }
.art-text p { margin: 0 0 14px; text-indent: 0; }
.art-text .plabel { color: var(--brand); font-weight: 800; margin-right: 6px; }
.tw {
  color: var(--brand); font-weight: 700; cursor: pointer;
  border-bottom: 2px solid #bfc9ff; padding: 0 1px; border-radius: 4px;
  background: rgba(86, 102, 245, 0);
  transition: background-color .22s var(--ease), border-color .22s var(--ease), color .22s var(--ease);
}
.tw:active, .tw:hover { background: var(--brand-soft); }
.tw.old { color: var(--green); border-bottom-color: #9fdcc2; }
.tw.out { color: var(--red); border-bottom-color: #ffb4b4; background: var(--red-soft); }
.tw.known { color: var(--green); border-bottom: 2px dotted #9fdcc2; }
.tw.known::after { content: '✓'; font-size: 10px; vertical-align: super; margin-left: 1px; color: var(--green); }
.tw.forgot { color: var(--red); border-bottom: 2px dashed var(--red); animation: noteFlash .4s var(--ease-out) backwards; }
.art-sent { background: var(--soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 15px; }
.art-sent .cn { color: var(--ink2); font-size: 13px; margin-top: 3px; }

/* 真题题目区 */
.quiz-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 20px 0 4px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.quiz-head b { font-size: 15.5px; }
.quiz-head span { color: var(--ink2); font-size: 12px; }
.q-item { background: var(--soft); border-radius: var(--r-item); padding: 14px 14px; margin-top: 12px; animation: fadeUp .34s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
.q-item .qt { font-weight: 600; line-height: 1.6; }
.q-item .qtype { font-size: 11px; color: var(--brand); background: var(--card-solid); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }
.q-item .qc { margin-top: 10px; }
.q-item .qc div {
  padding: 11px 12px; border-radius: var(--r-ctl); background: var(--card-solid); border: 1px solid var(--line);
  margin-bottom: 7px; cursor: pointer; font-size: 14.5px; line-height: 1.6;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .16s var(--spring), box-shadow .2s;
}
.q-item .qc div b { color: var(--ink2); margin-right: 4px; }
.q-item .qc div:active { border-color: var(--brand); transform: scale(.99); }
.q-item .qc div.right { border-color: var(--green); background: var(--green-soft); animation: okPulse .42s var(--spring); }
.q-item .qc div.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .34s var(--ease); }
.q-item .qe { color: var(--ink2); font-size: 13.5px; margin-top: 8px; display: none; line-height: 1.8; }
.q-item.answered .qe { display: block; animation: fadeUp .25s var(--ease) backwards; }

/* ================= 阅读笔记 ================= */
.art-notes .nc { color: var(--brand); font-weight: 700; }
.art-note-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.art-note-form textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; background: var(--card-solid);
  outline: none; resize: vertical; font-family: inherit; line-height: 1.7; min-height: 76px;
}
.art-note-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.art-note-form .btn { align-self: flex-start; }
.an-item { background: var(--note-bg); border: 1px solid var(--note-border); border-radius: 12px; padding: 11px 13px; margin-top: 10px; animation: fadeUp .3s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
.an-quote {
  border-left: 3px solid var(--note-border); padding: 2px 0 2px 10px; margin-bottom: 6px;
  color: var(--ink2); font-size: 13px; line-height: 1.6; font-style: italic;
}
.an-text { font-size: 14.5px; line-height: 1.75; word-break: break-word; white-space: pre-wrap; }
.an-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--ink2); font-size: 11.5px; }
.an-foot .note-del { border: none; background: none; color: var(--ink3); font-size: 12.5px; padding: 4px 6px; }
.an-foot .note-del:hover, .an-foot .note-del:active { color: var(--red); }

/* ================= 词库 ================= */
.dict-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.dict-search-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.dict-search-wrap input {
  width: 100%;
  border: 1px solid var(--card-line); border-radius: var(--r-ctl); padding: 13px 40px 13px 15px; font-size: 16px; outline: none; background: var(--card);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
}
.dict-search-wrap input:focus { box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.dict-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: none; background: rgba(125, 125, 125, .16); color: var(--ink2); padding: 4px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 50%; width: 22px; height: 22px; flex-shrink: 0;
  transition: color .15s, background-color .15s, transform .12s;
}
.dict-clear:hover { color: var(--ink); background: rgba(125, 125, 125, .28); }
.dict-clear:active { transform: translateY(-50%) scale(.9); }
.dict-clear svg { width: 12px; height: 12px; display: block; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--card-line); background: var(--card-solid); color: var(--ink2); border-radius: var(--r-pill); padding: 8px 15px; font-size: 13.5px; box-shadow: var(--shadow); transition: background-color .22s var(--ease), color .22s var(--ease), transform .18s var(--spring), box-shadow .22s; }
.chip:active { transform: scale(.94); }
.chip.active { background: var(--ink); color: var(--bg); border-color: transparent; box-shadow: 0 6px 16px -8px rgba(23, 28, 46, .5); }
.dict-count { color: var(--ink2); font-size: 12px; margin: 4px 2px 8px; }
.book-chips { margin: 2px 2px 10px; }
.book-chips .chip { font-size: 12.5px; padding: 7px 12px; }
.book-chips .chip.active { background: var(--brand); }
.dict-item {
  background: var(--card-solid); border: 1px solid var(--card-line); border-radius: var(--r-item); margin-bottom: 8px; overflow: hidden; box-shadow: var(--shadow);
  animation: fadeUp .3s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 22ms);
  transition: box-shadow .25s var(--ease), transform .2s var(--spring);
}
.dict-item .row1 { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer; transition: background-color .2s; }
.dict-item .row1:active { background: var(--soft); }
.dict-item .dw { font-weight: 700; font-size: 16px; min-width: 90px; }
.dict-item .dp { color: var(--ink2); font-size: 12px; }
.dict-item .dt { color: var(--ink2); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-item .ds { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--soft2); color: var(--ink2); white-space: nowrap; }
.dict-item .ds.new { background: var(--brand-soft); color: var(--brand); }
.dict-item .ds.learning { background: var(--amber-soft); color: var(--amber); }
.dict-item .ds.mastered { background: var(--green-soft); color: var(--green); }
.dict-item .ds.extra { background: var(--violet-soft); color: var(--violet); }
.dict-item .detail { display: grid; grid-template-rows: 0fr; grid-auto-rows: 0fr; opacity: 0; transition: grid-template-rows .34s var(--ease-out), opacity .26s var(--ease); }
.dict-item .detail > * { min-height: 0; overflow: hidden; }
.dict-item .detail > .dk {
  overflow: hidden; min-height: 0;
  padding: 0 14px; font-size: 14px; background: var(--soft); transition: padding .34s var(--ease-out);
}
.dict-item.open .detail { grid-template-rows: 1fr; opacity: 1; }
.dict-item.open .detail > .dk { padding: 12px 14px; border-top: 1px dashed var(--line); }
.detail .cn-line { margin-bottom: 4px; }
.detail .cn-line .pos { color: var(--ink2); font-style: italic; margin-right: 6px; }
.detail .sent { background: var(--card-solid); border-radius: 10px; padding: 8px 12px; margin-top: 8px; font-size: 13px; }
.detail .meta { color: var(--ink2); font-size: 12px; margin-top: 8px; }
.dict-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.dict-acts .btn { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.dict-star-at { color: var(--ink2); font-size: 11.5px; }
.star-mark { color: var(--amber); font-style: normal; font-size: 12px; margin-left: 5px; vertical-align: 2px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ink2); font-size: 13px; margin: 14px 0; }

/* ================= 查词页 ================= */
.search-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.search-result { text-align: left; animation: fadeUp .3s var(--ease) backwards; }
.sr-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.sr-word { font-size: 28px; font-weight: 800; }
.sr-extra { margin-top: 10px; font-size: 13px; color: var(--ink2); }
.sr-status { margin-top: 12px; color: var(--ink2); font-size: 12.5px; background: var(--soft); border-radius: 10px; padding: 8px 12px; }
.search-result .btn { margin-top: 12px; }
.sr-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sr-acts .btn { margin-top: 12px; }
.search-result .wc-exam { margin-top: 14px; }
.search-result .cn-line { margin-bottom: 4px; }
.search-result .pos { color: var(--ink2); font-style: italic; margin-right: 6px; }
.search-result .sent { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: 14px; }
.search-result .sent .cn { color: var(--ink2); font-size: 13px; margin-top: 3px; }

/* ================= 设置 ================= */
.field { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.field > span { width: 120px; color: var(--ink2); font-size: 14px; flex-shrink: 0; }
.field input, .sel {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 11px 12px; font-size: 16px; outline: none; min-width: 0;
  transition: border-color .2s, box-shadow .2s; background: var(--card-solid); color: var(--ink);
}
.field input:focus, .sel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* 开关（拼写模式） */
.switch { position: relative; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; border: none; padding: 0; flex: none; }
.switch .sl {
  display: block; width: 52px; height: 30px; border-radius: 999px; background: var(--soft2);
  position: relative; cursor: pointer; transition: background-color .25s var(--ease);
}
.switch .sl::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .28s var(--spring); will-change: transform;
}
.switch input:checked + .sl { background: var(--brand); }
.switch input:checked + .sl::after { transform: translateX(22px); }
.field .switch { margin-left: auto; }
#apiStatus { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }

/* ================= 点词弹层 ================= */
.popup-mask {
  position: fixed; inset: 0; background: rgba(15, 20, 40, .38);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .22s var(--ease-out) backwards;
}
.popup-mask.closing { animation: maskOut .2s var(--ease) forwards; }
.popup {
  background: var(--card); border: 1px solid var(--card-line); border-bottom: none; border-radius: var(--r-card) var(--r-card) 0 0; width: 100%; max-width: 720px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 76vh; overflow-y: auto;
  animation: sheetUp .34s var(--ease-out) backwards; will-change: transform;
}
.popup-mask.closing .popup { animation: sheetDown .22s var(--ease) forwards; }
.popup::before {
  content: ''; display: block; width: 40px; height: 4px; border-radius: 99px;
  background: var(--soft2); margin: -6px auto 10px;
}
.popup-head { display: flex; align-items: baseline; gap: 10px; }
.popup-head .pw { font-size: 24px; font-weight: 800; }
.popup-head .p-phon { color: var(--ink2); font-size: 13px; }
.popup-close { margin-left: auto; border: none; background: var(--soft2); width: 34px; height: 34px; border-radius: 50%; font-size: 14px; transition: transform .16s var(--spring), background-color .2s, color .2s; }
.popup-close:active { transform: scale(.86) rotate(90deg); }
.popup-body { margin-top: 10px; font-size: 15px; }
.popup-body .cn-line { margin-bottom: 3px; }
.popup-body .pos { color: var(--ink2); font-style: italic; margin-right: 6px; }
.popup-body .sent { background: var(--soft); border-radius: 10px; padding: 9px 12px; margin-top: 10px; font-size: 13.5px; }
.popup-body .sent .cn { color: var(--ink2); font-size: 12.5px; margin-top: 3px; }
.popup-body textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card-solid); color: var(--ink);
  font-size: 15px; font-family: inherit; outline: none; resize: vertical; margin: 8px 0;
}
.popup-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.popup-actions .btn { flex: 1 1 44%; min-width: 130px; }

/* ================= 一组复盘 ================= */
/* 白噪音悬浮键是 z-index 60，复盘弹层要盖住它，否则悬浮键压在操作按钮上 */
#groupBreak { z-index: 70; }
.gb-sheet { display: flex; flex-direction: column; overflow: hidden; }
.gb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gb-k { font-family: var(--font-label); font-size: 11.5px; font-weight: 700; letter-spacing: var(--label-track); color: var(--brand); }
.gb-tally { font-size: 12px; color: var(--ink2); }
.gb-list { margin-top: 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.gb-row {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr) auto;
  align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.gb-row:last-child { border-bottom: none; }
.gb-w { font-family: var(--font-disp); font-size: 15px; font-weight: var(--num-w); color: var(--ink); }
.gb-d { font-size: 13px; line-height: 1.5; color: var(--ink2); }
.gb-d .pos { font-style: italic; margin-right: 5px; }
.gb-g { font-style: normal; font-size: 11.5px; white-space: nowrap; color: var(--ink2); }
.gb-row.know .gb-g { color: var(--green); }
.gb-row.fuzzy .gb-g { color: var(--amber); }
.gb-row.forget .gb-g { color: var(--red); }
.gb-row.easy .gb-g { color: var(--violet); }
.gb-actions { display: flex; gap: 10px; margin-top: 16px; }
.gb-actions .btn { flex: 1; }

/* ================= 发现新版本（热更新弹窗） ================= */
/* 同 #groupBreak：要盖过 z-index 60 的白噪音悬浮键 */
#updatePopup { z-index: 70; }
.up-sheet { display: flex; flex-direction: column; }
.up-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.up-k { font-family: var(--font-label); font-size: 11.5px; font-weight: 700; letter-spacing: var(--label-track); color: var(--brand); }
.up-v { font-family: var(--font-num); font-size: 12px; font-weight: var(--num-w); color: var(--ink2); font-variant-numeric: tabular-nums; letter-spacing: var(--num-track); }
.up-notes { margin: 10px 0 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-body); }
.up-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink2); }
.up-notes:empty, .up-hint:empty { display: none; }
.up-actions { display: flex; gap: 10px; margin-top: 16px; }
.up-actions .btn { flex: 1; }

/* ---------- 句子拆解 ---------- */
.btn.parse { background: var(--brand-soft); color: var(--brand); }
.p-trans { margin-top: 4px; font-size: 14px; background: var(--soft); border-radius: 12px; padding: 10px 13px; }
.p-trans b { color: var(--ink2); font-weight: 600; }
.p-sectitle { font-size: 13px; font-weight: 800; margin: 14px 0 8px; }
.p-sectitle i { font-style: normal; font-weight: 400; color: var(--ink2); font-size: 11.5px; margin-left: 4px; }

.chain { display: flex; flex-direction: column; }
.chain-node { display: flex; align-items: flex-start; gap: 8px; animation: fadeUp .3s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.chain-node .role { flex-shrink: 0; min-width: 44px; text-align: center; font-size: 11px; color: #fff; border-radius: 6px; padding: 2px 7px; margin-top: 2px; }
.chain-node .chain-text { font-size: 14.5px; border-radius: 8px; padding: 2px 7px; line-height: 1.7; }
.chain-link {
  width: 2px; height: 12px; margin-left: 28px; background: var(--soft2); position: relative; margin-top: 1px; margin-bottom: 1px;
  transform-origin: top center; animation: barGrow .3s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms);
}
.chain-link::after {
  content: ''; position: absolute; bottom: -1px; left: -2.5px;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 5px solid var(--soft2);
}
.c0 { background: #e8f0fe; color: #1a56c4; } .r0 { background: #5b8af7; }
.c1 { background: #fde8e8; color: #c43030; } .r1 { background: #ef5350; }
.c2 { background: #ede7f6; color: #5e35b1; } .r2 { background: #7e57c2; }
.c3 { background: #e0f2f1; color: #00695c; } .r3 { background: #26a69a; }
.c4 { background: #fef3e2; color: #b26a00; } .r4 { background: #f6a723; }
.c5 { background: #fce4ec; color: #ad1457; } .r5 { background: #ec407a; }
/* 深色下成分色块换成暗色透明底 + 高亮文字 */
:root[data-theme="dark"] .c0 { background: rgba(91, 138, 247, .18); color: #a7c0ff; }
:root[data-theme="dark"] .c1 { background: rgba(239, 83, 80, .18); color: #ff9e9b; }
:root[data-theme="dark"] .c2 { background: rgba(126, 87, 194, .22); color: #cbb3f0; }
:root[data-theme="dark"] .c3 { background: rgba(38, 166, 154, .18); color: #7fd6cc; }
:root[data-theme="dark"] .c4 { background: rgba(246, 167, 35, .18); color: #ffcf7d; }
:root[data-theme="dark"] .c5 { background: rgba(236, 64, 122, .18); color: #f79cc0; }
/* 深色下目标词下划线降亮，避免刺眼 */
:root[data-theme="dark"] .tw { border-bottom-color: rgba(125, 138, 255, .45); }

.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 10px; animation: fadeUp .3s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 65ms); }
.step-no {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.step-body { flex: 1; background: var(--soft); border-radius: 10px; padding: 8px 12px; }
.step-body b { font-size: 13.5px; color: var(--brand); }
.step-body p { margin: 2px 0 0; font-size: 13px; line-height: 1.75; color: var(--ink-body); }
.step-link { margin-left: 10px; }

.gram-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gram-chip {
  border: 1px solid var(--line); background: var(--card-solid); color: var(--ink);
  border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 600;
  animation: popIn .28s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), transform .18s var(--spring);
}
.gram-chip:active { transform: scale(.94); background: var(--brand-soft); }
.gd-head { display: flex; align-items: center; gap: 8px; }
.gd-name { font-size: 19px; font-weight: 800; }
.gd-brief { margin-top: 8px; font-size: 14px; }
.gd-formula {
  margin-top: 10px; background: var(--brand-soft); color: var(--brand);
  border-radius: 10px; padding: 9px 13px; font-size: 13.5px; font-weight: 700;
}
.gd-explain { margin-top: 10px; font-size: 13.5px; line-height: 1.85; color: var(--ink-body); }
.gd-exs { margin-top: 10px; }
.gd-ex { background: var(--soft); border-radius: 10px; padding: 9px 12px; margin-bottom: 7px; font-size: 13.5px; }
.gd-ex .cn { color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
.p-back { border: none; background: none; color: var(--brand); font-size: 13px; padding: 4px 0; margin-bottom: 8px; transition: transform .16s var(--spring), opacity .2s; }
.p-back:active { transform: translateX(-3px); opacity: .7; }
.p-load { text-align: center; color: var(--ink2); padding: 20px 0; font-size: 14px; animation: fadeUp .26s var(--ease-out) backwards; }
.p-load::after { content: ''; display: block; width: 26px; height: 26px; margin: 10px auto 0; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.ai-ask-box { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.ai-ask-row { display: flex; gap: 8px; align-items: center; }
.ai-ask-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: var(--card-solid); color: var(--ink); font: inherit; font-size: 13px; }
.ai-ask-row input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.ai-ask-result { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.ai-ask-result:empty { display: none; }
.sense-line.sense-primary { background: var(--brand-soft); border-radius: 6px; padding: 3px 6px; margin-left: -6px; margin-right: -6px; }
.sense-key { display: inline-block; margin-right: 5px; color: var(--brand); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .04em; }

/* 骨架屏：网络请求期间保留版式，避免内容跳变 */
.skel { position: relative; overflow: hidden; background: var(--soft2); border-radius: 10px; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: translateX(-100%); animation: shimmer 1.15s var(--ease-out) infinite;
}
:root[data-theme="dark"] .skel::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
}
.dict-list.loading { opacity: .5; transition: opacity .2s var(--ease); }

/* ================= Toast ================= */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-pad) + 16px);
  background: var(--toast-bg); color: #fff; padding: 11px 20px;
  border-radius: 999px; font-size: 14px; z-index: 99; max-width: 86vw; text-align: center;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
  transform: translate3d(-50%, 16px, 0) scale(.96);
  transition: opacity .2s var(--ease), transform .32s var(--spring);
}
.toast.show { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
.toast.out { opacity: 0; transform: translate3d(-50%, 10px, 0) scale(.98); transition-duration: .24s; }

/* ================= 白噪音 ================= */
.noise {
  position: fixed; right: 14px; bottom: calc(var(--tabbar-pad) + 14px); z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
/* 面板弹出不得挤压圆形按钮：面板绝对定位到按钮上方，按钮位置永远锚在视口右下 */
.noise-panel { position: absolute; right: 0; bottom: calc(100% + 10px); }
.noise-btn {
  position: relative; width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; border: none;
  background: var(--card-solid); box-shadow: var(--shadow); font-size: 19px; color: var(--ink2);
  transition: transform .18s var(--spring), background-color .25s var(--ease);
}
.noise-btn:active { transform: scale(.9); }
.noise-btn.playing { background: var(--brand-soft); }
.noise-btn svg { width: 21px; height: 21px; display: block; margin: 0 auto; }
/* 呼吸光环用伪元素 transform/opacity 动画，避免逐帧重绘 box-shadow */
.noise-btn.playing::before {
  content: ''; position: absolute; inset: -1px; border-radius: 50%;
  border: 2px solid rgba(86, 102, 245, .45); pointer-events: none;
  animation: ringOut 2s var(--ease-out) infinite; will-change: transform, opacity;
}
@keyframes ringOut { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
.noise-panel {
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-item); box-shadow: var(--shadow);
  padding: 14px; width: 232px; transform-origin: bottom right;
}
.noise-panel.on { animation: panelPop .26s var(--spring) backwards; transform-origin: bottom right; }
@keyframes panelPop { from { opacity: 0; transform: translateY(10px) scale(.9); } }
.np-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.np-types { display: flex; flex-wrap: wrap; gap: 6px; }
.np-type { border: none; background: var(--soft2); color: var(--ink2); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; transition: background-color .22s var(--ease), color .22s var(--ease), transform .16s var(--spring); }
.np-type.active { background: var(--brand); color: #fff; }
.np-type:active { transform: scale(.94); }
.np-vol { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.np-vol-lab { font-size: 12.5px; color: var(--ink2); flex-shrink: 0; }
.np-vol input { flex: 1; accent-color: var(--brand); }

/* ============ 全屏新手引导：整屏分页，左滑推进 ============ */
.intro {
  position: fixed; inset: 0; z-index: 200;
  background-color: var(--bg); background-image: var(--ambient); color: var(--ink);
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 22px calc(16px + env(safe-area-inset-bottom, 0px));
  opacity: 0; transition: opacity .26s var(--ease-out);
}
.intro.on { opacity: 1; }
.intro-bar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.intro-bar .intro-mark { width: 58px; height: 21px; margin: 0; }
.intro-skip { border: none; background: none; padding: 4px 2px; font-size: 13px; color: var(--ink2); transition: color .2s var(--ease); }
/* 横向归拖拽，纵向仍可滚：pan-y 必须写在真正的滚动容器上，否则合成器会先接管手势并发 pointercancel */
.intro-view { flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: pan-y; }
.intro-track { display: flex; height: 100%; will-change: transform; }
.intro-pg { position: relative; flex: 0 0 100%; width: 100%; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; }
/* 单页内容超高时只在本页内滚，不把整条 track 顶开。
   顶部留固定高度的白：每页的眉标落在同一条横线上，翻页时视线不用重新找位置 */
.intro-in { max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8.5vh 0 10px; touch-action: pan-y; }
.intro-pg.seen .intro-in > * { animation: fadeUp .44s var(--ease-out) backwards; }
.intro-pg.seen .intro-in > :nth-child(2) { animation-delay: .05s; }
.intro-pg.seen .intro-in > :nth-child(3) { animation-delay: .1s; }
.intro-pg.seen .intro-in > :nth-child(4) { animation-delay: .15s; }
.intro-pg.seen .intro-in > :nth-child(5) { animation-delay: .2s; }
.intro-k { font-family: var(--font-label); font-size: 11.5px; font-weight: 700; letter-spacing: var(--label-track); color: var(--brand); }
.intro-h { font-family: var(--font-disp); font-size: 23px; font-weight: 800; line-height: 1.42; letter-spacing: -.2px; margin: 9px 0 0; }
.intro-p { font-size: 13.5px; line-height: 1.8; color: var(--ink2); margin: 15px 0 0; }
/* 中文可以逐字断行，但「一次次」「用上一次」是一个词，不许被行宽劈开 */
.nb { white-space: nowrap; }
.intro-hint { display: flex; align-items: center; gap: 7px; margin-top: 22px; font-size: 11.5px; letter-spacing: .06em; color: var(--ink2); }
/* 抖的是「往左拖」这个手势本身，所以只给手指那条箭头加动画；指针设备改看静态键帽 */
.intro-hint .ih-ar { display: inline-block; font-family: var(--font-num); margin-left: 7px; animation: nudgeX 1.9s var(--ease) infinite; }
.ih-key { display: none; }
.kc {
  display: inline-block; min-width: 21px; margin: 0 3px; padding: 1px 5px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--card-solid);
  font-family: var(--font-num); font-size: 11px; line-height: 1.35; text-align: center; color: var(--ink);
}
@keyframes nudgeX { 0%, 62%, 100% { transform: translateX(0); opacity: .5; } 78% { transform: translateX(-7px); opacity: 1; } }
/* 复习排期：一条真正的遗忘曲线。记忆每衰减到低点，正好有下一次复习把它拉回顶部；
   锯齿一个比一个浅，间隔一个比一个长，这就是背了不忘的全部机制。
   曲线跟着正文往下走一段再出现，让空白沉到页面底部而不是横在中间 */
.intro-axis { margin-top: 118px; }
.ia-cap, .intro-cap { font-family: var(--font-label); font-size: 11px; letter-spacing: var(--label-track); color: var(--ink2); }
.intro-cap { margin-top: 30px; }
.ia-curve { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.ia-base { stroke: var(--rule); stroke-width: 1; }
.ia-run { fill: none; stroke: var(--brand); stroke-width: 1.3; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 0; opacity: .82; }
.intro-pg.seen .ia-run { animation: iaDraw 1.15s var(--ease-out) .12s backwards; }
@keyframes iaDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.intro-pg.seen .ia-dots { animation: fadeIn .5s var(--ease-out) .66s backwards; }
.ia-dot { fill: var(--brand); rx: 3.5px; ry: 3.5px; }
.ia-line { position: relative; height: 15px; margin-top: 5px; }
.ia-line b { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--font-num); font-size: 11.5px; font-weight: 400; line-height: 1; color: var(--ink2); }

.intro-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
/* 13 本词库落单的那张卡横跨两列，不给它留半个空格 */
.intro-list > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.intro-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  border: 1.5px solid var(--line); background: var(--card-solid); border-radius: var(--r-item); padding: 11px 12px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), transform .18s var(--spring);
}
.intro-row:active { transform: scale(.97); }
.intro-row b { font-size: 14px; font-weight: 700; line-height: 1.4; }
.intro-row span { font-size: 11.5px; color: var(--ink2); }
.intro-row.sel { border-color: var(--brand); background: var(--brand-soft); }
.intro-row.sel span { color: var(--brand); }
.intro-chips { display: flex; gap: 8px; margin-top: 18px; }
.intro-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 1.5px solid var(--line); background: var(--card-solid); border-radius: 12px; padding: 12px 0 9px;
  font-family: var(--font-num); font-size: 17px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), transform .18s var(--spring);
}
.intro-chip i { font-family: var(--font-ui); font-style: normal; font-size: 11px; font-weight: 400; line-height: 1.2; color: var(--ink2); }
.intro-chip:active { transform: scale(.95); }
.intro-chip.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.intro-chip.sel i { color: var(--brand); opacity: .8; }
.intro-ol { list-style: none; counter-reset: istep; margin: 18px 0 0; padding: 0; }
.intro-ol li { counter-increment: istep; position: relative; padding-left: 30px; margin-top: 13px; }
.intro-ol li:first-child { margin-top: 0; }
.intro-ol li::before {
  content: counter(istep); position: absolute; left: 0; top: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-family: var(--font-num); font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.intro-ol b { display: block; font-size: 14px; font-weight: 700; }
.intro-ol span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.65; color: var(--ink2); }

/* 末页的确认清单：把前两页选下来的东西回读一遍，主动作才有落点 */
.intro-sum { margin: 26px 0 0; border-top: 1px solid var(--rule); }
.intro-sum > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.intro-sum dt { font-size: 13px; color: var(--ink2); }
.intro-sum dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); text-align: right; }

/* 第 4、5 页页底的实机缩略：直接挂真实类名（.wordcard/.card.article/.popup），
   皮肤与明暗靠既有规则跟随，这里只压尺寸、不另造一套视觉 */
.intro-pg .im-mock { margin: 26px 0 0; min-height: 0; animation: none; }
.intro-pg .im-mock .wc-tags { margin-bottom: 9px; }
.intro-pg .im-mock .wc-word { font-size: 26px; }
.intro-pg .im-mock .wc-phon { font-size: 13px; margin-top: 2px; }
.intro-pg .im-mock .wc-trans { margin-top: 13px; font-size: 14.5px; line-height: 1.6; }
.intro-pg .im-mock .wc-sent { margin-top: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; }
.intro-pg .im-mock .wc-sent .cn { font-size: 12.5px; }
.intro-pg .im-mock .grade-row { margin-top: 12px; gap: 8px; }
.intro-pg .im-mock .btn, .intro-pg .im-sheet .btn { display: flex; align-items: center; justify-content: center; }
.intro-pg .im-mock .btn.grade { min-height: 46px; padding: 0; font-size: 14px; }
.intro-pg .article.im-mock h2 { font-size: 17px; line-height: 1.4; margin-bottom: 4px; }
.intro-pg .article.im-mock .art-text { font-size: 13.5px; line-height: 1.85; }
.intro-pg .article.im-mock .art-text p { margin: 0; }
.intro-pg .im-sheet { margin-top: 10px; border: 1px solid var(--card-line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.intro-pg .im-sheet .popup { border: 0; border-radius: 0; padding: 14px 16px 16px; animation: none; }
.intro-pg .im-sheet .popup-head .pw { font-size: 19px; }
.intro-pg .im-sheet .popup-body { margin-top: 7px; font-size: 14px; }
.intro-pg .im-sheet .popup-actions { margin-top: 13px; gap: 8px; }
.intro-pg .im-sheet .popup-actions .btn { flex: 1 1 40%; min-width: 0; min-height: 38px; padding: 0; font-size: 13px; }

.intro-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; }
.intro-dots { display: flex; align-items: center; gap: 5px; }
.intro-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--soft2); transition: background .28s var(--ease), width .28s var(--ease-out); }
.intro-dots i.on { width: 17px; background: var(--brand); }
.intro-go { min-width: 116px; }
/* 手机端不占这条 foot（往右拖就是回退）；≥700px 才露出来，见下面的桌面块 */
.intro-back { display: none; }

/* ================= 首次设置向导 ================= */
.setup-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(13, 17, 34, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .28s var(--ease-out) backwards;
}
.setup-mask.closing { animation: maskOut .22s var(--ease) forwards; }
.setup-card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card); box-shadow: 0 24px 60px -12px rgba(13, 17, 34, .5);
  width: min(92vw, 400px); padding: 26px 22px 22px; text-align: center;
  max-height: 90vh; overflow-y: auto;
}
.setup-card.on { animation: cardSwap .34s var(--ease-out) backwards; }
@keyframes cardSwap { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.setup-mask.closing .setup-card { animation: popOut .22s var(--ease) forwards; }
@keyframes popOut { to { opacity: 0; transform: scale(.96); } }
/* 品牌标记：和启动页同一个 wordmark，用蒙版取当前皮肤的字色 */
.su-logo {
  width: 86px; height: 32px; margin: 0 auto; background: var(--ink);
  -webkit-mask: url("img/wordmark.png") center / 100% 100% no-repeat;
  mask: url("img/wordmark.png") center / 100% 100% no-repeat;
}
.su-title { font-size: 21px; font-weight: 800; margin-top: 12px; }
.su-sub { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.setup-card .btn { width: 100%; }
.setup-card .btn:disabled { opacity: .4; }

/* ================= 词条笔记（卡片内） ================= */
.wc-notes { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.notes-title { font-size: 13px; font-weight: 700; color: var(--ink2); margin-bottom: 8px; }
.note-item {
  display: flex; align-items: flex-start; gap: 8px; background: var(--note-bg); border: 1px solid var(--note-border);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; font-size: 13.5px; line-height: 1.6;
  animation: fadeUp .28s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.note-item span { flex: 1; word-break: break-word; white-space: pre-wrap; }
.note-del { border: none; background: none; color: var(--ink3); font-size: 12px; padding: 0 2px; }
.note-del:hover { color: var(--red); }
.note-add { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-add input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; background: var(--card-solid); color: var(--ink);
  font-size: 15px; outline: none; min-width: 0;
}

/* ================= 作业成绩 / 全文翻译 ================= */
.quiz-result {
  display: flex; align-items: center; gap: 16px;
  background: var(--brand); color: #fff;
  border-radius: var(--r-item); padding: 16px 20px; margin: 12px 0 4px;
  box-shadow: 0 8px 20px -10px rgba(86, 102, 245, .42);
  animation: scorePop .5s var(--spring) backwards;
}
@keyframes scorePop { from { opacity: 0; transform: translateY(14px) scale(.92); } }
.qr-score { font-size: 38px; font-weight: 800; line-height: 1; }
.qr-score span { font-size: 15px; font-weight: 600; margin-left: 2px; }
.qr-score .qr-num { font-size: inherit; font-weight: inherit; margin-left: 0; }
.qr-text { font-size: 13.5px; line-height: 1.7; }
.qr-text b { font-size: 14px; }
.art-actions { margin: 4px 0 10px; }
.art-actions .btn { width: 100%; }
.art-translation {
  background: var(--soft); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
  font-size: 14.5px; line-height: 1.9; color: var(--ink-body);
  animation: fadeUp .3s var(--ease) backwards;
}
.art-translation p { margin: 0 0 10px; }
.art-translation .p-sectitle { margin-top: 0; }

/* ================= 删除 / 收起 ================= */
.removing { animation: itemOut .22s var(--ease) forwards; }
@keyframes itemOut { to { opacity: 0; transform: translate3d(-14px, 0, 0) scale(.96); } }

/* ================= 指针设备：hover 反馈 ================= */
@media (hover: hover) and (pointer: fine) {
  /* hover 规则写在文件末尾，必须排除 :active，否则按压反馈会被后写的 hover 覆盖 */
  .btn:not(:disabled):not(:active):hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
  .task-btn:not(:active):hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
  .btn.primary:not(:disabled):hover { box-shadow: var(--btn-sh-hover); }
  .btn.ghost:not(:disabled):hover { background: var(--brand-soft); }
  .btn.danger:not(:disabled):hover { background: var(--red-soft); }
  .art-item:not(:active):hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
  .art-item .art-del { display: block; }
  .art-item .art-del:hover { color: var(--red); background: var(--red-soft); }
  .dict-item:hover { box-shadow: var(--shadow-lift); }
  .dict-item .row1:hover { background: var(--soft); }
  .chip:not(.active):hover { color: var(--ink); }
  .gram-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
  .intro-skip:hover { color: var(--ink); }
  .intro-row:not(:active):hover { border-color: var(--brand); }
  .intro-chip:not(:active):not(.sel):hover { border-color: var(--brand); }
  .tab:hover:not(.active) { color: var(--ink); }
  .q-item .qc div:hover:not(.right):not(.wrong):not(:active) { border-color: var(--brand); background: #fbfcff; }
  .noise-btn:not(:active):hover { transform: translateY(-2px); }
  .popup-close:hover { background: var(--red-soft); color: var(--red); }
  .note-del:hover { color: var(--red); }
  a.btn:hover { filter: brightness(1.02); }
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ================= 桌面端 (>=768px)：方向 2 静奢极简无界工作台 ================= */
@media (min-width: 768px) {
  /* 1. 隐藏移动端底部悬浮栏，释放全部底部视口 */
  .tabbar { display: none !important; }

  /* 2. 左侧 72px 悬浮微 Dock (钛黑毛玻璃、微边框、呼吸高亮) */
  .desktop-dock {
    display: flex !important;
    position: fixed; left: 24px; top: 50%; transform: translateY(-50%);
    width: 68px; padding: 22px 0;
    background: var(--tabbar-bg);
    backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--card-line);
    border-radius: 26px;
    box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    flex-direction: column; align-items: center; justify-content: space-between;
    z-index: 50; gap: 20px;
    animation: fadeIn .3s var(--ease-out);
  }
  .dock-brand {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  }
  .dock-logo {
    font-size: 20px; font-weight: 900; letter-spacing: -1px; color: var(--ink);
    font-family: var(--font-disp, -apple-system, sans-serif);
  }
  .dock-dot { color: #38bdf8; font-style: normal; }
  .dock-items {
    display: flex; flex-direction: column; gap: 14px; align-items: center; width: 100%;
  }
  .dock-item {
    position: relative; width: 46px; height: 46px; border-radius: 14px;
    border: 1px solid transparent; background: transparent; color: var(--ink2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s var(--ease);
  }
  .dock-item .ico svg { width: 20px; height: 20px; display: block; }
  .dock-label { display: none; }
  .dock-item:hover { color: var(--ink); background: rgba(125, 125, 125, 0.12); transform: scale(1.06); }
  .dock-item.active {
    color: #38bdf8; background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 4px 16px -2px rgba(56, 189, 248, 0.25);
  }
  .dock-item .badge {
    position: absolute; top: 4px; right: 4px; min-width: 14px; height: 14px;
    border-radius: 99px; background: var(--brand); color: #fff; font-size: 9px; font-weight: 700;
    display: none; align-items: center; justify-content: center; padding: 0 3px;
  }
  .dock-item .badge:not(:empty) { display: flex; }

  /* 3. 宽屏视口拓展至 1060px，为左侧微 Dock 留出呼吸留白 */
  main {
    max-width: 1060px; margin: 0 auto;
    padding-left: 98px; padding-right: 28px;
    padding-bottom: 40px;
  }
  .topbar {
    max-width: 1060px; margin: 0 auto;
    padding-left: 98px; padding-right: 28px;
  }

  /* 5. 桌面端卡片与背词舞台：静奢微发光与极细磨砂边框 */
  .wordcard {
    min-height: 400px;
    max-width: 820px;
    margin-inline: auto;
    width: 100%;
    border: 1px solid var(--card-line);
    box-shadow: 0 20px 54px -16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  #studyWrap {
    max-width: 820px;
    margin-inline: auto;
    width: 100%;
  }
  .triage-row, .grade-row {
    max-width: 820px;
    margin-inline: auto;
    width: 100%;
  }

  /* 首页常驻活动卡片在大屏上的居中 */
  .home-top { max-width: 820px; margin-inline: auto; width: 100%; }
  #homeMain { max-width: 820px; margin-inline: auto; width: 100%; }
  /* —— 新手引导：电脑端不是把手机那一屏拉宽，而是收进和正文同宽的一条列。
     轨道仍按视口宽滑页（intro.w 不变，拖拽/键盘/动效都不用改），只有列内的东西回到 720；
     曲线、每日词量、三档自评共用一个「插图宽度」460，列里才有第二条可对齐的竖线。 */
  .intro { --intro-col: 720px; --intro-fig: 460px; }
  .intro-bar, .intro-foot { width: min(100%, var(--intro-col)); margin-inline: auto; }
  /* margin:auto 而不是 justify-content:center：内容超高时 auto 边距自己塌成 0，页内滚动照常，不会裁掉顶部。
     底部留 13px ≥ fadeUp 的 12px 位移，否则入场动画那一拍会把滚动条闪出来一下（桌面是经典滚动条，占位可见）。 */
  .intro-in { width: min(100%, var(--intro-col)); margin: auto; padding: 18px 0 13px; }
  /* 列宽翻倍之后要收的是行长，不是字号：四套皮肤各自定了 display/body 字号（.intro-h/.intro-p/.intro-k），
     桌面块去改字号只会让 frost/deck 生效、editorial/instrument 被自己的规则挡住（皮肤分叉）。
     34em 是按字符数收，中文一行约 34 字，任何字号下落地的都是同一个阅读宽度。 */
  .intro-p { max-width: 34em; }
  .intro-axis { width: min(100%, var(--intro-fig)); margin-top: 44px; }
  .intro-chips { max-width: var(--intro-fig); }
  /* 落单的那本词库横跨 720 会扁成一条横幅，改成「名称 ← 词数」的一行式收尾 */
  .intro-list > :last-child:nth-child(odd) { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; }
  /* 回退用文本键（和「跳过」同一套语言），不占主按钮的位置也不和它抢重量；
     JS 只切 visibility，所以「下一步」的右沿在有/无上一步时不动 */
  .intro-back { display: inline-block; margin-left: auto; padding: 12px 10px; transition: color .2s var(--ease), transform .18s var(--spring); }
  .intro-back:active { transform: scale(.97); }
  /* 三块「图」共用一个宽度：曲线、词量胶囊、实机缩略。列里只有两条竖线可对齐，
     缩略卡按 720 铺满的话，三档自评会被拉成 400px 宽的大按钮，就不像「一张卡片」了 */
  .intro-pg .im-mock, .intro-pg .im-sheet { width: min(100%, var(--intro-fig)); margin-top: 20px; }
}
/* 键盘提示只给真有键盘鼠标的设备：宽屏平板（≥700px 但手指）仍然该看到「向左滑动」 */
@media (min-width: 700px) and (pointer: fine) {
  .ih-touch { display: none; }
  .ih-key { display: inline; }
}
@media (max-width: 380px) {
  .brand b { display: none; }
  .ci-dot { width: 17px; height: 17px; line-height: 17px; }
  .field > span { width: 96px; }
  .ci-big b { font-size: 48px; }
  .task-btn .tb-count { font-size: 34px; }
}

/* ================= 冷启动闪屏：声波语脉 · 音标波形 =================
   以语音与声学频谱为视觉锚点，突出「听音辨义 × 原生自然朗读」的现代数字工具质感。
   构图放在网页里，跟着热更新走，不用重新打包 APK。 */
html.no-boot #boot { display: none !important; }
.boot {
  position: fixed; inset: 0; z-index: 9999; overflow: hidden; background-color: #080c14;
  color: #f8fafc; display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.boot-content {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 360px; padding: 20px;
  animation: bootContentIn .45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.boot-glow {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0.9;
}
.boot-mark {
  position: relative; display: flex; align-items: baseline;
  font-family: var(--font-disp, -apple-system, sans-serif);
  font-size: 48px; font-weight: 800; letter-spacing: -1.5px;
  color: #ffffff; line-height: 1;
}
.boot-char-i { position: relative; display: inline-block; }
.boot-i-dot {
  position: absolute; top: 3px; left: 50%; width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%; background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 18px var(--brand);
  animation: bootPulseDot 1.4s ease-in-out infinite;
}

/* 音频声学频谱条 */
.boot-spectrum {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; margin-top: 24px;
}
.boot-bar {
  width: 4px; border-radius: 3px;
  background: linear-gradient(180deg, #38bdf8 0%, var(--brand) 100%);
  animation: bootSoundWave 1.2s ease-in-out infinite alternate;
}
.boot-bar:nth-child(1) { height: 12px; animation-delay: 0.1s; }
.boot-bar:nth-child(2) { height: 26px; animation-delay: 0.35s; }
.boot-bar:nth-child(3) { height: 34px; animation-delay: 0.15s; background: linear-gradient(180deg, #60a5fa 0%, #a855f7 100%); }
.boot-bar:nth-child(4) { height: 20px; animation-delay: 0.45s; }
.boot-bar:nth-child(5) { height: 10px; animation-delay: 0.2s; }

.boot-sub {
  margin-top: 20px; font-size: 11.5px; color: var(--ink2);
  letter-spacing: 2px; text-transform: uppercase; font-weight: 600;
  animation: fadeIn .4s var(--ease-out) .15s backwards;
}
.boot-phonetic {
  font-family: "Courier Prime", monospace, sans-serif;
  font-size: 13px; color: var(--ink3); margin-top: 5px; letter-spacing: 0.5px;
  animation: fadeIn .4s var(--ease-out) .25s backwards;
}

@keyframes bootContentIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes bootPulseDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px #38bdf8; }
  50% { transform: scale(1.4); box-shadow: 0 0 16px #38bdf8, 0 0 24px var(--brand); }
}
@keyframes bootSoundWave {
  0% { transform: scaleY(0.3); opacity: 0.45; }
  100% { transform: scaleY(1.15); opacity: 1; }
}

/* 退场：声波与字标平滑上浮微淡出 */
.boot.out { opacity: 0; pointer-events: none; transition: opacity .26s var(--ease); }
.boot.out .boot-content { animation: bootContentOut .24s var(--ease) forwards; }
@keyframes bootContentOut { to { opacity: 0; transform: translateY(-14px) scale(0.97); } }

/* ============================================================
   皮肤（<html data-style>）：四套界面风格，各自带深色
   深浅色轴照常工作：浅色块用 :root[data-style=x]，深色块用
   :root[data-style=x][data-theme=dark]（权重更高，只重述颜色令牌，
   圆角/字族/尺寸由浅色块继续生效）。
   文件开头的 :root 是「薄雾留白」的回退值：JS 未执行时界面依然完整。
   ============================================================ */

/* ---------- 01 排印辞书 —— 默认。辞书细线分栏，衬线词条，印泥朱砂单一点色 ---------- */
:root[data-style="editorial"] {
  --bg: #f6f4ef;
  --ambient: none;
  --ambient: none;
  --card: #fbfaf6;
  --card-solid: #fffdf8;
  --card-line: #e7e2d7;
  --ink: #201f1c;
  --ink-body: #3c3831;
  --ink2: #6b665c;
  --ink3: #b3ab9b;
  --brand: #9e3b2e;
  --brand-soft: rgba(158, 59, 46, .09);
  --green: #3f6b4d;    --green-soft: rgba(63, 107, 77, .12);
  --amber: #8a5a12;    --amber-soft: rgba(138, 90, 18, .13);
  --red: #9e3b2e;      --red-soft: rgba(158, 59, 46, .10);
  --violet: #5a4a7a;   --violet-soft: rgba(90, 74, 122, .10);
  --soft: rgba(32, 31, 28, .05);
  --soft2: rgba(32, 31, 28, .09);
  --toast-bg: rgba(32, 31, 28, .94);
  --tabbar-bg: #f6f4ef;
  --topbar-bg: rgba(246, 244, 239, .92);
  --line: rgba(32, 31, 28, .13);
  --rule: #d7d1c4;
  --boot-rule: #c9c2b2;
  --boot-dot: #8c8474;
  --shadow: none;
  --shadow-lift: none;
  --btn-sh: none;
  --btn-sh-hover: none;
  --font-disp: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --font-num: var(--font-disp);
  --blur: none;
  --r-card: 0px; --r-item: 0px; --r-ctl: 0px; --r-pill: 0px;
  --pad-word: 22px 0;
  --wc-align: left; --wc-justify: flex-start;
  --num-w: 600; --num-track: 0px;
  --label-w: 600; --label-track: .2px;
  --tag-tf: none; --tag-track: 0px;
  --hw-size: 44px; --hw-w: 600; --hw-track: 0px;
}
:root[data-style="editorial"][data-theme="dark"] {
  --bg: #141311;
  --card: #1b1a17;
  --card-solid: #211f1b;
  --card-line: #332f28;
  --ink: #e8e4da;
  --ink-body: #c6bfb2;
  --ink2: #948b7b;
  --ink3: #5b554b;
  --brand: #c8604e;
  --brand-soft: rgba(200, 96, 78, .14);
  --green: #7ba588;    --green-soft: rgba(123, 165, 136, .15);
  --amber: #c08e42;    --amber-soft: rgba(192, 142, 66, .15);
  --red: #c8604e;      --red-soft: rgba(200, 96, 78, .15);
  --violet: #9a8bb8;   --violet-soft: rgba(154, 139, 184, .15);
  --soft: rgba(232, 228, 218, .05);
  --soft2: rgba(232, 228, 218, .10);
  --toast-bg: rgba(48, 44, 38, .96);
  --tabbar-bg: #141311;
  --topbar-bg: rgba(20, 19, 17, .92);
  --line: rgba(232, 228, 218, .14);
  --rule: #3a352c;
  --boot-rule: #4a443a;
  --boot-dot: #8a8172;
}
/* 区块不再靠卡片底色分块，改用一条细线；文字与页面左边距对齐 */
:root[data-style="editorial"] .home-top { flex: 0 0 auto; justify-content: flex-start; }
/* 每日一句：与正文同起排，署名是这一栏唯一的朱砂 */
:root[data-style="editorial"] .dq { text-align: left; }
:root[data-style="editorial"] .dq-en { font-size: 16px; color: var(--ink); }
:root[data-style="editorial"] .dq-by { color: var(--brand); }
/* 引导页：衬线标题挑大梁，选项只靠一条细线和字色分层，不铺底色 */
:root[data-style="editorial"] .intro-h { font-size: 25px; line-height: 1.38; font-weight: 600; letter-spacing: -.1px; }
:root[data-style="editorial"] .intro-p { font-size: 14px; line-height: 1.85; color: var(--ink-body); }
:root[data-style="editorial"] .intro-row, :root[data-style="editorial"] .intro-chip { background: transparent; border-color: var(--rule); border-width: 1px; }
:root[data-style="editorial"] .intro-row.sel, :root[data-style="editorial"] .intro-chip.sel { background: transparent; border-color: var(--ink); color: var(--ink); }
:root[data-style="editorial"] .intro-row.sel span, :root[data-style="editorial"] .intro-chip.sel i { color: var(--brand); opacity: 1; }
:root[data-style="editorial"] .intro-ol li::before { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink2); }
/* 报头吃满上半区：日期—数字—按钮—提示沿顶部起排，连续打卡点沉到报头底边 */
:root[data-style="editorial"] .checkin-hero { display: block; }
:root[data-style="editorial"] .ci-days { margin-top: auto; }
:root[data-style="editorial"] .checkin-hero .ci-btn { align-self: flex-start; }
:root[data-style="editorial"] .card {
  background: transparent; border: 0; border-top: 1px solid var(--rule);
  border-radius: 0; box-shadow: none; padding: 18px 0 16px; margin-bottom: 0;
}
:root[data-style="editorial"] .card h3 { font-family: var(--font-disp); font-weight: 600; font-size: 17px; letter-spacing: .2px; }
:root[data-style="editorial"] .checkin-hero { padding: 26px 0 22px; text-align: left; }
:root[data-style="editorial"] .ci-big { justify-content: flex-start; }
:root[data-style="editorial"] .ci-days { justify-content: flex-start; }
:root[data-style="editorial"] .ci-dot { background: transparent; color: var(--ink2); box-shadow: inset 0 0 0 1px var(--rule); }
:root[data-style="editorial"] .ci-dot.on { background: var(--ink); color: var(--bg); box-shadow: none; }
:root[data-style="editorial"] .ci-dot.today { box-shadow: inset 0 0 0 2px var(--ink); }
:root[data-style="editorial"] .task-btn {
  background: transparent; border: 1px solid var(--rule); box-shadow: none;
  align-items: flex-start; padding: 16px 14px 15px;
}
:root[data-style="editorial"] .task-btn .tb-count { color: var(--ink); }
:root[data-style="editorial"] .tb-review .tb-count { color: var(--green); }
:root[data-style="editorial"] .wordcard {
  background: transparent; border: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
  box-shadow: none; justify-content: flex-start; padding-top: 20px;
}
:root[data-style="editorial"] .tag { background: transparent; padding: 0; }
:root[data-style="editorial"] .tag.stage { color: var(--ink3); }
:root[data-style="editorial"] .wc-phon { font-size: 14px; letter-spacing: .3px; }
:root[data-style="editorial"] .wc-sent, :root[data-style="editorial"] .wc-exam {
  background: transparent; border-left: 2px solid var(--rule); border-radius: 0; padding-left: 12px;
}
:root[data-style="editorial"] .progress { height: 4px; background: var(--soft2); }
:root[data-style="editorial"] .topsearch { background: transparent; border-color: var(--rule); }
:root[data-style="editorial"] .theme-btn { background: transparent; border: 1px solid var(--rule); box-shadow: none; }
:root[data-style="editorial"] .tabbar { box-shadow: none; }
:root[data-style="editorial"] .tab-ind { border-radius: 0; }
:root[data-style="editorial"] .art-item, :root[data-style="editorial"] .dict-item { box-shadow: none; }
/* 词条列表：辞书的栏线，不是卡片堆 */
:root[data-style="editorial"] .dict-item {
  background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
}
:root[data-style="editorial"] .dict-item .row1 { padding-left: 0; padding-right: 0; }
:root[data-style="editorial"] .dict-item .detail > .dk { padding-left: 0; padding-right: 0; }
:root[data-style="editorial"] .read-list .art-item {
  background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding-left: 0; padding-right: 0;
}

/* ---------- 02 冷静仪表 —— 精密仪表面板：等宽数字、方格刻度、信号青 ---------- */
:root[data-style="instrument"] {
  --bg: #e7eaec;
  --ambient: none;
  --card: #f3f5f6;
  --card-solid: #ffffff;
  --card-line: #d5dade;
  --ink: #14181d;
  --ink-body: #333c44;
  --ink2: #606a74;
  --ink3: #a9b2ba;
  --brand: #0f766e;
  --brand-soft: rgba(15, 118, 110, .10);
  --green: #157f5f;    --green-soft: rgba(21, 127, 95, .12);
  --amber: #b8791f;    --amber-soft: rgba(184, 121, 31, .13);
  --red: #b3403c;      --red-soft: rgba(179, 64, 60, .11);
  --violet: #4a5a8c;   --violet-soft: rgba(74, 90, 140, .10);
  --soft: rgba(20, 24, 29, .05);
  --soft2: rgba(20, 24, 29, .10);
  --toast-bg: rgba(20, 24, 29, .95);
  --tabbar-bg: #e7eaec;
  --topbar-bg: rgba(231, 234, 236, .92);
  --line: rgba(20, 24, 29, .16);
  --rule: #c6ccd1;
  --boot-rule: #b0b8bf;
  --boot-dot: #7b858e;
  --shadow: none;
  --shadow-lift: none;
  --btn-sh: none;
  --btn-sh-hover: none;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  --font-label: var(--font-num);
  --blur: none;
  --r-card: 6px; --r-item: 6px; --r-ctl: 5px; --r-pill: 5px;
  --wc-align: left; --wc-justify: flex-start;
  --num-w: 600; --num-track: -1px;
  --label-w: 600; --label-track: 0px; --label-tf: none;
  --tag-tf: none; --tag-track: 0px;
  --hw-size: 34px; --hw-w: 600; --hw-track: -.3px;
}
:root[data-style="instrument"][data-theme="dark"] {
  --bg: #0f1418;
  --card: #161c22;
  --card-solid: #1a2128;
  --card-line: #2a333b;
  --ink: #dfe5e9;
  --ink-body: #b6c0c8;
  --ink2: #838e98;
  --ink3: #4d5760;
  --brand: #34a89b;
  --brand-soft: rgba(52, 168, 155, .16);
  --green: #46ae87;    --green-soft: rgba(70, 174, 135, .16);
  --amber: #c9903a;    --amber-soft: rgba(201, 144, 58, .16);
  --red: #d9695f;      --red-soft: rgba(217, 105, 95, .16);
  --violet: #8fa0c8;   --violet-soft: rgba(143, 160, 200, .16);
  --soft: rgba(223, 229, 233, .05);
  --soft2: rgba(223, 229, 233, .11);
  --toast-bg: rgba(38, 46, 54, .96);
  --tabbar-bg: #0f1418;
  --topbar-bg: rgba(15, 20, 24, .92);
  --line: rgba(223, 229, 233, .16);
  --rule: #2f3941;
  --boot-rule: #3d4750;
  --boot-dot: #6d7a84;
}
:root[data-style="instrument"] .card { border: 1px solid var(--card-line); box-shadow: none; padding: 14px 16px; }
:root[data-style="instrument"] .card h3 { font-size: 11.5px; font-weight: 600; letter-spacing: .2px; color: var(--ink2); }
:root[data-style="instrument"] .home-top { flex: 0 0 auto; justify-content: flex-start; }
/* 每日一句：英文走等宽（拉丁字符才用等宽），译文留在 UI 字体里 */
:root[data-style="instrument"] .dq { text-align: left; }
:root[data-style="instrument"] .dq-en { font-family: var(--font-num); font-size: 13.5px; line-height: 1.6; letter-spacing: -.2px; }
:root[data-style="instrument"] .dq-by { font-family: var(--font-num); font-size: 11.5px; color: var(--brand); }
:root[data-style="instrument"] .dq-zh { font-size: 12.5px; }
/* 引导页：等宽小标题 + 方角控件，标题不再挑字重，靠字号差分层 */
:root[data-style="instrument"] .intro-k { font-family: var(--font-num); font-size: 10.5px; letter-spacing: .04em; }
:root[data-style="instrument"] .intro-h { font-size: 19px; line-height: 1.45; font-weight: 700; letter-spacing: -.1px; }
:root[data-style="instrument"] .intro-p { font-size: 12.5px; line-height: 1.75; }
:root[data-style="instrument"] .intro-row, :root[data-style="instrument"] .intro-chip { border-width: 1px; border-radius: 4px; background: var(--card); }
:root[data-style="instrument"] .intro-row { padding: 10px 11px; }
:root[data-style="instrument"] .intro-row b { font-size: 13px; }
:root[data-style="instrument"] .intro-ol li::before, :root[data-style="instrument"] .intro-dots i { border-radius: 2px; }
:root[data-style="instrument"] .ia-dot { rx: 1px; ry: 1px; }
:root[data-style="instrument"] .ia-cap, :root[data-style="instrument"] .intro-cap { font-family: var(--font-num); font-size: 10.5px; }
:root[data-style="instrument"] .intro-sum dd { font-size: 13px; }
:root[data-style="instrument"] .intro-ol b { font-size: 13px; }
:root[data-style="instrument"] .intro-ol span { font-size: 12px; }
/* 面板不拉伸：读数块按内容收拢，两块一起顶到页首，留白落在面板之外 */
:root[data-style="instrument"] .checkin-hero { padding: 18px 16px 20px; text-align: left; }
:root[data-style="instrument"] .ci-date, :root[data-style="instrument"] .ci-big i { font-size: 11px; }
:root[data-style="instrument"] .ci-cap { font-family: var(--font-num); font-size: 11px; text-align: left; }
:root[data-style="instrument"] .ci-big { justify-content: flex-start; gap: 10px; }
:root[data-style="instrument"] .ci-days { gap: 2px; justify-content: flex-start; }
:root[data-style="instrument"] .ci-dot { width: 13px; height: 26px; line-height: 26px; border-radius: 2px; font-size: 9px; }
:root[data-style="instrument"] .ci-dot.today { box-shadow: inset 0 0 0 1px var(--bg), 0 0 0 2px var(--brand); }
:root[data-style="instrument"] .checkin-hero .ci-btn { min-width: 0; width: 100%; font-size: 15px; }
:root[data-style="instrument"] .task-btn { border: 1px solid var(--card-line); box-shadow: none; align-items: flex-start; padding: 14px 14px 13px; gap: 1px; }
:root[data-style="instrument"] .task-btn .tb-count { color: var(--ink); }
:root[data-style="instrument"] .task-btn .tb-label { font-size: 11px; }
:root[data-style="instrument"] .task-btn .tb-sub { font-family: var(--font-num); font-size: 10px; }
:root[data-style="instrument"] .tb-review .tb-count { color: var(--green); }
:root[data-style="instrument"] .wordcard { border: 1px solid var(--card-line); box-shadow: none; padding: 18px 16px 16px; justify-content: flex-start; }
:root[data-style="instrument"] .tag { background: transparent; border: 1px solid currentColor; padding: 1px 6px; font-size: 10px; font-family: var(--font-num); }
:root[data-style="instrument"] .wc-phon { font-family: inherit; font-size: 13.5px; letter-spacing: 0.2px; }
:root[data-style="instrument"] .wc-sent, :root[data-style="instrument"] .wc-exam { border: 1px solid var(--rule); border-radius: 4px; }
/* 进度条画成分段刻度：一格一段，读完一格就是学完一段 */
:root[data-style="instrument"] .progress { height: 12px; border-radius: 3px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--rule); }
:root[data-style="instrument"] .progress .bar { border-radius: 3px; background: repeating-linear-gradient(90deg, var(--brand) 0 6px, transparent 6px 9px); }
:root[data-style="instrument"] .progress-text { font-family: var(--font-num); font-size: 11px; letter-spacing: .5px; }
/* 三档评分合成一台仪表开关：选中那一格整块填色 */
:root[data-style="instrument"] .grade-row { gap: 0; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; }
:root[data-style="instrument"] .btn.grade { border-radius: 0; border-right: 1px solid var(--rule); background: var(--card-solid); color: var(--ink2); font-size: 15px; }
:root[data-style="instrument"] .btn.grade:last-child { border-right: 0; }
:root[data-style="instrument"] .btn.forget.sel { background: var(--red); color: var(--on-brand); }
:root[data-style="instrument"] .btn.fuzzy.sel { background: var(--amber); color: var(--on-brand); }
:root[data-style="instrument"] .btn.know.sel { background: var(--green); color: var(--on-brand); }
:root[data-style="instrument"] .tabbar { box-shadow: none; }
:root[data-style="instrument"] .tab .lb { font-size: 10px; }
:root[data-style="instrument"] .topsearch { border-color: var(--rule); }
:root[data-style="instrument"] .theme-btn { background: var(--card-solid); border: 1px solid var(--rule); box-shadow: none; }

/* ---------- 03 薄雾留白 —— 现状深化：更冷的晨光、更完整的层次 ---------- */
:root[data-style="frost"] {
  --bg: #eef1f6;
  --blur: blur(20px) saturate(160%);
  --r-card: 22px;
  --shadow: 0 1px 2px rgba(23, 28, 46, .04), 0 14px 34px -18px rgba(23, 28, 46, .16);
  --shadow-lift: 0 2px 4px rgba(23, 28, 46, .06), 0 20px 44px -20px rgba(23, 28, 46, .22);
}
:root[data-style="frost"][data-theme="dark"] {
  --bg: #0e1220;
  --blur: blur(20px) saturate(160%);
  --r-card: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 14px 34px -18px rgba(0, 0, 0, .55);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .34), 0 20px 44px -20px rgba(0, 0, 0, .62);
}
/* 引导页眉标只有 11.5px：这两套皮肤的品牌色在这个字号上压不满 4.5:1，改走正文字色，品牌色留给圆点和按钮 */
:root[data-style="frost"] .intro-k { color: var(--ink-body); }

/* ---------- 04 字卡墙 —— 破套路：产品自己的实物是一叠词卡，卡片有厚度 ---------- */
:root[data-style="deck"] {
  --bg: #efe9df;
  --ambient: none;
  --card: #fbf8f2;
  --card-solid: #fffdf7;
  --card-line: #e0d8c9;
  --ink: #26221b;
  --ink-body: #4a4235;
  --ink2: #76695a;
  --ink3: #c0b6a3;
  --brand: #a85f16;
  --brand-soft: rgba(168, 95, 22, .12);
  --green: #1f7a54;    --green-soft: rgba(31, 122, 84, .13);
  --amber: #a85f16;    --amber-soft: rgba(168, 95, 22, .13);
  --red: #a8402f;      --red-soft: rgba(168, 64, 47, .11);
  --violet: #5f4b7a;   --violet-soft: rgba(95, 75, 122, .11);
  --note-bg: rgba(255, 236, 170, .7);
  --note-border: #dcc285;
  --note-ink: #8a6608;
  --soft: rgba(38, 34, 27, .055);
  --soft2: rgba(38, 34, 27, .10);
  --toast-bg: rgba(38, 34, 27, .95);
  --tabbar-bg: #efe9df;
  --topbar-bg: rgba(239, 233, 223, .92);
  --line: rgba(38, 34, 27, .14);
  --rule: #ddd4c3;
  --boot-rule: #cabfa9;
  --boot-dot: #8f846f;
  /* 一叠卡：主卡后面露出第二张的纸边 */
  --shadow: 4px 5px 0 -1px var(--card-solid), 4px 5px 0 0 var(--rule);
  --shadow-lift: 6px 8px 0 -1px var(--card-solid), 6px 8px 0 0 var(--rule);
  --btn-sh: none;
  --btn-sh-hover: none;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --blur: none;
  --r-card: 8px; --r-item: 8px; --r-ctl: 6px; --r-pill: 6px;
  --num-w: 700; --num-track: -.5px;
}
:root[data-style="deck"][data-theme="dark"] {
  --bg: #191713;
  --card: #232019;
  --card-solid: #2a251d;
  --card-line: #3a332a;
  --ink: #e9e2d3;
  --ink-body: #c6bda9;
  --ink2: #9b907b;
  --ink3: #5c5545;
  --brand: #d9934a;
  --brand-soft: rgba(217, 147, 74, .16);
  --green: #63b28c;    --green-soft: rgba(99, 178, 140, .16);
  --amber: #d9934a;    --amber-soft: rgba(217, 147, 74, .16);
  --red: #d9776a;      --red-soft: rgba(217, 119, 106, .16);
  --violet: #a394c0;   --violet-soft: rgba(163, 148, 192, .16);
  --note-bg: rgba(217, 147, 74, .14);
  --note-border: rgba(217, 147, 74, .4);
  --note-ink: #d9b072;
  --on-brand: #191713;
  --soft: rgba(233, 226, 211, .05);
  --soft2: rgba(233, 226, 211, .11);
  --toast-bg: rgba(58, 51, 42, .96);
  --tabbar-bg: #191713;
  --topbar-bg: rgba(25, 23, 19, .92);
  --line: rgba(233, 226, 211, .14);
  --rule: #453d31;
  --boot-rule: #554b3c;
  --boot-dot: #9b8f78;
  --shadow: 4px 5px 0 -1px var(--card-solid), 4px 5px 0 0 var(--rule);
  --shadow-lift: 6px 8px 0 -1px var(--card-solid), 6px 8px 0 0 var(--rule);
}
:root[data-style="deck"] .card { border: 1px solid var(--card-line); }
:root[data-style="deck"] .card h3 { font-size: 12px; font-weight: 700; letter-spacing: .2px; color: var(--ink2); }
/* 每日一句：像在今天这张卡上划过一道荧光笔 */
:root[data-style="deck"] .dq { text-align: left; }
:root[data-style="deck"] .dq-t {
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 2px; background: linear-gradient(transparent 64%, var(--note-bg) 64%);
}
/* 引导页：选项就是几张纸片，选中的一张压上荧光笔 */
:root[data-style="deck"] .intro-k { color: var(--ink-body); }
:root[data-style="deck"] .intro-row, :root[data-style="deck"] .intro-chip { border-color: var(--card-line); box-shadow: 2px 2px 0 -1px var(--card-solid), 2px 2px 0 0 var(--rule); }
:root[data-style="deck"] .intro-row.sel, :root[data-style="deck"] .intro-chip.sel { border-color: var(--note-border); background: var(--note-bg); color: var(--ink); }
:root[data-style="deck"] .intro-row.sel span, :root[data-style="deck"] .intro-chip.sel i { color: var(--note-ink); }
:root[data-style="deck"] .intro-ol li::before { background: var(--note-bg); box-shadow: inset 0 0 0 1px var(--note-border); color: var(--note-ink); border-radius: 4px; }
:root[data-style="deck"] .task-btn { border: 1px solid var(--card-line); }
:root[data-style="deck"] .wordcard { position: relative; z-index: 0; border: 1px solid var(--card-line); justify-content: flex-start; padding-top: 22px; }
/* 正在背的这张从牌堆里抽出来：后面再垫两张纸，各自歪一点点 */
:root[data-style="deck"] .wordcard::before,
:root[data-style="deck"] .wordcard::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card);
}
:root[data-style="deck"] .wordcard::before { transform: rotate(-.55deg) translate(2px, 4px); }
:root[data-style="deck"] .wordcard::after { transform: rotate(.4deg) translate(4px, 8px); }
:root[data-style="deck"] .wc-tags { justify-content: flex-start; }
:root[data-style="deck"] .tag { font-family: var(--font-num); font-size: 10px; }
:root[data-style="deck"] .wc-wordline { justify-content: flex-start; }
:root[data-style="deck"] .wordcard { text-align: left; }
:root[data-style="deck"] .wc-sent { border-bottom: 2px solid var(--amber-soft); }
:root[data-style="deck"] .ci-dot { border-radius: 4px; box-shadow: inset 0 0 0 1px var(--card-line); }
:root[data-style="deck"] .tabbar { box-shadow: 0 -1px 0 var(--rule); }
:root[data-style="deck"] .theme-btn { border: 1px solid var(--card-line); box-shadow: none; }
:root[data-style="deck"] .topsearch { border-color: var(--card-line); }

/* ---------- 设置页的风格选择器：跟着当前皮肤走，不各自造型 ---------- */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.style-opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  border: 1px solid var(--card-line); border-radius: var(--r-item); background: var(--card-solid);
  padding: 12px 12px 13px; text-align: left; color: var(--ink-body); box-shadow: var(--shadow);
  transition: transform .16s var(--spring), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.style-opt:active { transform: scale(.97); }
.style-opt .sw { display: flex; gap: 4px; }
.style-opt .sw b { width: 15px; height: 15px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.style-opt .sw b:nth-child(1) { background: var(--c1); }
.style-opt .sw b:nth-child(2) { background: var(--c2); }
.style-opt .sw b:nth-child(3) { background: var(--c3); }
.style-opt .so-n { font-family: var(--font-label); font-size: 14px; font-weight: 700; letter-spacing: var(--label-track); color: var(--ink); }
.style-opt .so-d { font-size: 11.5px; line-height: 1.5; color: var(--ink2); }
.style-opt[aria-checked="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.style-opt[aria-checked="true"]::before {
  content: ''; position: absolute; top: 11px; right: 11px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--brand); animation: popIn .28s var(--spring) backwards;
}
@media (max-width: 380px) { .style-grid { grid-template-columns: 1fr; } }

/* 窄屏：皮肤令牌权重高于 :root，所以缩放值要带同等权重写在最后 */
@media (max-width: 380px) {
  :root, :root[data-style] { --hw-size: 34px; --num-track: -.3px; }
  :root[data-style="editorial"] { --hw-size: 36px; }
  :root[data-style="instrument"] { --hw-size: 30px; }
}
.art-swipe-done {
  position: absolute; top: 0; right: 84px; bottom: 0; width: 84px;
  border: none; background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1.3;
  border-radius: var(--r-item) 0 0 var(--r-item);
  opacity: 0; pointer-events: none;
  transition: opacity .18s var(--ease);
}
.art-swipe-del { border-radius: 0 var(--r-item) var(--r-item) 0; }
.art-row.revealed .art-swipe-done { opacity: 1; pointer-events: auto; }
.art-item.done { opacity: 0.75; }
.art-item.done .t { text-decoration: none; }
.art-done-star {
  display: inline-block;
  margin-right: 5px;
  font-size: 15px;
  line-height: 1;
  vertical-align: -1px;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.4));
  animation: popIn 0.3s var(--spring) backwards;
}

/* 例句单词可点击样式 */
.wc-sent .tw {
  color: inherit;
  font-weight: normal;
  border-bottom: 1px dotted rgba(86, 102, 245, 0.45);
  border-radius: 2px;
  cursor: pointer;
  padding: 0 1px;
}
.wc-sent .tw:hover, .wc-sent .tw:active {
  background: var(--brand-soft);
  color: var(--brand);
}
.wc-sent .tw b {
  color: var(--brand);
  font-weight: 700;
}

/* 阅读文章中普通单词点状下划线提示 */
.art-text .tw.plain {
  color: inherit;
  font-weight: normal;
  border-bottom: 1px dotted rgba(86, 102, 245, 0.4);
  cursor: pointer;
  border-radius: 2px;
  padding: 0 1px;
}
.art-text .tw.plain:hover, .art-text .tw.plain:active {
  background: var(--brand-soft);
  color: var(--brand);
}
:root[data-theme="dark"] .art-text .tw.plain {
  border-bottom-color: rgba(125, 138, 255, 0.35);
}

/* 选中但未提交的选项高亮 */
.q-item .qc div.sel {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--brand);
}
:root[data-theme="dark"] .q-item .qc div.sel {
  background: rgba(125, 138, 255, 0.2);
}

/* 派生词模块样式 */
.sec-deriv {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-body);
}
.sec-deriv b {
  color: var(--brand);
}
.deriv-word {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px dotted var(--brand);
  padding: 0 1px;
  border-radius: 2px;
}
.deriv-word:hover, .deriv-word:active {
  background: var(--brand-soft);
}
.sec-deriv .pos {
  color: var(--ink2);
  font-style: italic;
  font-size: 12px;
  margin-left: 2px;
}

/* 卡片右上角「太简单」快捷按钮 */
.wordcard { position: relative; }
.btn-card-easy {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink3);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-card-easy:hover, .btn-card-easy:active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}
/* 二段式标记：已标记为太简单（再次点击取消） */
.btn-card-easy.on {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 700;
}
.btn-card-easy.pop { animation: popIn .3s var(--spring); }
:root[data-style="instrument"] .btn-card-easy {
  border-radius: 3px;
  font-family: var(--font-num);
  font-size: 10.5px;
}
:root[data-style="deck"] .btn-card-easy {
  border-radius: 4px;
  box-shadow: 1px 1px 0 var(--card-line);
}

/* ================= 打印 / 导出 PDF 样式 ================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 15mm 18mm 15mm 18mm;
  }

  body, html {
    background: #fff !important;
    color: #111 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  #topbar, #tabs, #tabIndicator, #noiseWidget, #toast, #loginMask, #intro,
  .read-head, .art-actions, .quiz-submit-row, #quizResult, .tts-btn,
  .art-note-form, .note-del, .art-outside {
    display: none !important;
  }

  .view:not(#view-read) {
    display: none !important;
  }
  #view-read, #readArticle, .card.article {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    max-width: 100% !important;
  }

  #artTitle {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #000 !important;
    margin-bottom: 6px !important;
    text-align: center !important;
    letter-spacing: -0.2px !important;
  }
  #artMeta {
    text-align: center !important;
    color: #666 !important;
    font-size: 11.5px !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #ddd !important;
    padding-bottom: 10px !important;
  }
  .exam-flag {
    display: inline-block !important;
    margin: 0 auto 8px !important;
    text-align: center !important;
    border: 1px solid #333 !important;
    color: #000 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 1px 8px !important;
    border-radius: 3px !important;
  }
  .art-text {
    font-size: 14.5px !important;
    line-height: 1.8 !important;
    color: #222 !important;
  }
  .art-text p {
    margin-bottom: 14px !important;
    text-align: justify !important;
  }
  .art-text .plabel {
    font-weight: 800 !important;
    color: #000 !important;
    margin-right: 4px !important;
  }

  .tw, .tw.plain, .tw.cur {
    border-bottom: none !important;
    color: inherit !important;
    font-weight: normal !important;
    background: none !important;
  }
  .tw.cur b {
    font-weight: 700 !important;
    color: #000 !important;
  }

  #artQuestions {
    margin-top: 24px !important;
    border-top: 2px solid #222 !important;
    padding-top: 12px !important;
  }
  .quiz-head {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
    font-weight: 700 !important;
    color: #000 !important;
    border-bottom: 1px dashed #ccc !important;
    padding-bottom: 6px !important;
  }
  .q-item {
    page-break-inside: avoid !important;
    margin-top: 14px !important;
    padding: 10px 14px !important;
    background: #fafafa !important;
    border: 1px solid #e2e2e2 !important;
    border-radius: 6px !important;
  }
  .q-item .qt {
    font-weight: 700 !important;
    font-size: 13.5px !important;
    color: #111 !important;
  }
  .q-item .qc {
    margin-top: 8px !important;
  }
  .q-item .qc div {
    padding: 5px 8px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    margin-bottom: 4px !important;
    font-size: 12.5px !important;
    border-radius: 4px !important;
  }
  .q-item .qc div.right {
    font-weight: 700 !important;
    border-color: #2e7d32 !important;
    background: #e8f5e9 !important;
  }
  .q-item .qc div.wrong {
    border-color: #c62828 !important;
    background: #ffebee !important;
  }
  .q-item .qe {
    display: block !important;
    margin-top: 8px !important;
    padding: 8px 10px !important;
    background: #f1f3f5 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    color: #333 !important;
    line-height: 1.6 !important;
  }

  .art-translation {
    display: block !important;
    page-break-before: auto !important;
    margin-top: 22px !important;
    padding-top: 14px !important;
    border-top: 1px dashed #bbb !important;
    font-size: 13px !important;
    color: #333 !important;
  }
  .art-translation .p-sectitle {
    font-weight: 800 !important;
    font-size: 15px !important;
    margin-bottom: 8px !important;
    color: #000 !important;
  }

  .card.art-notes {
    page-break-inside: avoid !important;
    margin-top: 20px !important;
    padding: 12px !important;
    border: 1px solid #ddd !important;
    background: #fdfdfd !important;
  }
}

/* 阅读列表分类筛选 */
.read-filter-chips {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.read-filter-chips::-webkit-scrollbar { display: none; }
.read-filter-chips .chip {
  padding: 6px 14px;
  font-size: 13px;
  flex-shrink: 0;
}
.art-tag-novel {
  color: var(--violet);
  background: var(--violet-soft);
  border: 1px solid rgba(124, 77, 255, 0.2);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* ================= 顶栏个人装扮与积分徽章 ================= */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 3px 8px 3px 4px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: transform .15s, border-color .2s;
  user-select: none;
}
.user-profile-badge:active { transform: scale(.95); }
/* ===== 头像 =====
   图形本体来自 core.js 的 AVATARS（24×24、只用 currentColor），这里只给配色与尺寸。
   font-size 现在只是字号：头像框（core.js 的 FRAMES）已改为内联 SVG，
   环厚由框自己的 inset 百分比决定，不再靠 em 反推，所以改 font-size 不会再动环。 */
.avatar-box {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 16px;
  flex-shrink: 0;
}
.avatar-box > .avatar-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.avatar-box > svg,
.avatar-box > .avatar-text > svg {
  width: 78%;
  height: 78%;
  display: block;
}
/* 位图头像（core.js 的 AVATARS 里以 <img> 引用的，如 avatar-cat）：
   无白底圈、无圆角裁切（PNG 本身透明底），容器放大到 130% 并靠 flex 居中，
   让黑猫不透明主体（约占图宽 45%）的视觉大小与其它 SVG 头像（约 65% 盘径）对齐；
   头像框仍是叠加在其上的独立环（.avatar-frame），互不干扰。
   ⚠️ img 可能直接挂在 .avatar-box 下（商城列表），也可能包在 .avatar-text 里
   （顶栏/商城头部 innerHTML 注入），两种结构都要约束。 */
.avatar-box > img.avatar-img,
.avatar-box > .avatar-text > img.avatar-img {
  width: 130%;
  height: 130%;
  object-fit: contain;
  display: block;
}
.avatar-box.large {
  width: 54px;
  height: 54px;
  font-size: 30px;
}
/* ===== 头像框 =====
   图形本体来自 core.js 的 FRAMES（内联 SVG，卡通贴纸风），这里只负责摆放、尺寸与动画。
   几何：inset:-16.5% → 整框 = 1.33×box；环外径 0.596 box、内径 0.503 box，
   与旧版纯 CSS 环（28px 头像下 14.5~17px）基本重合，顶栏 28px 头像的胶囊不会被撑破。
   ⚠️ 框的大小现在完全由 inset 百分比决定，和 font-size 无关了（旧版靠 em 反推环厚）。 */
.avatar-frame {
  position: absolute;
  inset: -16.5%;
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
}
.avatar-frame > svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* 动画元素必须 transform-box:fill-box，否则 rotate/scale 会绕 viewBox 原点跑飞 */
.avatar-frame > svg [class^="fr-"] { transform-box: fill-box; transform-origin: 50% 50%; }

/* 自身发光的三种留一点外晕；金属/贴纸类不加（浅色底上会糊成一团） */
.avatar-frame.frame-neon > svg { filter: drop-shadow(0 0 .16em rgba(34, 211, 238, .5)); }
.avatar-frame.frame-fire > svg { filter: drop-shadow(0 0 .16em rgba(249, 115, 22, .5)); }
.avatar-frame.frame-galaxy > svg { filter: drop-shadow(0 0 .16em rgba(124, 58, 237, .45)); }

@keyframes frSway { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes frTwinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .68; } }
@keyframes frTwinkle2 { 0%, 100% { transform: scale(.86); opacity: .62; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes frFlicker { 0%, 100% { transform: scaleY(1) scaleX(1); } 50% { transform: scaleY(1.14) scaleX(.94); } }
@keyframes frFlicker2 { 0%, 100% { transform: scaleY(1.1) scaleX(.95); } 50% { transform: scaleY(.92) scaleX(1.04); } }
@keyframes frGlitch { 0%, 84%, 100% { transform: none; } 86% { transform: translateX(.5px); } 91% { transform: translateX(-.4px); } 96% { transform: translateX(.25px); } }
@keyframes frGlitch2 { 0%, 78%, 100% { transform: none; } 82% { transform: translateX(-.5px); } 88% { transform: translateX(.4px); } }
@keyframes frBreathe { from { opacity: .45; } to { opacity: 1; } }

.avatar-frame svg .fr-sway { animation: frSway 3.4s ease-in-out infinite alternate; }
.avatar-frame svg .fr-twinkle { animation: frTwinkle 3.2s ease-in-out infinite; }
.avatar-frame svg .fr-twinkle2 { animation: frTwinkle2 2.4s ease-in-out infinite; }
.avatar-frame svg .fr-flicker { animation: frFlicker 1.3s ease-in-out infinite; }
.avatar-frame svg .fr-flicker2 { animation: frFlicker2 1.7s ease-in-out infinite; }
.avatar-frame svg .fr-glitch { animation: frGlitch 2.8s steps(1, end) infinite; }
.avatar-frame svg .fr-glitch2 { animation: frGlitch2 3.4s steps(1, end) infinite; }
.avatar-frame svg .fr-breathe { animation: frBreathe 2.6s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  .avatar-frame svg [class^="fr-"] { animation: none; }
}

.points-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-body);
}
.points-pill .coin { font-size: 14px; }

/* ================= 积分商城视图 ================= */
#view-shop.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shop-header {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-user-banner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sub-info {
  flex: 1;
  min-width: 0;
}
.sub-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-head);
}
.sub-points-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 3px;
}
.sub-coin { font-size: 17px; }
.sub-points {
  font-size: 24px;
  font-weight: 800;
  color: #f59e0b;
  font-family: var(--font-disp);
}
.sub-label {
  font-size: 12px;
  color: var(--ink2);
}
/* 今日积分进度：今日已得 x / 600 + 文章类 n/6 */
.sub-daily-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink2);
}
.sub-daily-label { font-size: 11.5px; }
.sub-daily-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  font-family: var(--font-disp);
}
.sub-daily-cap { font-size: 11.5px; }
.sub-daily-art {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink2);
}
.sub-daily-art.full {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  color: var(--brand);
  font-weight: 700;
}
.sub-daily-bar {
  margin-top: 5px;
  height: 4px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
  max-width: 190px;
}
.sub-daily-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width .5s var(--ease-out, ease);
}
.shop-rules-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink2);
}
.shop-rules-bar b { color: var(--brand); font-weight: 700; }

.shop-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shop-nav::-webkit-scrollbar { display: none; }
.snav-btn {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.snav-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.shop-card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--r-card);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform .15s, border-color .2s;
}
.shop-card:hover { border-color: var(--brand); }
.shop-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-pill);
}
.shop-card-badge.equipped {
  background: var(--brand);
  color: var(--on-brand);
}
.shop-card-badge.unlocked {
  background: var(--brand-soft);
  color: var(--brand);
}
.shop-card-icon {
  margin: 6px 0 10px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-head);
  margin-bottom: 4px;
}
.shop-card-desc {
  font-size: 11.5px;
  color: var(--ink2);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}
.shop-card-action {
  width: 100%;
}
.shop-btn {
  width: 100%;
  border: none;
  padding: 7px 0;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, background-color .15s;
}
.shop-btn.buy {
  background: #f59e0b;
  color: #fff;
}
.shop-btn.buy:hover { background: #d97706; }
.shop-btn.equip {
  background: var(--card-solid);
  border: 1px solid var(--line);
  color: var(--ink-body);
}
.shop-btn.equip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.shop-btn.active-equipped {
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;   /* 可点击：同样打开商品预览 */
}

/* ================= 商品预览窗口 ================= */
/* 点商品卡片呼出的「先看后买」大图舞台：头像/头像框/字体样张/主题迷你模拟/白噪音试听 */
.spv-stage {
  min-height: 158px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 14px;
  margin-bottom: 14px;
  overflow: hidden;
}

/* 积分流水项 */
.ph-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ph-item:last-child { border-bottom: none; }
.ph-reason { font-size: 13.5px; font-weight: 600; color: var(--ink-body); }
.ph-time { font-size: 11px; color: var(--ink2); margin-top: 2px; }
.ph-amount { font-size: 14px; font-weight: 700; font-family: var(--font-disp); }
.ph-amount.plus { color: #10b981; }
.ph-amount.minus { color: #ef4444; }

/* ================= 自定义字体配置（全站全局生效） ================= */
/* 字栈是「预览 ↔ 实际」的唯一事实来源：core.js SHOP_CATALOG 字体项的 preview 必须与这里逐字一致，
   index.html 的 Google Fonts 链接必须覆盖字栈里的全部在线家族。scripts/font-sync-test.js 锁这条。 */
html[data-font="serif"] {
  --font-custom: "Playfair Display", "Noto Serif SC", "Songti SC", SimSun, serif;
}
html[data-font="kaiti"] {
  --font-custom: "LXGW WenKai TC", "STKaiti", "KaiTi", "BiauKai", serif;
}
html[data-font="round"] {
  --font-custom: "Nunito", "Yuanti SC", "YouYuan", sans-serif;
}
html[data-font="mono"] {
  --font-custom: "JetBrains Mono", Consolas, "Courier New", monospace;
}
/* 手写行楷（练字感）、几何无衬线（现代清爽）、打字机衬线（复古读物） */
html[data-font="handwrite"] {
  --font-custom: "Ma Shan Zheng", "ZCOOL KuaiLe", "Xingkai SC", "STXingkai", KaiTi, cursive, serif;
}
html[data-font="geometric"] {
  --font-custom: "Poppins", "Century Gothic", "Futura", "Avenir Next", sans-serif;
}
html[data-font="typewriter"] {
  --font-custom: "Courier Prime", "Courier New", "American Typewriter", monospace;
}

/* 核心：选中任意字体后，全站所有变量及全部 UI 元素 100% 全局生效 */
html[data-font]:not([data-font="default"]) {
  --font-ui: var(--font-custom) !important;
  --font-disp: var(--font-custom) !important;
  --font-num: var(--font-custom) !important;
  --font-label: var(--font-custom) !important;
}
html[data-font]:not([data-font="default"]),
html[data-font]:not([data-font="default"]) body,
html[data-font]:not([data-font="default"]) button,
html[data-font]:not([data-font="default"]) input,
html[data-font]:not([data-font="default"]) select,
html[data-font]:not([data-font="default"]) textarea,
html[data-font]:not([data-font="default"]) .tab,
html[data-font]:not([data-font="default"]) .tab .lb,
html[data-font]:not([data-font="default"]) .card,
html[data-font]:not([data-font="default"]) .wordcard,
html[data-font]:not([data-font="default"]) .wc-word,
html[data-font]:not([data-font="default"]) .art-text,
html[data-font]:not([data-font="default"]) #artTitle,
html[data-font]:not([data-font="default"]) .brand,
html[data-font]:not([data-font="default"]) .sub-name,
html[data-font]:not([data-font="default"]) h1,
html[data-font]:not([data-font="default"]) h2,
html[data-font]:not([data-font="default"]) h3,
html[data-font]:not([data-font="default"]) p,
html[data-font]:not([data-font="default"]) span,
html[data-font]:not([data-font="default"]) div {
  font-family: var(--font-custom) !important;
}

/* 字体样张豁免：商城三处预览（网格图标 / 兑换确认 / 预览大窗）与长图·PDF 导出自带字栈，
   不能被上面的全局 !important 改掉——否则预览永远显示「已装配字体」而不是「将得到的字体」。
   传字栈用内联自定义属性 --fsp（不能写内联 font-family，!important 会吞掉它），
   这条规则特异性 (0,3,1) 压过全局 div/span/p 的 (0,2,2)，.fsp * 连后代一起兜住。 */
.fsp { font-family: var(--fsp, inherit); }
html[data-font]:not([data-font="default"]) .fsp,
html[data-font]:not([data-font="default"]) .fsp * {
  font-family: var(--fsp, inherit) !important;
}

/* ================= 新增皮肤主题 ================= */
/* 05 日系抹茶 */
:root[data-style="matcha"] {
  --bg: #f5f7f2;
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-line: #e3e8dc;
  --line: #d8ded0;
  --ink: #1f3323;
  --ink-body: #2d4532;
  --ink2: #5b7360;
  --ink3: #9fb0a2;
  --brand: #2e7d32;
  --brand-soft: rgba(46, 125, 50, .12);
  --on-brand: #ffffff;
  --tabbar-bg: rgba(245, 247, 242, .88);
  --topbar-bg: rgba(245, 247, 242, .88);
}
:root[data-style="matcha"][data-theme="dark"] {
  --bg: #121913;
  --card: #182219;
  --card-solid: #1c271e;
  --card-line: #2a382c;
  --line: #2d3d2f;
  --ink: #e5ede6;
  --ink-body: #b8ccbb;
  --ink2: #7a947d;
  --ink3: #4a5c4c;
  --brand: #66bb6a;
  --brand-soft: rgba(102, 187, 106, .18);
  --on-brand: #0f2412;
  --tabbar-bg: rgba(18, 25, 19, .92);
  --topbar-bg: rgba(18, 25, 19, .92);
}

/* 06 赛博霓虹 */
:root[data-style="cyberpunk"] {
  --bg: #0b0f19;
  --card: #111827;
  --card-solid: #172033;
  --card-line: #1e293b;
  --line: #24324a;
  --ink: #f0fdfa;
  --ink-body: #cbd5e1;
  --ink2: #64748b;
  --ink3: #334155;
  --brand: #06b6d4;
  --brand-soft: rgba(6, 182, 212, .18);
  --on-brand: #042f2e;
  --tabbar-bg: rgba(11, 15, 25, .92);
  --topbar-bg: rgba(11, 15, 25, .92);
}
:root[data-style="cyberpunk"][data-theme="dark"] {
  --bg: #080c14;
  --card: #0f1624;
  --card-solid: #141d30;
  --card-line: #1c273d;
  --line: #202e48;
  --ink: #f0fdfa;
  --ink-body: #94a3b8;
  --ink2: #475569;
  --ink3: #1e293b;
  --brand: #22d3ee;
  --brand-soft: rgba(34, 211, 238, .2);
  --on-brand: #042f2e;
  --tabbar-bg: rgba(8, 12, 20, .94);
  --topbar-bg: rgba(8, 12, 20, .94);
}

/* 糖果书屋：所有覆写限定在 candy，复用原有组件与交互。 */
.candy-buddy { display: none; }
:root[data-style="candy"] {
  --bg: #fff9ed; --ambient: none;
  --card: #ffffff; --card-solid: #ffffff; --card-line: #e9dfd1;
  --ink: #312742; --ink-body: #443b51; --ink2: #716477; --ink3: #827188;
  --brand: #ba3527; --brand-soft: #ffe8e0; --on-brand: #ffffff;
  --green: #23704c; --green-soft: #e3f5d9;
  --amber: #865600; --amber-soft: #fff0ac;
  --red: #b33335; --red-soft: #ffe2e0;
  --violet: #6742b0; --violet-soft: #efe5ff;
  --note-bg: #fff0ac; --note-border: #d5a335; --note-ink: #745100;
  --soft: #f8f2e9; --soft2: #eee5da; --line: #e9dfd1; --rule: #e9dfd1;
  --topbar-bg: #fff9ed; --tabbar-bg: #ffffff; --toast-bg: #312742;
  --r-ctl: 16px; --r-item: 20px; --r-card: 26px; --r-pill: 999px;
  --shadow: 0 5px 0 #e9dfd1; --shadow-lift: 0 7px 0 #dfd2c2;
  --btn-sh: 0 4px 0 #84291f; --btn-sh-hover: 0 5px 0 #84291f;
  --blur: none; --pad-card: 20px; --pad-word: 32px 22px;
  --font-ui: "Segoe UI Variable", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-disp: "Arial Rounded MT Bold", "Segoe UI Variable", "Microsoft YaHei", sans-serif;
  --font-num: var(--font-disp); --font-label: var(--font-ui);
  --num-w: 850; --label-w: 750; --label-track: 0px;
  --hw-size: 42px; --hw-w: 850; --hw-track: -.5px;
  --boot-rule: #e1c3ab; --boot-dot: #c45343;
  --candy-yellow: #ffdc64; --candy-blue: #72d5ee; --candy-coral: #ff735f;
  --candy-purple: #d0b8fa; --candy-deep: #312742;
}
:root[data-style="candy"][data-theme="dark"] {
  --bg: #211c32; --card: #30283f; --card-solid: #30283f; --card-line: #554362;
  --ink: #fff5e7; --ink-body: #eee3ed; --ink2: #cfbcd6; --ink3: #bca4c5;
  --brand: #ffac9a; --brand-soft: #53313c; --on-brand: #321d2d;
  --green: #a7e186; --green-soft: #354535;
  --amber: #ffe088; --amber-soft: #51432f;
  --red: #ffacab; --red-soft: #51313f;
  --violet: #ceb0ff; --violet-soft: #46365e;
  --note-bg: #51432f; --note-border: #9d824e; --note-ink: #ffe088;
  --soft: #3d324c; --soft2: #50405e; --line: #554362; --rule: #554362;
  --topbar-bg: #211c32; --tabbar-bg: #30283f; --toast-bg: #51405d;
  --shadow: 0 5px 0 #181321; --shadow-lift: 0 7px 0 #181321;
  --btn-sh: 0 4px 0 #b46d64; --btn-sh-hover: 0 5px 0 #b46d64;
  --boot-rule: #705472; --boot-dot: #ffac9a;
}
[data-style="candy"] .topbar { border-bottom: 0; padding-top: calc(13px + env(safe-area-inset-top, 0px)); padding-bottom: 12px; gap: 9px; }
[data-style="candy"] .brand { color: var(--brand); letter-spacing: -.5px; }
[data-style="candy"] .brand b { font-weight: 850; }
[data-style="candy"] .topsearch { border: 1.5px solid var(--line); padding-left: 12px; }
[data-style="candy"] .theme-btn { border: 1.5px solid var(--line); box-shadow: 0 3px 0 var(--line); color: var(--violet); }
[data-style="candy"] main { padding-top: 12px; padding-bottom: calc(var(--tabbar-pad) + 38px); }
[data-style="candy"] #homeMain { gap: 20px; flex: 0 0 auto; }
[data-style="candy"] .dq { display: none; }
[data-style="candy"] .dq-en { font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--ink2); }
[data-style="candy"] .dq-by { font-weight: 400; font-size: 12px; }
[data-style="candy"] .dq-zh { font-size: 13px; margin-top: 5px; }
[data-style="candy"] .home-top { flex: 0 0 auto; }
[data-style="candy"] .checkin-hero { position: relative; overflow: hidden; text-align: left; padding: 22px 22px 19px; background: var(--candy-yellow); color: var(--candy-deep); border: 1.5px solid #d9b341; box-shadow: 0 5px 0 #d9b341; }
[data-style="candy"] .candy-buddy { display: block; position: absolute; width: 154px; height: 154px; object-fit: contain; right: 1px; top: 21px; pointer-events: none; animation: candyHello .65s var(--spring) backwards; }
[data-style="candy"] .ci-date { color: #675024; font-size: 13px; font-weight: 700; }
[data-style="candy"] .ci-big { justify-content: flex-start; gap: 7px; margin: 5px 0 11px; }
[data-style="candy"] .ci-big b { font-size: 57px; letter-spacing: -2px; color: var(--candy-deep); }
[data-style="candy"] .ci-big i { font-size: 13px; max-width: 72px; line-height: 1.4; text-align: left; font-weight: 750; color: #675024; }
[data-style="candy"] .ci-btn { min-width: 0; padding: 10px 19px; min-height: 43px; background: #ba3527; color: #ffffff; box-shadow: 0 4px 0 #84291f; }
[data-style="candy"] .checkin-hero .ci-btn { margin-top: 0; font-size: 15px; }
[data-style="candy"] .checkin-hero .ci-btn:disabled { background: #fff6d2; color: #554222; box-shadow: 0 3px 0 #c3a145; opacity: 1; }
[data-style="candy"] .ci-hint { color: #675024; font-size: 13px; margin-top: 12px; }
[data-style="candy"] .ci-days { justify-content: flex-start; gap: 5px; margin-top: 13px; }
[data-style="candy"] .ci-cap { color: #675024; text-align: left; }
[data-style="candy"] .ci-dot { width: 14px; height: 14px; line-height: 14px; font-size: 10px; color: #675024; border-color: #b6974b; background: #fff2b5; }
[data-style="candy"] .ci-dot.on { background: #ba3527; border-color: #ba3527; color: #fff; }
[data-style="candy"] .home-actions { gap: 14px; }
[data-style="candy"] .task-btn { text-align: left; align-items: flex-start; padding: 16px 19px 18px; border: 1.5px solid #d85445; border-radius: 24px; box-shadow: 0 5px 0 #d85445; color: var(--candy-deep); transition: transform .16s var(--spring), box-shadow .16s; }
[data-style="candy"] .tb-new { background: var(--candy-coral); }
[data-style="candy"] .tb-review { background: var(--candy-blue); border-color: #379cb9; box-shadow: 0 5px 0 #379cb9; }
[data-style="candy"] .tb-count { font-size: 43px; line-height: 1.1; letter-spacing: -1.5px; color: var(--candy-deep); }
[data-style="candy"] .tb-label { margin-top: 7px; color: var(--candy-deep); font-size: 17px; font-weight: 800; }
[data-style="candy"] .tb-sub { color: #312742; font-size: 12px; margin-top: 2px; }
[data-style="candy"] .home-foot { margin-bottom: 0; padding: 19px 20px 15px; }
[data-style="candy"] .hp-book { color: var(--ink); font-size: 15px; font-weight: 750; }
[data-style="candy"] .hp-num { color: var(--ink2); font-size: 13px; }
[data-style="candy"] .progress { height: 10px; background: var(--soft2); border-radius: 99px; }
[data-style="candy"] .bar { border-radius: 99px; background: var(--violet); }
[data-style="candy"] .hr { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
[data-style="candy"] .hr-t { color: var(--ink); font-size: 14px; font-weight: 650; }
[data-style="candy"] .hr-go { background: var(--violet-soft); color: var(--violet); border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
[data-style="candy"] .tabbar { left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border: 1.5px solid var(--line); border-radius: 23px; padding: 2px 4px; box-shadow: 0 5px 0 var(--line); }
[data-style="candy"] .tab { min-height: 58px; }
[data-style="candy"] .tab .lb { font-size: 12px; font-weight: 700; }
[data-style="candy"] .tab.active[data-view="home"] { color: var(--brand); }
[data-style="candy"] .tab.active[data-view="read"] { color: var(--violet); }
[data-style="candy"] .tab.active[data-view="dict"] { color: var(--green); }
[data-style="candy"] .tab.active[data-view="settings"] { color: var(--amber); }
[data-style="candy"] .tab-ind { background: var(--soft); }
[data-style="candy"] .badge { background: #ba3527; font-size: 11px; }
[data-style="candy"] .wordcard { border: 1.5px solid var(--line); border-top: 8px solid var(--candy-purple); border-radius: 28px; }
/* 正反面共用同一块空间，释义在卡内滚动，自评始终位于导航上方。 */
@media (min-width: 281px) and (min-height: 601px) {
  [data-style="candy"] #studyWrap { flex: 0 0 auto; height: calc(100dvh - 182px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 0; }
  [data-style="candy"] #studyCard { flex: 1; min-height: 0; }
  [data-style="candy"] #wordCard { flex: 1; min-height: 0; }
  [data-style="candy"] .wordcard.open { justify-content: flex-start; }
  [data-style="candy"] .wordcard.open .wc-body { flex: 1; min-height: 0; }
  [data-style="candy"] .wordcard.open .wcb-in { max-height: none; overscroll-behavior: contain; }
}
[data-style="candy"] .candy-finish { position: static; width: 156px; height: 156px; align-self: center; }
[data-style="candy"] #studyDone .empty-ico { display: none; }
[data-style="candy"] .wc-word { letter-spacing: -1px; overflow-wrap: anywhere; }
[data-style="candy"] .wc-phon { color: var(--ink2); font-size: 15px; }
[data-style="candy"] #studyCard:has(.wordcard.open) #studyNote { visibility: hidden; }
[data-style="candy"] .tts-btn { background: var(--violet-soft); color: var(--violet); border: 1px solid var(--line); }
[data-style="candy"] .tag { font-size: 12px; font-weight: 650; }
[data-style="candy"] .tag.new { background: var(--brand-soft); color: var(--brand); }
[data-style="candy"] .tag.stage { background: var(--violet-soft); color: var(--violet); }
[data-style="candy"] .btn.reveal { background: var(--candy-yellow); color: var(--candy-deep); box-shadow: 0 4px 0 #d9b341; }
[data-style="candy"] .grade { border: 1px solid var(--line); box-shadow: 0 3px 0 var(--line); }
[data-style="candy"] .btn.grade.know, [data-style="candy"] .btn.grade.go { background: var(--green-soft); color: var(--green); }
[data-style="candy"] .btn.grade.fuzzy { background: var(--amber-soft); color: var(--amber); }
[data-style="candy"] .btn.grade.forget { background: var(--red-soft); color: var(--red); }
[data-style="candy"] .btn.grade.easy { background: var(--violet-soft); color: var(--violet); }
[data-style="candy"] .gen-top { background: var(--violet-soft); border-color: var(--line); }
[data-style="candy"] .gen-hint { font-size: 13px; text-align: left; }
[data-style="candy"] .gen-top h3 { font-size: 20px; color: var(--violet); }
[data-style="candy"] #btnGenArticleRead { background: var(--violet); color: var(--card-solid); box-shadow: 0 4px 0 #482c83; }
[data-style="candy"] #btnGenStory { background: var(--card-solid); color: var(--violet); border: 1px solid var(--line); }
[data-style="candy"] .art-row { margin-bottom: 17px; }
[data-style="candy"] .art-item { border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line); padding: 22px 20px; }
[data-style="candy"] .art-item .t { font-size: 19px; font-weight: 750; padding-right: 16px; }
[data-style="candy"] .art-item .m { font-size: 12px; line-height: 1.8; }
[data-style="candy"] .article { box-shadow: none; }
[data-style="candy"] .article h2 { font-size: 25px; line-height: 1.3; letter-spacing: -.5px; }
[data-style="candy"] .art-text { font-size: 17px; line-height: 1.95; color: var(--ink-body); }
[data-style="candy"] .tw { background: var(--brand-soft); color: var(--brand); border-bottom-color: var(--brand); border-radius: 4px; }
[data-style="candy"] .tw.old { background: var(--green-soft); color: var(--green); border-bottom-color: var(--green); }
[data-style="candy"] .chip { min-height: 38px; padding: 6px 13px; font-size: 13px; border: 1.5px solid var(--line); font-weight: 600; }
[data-style="candy"] .chip.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
[data-style="candy"] .book-chips { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
[data-style="candy"] .book-chips .chip { flex-shrink: 0; order: 1; padding: 7px 15px; box-shadow: 0 2px 0 var(--line); }
[data-style="candy"] .book-chips .chip.active { order: 0; }
[data-style="candy"] .dict-item { border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; background: var(--card-solid); padding: 0; }
[data-style="candy"] .dict-item .row1 { padding: 14px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 9px; align-items: center; }
[data-style="candy"] .dict-item .dw { font-family: var(--font-disp); font-size: 19px; font-weight: 750; }
[data-style="candy"] .dict-item .dp { color: var(--ink2); grid-column: 1 / -1; grid-row: 2; word-break: normal; overflow-wrap: normal; }
[data-style="candy"] .dict-item .dt { min-width: 0; grid-column: 1 / -1; grid-row: 3; color: var(--ink-body); font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
[data-style="candy"] .dict-item .ds { grid-column: 2; grid-row: 1; }
[data-style="candy"] .dict-item { box-shadow: 0 3px 0 var(--line); }
[data-style="candy"] input, [data-style="candy"] select, [data-style="candy"] textarea { color: var(--ink); }
[data-style="candy"] input::placeholder, [data-style="candy"] textarea::placeholder { color: var(--ink2); opacity: 1; }
[data-style="candy"] .field input, [data-style="candy"] .field select, [data-style="candy"] #dictSearch { border: 1.5px solid var(--line); background: var(--card-solid); min-height: 44px; }
[data-style="candy"] .card h3 { font-size: 18px; }
[data-style="candy"] .style-opt { border: 1.5px solid var(--line); background: var(--soft); padding: 15px; }
[data-style="candy"] #view-settings > .card { box-shadow: 0 2px 0 var(--line); }
[data-style="candy"] .style-opt { box-shadow: none; }
[data-style="candy"] .style-opt[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 3px 0 var(--brand); }
[data-style="candy"] .so-n { font-size: 15px; }
[data-style="candy"] .so-d { font-size: 12px; color: var(--ink2); line-height: 1.6; }
[data-style="candy"] .hint { max-width: 58ch; }
[data-style="candy"] .sw { border-radius: 12px; }
[data-style="candy"] .popup { border: 1.5px solid var(--line); box-shadow: var(--shadow); }
[data-style="candy"] .noise-btn { background: var(--card-solid); color: var(--violet); border: 1px solid var(--line); }
[data-style="candy"] button:focus-visible, [data-style="candy"] input:focus-visible, [data-style="candy"] select:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
[data-style="candy"] .btn:active, [data-style="candy"] .task-btn:active { transform: translateY(3px) scale(.985); box-shadow: none; }
@keyframes candyHello { from { opacity: 0; transform: translateY(15px) rotate(9deg) scale(.88); } to { opacity: 1; transform: none; } }
@media (hover: hover) {
  [data-style="candy"] .task-btn:hover { transform: translateY(-2px); }
}
@media (min-width: 700px) {
  [data-style="candy"] .topbar { padding-left: max(24px, calc((100vw - 900px) / 2)); padding-right: max(24px, calc((100vw - 900px) / 2)); }
  [data-style="candy"] main { max-width: 900px; padding-top: 32px; padding-left: 22px; padding-right: 22px; }
  [data-style="candy"] #homeMain { display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; align-content: start; }
  [data-style="candy"] .dq { grid-column: 1 / -1; padding: 0; }
  [data-style="candy"] .dq-en { font-size: 18px; }
  [data-style="candy"] .home-top { grid-row: span 2; }
  [data-style="candy"] .checkin-hero { height: 100%; min-height: 330px; padding: 28px; }
  [data-style="candy"] .candy-buddy { width: 208px; height: 208px; right: 0; top: 50px; }
  [data-style="candy"] .ci-big { margin-top: 20px; }
  [data-style="candy"] .ci-big b { font-size: 76px; }
  [data-style="candy"] .ci-days { margin-top: 32px; }
  [data-style="candy"] #readArticle > .card { max-width: 700px; margin-left: auto; margin-right: auto; }
  [data-style="candy"] #studyWrap { height: calc(100dvh - 214px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  [data-style="candy"] .tabbar { width: 560px; left: 50%; right: auto; transform: translateX(-50%); bottom: 20px; }
}
@media (max-width: 280px) {
  [data-style="candy"] .topbar { display: grid; grid-template-columns: 1fr 38px; }
  [data-style="candy"] .topsearch { grid-row: 2; grid-column: 1 / -1; }
  [data-style="candy"] .theme-btn { grid-column: 2; grid-row: 1; }
  [data-style="candy"] .home-actions { grid-template-columns: 1fr; }
  [data-style="candy"] .checkin-hero .candy-buddy { display: none; }
  [data-style="candy"] .ci-days { gap: 4px; }
  [data-style="candy"] .ci-dot { width: 12px; height: 12px; line-height: 12px; }
  [data-style="candy"] .grade-row { flex-wrap: wrap; }
  [data-style="candy"] .grade-row .btn { padding-left: 9px; padding-right: 9px; }
  [data-style="candy"] .study-head { flex-wrap: wrap; }
  [data-style="candy"] .study-head .progress-text { min-width: 0; }
  [data-style="candy"] .wc-wordline { flex-direction: column; }
  [data-style="candy"] .wc-word { font-size: 30px; }
  [data-style="candy"] .wordcard { padding: 22px 12px; }
  [data-style="candy"] .dict-item .row1 { grid-template-columns: minmax(0, 1fr) auto; }
  [data-style="candy"] .dict-item .ds { grid-column: 2; }
  [data-style="candy"] .hp-top { flex-wrap: wrap; }
  [data-style="candy"] .tabbar { left: 8px; right: 8px; }
}
@media (max-width: 359px) {
  [data-style="candy"] .brand { font-size: 14px; }
  [data-style="candy"] .brand b { display: block; }
  [data-style="candy"] .ts-go { padding: 7px 8px; }
  [data-style="candy"] .candy-buddy { width: 125px; height: 125px; right: -5px; top: 33px; }
  [data-style="candy"] .checkin-hero { padding-left: 18px; }
  [data-style="candy"] .ci-big i { font-size: 12px; }
  [data-style="candy"] .ci-dot { width: 12px; height: 12px; line-height: 12px; }
  [data-style="candy"] .ci-days { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-style="candy"] .candy-buddy { animation: none; }
  [data-style="candy"] .task-btn:hover { transform: none; }
}

/* ================= 首页双人成行常驻活动卡片 ================= */
.home-team-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  cursor: pointer;
  transition: transform .15s, border-color .2s;
  user-select: none;
}
.home-team-card:hover { border-color: var(--brand); }
.home-team-card:active { transform: scale(0.985); }
.htc-left { flex: 1; min-width: 0; }
.htc-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #9e382b;
  background: rgba(158, 56, 43, 0.08);
  border: 1px solid rgba(158, 56, 43, 0.2);
  padding: 1px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.htc-badge.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}
.htc-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.htc-desc {
  font-size: 11.5px;
  color: var(--ink2);
  margin-top: 2px;
}
.htc-right {
  font-size: 26px;
  padding-left: 12px;
  flex-shrink: 0;
}

/* ================= 小屏手机适配（≤430px） =================
   布局顺序与内容和大屏完全一致（背单词按钮在签到卡下方），不重排、不动正常屏：
   仅当「屏不够高、原有内容装不下」时把整页等比缩小（zoom），小屏看到的内容与大屏手机一致。
   分档按实测：内容全部可见需 (按钮区底 + 底栏) × zoom ≤ 屏高。桌面与足够高的手机不命中，保持原样。 */
@media (max-width: 430px) and (max-height: 860px) { html { zoom: .94; } }
@media (max-width: 430px) and (max-height: 800px) { html { zoom: .90; } }
@media (max-width: 430px) and (max-height: 755px) { html { zoom: .83; } }
@media (max-width: 430px) and (max-height: 700px) { html { zoom: .78; } }
@media (max-width: 430px) and (max-height: 660px) { html { zoom: .74; } }
@media (max-width: 430px) and (max-height: 620px) { html { zoom: .66; } }

@media (max-width: 430px) {
  /* 商城资料卡统计行：小屏剩余宽度不足时，让「文章 0/6」胶囊整体换行，
     禁止中文标签被逐字折断（「今日已/得」）——这是原有折行错乱，不是样式改版 */
  .sub-daily-row { flex-wrap: wrap; gap: 5px 4px; }
  .sub-daily-label, .sub-daily-val, .sub-daily-cap, .sub-daily-art { white-space: nowrap; }
  .sub-daily-art { margin-left: 2px; }
}

/* ================= 经典名著 · 书库卡片 ================= */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.book-card {
  display: flex; gap: 12px; padding: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-item);
  box-shadow: var(--shadow);
  animation: fadeUp .34s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 42ms);
  transition: transform .18s var(--spring), box-shadow .22s var(--ease);
}
.book-card:active { transform: scale(.975); }
.bc-cover {
  width: 46px; height: 64px; border-radius: 5px 9px 9px 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  background: var(--soft2); border: 1px solid var(--line); border-left: 5px solid var(--bc, #667089);
  box-shadow: inset -6px 0 10px -8px rgba(23, 28, 46, .35);
}
.bc-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
/* 标题独占整行宽度；分类角标挪到「章 · 词」那一行的右侧 —— 卡片窄（单列约 185px），
   角标放标题里会把长书名挤成「重生…」，放元信息行才两者都读得清 */
.bc-title { font-weight: 800; font-size: 14.5px; letter-spacing: -.2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 书籍分类角标：名著 / 四级网文 / 六级网文 */
.bc-title .art-tag-novel { flex-shrink: 0; font-size: 9px; padding: 0 4px; line-height: 14px; border-radius: 4px; letter-spacing: 0; }
.bc-meta { font-size: 11px; color: var(--ink2); margin-top: 5px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; min-width: 0; }
.bc-meta > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bc-meta .art-tag-novel { flex-shrink: 0; font-size: 9px; padding: 0 4px; line-height: 14px; border-radius: 4px; letter-spacing: 0; border: none; font-weight: 700; }
.art-tag-web { color: #0b7285; background: rgba(13, 148, 136, .12); border-color: rgba(13, 148, 136, .28); }
.art-tag-web6 { color: #7c3aed; background: rgba(124, 58, 237, .12); border-color: rgba(124, 58, 237, .28); }
.art-tag-my { color: #b45309; background: rgba(217, 119, 6, .13); border-color: rgba(217, 119, 6, .3); }
/* 导入中的书：整卡压暗 + 顶部进度条，明确「还不能点开」 */
.book-card { position: relative; }
.book-card.bc-busy { opacity: .72; }
.bc-trans {
  display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 6px;
  font-size: 10.5px; font-weight: 700; color: #b45309; font-variant-numeric: tabular-nums;
}
.bc-spin {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(217, 119, 6, .28); border-top-color: #d97706;
  animation: bcSpin .7s linear infinite;
}
.bc-trans.bc-fail { color: var(--red); }
@keyframes bcSpin { to { transform: rotate(360deg); } }
/* 导入读物的删除键：右上角，不挤占卡片内容 */
.bc-del {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--soft2); color: var(--ink3); font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.bc-del:active { transform: scale(.9); background: var(--red); color: #fff; border-color: var(--red); }
/* 「导入 TXT」独占一行，避免与两个生成键挤成三列 */
#btnImportTxt { grid-column: 1 / -1; }
.bc-author { font-size: 11.5px; color: var(--ink2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-prog { height: 4px; border-radius: 99px; background: var(--soft2); margin-top: 6px; overflow: hidden; }
.bc-prog i { display: block; height: 100%; border-radius: 99px; background: var(--bc, var(--brand)); transition: width .4s var(--ease-out); }
.bc-tip { font-size: 10.5px; color: var(--ink3); margin-top: auto; padding-top: 5px; }
.art-sec-head {
  font-size: 12px; font-weight: 700; color: var(--ink2); letter-spacing: .4px;
  margin: 4px 2px 9px;
}

/* ================= 经典名著 · 全屏阅读器（夸克式） ================= */
/* 层级：底栏 45 / 阅读器 46 / 点词弹层 50 / 悬浮键 60（阅读时隐藏）
   阅读器自带纸感主题（data-rdtheme: paper / white / green / night），不跟随应用皮肤；
   颜色全部走 --rd-* 变量，不影响其他组件。 */
.reader {
  position: fixed; inset: 0; z-index: 46;
  display: flex; flex-direction: column;
  background: var(--rd-bg); color: var(--rd-ink);
  animation: fadeIn .24s var(--ease-out) backwards;
  /* 默认主题 = 纸黄（与 data-rdtheme="paper" 相同，供初始化兜底） */
  --rd-bg: #f5efe2; --rd-ink: #38342c; --rd-ink2: #8b8271;
  --rd-line: rgba(112, 100, 72, .17); --rd-soft: rgba(112, 100, 72, .09);
  --rd-glass: rgba(246, 240, 228, .9); --rd-card: rgba(255, 252, 245, .78);
  --rd-sheet-bg: #fdfaf3; --rd-accent: #8a6a35; --rd-accent-ink: #fff;
  --rd-dot: rgba(94, 84, 58, .32); --rd-key-bg: #efe0b6; --rd-key-ink: #7a5a17;
  --rd-key-line: rgba(160, 122, 44, .38);
}
.reader[data-rdtheme="paper"] {
  --rd-bg: #f5efe2; --rd-ink: #38342c; --rd-ink2: #8b8271;
  --rd-line: rgba(112, 100, 72, .17); --rd-soft: rgba(112, 100, 72, .09);
  --rd-glass: rgba(246, 240, 228, .9); --rd-card: rgba(255, 252, 245, .78);
  --rd-sheet-bg: #fdfaf3; --rd-accent: #8a6a35; --rd-accent-ink: #fff;
  --rd-dot: rgba(94, 84, 58, .32); --rd-key-bg: #efe0b6; --rd-key-ink: #7a5a17;
  --rd-key-line: rgba(160, 122, 44, .38);
}
.reader[data-rdtheme="white"] {
  --rd-bg: #fafafa; --rd-ink: #26262b; --rd-ink2: #8a8a93;
  --rd-line: rgba(20, 20, 40, .10); --rd-soft: rgba(20, 20, 40, .05);
  --rd-glass: rgba(250, 250, 250, .9); --rd-card: #ffffff;
  --rd-sheet-bg: #ffffff; --rd-accent: #4b5bd6; --rd-accent-ink: #fff;
  --rd-dot: rgba(60, 60, 96, .28); --rd-key-bg: #fbeec2; --rd-key-ink: #8a6a1f;
  --rd-key-line: rgba(180, 140, 44, .40);
}
.reader[data-rdtheme="green"] {
  --rd-bg: #e4ecdc; --rd-ink: #333d2c; --rd-ink2: #7e8a72;
  --rd-line: rgba(64, 88, 52, .16); --rd-soft: rgba(64, 88, 52, .09);
  --rd-glass: rgba(228, 236, 220, .9); --rd-card: rgba(246, 250, 240, .8);
  --rd-sheet-bg: #eff5e8; --rd-accent: #4f7a3a; --rd-accent-ink: #fff;
  --rd-dot: rgba(64, 88, 52, .30); --rd-key-bg: #d5e5b8; --rd-key-ink: #4c621f;
  --rd-key-line: rgba(108, 140, 52, .40);
}
.reader[data-rdtheme="night"] {
  --rd-bg: #17181b; --rd-ink: #bebcb6; --rd-ink2: #7b7a7e;
  --rd-line: rgba(255, 255, 255, .09); --rd-soft: rgba(255, 255, 255, .07);
  --rd-glass: rgba(23, 24, 27, .9); --rd-card: rgba(34, 35, 39, .8);
  --rd-sheet-bg: #202126; --rd-accent: #c9a86a; --rd-accent-ink: #201b12;
  --rd-dot: rgba(255, 255, 255, .20); --rd-key-bg: rgba(214, 164, 80, .20); --rd-key-ink: #e0c084;
  --rd-key-line: rgba(214, 164, 80, .38);
}
body.reading .noise { display: none; }

.rd-top {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: calc(9px + env(safe-area-inset-top, 0px)) 12px 9px;
  border-bottom: 1px solid var(--rd-line); background: var(--rd-glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.rbtn {
  width: 38px; height: 38px; border-radius: 12px; border: none; flex-shrink: 0;
  background: var(--rd-soft); color: var(--rd-ink); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .2s var(--ease), color .2s, transform .16s var(--spring);
}
.rbtn:active { transform: scale(.9); }
.rbtn.on { background: var(--rd-key-bg); color: var(--rd-key-ink); }
.rd-head {
  flex: 1; min-width: 0; border: none; background: transparent; color: var(--rd-ink);
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 4px;
}
.rd-bname { font-size: 14px; font-weight: 800; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-cname { font-size: 11px; color: var(--rd-ink2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* min-height:0：flex 子项默认 min-height:auto，真机 WebView 上会被内容撑高，
   把底部工具栏挤到正文上面（末行被遮）——显式归零，保证滚动区永远只有“可用高度”。 */
.rd-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 底部留白含安全区：滚到章尾时末行不会被底部工具栏压住 */
.rd-inner { max-width: 640px; margin: 0 auto; padding: 22px 22px calc(56px + env(safe-area-inset-bottom, 0px)); }

.rd-ct { margin: 6px 0 22px; text-align: center; }
.rd-ct-no { font-family: var(--font-label); font-size: 10.5px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--rd-ink2); }
.rd-ct-title { font-family: var(--font-disp); font-size: 21px; font-weight: 800; margin: 9px 0 4px; letter-spacing: -.3px; color: var(--rd-ink); }
.rd-ct-sub { font-size: 13px; color: var(--rd-ink2); }

.rd-text { --rd-fs: 17px; font-size: var(--rd-fs); }
.rd-para { margin: 0 0 19px; }
.rd-e { display: block; line-height: 1.9; font-family: var(--font-disp); letter-spacing: .1px; }
.rd-c {
  display: block; margin-top: 7px; padding-left: 11px; border-left: 2px solid var(--rd-line);
  font-size: calc(var(--rd-fs) - 3.5px); line-height: 1.74; color: var(--rd-ink2);
}
/* 译文默认不显示：关闭态同时收起段落翻译与章节中文副题 */
.reader.rd-hide-cn .rd-c, .reader.rd-hide-cn .rd-ct-sub { display: none; }

/* 正文可点词：低调点状下划线；本章重点词纸感马克笔高亮 */
.rd-text .tw.plain {
  color: inherit; font-weight: normal;
  border-bottom: 1px dotted var(--rd-dot);
  cursor: pointer; border-radius: 2px; padding: 0 1px;
}
.rd-text .tw.plain:hover, .rd-text .tw.plain:active { background: var(--rd-soft); color: var(--rd-accent); border-bottom-color: var(--rd-accent); }
.rd-text .tw.rd-key {
  background: var(--rd-key-bg); color: var(--rd-key-ink); font-weight: 600;
  border-bottom: 1px solid var(--rd-key-line); border-radius: 3px;
}
.rd-text .tw.rd-key:hover, .rd-text .tw.rd-key:active { background: var(--rd-accent); color: var(--rd-accent-ink); border-bottom-color: var(--rd-accent); }

.rd-words { margin-top: 32px; border-top: 1px dashed var(--rd-line); padding-top: 15px; }
.rd-w-head { font-size: 12px; font-weight: 700; color: var(--rd-ink2); letter-spacing: .4px; margin-bottom: 10px; }
.rd-w-head span { font-weight: 800; color: var(--rd-accent); margin-left: 2px; }
.rd-w-list { display: flex; flex-wrap: wrap; gap: 7px; }
.rd-w {
  border: 1px solid var(--rd-line); background: var(--rd-card); color: var(--rd-ink);
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-family: var(--font-disp);
  transition: background-color .2s var(--ease), color .2s, transform .16s var(--spring), border-color .2s;
}
.rd-w:active { transform: scale(.93); background: var(--rd-soft); color: var(--rd-accent); border-color: var(--rd-accent); }

.reader .rd-nav { display: flex; gap: 10px; margin-top: 30px; }
.reader .rd-nav .btn { flex: 1; box-shadow: none; background: var(--rd-soft); color: var(--rd-ink); border: 1px solid var(--rd-line); }
.reader .rd-nav .btn.primary { background: var(--rd-accent); color: var(--rd-accent-ink); border-color: transparent; }
.reader .rd-nav .btn:disabled { opacity: .45; pointer-events: none; }
.rd-foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--rd-ink2); opacity: .85; }

/* 底部工具栏（夸克式）：目录 / 进度 / 设置 */
.rd-bar {
  position: relative; z-index: 2;   /* 永远压在正文之上，不参与滚动 */
  flex-shrink: 0; display: flex; align-items: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--rd-sheet-bg);   /* 兜底色：不支持磨砂的 WebView 上保证不透明，正文不会透出来 */
  border-top: 1px solid var(--rd-line);
}
@supports ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
  .rd-bar { background: var(--rd-glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
}
.rd-bbtn {
  width: 54px; flex-shrink: 0; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--rd-ink2); font-size: 10px; padding: 5px 0 3px; border-radius: 12px;
  transition: color .2s var(--ease), background-color .2s var(--ease), transform .16s var(--spring);
}
.rd-bbtn:active { transform: scale(.94); background: var(--rd-soft); }
.rd-bic { font-size: 17px; line-height: 1.1; color: var(--rd-ink); font-family: var(--font-disp); }
.rd-bbtn.on { color: var(--rd-accent); }
.rd-bbtn.on .rd-bic { color: var(--rd-accent); }

.rd-prog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.rd-prog-track { position: relative; flex: 1; height: 32px; margin: 0 2px; touch-action: none; cursor: pointer; }
.rd-prog-rail { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 99px; background: var(--rd-line); }
.rd-prog-fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 99px; background: var(--rd-accent); opacity: .9; }
.rd-prog-knob {
  position: absolute; top: 50%; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--rd-accent); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--rd-glass), 0 2px 6px rgba(20, 16, 8, .28);
}
.rd-prog-tip {
  position: absolute; bottom: 27px; transform: translateX(-50%);
  background: var(--rd-ink); color: var(--rd-bg);
  font-size: 11px; line-height: 1; padding: 5px 9px; border-radius: 8px;
  white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums;
}
.rd-pct { flex-shrink: 0; width: 34px; text-align: right; font-size: 11px; color: var(--rd-ink2); font-variant-numeric: tabular-nums; }

/* 目录 / 书签抽屉（左侧滑出） */
.rd-drawer { position: absolute; inset: 0; z-index: 3; }
.rd-drawer-mask {
  position: absolute; inset: 0; background: rgba(15, 18, 30, .38);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: fadeIn .2s var(--ease-out) backwards;
}
.rd-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(82vw, 360px);
  background: var(--rd-sheet-bg); color: var(--rd-ink); border-right: 1px solid var(--rd-line);
  box-shadow: 24px 0 60px -30px rgba(13, 17, 34, .5);
  display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 calc(10px + env(safe-area-inset-bottom, 0px));
  animation: rdDrawerIn .3s var(--ease-out) backwards;
}
@keyframes rdDrawerIn { from { transform: translate3d(-100%, 0, 0); } }
.rd-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 11px; border-bottom: 1px solid var(--rd-line); }
.rd-drawer-head b { font-size: 15px; }
.rd-drawer-head .popup-close { background: var(--rd-soft); color: var(--rd-ink2); }
.rd-toc { flex: 1; overflow-y: auto; padding: 8px 10px; }
.rd-toc-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; background: transparent; color: var(--rd-ink); padding: 10px 10px; border-radius: 12px;
  transition: background-color .2s var(--ease);
}
.rd-toc-item:active { background: var(--rd-soft); }
.rd-toc-item.on { background: var(--rd-soft); }
.rd-toc-no { font-family: var(--font-num); font-size: 12px; font-weight: 800; color: var(--rd-ink2); opacity: .75; width: 24px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rd-toc-item.on .rd-toc-no { color: var(--rd-accent); opacity: 1; }
.rd-toc-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-toc-cn { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-toc-en { font-size: 11px; color: var(--rd-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-toc-state { font-size: 10.5px; color: var(--rd-ink2); opacity: .75; flex-shrink: 0; }
.rd-toc-item.on .rd-toc-state { color: var(--rd-accent); opacity: 1; font-weight: 700; }
.rd-bm-sec { border-top: 1px solid var(--rd-line); padding: 9px 10px 2px; max-height: 42%; display: flex; flex-direction: column; }
.rd-bm-head { font-size: 12px; font-weight: 700; color: var(--rd-ink2); padding: 2px 6px 7px; }
.rd-bm-n { color: var(--rd-accent); }
.rd-bm-list { overflow-y: auto; padding-bottom: 6px; }
.rd-bm { display: flex; align-items: center; gap: 4px; }
.rd-bm-go {
  flex: 1; min-width: 0; text-align: left; border: none; background: transparent; color: var(--rd-ink);
  padding: 8px 6px; border-radius: 10px; display: flex; flex-direction: column; gap: 2px;
  transition: background-color .2s var(--ease);
}
.rd-bm-go:active { background: var(--rd-soft); }
.rd-bm-t { font-size: 12.5px; font-weight: 700; color: var(--rd-accent); }
.rd-bm-x { font-size: 11.5px; color: var(--rd-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rd-bm-del {
  border: none; background: transparent; color: var(--rd-ink2); width: 30px; height: 30px;
  border-radius: 9px; flex-shrink: 0; transition: background-color .2s, color .2s;
}
.rd-bm-del:active { color: var(--red); background: var(--red-soft); }
.rd-bm-empty { font-size: 12px; color: var(--rd-ink2); padding: 6px; line-height: 1.6; }

/* 设置面板（底部上滑，夸克式）：字号 / 背景 / 显示翻译 */
.rd-sheet { position: absolute; inset: 0; z-index: 5; }
.rd-sheet-mask {
  position: absolute; inset: 0; background: rgba(12, 14, 22, .30);
  animation: fadeIn .18s var(--ease-out) backwards;
}
.rd-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--rd-sheet-bg); color: var(--rd-ink);
  border-radius: 20px 20px 0 0;
  padding: 9px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -18px 50px -22px rgba(12, 14, 30, .45);
  animation: sheetUp .28s var(--ease-out) backwards;
}
.rd-sheet-grip { width: 36px; height: 4px; border-radius: 99px; background: var(--rd-line); margin: 0 auto 8px; }
.rd-sheet-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; min-height: 30px; }
.rd-sheet-row + .rd-sheet-row { border-top: 1px solid var(--rd-line); }
.rd-sheet-label { width: 58px; flex-shrink: 0; font-size: 12.5px; color: var(--rd-ink2); }

.rd-sz { flex: 1; display: flex; align-items: center; gap: 11px; }
.rd-a-sm { font-size: 12px; color: var(--rd-ink2); }
.rd-a-lg { font-size: 19px; color: var(--rd-ink2); }
.rd-sz input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 99px; background: var(--rd-line); outline: none; margin: 0;
}
.rd-sz input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--rd-accent); border: 2.5px solid var(--rd-sheet-bg);
  box-shadow: 0 1px 4px rgba(20, 16, 8, .3); cursor: pointer;
}

.rd-themes { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rd-theme {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid var(--rd-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: transparent;
  transition: transform .18s var(--spring), box-shadow .2s var(--ease);
}
.rd-theme:active { transform: scale(.92); }
.rd-theme[data-th="paper"] { background: #f5efe2; }
.rd-theme[data-th="white"] { background: #fcfcfc; }
.rd-theme[data-th="green"] { background: #e4ecdc; }
.rd-theme[data-th="night"] { background: #1d1e22; border-color: rgba(255, 255, 255, .16); }
.rd-theme.on { box-shadow: 0 0 0 2px var(--rd-sheet-bg), 0 0 0 3.5px var(--rd-accent); }
.rd-theme.on::after { content: '✓'; line-height: 1; }
.rd-theme.on[data-th="paper"] { color: #8a6a35; }
.rd-theme.on[data-th="white"] { color: #4b5bd6; }
.rd-theme.on[data-th="green"] { color: #4f7a3a; }
.rd-theme.on[data-th="night"] { color: #c9a86a; }

.rd-switch { position: relative; margin-left: auto; flex-shrink: 0; }
.rd-switch input { position: absolute; opacity: 0; pointer-events: none; }
.rd-switch i { display: block; width: 46px; height: 27px; border-radius: 999px; background: var(--rd-soft); position: relative; transition: background-color .22s var(--ease); box-shadow: inset 0 0 0 1px var(--rd-line); }
.rd-switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s var(--spring);
}
.rd-switch input:checked + i { background: var(--rd-accent); box-shadow: none; }
.rd-switch input:checked + i::after { transform: translateX(19px); }

/* ================= 阅读器 · 左右翻页（默认） ================= */
/* page 模式：容器禁原生滚动与滚动条，翻页 = scrollTop 整屏推进 + 双页滑动过渡。
   overscroll-behavior:none 压掉真机上的弹性越界（否则手指上下带一下，正文会越出被工具栏压住）。 */
.reader.rd-page .rd-scroll { overflow: hidden; scrollbar-width: none; overscroll-behavior: none; touch-action: none; }
.reader.rd-page .rd-scroll::-webkit-scrollbar { display: none; }

/* 翻页过渡：旧视口快照层（由 JS 定位盖住 #rdScroll 区域，随动画滑出）。
   z-index 必须低于 .rd-bar（2）：ghost 是 append 到 #reader 末尾的，同层时会压住底栏。 */
.rd-ghost {
  position: absolute; z-index: 1; overflow: hidden; pointer-events: none;
  background: var(--rd-bg); will-change: transform;
  box-shadow: 0 0 30px rgba(15, 15, 28, .12);
}
/* 过渡期间容器禁滚动（scroll 模式下滑入不撑出横向滚动） */
.rd-scroll.rd-x-clip { overflow: hidden; }

/* 翻页方式切换（设置面板内）：左右翻 / 上下滚 */
.rd-mode-group { flex: 1; display: flex; gap: 8px; }
.rd-mode {
  flex: 1; border: 1px solid var(--rd-line); background: var(--rd-soft); color: var(--rd-ink2);
  border-radius: 10px; padding: 7px 0; font-size: 12.5px; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s, border-color .2s, transform .16s var(--spring);
}
.rd-mode:active { transform: scale(.94); }
.rd-mode.on { background: var(--rd-accent); border-color: var(--rd-accent); color: var(--rd-accent-ink); font-weight: 700; }

/* ================= 设置项说明（问号按钮 + 底部弹层） ================= */
#view-settings .card > h3 { display: flex; align-items: center; gap: 8px; }
.q-btn {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--soft); color: var(--ink2); font-size: 12px; font-weight: 800; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .2s var(--ease), color .2s, transform .16s var(--spring);
}
.q-btn:active { transform: scale(.86); background: var(--brand-soft); color: var(--brand); }
/* 说明文字移入问号弹层：卡片内原 hint 不再常显（账号状态是动态文本，保留） */
#view-settings .card .hint:not(#accStatus) { display: none; }

#qSheet { position: fixed; inset: 0; z-index: 130; }
.qs-mask { position: absolute; inset: 0; background: rgba(12, 14, 22, .34); animation: fadeIn .18s var(--ease-out) backwards; }
.qs-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 74vh;
  display: flex; flex-direction: column;
  background: var(--card-solid); color: var(--ink); border-radius: 20px 20px 0 0;
  padding: 9px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -18px 50px -22px rgba(12, 14, 30, .45);
  animation: sheetUp .28s var(--ease-out) backwards;
}
.qs-grip { width: 36px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 8px; flex-shrink: 0; }
.qs-head { font-size: 15px; font-weight: 800; padding: 2px 0 8px; flex-shrink: 0; }
.qs-body { overflow-y: auto; padding-bottom: 4px; }
.qs-item { padding: 11px 0; border-top: 1px solid var(--rule); }
.qs-item:first-child { border-top: none; padding-top: 4px; }
.qs-label { font-size: 12.5px; font-weight: 800; color: var(--ink); margin-bottom: 3px; }
.qs-text { font-size: 13px; line-height: 1.72; color: var(--ink2); }
.qs-text b { color: var(--ink); }
.qs-text code { font-family: var(--font-num); font-size: 12px; background: var(--soft); padding: 1px 5px; border-radius: 6px; }
.qs-foot { flex-shrink: 0; padding-top: 12px; }
.qs-foot .btn { width: 100%; }

/* ============================================================
   新增皮肤（免费）：08 素笺石墨 / 09 瑞士网格
   两块都是「中性极简」方向——现有七套全部带色相倾向
   （米纸 / 靛蓝 / 暖木 / 糖果 / 茶绿 / 霓虹），中性灰阶与
   纯白强排版是空着的。装饰上刻意不加任何材质：无阴影、
   无渐变光斑、无圆角修饰，只靠描边与字重拉开层次。
   ============================================================ */

/* ---------- 08 素笺石墨 —— 去色灰阶：界面只剩黑白灰，唯一点色是一点朱橙 ---------- */
:root[data-style="graphite"] {
  --bg: #f6f7f8;
  --ambient: none;
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-line: #e4e6e9;
  --ink: #16181b;
  --ink-body: #33373d;
  --ink2: #6a7076;
  --ink3: #aeb3b9;
  --brand: #17181a;          /* 墨黑按键：去色皮肤的「点色」就是按键本身 */
  --brand-soft: rgba(22, 24, 27, .07);
  --on-brand: #ffffff;
  --green: #1f7a4d;   --green-soft: rgba(31, 122, 77, .11);
  --amber: #c2521c;   --amber-soft: rgba(194, 82, 28, .11);
  --red: #c03a30;     --red-soft: rgba(192, 58, 48, .10);
  --violet: #5b4f86;  --violet-soft: rgba(91, 79, 134, .10);
  --note-bg: #f1f2f4; --note-border: #d3d6da; --note-ink: #4a4f55;
  --soft: rgba(22, 24, 27, .05);
  --soft2: rgba(22, 24, 27, .09);
  --toast-bg: rgba(22, 24, 27, .95);
  --tabbar-bg: #ffffff;
  --topbar-bg: rgba(246, 247, 248, .93);
  --line: rgba(22, 24, 27, .10);
  --rule: #e4e6e9;
  --boot-rule: #ced2d7;
  --boot-dot: #7d8389;
  --shadow: none;
  --shadow-lift: none;
  --btn-sh: none;
  --btn-sh-hover: none;
  --blur: none;
  --r-card: 8px; --r-item: 6px; --r-ctl: 4px; --r-pill: 4px;
  --pad-word: 22px 16px;
  --num-w: 700; --num-track: -.2px;
  --label-w: 600; --label-track: .1px;
  --hw-size: 42px; --hw-w: 700; --hw-track: 0px;
}
:root[data-style="graphite"][data-theme="dark"] {
  --bg: #0f1012;
  --card: #17191c;
  --card-solid: #1b1d21;
  --card-line: #292c31;
  --ink: #f3f4f6;
  --ink-body: #c9ccd1;
  --ink2: #8b9096;
  --ink3: #54585e;
  --brand: #e9eaec;          /* 深色下墨黑按键不可见，反转为白键黑字，仍不引入色相 */
  --brand-soft: rgba(233, 234, 236, .10);
  --on-brand: #14161a;
  --green: #59b183;   --green-soft: rgba(89, 177, 131, .16);
  --amber: #e08a4e;   --amber-soft: rgba(224, 138, 78, .16);
  --red: #e0705f;     --red-soft: rgba(224, 112, 95, .15);
  --violet: #a99ad6;  --violet-soft: rgba(169, 154, 214, .16);
  --note-bg: #1f2226; --note-border: #34383e; --note-ink: #b9bdc3;
  --soft: rgba(243, 244, 246, .06);
  --soft2: rgba(243, 244, 246, .11);
  --toast-bg: rgba(38, 41, 45, .96);
  --tabbar-bg: #131518;
  --topbar-bg: rgba(15, 16, 18, .93);
  --line: rgba(243, 244, 246, .10);
  --rule: #292c31;
  --boot-rule: #34383e;
  --boot-dot: #6b7076;
}
/* 石墨：卡片靠 1px 描边立住（没有阴影可用），一切圆角压到 4~8px */
:root[data-style="graphite"] .card { border: 1px solid var(--card-line); box-shadow: none; }
:root[data-style="graphite"] .wordcard { border: 1px solid var(--card-line); box-shadow: none; }
:root[data-style="graphite"] .task-btn { border: 1px solid var(--card-line); box-shadow: none; }
:root[data-style="graphite"] .tabbar { box-shadow: 0 -1px 0 var(--rule); }
:root[data-style="graphite"] .topbar { border-bottom: 1px solid var(--rule); }
:root[data-style="graphite"] .theme-btn { border: 1px solid var(--rule); box-shadow: none; }
:root[data-style="graphite"] .topsearch { border: 1px solid var(--rule); }
:root[data-style="graphite"] .ci-dot { border-radius: 3px; }
:root[data-style="graphite"] .progress { height: 6px; border-radius: 3px; }
:root[data-style="graphite"] .progress .bar { border-radius: 3px; }
:root[data-style="graphite"] .intro-ol li::before { border-radius: 3px; }
:root[data-style="graphite"] .btn.primary { box-shadow: none; }

/* ---------- 09 瑞士网格 —— 纯白 + 极淡方格底纹 + 克莱因蓝一点 + 超粗无衬线排版 ---------- */
:root[data-style="swiss"] {
  --bg: #ffffff;
  /* 方格底纹：固定在视口层（body::before），滚动时纹丝不动，像屏幕上的坐标纸 */
  --ambient:
    repeating-linear-gradient(90deg, rgba(10, 10, 11, .045) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(10, 10, 11, .045) 0 1px, transparent 1px 32px);
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-line: #e2e2e5;
  --ink: #0a0a0b;
  --ink-body: #2b2b2e;
  --ink2: #6e6e75;
  --ink3: #b4b4bb;
  --brand: #1b36d8;          /* 克莱因蓝：整屏唯一高饱和色 */
  --brand-soft: rgba(27, 54, 216, .08);
  --on-brand: #ffffff;
  --green: #0f7a45;   --green-soft: rgba(15, 122, 69, .10);
  --amber: #a05a00;   --amber-soft: rgba(160, 90, 0, .10);
  --red: #c2261f;     --red-soft: rgba(194, 38, 31, .09);
  --violet: #4237b8;  --violet-soft: rgba(66, 55, 184, .09);
  --note-bg: #f4f5f8; --note-border: #c9cdd8; --note-ink: #2b2b2e;
  --soft: rgba(10, 10, 11, .04);
  --soft2: rgba(10, 10, 11, .08);
  --toast-bg: rgba(10, 10, 11, .95);
  --tabbar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, .94);
  --line: rgba(10, 10, 11, .12);
  --rule: #e2e2e5;
  --boot-rule: #d6d6da;
  --boot-dot: #1b36d8;
  --shadow: none;
  --shadow-lift: none;
  --btn-sh: none;
  --btn-sh-hover: none;
  --blur: none;
  --font-disp: "Helvetica Neue", Helvetica, Inter, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: var(--font-disp);
  --font-label: var(--font-disp);
  --r-card: 0px; --r-item: 0px; --r-ctl: 0px; --r-pill: 0px;
  --pad-word: 26px 16px;
  --wc-align: left; --wc-justify: flex-start;
  --num-w: 800; --num-track: -1.2px;
  --label-w: 700; --label-track: .09em; --label-tf: uppercase;
  --tag-tf: uppercase; --tag-track: .06em;
  --hw-size: 46px; --hw-w: 800; --hw-track: -1.4px;
}
:root[data-style="swiss"][data-theme="dark"] {
  --bg: #0a0a0b;
  --ambient: none;           /* 深色下底纹会显脏，关掉，只留纯黑底 */
  --card: #131315;
  --card-solid: #17171a;
  --card-line: #2a2a2f;
  --ink: #f5f5f6;
  --ink-body: #cdcdd2;
  --ink2: #8b8b93;
  --ink3: #4d4d54;
  --brand: #7d8dff;
  --brand-soft: rgba(125, 141, 255, .16);
  --on-brand: #0a0a0b;
  --green: #4bbd84;   --green-soft: rgba(75, 189, 132, .16);
  --amber: #f0a94a;   --amber-soft: rgba(240, 169, 74, .16);
  --red: #ff6b5e;     --red-soft: rgba(255, 107, 94, .15);
  --violet: #a79cff;  --violet-soft: rgba(167, 156, 255, .16);
  --note-bg: #1a1a1e; --note-border: #33333a; --note-ink: #cdcdd2;
  --soft: rgba(245, 245, 246, .06);
  --soft2: rgba(245, 245, 246, .12);
  --toast-bg: rgba(30, 30, 34, .96);
  --tabbar-bg: #101012;
  --topbar-bg: rgba(10, 10, 11, .94);
  --line: rgba(245, 245, 246, .12);
  --rule: #2a2a2f;
  --boot-rule: #3a3a42;
  --boot-dot: #7d8dff;
}
/* 瑞士：直角到底 + 左对齐 + 小标题走大写小字，一切对齐到网格 */
:root[data-style="swiss"] .card { border: 1px solid var(--card-line); box-shadow: none; }
:root[data-style="swiss"] .card h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink2);
}
:root[data-style="swiss"] .wordcard { border: 1px solid var(--card-line); box-shadow: none; justify-content: flex-start; text-align: left; }
:root[data-style="swiss"] .wc-tags, :root[data-style="swiss"] .wc-wordline { justify-content: flex-start; }
:root[data-style="swiss"] .task-btn { border: 1px solid var(--card-line); box-shadow: none; }
:root[data-style="swiss"] .checkin-hero { text-align: left; }
:root[data-style="swiss"] .ci-big, :root[data-style="swiss"] .ci-days { justify-content: flex-start; }
:root[data-style="swiss"] .ci-dot { border-radius: 0; }
:root[data-style="swiss"] .dq { text-align: left; }
:root[data-style="swiss"] .tag { border-radius: 0; }
:root[data-style="swiss"] .progress { height: 8px; border-radius: 0; }
:root[data-style="swiss"] .progress .bar { border-radius: 0; }
:root[data-style="swiss"] .intro-ol li::before { border-radius: 0; }
:root[data-style="swiss"] .tabbar { box-shadow: 0 -1px 0 var(--rule); }
:root[data-style="swiss"] .tab .lb { font-size: 10px; letter-spacing: .05em; }
:root[data-style="swiss"] .theme-btn { border: 1px solid var(--rule); box-shadow: none; }
:root[data-style="swiss"] .topsearch { border: 1px solid var(--rule); }
:root[data-style="swiss"] .btn.primary { box-shadow: none; }

/* ================= 今日排行榜 ================= */
/* 入口横幅：和「双人成行」同一套卡片语言，颜色全走令牌，9 套皮肤自动适配 */
.shop-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 13px 16px; margin-bottom: 12px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
  transition: transform .16s var(--spring), border-color .2s;
}
.shop-banner:active { transform: scale(.985); }
.sbb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sbb-icon { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.sbb-title { font-size: 14px; font-weight: 700; letter-spacing: .5px; color: var(--ink); }
.sbb-desc { font-size: 11.5px; color: var(--ink2); margin-top: 2px; }
.sbb-btn {
  border: 1px solid var(--line); background: var(--soft); color: var(--brand);
  padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}

/* 弹层：沿用 .popup 的底部抽屉，只调整内部节奏 */
.lb-sheet { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.lb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lb-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: .3px; }
.lb-sub { font-size: 11.5px; color: var(--ink2); margin-top: 3px; line-height: 1.45; }
.lb-body { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px;
  background: var(--soft); border: 1px solid transparent;
}
.lb-row.me { background: var(--brand-soft); border-color: var(--brand); }
.lb-rank {
  width: 24px; flex: 0 0 auto; text-align: center;
  font-size: 13px; font-weight: 800; color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.lb-rank.medal { font-size: 17px; }
.lb-ava { width: 30px; height: 30px; flex: 0 0 auto; }
.lb-name {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-name .lb-tag {
  font-size: 10px; font-weight: 700; color: var(--brand);
  border: 1px solid var(--brand); border-radius: 999px;
  padding: 0 5px; margin-left: 5px; vertical-align: 1px;
}
.lb-nums { display: flex; gap: 7px; font-size: 11px; color: var(--ink2); white-space: nowrap; }
.lb-nums b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-total {
  min-width: 38px; text-align: right; flex: 0 0 auto;
  font-size: 15px; font-weight: 800; color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.lb-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink2); text-align: center; line-height: 1.6;
}
.lb-empty { text-align: center; color: var(--ink2); font-size: 12.5px; padding: 26px 0; }
.lb-loading { text-align: center; color: var(--ink2); font-size: 12.5px; padding: 26px 0; }
