/* ===================================
   考研单词背诵系统 — 全局样式
   错题本 × 现代稳妥 · 红笔批注 × 克制界面 · 日夜双模式
   =================================== */

/* ===== CSS Variables ===== */
:root {
  /* Layout */
  --sidebar-w: 220px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Typography */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* Daylight — 错题本（暖纸 + 墨色 + 红笔） */
  --c-bg: #f6f2e9;
  --c-surface: #fefcf7;
  --c-surface-2: #f1ecdf;
  --c-sidebar: #2e2922;
  --c-text: #2b2721;
  --c-text-2: #6f6859;
  --c-text-3: #a49c8b;
  --c-border: #e4ddcc;
  --c-border-light: #eee8da;

  --c-green: #4f7a58;
  --c-green-h: #436a4b;
  --c-green-bg: #e9f0e6;
  --c-green-bg-h: #dbe7dc;
  --c-red: #c0392b;
  --c-red-h: #a93226;
  --c-red-deep: #8f2b20;
  --c-red-bg: #f7e7e3;
  --c-blue: #3f6d9e;
  --c-blue-bg: #e8eff6;
  --c-purple: #7b6b8f;
  --c-purple-bg: #f0ecf5;
  --c-amber: #b7791f;
  --c-amber-bg: #f7efdc;
  --accent: #c0392b;
  --c-accent: var(--c-red);

  /* 热力图空白格颜色（浅色/白底） */
  --heat-empty: #eae4d4;
  --heat-l1: #f3d4cd;
  --heat-l2: #e3a99c;
  --heat-l3: #cd6f5e;
  --heat-l4: #c0392b;

  --shadow: 0 1px 2px rgba(50,40,25,.05), 0 2px 8px rgba(50,40,25,.06);
  --shadow-md: 0 4px 14px rgba(50,40,25,.09), 0 2px 4px rgba(50,40,25,.05);
  --shadow-lg: 0 10px 28px rgba(50,40,25,.16);

  /* legacy var aliases */
  --bg-secondary: var(--c-surface-2);
  --text: var(--c-text);
  --text-secondary: var(--c-text-2);
  --border: var(--c-border);
  --font-sm: var(--fs-sm);
  --font-lg: var(--fs-lg);
  --font-xl: var(--fs-xl);
  --font-2xl: var(--fs-2xl);
  --fs-md: var(--fs-base);
  --c-bg-2: var(--c-surface-2);
}

[data-theme="dark"] {
  /* Night — 深夜书桌（暖褐纸 + 墨色 + 红笔） */
  --c-bg: #211d16;
  --c-surface: #2a251e;
  --c-surface-2: #342e24;
  --c-sidebar: #1b1813;
  --c-text: #e9e1d0;
  --c-text-2: #ab9f8a;
  --c-text-3: #7d7360;
  --c-border: #423a2c;
  --c-border-light: #383124;

  --c-green: #9dbb9f;
  --c-green-h: #b2c9b3;
  --c-green-bg: #2b3527;
  --c-green-bg-h: #33412e;
  --c-red: #e07a6b;
  --c-red-h: #e98f82;
  --c-red-deep: #c95c4d;
  --c-red-bg: #3a2925;
  --c-blue: #93b2d1;
  --c-blue-bg: #27303c;
  --c-purple: #b6a5c7;
  --c-purple-bg: #342d3a;
  --c-amber: #d8a94f;
  --c-amber-bg: #3a301c;
  --accent: #e07a6b;
  --c-accent: var(--c-red);

  --heat-empty: #352e21;
  --heat-l1: #4a2c27;
  --heat-l2: #6d3a31;
  --heat-l3: #a34c3f;
  --heat-l4: #e07a6b;

  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.2);
  --shadow-md: 0 4px 14px rgba(0,0,0,.35);
  --shadow-lg: 0 10px 28px rgba(0,0,0,.45);
}

[data-theme="blue"] {
  /* Breeze — 清爽蓝白（明亮干净） */
  --c-bg: #f0f4fa;
  --c-surface: #ffffff;
  --c-surface-2: #e8eef7;
  --c-sidebar: #26364f;
  --c-text: #22293a;
  --c-text-2: #5d6a84;
  --c-text-3: #93a0b8;
  --c-border: #d9e2ef;
  --c-border-light: #e5ecf5;

  --c-green: #2f8f6b;
  --c-green-h: #27795c;
  --c-green-bg: #dff1ea;
  --c-green-bg-h: #d2ebdf;
  --c-red: #d05a5a;
  --c-red-h: #b94a4a;
  --c-red-deep: #9e3c3c;
  --c-red-bg: #fbe8e8;
  --c-blue: #3a6ea5;
  --c-blue-bg: #e2ecf6;
  --c-purple: #7d6fb0;
  --c-purple-bg: #ece9f6;
  --c-amber: #c08a1e;
  --c-amber-bg: #f8efd8;
  --accent: #3a6ea5;
  --c-accent: var(--c-blue);

  --heat-empty: #e7ecf3;
  --heat-l1: #f3d8d8;
  --heat-l2: #e3a9a9;
  --heat-l3: #cf7777;
  --heat-l4: #d05a5a;

  --shadow: 0 1px 2px rgba(35,55,90,.05), 0 2px 8px rgba(35,55,90,.06);
  --shadow-md: 0 4px 14px rgba(35,55,90,.09);
  --shadow-lg: 0 10px 28px rgba(35,55,90,.16);
}

[data-theme="sepia"] {
  /* Scroll — 复古牛皮纸（做旧暖棕） */
  --c-bg: #f0e2c8;
  --c-surface: #f9efd9;
  --c-surface-2: #e8d8b8;
  --c-sidebar: #4a3b28;
  --c-text: #3f3325;
  --c-text-2: #7c6a4f;
  --c-text-3: #a6957a;
  --c-border: #dcc9a4;
  --c-border-light: #e7d7b6;

  --c-green: #5c7440;
  --c-green-h: #4e6436;
  --c-green-bg: #e7edda;
  --c-green-bg-h: #dce6c8;
  --c-red: #a5523c;
  --c-red-h: #91462f;
  --c-red-deep: #7d3b28;
  --c-red-bg: #f2e0d8;
  --c-blue: #546f8c;
  --c-blue-bg: #e4ebf0;
  --c-purple: #7c6a86;
  --c-purple-bg: #ece7ee;
  --c-amber: #a0711b;
  --c-amber-bg: #f2e7c8;
  --accent: #a5523c;
  --c-accent: var(--c-red);

  --heat-empty: #e4d5b6;
  --heat-l1: #ecccb8;
  --heat-l2: #d99c7e;
  --heat-l3: #c0704f;
  --heat-l4: #a5523c;

  --shadow: 0 1px 2px rgba(80,60,30,.06), 0 2px 8px rgba(80,60,30,.07);
  --shadow-md: 0 4px 14px rgba(80,60,30,.1);
  --shadow-lg: 0 10px 28px rgba(80,60,30,.18);
}

[data-theme="nightblue"] {
  /* Stardust — 星空午夜蓝（深蓝黑，夜晚专注） */
  --c-bg: #151a26;
  --c-surface: #1d2434;
  --c-surface-2: #262e42;
  --c-sidebar: #10141d;
  --c-text: #dce4f0;
  --c-text-2: #97a3bb;
  --c-text-3: #66718c;
  --c-border: #323c54;
  --c-border-light: #2a3348;

  --c-green: #8fd0a9;
  --c-green-h: #a3dbb9;
  --c-green-bg: #20302a;
  --c-green-bg-h: #26392f;
  --c-red: #e8817e;
  --c-red-h: #f09390;
  --c-red-deep: #d06460;
  --c-red-bg: #38282c;
  --c-blue: #7ea8e0;
  --c-blue-bg: #232e42;
  --c-purple: #a59ad4;
  --c-purple-bg: #2e2a3e;
  --c-amber: #dfb055;
  --c-amber-bg: #3a3118;
  --accent: #e8817e;
  --c-accent: var(--c-red);

  --heat-empty: #222a3a;
  --heat-l1: #432e32;
  --heat-l2: #6a4346;
  --heat-l3: #a55f5c;
  --heat-l4: #e8817e;

  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.24);
  --shadow-md: 0 4px 14px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 28px rgba(0,0,0,.5);
}

[data-theme="pureblue"] {
  /* Pure Blue — 纯蓝白（白底 + 蓝色点缀，极简清爽） */
  --c-bg: #f4f8fe;
  --c-surface: #ffffff;
  --c-surface-2: #edf3fc;
  --c-sidebar: #ffffff;
  --c-text: #1b2a44;
  --c-text-2: #586a8c;
  --c-text-3: #94a5c2;
  --c-border: #dce7f6;
  --c-border-light: #e9f0fa;

  --c-green: #159a63;
  --c-green-h: #107e51;
  --c-green-bg: #dcf4e9;
  --c-green-bg-h: #cbeedd;
  --c-red: #e04848;
  --c-red-h: #c93a3a;
  --c-red-deep: #b02e2e;
  --c-red-bg: #fdeaea;
  --c-blue: #2563eb;
  --c-blue-h: #1d4fd7;
  --c-blue-bg: #e3edfe;
  --c-purple: #6d63d6;
  --c-purple-bg: #e9e7fb;
  --c-amber: #d08a12;
  --c-amber-bg: #fbf1dc;
  --accent: #2563eb;
  --c-accent: var(--c-blue);

  --heat-empty: #e6eef9;
  --heat-l1: #cfe0fb;
  --heat-l2: #93b8f6;
  --heat-l3: #4f83ef;
  --heat-l4: #2563eb;

  --shadow: 0 1px 2px rgba(30,70,140,.05), 0 2px 8px rgba(30,70,140,.06);
  --shadow-md: 0 4px 14px rgba(30,70,140,.09);
  --shadow-lg: 0 10px 28px rgba(30,70,140,.16);
}

