/* ============================================================
   设计系统
   配色思路：暖白底（长时间阅读不刺眼）+ 靛蓝主色（学习/专注）
   ============================================================ */

:root {
  /* 中性色 */
  --bg:          #faf9f7;
  --surface:     #ffffff;
  --surface-2:   #f4f2ef;
  --border:      #e8e5e0;
  --border-soft: #f0ede8;

  --ink:         #1c1a17;
  --ink-2:       #4a4640;
  --ink-3:       #86807a;
  --ink-4:       #b5afa8;

  /* 主色 */
  --brand:       #4f46e5;
  --brand-soft:  #eef2ff;
  --brand-deep:  #3730a3;

  /* 单词状态色 —— 这是本产品的核心视觉语言 */
  --w-new:       #3b82f6;   /* 新词：蓝 */
  --w-new-bg:    #dbeafe;
  --w-review:    #d97706;   /* 复习中：琥珀 */
  --w-review-bg: #fef3c7;
  --w-known:     #059669;   /* 已掌握：绿 */
  --w-known-bg:  #d1fae5;
  --w-unknown:   #dc2626;   /* 标记不会：红 */
  --w-unknown-bg:#fee2e2;

  /* 排版 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-read: "Songti SC", "SimSun", Georgia, "Noto Serif SC", serif;

  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 2px rgba(28,26,23,.04), 0 4px 16px rgba(28,26,23,.06);
  --shadow-l: 0 2px 8px rgba(28,26,23,.06), 0 12px 40px rgba(28,26,23,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============================================================
   首页
   ============================================================ */

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,249,247,.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, #7c6cf5 100%);
  display: grid; place-items: center; color: #fff; font-size: 15px;
  box-shadow: 0 2px 8px rgba(79,70,229,.28);
}
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  padding: 7px 13px; border-radius: 8px; font-size: 14px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.auth-entry { font: inherit; color: var(--ink-3); font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 9px; background: var(--brand-soft); }
.auth-entry:hover { color: var(--brand); }
.auth-modal { position: fixed; inset: 0; z-index: 500; display: none; place-items: center; padding: 18px; }
.auth-modal.open { display: grid; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(20,18,30,.48); backdrop-filter: blur(3px); }
.auth-card { position: relative; z-index: 1; width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 25px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.auth-close { position: absolute; right: 14px; top: 10px; font-size: 25px; color: var(--ink-4); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { padding: 9px; border-radius: 7px; color: var(--ink-3); font-weight: 700; }
.auth-tabs button.on { background: white; color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.auth-card form { display: grid; gap: 13px; }
.auth-card [hidden] { display: none !important; }
.auth-card label { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.auth-card input { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; font-size: 15px; outline: none; }
.auth-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-submit { width: 100%; justify-content: center; margin-top: 3px; }
.auth-submit:disabled { opacity: .6; }
#registerTurnstile:empty { display: none; }
.auth-msg { min-height: 20px; margin-top: 12px; font-size: 13px; text-align: center; }
.auth-msg.bad { color: var(--w-unknown); }.auth-msg.ok { color: var(--w-known); }
.auth-note { font-size: 11px; color: var(--ink-4); text-align: center; margin-top: 10px; }
.auth-account { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); padding: 13px; border-radius: 10px; margin-bottom: 15px; }
.auth-account span { color: var(--ink-3); font-size: 13px; }
.auth-logout { width: 100%; margin-top: 13px; padding: 9px; color: var(--ink-3); }
.btn-nav {
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 9px;
  font-size: 14px; font-weight: 600;
}

/* ---- 首屏 ---- */
.hero { padding: 74px 0 56px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-soft); color: var(--brand-deep);
  padding: 6px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 600; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 50px); line-height: 1.18;
  font-weight: 800; letter-spacing: -1.2px; margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand) 0%, #a855f7 55%, #ec4899 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  font-size: clamp(15px, 2vw, 17px); color: var(--ink-2);
  max-width: 620px; margin: 0 auto 32px; line-height: 1.75;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 11px;
  font-size: 15px; font-weight: 600; transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 10px rgba(79,70,229,.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79,70,229,.36); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }

/* ---- 卖点 ---- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin: 52px 0 0;
}
.stat {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px 20px; text-align: center;
}
.stat-num {
  font-size: 30px; font-weight: 800; letter-spacing: -1px;
  color: var(--brand); line-height: 1.2;
}
.stat-label { font-size: 13px; color: var(--ink-3); margin-top: 5px; }

/* ---- 对比 ---- */
.section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 {
  font-size: clamp(23px, 3.4vw, 31px); font-weight: 800;
  letter-spacing: -.7px; margin-bottom: 12px;
}
.section-head p { color: var(--ink-3); font-size: 15px; max-width: 560px; margin: 0 auto; }

.compare {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.compare-row {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr;
  border-bottom: 1px solid var(--border-soft);
}
.compare-row:last-child { border-bottom: none; }
.compare-row > div { padding: 15px 20px; font-size: 14px; }
.compare-head { background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.compare-row .ours { background: #f5f3ff; font-weight: 600; color: var(--brand-deep); }
.compare-row .theirs { color: var(--ink-3); }
.compare-head .ours { background: var(--brand-soft); color: var(--brand-deep); }

/* ---- 功能入口 ---- */
.entries {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px;
}
.entry {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 24px 22px 20px;
  display: flex; flex-direction: column; min-height: 190px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  position: relative; overflow: hidden;
}
.entry:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); border-color: var(--border); }
.entry-main {
  background: linear-gradient(150deg, #4f46e5 0%, #6d5ce8 50%, #8b5cf6 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 22px rgba(79,70,229,.26);
}
.entry-main:hover { box-shadow: 0 10px 36px rgba(79,70,229,.34); }
.entry-main h3, .entry-main .entry-go { color: #fff; }
.entry-main p { color: rgba(255,255,255,.85); }
.entry-off { opacity: .55; }
.entry-off:hover { transform: none; box-shadow: none; }

.entry-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.entry-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 21px;
  background: linear-gradient(135deg, var(--brand-soft), #fae8ff);
}
.entry-main .entry-icon { background: rgba(255,255,255,.2); }
.entry-tag {
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 100px;
  background: rgba(255,255,255,.22); color: #fff;
}
.entry-tag.hot { background: #fef3c7; color: #92400e; }
.entry-tag.off { background: var(--surface-2); color: var(--ink-4); }

.entry h3 { font-size: 17px; font-weight: 700; margin-bottom: 7px; letter-spacing: -.2px; }
.entry p { font-size: 13px; color: var(--ink-3); line-height: 1.6; flex: 1; }
.entry-go { font-size: 13px; font-weight: 700; color: var(--brand); margin-top: 12px; }
.entry-off .entry-go { color: var(--ink-4); }

/* ---- 为什么能记住 ---- */
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.why-item {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 24px 22px;
}
.why-num {
  font-size: 13px; font-weight: 800; color: var(--brand);
  letter-spacing: .5px; margin-bottom: 11px;
  display: inline-block; padding: 3px 9px; border-radius: 7px;
  background: var(--brand-soft);
}
.why-item h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.2px; }
.why-item p { font-size: 13.5px; color: var(--ink-3); line-height: 1.7; }

/* ---- 目录页 ---- */
.cat-list { display: flex; flex-direction: column; gap: 9px; }
.cat-item {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; gap: 15px;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.cat-item:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateX(2px); }
.cat-no {
  font-size: 13px; font-weight: 800; color: var(--ink-4);
  min-width: 34px; flex-shrink: 0;
}
.cat-body { flex: 1; min-width: 0; }
.cat-title { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.cat-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.cat-words { font-size: 12px; color: var(--ink-4); flex-shrink: 0; }

/* ---- 系列卡片 ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 26px 22px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); border-color: var(--border); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 15px;
  background: linear-gradient(135deg, var(--brand-soft), #fae8ff);
}
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.card p { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; margin-bottom: 15px; }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: 100px;
  background: var(--surface-2); color: var(--ink-2); font-weight: 600;
}
.tag-hot { background: #fff1f2; color: #be123c; }

/* ---- 书架卡片 ---- */
.book-card { display: flex; flex-direction: column; }
.book-sub {
  font-size: 12.5px; color: var(--brand); font-weight: 600;
  margin: -3px 0 9px; letter-spacing: -.1px;
}
.book-stat {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--ink-4);
  margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--border-soft);
}
.book-prog { margin-top: 11px; }
.book-prog-bar {
  height: 5px; border-radius: 100px; background: var(--surface-2); overflow: hidden;
}
.book-prog-bar i {
  display: block; height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--brand), #a855f7);
}
.book-prog span { font-size: 11.5px; color: var(--ink-4); display: block; margin-top: 6px; }

/* 书目页的书头 */
.cat-book {
  display: flex; align-items: flex-start; gap: 17px;
}
.cat-book-icon {
  width: 58px; height: 58px; border-radius: 15px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 27px;
  background: linear-gradient(135deg, var(--brand-soft), #fae8ff);
}

/* ---- 页脚 ---- */
.footer {
  border-top: 1px solid var(--border-soft); padding: 34px 0 46px;
  color: var(--ink-4); font-size: 13px; text-align: center;
}
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--brand); }

