/* ============================================================
   Я · 俄语单词手账
   粉色毛玻璃设计系统
   ============================================================ */

:root {
  /* 茶绿 / 奶油系 */
  --leaf-50: #f6fbf7;
  --leaf-100: #eef8f1;
  --leaf-200: #dcefe3;
  --leaf-300: #b8e3cb;
  --leaf-400: #8bcbaa;
  --leaf-500: #3f8f68;
  --leaf-600: #2b6b4f;
  --leaf-700: #245741;
  --ink: #1d2f28;
  --ink-2: #4a6156;
  --ink-3: #7b8f85;

  --accent: var(--leaf-500);
  --accent-deep: var(--leaf-600);
  --accent-soft: rgba(79, 156, 118, .12);
  --gold: #b99f6e;

  /* 兼容旧变量名（图表与内联样式仍在引用） */
  --brand: var(--leaf-500);
  --brand-2: var(--leaf-600);
  --brand-3: #9fc9b3;
  --ok: #3f8f6c;
  --warn: #b8863f;
  --bad: var(--leaf-600);

  --bg: #f2f8f4;
  --surface: rgba(255, 255, 255, .62);
  --surface-solid: #fbfdfb;
  --surface-2: rgba(255, 255, 255, .38);
  --glass-line: rgba(255, 255, 255, .78);
  --glass-line-2: rgba(255, 255, 255, .5);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --border: rgba(150, 185, 168, .34);
  --border-strong: rgba(150, 185, 168, .58);

  --shadow-xs: 0 1px 2px rgba(45, 80, 65, .06);
  --shadow-sm: 0 10px 24px -18px rgba(45, 90, 70, .45);
  --shadow: 0 22px 48px -30px rgba(45, 90, 70, .5), 0 2px 8px rgba(45, 90, 70, .06);
  --shadow-lg: 0 40px 90px -50px rgba(30, 70, 52, .5);
  --glow: 0 0 0 1px rgba(255, 255, 255, .6) inset, 0 18px 40px -28px rgba(60, 130, 100, .4);

  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --maxw: 1180px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "Times New Roman", serif;
  --blur: saturate(165%) blur(22px);
}

html[data-theme="dark"] {
  --bg: #0f1a15;
  --surface: rgba(30, 60, 48, .5);
  --surface-solid: #14251d;
  --surface-2: rgba(255, 255, 255, .05);
  --glass-line: rgba(170, 225, 195, .16);
  --glass-line-2: rgba(170, 225, 195, .1);
  --text: #e9f7ee;
  --text-2: #b9d8c6;
  --text-3: #8aa79a;
  --border: rgba(150, 215, 180, .16);
  --border-strong: rgba(150, 215, 180, .32);
  --accent: #6cc79b;
  --accent-deep: #52b183;
  --accent-soft: rgba(108, 199, 155, .16);
  --shadow-sm: 0 10px 24px -16px rgba(0, 0, 0, .6);
  --shadow: 0 26px 60px -36px rgba(0, 0, 0, .75);
  --shadow-lg: 0 50px 100px -60px rgba(0, 0, 0, .85);
  --glow: 0 0 0 1px rgba(170, 225, 195, .1) inset, 0 18px 40px -28px rgba(0, 0, 0, .6);
}


/* 修复：hidden 属性被 display 覆盖，导致全屏透明层吃掉点击与滑动 */
[hidden] { display: none !important; }