/* 纯蓝白：白色侧栏（其余主题侧栏为深色，需单独覆盖文字与选中态） */
[data-theme="pureblue"] .sidebar {
  border-right: 1px solid var(--c-border);
}
[data-theme="pureblue"] .sidebar-logo {
  color: var(--c-text);
  border-bottom-color: var(--c-border-light);
}
[data-theme="pureblue"] .sidebar-logo i.ph { color: var(--c-blue); }
[data-theme="pureblue"] .nav-group-label { color: var(--c-text-3); }
[data-theme="pureblue"] .nav-group + .nav-group { border-top-color: var(--c-border-light); }
[data-theme="pureblue"] .sidebar-nav a { color: var(--c-text-2); }
[data-theme="pureblue"] .sidebar-nav a:hover {
  background: var(--c-surface-2); color: var(--c-text);
}
[data-theme="pureblue"] .sidebar-nav a.active {
  background: var(--c-blue); color: #fff; font-weight: 600;
}
[data-theme="pureblue"] .sidebar-nav a.active i.ph { color: #fff; }
[data-theme="pureblue"] .top-bar {
  background: rgba(255,255,255,.85);
  border-bottom-color: var(--c-border-light);
}

/* ===== Phosphor icons base ===== */
i.ph { font-size: 1.2em; vertical-align: middle; line-height: 0; }
i.ph.ph-sm { font-size: 1em; }
i.ph.ph-lg { font-size: 1.5em; }

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 自定义主题壁纸层（固定在背景之上、内容之下） */
.theme-wallpaper {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
.theme-wallpaper.active { opacity: .85; }

/* 内容遮罩：垫在壁纸之上、内容之下，抵消高亮/花纹区域，保证文字始终可读 */
.theme-wallpaper-mask {
  position: fixed; inset: 0; z-index: -1;
  background: rgba(255,255,255,.5);
  opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
[data-theme="custom"] .theme-wallpaper-mask.active { opacity: 1; }
[data-theme="custom"][data-wall-fg="light"] .theme-wallpaper-mask { background: rgba(16,16,22,.55); }

/* ===== 自定义壁纸主题：整体透明化，露出壁纸 ===== */
/* 通过覆盖全局 CSS 变量，让所有使用 surface/bg 变量的组件自动透明 */
[data-theme="custom"] {
  --c-bg: transparent;
  --c-surface: transparent;
  --c-surface-2: transparent;
  --c-border: rgba(0,0,0,.14);
  --c-border-light: rgba(0,0,0,.08);
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: none;
  /* 自定义模式：所有文字改为黑色，保证壁纸上清晰可读 */
  --c-text: #000000;
  --c-text-2: #111111;
  --c-text-3: #222222;
  --text: #000000;
  --text-secondary: #111111;
}
[data-theme="custom"] body {
  background: transparent;
  background-image: none;
}
[data-theme="custom"] .sidebar {
  background: transparent;
  border-right-color: rgba(0,0,0,.1);
}
[data-theme="custom"] .top-bar {
  background: transparent !important;
  border-bottom-color: rgba(0,0,0,.1);
}
[data-theme="custom"] .sidebar-nav a.active {
  background: rgba(247,231,227,.3);
}
[data-theme="custom"] .sidebar-logo {
  color: #000;
  border-bottom-color: rgba(0,0,0,.08);
}
[data-theme="custom"] .sidebar-nav a {
  color: #111;
}
[data-theme="custom"] .sidebar-nav a:hover {
  background: rgba(255,255,255,.18);
  color: #000;
}
[data-theme="custom"] .nav-group-title {
  color: rgba(0,0,0,.5);
}
[data-theme="custom"] .nav-group + .nav-group { border-top-color: rgba(0,0,0,.08); }

/* ===== 自动前景色：深色壁纸 → 白字 + 浅色边框 ===== */
[data-theme="custom"][data-wall-fg="light"] {
  --c-text: #ffffff;
  --c-text-2: #ececec;
  --c-text-3: #cfcfcf;
  --text: #ffffff;
  --text-secondary: #ececec;
  --c-border: rgba(255,255,255,.24);
  --c-border-light: rgba(255,255,255,.16);
}
[data-theme="custom"][data-wall-fg="light"] .sidebar {
  border-right-color: rgba(255,255,255,.18);
}
[data-theme="custom"][data-wall-fg="light"] .top-bar {
  border-bottom-color: rgba(255,255,255,.18);
}
[data-theme="custom"][data-wall-fg="light"] .sidebar-logo {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.16);
}
[data-theme="custom"][data-wall-fg="light"] .sidebar-nav a { color: #ececec; }
[data-theme="custom"][data-wall-fg="light"] .sidebar-nav a:hover {
  background: rgba(0,0,0,.2);
  color: #fff;
}
[data-theme="custom"][data-wall-fg="light"] .sidebar-nav a.active {
  background: rgba(255,255,255,.16);
}
[data-theme="custom"][data-wall-fg="light"] .nav-group-title { color: rgba(255,255,255,.62); }
[data-theme="custom"][data-wall-fg="light"] .nav-group + .nav-group { border-top-color: rgba(255,255,255,.16); }

/* ===== 壁纸缩略图列表（设置页） ===== */
.wallpaper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.wallpaper-item {
  position: relative;
  width: 86px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--c-border);
  box-shadow: var(--shadow);
}
.wallpaper-item.active {
  border-color: var(--c-green);
  box-shadow: 0 0 0 2px var(--c-green);
}
.wallpaper-thumb {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.wallpaper-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wallpaper-del:hover { background: var(--c-red); }

/* 纸张颗粒纹理（暖纸书卷质感） */
body {
  background-image: radial-gradient(rgba(120,96,54,.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* themed browser surfaces */
::selection { background: rgba(192,57,43,.22); color: inherit; }
:root { caret-color: var(--c-red); }
* { scrollbar-width: thin; scrollbar-color: var(--c-border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--c-text-3); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, [role='button']:focus-visible { outline: 2px solid var(--c-green); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

h1, h2, h3, h4,
.top-bar-title, .card-header, .section-title,
.stat-value, .sidebar-logo, .word-text {
  font-family: var(--font-serif);
}

/* ===== Layout ===== */
.app-layout { display: flex; min-height: 100dvh; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-sidebar);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column;
  z-index: 50; overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  font-size: 1.05rem; font-weight: 700;
  color: #efe7d3; letter-spacing: .02em;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-logo i.ph { font-size: 1.3em; color: var(--c-red); }
.sidebar-nav { list-style: none; padding: 6px 0; flex: 1; }
.nav-group {
  display: flex; flex-direction: column;
  margin-top: 4px;
}
.nav-group-title {
  font-size: var(--fs-xs); font-weight: 600;
  color: rgba(201,191,164,.45);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 12px 18px 4px;
}
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); margin-top: 8px; }
.sidebar-nav > a { margin-top: 6px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; margin: 1px 10px;
  color: #c9bfa4; text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all .15s ease;
}
.sidebar-nav a i.ph { font-size: 1.15em; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #f1ead6; }
.sidebar-nav a.active {
  background: var(--c-red-bg); color: var(--c-red); font-weight: 600;
}
.sidebar-nav a.active i.ph { color: var(--c-red); }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100dvh; min-width: 0;
  display: flex; flex-direction: column;
}

/* Top Bar */
.top-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 28px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  background: rgba(from var(--c-surface) r g b / .92);
}
@supports not (backdrop-filter: blur(8px)) {
  .top-bar { background: var(--c-surface); }
}
.top-bar-title { font-size: var(--fs-lg); font-weight: 600; }
.top-bar-slogan {
  flex: 1;
  text-align: center;
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12px;
}
.top-bar-actions { display: flex; align-items: center; gap: 8px; }

/* Page Content */
.page-content {
  padding: 28px 32px 48px;
  max-width: 1120px;
  width: 100%; flex: 1; min-width: 0;
}

/* ===== Card System ===== */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  font-weight: 600; margin-bottom: 14px;
  font-size: var(--fs-lg); color: var(--c-text);
}

.card-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* ===== Stat Cards ===== */
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-value {
  font-size: var(--fs-2xl); font-weight: 700;
  color: var(--c-text); line-height: 1.2;
}
.stat-label {
  font-size: var(--fs-xs); color: var(--c-text-3);
  margin-top: 4px; letter-spacing: .01em;
}
.stat-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stat-card-head .card-header { margin: 0; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; font-size: 1.15rem; flex-shrink: 0; }
.stat-icon--green { background: var(--c-green-bg); color: var(--c-green); }
.stat-icon--blue { background: var(--c-blue-bg); color: var(--c-blue); }
.stat-icon--amber { background: var(--c-amber-bg); color: var(--c-amber); }
.stat-icon--purple { background: var(--c-purple-bg); color: var(--c-purple); }
.stat-icon--red { background: var(--c-red-bg); color: var(--c-red); }
.progress-fill--green { background: var(--c-green); }
.progress-fill--blue { background: var(--c-blue); }
.progress-fill--amber { background: var(--c-amber); }
.progress-fill--purple { background: var(--c-purple); }
.progress-fill--red { background: var(--c-red); }
.stat-icon--ink { background: var(--c-surface-2); color: var(--c-text-2); }
.progress-fill--ink { background: var(--c-text-2); }
.stamp {
  display: inline-block; border: 2px solid var(--c-red); color: var(--c-red);
  font-size: var(--fs-xs); font-weight: 700; padding: 3px 10px;
  border-radius: 4px; transform: rotate(-3deg); letter-spacing: .06em;
  background: var(--c-surface); white-space: nowrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border: 1px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500;
  line-height: 1.5; text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--c-red); color: #fff; border-color: var(--c-red);
}
.btn-primary:hover { background: var(--c-red-h); border-color: var(--c-red-h); }

.btn-secondary {
  background: transparent; color: var(--c-text); border-color: var(--c-border);
}
.btn-secondary:hover { background: var(--c-surface-2); }

.btn-danger {
  background: var(--c-red-deep); color: #fff; border-color: var(--c-red-deep);
}
.btn-danger:hover { opacity: .85; }

.btn-sm { padding: 5px 12px; font-size: var(--fs-xs); }
.btn-lg { padding: 10px 24px; font-size: var(--fs-base); }

.btn-ghost {
  background: transparent; border-color: transparent; color: var(--c-text-2);
  padding: 6px;
}
.btn-ghost:hover { color: var(--c-text); background: var(--c-bg); border-radius: var(--radius-sm); }

.btn i.ph { font-size: 1.1em; }

/* ===== Badge ===== */
.badge {
  display: inline-block;
  padding: 2px 10px; border-radius: 99px;
  font-size: var(--fs-xs); font-weight: 500;
  line-height: 1.5;
}
.badge-new    { background: var(--c-blue-bg); color: var(--c-blue); }
.badge-master { background: var(--c-green-bg); color: var(--c-green); }
.badge-learning { background: var(--c-amber-bg); color: var(--c-amber); }
.badge-review { background: var(--c-blue-bg); color: var(--c-blue); }
.badge-reviewing { background: var(--c-purple-bg); color: var(--c-purple); }
.badge-mastered { background: var(--c-green-bg); color: var(--c-green); }
.badge-warn { background: var(--c-amber-bg); color: var(--c-amber); }
.badge-error { background: var(--c-red-bg); color: var(--c-red); }

/* ===== Progress Bar ===== */
.progress {
  height: 6px; border-radius: 99px; background: var(--c-bg);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  background: var(--c-red);
  transition: width .4s ease;
}

/* ===== Word Card (Flashcard) ===== */
.card-flash, .word-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 520px; margin: 0 auto;
  padding: 44px 36px; text-align: center;
}
.word-card .word-text, .card-flash .word-text {
  font-size: var(--fs-3xl); font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 10px;
}
.word-card .word-phonetic, .card-flash .word-phonetic {
  font-size: var(--fs-lg); color: var(--c-text-2); margin-bottom: 4px;
  font-family: "Times New Roman", serif;
}
.word-card .word-pos, .card-flash .word-pos {
  font-size: var(--fs-sm); color: var(--c-text-3);
}
.meaning-pos {
  font-weight: 700; color: var(--c-green); margin-right: 2px;
}
.word-card .word-meaning, .card-flash .word-meaning {
  font-size: var(--fs-base); margin-top: 20px; padding: 16px 20px;
  background: var(--c-bg); border-radius: var(--radius-sm);
  color: var(--c-text); line-height: 1.7; white-space: pre-line;
  text-align: left;
}
.word-card .word-example, .card-flash .word-example {
  font-size: var(--fs-sm); color: var(--c-text-2);
  margin-top: 14px; font-style: italic; white-space: pre-line;
  text-align: left;
}
.word-card-actions, .card-actions {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 28px; flex-wrap: wrap;
}
.word-card-actions .btn, .card-actions .btn {
  min-width: 90px; padding: 10px 20px;
}

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
.table, .data-table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
}
.table th, .data-table th {
  text-align: left; padding: 10px 14px; font-weight: 600;
  color: var(--c-text-2); font-size: var(--fs-xs);
  letter-spacing: .03em;
  border-bottom: 1.5px solid var(--c-border);
  white-space: nowrap;
  background: var(--c-surface-2);
}
.table td, .data-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--c-border-light);
  vertical-align: middle;
}
.table tr:hover td, .data-table tr:hover td { background: var(--c-surface-2); }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  font-size: var(--fs-sm); font-family: inherit; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none; border-color: var(--c-green);
  box-shadow: 0 0 0 3px rgba(79,122,88,.14);
}
select.form-input { appearance: auto; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-help { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 4px; }
.form-input::placeholder { color: var(--c-text-3); }

/* ===== Section ===== */
.section {
  margin-bottom: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.section-title {
  font-size: var(--fs-lg); font-weight: 600;
  color: var(--c-text);
  margin: 0;
}

/* ===== Grid ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ===== Toggle Switch ===== */
.toggle {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: var(--fs-sm);
}
.toggle input { display: none; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--c-border); transition: background .2s; flex-shrink: 0;
  position: relative;
}
.toggle input:checked + .toggle-track { background: var(--c-green); }
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s ease;
}
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ===== Toast ===== */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: var(--radius);
  color: #fff; font-size: var(--fs-sm); font-weight: 500;
  pointer-events: auto;
  animation: toasting .25s ease;
  box-shadow: var(--shadow-lg);
}
.toast-success { background: var(--c-green); }
.toast-error   { background: var(--c-red); }
.toast.ok      { background: var(--c-green); }
.toast.err     { background: var(--c-red); }
@keyframes toasting { from { opacity: 0; transform: translateY(-8px); } }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--c-surface); border-radius: var(--radius);
  padding: 28px; max-width: 460px; width: 90%; max-height: 85dvh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
}

/* AI 上传框 */
.ai-upload-box {
  display: block; border: 2px dashed var(--c-border);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ai-upload-box:hover { border-color: var(--c-green); background: rgba(63,92,69,.05); }
.ai-cell { padding: 5px 8px; min-width: 90px; font-size: var(--fs-xs); }

/* AI 密钥输入（仿 Trae API 配置） */
.ai-key-wrap { position: relative; flex: 1; min-width: 0; }
.ai-key-wrap .form-input { padding-right: 36px; }
.ai-key-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer;
  color: var(--c-text-3); padding: 4px; font-size: 15px;
  display: flex; align-items: center;
}
.ai-key-toggle:hover { color: var(--c-text); }
.ai-test-result {
  margin-top: 6px; font-size: var(--fs-xs);
  display: flex; align-items: center; gap: 4px;
}
.ai-test-loading { color: var(--c-text-3); }
.ai-test-ok { color: var(--c-green); }
.ai-test-fail { color: var(--c-red); }

@keyframes spin { to { transform: rotate(360deg); } }

/* 模型视觉能力标签 */
.ai-vision-tag {
  display: inline-block; font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 6px; vertical-align: middle;
  background: rgba(63,92,69,.12); color: var(--c-green);
}
.ai-vision-no {
  background: rgba(192,57,43,.12); color: var(--c-red);
}

/* AI 导入：输入源切换 */
.ai-source-tabs { display: flex; gap: 6px; }
.ai-source-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg); color: var(--c-text-2); cursor: pointer;
  font-size: var(--fs-sm); transition: all .15s;
}
.ai-source-tab:hover { border-color: var(--c-green); color: var(--c-green); }
.ai-source-tab.active {
  background: var(--c-green-bg); border-color: var(--c-green);
  color: var(--c-green); font-weight: 600;
}
.ai-source-pane { margin-top: 10px; }

/* AI 导入：三级复审 */
.ai-review-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px;
}
.ai-review-item {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); padding: 5px 10px; border-radius: 8px;
  background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c-text-2);
}
.ai-review-item em { font-style: normal; font-weight: 600; color: var(--c-text-3); }
.ai-review-item.done {
  background: var(--c-green-bg); border-color: var(--c-green);
  color: var(--c-green);
}
.ai-review-item.done em { color: var(--c-green); }
.ai-review-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* AI 复审标记 */
.ai-mark { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 5px; margin-right: 3px; white-space: nowrap; }
.ai-mark-ok { background: var(--c-green-bg); color: var(--c-green); }
.ai-mark-issue { background: var(--c-red-bg); color: var(--c-red); }
.ai-mark-cell { white-space: nowrap; }
.ai-cell-warn { border-color: var(--c-red) !important; background: var(--c-red-bg); }
.ai-issue-chip {
  display: inline-block; font-size: 11px; padding: 2px 8px; margin: 2px 4px 2px 0;
  border-radius: 6px; background: var(--c-red-bg); color: var(--c-red);
}

/* 启用/禁用开关（仿 Trae 模型管理） */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--c-border); border-radius: 20px;
  transition: background .2s;
}
.switch .slider:before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 2px; top: 2px; background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.switch input:checked + .slider { background: var(--c-green); }
.switch input:checked + .slider:before { transform: translateX(16px); }

/* ===== Word list page layout ===== */
.wordlist-layout { display: flex; gap: 20px; align-items: flex-start; }
.wordlist-side { flex: 0 0 250px; min-width: 0; }
.wordlist-main { flex: 1; min-width: 0; }

/* ===== Progress Bar (shorthand) ===== */
.progress-bar {
  height: 6px; border-radius: 99px; background: var(--c-bg);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: var(--c-red);
  transition: width .4s ease;
}

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 16px; justify-content: center;
}
.pagination .page-info {
  font-size: var(--fs-sm); color: var(--c-text-3); margin: 0 8px;
}

/* ===== Responsive ===== */

/* ===== Review meta ===== */
.review-meta {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; font-size: var(--fs-xs); color: var(--c-text-2);
}
.review-meta-item {
  background: var(--c-surface-2); padding: 4px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-light);
}

/* ===== Divider ===== */
.divider, hr {
  border: none; border-top: 1px solid var(--c-border); margin: 20px 0;
}

/* ===== Stat Grid (shorthand) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* ===== Utility Classes ===== */
.text-green  { color: var(--c-green); }
.text-red    { color: var(--c-red); }
.text-sub, .text-secondary  { color: var(--c-text-2); }
.text-muted  { color: var(--c-text-3); }
.text-accent { color: var(--c-green); }
.text-sm     { font-size: var(--fs-sm); }
.text-xs     { font-size: var(--fs-xs); }
.text-center { text-align: center !important; }
.font-bold   { font-weight: 600; }

