/* style.css — 雅思听写 · 设计层
 * 基座：Pico CSS v2（MIT，assets/vendor/pico.min.css），本文件在其上定义设计令牌与组件。
 * 视觉方向（2026-08-03 改版，参照 参考风格/1-dimensional-layering.html + daisyUI）：
 * Dimensional Layering —— 白卡细边框 + 彩色渐变偏移背板（hover 背板滑出）、
 * 多色 soft 点缀、暗色玻璃拟态登录区、按钮按压态。主题绿 #166534 仍是第一色。
 * 字重 400 / 600 / 700 / 800（大标题）。
 * 背板实现约定：卡片本体永不 transform（transform 会新建 stacking context，
 * 把 z-index:-1 的背板顶到卡面上来）；hover 一律只动背板与阴影。 */

/* ---------------- 设计令牌 ---------------- */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;

  /* 2026-08-03 三次修正：整版中性化。前版墨色/线条/次级底全是带绿的灰，
     叠上绿色主色后整页读感发绿。中性面板一律无彩度近白/灰，绿只留在
     --accent 点缀（与 wamiko.com 门户的产品点缀色约定一致）。 */
  --bg: #fafbfc;            /* 近白纸面 */
  --card: #ffffff;
  --card-2: #f1f3f6;
  --ink: #1d2129;
  --ink-2: #495057;
  --muted: #6c757d;
  --line: #e7eaef;
  --line-strong: #d4d9e0;
  --accent: #166534;
  --accent-strong: #14532d;
  --accent-soft: #e9f6ec;
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, .07);
  --ok-soft: #e9f6ec;
  --note: #8a5a0b;
  --note-soft: rgba(150, 118, 20, .09);
  /* 单行控件统一高度：Pico 输入框默认 48px、自绘按钮 42px，同行必错位。
     Pico 高度=1rem×line-height+spacing×2+border×2 且选择器优先级压不住，
     只能改令牌：8px 令公式得 ≈42px。 */
  --control-h: 42px;
  --pico-form-element-spacing-vertical: 8px;
  --radius: 12px;        /* 控件 / 按钮 */
  --radius-lg: 20px;     /* 卡片 */
  --shadow: 0 1px 3px rgba(35, 42, 54, .05);
  --shadow-hover: 0 20px 44px -14px rgba(35, 42, 54, .17);

  /* Dimensional Layering：六个循环点缀色（背板渐变 + 编号章） */
  --hue-1: #166534; --hue-1s: #e9f6ec;
  --hue-2: #2563eb; --hue-2s: #e6effe;
  --hue-3: #b45309; --hue-3s: #fdf1e3;
  --hue-4: #6d4aff; --hue-4s: #eeeaff;
  --hue-5: #be3963; --hue-5s: #fbeaf0;
  --hue-6: #0f766e; --hue-6s: #e5f5f2;
  --plate-alpha: 55%;    /* 背板渐变里主色的浓度 */

  /* Pico 主题变量接管 */
  --pico-font-family: var(--font-ui);
  --pico-font-size: 15px;
  --pico-line-height: 1.6;
  --pico-border-radius: var(--radius);
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-hover-background: var(--accent-strong);
  --pico-primary-focus: rgba(22, 101, 52, .25);
  --pico-color: var(--ink);
  --pico-background-color: var(--bg);
  --pico-card-background-color: var(--card);
  --pico-muted-color: var(--muted);
  --pico-muted-border-color: var(--line);
  --pico-h1-color: var(--ink);
  --pico-h2-color: var(--ink);
  --pico-h3-color: var(--ink);
  --pico-text-selection-color: rgba(22, 101, 52, .16);
}

html[data-theme="dark"] {
  --bg: #10141c;
  --card: #171c26;
  --card-2: #1f2530;
  --ink: #e6eaf2;
  --ink-2: #b3bccd;
  --muted: #8b96ab;
  --line: #283041;
  --line-strong: #394357;
  --accent: #4aa573;
  --accent-strong: #63bd8c;
  --accent-soft: rgba(74, 165, 115, .15);
  --danger: #e06a5e;
  --danger-soft: rgba(224, 106, 94, .13);
  --ok-soft: rgba(74, 165, 115, .15);
  --note: #cfa64a;
  --note-soft: rgba(207, 166, 74, .13);
  --shadow: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-hover: 0 20px 44px -14px rgba(0, 0, 0, .55);
  --hue-1: #4aa573; --hue-1s: rgba(74, 165, 115, .16);
  --hue-2: #6b9aff; --hue-2s: rgba(107, 154, 255, .15);
  --hue-3: #d99a4e; --hue-3s: rgba(217, 154, 78, .14);
  --hue-4: #9d86ff; --hue-4s: rgba(157, 134, 255, .15);
  --hue-5: #e07a9b; --hue-5s: rgba(224, 122, 155, .14);
  --hue-6: #4fb3aa; --hue-6s: rgba(79, 179, 170, .15);
  --plate-alpha: 34%;
  color-scheme: dark;
}

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); line-height: 1.6; font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error-text { color: var(--danger); }
kbd {
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 5px; font-family: var(--font-ui); font-size: .78em; color: var(--ink-2);
  background: var(--card);
}
code {
  background: var(--card-2); border-radius: 5px; padding: 0 4px;
  font-size: .88em; color: var(--ink-2);
}
h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; }
::selection { background: rgba(22, 101, 52, .16); }