/* 触摸：去掉点击延迟，允许纵向滑动，横向书架单独放开 */
button, .btn, .tabs button, .icon-btn, .mini-btn, .user-btn, a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shelf, .book-layout, .side-list { -webkit-overflow-scrolling: touch; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-color: #f4f8ee;
  line-height: 1.72;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* 背景：暖粉雾光 + 细颗粒 */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 6% -6%, rgba(160, 214, 182, .55), transparent 70%),
    radial-gradient(52% 44% at 100% 0%, rgba(240, 236, 190, .55), transparent 72%),
    radial-gradient(60% 50% at 52% 108%, rgba(190, 216, 196, .34), transparent 70%),
    linear-gradient(180deg, #f9fbf3 0%, #f4f8ee 44%, #eef5ec 100%);
}
.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}
html[data-theme="dark"] body { background-color: #0f1a15; }
html[data-theme="dark"] .bg-layer {
  background:
    radial-gradient(58% 46% at 6% -4%, rgba(96, 190, 145, .26), transparent 70%),
    radial-gradient(52% 44% at 100% 0%, rgba(120, 175, 110, .2), transparent 70%),
    radial-gradient(60% 50% at 50% 108%, rgba(150, 190, 130, .14), transparent 70%),
    linear-gradient(180deg, #12211a 0%, #0e1a14 60%, #0a130f 100%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(79, 156, 118, .2); }
.view svg { max-width: 100%; }

/* ---------- 悬浮玻璃导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  padding: 14px 18px 0;
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 12px 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow), var(--glow);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; padding-right: 6px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 32% 26%, #ffb0cd, var(--leaf-600) 72%);
  box-shadow: 0 8px 18px -10px rgba(53, 119, 90, .9), 0 0 0 1px rgba(255, 255, 255, .5) inset;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-family: var(--serif); font-size: 15.5px; font-weight: 700; letter-spacing: .04em; }
.brand-text i { font-style: normal; font-size: 10.5px; color: var(--text-3); letter-spacing: .1em; }

.mainnav { display: flex; align-items: center; gap: 1px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  position: relative; padding: 6px 13px; border-radius: 999px;
  font-size: 13.5px; color: var(--text-2); white-space: nowrap;
  transition: color .18s, background .18s;
}
.mainnav a:hover { color: var(--accent-deep); background: rgba(255, 255, 255, .45); }
.mainnav a.active {
  color: var(--accent-deep); font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 231, 241, .75));
  box-shadow: 0 6px 16px -12px rgba(60, 130, 100, .7), 0 0 0 1px rgba(255, 255, 255, .8) inset;
}
html[data-theme="dark"] .mainnav a.active {
  color: #c6efd8;
  background: linear-gradient(180deg, rgba(120, 200, 160, .18), rgba(255, 130, 175, .1));
  box-shadow: inset 0 0 0 1px rgba(150, 215, 180, .22);
}

.topbar-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--glass-line-2);
  background: rgba(255, 255, 255, .5);
  color: var(--text-2); cursor: pointer;
  display: grid; place-items: center;
  transition: .18s;
}
.icon-btn:hover { color: var(--accent-deep); background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 16px; height: 16px; }
html[data-theme="dark"] .icon-btn { background: rgba(255, 255, 255, .06); }
#btn-theme .i-moon { display: none; }
html[data-theme="dark"] #btn-theme .i-sun { display: none; }
html[data-theme="dark"] #btn-theme .i-moon { display: block; }

.user-btn {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px 0 3px; border-radius: 999px;
  border: 1px solid var(--glass-line-2); background: rgba(255, 255, 255, .55);
  color: var(--text); font-size: 12.5px; cursor: pointer; transition: .18s;
}
.user-btn:hover { background: #fff; box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .user-btn { background: rgba(255, 255, 255, .06); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #a8dcc2, var(--leaf-500));
  color: #fff; font-size: 11.5px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .65);
}
.user-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 页面骨架 ---------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: 34px 18px 72px; min-height: 62vh; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--border-strong); }

.page-head { margin-bottom: 22px; }
.page-title {
  font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.01em;
  margin: 8px 0 6px; display: flex; align-items: center; gap: 12px; color: var(--text);
}
.page-title svg { width: .82em; height: .82em; color: var(--accent); }
.page-sub { color: var(--text-2); font-size: 13.5px; margin: 0; max-width: 62ch; }

.section { margin-top: 40px; }
.section-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-title {
  font-family: var(--serif); font-size: 19px; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 9px; letter-spacing: .01em;
}
.section-title svg { width: 15px; height: 15px; color: var(--accent); }
.section-hint { color: var(--text-3); font-size: 12px; letter-spacing: .02em; }

/* ---------- 玻璃面板 ---------- */
.glass, .chart-card, .calendar-wrap, .quick-card, .word-card, .book-card, .toolbar, .dictation-panel, .choice-card, .flashcard, .kpi, .list-row, .modal {
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow), var(--glow);
}

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 17px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s, color .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--leaf-400), var(--leaf-600));
  --btn-fg: #fff; --btn-bd: transparent;
  box-shadow: 0 14px 28px -18px rgba(53, 119, 90, .95), 0 0 0 1px rgba(255, 255, 255, .22) inset;
}
.btn-primary:hover { box-shadow: 0 18px 34px -18px rgba(53, 119, 90, 1); }
.btn-soft {
  --btn-bg: rgba(255, 255, 255, .55);
  --btn-fg: var(--accent-deep);
  --btn-bd: var(--glass-line-2);
}
html[data-theme="dark"] .btn-soft { --btn-bg: rgba(255, 255, 255, .07); --btn-fg: #a9e2c8; }
.btn-ghost { --btn-bd: transparent; }
.btn-danger { --btn-bg: rgba(53, 119, 90, .1); --btn-fg: var(--leaf-700); --btn-bd: transparent; }
html[data-theme="dark"] .btn-danger { --btn-fg: #9fdcbe; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn-xs { height: 27px; padding: 0 10px; font-size: 11.5px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 14.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 分段控件 ---------- */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: 999px; background: rgba(255, 255, 255, .42);
  border: 1px solid var(--glass-line-2);
}
html[data-theme="dark"] .tabs { background: rgba(255, 255, 255, .05); }
.tabs button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 999px;
  color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: .18s;
}
.tabs button:hover { color: var(--accent-deep); }
.tabs button.active {
  background: #fff; color: var(--accent-deep); font-weight: 600;
  box-shadow: 0 6px 14px -10px rgba(180, 60, 110, .8);
}
html[data-theme="dark"] .tabs button.active { background: rgba(120, 200, 160, .18); color: #c6efd8; box-shadow: none; }

/* ---------- 输入 ---------- */
.select, .input {
  height: 36px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .55);
  color: var(--text); font-size: 13px; outline: none; transition: .18s;
}
html[data-theme="dark"] .select, html[data-theme="dark"] .input { background: rgba(255, 255, 255, .06); }
.select:focus, .input:focus {
  border-color: var(--leaf-300);
  box-shadow: 0 0 0 4px rgba(79, 156, 118, .12);
  background: #fff;
}
html[data-theme="dark"] .select:focus, html[data-theme="dark"] .input:focus { background: rgba(255, 255, 255, .1); }
.input::placeholder { color: var(--text-3); }
.search-input {
  min-width: 200px; padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a98295' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 14px;
}
textarea.input { border-radius: var(--radius-md); padding: 12px 14px; height: auto; }