/* ============================================================
   阅读页
   ============================================================ */

.reader-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.reader-top-inner {
  max-width: 1400px; margin: 0 auto; padding: 11px 20px;
  display: flex; align-items: center; gap: 16px;
}
.back-link { font-size: 14px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.back-link:hover { color: var(--ink); }
.reader-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.reader-count b { color: var(--brand); font-weight: 700; }

/* ---- 工具条 ---- */
.toolbar {
  max-width: 1400px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.tool-group { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tool-btn {
  padding: 7px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-3); transition: all .14s; white-space: nowrap;
}
.tool-btn:hover { color: var(--ink); }
.tool-btn.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.tool-sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }
.tool-spacer { flex: 1; }

/* ---- 双栏布局：左正文 / 右单词栏 ---- */
.reader-body {
  max-width: 1400px; margin: 0 auto; padding: 26px 20px 60px;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px; align-items: start;
}

/* 左：正文 */
.passage-wrap {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 40px 44px 48px; box-shadow: var(--shadow);
}
.passage-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 26px; }
.passage {
  font-family: var(--font-read);
  font-size: 18px; line-height: 2.0; color: #26231f;
  letter-spacing: .2px;
}
.passage p { margin-bottom: 1.35em; text-indent: 2em; }
.passage p:last-child { margin-bottom: 0; }

/* 单词高亮 —— 核心视觉 */
.hl {
  font-family: var(--font-sans);
  font-weight: 700; font-size: .93em;
  padding: 2px 6px; margin: 0 1px; border-radius: 5px;
  cursor: pointer; position: relative;
  transition: transform .13s, box-shadow .13s;
  border-bottom: 2px solid transparent;
}
.hl:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.13); }

.hl-new    { background: var(--w-new-bg);    color: var(--w-new); }
.hl-review { background: var(--w-review-bg); color: var(--w-review); }
.hl-known  { background: var(--w-known-bg);  color: var(--w-known); }
.hl-unknown{ background: var(--w-unknown-bg);color: var(--w-unknown); }

/* 复现角标 */
.hl[data-nth]::after {
  content: attr(data-nth);
  position: absolute; top: -7px; right: -5px;
  font-size: 9px; font-weight: 800; line-height: 1;
  background: currentColor; color: #fff;
  border-radius: 100px; padding: 2px 4px;
  min-width: 13px; text-align: center;
}

/* 释义 */
.gloss {
  font-family: var(--font-sans); font-size: .72em; font-weight: 500;
  color: var(--ink-3); margin-left: 1px;
}
.gloss.hidden { display: none; }