.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1      { gap: 4px; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.gap-4      { gap: 16px; }
.gap-6      { gap: 24px; }
.mt-2       { margin-top: 8px; }
.mt-4       { margin-top: 16px; }
.mt-6       { margin-top: 24px; }
.mb-2       { margin-bottom: 8px; }
.mb-4       { margin-bottom: 16px; }
.p-4        { padding: 16px; }
.p-6        { padding: 24px; }
.w-full     { width: 100%; }
.hidden     { display: none !important; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only    { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ===== Dashboard enhancements ===== */
.hero-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-title { margin: 0 0 6px; font-size: var(--fs-2xl); font-weight: 700; }
.date-chip { background: var(--c-surface-2); border: 1px solid var(--c-border-light); padding: 6px 14px; border-radius: 999px; font-size: var(--fs-sm); color: var(--c-text-2); white-space: nowrap; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--c-text-3); }
.empty-state i.ph { font-size: 2.2rem; color: var(--c-border); }
.empty-state-title { font-weight: 600; color: var(--c-text-2); }
.empty-state-hint { font-size: var(--fs-sm); }

/* ===== 考研写作工坊 ===== */
.study-tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 14px; text-decoration: none; color: var(--c-text);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-sm);
  transition: all .16s ease;
}
.study-tile:hover { background: var(--c-surface); border-color: var(--c-border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.study-tile-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; font-size: 1.05rem;
}
.study-tile-icon--red { background: var(--c-red-bg); color: var(--c-red); }
.study-tile-icon--blue { background: var(--c-blue-bg); color: var(--c-blue); }
.study-tile-icon--green { background: var(--c-green-bg); color: var(--c-green); }
.study-tile-icon--amber { background: var(--c-amber-bg); color: var(--c-amber); }
.study-tile-title { font-weight: 600; font-size: var(--fs-base); }
.study-tile-desc { font-size: var(--fs-xs); color: var(--c-text-3); line-height: 1.4; }

.markdown-body { line-height: 1.8; font-size: var(--fs-base); word-break: break-word; color: var(--c-text); }
.markdown-body > *:first-child { margin-top: 0 !important; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { margin: 18px 0 10px; line-height: 1.45; font-weight: 700; }
.markdown-body h1 { font-size: 1.5rem; padding-bottom: 10px; border-bottom: 2px solid var(--c-red); color: var(--c-red); }
.markdown-body h2 { font-size: 1.25rem; padding-bottom: 6px; border-bottom: 1px dashed var(--c-border); color: var(--c-red); }
.markdown-body h3 { font-size: 1.1rem; color: var(--c-text); }
.markdown-body h4 { font-size: 1rem; color: var(--c-text-2); }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { margin: 10px 0; padding-left: 26px; }
.markdown-body li { margin: 5px 0; }
.markdown-body ol { list-style: decimal; }
.markdown-body ul { list-style: disc; }
.markdown-body blockquote { margin: 10px 0; padding: 10px 16px; border-left: 4px solid var(--c-red); background: linear-gradient(90deg, rgba(139,0,0,.06), transparent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--c-text-2); font-size: .98em; }
.markdown-body hr { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--c-border-light), transparent); margin: 20px 0; }
.markdown-body code { background: var(--c-surface-2); padding: 2px 7px; border-radius: 4px; font-family: Consolas, Menlo, monospace; font-size: .88em; color: var(--c-red); border: 1px solid var(--c-border-light); }
.markdown-body pre { background: var(--c-surface-2); padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; border: 1px solid var(--c-border-light); margin: 10px 0; }
.markdown-body pre code { background: transparent; padding: 0; border: none; color: inherit; }
.markdown-body strong { color: var(--c-red); font-weight: 700; }
.markdown-body em { font-style: italic; color: var(--c-text-2); }

/* Markdown 表格样式 */
.md-table-wrap { margin: 14px 0; overflow-x: auto; border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); background: var(--c-surface); }
.md-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.md-table thead th { background: var(--c-red); color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; border: none; }
.md-table thead th:first-child { border-top-left-radius: calc(var(--radius-sm) - 1px); }
.md-table thead th:last-child { border-top-right-radius: calc(var(--radius-sm) - 1px); }
.md-table tbody tr:nth-child(even) { background: var(--c-surface-2); }
.md-table tbody tr:hover { background: rgba(139,0,0,.05); }
.md-table tbody td { padding: 9px 14px; border-top: 1px solid var(--c-border-light); vertical-align: top; line-height: 1.6; }
.md-table tbody td + td { border-left: 1px solid var(--c-border-light); }

/* 专属模板容器——给模板一个卡片式外观 */
#personalTempl { background: var(--c-surface); border: 1px solid var(--c-border-light); border-radius: var(--radius); padding: 22px 26px; margin-top: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.model-box { background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 8px; line-height: 1.7; }
.report-loading { display: flex; align-items: center; gap: 10px; color: var(--c-text-2); padding: 20px; }
.report-loading::before { content: ''; width: 16px; height: 16px; border: 2px solid var(--c-border); border-top-color: var(--c-red); border-radius: 50%; animation: vocab-spin .8s linear infinite; }
@keyframes vocab-spin { to { transform: rotate(360deg); } }
.btn-xs { padding: 2px 10px; font-size: var(--fs-xs); }
.error-list li { border-left: 3px solid var(--c-red); padding-left: 10px; }
.phrase-list { list-style: none; padding: 0; margin: 0; }
.phrase-item { padding: 10px 12px; border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--c-bg); }
.phrase-text { font-weight: 500; line-height: 1.5; word-break: break-word; }
.phrase-collect-btn { background: transparent; border: none; cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 3px; transition: background .15s ease; }
.phrase-collect-btn:hover { background: var(--c-surface-2); }
.phrase-collect-btn:disabled { cursor: not-allowed; opacity: .7; }

.quote-bar { overflow: hidden; background: var(--c-surface); border: 1px solid var(--c-border-light); border-radius: var(--radius); padding: 12px 0; position: relative; }
.quote-bar::before, .quote-bar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 1; pointer-events: none; }
.quote-bar::before { left: 0; background: linear-gradient(to right, var(--c-surface), transparent); }
.quote-bar::after { right: 0; background: linear-gradient(to left, var(--c-surface), transparent); }
.quote-track { display: inline-flex; white-space: nowrap; animation: quote-scroll 40s linear infinite; }
.quote-track:hover { animation-play-state: paused; }
.quote-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 36px; font-size: var(--fs-sm); color: var(--c-text-2); }
.quote-item i.ph { color: var(--c-red); }
@keyframes quote-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root { --sidebar-w: 0; }
  /* 移动端：隐藏桌面侧栏，改用底部五项目导航（mobile-tabbar） */
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-bottom: 72px; }
  .page-content { padding: 16px; }
  .top-bar { padding: 8px 16px; }
  .top-bar-slogan { display: none; }
  .top-bar-title { font-size: var(--fs-base); }
  .card { padding: 16px 18px; }
  .card-flash, .word-card { padding: 28px 20px; }
  .card-flash .word-text, .word-card .word-text { font-size: var(--fs-2xl); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .wordlist-layout { flex-direction: column; }
  .wordlist-side { flex: 0 0 auto; width: 100%; }
  .stat-value { font-size: var(--fs-xl); }
}

/* ===== 刷题打卡热力图（GitHub 贡献网格风格）===== */
.heatmap-stats {
  display: flex; gap: 28px;
}
.heatmap-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.heatmap-stat-value {
  font-size: var(--fs-xl); font-weight: 700; color: var(--c-text); line-height: 1.1;
}
.heatmap-stat-label {
  font-size: var(--fs-xs); color: var(--c-text-3);
}

.heatmap-ranges {
  display: inline-flex; gap: 4px; flex-wrap: wrap;
}
.heatmap-range-btn {
  border: 1px solid var(--c-border); background: transparent;
  color: var(--c-text-2); font-size: var(--fs-xs);
  border-radius: var(--radius-sm); padding: 4px 12px; cursor: pointer;
  line-height: 1.5; transition: all .15s ease;
}
.heatmap-range-btn:hover { color: var(--c-text); border-color: var(--c-text-3); }
.heatmap-range-btn.is-active {
  background: var(--c-green); border-color: var(--c-green); color: #fff;
}