/* ---------- 标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px;
  border-radius: 999px; background: rgba(255, 255, 255, .5);
  border: 1px solid var(--glass-line-2); color: var(--text-2);
  font-size: 11.5px; letter-spacing: .02em; white-space: nowrap;
}
html[data-theme="dark"] .chip { background: rgba(255, 255, 255, .06); }
.chip-ok { color: #2f7d5b; background: rgba(120, 205, 165, .16); border-color: rgba(120, 205, 165, .3); }
.chip-warn { color: #a5692a; background: rgba(235, 205, 150, .2); border-color: rgba(235, 205, 150, .34); }
.chip-bad { color: var(--leaf-700); background: rgba(79, 156, 118, .14); border-color: rgba(79, 156, 118, .3); }
.chip-brand { color: var(--accent-deep); background: rgba(79, 156, 118, .1); border-color: rgba(79, 156, 118, .24); }
html[data-theme="dark"] .chip-ok { color: #93e1bb; }
html[data-theme="dark"] .chip-warn { color: #f0cf9a; }
html[data-theme="dark"] .chip-bad { color: #8fd3b0; }
html[data-theme="dark"] .chip-brand { color: #a9e2c8; }

/* ---------- 首页 hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 30px; padding: 44px 46px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(255, 255, 255, .78), transparent 58%),
    linear-gradient(118deg, rgba(238, 248, 235, .95) 0%, rgba(206, 233, 214, .88) 46%, rgba(242, 243, 205, .82) 100%);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lg), var(--glow);
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 34px; align-items: center;
}
html[data-theme="dark"] .hero {
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(120, 195, 155, .16), transparent 58%),
    linear-gradient(120deg, rgba(28, 55, 44, .82), rgba(20, 42, 33, .86));
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--serif); font-weight: 700; text-wrap: balance;
  font-size: clamp(28px, 3.6vw, 44px); line-height: 1.22;
  letter-spacing: -.015em; margin: 12px 0 14px; color: var(--text);
}
.hero h1 em { font-style: italic; color: var(--accent-deep); white-space: nowrap; }
.hero p { margin: 0 0 26px; color: var(--text-2); font-size: 14px; max-width: 46ch; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 34px; }
.hero-stat b { display: block; font-family: var(--serif); font-size: 25px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.hero-stat span { font-size: 11.5px; color: var(--text-3); letter-spacing: .06em; }

.today-card {
  position: relative; z-index: 1;
  border-radius: 24px; padding: 24px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 24px 50px -34px rgba(45, 110, 85, .55), 0 0 0 1px rgba(255, 255, 255, .5) inset;
}
html[data-theme="dark"] .today-card { background: rgba(255, 255, 255, .06); }
.today-card .tc-label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.today-card .tc-ring { display: flex; align-items: center; gap: 18px; margin: 14px 0 18px; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--text);
}
.ring .ring-val small { display: block; font-family: var(--font); font-size: 9.5px; color: var(--text-3); letter-spacing: .12em; }
.today-list { display: flex; flex-direction: column; gap: 9px; }
.today-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.today-item b { font-family: var(--serif); font-size: 15px; color: var(--text); }
.today-actions { display: flex; gap: 8px; margin-top: 16px; }
.today-actions .btn { flex: 1; }

/* ---------- 书架 ---------- */
.shelf {
  display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.shelf::-webkit-scrollbar { height: 6px; }
.shelf::-webkit-scrollbar-thumb { background: rgba(150, 185, 168, .5); border-radius: 999px; }
.shelf .book-card { flex: 0 0 246px; scroll-snap-align: start; }

/* ---------- 词书卡 ---------- */
.grid { display: grid; gap: 16px; }
.grid-books { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.grid-words { grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); }
.grid-quick { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }

.book-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
  transition: transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s, border-color .3s;
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg), var(--glow); }
.book-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--leaf-100); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-cover-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 42px; color: #fff;
  background: linear-gradient(135deg, var(--leaf-300), var(--leaf-600));
}
.book-cover-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  padding: 3px 9px; border-radius: 999px; font-size: 10.5px; letter-spacing: .1em;
  background: rgba(255, 255, 255, .78); color: var(--leaf-700);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.book-body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.book-title { font-family: var(--serif); font-size: 16px; font-weight: 700; margin: 0; letter-spacing: .01em; }
