/* ==========================================================================
   精品小说网 jpxs.net — 全局样式表
   设计基调：纸感暖白 + 朱砂红点缀 + 衬线正文，东方书卷气与现代排版结合
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 亮色主题 */
  --bg: #faf8f4;
  --bg-elev: #ffffff;
  --bg-soft: #f4f0e8;
  --bg-sunken: #eeeadf;
  --text: #241f1a;
  --text-2: #6b6259;
  --text-3: #9c948a;
  --border: #e7e0d4;
  --border-strong: #d8cfbf;
  --accent: #b8443a;
  --accent-hover: #9e362d;
  --accent-soft: #f8ebe8;
  --accent-text: #ffffff;
  --gold: #a8862c;
  --green: #2f7d5d;
  --shadow-sm: 0 1px 2px rgba(60, 45, 30, .05), 0 2px 8px rgba(60, 45, 30, .04);
  --shadow-md: 0 2px 6px rgba(60, 45, 30, .06), 0 12px 32px rgba(60, 45, 30, .08);
  --shadow-lg: 0 8px 20px rgba(60, 45, 30, .08), 0 24px 60px rgba(60, 45, 30, .10);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --maxw: 1180px;
  --header-h: 62px;
  --read-font-size: 19px;
  --read-line-height: 2.05;
  --read-width: 46em;
  --paper: #faf8f4;
  --paper-text: #241f1a;
}