#checkinHeatmap { overflow-x: auto; }
.heatmap-months {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 28px 36px;
}
.heatmap-month-block {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.heatmap-month-title {
  font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2);
}
.heatmap-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 12px);
  grid-template-rows: 16px repeat(6, 12px);
  gap: 3px;
}
.heatmap-dow {
  font-size: 10px; color: var(--c-text-3); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.heatmap-cell { border-radius: 2px; }
.heatmap-cell.is-other { opacity: 0.35; }
.heatmap-cell:hover {
  outline: 1px solid var(--c-text-2); outline-offset: 1px;
}
.heatmap-legend {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 12px;
  font-size: var(--fs-xs); color: var(--c-text-3);
}
.heatmap-legend-cell { width: 12px; height: 12px; border-radius: 2px; }
.heatmap-legend-cell[data-level="0"] { background: var(--heat-empty); }
.heatmap-legend-cell[data-level="1"] { background: var(--heat-l1); }
.heatmap-legend-cell[data-level="2"] { background: var(--heat-l2); }
.heatmap-legend-cell[data-level="3"] { background: var(--heat-l3); }
.heatmap-legend-cell[data-level="4"] { background: var(--heat-l4); }

.heatmap-tooltip {
  position: fixed; z-index: 100;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 6px; box-shadow: var(--shadow-md);
  padding: 8px 10px; font-size: var(--fs-sm); color: var(--c-text);
  pointer-events: none; display: none;
}

/* ===== 词性标签编辑器 ===== */
.pos-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pos-quick-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pos-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.5;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  color: var(--c-text);
}
.pos-tag-name { cursor: text; }
.pos-tag-count { font-weight: 400; opacity: .7; font-size: var(--fs-xs); }
.pos-tag-x {
  border: none; background: transparent; cursor: pointer;
  font-size: var(--fs-sm); line-height: 1; padding: 0 2px; opacity: .6;
}
.pos-tag-x:hover { opacity: 1; }
.pos-tag-blue  { background: #e9eef5; color: #4f6f93; border-color: #d5dfeb; }
.pos-tag-green { background: #e9efe3; color: #3f5c45; border-color: #d3dfc9; }
.pos-tag-orange{ background: #f7efdc; color: #a97b24; border-color: #eddfc0; }
.pos-tag-purple{ background: #f0eaf4; color: #7c6a8f; border-color: #e0d6e9; }
.pos-tag-cyan  { background: #e5f0f2; color: #3f7f8a; border-color: #cfe2e6; }
.pos-tag-teal  { background: #e3f0ea; color: #2f7d68; border-color: #c9e2d8; }
.pos-tag-red   { background: #f6e8e0; color: #a9553d; border-color: #ecd4c8; }
.pos-tag-gray  { background: #f1ede2; color: #7a705d; border-color: #e3ddcc; }
.pos-tag-default{ background: var(--c-surface-2); color: var(--c-text-2); }
.pos-tag-uc    { background: #f1ede2; color: #7a705d; border-style: dashed; }

.pos-section {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 10px; background: var(--c-surface-2);
}
.pos-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pos-section-count { margin-left: auto; font-size: var(--fs-xs); color: var(--c-text-3); }
.pos-meanings { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.meaning-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--c-surface); border: 1px solid var(--c-border);
  font-size: var(--fs-sm); cursor: pointer;
}
.meaning-chip:hover { border-color: var(--accent); }
.meaning-chip-x {
  border: none; background: transparent; cursor: pointer;
  color: var(--c-text-3); font-size: var(--fs-sm); padding: 0 2px;
}
.meaning-chip-x:hover { color: var(--c-red); }
.pos-meaning-input { margin-top: 4px; }

/* ===== 背诵页：逐词性分步显示 ===== */
.pos-group { margin-bottom: 8px; padding: 6px 10px; background: var(--c-surface-2); border-radius: var(--radius-sm); }
.pos-group .meaning-pos { margin-right: 6px; }
.pos-group .meaning-item { display: inline-block; margin: 2px 6px 2px 0; }
.pos-group + .pos-group { margin-top: 8px; }

/* 陌生词性高亮 */
.pos-group.pos-uncommon {
  background: rgba(217, 119, 6, .10);
}
.pos-fam-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--c-border); border-radius: 12px;
  padding: 1px 8px; font-size: 11px; cursor: pointer;
  background: var(--c-surface); color: var(--c-text-2);
  margin-left: 6px; vertical-align: middle; user-select: none;
  transition: all .15s;
}
.pos-fam-btn:hover { border-color: var(--c-green); }
.pos-fam-btn.is-familiar { background: #dcfce7; color: #166534; border-color: #86efac; }
.pos-fam-btn.is-uncommon { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

/* 复习模式切换条 */
.review-mode-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 12px;
  background: var(--c-surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}
.review-mode-bar .mode-btn {
  border: 1px solid var(--c-border); border-radius: 14px;
  padding: 3px 12px; font-size: var(--fs-sm); cursor: pointer;
  background: var(--c-surface); color: var(--c-text-2);
}
.review-mode-bar .mode-btn.is-active { background: #8a6f9e; color: #fff; border-color: #8a6f9e; }
.pos-expand-all {
  display: inline-block; margin-top: 6px; cursor: pointer;
  color: var(--c-text-3); font-size: var(--fs-sm);
  text-decoration: underline; text-underline-offset: 3px;
}
.pos-expand-all:hover { color: var(--c-green); }

/* ===== 计划驱动：今日学习中心 ===== */
.plan-today-card { border: 2px solid var(--c-green, #16a34a); }
.today-task-card {
  text-align: center; padding: 16px 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface-2);
}
.today-task-card .btn { margin-top: 4px; }

/* 本周日历 */
.weekly-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; text-align: center;
}
.weekday-cell {
  padding: 10px 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: var(--c-surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 72px;
}
.weekday-label { font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 600; }
.weekday-icon { font-size: var(--fs-lg); line-height: 1.4; }
.weekday-count { font-size: var(--fs-xs); color: var(--c-text-2); }
.weekday-done { background: #dcfce7; border-color: #86efac; }
.weekday-done .weekday-icon { color: #16a34a; }
.weekday-today { background: #fef3c7; border-color: #fcd34d; border-width: 2px; }
.weekday-today .weekday-icon { color: #d97706; }
.weekday-missed { background: #fef2f2; border-color: #fecaca; }
.weekday-missed .weekday-icon { color: #dc2626; opacity: .5; }
.weekday-future { background: var(--c-surface-2); opacity: .5; }

/* 一键开始今日学习卡片 */
.plan-quick-start { border-radius: var(--radius); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* 只停无限循环/位移动画，保留一次性状态反馈（toast、结果进入等） */
  .quote-track,
  .report-loading::before,
  .spin,
  .spinning,
  .ph-spin {
    animation: none !important;
  }
}

/* ===== 隐私与内容声明弹窗 ===== */
.privacy-mask { z-index: 200; }
.privacy-modal {
  max-width: 760px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.privacy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 8px;
}
.privacy-head-title { font-size: 1.12rem; font-weight: 700; }
.privacy-head-title i.ph { color: var(--c-green); margin-right: 4px; }
.privacy-x {
  border: none; background: transparent; cursor: pointer;
  font-size: 1.2rem; line-height: 1; color: var(--c-text-3);
  padding: 4px 6px; border-radius: 6px;
}
.privacy-x:hover { background: var(--c-surface-2); color: var(--c-text); }
.privacy-meta {
  padding: 0 24px 12px;
  font-size: var(--fs-sm);
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border-light);
}
.privacy-body {
  padding: 16px 24px 20px;
  overflow-y: auto;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--c-text-2);
}
.privacy-body h4 {
  font-size: .95rem;
  color: var(--c-text);
  margin: 16px 0 6px;
}
.privacy-body h4:first-child { margin-top: 0; }
.privacy-body p { margin: 0 0 6px; }
.privacy-body ul { margin: 0 0 8px; padding-left: 20px; }
.privacy-body li { margin-bottom: 4px; }
.privacy-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--c-border-light);
}
.privacy-blocked { padding: 44px 24px 36px; text-align: center; }
.privacy-blocked i.ph { font-size: 2.4rem; color: var(--c-amber); }
.privacy-blocked-title { font-weight: 600; margin: 10px 0 6px; color: var(--c-text); }
.privacy-blocked p { color: var(--c-text-3); font-size: var(--fs-sm); margin: 0 0 8px; line-height: 1.8; }

/* ===== 恢复批次 1：通用工具类 + 会话页检测/学习区 ===== */
/* ============================================================
   【恢复批次 1】通用工具类
   ============================================================ */

/* 语义色：与项目原有 .text-red/.text-green 同族，补齐余下颜色 */
.text-blue   { color: var(--c-blue); }
.text-amber  { color: var(--c-amber); }
.text-faint  { color: var(--c-text-3); }
.fs-20       { font-size: 20px; }

/* 统计值里的单位（12 / 30 中的「/ 30」） */
.stat-value .unit {
  font-size: var(--fs-base); font-weight: 400; color: var(--c-text-3);
}

/* 进度图例圆点（替代原先 5 条行内样式写的圆点） */
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.legend-dot--green { background: var(--c-green); }
.legend-dot--amber { background: var(--c-amber); }

/* 卡片内小节标题与元信息行 */
.subhead {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2);
}
.subhead i.ph { font-size: 1.05rem; flex-shrink: 0; }
.hr-light { height: 1px; border: 0; margin: 16px 0; background: var(--c-border-light); }
.meta-row {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--c-text-3);
}
.meta-row i.ph { font-size: 1rem; flex-shrink: 0; }
.spin { animation: spin 1s linear infinite; display: inline-block; }

/* ============================================================
   【恢复批次 1】背诵 / 复习 会话页
   检测输入区 · 判定结果 · 操作区 · 完成卡
   ============================================================ */

/* 作用域：两个会话页的根容器会带上 .check-scope，为检测区提供配色变量 */
.check-scope {
  --check-accent: var(--c-red);
  --check-accent-ring: rgba(192, 57, 43, .14);
  --tone-correct-bg: var(--c-green-bg);
  --tone-correct-fg: var(--c-green);
  --tone-partial-bg: var(--c-amber-bg);
  --tone-partial-fg: var(--c-amber);
  --tone-wrong-bg: var(--c-red-bg);
  --tone-wrong-fg: var(--c-red);
  --tone-pending-bg: var(--c-blue-bg);
  --tone-pending-fg: var(--c-blue);
}
.setup-scope--review .check-scope {
  --check-accent: var(--c-purple);
  --check-accent-ring: rgba(123, 107, 143, .16);
}

.check-hint { margin-bottom: 10px; font-size: var(--fs-sm); color: var(--c-text-3); letter-spacing: .02em; }
.check-input-row { display: flex; gap: 10px; align-items: stretch; }
.check-input {
  flex: 1; min-width: 0; padding: 13px 16px; font-size: var(--fs-xl);
  border: 2px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text); text-align: center;
  letter-spacing: 1px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.check-input:focus { border-color: var(--check-accent); box-shadow: 0 0 0 3px var(--check-accent-ring); }
.check-input::placeholder { color: var(--c-text-3); letter-spacing: 0; }
.check-result {
  margin-top: 14px; padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: var(--fs-md); text-align: left; display: none;
  animation: resultIn .22s ease;
}
@keyframes resultIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.check-result.result-correct { display: block; background: var(--tone-correct-bg); border: 1px solid var(--tone-correct-fg); color: var(--tone-correct-fg); }
.check-result.result-partial { display: block; background: var(--tone-partial-bg); border: 1px solid var(--tone-partial-fg); color: var(--tone-partial-fg); }
.check-result.result-wrong   { display: block; background: var(--tone-wrong-bg);   border: 1px solid var(--tone-wrong-fg);   color: var(--tone-wrong-fg); }
.check-result.result-pending { display: block; background: var(--tone-pending-bg); border: 1px solid var(--tone-pending-fg); color: var(--tone-pending-fg); }
.check-result-title { font-weight: 700; margin-bottom: 6px; }
.check-comment { margin-top: 4px; opacity: .92; color: var(--c-text-2); }
.check-flag {
  display: inline-block; font-size: var(--fs-xs); padding: 2px 8px; border-radius: 99px;
  margin-left: 6px; vertical-align: middle;
  background: var(--c-surface-2); color: var(--c-text-2);
}
.spell-line { margin: 3px 0; color: var(--c-text-2); }
.spell-ok { font-weight: 600; color: var(--c-text); }
.spell-bad { color: var(--c-red); font-weight: 700; text-decoration: line-through; text-decoration-thickness: 2px; }
.btn-ghost-danger { background: transparent; color: var(--c-red); border: 1.5px solid var(--c-red); }
.btn-ghost-danger:hover { background: var(--c-red-bg); }
.btn:active { transform: scale(.97); }
.kbd-hint {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 6px;
  font-size: var(--fs-xs); font-weight: 500; opacity: .8;
  background: var(--c-surface-2); color: var(--c-text-2);
}

/* 操作区 */
.study-actions { margin-top: auto; width: 100%; }
.study-primary-action { width: 100%; }
.study-primary-action .btn { min-width: min(100%, 320px); border-radius: var(--radius); }
.study-mark-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  width: min(100%, 560px); margin-top: 14px;
}
.study-mark-actions .btn { min-width: 0; min-height: 54px; border-radius: var(--radius); font-size: var(--fs-base); font-weight: 600; }
.study-navigation { display: flex; justify-content: space-between; width: 100%; margin-top: 26px; }
.study-navigation .btn { border-radius: 99px; padding: 8px 18px; }

/* 完成卡：红笔印章 */
.completion-card { text-align: center; padding: 52px 36px 44px; }
.completion-stamp {
  display: inline-block; margin-bottom: 26px; padding: 10px 24px;
  border: 2px solid var(--c-red); border-radius: 8px; color: var(--c-red);
  font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: 700;
  letter-spacing: .35em; text-indent: .35em; transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px var(--c-red);
}
/* ============================================================
   【恢复批次 2】从各模板内联 <style> 迁入的页面样式
   注：这些规则原本就是各页的样式来源，迁入以统一维护。
   ============================================================ */

/* --- 来自 _assistant_panel.html --- */
.assistant-fab {
    position: fixed; bottom: 20px; right: 20px; z-index: 90;
    display: flex; align-items: center; gap: 8px;
    padding: 0 20px; height: 50px; border: none; border-radius: 25px; cursor: pointer;
  background: linear-gradient(135deg, var(--c-green), var(--c-green-h));
    color: #fff; font-size: var(--fs-base); font-weight: 600;
    box-shadow: var(--shadow-lg);
  }
.assistant-fab:hover { filter: brightness(1.08); }
.assistant-fab.hidden { display: none; }
.assistant-panel {
    position: fixed; bottom: 84px; right: 20px; z-index: 90;
    width: 360px; max-width: calc(100vw - 32px);
    height: 480px; max-height: calc(100dvh - 120px);
    display: flex; flex-direction: column;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  }
.assistant-panel.hidden { display: none; }
.assistant-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--c-border-light);
    background: var(--c-surface-2);
  }
.assistant-header-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.assistant-body {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
  }
.assistant-msg {
    max-width: 85%; padding: 8px 12px; border-radius: 12px;
    font-size: var(--fs-sm); line-height: 1.6;
    word-break: break-word;
  }
.assistant-msg.user {
    white-space: pre-wrap; align-self: flex-end;
    background: var(--c-green); color: #fff;
    border-bottom-right-radius: 4px;
  }
.assistant-msg.ai {
    white-space: normal; align-self: flex-start;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border-light); border-bottom-left-radius: 4px;
  }
.assistant-msg.ai h1, .assistant-msg.ai h2, .assistant-msg.ai h3, .assistant-msg.ai h4 {
    margin: 8px 0 4px; font-weight: 700; line-height: 1.4;
  }
.assistant-msg.ai h1 { font-size: 1.1rem; }
.assistant-msg.ai h2 { font-size: 1.05rem; }
.assistant-msg.ai h3, .assistant-msg.ai h4 { font-size: 1rem; }
.assistant-msg.ai ul, .assistant-msg.ai ol { margin: 4px 0; padding-left: 18px; }
.assistant-msg.ai th, .assistant-msg.ai td { border: 1px solid var(--c-border); padding: 4px 8px; text-align: left; }
.assistant-msg-time { display: block; margin-top: 4px; font-size: 10px; opacity: .65; }
.assistant-msg.user .assistant-msg-time { text-align: right; }
.assistant-empty {
    color: var(--c-text-3); text-align: center; font-size: var(--fs-sm);
    margin: auto; line-height: 1.8; padding: 0 8px;
  }
.assistant-actions {
    padding: 8px 12px 0; border-top: 1px solid var(--c-border-light);
    background: var(--c-surface-2); display: flex; gap: 6px; flex-wrap: wrap;
  }
.assistant-input-row {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 10px 12px; border-top: 1px solid var(--c-border-light);
    background: var(--c-surface-2);
  }
.assistant-input-row textarea { flex: 1; resize: none; min-height: 38px; max-height: 100px; }

/* --- 来自 _word_ext_panel.html --- */
.word-card-expanded { max-width: 780px; }
.word-ext-panel {
    margin-top: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    border: 1px solid var(--c-border);
    background: var(--c-surface-2);
    box-shadow: var(--shadow);
    animation: extPanelSlideIn .28s ease;
  }
.ext-bar-note  { height: 3px; background: linear-gradient(90deg, var(--c-green), var(--c-green-bg)); }
.ext-bar-quick { height: 3px; background: linear-gradient(90deg, var(--c-amber), var(--c-amber-bg)); }
.ext-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px 10px;
  }
.ext-header-title { font-weight: 700; font-size: var(--fs-base); display: flex; align-items: center; gap: 8px; }
.ext-header-title i { font-size: 20px; }
.ext-header-title .ext-word { font-weight: 400; font-size: var(--fs-xs); color: var(--c-text-3); margin-left: 4px; }
.ext-close-btn {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--c-text-3);
    cursor: pointer; transition: all .15s;
  }
.ext-close-btn:hover { background: var(--c-border); color: var(--c-text); }
.ext-body { padding: 0 18px 16px; }
.ext-meta { font-size: var(--fs-xs); color: var(--c-text-3); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.note-paper {
    background: var(--c-amber-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    position: relative;
  }
.note-paper::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--c-amber), transparent);
    opacity: .4;
  }
.note-paper textarea {
    width: 100%; border: none; background: transparent;
    font-family: var(--font-sans); font-size: var(--fs-base);
    line-height: 1.8; color: var(--c-text); resize: none;
    min-height: 18dvh; max-height: 52dvh; overflow-y: auto; padding: 0;
  }
.note-paper textarea:focus { outline: none; }
.note-paper textarea::placeholder { color: var(--c-text-3); font-style: italic; }
.qm-deck {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    position: relative;
  }
.qm-deck::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--c-amber), transparent);
    opacity: .5;
  }
.qm-deck textarea {
    width: 100%; border: none; background: transparent;
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: var(--fs-sm); line-height: 1.8; color: var(--c-text);
    resize: none; min-height: 34dvh; max-height: 62dvh; overflow-y: auto; padding: 0;
  }
.qm-deck textarea:focus { outline: none; }
.qm-deck textarea::placeholder { color: var(--c-text-3); }
.qm-deck.ai-generating {
    animation: aiGlow 1.2s ease-in-out infinite alternate;
  }
.ext-actions {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    margin-top: 12px;
  }
.ext-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border-radius: 99px;
    font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
    border: 1px solid var(--c-border); background: var(--c-surface);
    color: var(--c-text-2); transition: all .15s;
  }
.ext-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ext-pill i { font-size: 16px; }
.ext-pill-primary  { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.ext-pill-primary:hover { background: var(--c-green-h); }
.ext-pill-amber    { background: var(--c-amber); color: #fff; border-color: var(--c-amber); }
.ext-pill-amber:hover { filter: brightness(1.1); }
.ext-pill-danger   { color: var(--c-red); border-color: var(--c-red-bg); }
.ext-pill-danger:hover { background: var(--c-red-bg); }
.ext-pill-ghost    { border-color: transparent; background: transparent; }
.ext-pill-ghost:hover { background: var(--c-surface-2); }
.ext-page-input {
    width: 90px; padding: 5px 10px; border-radius: 99px;
    border: 1px solid var(--c-border); background: var(--c-surface);
    font-size: var(--fs-sm); text-align: center;
  }
.ext-page-input:focus { border-color: var(--c-green); outline: none; }
.study-tool-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border-radius: 99px;
    border: 1px solid var(--c-border); background: var(--c-surface);
    color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 500;
    cursor: pointer; transition: all .18s;
  }
.study-tool-btn i { font-size: 16px; transition: transform .2s; }
.study-tool-btn:hover { border-color: var(--c-text-3); box-shadow: var(--shadow); }
.study-tool-btn:hover i { transform: scale(1.15); }
.study-tool-btn.active-note { background: var(--c-green-bg); border-color: var(--c-green); color: var(--c-green); }
.study-tool-btn.active-note i { color: var(--c-green); }
.study-tool-btn.active-quick { background: var(--c-amber-bg); border-color: var(--c-amber); color: var(--c-amber); }
.study-tool-btn.active-quick i { color: var(--c-amber); }
.study-tool-btn.active-fav { background: var(--c-amber-bg); border-color: var(--c-amber); color: var(--c-amber); }
.study-tool-btn.active-fav i { color: var(--c-amber); }

/* --- 来自 learn_session.html --- */
.learn-session { max-width: 840px; margin: 0 auto; }
.learn-progress { padding: 14px 18px; margin-bottom: 16px; }
.learn-progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.learn-progress .progress-bar { height: 8px; background: var(--c-bg); }
.learn-progress-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 18px; border-radius: 99px;
    background: transparent; outline: none; cursor: pointer; margin-top: 0;
  }