.book-sub {
  font-size: 11.5px; color: var(--text-3); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 8px; }
.book-count { font-size: 11.5px; color: var(--text-2); letter-spacing: .04em; }
.progress-track { height: 4px; border-radius: 999px; background: rgba(150, 185, 168, .22); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--leaf-300), var(--leaf-600)); transition: width .5s; }


/* 官方书影：像立在书架上的实体书 */
.book-cover.has-photo {
  background:
    radial-gradient(130% 95% at 50% 2%, rgba(255, 255, 255, .34), transparent 70%),
    linear-gradient(160deg, #e8f3ea, #dcefe2 55%, #d4ebdc);
  display: grid;
  place-items: center;
  padding: 14px 16px;
}
html[data-theme="dark"] .book-cover.has-photo {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(130, 200, 165, .12), transparent 70%),
    linear-gradient(160deg, #16241d, #0f1a15);
}
.book-cover.has-photo img {
  position: absolute;
  inset: 12px 14px;
  margin: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 24px);
  object-fit: contain;
  border-radius: 3px;
  filter: saturate(1.06) contrast(1.03);
  box-shadow: 0 18px 30px -18px rgba(25, 75, 55, .62), 0 3px 8px rgba(25, 75, 55, .12);
  transition: transform .6s cubic-bezier(.2, .8, .3, 1);
}
.book-card:hover .book-cover.has-photo img { transform: translateY(-4px) scale(1.015); }
.book-cover.has-photo::after {
  content: ""; position: absolute; left: 18%; right: 18%; bottom: 8px; height: 10px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(45, 105, 80, .28), transparent 70%);
  filter: blur(3px); pointer-events: none;
}
.book-cover.has-photo .book-cover-badge { left: 10px; top: 10px; }

/* ---------- 快捷块 ---------- */
.quick-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.quick-card {
  display: flex; gap: 12px; align-items: center;
  padding: 16px 17px; border-radius: var(--radius-md);
  transition: transform .24s, box-shadow .24s, border-color .24s;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), var(--glow); }
.quick-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(200, 235, 215, .7));
  color: var(--accent-deep);
  box-shadow: 0 8px 18px -14px rgba(60, 130, 100, .8), 0 0 0 1px rgba(255, 255, 255, .7) inset;
}
html[data-theme="dark"] .quick-icon { background: rgba(95, 175, 135, .14); color: #a9e2c8; box-shadow: none; }
.quick-icon svg { width: 17px; height: 17px; }
.quick-text b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.quick-text span { font-size: 11.5px; color: var(--text-3); }

/* ---------- 单词卡 ---------- */
.word-card {
  position: relative; border-radius: var(--radius-md); padding: 17px 18px 15px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.word-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg), var(--glow); }
.word-card.is-mark-1 { box-shadow: inset 3px 0 0 rgba(120, 205, 165, .8), var(--shadow); }
.word-card.is-mark-2 { box-shadow: inset 3px 0 0 rgba(79, 156, 118, .75), var(--shadow); }
.word-card.is-mark-3 { box-shadow: inset 3px 0 0 rgba(235, 205, 150, .85), var(--shadow); }
.word-top { display: flex; align-items: flex-start; gap: 10px; }
.word-main { flex: 1; min-width: 0; }
.word-text {
  font-family: var(--serif); font-size: 23px; font-weight: 700; line-height: 1.26;
  letter-spacing: .005em; word-break: break-word;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.word-text .ru { color: var(--text); }
.word-pos {
  font-family: var(--font); font-size: 10.5px; font-weight: 500; color: var(--text-3);
  padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .55);
  border: 1px solid var(--glass-line-2); letter-spacing: .04em;
}
html[data-theme="dark"] .word-pos { background: rgba(255, 255, 255, .07); }
.word-pron { font-family: var(--font); font-size: 11.5px; color: var(--text-3); }
.word-meaning { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.word-meaning.hidden-meaning { filter: blur(6px); cursor: pointer; user-select: none; transition: filter .25s; }
.word-meaning.hidden-meaning:hover { filter: blur(0); }
.word-example {
  font-size: 12.5px; color: var(--text-3); border-top: 1px dashed var(--border);
  padding-top: 8px; margin-top: 2px; line-height: 1.7;
}
.word-example .ru { font-family: var(--serif); font-size: 13.5px; color: var(--text-2); }
.word-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.word-idx { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.word-note {
  font-size: 12px; color: var(--text-2); border-radius: 10px; padding: 7px 10px;
  background: rgba(238, 240, 210, .45); border-left: 2px solid rgba(190, 175, 130, .8);
}
html[data-theme="dark"] .word-note { background: rgba(235, 210, 160, .1); }

.mini-btn {
  width: 29px; height: 29px; border-radius: 50%;
  border: 1px solid var(--glass-line-2);
  background: rgba(255, 255, 255, .5);
  color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; transition: .16s;
}
.mini-btn:hover { color: var(--accent-deep); border-color: var(--leaf-300); background: #fff; }
.mini-btn svg { width: 14px; height: 14px; }
html[data-theme="dark"] .mini-btn { background: rgba(255, 255, 255, .06); }
.mini-btn.on-ok { color: #2f7d5b; background: rgba(120, 205, 165, .22); border-color: rgba(120, 205, 165, .4); }
.mini-btn.on-bad { color: var(--leaf-700); background: rgba(79, 156, 118, .18); border-color: rgba(79, 156, 118, .4); }
.mini-btn.on-warn { color: #a5692a; background: rgba(235, 205, 150, .22); border-color: rgba(235, 205, 150, .42); }

/* ---------- 词书页：侧栏 + 主区 ---------- */
.book-hero {
  position: relative; overflow: hidden; border-radius: 26px;
  padding: 0; min-height: 168px; display: flex; align-items: flex-end;
  border: 1px solid var(--glass-line); box-shadow: var(--shadow-lg), var(--glow);
  background: linear-gradient(130deg, rgba(235, 247, 239, .9), rgba(255, 210, 228, .82));
}
.book-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; opacity: .18; }
.book-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(252, 254, 253, .25) 0%, rgba(250, 253, 251, .72) 55%, rgba(246, 252, 248, .92) 100%);
}
html[data-theme="dark"] .book-hero::after { background: linear-gradient(180deg, rgba(12, 26, 20, .1), rgba(12, 26, 20, .8) 78%); }
.book-hero-inner { position: relative; z-index: 1; padding: 22px 26px; width: 100%; }
.book-hero h1 { margin: 0 0 6px; font-family: var(--serif); font-size: clamp(23px, 3vw, 32px); font-weight: 700; letter-spacing: -.01em; }
.book-hero .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); letter-spacing: .03em; }
.book-hero .meta b { color: var(--text); font-family: var(--serif); font-size: 13.5px; }