button { font-family: inherit; cursor: pointer; }
/* 接管 Pico 的按钮基座：默认“无造型”，由组件类决定外观。
   注意必须用真实选择器（不能用 :where），否则优先级压不过 Pico 的按钮规则，
   其默认 padding 会把小尺寸图标按钮的内容区挤没。 */
button, [type="submit"], [type="reset"], [type="button"], [role="button"] {
  --pico-background-color: transparent;
  --pico-color: var(--ink);
  --pico-border-color: transparent;
  --pico-border-width: 0;
  --pico-font-weight: 600;
  background: none;
  color: var(--ink);
  padding: 0;
  transition: color .15s, background-color .15s, border-color .15s, opacity .15s,
    box-shadow .18s, transform .18s;
}
:where(button, [role="button"]):focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input, textarea { caret-color: var(--accent); }

/* 视图容器自建 stacking context：卡片背板用 z-index:-1，若无此层，
   负 z 伪元素会被画到 body 不透明背景之下而不可见（html 与 body 都有底色）。 */
.view { position: relative; z-index: 0; }
/* 视图切换的进入反馈（唯一的入场动效） */
.view:not(.hidden) { animation: view-in .32s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- 图标 ---------------- */
.ico { display: inline-flex; width: 1em; height: 1em; vertical-align: -.12em; }
.ico svg, .btn-ico svg, .fb-ico svg { width: 100%; height: 100%; stroke: currentColor;
  fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-ico { display: inline-flex; width: 15px; height: 15px; margin-right: 6px;
  vertical-align: -2px; }

/* ---------------- 头部 ---------------- */
.site-header {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 10; padding: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between;
  min-height: 66px; max-width: 1180px; gap: 12px; }
.brand-cluster { display: flex; align-items: center; gap: 13px; }
/* 主品牌 = wamiko.com 大字标（2026-08-03 改版，与主站首页同款）：
   音节 wa·mi·ko 拉开 + 小号蓝色 .com；逐字母落地弹跳入场（--d 控制每字延迟），
   悬停单字母再跳。基线样式即最终态，动画用 backwards 只管入场，悬停替换动画不会闪隐。 */
.suite-brand {
  display: inline-flex; align-items: center; height: 32px;
  color: var(--ink); text-decoration: none; flex: none;
  font-size: 21px; font-weight: 800; letter-spacing: -.02em;
  white-space: nowrap; line-height: 1;
}
.suite-brand .wm-s + .wm-s { margin-left: .13em; }
.suite-brand .wm-tld { margin-left: .1em; font-size: .55em; font-weight: 700; color: #2563eb; }
html[data-theme="dark"] .suite-brand .wm-tld { color: #6b9aff; }
/* 动画分层：b 只管入场（animation 永不切换），内层 i 只管悬停跳。
   共用一层时，移开鼠标 animation 换回 wm-drop 会整段重播入场，字标窜出再落下。 */
/* 入场与待机都挂在 b 上（多重 animation，永不被替换）；
   悬停单独用 i 的 transition —— 两者不再抢同一个 animation 属性，
   鼠标扫过后不会停在中间帧（2026-08-04 修）。 */
.suite-brand b {
  display: inline-block; font-weight: inherit; color: inherit;
  animation: wm-drop .85s cubic-bezier(.24,1.2,.36,1) var(--d, 0s) backwards,
             wm-idle 16s ease-in-out calc(var(--d, 0s) * 4 + 8s) infinite;
}
/* 待机小跳：每 16s 按入场节奏错峰轻跳一轮 */
@keyframes wm-idle {
  0%, 90%, 96%, 100% { transform: none; }
  92% { transform: translateY(-.14em) scale(.98, 1.03); }
  94.2% { transform: translateY(.04em) scale(1.02, .97); }
}
.suite-brand b i { display: inline-block; font-style: normal;
  transition: transform .28s cubic-bezier(.34, 1.56, .64, 1); }
.suite-brand b:hover i { transform: translateY(-.18em); }
/* 音节三重奏（与主站首页一致）：wa 实心 / mi 品牌蓝 / ko 空心描边 */
.suite-brand .wm-s:nth-child(2) { color: #2563eb; }
html[data-theme="dark"] .suite-brand .wm-s:nth-child(2) { color: #6b9aff; }
.suite-brand .wm-s:nth-child(3) { color: transparent; -webkit-text-stroke: .06em var(--ink); }
@supports not (-webkit-text-stroke: 1px #000) {
  .suite-brand .wm-s:nth-child(3) { color: var(--ink); }
}
@keyframes wm-drop {
  0%   { opacity: 0; transform: translateY(-1.2em); }
  46%  { opacity: 1; transform: translateY(0); }
  58%  { transform: translateY(.1em) scale(1.06,.88); }
  74%  { transform: translateY(-.14em) scale(.97,1.04); }
  88%  { transform: translateY(.03em); }
  100% { opacity: 1; transform: none; }
}
@keyframes wm-hop {
  35% { transform: translateY(-.22em) scale(.97,1.05); }
  65% { transform: translateY(.05em) scale(1.04,.94); }
}
@media (prefers-reduced-motion: reduce) {
  .suite-brand b { animation: none; }
  .suite-brand b i { transition: none; }
}
.suite-divider { width: 1px; height: 26px; background: var(--line-strong); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--ink); cursor: pointer; }
/* 品牌图标与 wamiko.com 门户同款：浅绿圆角砖 + 绿描边「耳机」。
   旧的深绿方块+均衡器条是门户改版前的图形，已废弃。 */
.brand-mark { width: 30px; height: 30px; }
.brand-mark .mark-bg { fill: var(--accent-soft); }
.brand-mark .mark-ico {
  stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; fill: none;
}
html[data-theme="dark"] .brand-mark .mark-bg { fill: rgba(127, 199, 159, .16); }
html[data-theme="dark"] .brand-mark .mark-ico { stroke: #7fc79f; }
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { display: block; font-size: 9px; font-weight: 600;
  letter-spacing: .1em; color: var(--accent); margin-top: 2px; }
.nav { display: flex; gap: 2px; align-items: center; }
.nav-btn {
  border: none; background: none; color: var(--ink-2); font-size: 14px;
  padding: 7px 12px; border-radius: var(--radius);
}
.nav-btn:hover { color: var(--ink); background: var(--card-2); }
.nav-cta { background: var(--accent); color: #fff; margin-left: 6px; }
.nav-cta:hover { background: var(--accent-strong); color: #fff; }
.badge {
  display: inline-block; min-width: 17px; text-align: center; background: var(--danger);
  color: #fff; border-radius: 9px; font-size: 11px; line-height: 17px;
  padding: 0 5px; margin-left: 5px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink-2); display: inline-flex; align-items: center;
  justify-content: center; margin-left: 8px; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------- 通用组件 ---------------- */
main.wrap { max-width: 1180px; padding-top: 26px; padding-bottom: 70px; }
.page-tip { color: var(--ink-2); margin: 0 0 4px; font-size: 14px; }
.group-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted);
  margin: 30px 0 12px; text-transform: uppercase;
}
.group-note { font-weight: 400; letter-spacing: .04em; margin-left: 8px;
  text-transform: none; }
.panel-title { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.panel-note { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 8px; }

.primary-btn, .ghost-btn {
  border-radius: var(--radius); padding: 0 18px; font-size: 14px; font-weight: 600;
  height: var(--control-h);
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
}
.primary-btn { background: var(--accent); color: #fff; border: 1px solid var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 28%, transparent); }
/* 暗色 accent 较亮，白字对比度不足；改深色字，与集群暗色按钮写法一致 */
html[data-theme="dark"] .primary-btn { color: #101211; }
.primary-btn:hover { background: var(--accent-strong); border-color: var(--accent-strong);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 38%, transparent); }
.primary-btn:active { transform: translateY(1px);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.primary-btn:disabled { opacity: .4; cursor: not-allowed; }
.ghost-btn { background: var(--card); border: 1px solid var(--line-strong); color: var(--ink); }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--card)); }
.ghost-btn:active { transform: translateY(1px); }
.ghost-btn.danger { color: var(--danger); border-color: var(--danger); }
.ghost-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.link-btn {
  background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 600;
  padding: 3px 5px; border-radius: 5px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.back-btn:hover { color: var(--ink); text-decoration: none; }

/* ---------------- 词库卡片 ---------------- */
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.lib-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px 16px; cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .18s, box-shadow .18s;
}
.lib-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-hover); }
.lib-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib-card h3 { margin: 0 0 3px; font-size: 16px; font-weight: 700; }
.lib-desc { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; min-height: 20px; }
.lib-meta { margin: 0; color: var(--muted); font-size: 12px; }
.lib-prog { margin-top: 7px; font-size: 12.5px; color: var(--accent); }
.lib-prog.muted { color: var(--muted); }
.lib-tag {
  position: absolute; top: 14px; right: 42px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 9px;
}
.lib-del {
  position: absolute; top: 8px; right: 8px; border: none; background: none;
  color: var(--muted); width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lib-del:hover { color: var(--danger); background: var(--danger-soft); }
.lib-del .ico { width: 13px; height: 13px; }

/* ---------------- 配置页 ---------------- */
.setup-title { margin: 14px 0 2px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.setup-desc { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.setup-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .setup-cols { grid-template-columns: 1fr; } }
.setup-sections, .setup-settings {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow);
}
.sec-row { display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding: 8px 0; }
.sec-row:last-of-type { border-bottom: none; }
.sec-label { display: flex; align-items: center; gap: 9px; cursor: pointer; flex: 1;
  font-size: 14px; }
.sec-count { color: var(--muted); font-size: 12px; }
.sec-prog { color: var(--accent); font-size: 12px; }
.sec-words { padding: 6px 0 6px 26px; }
.sec-words .word-table { max-height: 280px; overflow: auto; display: block; }

.set-row { display: flex; align-items: center; gap: 10px; margin: 13px 0; flex-wrap: wrap; }
.set-row > label { width: 60px; color: var(--ink-2); font-size: 13.5px; flex-shrink: 0; }
.set-note { color: var(--muted); font-size: 12.5px; }
.set-note-block { flex-basis: 100%; margin-left: 70px; }
.seg { display: inline-flex; gap: 2px; background: var(--card-2);
  border-radius: 12px; padding: 3px; }
.seg button {
  border: none; background: none; padding: 6px 13px; font-size: 13px;
  color: var(--ink-2); border-radius: 9px;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--accent); font-weight: 600;
  box-shadow: var(--shadow); }
#set-pick {
  width: 110px; padding: 7px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font-size: 14px; background: var(--card); color: var(--ink);
}
#set-pick:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, .13); }
.set-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
  margin: 18px 0; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  color: var(--ink-2); cursor: pointer; }
.switch input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
/* 配置页底部的全局设置摘要行 */
.prefs-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin: 18px 0 14px; padding-top: 13px;
  color: var(--muted); font-size: 12.5px; line-height: 1.7;
}
.prefs-summary #setup-prefs-line { flex: 1; min-width: 180px; }

/* ---------------- 设置弹窗 ---------------- */
/* Pico 把 dialog 做成全屏遮罩层（min-width/height:100%），卡片造型交给内部 form；
   此处把 dialog 还原为透明全屏 flex 容器，卡片样式集中在 .prefs-form 上 */
.prefs-dlg {
  min-width: 0; min-height: 0; border: none; padding: 0;
  background: transparent; color: var(--ink);
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 720px);
}
.prefs-dlg::backdrop { background: rgba(16, 24, 40, .42); }
.prefs-form { padding: 20px 24px 22px; overflow: auto; max-height: inherit; width: 100%;
  background: var(--card); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .25); }