/* 默写模式 */
.blank {
  display: inline-block; min-width: 78px;
  border-bottom: 2.5px solid var(--brand);
  background: var(--brand-soft);
  font-family: var(--font-sans); font-weight: 700;
  text-align: center; padding: 0 7px; border-radius: 4px 4px 0 0;
  outline: none; color: var(--brand-deep);
}
.blank:focus { background: #e0e7ff; box-shadow: 0 0 0 3px rgba(79,70,229,.16); }
.blank.ok    { border-color: var(--w-known); background: var(--w-known-bg); color: var(--w-known); }
.blank.bad   { border-color: var(--w-unknown); background: var(--w-unknown-bg); color: var(--w-unknown); }

/* 右：单词栏 */
.sidebar { position: sticky; top: 122px; }
.side-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.side-head {
  padding: 15px 17px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2);
}
.side-head h3 { font-size: 14px; font-weight: 700; }
.side-legend { display: flex; gap: 9px; font-size: 11px; color: var(--ink-3); }
.legend-dot { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot i { width: 8px; height: 8px; border-radius: 3px; display: block; }

/* 规则说明面板 */
.side-help {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 800; color: var(--ink-3);
  display: grid; place-items: center; flex-shrink: 0;
}
.side-help:hover { color: var(--brand); border-color: var(--brand); }
.side-explain {
  padding: 14px 15px; border-bottom: 1px solid var(--border-soft);
  background: #fbfaff; font-size: 12px; line-height: 1.6;
}
.ex-sec { margin-bottom: 13px; }
.ex-sec:last-child { margin-bottom: 0; }
.ex-t { font-weight: 700; color: var(--brand-deep); margin-bottom: 6px; font-size: 11.5px; }
.ex-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; color: var(--ink-2); }
.ex-row i { width: 9px; height: 9px; border-radius: 3px; display: block; flex-shrink: 0; margin-top: 5px; }
.ex-row b { color: var(--ink); flex-shrink: 0; font-weight: 700; }
.ex-row span { color: var(--ink-3); }
.ex-flow { color: var(--ink-2); line-height: 1.9; }
.ex-flow em { font-style: normal; color: var(--brand); font-weight: 700; font-size: 11px; }
.ex-flow span { color: var(--ink-4); font-size: 11px; }

.wordlist { max-height: 62vh; overflow-y: auto; padding: 7px; position: relative; scroll-behavior: smooth; }
.wordlist::-webkit-scrollbar { width: 7px; }
.wordlist::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.wordlist::-webkit-scrollbar-track { background: transparent; }

.wl-item {
  padding: 9px 11px; border-radius: var(--radius-s);
  transition: background .13s; cursor: pointer;
}
.wl-top { display: flex; align-items: center; gap: 10px; }
.wl-item:hover { background: var(--surface-2); }
.wl-item.active { background: var(--brand-soft); }

/* 释义明细：只在选中时展开，平时保持列表可扫读 */
.wl-detail {
  display: none; margin: 6px 0 3px 30px;
  padding-top: 6px; border-top: 1px dashed var(--border-soft);
}
.wl-item.active .wl-detail { display: block; }
.wl-row { display: flex; gap: 7px; font-size: 11.5px; line-height: 1.55; margin-bottom: 2px; }
.wl-k { color: var(--ink-4); flex-shrink: 0; font-weight: 600; }
.wl-v { color: var(--ink-2); }
.wl-rank {
  font-size: 11px; font-weight: 700; color: var(--ink-4);
  width: 20px; flex-shrink: 0; text-align: right;
}
.wl-main { flex: 1; min-width: 0; }
.wl-word { font-size: 14px; font-weight: 700; letter-spacing: -.1px; }
.wl-gloss {
  font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.wl-badge {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 100px;
  flex-shrink: 0;
}
.wl-badge.new    { background: var(--w-new-bg);    color: var(--w-new); }
.wl-badge.review { background: var(--w-review-bg); color: var(--w-review); }
.wl-badge.known  { background: var(--w-known-bg);  color: var(--w-known); }

.side-foot { padding: 12px 17px; border-top: 1px solid var(--border-soft); background: var(--surface-2); }
.side-foot button {
  width: 100%; padding: 10px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 13.5px; font-weight: 600;
}
.side-foot button:hover { background: var(--brand-deep); }

/* ---- 章节导航 ---- */
.chapter-nav {
  max-width: 1400px; margin: 0 auto; padding: 0 20px 70px;
  display: flex; justify-content: space-between; gap: 12px;
}
.chapter-nav a {
  flex: 1; padding: 17px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-soft);
  font-size: 14px; font-weight: 600; transition: all .15s;
}
.chapter-nav a:hover { border-color: var(--brand); color: var(--brand); }
.chapter-nav a.next { text-align: right; }
.chapter-nav a.disabled { opacity: .35; pointer-events: none; }