.learn-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--c-red); cursor: pointer;
    border: 3px solid var(--c-surface);
    box-shadow: 0 0 0 1px var(--c-border), var(--shadow);
  }
.learn-progress-slider::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--c-red); cursor: pointer; border: 3px solid var(--c-surface);
    box-shadow: 0 0 0 1px var(--c-border), var(--shadow);
  }
.study-card {
    position: relative;
    min-height: 560px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 26px 44px 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }
.study-card-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; flex-wrap: wrap; }
.study-unit { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--c-red-bg); color: var(--c-red); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; }
.study-tools { display: flex; gap: 6px; }
.study-tools .btn { min-width: auto; padding: 6px 11px; border-radius: 99px; font-size: var(--fs-xs); }
.study-body {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; padding: 18px 0 8px;
    animation: cardIn .32s ease;
  }
.study-card .word-text {
    margin-top: 18px;
    font-size: clamp(2.5rem, 8vw, 4.9rem);
    line-height: 1.14; letter-spacing: -.01em;
    position: relative; padding-bottom: 16px;
  }
.study-card .word-text::after {
    content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 62px; height: 3px; border-radius: 999px; background: var(--c-red); opacity: .8;
  }
.study-card.is-spelling .word-text::after { display: none; }
.study-card .word-phonetic { margin-top: 10px; font-size: var(--fs-lg); color: var(--c-text-2); }
.study-card .word-pos { margin: 16px 0 4px; display: inline-flex; padding: 3px 12px; border-radius: 99px; background: var(--c-surface-2); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .04em; }
.study-card .word-meaning { width: min(100%, 600px); margin: 16px 0 0; text-align: left; padding: 18px 20px; background: var(--c-bg); border-radius: var(--radius-sm); line-height: 1.8; }
.gate-badge-alt { background: var(--c-amber); }
.study-card .word-example { width: min(100%, 600px); margin-top: 12px; text-align: left; color: var(--c-text-2); font-style: italic; }
.ex-en { white-space: pre-wrap; font-style: normal; color: var(--c-text); }
.ex-zh { color: var(--c-text-2); font-size: 0.92em; margin-top: 4px; white-space: pre-wrap; font-style: normal; }
.ex-actions { display: inline-flex; gap: 8px; margin-top: 8px; }
.ex-btn { border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); border-radius: var(--radius-sm); padding: 3px 10px; font-size: var(--fs-sm); cursor: pointer; font-style: normal; }
.ex-btn:hover { border-color: var(--c-green); color: var(--c-green); }
.ex-btn.ex-primary { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.ex-btn.ex-danger { color: var(--c-red); }
.ex-btn.ex-danger:hover { border-color: var(--c-red); color: var(--c-red); }
.ex-empty { color: var(--c-text-3); font-size: var(--fs-sm); margin-bottom: 6px; font-style: normal; }
.ex-form { display: flex; flex-direction: column; gap: 8px; font-style: normal; }
.ex-input { width: 100%; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 6px 9px; font: inherit; background: var(--c-surface); color: var(--c-text); resize: vertical; }
.ex-msg { color: var(--c-red); font-size: var(--fs-sm); min-height: 1em; font-style: normal; }
.check-panel { width: min(100%, 600px); margin: 22px 0 0; }
.completion-card .card-header { justify-content: center; font-size: var(--fs-xl); margin-bottom: 8px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; width: min(100%, 420px); margin: 26px auto; }
.summary-card { text-align: center; padding: 18px 14px; background: var(--c-surface-2); border-radius: var(--radius); border: 1px solid var(--c-border-light); }
.summary-value { font-family: var(--font-serif); font-size: var(--fs-3xl); font-weight: 700; }
.summary-label { font-size: var(--fs-sm); color: var(--c-text-2); margin-top: 2px; }
.completion-card .btn { margin-top: 6px; }

/* --- 来自 review_session.html --- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
  }
.summary-card {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
  }
.summary-value {
    font-size: var(--font-2xl);
    font-weight: 700;
  }
.summary-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
  }
.review-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: var(--font-sm);
    color: var(--text-secondary);
  }
.review-meta-item {
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
  }
.progress-bar-fill.review {
  background: var(--c-purple);
  }
.word-meaning, .word-example {
    white-space: pre-line;
  }
.review-stage { max-width: 820px; margin: 0 auto; }
.review-progress { padding: 13px 16px; }
.review-progress-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.review-progress-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; border-radius: 4px;
    background: var(--c-border); outline: none; cursor: pointer;
    margin-top: 8px;
  }
.review-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--c-purple); cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  }
.review-progress-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--c-purple); cursor: pointer; border: 2px solid #fff;
  }
.review-study-card { min-height: 540px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 44px; position: relative; }
.review-study-card .word-text { margin-top: 38px; font-size: clamp(2.4rem, 7vw, 4.8rem); line-height: 1.12; }
.review-study-card .word-phonetic { font-size: var(--fs-lg); }
.review-study-card .word-pos { margin: 10px 0 4px; }
.review-tools { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; }
.review-tools .btn { min-width: auto; padding: 7px 9px; }
.review-study-card .word-meaning, .review-study-card .word-example { width: min(100%, 580px); text-align: left; }
.review-reveal { width: 100%; margin-top: auto; }
.review-reveal .btn { min-width: min(100%, 300px); }
.review-mark-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; width: min(100%, 540px); margin-top: 14px; }
.review-mark-actions .btn { min-width: 0; }
.review-navigation { display: flex; justify-content: space-between; width: 100%; margin-top: 26px; }
.review-mode-bar .mode-btn.is-active { background: var(--c-purple-bg); border-color: var(--c-purple); color: var(--c-purple); font-weight: 600; }
.check-mode-bar { margin-top: 8px; }
.check-panel { width: min(100%, 600px); margin: 20px auto 0; }
.check-submit { min-width: 108px; }
.gate-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--c-purple); color: #fff; font-size: var(--fs-xs); font-weight: 600; margin-right: 6px; vertical-align: 1px; }
.mark-btn:disabled { opacity: .45; cursor: not-allowed; }
.wrong-wrap { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--c-red); background: var(--c-red-bg); border-radius: var(--radius-sm); }
.wrong-title { font-weight: 700; margin-bottom: 8px; }
.wrong-list { display: flex; flex-direction: column; gap: 8px; max-height: 40dvh; overflow-y: auto; }
.wrong-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.wrong-word { font-weight: 700; min-width: 90px; }
.wrong-meaning { flex: 1; color: var(--c-text-2); font-size: var(--fs-sm); text-align: left; }
.wrong-tag { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 99px; background: var(--c-red-bg); color: var(--c-red); white-space: nowrap; }
.wrong-tag.wrong-fixed { background: var(--c-green-bg); color: var(--c-green); }
.word-badge { font-weight: 600; }
.word-badge.badge-yesterday { color: var(--c-purple); }
.word-badge.badge-repractice { color: var(--c-red); }

/* --- 来自 learn_start.html --- */
.today-mission { border: 1px solid var(--c-green) !important; background: var(--c-green-bg) !important; }
#gatesConfig:not(.hidden) { display: flex; }

/* --- 来自 history.html --- */
.history-wrap { max-width: 900px; margin: 0 auto; }
.stat-value-sm { font-size: var(--font-2xl); font-weight: 700; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar select, .filter-bar .btn { margin: 0; }
.trend-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 10px 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.trend-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.trend-bar { width: 60%; border-radius: 3px 3px 0 0; background: var(--c-purple); opacity: .85; min-height: 2px; transition: opacity .15s; }
.trend-bar:hover { opacity: 1; }
.trend-bar.zero { background: var(--c-border); opacity: .5; }
.trend-num { font-size: var(--fs-xs); color: var(--c-text-2); }
.trend-label { font-size: var(--fs-xs); color: var(--c-text-3); }
.day-group { margin-bottom: 14px; }
.day-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: var(--c-surface-2); border-radius: var(--radius-sm); margin-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.record-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.record-row:last-child { border-bottom: none; }
.record-time { font-size: var(--fs-xs); color: var(--c-text-3); min-width: 46px; }
.record-word { font-weight: 600; min-width: 110px; }
.record-word a { color: var(--c-text); text-decoration: none; }
.record-word a:hover { color: var(--c-purple); }
.record-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tag { font-size: var(--fs-xs); padding: 2px 9px; border-radius: 99px; }
.tag-ok { background: var(--c-green-bg); color: var(--c-green); }
.tag-bad { background: var(--c-red-bg); color: var(--c-red); }
.tag-skip { background: var(--c-surface-2); color: var(--c-text-2); }
.tag-neutral { background: var(--c-amber-bg); color: var(--c-amber); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.pagination .page-link { padding: 6px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); color: var(--c-text-2); text-decoration: none; }
.pagination .page-link.active { background: var(--c-purple); color: #fff; border-color: var(--c-purple); }

/* ===== 恢复批次 3：工具类 + 表格别名 + 写作工坊 ===== */
/* ============================================================
   【恢复批次 3】布局工具类补全
   模板中已在用、但 style.css 从未定义的少量 flex/间距类。
   ============================================================ */
.flex-wrap    { flex-wrap: wrap; }
.flex-column  { flex-direction: column; }
.justify-end  { justify-content: flex-end; }
.items-start  { align-items: flex-start; }
/* 补齐既有 8px 步长间距标度（原本只有 2/4/6 档） */
.mt-1  { margin-top: 4px; }
.mt-3  { margin-top: 12px; }
.text-lg { font-size: var(--fs-lg); }

/* ============================================================
   【恢复批次 3】表格别名
   4 个工坊模板使用 .word-table，但样式只定义在 .data-table 上，
   导致这些页面表格全无样式。此处合并选择器。
   ============================================================ */
.table, .data-table, .word-table { width: 100%; border-collapse: collapse; }
.table th, .data-table th, .word-table th {
  text-align: left; padding: 11px 14px; font-weight: 600;
  font-size: var(--fs-sm); color: var(--c-text-2);
  border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.table td, .data-table td, .word-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--c-border-light);
  vertical-align: middle;
}
.table tr:hover td, .data-table tr:hover td, .word-table tr:hover td { background: var(--c-surface-2); }

/* ============================================================
   【恢复批次 3】写作工坊（workshop）
   二级导航 · 卡片 · 页头 · 筛选胶囊 · 记录表 · 得分胶囊 · 详情展开
   ============================================================ */

/* 二级导航 */
.ws-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px; margin-bottom: 18px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
}
.ws-nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--c-text-2); text-decoration: none;
  font-size: .88rem; line-height: 1.3; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.ws-nav a:hover { background: var(--c-surface); color: var(--c-text); }
.ws-nav a i.ph { font-size: 1.05rem; flex-shrink: 0; }
.ws-nav a.active {
  background: var(--c-surface); color: var(--c-red);
  font-weight: 600; border-color: var(--c-border); box-shadow: var(--shadow);
}

/* 页头 */
.ws-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ws-head-title { display: flex; align-items: center; gap: 10px; font-size: 1.18rem; font-weight: 600; color: var(--c-text); line-height: 1.35; }
.ws-head-title i.ph { font-size: 1.35rem; flex-shrink: 0; }
.ws-head-sub { margin-top: 5px; font-size: var(--fs-sm); color: var(--c-text-3); line-height: 1.65; }

/* 卡片 */
.ws-card { padding: 0; overflow: hidden; }
.ws-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 0; padding: 15px 22px;
  border-bottom: 1px solid var(--c-border-light); background: var(--c-surface-2);
}
.ws-card-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 600; }
.ws-card-title i.ph { font-size: 1.3rem; flex-shrink: 0; }
.ws-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-card-body { padding: 18px 22px; }
.ws-note { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--c-text-3); line-height: 1.7; }
.ws-note:last-child { margin-bottom: 0; }
.ws-subsection { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-border-light); }
.ws-subsection-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; color: var(--c-text); }
.ws-tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px 22px; }
@media (max-width: 640px) { .ws-tile-grid { grid-template-columns: 1fr; } }

/* 筛选胶囊 */
.ws-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; row-gap: 10px; }
.ws-filter-group {
  display: flex; gap: 2px; padding: 4px;
  background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: 10px;
}
.ws-filter-group a {
  padding: 6px 14px; border-radius: 7px;
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--c-text-2); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.ws-filter-group a:hover { background: var(--c-surface); color: var(--c-text); }
.ws-filter-group a.active { background: var(--c-red); color: #fff; box-shadow: var(--shadow); }
.ws-filters .ws-filter-end { margin-left: auto; }

/* 记录表 */
.ws-rec-table { width: 100%; }
.ws-rec-table thead th {
  padding: 9px 12px; font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-text-3); letter-spacing: .03em; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--c-border); background: var(--c-surface-2);
}
.ws-rec-table tbody td { padding: 11px 12px; }
.ws-rec-title { font-weight: 600; color: var(--c-text); line-height: 1.4; }
.ws-rec-sub { margin-top: 2px; font-size: var(--fs-xs); color: var(--c-text-3); }
.ws-rec-row:hover { background: var(--c-surface-2); }
.ws-year-chip { padding: 3px 10px !important; font-size: var(--fs-xs) !important; }
.ws-detail-row:hover { background: transparent; }
.ws-history-stats { margin-bottom: 14px; }

/* 得分胶囊：按得分占比着色 */
.ws-score-chip {
  display: inline-flex; align-items: baseline; gap: 3px;
  padding: 3px 10px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--c-surface-2); color: var(--c-text-2);
  border: 1px solid var(--c-border-light);
}
.ws-score-chip small { font-size: .68rem; font-weight: 500; opacity: .65; }
.ws-score-chip--none { color: var(--c-text-3); font-weight: 500; }
.ws-score-chip--good { background: var(--c-green-bg); color: var(--c-green); border-color: transparent; }
.ws-score-chip--ok   { background: var(--c-amber-bg); color: var(--c-amber); border-color: transparent; }
.ws-score-chip--weak { background: var(--c-red-bg);   color: var(--c-red);   border-color: transparent; }