/* showModal 后焦点落在 form 上，UA 焦点环会描住整个卡片，这里不需要 */
.prefs-form:focus { outline: none; }
/* Pico 会给 form 内的表单元素加 margin-bottom，这里的 seg/开关不需要 */
.prefs-form button, .prefs-form input, .prefs-form label { margin-bottom: 0; }
.prefs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prefs-head h2 { margin: 0; font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.prefs-tip { color: var(--muted); font-size: 12.5px; margin: 6px 0 16px; line-height: 1.65; }
.prefs-dlg .set-row > label { width: 68px; }
.prefs-dlg .set-note-block { margin-left: 78px; }
.prefs-actions {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px;
}
.prefs-actions .primary-btn { min-width: 120px; }

.big-start {
  width: 100%; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 13px; padding: 14px; font-size: 15.5px; font-weight: 700;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 55%, transparent);
}
html[data-theme="dark"] .big-start { color: #101211; }
.big-start:hover { background: var(--accent-strong); border-color: var(--accent-strong);
  box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--accent) 65%, transparent); }
.big-start:active { transform: translateY(1px);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---------------- 听写页 ---------------- */
.d-top { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.d-progress { flex: 1; height: 4px; background: var(--line); border-radius: 4px;
  overflow: hidden; }
#d-progressbar { height: 100%; width: 0; background: var(--accent); border-radius: 4px;
  transition: width .25s; }
.d-counter { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.pass-notice {
  border: none; color: var(--note); background: var(--note-soft);
  border-radius: var(--radius); padding: 9px 16px; margin: 8px 0; text-align: center;
  font-size: 13.5px;
}
/* 听写主卡：本站唯一常驻的「偏移背板」主角（绿色渐变垫层，静置不动） */
.d-main {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow); padding: 44px 30px 30px; text-align: center;
  max-width: 660px; margin: 24px auto 0;
}
.d-main::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--hue-1) var(--plate-alpha), var(--hue-1s)),
    color-mix(in srgb, var(--hue-2) calc(var(--plate-alpha) - 8%), var(--hue-2s)));
  transform: translate(9px, 9px);
}
.d-prompt { min-height: 36px; font-size: 19px; margin-bottom: 8px; }
.recite-t { color: var(--accent); font-weight: 600; }
.hint-t { color: var(--ink-2); letter-spacing: 2px; font-weight: 600; }
.play-btn {
  width: 76px; height: 76px; border-radius: 50%; border: none;
  background: var(--accent-soft); color: var(--accent); margin: 6px auto 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent-soft) 55%, transparent),
    0 10px 24px -8px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: background-color .15s, color .15s, transform .1s, box-shadow .18s;
}
.play-btn:hover { background: var(--accent); color: #fff; transform: scale(1.04);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-soft) 70%, transparent),
    0 14px 30px -8px color-mix(in srgb, var(--accent) 50%, transparent); }