.book-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 20px; align-items: start; }
.book-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 12px; }
.side-card {
  border-radius: var(--radius); padding: 16px;
  background: var(--surface); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.side-label {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between;
}
.side-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.side-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 9px; border-radius: 9px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; transition: .16s; border: 1px solid transparent; text-align: left;
  background: transparent;
}
.side-item:hover { background: rgba(255, 255, 255, .55); color: var(--text); }
html[data-theme="dark"] .side-item:hover { background: rgba(255, 255, 255, .07); }
.side-item.active {
  background: linear-gradient(180deg, #fff, rgba(225, 244, 232, .9));
  color: var(--accent-deep); border-color: var(--leaf-200);
  box-shadow: 0 6px 16px -14px rgba(60, 130, 100, .9);
  font-weight: 600;
}
html[data-theme="dark"] .side-item.active { background: rgba(110, 190, 150, .16); color: #c6efd8; border-color: rgba(120, 200, 160, .28); }
.side-item .n { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-hr { height: 1px; background: var(--border); margin: 12px 0; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-actions .btn { width: 100%; }

.book-main { min-width: 0; }
.list-topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.list-topbar .search-input { flex: 1; min-width: 180px; }

/* 兼容旧工具栏类（其他页面仍在用） */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 14px;
}
.toolbar-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.toolbar-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.toolbar .select { height: 32px; font-size: 12.5px; }


/* 单元胶囊（紧凑排布） */
.side-list.chips { flex-direction: row; flex-wrap: wrap; gap: 4px; max-height: 150px; overflow: auto; }
.side-list.chips .side-item { padding: 3px 9px; font-size: 11.5px; border-radius: 999px; background: rgba(255, 255, 255, .45); border: 1px solid var(--glass-line-2); }
.side-list.chips .side-item.active { background: linear-gradient(180deg, #fff, rgba(225, 244, 232, .95)); }
html[data-theme="dark"] .side-list.chips .side-item { background: rgba(255, 255, 255, .06); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 28px; flex-wrap: wrap; }
.pager .btn { min-width: 33px; padding: 0 10px; height: 31px; font-size: 12px; }
.pager .page-info { font-size: 11.5px; color: var(--text-3); padding: 0 5px; letter-spacing: .04em; }

/* ---------- 学习舞台 ---------- */
.study-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 12px 0 44px; min-height: calc(100vh - 300px); }
.study-topbar { width: 100%; max-width: 780px; display: flex; align-items: center; gap: 12px; }
.study-topbar .btn { height: 32px; }
.study-progress { flex: 1; height: 4px; border-radius: 999px; background: rgba(150, 185, 168, .26); overflow: hidden; }
.study-progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--leaf-300), var(--leaf-600)); transition: width .35s; }
.study-counter { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: .1em; }

.flashcard {
  position: relative; width: 100%; max-width: 620px; min-height: 320px;
  border-radius: 30px; padding: 38px 34px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 13px; cursor: pointer;
  transition: transform .2s, box-shadow .3s;
}
.flashcard::before {
  content: ""; position: absolute; inset: -1px; border-radius: 31px; pointer-events: none;
  background: radial-gradient(70% 90% at 50% 0%, rgba(255, 255, 255, .7), transparent 60%);
  opacity: .6;
}
html[data-theme="dark"] .flashcard::before { background: radial-gradient(70% 90% at 50% 0%, rgba(120, 200, 160, .12), transparent 60%); }
.flashcard:active { transform: scale(.995); }
.flashcard .fc-word {
  font-family: var(--serif); font-size: clamp(34px, 6vw, 52px); font-weight: 700;
  line-height: 1.2; letter-spacing: .005em;
}
.flashcard .fc-hint { font-size: 11.5px; color: var(--text-3); letter-spacing: .08em; margin-top: 2px; }
.flashcard .fc-back { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.flashcard .fc-meaning { font-size: 20px; font-weight: 600; }
.flashcard .fc-ex { font-family: var(--serif); font-size: 13.5px; color: var(--text-2); max-width: 460px; line-height: 1.75; }
.flashcard .fc-ex-cn { font-size: 12px; color: var(--text-3); }
.flashcard .fc-pos { font-size: 11px; color: var(--text-3); letter-spacing: .1em; }
.fc-badge { position: absolute; top: 18px; left: 20px; }
.study-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.study-actions .btn { min-width: 112px; height: 42px; }
.kbd-hint { font-size: 11.5px; color: var(--text-3); text-align: center; letter-spacing: .04em; }
.kbd-hint kbd {
  font-family: var(--font); font-size: 10.5px; background: rgba(255, 255, 255, .6);
  border: 1px solid var(--glass-line-2); border-radius: 5px; padding: 1px 5px; margin: 0 2px;
  color: var(--text-2);
}
html[data-theme="dark"] .kbd-hint kbd { background: rgba(255, 255, 255, .08); }

/* 选择题 */
.choice-card { width: 100%; max-width: 680px; border-radius: 28px; padding: 32px 30px; display: flex; flex-direction: column; gap: 18px; }
.choice-question { text-align: center; }
.choice-question .q-word { font-family: var(--serif); font-size: clamp(30px, 5.2vw, 44px); font-weight: 700; letter-spacing: .005em; }
.choice-question .q-sub { font-size: 11.5px; color: var(--text-3); margin-top: 5px; letter-spacing: .08em; }
.choice-options { display: grid; gap: 9px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-radius: 14px; border: 1px solid var(--glass-line-2);
  background: rgba(255, 255, 255, .42); cursor: pointer; font-size: 14px;
  transition: .18s; text-align: left; color: var(--text);
}
html[data-theme="dark"] .option { background: rgba(255, 255, 255, .05); }
.option:hover:not(.locked) {
  border-color: var(--leaf-300); background: #fff; transform: translateX(2px);
  box-shadow: 0 10px 22px -18px rgba(60, 130, 100, .8);
}
html[data-theme="dark"] .option:hover:not(.locked) { background: rgba(255, 255, 255, .1); }
.option .key {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px;
  background: rgba(255, 255, 255, .7); color: var(--text-3); border: 1px solid var(--glass-line-2);
}
.option.correct { border-color: rgba(120, 205, 165, .8); background: rgba(120, 205, 165, .14); }
.option.correct .key { background: #63b992; color: #fff; border-color: transparent; }
.option.wrong { border-color: rgba(79, 156, 118, .7); background: rgba(79, 156, 118, .1); }
.option.wrong .key { background: var(--leaf-500); color: #fff; border-color: transparent; }
.option.locked { cursor: default; }
.choice-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.stat-box {
  border-radius: 14px; padding: 13px; text-align: center;
  background: rgba(255, 255, 255, .45); border: 1px solid var(--glass-line-2);
}
html[data-theme="dark"] .stat-box { background: rgba(255, 255, 255, .05); }
.stat-box b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.stat-box span { font-size: 10.5px; color: var(--text-3); letter-spacing: .1em; }

/* 听写 */
.dictation-panel { width: 100%; max-width: 680px; border-radius: 28px; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.audio-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 52px; }
.audio-wave i { width: 4px; border-radius: 3px; background: linear-gradient(180deg, var(--leaf-300), var(--leaf-600)); opacity: .28; }
.audio-wave.playing i { animation: wave 1s ease-in-out infinite; opacity: .95; }
.audio-wave.playing i:nth-child(2) { animation-delay: .1s; }
.audio-wave.playing i:nth-child(3) { animation-delay: .2s; }
.audio-wave.playing i:nth-child(4) { animation-delay: .3s; }
.audio-wave.playing i:nth-child(5) { animation-delay: .15s; }
.audio-wave.playing i:nth-child(6) { animation-delay: .25s; }
.audio-wave.playing i:nth-child(7) { animation-delay: .05s; }
@keyframes wave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.dictation-input {
  width: 100%; height: 58px; font-family: var(--serif); font-size: 23px; text-align: center;
  border-radius: 16px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, .55); color: var(--text); outline: none;
  transition: .2s; letter-spacing: .02em;
}
html[data-theme="dark"] .dictation-input { background: rgba(255, 255, 255, .06); }
.dictation-input:focus { border-color: var(--leaf-300); box-shadow: 0 0 0 4px rgba(79, 156, 118, .12); background: #fff; }
html[data-theme="dark"] .dictation-input:focus { background: rgba(255, 255, 255, .1); }
.dictation-input.ok { border-color: rgba(120, 205, 165, .8); background: rgba(120, 205, 165, .1); }
.dictation-input.bad { border-color: rgba(79, 156, 118, .8); background: rgba(79, 156, 118, .08); }
.dictation-feedback { min-height: 46px; text-align: center; }
.feedback-ok { color: #2f7d5b; font-weight: 600; }
html[data-theme="dark"] .feedback-ok { color: #8fe0b8; }
.feedback-bad { color: var(--leaf-700); font-weight: 600; }
html[data-theme="dark"] .feedback-bad { color: #8fd3b0; }
.answer-reveal { font-family: var(--serif); font-size: 21px; }
.dictation-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ---------- 弹窗 ---------- */
.modal-host { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 40, 32, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s; }
.modal {
  position: relative; width: 100%; max-width: 540px; max-height: 86vh; overflow: auto;
  border-radius: 24px; padding: 26px 26px 22px; animation: pop .24s cubic-bezier(.2, .9, .3, 1.05);
  background: rgba(250, 253, 251, .88);
}
html[data-theme="dark"] .modal { background: rgba(20, 42, 33, .92); }
.modal.wide { max-width: 760px; }
.modal h3 { font-family: var(--serif); margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.modal .modal-sub { color: var(--text-3); font-size: 12.5px; margin: 0 0 18px; }
.modal-close { position: absolute; right: 15px; top: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.toast-host { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 9px 17px; border-radius: 999px; font-size: 12.5px;
  background: rgba(250, 253, 251, .92); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow); animation: toastIn .22s; max-width: 90vw;
}
.toast.ok { color: #2f7d5b; }
.toast.bad { color: var(--leaf-700); }
.toast.info { color: var(--accent-deep); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 列表 ---------- */
.list-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: 14px;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.list-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg), var(--glow); }
.list-main { flex: 1; min-width: 0; }
.list-main b { font-size: 13.5px; }
.list-main .ru { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.list-sub { font-size: 11.5px; color: var(--text-3); }

.empty {
  text-align: center; padding: 56px 22px; color: var(--text-3);
  border-radius: var(--radius); border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, .35);
}
html[data-theme="dark"] .empty { background: rgba(255, 255, 255, .04); }
.empty .em-icon {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent);
  background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-line);
}
.empty .em-icon svg { width: 20px; height: 20px; }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; font-size: 14.5px; font-family: var(--serif); }

/* ---------- 日历 ---------- */
.calendar-wrap { border-radius: var(--radius); padding: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-head { font-size: 10.5px; color: var(--text-3); text-align: center; letter-spacing: .14em; padding-bottom: 4px; }
.day-cell {
  position: relative; height: 56px; border-radius: 12px;
  border: 1px solid transparent; background: rgba(255, 255, 255, .32);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2); cursor: pointer; transition: .16s; gap: 1px;
}
html[data-theme="dark"] .day-cell { background: rgba(255, 255, 255, .04); }
.day-cell:hover { border-color: var(--leaf-300); color: var(--accent-deep); background: rgba(255, 255, 255, .7); }
.day-cell.muted { opacity: .28; cursor: default; background: transparent; }
.day-cell.today {
  border-color: var(--leaf-400);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(215, 240, 225, .9));
  font-weight: 600; color: var(--leaf-700);
}
html[data-theme="dark"] .day-cell.today { background: rgba(100, 180, 140, .18); color: #c6efd8; }
.day-cell.has-data { background: linear-gradient(160deg, rgba(255, 255, 255, .8), rgba(205, 238, 220, .62)); }
html[data-theme="dark"] .day-cell.has-data { background: rgba(95, 175, 135, .1); }
.day-cell .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--leaf-500); }
.day-cell .cnt { position: absolute; right: 6px; top: 4px; font-size: 9.5px; color: var(--text-3); }

/* ---------- 图表 ---------- */
.chart-card { border-radius: var(--radius); padding: 20px 22px; }
.chart-card h4 { margin: 0 0 3px; font-family: var(--serif); font-size: 15px; font-weight: 700; }
.chart-card .chart-hint { font-size: 11.5px; color: var(--text-3); margin-bottom: 14px; }
.chart-svg { width: 100%; height: 160px; overflow: visible; }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 10px; height: 130px; }
.bars .bar-col { flex: 0 1 62px; min-width: 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--leaf-300), var(--leaf-600)); min-height: 3px; transition: height .45s; }
.bars .bar-label { font-size: 10px; color: var(--text-3); letter-spacing: .04em; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
.stage-cell { text-align: center; padding: 11px 6px; border-radius: 12px; background: rgba(255, 255, 255, .4); border: 1px solid var(--glass-line-2); }
html[data-theme="dark"] .stage-cell { background: rgba(255, 255, 255, .05); }
.stage-cell b { display: block; font-family: var(--serif); font-size: 18px; font-weight: 700; }
.stage-cell span { font-size: 10px; color: var(--text-3); letter-spacing: .04em; }

/* ---------- 统计 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.kpi { border-radius: var(--radius-md); padding: 17px 18px; position: relative; overflow: hidden; }
.kpi::after {
  content: ""; position: absolute; right: -26px; top: -26px; width: 78px; height: 78px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .8), transparent 70%);
}
html[data-theme="dark"] .kpi::after { background: radial-gradient(circle, rgba(120, 195, 155, .18), transparent 70%); }
.kpi b { display: block; font-family: var(--serif); font-size: 25px; font-weight: 700; letter-spacing: -.01em; }
.kpi span { font-size: 11px; color: var(--text-3); letter-spacing: .06em; }
.kpi .kpi-trend { font-size: 11px; color: var(--accent-deep); margin-top: 2px; }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 56px; padding: 0 18px 26px; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: 20px;
  background: rgba(255, 255, 255, .38); border: 1px solid var(--glass-line-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  font-size: 11.5px; color: var(--text-3); letter-spacing: .03em;
}
html[data-theme="dark"] .footer-inner { background: rgba(255, 255, 255, .04); }
.footer-inner b { font-family: var(--serif); color: var(--text-2); margin-right: 8px; font-size: 12.5px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--accent-deep); }

/* ---------- 迷你播放器 ---------- */
.player-host { position: fixed; right: 20px; bottom: 20px; z-index: 150; }
.mini-player {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px;
  background: rgba(250, 253, 251, .85); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lg); font-size: 12.5px;
}
html[data-theme="dark"] .mini-player { background: rgba(22, 45, 36, .9); }
.mini-player .mp-word { font-family: var(--serif); font-weight: 700; }