/* 详情展开 */
.ws-detail { padding: 16px 20px; background: var(--c-surface-2); border-top: 1px solid var(--c-border-light); }
.ws-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ws-detail-label { margin-bottom: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-3); letter-spacing: .03em; }
.ws-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: var(--fs-sm); line-height: 1.8; color: var(--c-text); }
.ws-pre-scroll { max-height: 260px; overflow: auto; }
.ws-pre-error { color: var(--c-red); }
.ws-toggle-btn { display: inline-flex; align-items: center; gap: 4px; }
.ws-toggle-btn i.ph { transition: transform .2s ease; font-size: .95rem; }
.ws-toggle-btn.open i.ph { transform: rotate(180deg); }

/* 工坊小节标题与通用分区 */
.ws-section { margin-bottom: 18px; }
.ws-section:last-child { margin-bottom: 0; }
.ws-section-title { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2); }
.ws-section-title i.ph { font-size: 1rem; }

/* 真题卡片 */
.ws-qcard { display: flex; flex-direction: column; gap: 10px; }
.ws-qcard-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-qcard-title { font-size: 1.05rem; font-weight: 600; color: var(--c-text); line-height: 1.5; }
.ws-qcard-excerpt { font-size: var(--fs-sm); color: var(--c-text-2); line-height: 1.75; white-space: pre-line; }
.ws-cell-title { max-width: 380px; font-weight: 600; color: var(--c-text); line-height: 1.5; }
.ws-cell-excerpt { margin-top: 3px; font-size: var(--fs-xs); color: var(--c-text-3); line-height: 1.6; }

/* 好句页卡片头 */
.ws-phrase-head { display: flex; align-items: center; gap: 8px; }
.ws-phrase-head i.ph { font-size: 1.1rem; }

/* ===== 恢复批次 4：设置页 / 起始页 / 考试页 / 词表 / 对话页 ===== */
/* ============================================================
   【恢复批次 4】设置页（settings）
   ============================================================ */
.settings-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1120px; }
.settings-page > .card { margin: 0 !important; }
.settings-body { min-width: 0; }
.settings-body > .card { display: none; }
.settings-body > .card.active { display: block; animation: settingsFade .22s ease; }
.settings-nav {
  position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px; background: var(--c-surface-2);
  border: 1px solid var(--c-border-light); border-radius: var(--radius);
}
.settings-nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--c-text-2); text-decoration: none;
  font-size: .9rem; line-height: 1.3; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.settings-nav a:hover { background: var(--c-surface); color: var(--c-text); }
.settings-nav a i.ph { font-size: 1.05rem; flex-shrink: 0; width: 1.25em; text-align: center; }
.settings-nav a.active { background: var(--c-surface); color: var(--c-blue); font-weight: 600; border-color: var(--c-border); box-shadow: var(--shadow); }
.settings-subgroup { padding: 14px 16px; background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); margin-bottom: 14px; }
.settings-subgroup:last-child { margin-bottom: 0; }
.settings-subgroup-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; color: var(--c-text); margin-bottom: 12px; }
.settings-subgroup-title i.ph { color: var(--c-blue); font-size: 1rem; }
@media (max-width: 820px) {
  .settings-page { grid-template-columns: 1fr; gap: 14px; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
  .settings-nav a { flex: 0 0 auto; min-height: 44px; padding: 10px 14px; font-size: .85rem; }
  .settings-subgroup { padding: 12px; }
}
.settings-page .card-header {
  display: flex; align-items: center; gap: 9px;
  margin: -20px -24px 18px; padding: 14px 24px;
  border-bottom: 1px solid var(--c-border-light);
  background: var(--c-surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
  scroll-margin-top: 16px;
}
.settings-page .card-header i.ph { font-size: 1.15rem; flex-shrink: 0; }
.settings-sub { font-size: .82rem; color: var(--c-text-3); line-height: 1.6; margin: -6px 0 16px; }
.settings-sub:last-child { margin-bottom: 0; }
.save-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--c-border-light); }

.feat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feat-item { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); }
.feat-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; color: var(--c-text); }
.feat-head i.ph { font-size: 1.05rem; }
.feat-desc { font-size: .8rem; color: var(--c-text-3); line-height: 1.5; }
.feat-item select { min-width: 0 !important; width: 100%; margin-top: 2px; }

.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); }
.action-head { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: .95rem; color: var(--c-text); }
.action-head i.ph { font-size: 1.15rem; color: var(--c-blue); }
.action-desc { font-size: .82rem; color: var(--c-text-3); line-height: 1.55; }
.action-item .btn { align-self: flex-start; margin-top: 2px; }
.action-item.danger { border-left: 3px solid var(--c-red); }
.action-item.danger .action-head, .action-item.danger .action-head i.ph { color: var(--c-red); }

.about-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.about-stat-title { margin: 0; font-size: .85rem; font-weight: 600; color: var(--c-text-2); }
.about-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.about-link { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--c-surface); border: 1px solid var(--c-border-light); border-radius: var(--radius-sm); color: var(--c-blue); text-decoration: none; font-size: .85rem; min-width: 0; }
.about-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.about-link:hover { border-color: var(--c-blue); }
.about-block { padding: 13px 15px; background: var(--c-surface-2); border-radius: var(--radius-sm); margin-bottom: 12px; }
.about-block:last-child { margin-bottom: 0; }
.about-block.accent-blue { border-left: 3px solid var(--c-blue); }
.about-block.accent-green { border-left: 3px solid var(--c-green); }
.about-block.accent-amber { border-left: 3px solid var(--c-amber); }
.about-block-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; margin-bottom: 10px; }

.donate-mask { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; background: rgba(30,25,15,.38); backdrop-filter: blur(2px); }
.donate-box { width: min(480px, calc(100vw - 48px)); max-height: 86vh; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; border-radius: var(--radius-lg); background: var(--c-surface); box-shadow: var(--shadow-lg); border: 1px solid var(--c-border-light); padding: 22px 24px 18px; animation: donatePop .2s cubic-bezier(.2,.9,.3,1.2); }
.donate-title { font-size: 1.05rem; font-weight: 600; color: var(--c-text); margin-bottom: 16px; text-align: center; }
.donate-qrs { display: flex; gap: 18px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.donate-qrs figure { margin: 0; text-align: center; }
.donate-qrs img { display: block; width: auto; height: auto; max-width: 175px; max-height: 50vh; border-radius: 10px; border: 1px solid var(--c-border-light); }
.donate-qrs figcaption { margin-top: 8px; font-size: .82rem; color: var(--c-text-2); }
@media (max-width: 520px) { .donate-qrs img { max-width: min(58vw, 175px); } }
.donate-tip { text-align: center; margin-top: 14px; }
.donate-footer { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.update-check-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--c-blue); font-size: .8rem; font-family: inherit; }
.update-check-btn:hover { text-decoration: underline; }
.update-check-btn:disabled { color: var(--c-text-2); cursor: default; text-decoration: none; }
.update-check-status { display: block; min-height: 1.2em; margin-top: 4px; color: var(--c-text-2); font-size: .74rem; }
.update-check-status[data-state="available"] { color: var(--c-blue); }
.update-check-status[data-state="current"] { color: var(--c-green); }
.update-check-status[data-state="error"] { color: var(--c-amber); }
.update-box { width: min(520px, calc(100vw - 36px)); }
.update-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: -6px 0 16px; }
.update-summary > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--c-border-light); border-radius: 9px; background: var(--c-surface-2); }
.update-summary-label { display: block; margin-bottom: 3px; color: var(--c-text-2); font-size: .74rem; }
.update-summary strong { display: block; overflow-wrap: anywhere; color: var(--c-text); font-size: .9rem; font-weight: 650; }
.update-section-title { margin: 0 0 7px; color: var(--c-text); font-size: .86rem; font-weight: 650; }
.update-integrity-note { margin: 10px 0 14px; padding: 9px 11px; border-left: 3px solid var(--c-blue); border-radius: 0 7px 7px 0; background: var(--c-surface-2); color: var(--c-text-2); font-size: .78rem; line-height: 1.55; }
.update-progress-track { height: 8px; border-radius: 999px; background: var(--c-border); overflow: hidden; }
.update-progress-bar { height: 100%; width: 0; background: var(--c-blue); transition: width .25s; }
#upProgressText { margin-top: 7px; text-align: center; }
.update-notes { white-space: pre-wrap; word-break: break-word; max-height: 42vh; overflow: auto; background: var(--c-surface-2); border-radius: 8px; padding: 12px 14px; font-family: inherit; font-size: .88rem; line-height: 1.7; color: var(--c-text); margin: 0 0 6px; }
@media (max-width: 420px) { .update-summary { grid-template-columns: 1fr; gap: 7px; } }
.dl-done-path { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: 8px; margin: 12px 0 4px; font-size: .85rem; }
.vault-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 10px; padding: 10px 14px; font-size: .88rem; line-height: 1.5; }
.vault-warn { background: #fdf3e3; color: #9a6208; border: 1px solid #e9c27c; }
.vault-ok { background: #eef8ef; color: #2c7a3f; border: 1px solid #a9d8b3; }
.vault-locked { background: #eef3fb; color: #355a8c; border: 1px solid #b6c9e4; }

/* ============================================================
   【恢复批次 4】背诵 / 复习 起始页
   ============================================================ */
.learn-setup { max-width: 980px; margin: 0 auto; }
.setup-title { margin: 0 0 8px; font-size: 1.4rem; font-weight: 800; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.setup-title::before { content: ''; width: 5px; height: 1.05em; border-radius: 3px; background: var(--c-green); flex: none; }
.setup-scope--review .setup-title::before { background: var(--c-purple); }
.setup-subtitle { margin: 0; color: var(--c-text-2); line-height: 1.7; max-width: 720px; }
.setup-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.choice-group { padding: 13px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.choice-group-title { display: block; margin-bottom: 9px; color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 600; }
.choice-option { display: inline-flex; align-items: center; gap: 7px; margin-right: 14px; padding: 7px 0; cursor: pointer; }
.unit-picker { margin-top: 14px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.unit-picker summary { padding: 12px 14px; cursor: pointer; list-style: none; }
.unit-picker summary::-webkit-details-marker { display: none; }
.unit-picker[open] summary { border-bottom: 1px solid var(--c-border); }
.unit-choice { padding: 12px !important; cursor: pointer; transition: transform .15s, border-color .15s; }
.unit-choice:hover { transform: translateY(-1px); }
.learn-start-submit { margin-top: 16px; display: flex; justify-content: flex-end; }

/* 快速开始卡片：紧凑横版，图标置于圆角色块中 */
.quick-start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-card, button.quick-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon desc";
  column-gap: 14px; row-gap: 3px; align-items: center;
  width: 100%; text-align: left; padding: 14px 16px;
  border: 1px solid var(--c-border-light); border-radius: 12px;
  background: var(--c-surface); text-decoration: none; color: inherit; font: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s; cursor: pointer;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
button.quick-card:hover { background: var(--c-surface); }
.quick-icon {
  grid-area: icon; align-self: center; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px; font-size: 1.3rem;
  background: var(--c-green-bg); color: var(--c-green);
}
.quick-title { grid-area: title; align-self: end; font-weight: 700; font-size: .95rem; line-height: 1.35; }
.quick-desc { grid-area: desc; align-self: start; font-size: .8rem; color: var(--c-text-2); line-height: 1.5; }
.quick-card.is-disabled { opacity: .6; cursor: default; pointer-events: none; }

/* 预设卡：右侧悬浮操作按钮 */
.preset-card { position: relative; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "icon title actions" "icon desc actions"; }
.preset-actions { grid-area: actions; display: flex; gap: 2px; opacity: .45; transition: opacity .15s; }
.preset-card:hover .preset-actions, .preset-actions:focus-within { opacity: 1; }
.preset-actions .btn { padding: 4px 6px; }

.setup-scope--learn .unit-choice:hover { border-color: var(--c-green); }
.setup-scope--learn .quick-card:hover { border-color: var(--c-green); }
.setup-scope--review .unit-choice:hover { border-color: var(--c-purple); }
.setup-scope--review .quick-icon { background: var(--c-purple-bg); color: var(--c-purple); }
.setup-scope--review .quick-card:hover { border-color: var(--c-purple); }

/* 今日任务卡：进度胶囊 */
.mission-title { font-weight: 700; font-size: var(--fs-lg); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mission-title .ph { color: var(--c-green); }
.mission-plan { font-weight: 500; font-size: .78rem; color: var(--c-text-2); background: var(--c-surface); border: 1px solid var(--c-border-light); padding: 2px 10px; border-radius: 999px; }
.mission-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mission-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--c-text-2); background: var(--c-surface); border: 1px solid var(--c-border-light); border-radius: 999px; padding: 4px 12px; }
.mission-chip strong { color: var(--c-green); font-size: .92rem; }
.mission-chip .ph { color: var(--c-text-3); }

@media (max-width: 640px) {
  .setup-row { grid-template-columns: 1fr; }
  .learn-start-submit .btn { width: 100%; }
  .quick-start-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   【恢复批次 4】模拟考试（exam）
   考试主题色：--c-blue（与背诵绿、复习紫区分）
   ============================================================ */

/* ----- 阶段一：考前配置 ----- */
#examConfig { max-width: 980px; margin: 0 auto; }
.exam-setup-sub { margin-bottom: 18px; }
.setup-title--exam::before { background: var(--c-blue); }
.exam-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.exam-card--scope { grid-row: span 2; }
.exam-setup > .card { margin-bottom: 16px; }
.exam-section-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 14px; }
.exam-section-title .ph { color: var(--c-blue); font-size: 1.12rem; flex: none; }
.exam-card-head .exam-section-title { margin-bottom: 0; }

/* 可点选项卡：原生 radio 呈现为自定义圆点，选中态蓝边浅底 + 右上对勾 */
.exam-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.exam-choice-grid--1 { grid-template-columns: 1fr; }
.exam-choice-grid--2col { margin-bottom: 14px; }
.exam-choice {
  position: relative; display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 30px 10px 12px;
  border: 1px solid var(--c-border-light); border-radius: 10px;
  background: var(--c-surface); cursor: pointer;
  font-size: .9rem; line-height: 1.4; color: var(--c-text);
  transition: border-color .15s, background .15s, transform .15s;
}
.exam-choice:hover { border-color: var(--c-blue); transform: translateY(-1px); }
.exam-choice > span { min-width: 0; }
.exam-choice .text-sm { display: block; font-size: .78rem; font-weight: 400; color: var(--c-text-3); margin-top: 1px; }
.exam-choice input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 16px; height: 16px; margin: 2px 0 0; padding: 0;
  border: 2px solid var(--c-border); border-radius: 50%;
  background: var(--c-surface); cursor: pointer;
  transition: border-color .15s;
}
.exam-choice input[type="radio"]:checked { border-color: var(--c-blue); }
.exam-choice input[type="radio"]:checked::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-blue);
}
.exam-choice:has(input:checked) { border-color: var(--c-blue); background: var(--c-blue-bg); font-weight: 600; }
.exam-choice:has(input:checked)::after {
  content: ''; position: absolute; top: 12px; right: 13px;
  width: 5px; height: 9px; border: solid var(--c-blue);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* 单元卡片网格 */
.exam-unit-grid { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.exam-unit-card { padding: 11px 13px; margin: 0; cursor: pointer; font-size: .88rem; transition: border-color .15s, background .15s; }
.exam-unit-card:hover { border-color: var(--c-blue); }
.exam-unit-card:has(input:checked) { border-color: var(--c-blue); background: var(--c-blue-bg); }
.exam-unit-card .exam-unit-checkbox { accent-color: var(--c-blue); width: 16px; height: 16px; cursor: pointer; }
.exam-unit-hint { margin-top: 10px; color: var(--c-red); font-size: .82rem; }

/* 题目数量：输入框 + 胶囊快捷按钮 */
.exam-count-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.exam-count-field { display: flex; align-items: center; gap: 8px; }
.exam-count-field .form-input { width: 110px; }
.exam-count-suffix { color: var(--c-text-2); font-size: .9rem; }
.exam-count-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.exam-count-chip {
  padding: 6px 18px; border-radius: 999px; font-size: .85rem; cursor: pointer;
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-2);
  font-family: inherit; transition: all .15s;
}
.exam-count-chip:hover { border-color: var(--c-blue); color: var(--c-blue); }
.exam-count-chip.active { background: var(--c-blue); border-color: var(--c-blue); color: #fff; font-weight: 600; }
.exam-start-btn { width: 100%; padding: 12px; font-size: 1rem; }

@media (max-width: 860px) {
  .exam-config-grid { grid-template-columns: 1fr; }
  .exam-card--scope { grid-row: auto; }
}
@media (max-width: 520px) {
  .exam-choice-grid { grid-template-columns: 1fr; }
}

/* ----- 阶段二/三：答题、成绩 ----- */
#examAnswer, #examResult { max-width: 860px; margin: 0 auto; }
.exam-qpos { font-size: 1.05rem; font-weight: 700; }
.exam-timer-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-blue-bg); color: var(--c-blue);
  border-radius: 999px; padding: 4px 12px; font-weight: 700;
}
.exam-timer-pill .ph { font-size: .95rem; }
#examTimer { font-family: ui-monospace, Consolas, monospace; font-size: 1rem; color: var(--c-blue); }
.progress-bar-fill.exam-progress { background: var(--c-blue); }

/* 题干：柔和底色横幅区 */
.exam-prompt {
  text-align: center; padding: 26px 24px 22px;
  margin: -20px -24px 18px;
  background: var(--c-bg); border-bottom: 1px solid var(--c-border-light);
  border-radius: var(--radius) var(--radius) 0 0;
}
.exam-prompt .exam-word { font-size: 2rem; font-weight: 800; letter-spacing: 1px; }
.exam-prompt .exam-sub { color: var(--c-text-3); margin-top: 5px; font-size: .9rem; }
#examQuestionLabel {
  display: inline-block; margin: 0 0 14px !important; padding: 4px 13px;
  border-radius: 999px; background: var(--c-blue-bg); color: var(--c-blue);
  font-size: .8rem !important; font-weight: 600;
}

/* 选项 */
.exam-option { display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--c-border); border-radius: 10px; padding: 13px 16px; background: var(--c-surface); cursor: pointer; transition: all .15s ease; text-align: left; font-size: .93rem; }
.exam-option:hover { border-color: var(--c-blue); background: var(--c-blue-bg); transform: translateY(-1px); }
.exam-option.sel { border-color: var(--c-blue); background: var(--c-blue-bg); font-weight: 600; }
.exam-option .exam-letter { flex: none; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--c-border); font-size: .85rem; color: var(--c-text-3); background: var(--c-surface); transition: all .15s; }
.exam-option:hover .exam-letter { border-color: var(--c-blue); color: var(--c-blue); }
.exam-option.sel .exam-letter { background: var(--c-blue); color: #fff; border-color: var(--c-blue); }
#examOptions .form-input:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(63,109,158,.16); }

/* 答题卡点位 */
.exam-dot { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--c-border); display: flex; align-items: center; justify-content: center; background: var(--c-surface); cursor: pointer; font-size: .85rem; position: relative; transition: border-color .15s, background .15s; }
.exam-dot:hover { border-color: var(--c-blue); }
.exam-dot.answered { background: var(--c-blue-bg); border-color: var(--c-blue); color: var(--c-blue); }
.exam-dot.current { border-color: var(--c-blue); box-shadow: 0 0 0 2px var(--c-blue-bg); }
#examAnsweredCount { color: var(--c-blue); font-weight: 700; }
.exam-dot.j-ing { border-color: var(--c-amber); color: var(--c-amber); }
.exam-dot.j-ok { border-color: var(--c-green); color: var(--c-green); background: var(--c-green-bg); }
.exam-dot.j-partial { border-color: var(--c-amber); color: var(--c-amber); background: var(--c-amber-bg); }
.exam-dot.j-wrong, .exam-dot.j-err { border-color: var(--c-red); color: var(--c-red); background: var(--c-red-bg); }
.exam-dot.j-done { border-color: var(--c-text-3); color: var(--c-text-3); background: var(--c-surface-2); }