.play-btn:active { transform: scale(.97); }
html[data-theme="dark"] .play-btn:hover { color: #101211; }
.play-btn .ico { width: 26px; height: 26px; }
.play-btn.playing { background: var(--accent); color: #fff;
  animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .72; } }
.channel-note { min-height: 20px; font-size: 12.5px; color: var(--note); }
.channel-note.error { color: var(--danger); }
.d-input {
  width: 100%; max-width: 430px; margin: 12px auto 0; display: block;
  font-size: 26px; font-weight: 600; padding: 10px 16px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--bg); color: var(--ink); outline: none;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.d-input:focus { border-color: var(--accent); background: var(--card);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, .13); }
.d-input::placeholder { color: var(--muted); font-weight: 400; font-size: 14px; }
/* 分组模式提交回执：中性一闪，不透露对错 */
.d-input.logged { animation: logged .32s ease-out; }
@keyframes logged { 0% { background: var(--card-2); } 100% { background: var(--card); } }
.d-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px;
  flex-wrap: wrap; }

/* 快捷键提示：听写卡左上角的小图标，悬停/聚焦向下展开面板；按钮内不再放 kbd */
.kbd-tips { position: absolute; top: 14px; left: 14px; z-index: 3;
  text-align: left; outline: none; }
.kbd-tips-icon { display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--card-2); color: var(--ink-2);
  border: 1px solid var(--line); cursor: default;
  transition: color .15s, border-color .15s, background-color .15s; }
