/* ============================================================
   方志优数 · 方志全文数据库 Demo
   设计系统沿用方志优数 v11: 朱砂红 / 泥金 / 墨蓝 / 米纸
   ============================================================ */

/* ---- 仿古字体 (与主站共用 assets/) ---- */
@font-face {
  font-family: 'FZ Xiaozhuan';   /* 小篆 — 最具历史感 */
  src: url('../../assets/font-zhuan.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF;
}
@font-face {
  font-family: 'Shoujin';        /* 瘦金体 */
  src: url('../../assets/font-shoujin.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF;
}
@font-face {
  font-family: 'Guli';           /* 方正古隶 */
  src: url('../../assets/font-guli.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF;
}
@font-face {
  font-family: 'Lishu';          /* 隶书 */
  src: url('../../assets/font-lishu.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF;
}
@font-face {
  font-family: 'Xingkai';        /* 华文行楷 */
  src: url('../../assets/font-xingkai.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF;
}

:root {
  --cinnabar: #C8332E;
  --cinnabar-deep: #A82822;
  --gold: #C9A961;
  --gold-soft: #D8B96B;
  --ink: #15233F;
  --ink-deep: #0D1729;
  --paper: #F5F1E8;
  --paper-2: #ECE5D2;
  --line: #E3DCC8;
  --text: #2A2A2A;
  --text-mute: #6B6B6B;

  --font-zh-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-zh-sans: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --font-en-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mark: 'Marcellus', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-zhuan: 'FZ Xiaozhuan', 'Noto Serif SC', serif;  /* 小篆, 与 logo "方"字呼应 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-zh-sans);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; }
[hidden] { display: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--cinnabar) 0%, var(--cinnabar-deep) 100%);
  color: var(--paper);
  font-weight: 700; font-size: 15px;
  padding: 13px 30px; border-radius: 6px;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 26px -12px rgba(200,51,46,0.6);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(200,51,46,0.7); }
.btn-ghost {
  border: 1px solid var(--line); color: var(--ink);
  padding: 9px 20px; border-radius: 6px; font-size: 14px; font-weight: 500;
  background: #fff; transition: all 0.3s var(--ease);
}
.btn-ghost:hover { border-color: var(--cinnabar); color: var(--cinnabar); }

/* 旧版点线水印已由 .db-decor 古舆图背景层取代 */
.page-decor { display: none; }
.app-view::before { content: none; }

.login-bg-grid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(21,35,63,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,35,63,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
}

/* ===== 古舆图背景层 (致敬海外站, 方志优数配色重绘) ===== */
.db-decor {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
/* 真实古舆图纹理 (取自海外站底图: 真实街网 + 原版古字),
   以纯色填充 + PNG 蒙版重新着色为方志优数墨色 */
.db-decor-map {
  position: absolute; inset: 0;
  background: var(--ink);
  -webkit-mask: url(../../assets/db-map.png) center / cover no-repeat;
          mask: url(../../assets/db-map.png) center / cover no-repeat;
  opacity: 0.46;
  animation: decorBreath 22s ease-in-out infinite;
}
@keyframes decorBreath {
  0%, 100% { opacity: 0.38; }
  50%      { opacity: 0.56; }
}

/* ===================== LOGIN ===================== */
.view-login {
  position: relative; min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 25%, #1a2851 0%, var(--ink) 45%, var(--ink-deep) 100%);
  overflow: hidden;
}
.view-login .login-bg-grid {
  background-image:
    linear-gradient(rgba(201,169,97,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,169,97,0.035) 1px, transparent 1px);
}
/* 古舆图纹理 — 登录页填充泥金, 叠在墨蓝之上 */
.login-map {
  position: absolute; inset: 0;
  z-index: 0; pointer-events: none;
  background: var(--gold);
  -webkit-mask: url(../../assets/db-map.png) center / cover no-repeat;
          mask: url(../../assets/db-map.png) center / cover no-repeat;
  opacity: 0.3;
  animation: decorBreathSoft 22s ease-in-out infinite;
}
@keyframes decorBreathSoft { 0%, 100% { opacity: 0.22; } 50% { opacity: 0.34; } }
/* 粒子星座网络 (复用主页 hero 动效, 适配登录页) */
.login-canvas {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; pointer-events: none;
  opacity: 0.5;   /* 整体下调路网网络的存在感 */
}
/* 小篆"志"印 — 巨大、淡雅、缓缓呼吸 */
.login-seal {
  position: absolute; top: 50%; left: 50%; z-index: 1;
  transform: translate(-50%, -52%);
  font-family: var(--font-zhuan); font-weight: 400;
  font-size: clamp(340px, 50vw, 660px); line-height: 1;
  color: rgba(201,169,97,0.07);
  pointer-events: none; user-select: none;
  animation: sealBreath 9s ease-in-out infinite;
}
@keyframes sealBreath {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -52%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -52%) scale(1.035); }
}
.login-box {
  position: relative; z-index: 2; width: 460px; max-width: 90vw;
  text-align: center;
}
.login-brand, .login-titles, .login-form { animation: loginRise 1s var(--ease) both; }
.login-titles { animation-delay: 0.12s; }
.login-form   { animation-delay: 0.24s; }
@keyframes loginRise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .login-seal, .login-map, .db-decor-map,
  .login-brand, .login-titles, .login-form { animation: none; }
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 44px; }
.login-mark { width: 96px; height: 96px; color: var(--cinnabar); }
.login-mark svg { width: 100%; height: 100%; overflow: visible; }
.login-zh {
  font-family: var(--font-zh-serif); font-weight: 700; font-size: 24px;
  color: var(--paper); letter-spacing: 0.06em;
}
.login-en {
  font-family: var(--font-mark); font-size: 11px; letter-spacing: 0.28em;
  color: var(--gold); margin-top: 8px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field {
  display: flex; align-items: center; gap: 10px;
  background: rgba(245,241,232,0.06); border: 1px solid rgba(201,169,97,0.28);
  border-radius: 8px; padding: 0 16px; transition: border-color 0.3s var(--ease);
}
.login-field:focus-within { border-color: var(--gold); }
.login-ico { font-size: 12px; color: var(--gold); flex-shrink: 0; }
.login-field input {
  flex: 1; background: none; border: none; outline: none;
  padding: 15px 0; color: var(--paper); font-size: 15px; font-family: var(--font-zh-sans);
}
.login-field input::placeholder { color: rgba(245,241,232,0.4); }
.login-submit { margin-top: 12px; width: 100%; padding: 15px; font-size: 16px; }
.login-tip { color: rgba(245,241,232,0.45); font-size: 12px; margin-top: 10px; }

/* ===================== APP SHELL ===================== */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,23,41,0.92);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(201,169,97,0.16);
}
.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 14px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; color: var(--cinnabar); flex-shrink: 0; }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-text { display: flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1; }
.brand-zh { font-family: var(--font-zh-sans); font-weight: 900; font-size: 22px; color: var(--paper); letter-spacing: 0.06em; }
.brand-en { font-family: var(--font-mark); font-size: 8px; letter-spacing: 0.18em; color: var(--gold); white-space: nowrap; }
.nav-links { display: flex; gap: 34px; font-size: 15px; font-weight: 500; color: rgba(245,241,232,0.72); }
.nav-links a { position: relative; padding: 4px 0; transition: color 0.3s var(--ease); }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 1.5px; background: var(--gold); transition: width 0.35s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--paper); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }

.nav-actions { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid rgba(201,169,97,0.32); color: rgba(245,241,232,0.85);
  font-size: 13px; transition: border-color 0.3s var(--ease);
}
.user-chip:hover { border-color: var(--gold); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-deep));
  color: var(--paper); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-zh-serif);
}
.user-menu {
  position: absolute; right: 0; top: 46px; width: 180px;
  background: var(--paper); border-radius: 10px; overflow: hidden;
  box-shadow: 0 24px 48px -16px rgba(13,23,41,0.4); border: 1px solid var(--line);
}
.user-menu-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.user-menu-head strong { font-family: var(--font-zh-serif); font-size: 15px; color: var(--ink); }
.user-menu-head span { font-size: 11px; color: var(--text-mute); font-family: var(--font-mono); }
.user-menu a { display: block; padding: 11px 16px; font-size: 14px; color: var(--text); transition: background 0.2s; }
.user-menu a:hover { background: var(--paper-2); }
.user-menu a#logout-btn { color: var(--cinnabar); border-top: 1px solid var(--line); }

.app-main { flex: 1; position: relative; }
.app-view { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 56px 40px 80px; min-height: 70vh; }

/* ===================== SEARCH HOME ===================== */
.search-hero { position: relative; z-index: 1; text-align: center; }
.db-title {
  font-family: var(--font-zh-serif); font-weight: 700;
  font-size: clamp(30px, 4vw, 50px); color: var(--cinnabar);
  letter-spacing: 0.08em;
}
.db-title.accent { background: linear-gradient(180deg, var(--cinnabar), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.db-title-en {
  font-family: var(--font-en-serif); font-style: italic; font-size: clamp(15px, 1.6vw, 22px);
  color: var(--text-mute); margin-top: 8px; margin-bottom: 44px;
}

.mode-tabs { display: flex; justify-content: center; gap: 14px; margin-bottom: 32px; flex-wrap: wrap; }
.mode-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 26px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  transition: all 0.3s var(--ease);
}
.mode-tab:hover { border-color: var(--gold); transform: translateY(-2px); }
.mode-tab.active { border-color: var(--cinnabar); background: linear-gradient(135deg, #fff 0%, #FBF6EC 100%); box-shadow: 0 12px 30px -14px rgba(200,51,46,0.4); }
.mode-ico {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-deep));
  color: var(--paper); font-family: var(--font-zh-serif); font-weight: 900;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(200,51,46,0.5);
}
.mode-tab:not(.active) .mode-ico { background: var(--paper-2); color: var(--text-mute); box-shadow: none; }
.mode-label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mode-label b { font-size: 16px; font-weight: 700; color: var(--ink); }
.mode-tab:not(.active) .mode-label b { color: var(--text-mute); }
.mode-label i { font-style: normal; font-size: 11px; color: var(--text-mute); font-family: var(--font-en-serif); }

.search-panel { max-width: 900px; margin: 0 auto; }
.qa-toggle { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.qa-btn { padding: 7px 22px; border-radius: 999px; font-size: 13px; color: var(--text-mute); transition: all 0.25s var(--ease); }
.qa-btn.active { background: #fff; color: var(--cinnabar); font-weight: 700; box-shadow: 0 2px 8px -2px rgba(0,0,0,0.12); }

.search-bar {
  display: flex; align-items: center; gap: 12px;
  background: #FBF6EC; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 8px 8px 22px; transition: border-color 0.3s var(--ease);
}
.search-bar:focus-within { border-color: var(--cinnabar); }
.search-bar-ico { color: var(--cinnabar); font-size: 20px; }
.search-bar input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 17px; padding: 14px 0; color: var(--text); font-family: var(--font-zh-sans);
}
.search-go { white-space: nowrap; }
.hot-row { margin-top: 14px; font-size: 13px; color: var(--text-mute); text-align: left; padding-left: 4px; }
.hot-row span b { color: var(--cinnabar); cursor: pointer; margin-right: 14px; font-weight: 500; }
.hot-row span b:hover { text-decoration: underline; }

.adv-filters { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 20px; }
.adv-field { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; }
.adv-field label { font-size: 13px; color: var(--cinnabar); font-weight: 700; flex-shrink: 0; }
.adv-field select, .adv-field input { flex: 1; border: none; outline: none; background: none; padding: 12px 0; font-size: 14px; font-family: var(--font-zh-sans); color: var(--text); }

/* browse */
.browse-tip { color: var(--text-mute); font-size: 14px; margin-bottom: 24px; }
.province-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.province-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 16px; text-align: center; transition: all 0.3s var(--ease);
}
.province-card:hover { border-color: var(--cinnabar); transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(200,51,46,0.35); }
.province-card .pv-name { font-family: var(--font-zh-serif); font-weight: 700; font-size: 17px; color: var(--ink); }
.province-card .pv-count { font-family: var(--font-mono); font-size: 13px; color: var(--cinnabar); margin-top: 6px; }
.province-card .pv-count b { font-size: 20px; }

/* ===================== RESULTS ===================== */
.results-head {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}
.back-link { color: var(--text-mute); font-size: 14px; transition: color 0.2s; }
.back-link:hover { color: var(--cinnabar); }
.results-head h2 { font-family: var(--font-zh-serif); font-size: 24px; font-weight: 700; color: var(--ink); flex: 1; }
.results-head h2 small { font-weight: 400; font-size: 15px; color: var(--text-mute); margin-left: 12px; }
.hl { color: var(--cinnabar); }

.results-table { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; }
.r-row {
  display: grid; grid-template-columns: 150px 1fr 88px 96px 96px 70px 44px;
  gap: 18px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid transparent;
  border-radius: 8px; padding: 20px 22px;
  transition: all 0.3s var(--ease);
}
.r-row:hover { border-left-color: var(--cinnabar); transform: translateX(2px); box-shadow: 0 16px 36px -22px rgba(13,23,41,0.25); }
.r-name { font-family: var(--font-zh-serif); font-weight: 700; font-size: 17px; color: var(--ink); }
.r-meta { font-size: 12.5px; color: var(--text-mute); line-height: 1.8; }
.r-meta b { color: var(--cinnabar); font-weight: 500; margin-right: 4px; }
.r-cell { font-size: 13px; color: var(--text); }
.r-cell.thin { color: var(--text-mute); }
.r-snippet { font-size: 13.5px; color: #4A4A4A; line-height: 1.75; grid-column: 2 / 7; margin-top: 2px; }
.r-snippet em { font-style: normal; background: var(--cinnabar); color: #fff; padding: 1px 6px; border-radius: 3px; font-size: 12.5px; }
.r-actions { display: flex; flex-direction: column; gap: 8px; }
.r-act {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-size: 13px; transition: all 0.25s var(--ease); background: #fff;
}
.r-act:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.r-grid-head {
  display: grid; grid-template-columns: 150px 1fr 88px 96px 96px 70px 44px;
  gap: 18px; padding: 0 22px 6px; font-size: 12px; color: var(--text-mute);
  letter-spacing: 0.1em; text-transform: uppercase;
}
/* 方志浏览行: 6 列(去掉页码), 操作=全文浏览 */
.r-row.browse-row, .r-grid-head.browse-head { grid-template-columns: 150px 1fr 88px 96px 96px 110px; }
.btn-read { padding: 8px 16px; border-radius: 7px; border: 1px solid var(--cinnabar); color: var(--cinnabar); background: #fff; font-size: 13px; white-space: nowrap; cursor: pointer; transition: all .25s var(--ease); }
.btn-read:hover { background: var(--cinnabar); color: #fff; }

.pager { position: relative; z-index: 1; display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.pager button {
  min-width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 14px; transition: all 0.2s;
}
.pager button:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.pager button.active { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }

.empty { text-align: center; padding: 80px 0; color: var(--text-mute); position: relative; z-index: 1; }

/* data table (table search / meta) */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; font-size: 13.5px; }
.data-table th { background: var(--ink); color: var(--paper); padding: 12px 16px; text-align: left; font-weight: 500; font-size: 13px; }
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FBF6EC; }
/* 后端返回的原始 HTML 表格 (table/search 真实数据) */
.raw-table { overflow-x: auto; }
.raw-table table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.raw-table td, .raw-table th { border: 1px solid var(--line); padding: 8px 12px; color: var(--text); text-align: center; vertical-align: middle; }
.raw-table tr:first-child td, .raw-table th { background: #FBF6EC; font-weight: 500; }
/* 非 HTML 的富文本/纯文本表格内容兜底 */
.raw-text { white-space: pre-wrap; word-break: break-word; font: 13px/1.7 var(--font-sans, sans-serif); color: var(--text); background: #fff; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; margin: 0; }
.raw-empty { color: var(--muted, #999); font-size: 13px; padding: 12px; }
/* 表格扫描原图 (OCR 不规整时展示权威原表) + 折叠的 OCR 文本 */
.raw-img-wrap { text-align: center; margin: 2px 0; }
.raw-img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.35); }
.raw-ocr { margin-top: 12px; font-size: 12.5px; color: var(--muted, #8a7c5e); }
.raw-ocr summary { cursor: pointer; user-select: none; padding: 4px 0; }
.raw-ocr[open] summary { margin-bottom: 6px; }
.raw-ocr .raw-text { max-height: 240px; overflow: auto; background: #faf7ef; font-size: 12.5px; padding: 10px 12px; }
/* KaTeX 渲染的 LaTeX 表格 */
.latex-cell { overflow-x: auto; padding: 6px 2px; color: var(--text); }
.latex-cell .katex-display { margin: 0; text-align: left; }
.latex-cell .katex { font-size: 1.02em; white-space: normal; text-align: left; }
/* 方志浏览 — 章节目录 (预览弹窗) */
.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.chapter-list li:last-child { border-bottom: none; }
.chapter-list .ch-title { color: var(--text); }
.chapter-list .ch-page { color: var(--muted, #999); font-size: 13px; white-space: nowrap; }
/* ===== 方志阅读器: 左目录 + 右扫描页 (仿翻开的纸质书) ===== */
.reader-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(20,18,28,.72); display: flex; align-items: center; justify-content: center; padding: 1.6vh 1.6vw; }
.reader-overlay[hidden] { display: none; }
.reader-frame { width: 100%; max-width: 1840px; height: 96vh; background: var(--paper, #FBF6EC); border-radius: 12px; box-shadow: 0 24px 80px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; }
/* 打开阅读器时的入场动效: 背景渐入 + 书本轻轻升起 */
@keyframes readerFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes readerRiseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reader-overlay:not([hidden]) { animation: readerFadeIn .26s ease both; }
.reader-overlay:not([hidden]) .reader-frame { animation: readerRiseIn .46s cubic-bezier(.2,.72,.28,1) both; }
.reader-head { display: flex; align-items: baseline; gap: 14px; padding: 15px 22px; border-bottom: 1px solid var(--line); background: var(--ink, #1a1730); }
.reader-title { font-family: var(--font-serif, serif); font-size: 19px; font-weight: 700; color: #E9C97A; }
.reader-sub { font-size: 12.5px; color: rgba(255,255,255,.6); flex: 1; }
.reader-head .modal-close { color: rgba(255,255,255,.85); margin-left: auto; }
.reader-cols { flex: 1; display: flex; min-height: 0; }
.reader-toc { width: 270px; flex-shrink: 0; border-right: 1px solid var(--line); overflow-y: auto; background: #F3ECDB; padding: 10px 0; }
.reader-toc-h { font-family: var(--font-serif, serif); font-size: 14px; font-weight: 700; color: #9a2828; padding: 8px 20px 12px; letter-spacing: 2px; }
.reader-toc-list { list-style: none; margin: 0; padding: 0; }
.reader-toc-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 20px; cursor: pointer; font-size: 13.5px; color: var(--text); border-left: 3px solid transparent; transition: background .15s; }
.reader-toc-item:hover { background: #EBE1CB; }
.reader-toc-item.active { background: #fff; border-left-color: #9a2828; color: #9a2828; font-weight: 600; }
.reader-toc-item .rt-page { color: var(--muted, #b09a6a); font-size: 12px; flex-shrink: 0; }
.reader-toc-empty { padding: 14px 20px; color: var(--muted, #999); font-size: 13px; }
/* 拟物化书桌 + 翻开的书 */
/* 书桌: 暖色木纹 + 四周渐隐, 让书页落在一张真实的桌面上 */
.reader-stage { flex: 1; display: flex; flex-direction: column; min-width: 0;
  background:
    radial-gradient(140% 120% at 50% -18%, rgba(158,128,82,.18), transparent 52%),
    radial-gradient(130% 135% at 50% 120%, rgba(0,0,0,.5), transparent 60%),
    repeating-linear-gradient(91deg, rgba(0,0,0,.05) 0 3px, rgba(255,255,255,.014) 3px 7px),
    linear-gradient(163deg, #433829 0%, #2d2518 56%, #201a10 100%); }
#reader-page { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 20px; perspective: 2800px; container-type: size;
  box-shadow: inset 0 0 100px 26px rgba(0,0,0,.42); }
/* 书本: 等比放大并四周留出书桌; --book-ar = 2×单页宽高比 */
.book { position: relative; display: flex; align-items: stretch; border-radius: 3px;
  box-shadow: 0 3px 9px rgba(0,0,0,.4), 0 22px 48px rgba(0,0,0,.5);
  transform-style: preserve-3d; aspect-ratio: var(--book-ar, 1.2222);
  width: min(100cqw, calc(92cqh * var(--book-ar, 1.2222))); height: auto; }
/* 纸块厚度: 露在书页四周的书口, 细密纸纹 */
.book::after { content: ''; position: absolute; z-index: -1; top: -3px; bottom: -7px; left: -14px; right: -14px; border-radius: 5px;
  background:
    repeating-linear-gradient(90deg, #e9dcbd 0 1px, #d0bd92 1px 2.5px),
    linear-gradient(180deg, #e4d6b2, #c8b682);
  box-shadow: 0 7px 16px rgba(0,0,0,.32); }
/* 书脊: 中缝凹陷阴影 (两页向内卷入装订处) */
.book::before { content: ''; position: absolute; z-index: 4; left: 50%; top: 0; bottom: 0; width: 50px; transform: translateX(-25px); pointer-events: none;
  background: linear-gradient(90deg, rgba(34,21,6,0) 0%, rgba(34,21,6,.14) 24%, rgba(20,12,2,.52) 50%, rgba(34,21,6,.14) 76%, rgba(34,21,6,0) 100%); }
.book-page { position: relative; background: #fdfbf3; overflow: hidden; width: 50%; height: 100%; }
.book-page .bp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
/* 书页弯曲明暗 (盖在扫描图上): 书脊侧渐暗, 书口侧微亮 */
.book-page::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.book-page-l { border-radius: 3px 0 0 3px; }
.book-page-r { border-radius: 0 3px 3px 0; }
.book-page-l::after { background: linear-gradient(90deg, rgba(255,253,247,.12), transparent 9% 74%, rgba(46,30,11,.22)); }
.book-page-r::after { background: linear-gradient(270deg, rgba(255,253,247,.12), transparent 9% 74%, rgba(46,30,11,.22)); }
.book-page-blank { width: 50%; height: 100%; background: #efe7d4; }
.book-page-blank::after { background: none; }
.bp-no { position: absolute; bottom: 8px; z-index: 3; font-size: 11px; color: #b1a079; }
.book-page-l .bp-no { right: 16px; } .book-page-r .bp-no { left: 16px; }
.bp-ph { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #cbb88f; font-size: 34px; }
.bp-ph span { font-size: 15px; color: #8a7c5e; }
/* 3D 翻页 (卷曲明暗 + 自然节奏) */
.flip-sheet { position: absolute; top: 0; height: 100%; width: 50%; transform-style: preserve-3d; z-index: 6; will-change: transform; }
.flip-sheet.flip-next { right: 0; transform-origin: left center; transform: rotateY(0deg); }
.flip-sheet.flip-prev { left: 0; transform-origin: right center; transform: rotateY(0deg); }
.flip-sheet.flip-next.go { animation: flipNext .92s cubic-bezier(.34,.05,.28,1) forwards; }
.flip-sheet.flip-prev.go { animation: flipPrev .92s cubic-bezier(.34,.05,.28,1) forwards; }
@keyframes flipNext { from { transform: rotateY(0deg); } to { transform: rotateY(-180deg); } }
@keyframes flipPrev { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; overflow: hidden; background: #fdfbf3; box-shadow: 0 0 26px rgba(0,0,0,.2); }
.flip-face img { display: block; width: 100%; height: 100%; object-fit: fill; }
.flip-back { transform: rotateY(180deg); }
.flip-next .flip-face { border-radius: 0 7px 7px 0; }
.flip-prev .flip-face { border-radius: 7px 0 0 7px; }
/* 卷曲光影: 书脊侧渐暗, 翻到中段最强, 营造纸张弯卷 */
.flip-gloss { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.flip-next .flip-front .flip-gloss { background: linear-gradient(90deg, rgba(28,19,5,.52), rgba(28,19,5,0) 52%); }
.flip-next .flip-back  .flip-gloss { background: linear-gradient(90deg, rgba(28,19,5,0) 48%, rgba(28,19,5,.5)); }
.flip-prev .flip-front .flip-gloss { background: linear-gradient(270deg, rgba(28,19,5,.52), rgba(28,19,5,0) 52%); }
.flip-prev .flip-back  .flip-gloss { background: linear-gradient(270deg, rgba(28,19,5,0) 48%, rgba(28,19,5,.5)); }
.flip-sheet.go .flip-gloss { animation: glossPulse .92s ease forwards; }
@keyframes glossPulse { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: .1; } }
/* 翻页时书脊投影加深 */
.book.flipping::before { opacity: 1; filter: brightness(.6); }
.reader-nav { position: relative; display: flex; align-items: center; justify-content: center; gap: 20px; padding: 13px; border-top: 1px solid var(--line); background: #F3ECDB; }
.reader-pageinfo { font-size: 13px; color: var(--text); min-width: 110px; text-align: center; }
.reader-nav button[disabled] { opacity: .4; cursor: not-allowed; }
/* 工具按钮 (单页 / 放大镜): 固定在导航左侧, 不影响中间翻页控件居中 */
.reader-tools { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.reader-tool { font-size: 12.5px; padding: 5px 11px; }
.reader-tool.active { background: #9a2828; color: #fff; border-color: #9a2828; }
/* 单页大字模式: 一页按原图分辨率铺满宽度 (≈双页时单页的 2×), 纵向滚动阅读 */
.reader-overlay.single-mode #reader-page { align-items: flex-start; overflow-y: auto; overflow-x: hidden; }
.book-single::before, .book-single::after { display: none; }
.book-page-solo { width: 100%; height: 100%; border-radius: 4px; box-shadow: 0 0 0 1px rgba(60,40,15,.12); }
/* 放大镜 (横条 loupe): 跟随鼠标, 从原图取样, 显示当前行及上下若干行 */
#reader-loupe { position: fixed; z-index: 2100; pointer-events: none; display: none; border-radius: 8px; background-repeat: no-repeat; background-color: #fdfbf3; box-shadow: 0 10px 34px rgba(0,0,0,.5), 0 0 0 2px rgba(233,201,122,.95), 0 0 0 5px rgba(20,16,8,.35); }
.reader-overlay.loupe-on .book-page, .reader-overlay.loupe-on .bp-img { cursor: zoom-in; }
@media (max-width: 720px) { .reader-toc { width: 140px; } .reader-frame { height: 94vh; } }
.tbl-card { position: relative; z-index: 1; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.tbl-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.tbl-card-title { font-family: var(--font-zh-serif); font-weight: 700; font-size: 17px; color: var(--ink); }
.tbl-card-src { font-size: 12.5px; color: var(--text-mute); }
.tbl-card-src b { color: var(--cinnabar); }

/* about / meta */
.about-wrap, .meta-wrap { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; text-align: center; }
.about-body { margin-top: 40px; text-align: left; }
.about-body p { font-family: var(--font-zh-serif); font-size: 17px; line-height: 1.95; color: #3A3A3A; margin-bottom: 20px; }
.about-body p b { color: var(--cinnabar); }
.about-by { text-align: center; color: var(--text-mute); font-size: 14px; margin-top: 30px; letter-spacing: 0.1em; }
.meta-sub { font-size: 16px; color: var(--text-mute); line-height: 1.8; margin: 18px auto 36px; max-width: 640px; }
.meta-demo { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; text-align: left; margin-bottom: 32px; }
.meta-q { font-family: var(--font-zh-serif); font-size: 16px; color: var(--ink); padding: 14px 18px; background: var(--paper-2); border-radius: 8px; border-left: 3px solid var(--cinnabar); }
.meta-a { margin-top: 20px; }
.meta-a-tag { display: inline-block; font-size: 12px; color: var(--cinnabar); font-weight: 700; margin-bottom: 12px; letter-spacing: 0.06em; }
.meta-cite { font-size: 12px; color: var(--text-mute); margin-top: 12px; }

/* ===================== MODAL ===================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13,23,41,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.modal-card {
  width: 720px; max-width: 92vw; max-height: 84vh; background: var(--paper);
  border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(13,23,41,0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--line); }
.modal-head span { font-family: var(--font-zh-serif); font-weight: 700; font-size: 18px; color: var(--cinnabar); }
.modal-close { font-size: 26px; color: var(--text-mute); width: 34px; height: 34px; border-radius: 50%; transition: all 0.2s; }
.modal-close:hover { background: var(--paper-2); color: var(--cinnabar); }
.modal-body { padding: 28px 30px; overflow-y: auto; font-family: var(--font-zh-serif); font-size: 16px; line-height: 2.05; color: #333; white-space: pre-wrap; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; border-top: 1px solid var(--line); }
.modal-meta { font-size: 13px; color: var(--text-mute); }

/* footer */
.app-footer {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 28px 40px; background: var(--ink-deep); color: rgba(245,241,232,0.55);
  font-size: 13px;
}
.footer-mark { width: 32px; height: 32px; color: var(--cinnabar); }
.footer-mark svg { width: 100%; height: 100%; overflow: visible; }

/* toast */
.toast {
  position: fixed; top: 88px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 26px;
  border-radius: 999px; font-size: 14px; z-index: 200;
  box-shadow: 0 16px 36px -12px rgba(13,23,41,0.5);
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 全局加载进度条 (顶部细线, 不确定型来回滑动) */
#net-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent, #9a2828) 40%, #e0a73a 60%, transparent);
  background-size: 42% 100%; background-repeat: no-repeat;
  animation: netBar 1.05s linear infinite; }
#net-bar[hidden] { display: none; }
@keyframes netBar { 0% { background-position: -42% 0; } 100% { background-position: 142% 0; } }
/* 结果页关键词整体换行, 不在词中间断开 */
#result-kw { white-space: nowrap; }

/* responsive */
@media (max-width: 920px) {
  .nav-inner { padding: 12px 20px; }
  .app-view { padding: 36px 20px 60px; }
  .nav-links { display: none; }
  .province-grid { grid-template-columns: repeat(2, 1fr); }
  .adv-filters { grid-template-columns: 1fr; }
  .r-row, .r-grid-head { grid-template-columns: 1fr; gap: 8px; }
  .r-grid-head { display: none; }
  .r-snippet { grid-column: 1; }
  .mode-tabs { flex-direction: column; }
}

/* ==================== 我的账户 / My Profile ==================== */
.profile-wrap { max-width: 920px; margin: 0 auto; position: relative; z-index: 1; }
.profile-top { margin-bottom: 20px; }
.profile-top .back-link { margin-bottom: 12px; }
.profile-top .db-title { font-size: 34px; margin: 0; }
.profile-top .db-title-en { margin: 2px 0 0; }
.profile-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.ptab { background: none; border: none; padding: 12px 20px; font-size: 15px; color: var(--muted, #8a7c5e); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--accent, #9a2828); border-bottom-color: var(--accent, #9a2828); font-weight: 600; }
.ppane { display: flex; flex-direction: column; gap: 22px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: 0 8px 24px -18px rgba(0,0,0,.25); }
.pcard-h { margin: 0 0 16px; font-size: 16px; font-weight: 600; color: var(--text); font-family: var(--font-serif, serif); }
.pcard-sub { font-size: 12.5px; color: var(--muted, #999); font-weight: 400; margin-left: 6px; }
.pload, .pempty { color: var(--muted, #999); font-size: 13.5px; padding: 16px 0; text-align: center; }
.pinfo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.pinfo-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.pinfo-k { font-size: 12.5px; color: var(--muted, #8a7c5e); }
.pinfo-v { font-size: 15px; color: var(--text); word-break: break-all; }
.pbadge { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--accent, #9a2828); color: #fff; font-size: 13px; }
.ptable-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ptable td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; white-space: nowrap; }
.ptable .pth td { background: #FBF6EC; color: var(--muted, #8a7c5e); font-weight: 500; font-size: 12.5px; }
.ptable tr:last-child td { border-bottom: none; }
.pmono { font-family: var(--font-mono, monospace); font-size: 12.5px; }
.postatus { display: inline-block; padding: 2px 10px; border-radius: 6px; background: #eef3ea; color: #3a7a3a; font-size: 12.5px; }
.pform { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.pfield { display: flex; flex-direction: column; gap: 6px; }
.pfield span { font-size: 12.5px; color: var(--muted, #8a7c5e); }
.pfield input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fdfbf5; }
.pfield input:focus { outline: none; border-color: var(--accent, #9a2828); }
.pform .btn-primary { align-self: flex-start; margin-top: 4px; }
.psub-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.psub-name { font-size: 20px; font-weight: 700; color: var(--text); font-family: var(--font-serif, serif); }
.psub-meta { font-size: 13px; color: var(--muted, #8a7c5e); margin-top: 4px; }
.psub-price { font-size: 22px; font-weight: 700; color: var(--accent, #9a2828); white-space: nowrap; }
.psub-per { font-size: 13px; color: var(--muted, #999); font-weight: 400; }
.psub-desc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text); }
.psub-desc p, .plan-title p, .plan-desc p { margin: 3px 0; }
.pmanage-btn { margin-top: 18px; }
.pquota-list { display: flex; flex-direction: column; gap: 18px; }
.pquota-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pquota-label { font-size: 14px; color: var(--text); }
.pquota-num { font-size: 12.5px; color: var(--muted, #8a7c5e); }
.pquota-bar { height: 8px; background: #efe7d4; border-radius: 999px; overflow: hidden; }
.pquota-fill { height: 100%; background: linear-gradient(90deg, var(--accent, #9a2828), #e0a73a); border-radius: 999px; transition: width .5s ease; }
.pquota-rem { font-size: 12px; color: var(--muted, #999); margin-top: 4px; }
.plans-card { max-width: 780px; width: 92vw; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #fdfbf5; }
.plan-name { font-size: 18px; font-weight: 700; color: var(--text); font-family: var(--font-serif, serif); }
.plan-title { font-size: 12.5px; color: var(--muted, #8a7c5e); }
.plan-price { font-size: 24px; font-weight: 700; color: var(--accent, #9a2828); margin: 12px 0; }
.plan-per { font-size: 13px; color: var(--muted, #999); font-weight: 400; }
.plan-desc { font-size: 12.5px; color: var(--text); line-height: 1.7; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 720px) { .pinfo-grid { grid-template-columns: 1fr; } .profile-top .db-title { font-size: 26px; } }

/* ---- Profile 设计迭代 v2 (对比度/留白/CTA/进度条/权益✓) ---- */
.pinfo-k, .pfield span, .pcard-sub, .pquota-num, .psub-meta, .plan-title, .ptable .pth td, .ptab { color: #6f6144; }
.ptab.active { color: var(--accent, #9a2828); }
.pinfo-item { border-bottom: 1px solid #f1eadd; }
.pinfo-grid { gap: 4px 40px; }
.ptable td.pempty { text-align: center; }
.pfield input:focus { box-shadow: 0 0 0 3px rgba(154,40,40,.08); }
/* 修改密码: 左表单 + 右安全提示 */
.pform { max-width: none; }
.pwd-wrap { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 36px; align-items: start; }
.pwd-hint { background: #faf6ec; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.pwd-hint-h { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.pwd-hint ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.pwd-hint li { font-size: 12.5px; color: #6f6144; padding-left: 16px; position: relative; line-height: 1.5; }
.pwd-hint li::before { content: "·"; position: absolute; left: 4px; color: var(--accent, #9a2828); font-weight: 700; }
/* 管理订阅: 朱红描边 CTA */
.pmanage-btn { border: 1.5px solid var(--accent, #9a2828); color: var(--accent, #9a2828); background: transparent; font-weight: 600; }
.pmanage-btn:hover { background: var(--accent, #9a2828); color: #fff; }
/* 权益列表 → ✓ */
.psub-desc p, .plan-desc p { margin: 7px 0; font-size: 13px; color: var(--text); padding-left: 22px; position: relative; line-height: 1.5; }
.psub-desc p::before, .plan-desc p::before { content: "✓"; position: absolute; left: 3px; top: 0; color: var(--accent, #9a2828); font-weight: 700; font-size: 12px; }
.plan-title p { padding-left: 0; margin: 2px 0; }
.plan-title p::before { content: none; }
/* 进度条: 轨道更明显 */
.pquota-bar { height: 9px; background: #ece2ce; box-shadow: inset 0 0 0 1px #e2d6bd; }
/* 方案卡片: 按内容高度, 不拉伸; 重置 modal-body 继承来的 pre-wrap(否则源码换行会被渲染成空行撑高) */
.plans-grid { align-items: start; white-space: normal; }
.plan-price { margin: 14px 0; }
@media (max-width: 720px) { .pwd-wrap { grid-template-columns: 1fr; } }

/* ---- 方案弹窗: 三方案平行展示 + 订阅按钮 (2026-07-02) ---- */
.plans-card { max-width: 1040px; }
.plans-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.plan-card { display: flex; flex-direction: column; }
.plan-desc { flex: 1; }
.plan-action { margin-top: 16px; }
.plan-sub { width: 100%; justify-content: center; text-align: center; }
.plan-contact { display: block; width: 100%; text-align: center; }
.plan-note { text-align: center; font-size: 12.5px; color: #8a7c5e; padding: 9px; background: #f5efe2; border-radius: 8px; }
.plan-custom { font-size: 22px; font-weight: 700; color: var(--text); }
@media (max-width: 860px) { .plans-grid { grid-template-columns: 1fr; } .plans-card { max-width: 460px; } }

/* ===== 阅读器书页操作条 (居中悬浮: 下载本页 / 加入书签) + 我的书签弹窗 (20260702b) ===== */
.reader-stage { position: relative; }   /* 悬浮操作条以书页区为锚, 单页滚动时不随内容滚走 */
.reader-pageacts { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 7;
  display: flex; gap: 6px; padding: 5px; border-radius: 999px;
  background: rgba(30,22,10,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 5px 20px rgba(0,0,0,.42), inset 0 0 0 1px rgba(233,201,122,.30);
  opacity: .88; transition: opacity .18s; }
.reader-stage:hover .reader-pageacts { opacity: 1; }
.reader-pageact { display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; line-height: 1; color: #f3e8c9; background: transparent;
  border: 0; border-radius: 999px; padding: 7px 13px; transition: background .15s, color .15s, transform .08s; }
.reader-pageact:hover { background: rgba(233,201,122,.20); color: #fff; }
.reader-pageact:active { transform: translateY(1px); }
.reader-pageact.done { color: #ffe6a3; }
.reader-pageact[disabled] { opacity: .45; cursor: default; }
@media (max-width: 720px) { .reader-pageact span { display: none; } .reader-pageact { padding: 7px 10px; font-size: 15px; } }

/* 我的书签弹窗 */
.fav-card { max-width: 640px; width: 92vw; }
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-item { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .08s; }
.fav-item:hover { border-color: #9a2828; box-shadow: 0 4px 14px rgba(154,40,40,.10); }
.fav-item:active { transform: translateY(1px); }
.fav-ico { flex-shrink: 0; font-size: 20px; }
.fav-main { flex: 1; min-width: 0; }
.fav-name { font-family: var(--font-serif, serif); font-size: 15.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-meta { font-size: 12.5px; color: var(--muted, #8a7c5e); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.fav-meta .fav-page { color: #9a2828; font-weight: 600; }
.fav-open { flex-shrink: 0; font-size: 12.5px; color: #9a2828; white-space: nowrap; }
.fav-del { flex-shrink: 0; border: 0; background: transparent; color: var(--muted, #b09a6a); font-size: 18px; cursor: pointer; padding: 4px 9px; border-radius: 7px; line-height: 1; }
.fav-del:hover { background: #fbeaea; color: #9a2828; }
.fav-empty { padding: 40px 12px; text-align: center; color: var(--muted, #999); font-size: 14px; }
.fav-empty .fav-empty-ico { font-size: 32px; display: block; margin-bottom: 10px; opacity: .5; }

/* 登录页 · 注册表单 (登录/注册切换 + 同意条款) 20260703a */
#register-form { gap: 13px; }
.login-alt { display: block; width: 100%; margin-top: 2px; padding: 6px; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; color: rgba(245,241,232,0.5); text-align: center; }
.login-alt b { color: var(--gold); font-weight: 600; }
.login-alt:hover b { text-decoration: underline; }
.login-agree { display: flex; align-items: flex-start; gap: 9px; margin-top: 2px; cursor: pointer;
  font-size: 12.5px; line-height: 1.5; color: rgba(245,241,232,0.6); }
.login-agree input { margin-top: 2px; accent-color: var(--gold); flex-shrink: 0; width: 15px; height: 15px; }
.login-agree b { color: rgba(245,241,232,0.85); font-weight: 600; }
/* 注册表单比登录高: 内容超出视口时可纵向滚动(不再被裁掉底部/顶部), 适配时仍居中 */
.view-login { overflow-x: hidden; overflow-y: auto; }
.login-box { margin: auto; padding-block: 28px; }