/* 成绩 */
.exam-score-ring { width: 168px; height: 168px; border-radius: 50%; margin: 20px auto 0; background: conic-gradient(var(--c-accent) 0%, var(--c-border) 0); display: flex; align-items: center; justify-content: center; }
.exam-score-inner { width: 134px; height: 134px; border-radius: 50%; background: var(--c-surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.exam-score-num { font-size: 2.3rem; font-weight: 800; color: var(--c-accent); }
.exam-stat { min-width: 104px; text-align: center; background: var(--c-surface-2); border: 1px solid var(--c-border-light); border-radius: 10px; padding: 11px 8px; }
.exam-stat-num { font-size: 1.45rem; font-weight: 800; }
#examCorrectCount { color: var(--c-green); }
#examWrongCount { color: var(--c-red); }
#examTimeUsed { color: var(--c-text-2); }
.exam-wrong-item { border: 1px solid var(--c-border); border-left: 3px solid var(--c-red); border-radius: 10px; padding: 12px 16px; background: var(--c-bg); }
.exam-wrong-item .ans-right { color: var(--c-green); }
.exam-wrong-item .ans-wrong { color: var(--c-red); text-decoration: line-through; }
.judge-mark { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid var(--c-surface); }
.judge-mark.mk-ing { background: var(--c-amber); }
.judge-mark.mk-ok { background: var(--c-green); }
.judge-mark.mk-partial { background: var(--c-amber); }
.judge-mark.mk-wrong, .judge-mark.mk-err { background: var(--c-red); }
.judge-mark.mk-done { background: var(--c-text-3); }
.judge-mark.mk-pending { background: var(--c-blue); }
.exam-dot.j-pending { border-color: var(--c-blue); color: var(--c-blue); background: var(--c-blue-bg); }
.judge-banner { margin-top: 10px; border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; display: flex; align-items: flex-start; gap: 8px; }
.judge-banner i { font-size: 18px; margin-top: 1px; }
.judge-banner.jb-ing { background: var(--c-amber-bg); color: var(--c-amber); }
.judge-banner.jb-ok { background: var(--c-green-bg); color: var(--c-green); }
.judge-banner.jb-partial { background: var(--c-amber-bg); color: var(--c-amber); }
.judge-banner.jb-wrong, .judge-banner.jb-err { background: var(--c-red-bg); color: var(--c-red); }
.judge-banner.jb-done { background: var(--c-bg); color: var(--c-text-3); }
.judge-banner.jb-pending { background: var(--c-blue-bg); color: var(--c-blue); }
.judge-banner .jb-retry { margin-left: auto; flex: none; background: none; border: none; cursor: pointer; color: inherit; font-size: .85rem; text-decoration: underline; padding: 0; }
.judge-banner .jb-comment { flex: 1; line-height: 1.55; word-break: break-all; }
.judge-src-tag { font-size: .72rem; opacity: .75; margin-left: 6px; }

/* ============================================================
   【恢复批次 4】词库浏览（word_list）
   ============================================================ */
.vocab-side-heading { display: flex; align-items: center; justify-content: space-between; margin: 18px 10px 8px; font-size: var(--fs-sm); color: var(--c-text-3); }
.unit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.unit-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.unit-count { flex-shrink: 0; font-size: var(--fs-xs); color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.unit-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0 !important; flex-shrink: 0; }
.unit-btn i.ph { font-size: .85rem; }
.vocab-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vocab-table-scroll { overflow-x: auto; }
.vocab-summary .quick-filters { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.vocab-summary .spacer { flex: 1 1 auto; }

/* ============================================================
   【恢复批次 4】AI 助手对话页
   ============================================================ */
.ai-chat-wrap { display: flex; height: calc(100vh - 190px); min-height: 460px; gap: 0; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; background: var(--c-surface); }
.ai-chat-sidebar { width: 220px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: 1px solid var(--c-border-light); background: var(--c-surface-2); overflow: hidden; }
.ai-chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ai-chat-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--c-border-light); }
.ai-chat-header .hint { font-size: var(--fs-xs); color: var(--c-text-3); flex: 1; min-width: 0; }
.ai-chat-header .model-select { width: auto; max-width: 220px; }
.ai-chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-chat-empty { margin: auto; text-align: center; color: var(--c-text-3); line-height: 2; }
.ai-chat-empty .big { display: block; font-size: 2.6rem; margin-bottom: 10px; color: var(--c-border); }
.ai-chat-input-row { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--c-border-light); }
.ai-chat-input-row .upload-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: var(--radius-sm); cursor: pointer; }
.ai-chat-input-row .upload-btn input { display: none; }
.ai-attach-pending { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.ai-attach-pending:empty { display: none; }

/* ===== 恢复批次 5：零散缺口 ===== */
/* ============================================================
   【恢复批次 5】零散缺口补齐
   ============================================================ */

/* 起始页：预设卡片编辑/保存行 · 单元勾选 */
.preset-edit { position: absolute; top: 8px; right: 8px; opacity: .7; padding: 4px 6px; }
.preset-edit:hover { opacity: 1; }
.preset-save-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.unit-checkbox { accent-color: var(--c-green); width: 15px; height: 15px; cursor: pointer; }
.unit-cb { accent-color: var(--c-green); }

/* 考试页：阶段容器 · 单元勾选 */
.exam-phase { display: flex; flex-direction: column; gap: 14px; }
.exam-unit-checkbox { margin-right: 6px; }

/* 好句页：收藏按钮图标与文字 */
.collect-icon { font-size: 1rem; margin-right: 3px; vertical-align: -2px; }
.collect-label { font-size: var(--fs-xs); }

/* 导入记录：行与词表预览 */
.import-log-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--c-border-light); }
.import-log-row:last-child { border-bottom: none; }
.import-words-preview { margin-top: 6px; font-size: var(--fs-xs); color: var(--c-text-3); line-height: 1.7; word-break: break-word; }

/* 设置页：字体大小 / 发音按钮（原本无独立样式，给一致的最小尺寸） */
.font-size-btn, .voice-btn { min-width: 52px; }

/* 词表：收藏按钮与释义标签文字 */
.favorite-btn { background: none; border: none; cursor: pointer; padding: 2px 4px; font-size: 1rem; line-height: 1; color: var(--c-text-3); }
.favorite-btn:hover { color: var(--c-amber); }
.meaning-chip-text { font-size: var(--fs-sm); line-height: 1.6; }

/* 协议弹窗：重点条款提示块 + 门禁态占位 */
.privacy-emph { margin: 0 0 10px; padding: 10px 14px; background: var(--c-surface-2); border-left: 3px solid var(--c-blue); border-radius: 6px; }
.privacy-emph p { margin: 0 0 6px; }
.privacy-emph p:last-child { margin-bottom: 0; }
.privacy-gate { z-index: 1000; }

/* 写作页：风格选择按钮 */
.style-btn { min-width: 0; }

/* 通用：单属性 gap 工具类（模板中以 .gap 直接使用过） */
.gap { gap: 8px; }

/* ============================================================
   【终点修复】恢复因误操作回退丢失、但代码仍在引用的样式
   ============================================================ */

/* --- 刷新按钮转圈（app.js 的 refreshPage() 会加此类）--- */
.spinning { animation: spin 1s linear infinite; display: inline-block; }

/* --- 图标修饰类：模板中以 ph-sm / ph-spin 形式使用 --- */
.ph-sm   { font-size: .95rem; }
.ph-spin { animation: spin 1s linear infinite; display: inline-block; }

/* --- 紧凑 Markdown 排版（聊天气泡内共用）---
   AI 助手页（.ai-msg.ai）与页面小助手（.assistant-msg.ai）共用；
   两者的容器盒子与标题字号属各自差异，仍分别定义。 --- */
.md-compact h3 { font-size: 1rem; }
.md-compact h4 { font-size: 1rem; }
.md-compact p { margin: 4px 0; }
.md-compact ul { margin: 4px 0; padding-left: 18px; }
.md-compact ol { margin: 4px 0; padding-left: 18px; }
.md-compact li { margin: 2px 0; }
.md-compact hr { border: none; border-top: 1px solid var(--c-border); margin: 8px 0; }
.md-compact code { background: rgba(127,127,127,.14); padding: 1px 4px; border-radius: 4px; font-size: .9em; font-family: Consolas, Menlo, monospace; }
.md-compact pre { background: rgba(127,127,127,.12); padding: 8px 10px; border-radius: 8px; overflow-x: auto; margin: 6px 0; }
.md-compact pre code { background: none; padding: 0; }
.md-compact blockquote { border-left: 3px solid var(--c-green); background: var(--c-green-bg); margin: 6px 0; padding: 6px 10px; border-radius: 0 6px 6px 0; color: var(--c-text-2); }
.md-compact table { border-collapse: collapse; margin: 6px 0; width: 100%; font-size: .95em; }
.md-compact th, .md-compact td { border: 1px solid var(--c-border); padding: 4px 8px; text-align: left; }
.md-compact a { color: var(--c-green); text-decoration: underline; word-break: break-all; }