.kbd-tips-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kbd-tips:hover .kbd-tips-icon, .kbd-tips:focus-within .kbd-tips-icon {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.kbd-tips-panel { position: absolute; top: 41px; left: 0; min-width: 172px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-hover); padding: 10px 13px;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; }
.kbd-tips:hover .kbd-tips-panel, .kbd-tips:focus-within .kbd-tips-panel {
  opacity: 1; transform: none; pointer-events: auto; }
.kbd-tips-panel div { display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--ink-2); padding: 3.5px 0; white-space: nowrap; }
.kbd-tips-panel kbd { min-width: 46px; text-align: center; }
.kbd-tips-title { font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase; margin: 0 0 4px; }
.d-feedback {
  margin: 24px auto 0; max-width: 510px; border-radius: var(--radius);
  text-align: left; font-size: 14.5px; max-height: 0; overflow: hidden;
  transition: max-height .2s, padding .2s;
}
.d-feedback.show { max-height: 320px; padding: 14px 18px; }
.d-feedback.ok { background: var(--ok-soft); }
.d-feedback.bad { background: var(--danger-soft); }
.fb-line { margin: 4px 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.fb-line .fb-word { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.fb-line.yours s { color: var(--danger); }
.fb-ico { display: inline-flex; width: 15px; height: 15px; align-self: center; }
.fb-ico.ok { color: var(--accent); }
.fb-ico.bad { color: var(--danger); }
.phon { color: var(--ink-2); font-size: 15px; }
.trans { color: var(--ink-2); }
/* ---------------- 分组听写：组末讲评 ---------------- */
.group-review {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover); padding: 20px 22px 22px;
  max-width: 760px; margin: 20px auto 0;
}
.gr-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gr-title { margin: 0; font-weight: 700; font-size: 21px; letter-spacing: -.01em; }
.gr-stat { color: var(--ink-2); font-size: 13.5px; }
.gr-stat b { color: var(--accent); font-size: 15px; }
/* 滚动放在外层容器上，表格本身保持 table 布局，才能撑满面板宽度 */
#gr-list { max-height: 46vh; overflow: auto; }
#gr-list th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.group-review .word-table td:first-child { width: 22px; padding-right: 0; }
.group-review .word-table .fb-ico { position: relative; top: 2px; }
tr.gr-bad td { background: var(--danger-soft); }
tr.gr-bad s { color: var(--danger); }
.gr-actions { display: flex; justify-content: center; margin-top: 18px; }
.gr-actions .primary-btn { min-width: 190px; }

.d-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.d-foot b { color: var(--accent); font-size: 15px; }
.d-crumb::before { content: "·"; margin: 0 8px; color: var(--line-strong); }

/* ---------------- 总结 / 统计卡片 ---------------- */
.summary-title { text-align: center; font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.summary-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin: 18px 0 28px;
}
/* 总结/统计数字卡：daisyUI stats 质感 + 循环色小背板 */
.sum-card {
  --hue: var(--hue-1); --hue-s: var(--hue-1s);
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center; padding: 18px 10px 14px; box-shadow: var(--shadow);
}
.sum-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: color-mix(in srgb, var(--hue) var(--plate-alpha), var(--hue-s));
  transform: translate(5px, 5px);
}
.sum-card:nth-child(2) { --hue: var(--hue-2); --hue-s: var(--hue-2s); }
.sum-card:nth-child(3) { --hue: var(--hue-3); --hue-s: var(--hue-3s); }
.sum-card:nth-child(4) { --hue: var(--hue-4); --hue-s: var(--hue-4s); }
.sum-card:nth-child(5) { --hue: var(--hue-5); --hue-s: var(--hue-5s); }
.sum-card:nth-child(6) { --hue: var(--hue-6); --hue-s: var(--hue-6s); }
.sum-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  color: var(--hue, var(--accent)); line-height: 1.15; }
.sum-label { color: var(--muted); font-size: 12px; margin-top: 3px; }
.summary-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px;
  flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.word-table { width: 100%; border-collapse: collapse; background: var(--card);
  font-size: 14px; }