/* 暗色主题（全站） */
html[data-theme="dark"] {
  --bg: #16161a;
  --bg-elev: #1e1e23;
  --bg-soft: #24242a;
  --bg-sunken: #121216;
  --text: #e6e2da;
  --text-2: #a29c93;
  --text-3: #746e66;
  --border: #2e2e35;
  --border-strong: #3d3d46;
  --accent: #d4655a;
  --accent-hover: #e07b70;
  --accent-soft: rgba(212, 101, 90, .13);
  --accent-text: #ffffff;
  --gold: #c9a44c;
  --green: #4ea882;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* 阅读页的三种纸色（仅作用于阅读区） */
[data-read-theme="paper"] { --paper: #faf8f4; --paper-text: #241f1a; }
[data-read-theme="sepia"] { --paper: #f4ecd8; --paper-text: #3b3226; }
[data-read-theme="night"] { --paper: #17171b; --paper-text: #b9b4ac; }
[data-read-theme="green"]  { --paper: #e3ede0; --paper-text: #26302a; }

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 26px; }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(150deg, var(--accent), #8f2f27);
  color: #fff; font-family: var(--serif); font-size: 19px; font-weight: 700;
  display: grid; place-items: center; letter-spacing: -1px;
  box-shadow: 0 2px 8px rgba(184, 68, 58, .3);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-family: var(--serif); font-size: 17px; letter-spacing: .5px; }
.logo-text small { font-size: 10px; color: var(--text-3); letter-spacing: 1.6px; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.main-nav a {
  padding: 7px 13px; border-radius: 8px; font-size: 14.5px; color: var(--text-2);
  transition: .16s; white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--bg-soft); }
.main-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search-box { position: relative; }
.search-box input {
  width: 200px; height: 36px; padding: 0 34px 0 34px;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: 99px;
  font-size: 14px; outline: none; transition: .2s;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { background: var(--bg-elev); border-color: var(--accent); width: 240px; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--text-3); border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 1px 5px; background: var(--bg-elev); font-family: var(--sans);
}
.search-box input:focus + kbd { opacity: 0; }

.search-suggest {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 400px; overflow: auto;
}
.search-suggest.open { display: block; }
.search-suggest .item { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; align-items: center; }
.search-suggest .item:hover { background: var(--bg-soft); }
.search-suggest .item .t { font-weight: 600; font-size: 14px; }
.search-suggest .item .m { font-size: 12px; color: var(--text-3); }
.search-suggest .empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 13px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  color: var(--text-2); border: 1px solid transparent; transition: .16s; position: relative;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn .badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 99px; font-size: 10px;
  display: grid; place-items: center; font-family: var(--sans); line-height: 1;
}
.menu-toggle { display: none; }

/* ---------- 4. 通用组件 ---------- */
.section { margin: 42px 0 54px; }
.section-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.section-head h2 {
  font-family: var(--serif); font-size: 21px; letter-spacing: .5px;
  display: flex; align-items: center; gap: 9px;
}
.section-head h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #8f2f27);
}
.section-head .sub { font-size: 13px; color: var(--text-3); padding-bottom: 2px; }
.section-head .more { margin-left: auto; font-size: 13px; color: var(--text-3); padding-bottom: 3px; transition: .16s; }
.section-head .more:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 20px; border-radius: 9px; font-size: 14.5px;
  font-weight: 600; transition: .18s; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 2px 10px rgba(184, 68, 58, .25); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(184, 68, 58, .32); }
.btn-ghost { background: var(--bg-elev); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-soft); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: var(--accent); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px;
  background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag-done { background: rgba(47, 125, 93, .1); color: var(--green); border-color: transparent; }
.tag-gold { background: rgba(168, 134, 44, .12); color: var(--gold); border-color: transparent; }

.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* ---------- 5. 书籍封面（程序化生成，无需图片资源） ---------- */
.cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(155deg, var(--c1, #6b6259), var(--c2, #241f1a));
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px 12px 13px; color: #fff; isolation: isolate;
  transition: transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s;
}
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, .35), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(0, 0, 0, .38), transparent 46%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 7px);
}
.cover::after {
  content: ""; position: absolute; inset: 7px; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 5px; pointer-events: none; z-index: 2;
}
.cover .glyph {
  position: absolute; right: -4px; bottom: -18px; z-index: 1;
  font-family: var(--serif); font-size: 96px; font-weight: 700; line-height: 1;
  color: rgba(255, 255, 255, .13); letter-spacing: -6px; user-select: none;
}
.cover .cv-top { position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 6px; }
.cover .cv-cat {
  font-size: 10.5px; letter-spacing: 1.5px; padding: 2px 7px; border-radius: 4px;
  background: rgba(255, 255, 255, .18); backdrop-filter: blur(4px);
}
.cover .cv-body {
  position: relative; z-index: 3; flex: 1 1 auto; min-height: 0;
  display: flex; justify-content: flex-end; align-items: flex-start; padding-top: 10px;
}
.cover .cv-title {
  font-family: var(--serif); font-size: 20px; line-height: 1.22; letter-spacing: 1.5px;
  writing-mode: vertical-rl; text-orientation: upright; max-height: 100%; overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.cover .cv-author {
  position: relative; z-index: 3; font-size: 11px; opacity: .82; letter-spacing: .5px;
}
.cover-wrap { position: relative; }
/* 迷你封面：仅保留底色与装饰字，用于榜单、联想词等小尺寸场景 */
.cover.mini { padding: 0; box-shadow: none; }
.cover.mini .cv-top, .cover.mini .cv-body, .cover.mini .cv-author { display: none; }
.cover.mini::after { inset: 3px; border-radius: 4px; }
.cover.mini .glyph {
  font-size: 22px; right: 50%; bottom: 50%; transform: translate(50%, 50%);
  letter-spacing: -2px; color: rgba(255, 255, 255, .5);
}
.cover-wrap:hover .cover { transform: translateY(-4px) scale(1.015); box-shadow: var(--shadow-md); }
.cover-wrap .corner {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px; color: #fff;
  background: rgba(0, 0, 0, .42); backdrop-filter: blur(4px);
}

/* ---------- 6. 首页 · 焦点区 ---------- */
.hero {
  margin-top: 26px; display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px;
}
.hero-main {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  min-height: 336px; display: flex; align-items: flex-end;
  background: linear-gradient(140deg, var(--c1), var(--c2)); color: #fff;
  box-shadow: var(--shadow-md); isolation: isolate;
}
.hero-main::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 85% 8%, rgba(255, 255, 255, .3), transparent 45%),
    radial-gradient(circle at 5% 95%, rgba(0, 0, 0, .5), transparent 55%);
}
.hero-main .glyph {
  position: absolute; right: 14px; top: 4px; font-family: var(--serif);
  font-size: 190px; font-weight: 700; line-height: 1; color: rgba(255, 255, 255, .1);
  letter-spacing: -14px; z-index: -1; user-select: none;
}
.hero-inner { position: relative; padding: 30px 32px; width: 100%; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: 1px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .25);
  padding: 3px 10px; border-radius: 99px; backdrop-filter: blur(6px); margin-bottom: 14px;
}
.hero-main h1 {
  font-family: var(--serif); font-size: 34px; letter-spacing: 2px; line-height: 1.2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .3); margin-bottom: 10px;
}
.hero-main .desc {
  font-size: 14px; opacity: .9; max-width: 46em; line-height: 1.75; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; opacity: .88; margin-bottom: 20px; }