/* ===== 终点修复：AI 助手侧栏与消息气泡 ===== */
/* ============================================================
   【终点修复】AI 助手页：会话侧栏与消息气泡
   .conv-list / .conv-item / .new-btn / .ai-msg 的样式随模板内联块丢失，
   按现有标记（.conv-item 内含 .title 与 .del，消息含 .ai-msg-meta）重建。
   ============================================================ */
.new-btn { width: 100%; justify-content: center; }

.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }

.conv-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--c-text-2);
  transition: background .15s, color .15s;
}
.conv-item:hover { background: var(--c-surface); color: var(--c-text); }
.conv-item.active { background: var(--c-surface); color: var(--c-green); font-weight: 600; }
.conv-item .title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-sm);
}
.conv-item .del {
  flex: none; opacity: 0; cursor: pointer;
  background: none; border: none; padding: 2px 4px;
  color: var(--c-text-3); font-size: .85rem; line-height: 1;
  transition: opacity .15s, color .15s;
}
.conv-item:hover .del, .conv-item.active .del { opacity: 1; }
.conv-item .del:hover { color: var(--c-red); }

/* 消息气泡：容器盒子（排版由 .md-compact 提供） */
.ai-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: var(--fs-base);
  line-height: 1.75;
  word-break: break-word;
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--c-green-bg);
  color: var(--c-text);
  border-bottom-right-radius: 4px;
}
.ai-msg.ai {
  align-self: flex-start;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-light);
  border-bottom-left-radius: 4px;
}
.ai-msg .ai-msg-meta {
  display: block; margin-top: 5px;
  font-size: 10px; opacity: .65;
}
.ai-msg.user .ai-msg-meta { text-align: right; }
.ai-attach-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ai-attach-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--c-surface); border: 1px solid var(--c-border-light);
  font-size: var(--fs-xs); color: var(--c-text-2);
}
.ai-attach-tag i.ph { font-size: .9rem; }

/* ===== 移动端底部导航（五项 tabbar + 「更多」抽屉） =====
   仅窄屏显示，替代原侧栏把 12 项全部横排的旧做法；
   触摸面积≥44×44px，焦点顺序与视觉顺序一致。 */
.mobile-tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
}
.mobile-tabbar a,
.mobile-tabbar button {
  flex: 1; min-width: 0; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 4px 2px;
  font-size: var(--fs-xs); line-height: 1;
  color: var(--c-text-2); text-decoration: none;
  background: transparent; border: none; cursor: pointer; border-radius: var(--radius-sm);
}
.mobile-tabbar a i.ph,
.mobile-tabbar button i.ph { font-size: 1.35rem; line-height: 1; }
.mobile-tabbar a.active { color: var(--c-red); font-weight: 600; }
.mobile-tabbar a:focus-visible,
.mobile-tabbar button:focus-visible { outline: 2px solid var(--c-green); outline-offset: -2px; }

/* 「更多」抽屉：底部上滑面板 */
.mobile-more {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  max-height: 72dvh; overflow-y: auto;
  transform: translateY(12px); opacity: 0;
  transition: transform .2s ease, opacity .2s ease, visibility .2s;
}
.mobile-more.open { transform: none; opacity: 1; visibility: visible; }
.mobile-more[hidden] { display: block; opacity: 0; transform: translateY(100%); pointer-events: none; visibility: hidden; }
.mobile-more-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--c-border-light);
  font-weight: 600; font-size: var(--fs-base); color: var(--c-text);
}
.mobile-more-close {
  border: none; background: transparent; cursor: pointer;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--c-text-3); border-radius: var(--radius-sm);
}
.mobile-more-close:hover { background: var(--c-surface-2); color: var(--c-text); }
.mobile-more-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.mobile-more-grid a {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 12px;
  color: var(--c-text); text-decoration: none;
  background: var(--c-surface-2); border: 1px solid var(--c-border-light);
  border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
.mobile-more-grid a i.ph { font-size: 1.2rem; color: var(--c-red); flex: none; }
.mobile-more-grid a:focus-visible { outline: 2px solid var(--c-green); outline-offset: 2px; }
.mobile-more-grid a.active { border-color: var(--c-red); color: var(--c-red); font-weight: 600; }

@media (max-width: 768px) {
  .mobile-tabbar { display: flex; }
}

/* 会话页（背诵/复习）：隐藏全局顶栏与移动端「更多」入口，答题为绝对中心 */
.session-page .top-bar { display: none; }
@media (max-width: 768px) {
  .session-page .main-content { padding-bottom: 0; }
}

/* ===== 仪表盘：信息层级与今日任务卡 ===== */
.stack { display: flex; flex-direction: column; gap: 24px; }

/* 每日一句：静态、低干扰、可关闭 */
.daily-quote {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; margin-bottom: 4px;
  font-size: var(--fs-sm); color: var(--c-text-2);
  border-bottom: 1px dashed var(--c-border);
}
.daily-quote i.ph { color: var(--c-red); flex: none; }
.daily-quote-text { font-family: var(--font-serif); font-weight: 600; color: var(--c-text); letter-spacing: .02em; }
.daily-quote-date { color: var(--c-text-3); font-size: var(--fs-xs); margin-left: auto; white-space: nowrap; }
.daily-quote-close {
  border: none; background: transparent; cursor: pointer;
  min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-text-3); border-radius: var(--radius-sm); font-size: 1rem; flex: none;
}
.daily-quote-close:hover { background: var(--c-surface-2); color: var(--c-text); }
.daily-quote[hidden] { display: none; }

/* 今日学习任务卡：首屏唯一首要任务 */
.daily-task-card {
  display: grid; grid-template-columns: 1fr auto;
  gap: 20px 32px; align-items: center;
  padding: 28px 28px 18px;
  position: relative;
  overflow: hidden;
}
.daily-task-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--c-red);
}
.daily-task-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.daily-task-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em;
  color: var(--c-red); text-transform: uppercase;
}
.daily-task-title { margin: 0; font-size: var(--fs-2xl); font-weight: 700; color: var(--c-text); }
.daily-task-desc { margin: 0; color: var(--c-text-2); font-size: var(--fs-sm); line-height: 1.6; }
.daily-task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.daily-task-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--c-surface-2); border: 1px solid var(--c-border-light);
  font-size: var(--fs-sm); color: var(--c-text-2);
}
.daily-task-chip i.ph { color: var(--c-red); font-size: .95rem; }
.daily-task-action { display: flex; align-items: stretch; }
.daily-task-action .btn { min-height: 52px; min-width: 200px; }
.daily-task-foot {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px dashed var(--c-border); padding-top: 12px; margin-top: 4px;
}
.stamp-sm { font-size: var(--fs-xs); padding: 2px 8px; }

/* 薄弱词提醒：第二层召唤入口 */
.weak-reminder-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.weak-reminder-main { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* 背诵官阶 */
.recitation-rank-card { display: grid; gap: 14px; }
.recitation-rank-heading,
.recitation-rank-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.recitation-rank-heading .card-header { margin: 0 0 4px; }
.recitation-rank-description { margin: 0; font-size: var(--fs-sm); }
.recitation-rank-name { margin-bottom: 4px; font-size: var(--fs-xl); font-weight: 700; color: var(--c-text); }
.recitation-rank-next { text-align: right; }
.recitation-rank-next strong { color: var(--c-text); font-weight: 700; }
.recitation-rank-progress { height: 8px; }
.recitation-rank-progress .progress-bar-fill { background: var(--c-green); }
.recitation-rank-details { border-top: 1px solid var(--c-border-light); padding-top: 12px; }
.recitation-rank-details summary {
  width: fit-content; cursor: pointer; color: var(--c-text-2);
  font-size: var(--fs-sm); font-weight: 600;
}
.recitation-rank-details summary:hover { color: var(--c-text); }
.recitation-rank-details summary:focus-visible,
.recitation-rank-table-wrap:focus-visible {
  outline: 2px solid var(--c-blue); outline-offset: 3px;
}
.recitation-rank-details[open] summary { margin-bottom: 12px; }
.recitation-rank-table { min-width: 560px; }
.recitation-rank-table caption {
  padding: 0 0 8px; color: var(--c-text-2); font-size: var(--fs-xs); text-align: left;
}
.recitation-rank-table tr.recitation-rank-current td,
.recitation-rank-table tr.recitation-rank-current th {
  background: var(--c-green-bg); color: var(--c-green); font-weight: 600;
}
.recitation-rank-note { margin: 10px 0 0; }

@media (max-width: 768px) {
  .daily-task-card { grid-template-columns: 1fr; padding: 20px 18px 16px; }
  .daily-task-action { width: 100%; }
  .daily-task-action .btn { min-width: 0; width: 100%; }
  .daily-quote-date { display: none; }
  .recitation-rank-next { text-align: left; }
}

/* ===== 背诵起始页：默认推荐 + 常用入口 + 调整学习方式（折叠） ===== */
.today-mission { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mission-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.mission-action { display: flex; align-items: center; flex: none; }
.mission-action .btn { min-height: 52px; min-width: 180px; }
.mission-recommend { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--c-text-2); }
.quick-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 单选选项：支持多行说明（场景 + 预估耗时） */
.choice-main { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 调整学习方式：折叠区头部 + 内容 */
.config-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: none; background: transparent; cursor: pointer; text-align: left;
  padding: 4px 0; font: inherit; color: var(--c-text);
}
.config-toggle-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: var(--fs-lg);
}
.config-toggle-title i.ph { color: var(--c-blue); }
.config-toggle-hint {
  flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--c-text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.config-toggle-arrow { color: var(--c-text-3); font-size: 1.1rem; transition: transform .2s ease; }
.config-toggle[aria-expanded="true"] .config-toggle-arrow { transform: rotate(180deg); }
.config-body { margin-top: 16px; border-top: 1px dashed var(--c-border); padding-top: 16px; }
.preset-list { }
@media (max-width: 640px) {
  .today-mission { flex-direction: column; align-items: stretch; }
  .mission-action .btn { width: 100%; min-width: 0; }
  .config-toggle-hint { display: none; }
  .quick-grid-2 { grid-template-columns: 1fr; }
}

/* ===== 会话页（背诵/复习）：三段式顶栏，答题为绝对中心 ===== */
.session-header { margin-bottom: 16px; }
.session-header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.session-header-side { display: flex; align-items: center; min-width: 0; }
.session-header-right { justify-content: flex-end; }
.session-center {
  min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.session-progress-row { display: flex; align-items: center; gap: 10px; }
.session-exit {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--c-text-2); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500;
  white-space: nowrap;
}
.session-exit:hover { background: var(--c-surface-2); color: var(--c-text); }
.session-exit i.ph { font-size: 1rem; }
.session-timer {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--c-surface-2); border: 1px solid var(--c-border-light);
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--fs-base);
  color: var(--c-text-2); white-space: nowrap;
}
/* 复习页：模式/检测方式切换区（第二行，仍属任务相关控制） */
.review-options {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--c-border);
}
@media (max-width: 640px) {
  .session-header-grid { gap: 8px; }
  .session-exit { padding: 8px 10px; }
  .session-exit span { display: inline; } /* 保持「退出并保存」文字可读，不隐藏 */
  .session-timer { padding: 8px 10px; }
}

/* ─── 新手引导弹窗 ─────────────────────────────── */
.onboarding-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: onboarding-fade-in 0.3s ease-out;
}
.onboarding-modal.hidden { display: none; }
@keyframes onboarding-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.onboarding-content {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 100%;
  padding: 32px;
  position: relative;
  animation: onboarding-slide-up 0.3s ease-out;
}
@keyframes onboarding-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.onboarding-step { text-align: center; }
.onboarding-step.hidden { display: none; }
.onboarding-icon {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark, #4a6cf7));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 28px;
}
.onboarding-content h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--c-text);
}
.onboarding-desc {
  color: var(--c-text-2);
  margin: 0 0 24px;
  line-height: 1.6;
}
.onboarding-features {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}
.onboarding-feature {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--c-bg);
  border-radius: var(--radius-sm);
}
.onboarding-feature i {
  font-size: 20px;
  color: var(--c-primary);
}
.onboarding-targets {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.onboarding-target {
  cursor: pointer;
}
.onboarding-target input { display: none; }
.target-label {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.target-label strong {
  font-size: 1.1rem;
  color: var(--c-text);
}
.target-label small {
  color: var(--c-text-2);
  margin-top: 4px;
}
.onboarding-target input:checked + .target-label {
  border-color: var(--c-primary);
  background: rgba(74, 108, 247, 0.1);
}
.onboarding-target:hover .target-label {
  border-color: var(--c-primary);
}
.onboarding-actions {
  display: flex; gap: 12px; justify-content: center;
}
.onboarding-btn {
  min-width: 140px;
  margin-top: 8px;
}
.onboarding-next-steps {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 20px;
}
.onboarding-action-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--c-bg);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--c-text);
  transition: all 0.2s;
}
.onboarding-action-link:hover {
  background: var(--c-surface-2);
  transform: translateX(4px);
}
.onboarding-action-link i {
  font-size: 20px;
  color: var(--c-primary);
}
.onboarding-progress {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 24px;
}
.progress-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-border);
  transition: all 0.2s;
}
.progress-dot.active {
  background: var(--c-primary);
  width: 24px;
  border-radius: 4px;
}
@media (max-width: 480px) {
  .onboarding-content { padding: 24px 20px; }
  .onboarding-targets { grid-template-columns: 1fr; }
}

/* ─── 学习成就 ─────────────────────────────── */
.achievement-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  min-width: 100px;
  position: relative;
  transition: all 0.2s;
  text-align: center;
}
.achievement-badge.unlocked {
  background: linear-gradient(135deg, rgba(74, 108, 247, 0.1), rgba(74, 108, 247, 0.05));
  border: 1px solid var(--c-primary);
  color: var(--c-primary);
}
.achievement-badge.locked {
  background: var(--c-bg);
  border: 1px solid var(--c-border-light);
  color: var(--c-text-2);
  opacity: 0.6;
}
.achievement-badge i.ph {
  font-size: 24px;
  margin-bottom: 6px;
}
.achievement-badge .achievement-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}
.achievement-badge .achievement-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.achievement-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.achievement-badge.locked:hover {
  opacity: 0.8;
}