.word-table th, .word-table td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.word-table th {
  color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; border-bottom-color: var(--line-strong);
}
.word-table tr:last-child td { border-bottom: none; }
/* daisyUI zebra：偶数行轻微着色，长表更易扫行 */
.word-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--card-2) 45%, var(--card)); }
.word-table b { font-weight: 600; font-size: 15.5px; }
.mini-play {
  border: none; background: none; color: var(--ink-2); padding: 3px 5px;
  border-radius: 6px; display: inline-flex; align-items: center;
}
.mini-play:hover { color: var(--accent); background: var(--accent-soft); }
.mini-play .ico { width: 15px; height: 15px; }

/* ---------------- 错词本 ---------------- */
.wb-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; }
.wb-actions { display: flex; gap: 10px; }
.wb-group {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  margin-bottom: 16px; padding: 8px 16px 14px; box-shadow: var(--shadow);
}
.wb-group-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; }
.wb-group-head h3 { margin: 10px 0; }
.wb-group-head > div { display: flex; gap: 8px; }
.wb-group .ghost-btn { padding: 6px 12px; font-size: 13px; }

/* ---------------- 导入 ---------------- */
.import-help {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 13px 16px; font-size: 13.5px; margin-bottom: 16px;
}
.import-form { display: flex; flex-direction: column; gap: 12px; }
#imp-name {
  padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 14.5px; background: var(--card); color: var(--ink);
}
#imp-name:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, .13); }
#imp-text {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px 14px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; resize: vertical; background: var(--card); color: var(--ink);
  line-height: 1.7;
}
#imp-text:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, .13); }
.import-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.import-progress { color: var(--ink-2); font-size: 13.5px; min-height: 22px; }
.file-label { display: inline-flex; align-items: center; cursor: pointer; }
input[type="file"]::file-selector-button {
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer;
  margin-right: 10px;
}

/* ---------------- 统计 ---------------- */
.stats-backup { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .header-inner { padding: 8px 0; flex-wrap: wrap; min-height: 60px; }
  .suite-brand { font-size: 15px; }
  .brand-cluster { gap: 9px; }
  .brand-text { font-size: 16px; }
  .brand-sub { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d-main { padding: 28px 16px 22px; }
  .d-input { font-size: 22px; }
  .set-switches { grid-template-columns: 1fr; }
  .nav-btn { padding: 6px 9px; font-size: 13.5px; }
}

/* ---------------- 错词本：毕业进度 / 窄屏表格 ---------------- */
.wb-graduated { color: var(--ink-2); font-size: 13.5px; margin: 0 0 12px; }
.wb-graduated b { color: var(--accent); }
.wb-streak { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
/* 表格在窄屏各自横向滚动，页面本身不横滚 —— 以前错词本的「移除」按钮会被卡片裁掉点不到 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .word-table { min-width: 520px; }

/* ---------------- 账号与同步 ---------------- */
.acct-box { border: none; border-radius: 16px;
  padding: 14px 16px; margin: 4px 0 18px; background: var(--card-2); }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct-head h3 { margin: 0 0 6px; }
.acct-status { font-size: 12.5px; color: var(--muted); }
.acct-status.ok { color: var(--accent); }
.acct-status.bad { color: var(--danger); }
.acct-form { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.acct-form input { flex: 1 1 200px; padding: 8px 12px; font-size: 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink); }
.acct-form input:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, .13); }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-actions .primary-btn, .acct-actions .ghost-btn { padding: 7px 14px; font-size: 13.5px; }
.acct-msg { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: var(--danger); }
.acct-msg.ok { color: var(--accent); }
.acct-who { margin: 8px 0 10px; font-size: 14px; }

/* ---------------- 介绍页（未登录）：清新简约绿（2026-08-03 改版） ---------------- */
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .9fr);
  gap: 54px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 64px 0 26px; }
.lp-eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 16px;
  color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.lp-eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px;
  background: var(--accent); }
.lp-title { margin: 0; font-size: clamp(34px, 4.6vw, 52px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.14; }
.lp-title em { font-style: normal; color: var(--accent); }
.lp-sub { max-width: 520px; margin: 18px 0 0; color: var(--muted);
  font-size: 15px; line-height: 1.8; }
.lp-account-note { display: inline-block; margin: 18px 0 0; padding: 7px 12px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; }
.lp-metrics { display: flex; margin: 30px 0 0; }
.lp-metrics div { flex: 1; padding: 2px 18px; border-left: 1px solid var(--line-strong); }
.lp-metrics div:first-child { padding-left: 0; border-left: 0; }
.lp-metrics strong { display: block; color: var(--accent); font-size: 24px;
  font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lp-metrics span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }

.lp-hero-cta { display: flex; align-items: center; gap: 14px; margin: 22px 0 0; flex-wrap: wrap; }
.lp-hero-cta .primary-btn { padding: 12px 22px; font-size: 15px; border-radius: 14px; }
.lp-enter-note { color: var(--muted); font-size: 12px; }

/* 右栏：听写练习示意卡 */
.demo-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 20px 44px -18px rgba(35, 42, 54, .13), 0 2px 6px rgba(35, 42, 54, .05); }
.demo-head { display: flex; align-items: center; gap: 9px; font-size: 12.5px;
  color: var(--ink-2); }