.hero-meta span { display: flex; align-items: center; gap: 5px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { height: 42px; }
.hero-main .btn-primary { background: #fff; color: #241f1a; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.hero-main .btn-primary:hover { background: rgba(255, 255, 255, .9); }
.hero-main .btn-ghost { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .34); color: #fff; backdrop-filter: blur(6px); }
.hero-main .btn-ghost:hover { background: rgba(255, 255, 255, .24); }

.hero-side { display: flex; flex-direction: column; gap: 20px; }
.panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.panel-head h3 { font-family: var(--serif); font-size: 16px; letter-spacing: .5px; }
.panel-head .more { margin-left: auto; font-size: 12px; color: var(--text-3); }
.panel-head .more:hover { color: var(--accent); }

.notice-list li { display: flex; gap: 9px; align-items: baseline; padding: 7px 0; font-size: 13.5px; color: var(--text-2); }
.notice-list li + li { border-top: 1px dashed var(--border); }
.notice-list .dot { width: 5px; height: 5px; border-radius: 99px; background: var(--accent); flex-shrink: 0; transform: translateY(-3px); }
.notice-list a:hover { color: var(--accent); }
.notice-list .date { margin-left: auto; font-size: 12px; color: var(--text-3); flex-shrink: 0; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px;
  border-radius: var(--radius); background: var(--bg-soft); font-size: 13px; color: var(--text-2);
  transition: .18s; border: 1px solid transparent;
}
.quick-item:hover { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 22%, transparent); transform: translateY(-2px); }
.quick-item .qi-icon { font-size: 19px; line-height: 1; }

/* ---------- 7. 书籍卡片网格 ---------- */
.book-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px 18px; }
.book-card { display: flex; flex-direction: column; gap: 10px; }
.book-card .info { display: flex; flex-direction: column; gap: 3px; }
.book-card .bt { font-size: 15px; font-weight: 600; letter-spacing: .3px; line-height: 1.35; }
.book-card .bt:hover { color: var(--accent); }
.book-card .ba { font-size: 12.5px; color: var(--text-3); }
.book-card .bx { font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.book-card .bx .sep { color: var(--border-strong); }

/* 横向列表（最新更新） */
.update-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 34px; }
.update-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius);
  transition: .16s; border-bottom: 1px dashed var(--border);
}
.update-item:hover { background: var(--bg-soft); }
.update-item .uc { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.update-item .ub { font-size: 14px; font-weight: 600; flex-shrink: 0; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-item .uc-title { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.update-item .uc-title:hover { color: var(--accent); }
.update-item .ut { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* ---------- 8. 排行榜 ---------- */
.rank-tabs { display: flex; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.rank-tab {
  padding: 6px 14px; border-radius: 99px; font-size: 13.5px; color: var(--text-2);
  border: 1px solid var(--border); background: var(--bg-elev); transition: .16s;
}
.rank-tab:hover { color: var(--text); border-color: var(--border-strong); }
.rank-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.rank-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 34px; }
.rank-row { display: flex; align-items: center; gap: 13px; padding: 12px 10px; border-bottom: 1px dashed var(--border); transition: .16s; border-radius: 8px; }
.rank-row:hover { background: var(--bg-soft); }
.rank-no {
  width: 24px; text-align: center; font-size: 15px; font-weight: 800; font-family: var(--serif);
  color: var(--text-3); flex-shrink: 0;
}
.rank-row:nth-child(1) .rank-no { color: #d94a3d; }
.rank-row:nth-child(2) .rank-no { color: #e08b2d; }
.rank-row:nth-child(3) .rank-no { color: #c8a63a; }
.rank-row .rname { font-size: 14.5px; font-weight: 600; }
.rank-row .rname:hover { color: var(--accent); }
.rank-row .rmeta { font-size: 12px; color: var(--text-3); margin-left: auto; text-align: right; flex-shrink: 0; }
.rank-row .rsub { font-size: 12.5px; color: var(--text-3); }

/* ---------- 9. 书库筛选 ---------- */
.filter-bar { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 20px; box-shadow: var(--shadow-sm); }
.filter-row { display: flex; align-items: flex-start; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.filter-row:last-child { border-bottom: none; }
.filter-row .fl { font-size: 13px; color: var(--text-3); flex-shrink: 0; width: 4.4em; padding-top: 5px; }
.filter-opts { display: flex; flex-wrap: wrap; gap: 4px 2px; }
.filter-opt {
  padding: 4px 12px; border-radius: 7px; font-size: 13.5px; color: var(--text-2); transition: .15s;
}
.filter-opt:hover { background: var(--bg-soft); color: var(--text); }
.filter-opt.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filter-result { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; font-size: 13.5px; color: var(--text-3); }
.filter-result b { color: var(--text); }

/* ---------- 10. 书籍详情页 ---------- */
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); margin: 22px 0 18px; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { opacity: .5; }

.detail-top { display: grid; grid-template-columns: 216px 1fr; gap: 30px; align-items: start; }
.detail-cover .cover { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.detail-cover .cover .cv-title { font-size: 25px; }
.detail-info h1 { font-family: var(--serif); font-size: 30px; letter-spacing: 1.5px; line-height: 1.25; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 14px; }
.detail-intro {
  font-size: 14.5px; line-height: 1.85; color: var(--text-2); position: relative;
  border-left: 3px solid var(--border); padding-left: 15px; margin-bottom: 16px;
}
.detail-intro.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 26px; padding: 16px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); margin-bottom: 18px; }
.detail-stats .st { display: flex; flex-direction: column; gap: 2px; }
.detail-stats .st b { font-size: 18px; font-family: var(--serif); letter-spacing: .5px; }
.detail-stats .st span { font-size: 12px; color: var(--text-3); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.chapter-panel { margin-top: 34px; }
.chapter-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chapter-tools .cnt { font-size: 13px; color: var(--text-3); }
.chapter-switch { margin-left: auto; display: flex; gap: 4px; }
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chapter-grid.rev { direction: rtl; }
.chapter-grid.rev > * { direction: ltr; }
.chapter-link {
  display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-2); border: 1px solid transparent; background: var(--bg-soft);
  transition: .16s;
}
.chapter-link:hover { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.chapter-link .cn { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; font-family: var(--sans); }
.chapter-link:hover .cn { color: var(--accent); }
.chapter-link .ct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ---------- 11. 阅读页 ---------- */
.reader-bar {
  position: sticky; top: var(--header-h); z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.reader-bar .container { display: flex; align-items: center; gap: 12px; height: 52px; }
.reader-bar .rb-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-bar .rb-title .ch { color: var(--text-3); font-weight: 400; margin-left: 8px; font-size: 13px; }
.reader-bar .rb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.reader { background: var(--paper); transition: background .25s; min-height: calc(100vh - var(--header-h) - 52px); }
.reader-main { max-width: var(--read-width); margin: 0 auto; padding: 42px 20px 80px; }
.reader-main h1 {
  font-family: var(--serif); font-size: calc(var(--read-font-size) + 9px); line-height: 1.4;
  color: var(--paper-text); letter-spacing: 1px; margin-bottom: 10px; font-weight: 600;
}
.reader-sub { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--paper-text); opacity: .55; padding-bottom: 20px; border-bottom: 1px solid color-mix(in srgb, var(--paper-text) 12%, transparent); margin-bottom: 30px; }
.reader-content {
  font-family: var(--serif); font-size: var(--read-font-size); line-height: var(--read-line-height);
  color: var(--paper-text); letter-spacing: .35px; text-align: justify;
}
.reader-content p { text-indent: 2em; margin: 0 0 .85em; }
.reader-content p:last-child { margin-bottom: 0; }

.reader-nav { display: flex; gap: 12px; margin-top: 44px; padding-top: 26px; border-top: 1px solid color-mix(in srgb, var(--paper-text) 12%, transparent); }
.reader-nav a {
  flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-text) 5%, transparent); transition: .18s;
  color: var(--paper-text); border: 1px solid transparent;
}
.reader-nav a:hover { background: color-mix(in srgb, var(--paper-text) 9%, transparent); }
.reader-nav a span { font-size: 11.5px; opacity: .55; }
.reader-nav a b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); }
.reader-nav a.next { text-align: right; align-items: flex-end; }
.reader-nav a.disabled { opacity: .35; pointer-events: none; }

.reader-foot { max-width: var(--read-width); margin: 0 auto; padding: 0 20px 60px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* 阅读工具面板 */
.reader-tools {
  position: absolute; top: calc(100% + 8px); right: 0; width: 300px; z-index: 60;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px 18px; display: none;
}
.reader-tools.open { display: block; }
.tool-group + .tool-group { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.tool-group > label { font-size: 12px; color: var(--text-3); display: block; margin-bottom: 9px; letter-spacing: .5px; }
.swatches { display: flex; gap: 9px; }
.swatch {
  width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 11px; transition: .16s;
}
.swatch:hover { transform: scale(1.06); }
.swatch.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 8px; background: var(--bg-soft); color: var(--text);
  font-size: 16px; display: grid; place-items: center; transition: .16s; border: 1px solid var(--border);
}
.stepper button:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.stepper .val { font-size: 13.5px; min-width: 3.4em; text-align: center; color: var(--text-2); }
.tool-row { display: flex; gap: 8px; }
.tool-row .btn { flex: 1; }

/* 阅读进度条 */
.progress-bar { position: fixed; left: 0; bottom: 0; height: 3px; background: var(--accent); width: 0; z-index: 70; transition: width .1s linear; }

/* ---------- 12. 页脚 ---------- */
.site-footer { margin-top: 60px; background: var(--bg-sunken); border-top: 1px solid var(--border); padding: 40px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; }
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: var(--text-3); line-height: 1.9; max-width: 30em; }
.footer-col h4 { font-size: 13.5px; margin-bottom: 12px; letter-spacing: .5px; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--text-3); transition: .16s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  font-size: 12.5px; color: var(--text-3);
}
.footer-bottom .domain { margin-left: auto; font-family: var(--sans); letter-spacing: .5px; }

/* ---------- 13. 骨架屏 / 空状态 / Toast ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty .em-icon { font-size: 42px; opacity: .5; margin-bottom: 14px; }
.empty p { font-size: 14px; margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: #241f1a; color: #fff; padding: 11px 22px; border-radius: 99px; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .26s; z-index: 200;
  display: flex; align-items: center; gap: 8px;
}
html[data-theme="dark"] .toast { background: #f2eee6; color: #1a1a1e; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1080px) {
  .book-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .update-list, .rank-list { grid-template-columns: 1fr; }
  .chapter-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-top { grid-template-columns: 160px 1fr; gap: 20px; }
  .detail-info h1 { font-size: 24px; }
  .main-nav { display: none; }
  .menu-toggle { display: grid; }
  .search-box input { width: 150px; }
  .search-box input:focus { width: 180px; }
}
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .book-grid { grid-template-columns: repeat(3, 1fr); gap: 18px 12px; }
  .cover .cv-title { font-size: 15px; }
  .hero-main h1 { font-size: 25px; }
  .hero-inner { padding: 22px 20px; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-top { grid-template-columns: 116px 1fr; gap: 16px; }
  .detail-info h1 { font-size: 20px; }
  .detail-stats { gap: 16px; }
  .detail-stats .st b { font-size: 16px; }
  .search-box { display: none; }
  .logo-text small { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .reader-main { padding: 26px 16px 60px; }
  .reader-tools { width: min(300px, calc(100vw - 32px)); right: -4px; }
  .rank-list { grid-template-columns: 1fr; }
  .filter-row .fl { width: 100%; padding-top: 0; }
  .filter-row { flex-direction: column; gap: 4px; }
}

/* 移动端抽屉导航 */
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); z-index: 55;
  padding: 20px; transform: translateX(100%); transition: transform .28s cubic-bezier(.3,.8,.3,1);
  overflow-y: auto;
}
.mobile-nav.open { transform: none; }
.mobile-nav a { display: block; padding: 13px 6px; font-size: 16px; border-bottom: 1px dashed var(--border); }
.mobile-nav a.active { color: var(--accent); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