/* ---- 弹层 ---- */
.pop {
  position: fixed; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-l);
  padding: 15px 17px; min-width: 248px; max-width: 340px;
  animation: popIn .13s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-5px) scale(.97); } }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pop-word { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.pop-speak {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand-soft); font-size: 15px;
  display: grid; place-items: center; transition: background .13s, transform .1s;
}
.pop-speak:hover { background: #e0e7ff; }
.pop-speak:active { transform: scale(.93); }

/* 自动发音开关的激活态 */
#toggleSpeak.active { color: var(--brand); background: var(--brand-soft); }
.pop-gloss { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.pop-meta {
  font-size: 11.5px; color: var(--ink-3); margin-top: 9px;
  padding-top: 9px; border-top: 1px solid var(--border-soft);
}
.pop-sec { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-soft); }
.pop-sec-title { font-size: 11px; font-weight: 700; color: var(--ink-4); margin-bottom: 5px; letter-spacing: .3px; }
.pop-sense { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.pop-sense b { color: var(--brand-deep); font-weight: 700; }
.pop-sense span { color: var(--ink-3); }

.pop-actions { display: flex; gap: 7px; margin-top: 11px; }
.pop-act-label { font-size: 11px; font-weight: 700; color: var(--ink-4); }
.pop-levels { gap: 6px; margin-top: 7px; }

/* 三档按钮：点哪档就是哪档，系统不猜 */
.pop-levels .lv {
  flex: 1; padding: 9px 4px; border-radius: 9px;
  font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 1.5px solid transparent; transition: all .14s;
}
.pop-levels .lv i { width: 7px; height: 7px; border-radius: 50%; display: block; flex-shrink: 0; }

.pop-levels .lv.unknown { background: var(--surface-2); color: var(--ink-2); }
.pop-levels .lv.unknown i { background: var(--w-unknown); }
.pop-levels .lv.half    { background: var(--surface-2); color: var(--ink-2); }
.pop-levels .lv.half i  { background: var(--w-review); }
.pop-levels .lv.known   { background: var(--surface-2); color: var(--ink-2); }
.pop-levels .lv.known i { background: var(--w-known); }

.pop-levels .lv:hover { background: #ecebe8; }

/* 操作说明：让"点哪档会发生什么"一眼可见 */
.pop-hint {
  font-size: 11px; color: var(--ink-4); margin-top: 9px; line-height: 1.6;
  padding-top: 9px; border-top: 1px dashed var(--border-soft);
}

/* 已选中的档位 */
.pop-levels .lv.on.unknown { background: var(--w-unknown-bg); color: var(--w-unknown); border-color: #fecaca; }
.pop-levels .lv.on.half    { background: var(--w-review-bg);  color: var(--w-review);  border-color: #fde68a; }
.pop-levels .lv.on.known   { background: var(--w-known-bg);   color: var(--w-known);   border-color: #a7f3d0; }
.pop-actions button {
  flex: 1; padding: 8px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border);
}
.pop-actions button:hover { background: var(--surface-2); }
.pop-actions .danger { color: var(--w-unknown); border-color: #fecaca; }
.pop-actions .danger:hover { background: var(--w-unknown-bg); }

/* ---- 加载态 ---- */
.loading { text-align: center; padding: 100px 20px; color: var(--ink-3); }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 16px;
  border: 3px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 隐藏单词表（桌面端用） */
body.list-hidden .sidebar { display: none; }
body.list-hidden .reader-body { grid-template-columns: 1fr; }

/* 移动端底部抽屉的触发条：桌面端隐藏 */
.sheet-toggle { display: none; }
.side-head-actions { display: flex; align-items: center; gap: 8px; }
.side-close { display: none; }

/* ============================================================
   响应式 —— 主打移动端
   ============================================================ */

/* 平板 */
@media (max-width: 1024px) {
  .reader-body { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; padding: 20px 14px 50px; }
  .passage-wrap { padding: 30px 28px 36px; }
}

/* 手机：正文全宽，单词表变成底部抽屉 */
@media (max-width: 860px) {
  .reader-top-inner { padding: 9px 14px; gap: 10px; }
  .reader-title { font-size: 14px; }
  .reader-count { font-size: 12px; }

  .toolbar { padding: 9px 14px; gap: 7px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .toolbar::-webkit-scrollbar { display: none; }
  .tool-btn { padding: 8px 12px; font-size: 13px; }
  .tool-sep { display: none; }
  .tool-spacer { display: none; }

  .reader-body {
    grid-template-columns: 1fr;
    gap: 0; padding: 0 0 90px;
  }
  .passage-wrap {
    border: none; border-radius: 0; box-shadow: none;
    padding: 22px 18px 30px; background: var(--surface);
  }
  .passage-title { font-size: 20px; margin-bottom: 18px; }
  .passage { font-size: 17.5px; line-height: 2.0; }

  /* 单词表：固定在底部的抽屉 */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    z-index: 120; margin: 0;
    transform: translateY(calc(100% - 0px));
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    max-height: 40vh;
    max-height: 40dvh;
  }
  body.sheet-open .sidebar { transform: translateY(0); }
  .side-card {
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    box-shadow: 0 -6px 32px rgba(28,26,23,.18);
    max-height: 40vh; max-height: 40dvh; display: flex; flex-direction: column;
  }
  .side-head { padding: 13px 16px 11px; position: relative; }
  .side-head::before {
    content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 4px; background: var(--border);
  }
  .wordlist { max-height: none; flex: 1; overflow-y: auto; }
  .side-foot { display: none; }
  .side-close {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 34px; padding: 6px 11px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
    font-size: 13px; font-weight: 700;
  }

  /* 抽屉触发条 */
  .sheet-toggle {
    display: block; position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 119; width: 100%;
    padding: 14px; border-radius: 14px 14px 0 0;
    background: var(--ink); color: #fff;
    font-size: 14px; font-weight: 700; letter-spacing: .3px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.14);
  }
  body.sheet-open .sheet-toggle { display: none; }

  .chapter-nav { padding: 18px 14px 40px; }
  .chapter-nav a { padding: 14px 16px; font-size: 13.5px; }

  .pop { left: 12px !important; right: 12px; max-width: none; min-width: 0; width: auto; }

  .compare-row { grid-template-columns: 1fr; }
  .compare-row > div { padding: 11px 16px; }
  .compare-head { display: none; }

  .hero { padding: 46px 0 36px; }
  .section { padding: 48px 0; }
  .stats { margin-top: 34px; gap: 10px; }
  .stat { padding: 17px 14px; }
  .stat-num { font-size: 25px; }
  .cards { gap: 13px; }
  .wrap { padding: 0 16px; }
}

/* 小屏手机 */
@media (max-width: 400px) {
  .passage { font-size: 16.5px; }
  .hl { font-size: .9em; padding: 1px 4px; }
  .passage-wrap { padding: 18px 14px 26px; }
  .nb-nums { grid-template-columns: repeat(2, 1fr); }
}