.demo-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); }
.demo-head em { margin-left: auto; font-style: normal; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-play { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.demo-playbtn { position: relative; width: 44px; height: 44px; flex: none;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 55%, transparent); }
.demo-playbtn::after { content: ""; position: absolute; left: 55%; top: 50%;
  transform: translate(-50%, -50%); border-left: 12px solid var(--card);
  border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.demo-wave { display: flex; align-items: center; gap: 4px; flex: 1; height: 34px; }
.demo-wave i { flex: 1; border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 30%, var(--accent-soft)); }
.demo-wave i:nth-child(1) { height: 30%; } .demo-wave i:nth-child(2) { height: 55%; }
.demo-wave i:nth-child(3) { height: 80%; } .demo-wave i:nth-child(4) { height: 45%; }
.demo-wave i:nth-child(5) { height: 95%; } .demo-wave i:nth-child(6) { height: 60%; }
.demo-wave i:nth-child(7) { height: 35%; } .demo-wave i:nth-child(8) { height: 75%; }
.demo-wave i:nth-child(9) { height: 50%; } .demo-wave i:nth-child(10) { height: 85%; }
.demo-wave i:nth-child(11) { height: 40%; } .demo-wave i:nth-child(12) { height: 25%; }
.demo-rate { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.demo-input { display: flex; align-items: center; margin-top: 20px; padding: 12px 14px;
  border: 1.5px solid var(--accent); border-radius: 12px; font-size: 16px;
  letter-spacing: .04em; color: var(--ink); background: var(--card); }
.demo-caret { width: 2px; height: 20px; margin-left: 3px; background: var(--accent);
  animation: demo-blink 1.1s steps(1) infinite; }
@keyframes demo-blink { 50% { opacity: 0; } }
.demo-verdict { margin-top: 14px; padding: 9px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; }
.demo-progress { height: 6px; margin-top: 16px; border-radius: 4px;
  background: var(--card-2); overflow: hidden; }
.demo-progress i { display: block; height: 100%; width: 60%; border-radius: 4px;
  background: var(--accent); }
.demo-note { margin: 12px 2px 0; color: var(--muted); font-size: 11.5px; text-align: right; }

/* 功能卡：白底细线 + 绿点标题，不再用彩色错位背板 */
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  max-width: 1080px; margin: 30px auto 0; }
.lp-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px; transition: transform .2s ease, box-shadow .2s ease; }
.lp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.lp-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: 15px; font-weight: 700; }
.lp-card h3::before { content: ""; width: 8px; height: 8px; border-radius: 3px;
  background: var(--accent); flex: none; }
.lp-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.lp-card code { font-size: 11.5px; background: var(--accent-soft); color: var(--accent);
  padding: 1px 5px; border-radius: 5px; }

/* 登录 / 注册：清爽白卡（弃用暗色浮层） */
.lp-auth { max-width: 460px; margin: 44px auto 60px; padding: 32px 30px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  text-align: center;
  box-shadow: 0 18px 44px -20px rgba(35, 42, 54, .12); }
.lp-auth h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; font-weight: 800; }
.lp-auth-tip { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }
.lp-form { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.lp-form input { padding: 12px 14px; font-size: 16px; /* ≥16px 免 iOS 聚焦缩放 */
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink); text-align: center;
  transition: border-color .15s, box-shadow .15s; }
.lp-form input:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft); }
.lp-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lp-msg { min-height: 20px; margin: 12px 0 0; font-size: 13.5px; color: var(--danger); }
.lp-msg.ok { color: var(--accent); }

/* 暗色浮层时代的 .lp-form / .lp-actions / .lp-msg 覆盖规则已于 2026-08-04 删除：
   登录区早已改为白卡，那批半透明白色规则排在后面会盖掉白卡样式，
   造成白底白字按钮与看不见的输入框。上方「清爽白卡」一节即唯一权威。 */
.lp-actions .primary-btn { min-width: 120px; }
.legal-consent { display: flex; align-items: flex-start; gap: 8px; max-width: 520px;
  margin: 0 auto 15px; color: var(--muted); font-size: 12px; line-height: 1.65;
  text-align: left; }
.legal-consent input { width: 15px; height: 15px; margin: 2px 0 0; flex: none;
  accent-color: var(--accent); }