/* ---------- 步骤 ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.step-item { display: flex; gap: 11px; }
.step-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  color: var(--accent-deep); background: rgba(255, 255, 255, .7);
  border: 1px solid var(--glass-line);
  box-shadow: 0 6px 14px -12px rgba(60, 130, 100, .9);
}
html[data-theme="dark"] .step-num { background: rgba(110, 190, 150, .16); color: #c6efd8; }
.step-title { font-size: 13.5px; font-weight: 600; }
.step-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .book-layout { grid-template-columns: minmax(0, 1fr); }
  .book-side { position: static; }
  .side-list { max-height: none; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-item { flex: 0 0 auto; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 760px) {
  .topbar { padding: 10px 12px 0; }
  .topbar-inner { flex-wrap: wrap; padding: 8px 10px; border-radius: 22px; gap: 8px; }
  .brand { order: 1; }
  .topbar-actions { order: 2; margin-left: auto; }
  .mainnav {
    order: 3; width: 100%; flex: none; gap: 4px; overflow-x: auto;
    padding-top: 2px; -webkit-overflow-scrolling: touch;
  }
  .mainnav a { padding: 5px 11px; font-size: 12.5px; background: rgba(255, 255, 255, .45); }
  html[data-theme="dark"] .mainnav a { background: rgba(255, 255, 255, .06); }
  .view { padding: 22px 13px 56px; }
  .page-title { font-size: 23px; }
  .hero { padding: 28px 22px; border-radius: 24px; }
  .hero-stats { gap: 20px; margin-top: 24px; }
  .grid-words { grid-template-columns: 1fr; }
  .shelf .book-card { flex: 0 0 208px; }
  .book-cover { aspect-ratio: 16 / 8.4; }
  .flashcard { padding: 30px 22px; min-height: 280px; border-radius: 24px; }
  .study-actions .btn { min-width: 96px; }
  .choice-result { grid-template-columns: repeat(3, 1fr); }
  .dictation-stats { grid-template-columns: repeat(2, 1fr); }
  .day-cell { height: 46px; }
  .footer-inner { padding: 16px; }
}

@media (max-width: 520px) {
  .brand-text i { display: none; }
  .user-name { display: none; }
  .page-title { font-size: 21px; }
  .hero h1 { font-size: 25px; }
  .hero-actions .btn { flex: 1; }
  .search-input { width: 100%; }
  .grid-books { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}


/* 触摸设备：放大点击热区，避免小按钮点不到 */
@media (hover: none), (pointer: coarse) {
  .mini-btn { width: 34px; height: 34px; }
  .mini-btn svg { width: 15px; height: 15px; }
  .icon-btn { width: 38px; height: 38px; }
  .user-btn { height: 38px; }
  .side-item { padding: 9px 11px; font-size: 13px; }
  .tabs button { padding: 7px 14px; }
  .day-cell { height: 50px; }
  .word-actions { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