.legal-consent a { color: var(--accent); text-decoration: none; }
.legal-consent a:hover { text-decoration: underline; }
.legal-consent-compact { margin: 10px 0 2px; }
/* 统一站点页脚（三站同款）：顶部分隔线 + 下方版块，左版权右链接 + 修复按钮。2026-08-10 */
.wm-footer { border-top: 1px solid var(--line); background: var(--card, #fff); margin-top: 40px; }
.wm-footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px 24px 34px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.wm-footer-copy { color: var(--muted); font-size: 12px; }
.wm-footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.wm-footer-links a { color: var(--muted); font-size: 12px; text-decoration: none; cursor: pointer; transition: color .15s; }
.wm-footer-links a:hover { color: var(--ink); }
@media (max-width: 640px) { .wm-footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; } }
@media (max-width: 640px) {
  .wm-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; gap: 34px; padding: 44px 0 8px; }
  .lp-demo { max-width: 440px; }
  .lp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .lp-title { font-size: 32px; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-metrics { flex-wrap: wrap; gap: 12px 0; }
  .lp-metrics div { flex: 1 1 40%; }
  .lp-metrics div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .lp-auth { padding: 26px 18px; }
}
.import-help-sub { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.import-help .link-btn { margin-right: 12px; }

/* ---------------- 终身词库：三态徽标 ---------------- */
.tri { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  margin-left: 6px; white-space: nowrap; }
.tri-mastered { color: var(--accent); background: var(--accent-soft); }
.tri-due { color: var(--danger); background: var(--danger-soft); }

/* ---------------- 书架：兑换码 / 空态 ---------------- */
.redeem-bar { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px 16px 10px; margin-bottom: 8px;
  box-shadow: var(--shadow); }
.redeem-row { display: flex; gap: 10px; flex-wrap: wrap; }
.redeem-row input { flex: 1 1 320px; padding: 10px 14px; font-size: 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font-family: var(--font-ui); }
.redeem-row input:focus { border-color: var(--accent); background: var(--card);
  outline: none; box-shadow: 0 0 0 3px rgba(22, 101, 52, .13); }
.redeem-msg { min-height: 20px; margin: 8px 0 0; font-size: 13.5px; color: var(--danger); }
.redeem-msg.ok { color: var(--accent); }
.shelf-empty { text-align: center; padding: 46px 20px 40px; max-width: 520px; margin: 0 auto; }
.shelf-empty h2 { font-weight: 700; font-size: 25px; letter-spacing: -.02em;
  margin: 0 0 12px; }
.shelf-empty p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 8px; }

/* ---------------- 首访欢迎层：全屏磨砂玻璃 ---------------- */
.welcome-veil { position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 52%, transparent);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  animation: veil-in .35s ease; }
@keyframes veil-in { from { opacity: 0; } }
.welcome-card { max-width: 420px; width: 100%; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 34px 30px 28px; box-shadow: 0 30px 70px -20px rgba(46, 52, 38, .3);
  animation: welcome-in .45s cubic-bezier(.22, 1, .36, 1); }
@keyframes welcome-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.welcome-wm { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.welcome-wm span { font-size: .55em; font-weight: 700; color: #2563eb; margin-left: .08em; }
.welcome-card h2 { margin: 12px 0 6px; font-size: 22px; font-weight: 800;
  letter-spacing: -.02em; }
.welcome-card > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.welcome-list { text-align: left; margin: 0 auto 20px; max-width: 320px;
  display: grid; gap: 9px; }
.welcome-list div { display: flex; align-items: baseline; gap: 9px;
  font-size: 13px; color: var(--ink-2); }
.welcome-list b { color: var(--accent); font-weight: 700; flex: none; }
.welcome-go { min-width: 180px; }
html[data-theme="dark"] .welcome-veil {
  background: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ---------------- 动效兜底 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .view:not(.hidden) { animation: none; }
}

/* ---------------- 登录弹窗（2026-08-04：登录卡从页面底部搬进弹窗） ---------------- */
.lp-mask { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(18, 24, 34, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: lp-mask-in .2s ease; overflow: auto; }
@keyframes lp-mask-in { from { opacity: 0; } }
.lp-mask .lp-auth { position: relative; max-width: 460px; width: 100%; margin: auto;
  animation: lp-card-in .28s cubic-bezier(.22, 1, .36, 1); }
@keyframes lp-card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.lp-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
  border: none; background: none; color: var(--muted); font-size: 26px; line-height: 1;
  border-radius: 8px; cursor: pointer; }
.lp-close:hover { background: var(--card-2); color: var(--ink); }

/* ---------- 设置 · 离线与缓存 ---------- */
.off-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line, #e5e7eb); }
.off-row:last-child { border-bottom: 0; }
.off-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.off-meta { flex: 1 1 auto; font-size: 12px; color: var(--muted, #6b7280); text-align: right; }
.off-btn { flex: 0 0 auto; font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--line, #d1d5db); border-radius: 6px; background: transparent; cursor: pointer; }
.off-btn[disabled] { opacity: .55; cursor: default; }
.off-clear { color: #b42318; border-color: #d9b1ab; }
.off-foot { margin: 8px 0 0; text-align: right; }
.nav-btn.sync-ok{color:var(--ok,#166534);font-weight:700}
.nav-btn.sync-fail{color:var(--danger,#b42318);font-weight:700}
.redeem-result{width:min(440px,calc(100% - 28px));border:0;border-radius:18px;padding:26px;text-align:center;box-shadow:0 24px 80px #0005}
.redeem-result::backdrop{background:#10203399;backdrop-filter:blur(2px)}
.redeem-result .rr-icon{width:54px;height:54px;margin:0 auto 10px;display:grid;place-items:center;border-radius:50%;background:#e8f6ec;color:#166534;font-size:28px;font-weight:800}
.redeem-result h2{margin:0 0 8px}.redeem-result p{color:var(--muted,#667085)}
.redeem-result-bonus{margin:14px 0;padding:13px;border:1px solid #ffd5c9;border-radius:12px;background:#fff4f0;color:#c43d1c;font-weight:700}
