:root {
  --primary: #ff6b8a;
  --primary-dark: #e0506d;
  --accent: #8a4bff;
  --bg: #fff7f9;
  --surface: #ffffff;
  --text: #2d1f26;
  --muted: #8d7a82;
  --border: #ffe6ed;
  --shadow: 0 8px 30px rgba(255,107,138,.12);
  --radius: 16px;
  --reader-size: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', 'Playfair Display', 'Georgia', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; cursor: pointer; transition: .2s;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: #fff0f3; }
.btn-white { background: #fff; color: var(--primary); border-color: #fff; }
.btn-white:hover { background: #fff0f3; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 20px;
}
.logo {
  font-size: 1.6rem; font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 24px; align-items: center; flex: 1; justify-content: center; }
.nav-links a { font-weight: 700; color: var(--muted); position: relative; padding: 6px 0; }
.nav-links a.active, .nav-links a:hover { color: var(--primary); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  width: 6px; height: 6px; background: var(--primary); border-radius: 50%;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.search-box input { border: none; padding: 8px 16px; outline: none; width: 180px; background: transparent; }
.btn-search { border: none; background: var(--primary); color: #fff; padding: 8px 16px; font-weight: 700; cursor: pointer; }

.hero {
  position: relative; padding: 80px 0 60px; overflow: hidden;
  background: radial-gradient(circle at 80% 10%, #fff0f5 0%, #ffeaf0 30%, var(--bg) 70%);
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0C13.4 0 0 13.4 0 30s13.4 30 30 30 30-13.4 30-30S46.6 0 30 0zm0 50c-11 0-20-9-20-20s9-20 20-20 20 9 20 20-9 20-20 20z' fill='%23ff6b8a' fill-opacity='0.04'/%3E%3C/svg%3E");
}
.hero-content { position: relative; display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: center; }
.hero-text .tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: #fff; color: var(--primary); font-weight: 800; font-size: .8rem; margin-bottom: 16px;
}
.hero-text h1 { font-size: 3rem; line-height: 1.15; margin-bottom: 16px; }
.hero-text p { font-size: 1.1rem; color: var(--muted); max-width: 540px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; margin-bottom: 32px; }
.hero-stats { display: flex; gap: 32px; }
.hero-stats strong { display: block; font-size: 1.5rem; color: var(--primary); }
.hero-stats span { font-size: .9rem; color: var(--muted); }
.hero-book { display: flex; justify-content: center; }

.book-cover { position: relative; width: 180px; height: 260px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: #f3f3f3; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; }
.hero-cover { width: 240px; height: 340px; }
.big-cover { width: 220px; height: 320px; }
.hero-cover-link { position: relative; display: block; width: 240px; height: 340px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: #f3f3f3; border: 1px solid #ddd; }
.hero-cover-link img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; }
.cover-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cover-art big { font-size: 5rem; }
.badge {
  position: absolute; top: 10px; left: 10px; background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}
.badge-hot {
  position: absolute; top: -10px; right: -10px; background: #ff4d6d; color: #fff;
  width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .75rem; box-shadow: 0 4px 12px rgba(255,77,109,.4); z-index: 2;
}

.main { padding: 48px 0; }
.pad-top { padding-top: 120px; }
.section { margin-bottom: 56px; scroll-margin-top: 80px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.section-head h2 { font-size: 1.7rem; }
.more {
  color: var(--primary); font-size: .9rem; font-weight: 700;
  padding: 6px 16px; border-radius: 999px; background: #fff0f3;
  transition: .2s; display: inline-flex; align-items: center; gap: 4px;
}
.more:hover { background: var(--primary); color: #fff; transform: translateX(2px); }

/* 首页完整书库网格 */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px; }
/* 章节区多分栏网格使用 8 列布局，每行最多 8 张 */
.section .book-grid { grid-template-columns: repeat(8, 1fr); }
@media (max-width: 1100px) { .section .book-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 820px) { .section .book-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .section .book-grid { grid-template-columns: repeat(2, 1fr); } }

.book-card {
  position: relative;
  display: flex; flex-direction: column; background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 2px 12px rgba(255,107,138,.08);
  transition: transform .22s ease, box-shadow .22s ease; height: 100%;
}
.book-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(255,107,138,.22); }
.book-card-link {
  display: flex; flex-direction: column; flex: 1;
  color: inherit; text-decoration: none;
}
.book-card-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.book-card .book-cover,
.book-card-link .book-cover {
  width: 100%; aspect-ratio: 2/3; height: auto; border-radius: 0; box-shadow: none; flex-shrink: 0;
}
.book-card .book-cover img,
.book-card-link .book-cover img { border-radius: 0; }
.book-card:hover .book-cover img,
.book-card-link:hover .book-cover img { transform: scale(1.04); }
.book-card .book-cover img,
.book-card-link .book-cover img { transition: transform .3s ease; }

/* 分栏卡片角落的 Share 按钮：默认淡出，hover 卡片时浮现；移动端始终可见 */
.card-share {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--primary);
  border: 1px solid rgba(255,107,138,.25);
  font-size: .72rem; font-weight: 700;
  cursor: pointer;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease, background .2s ease, color .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  font-family: inherit;
  line-height: 1;
}
.book-card:hover .card-share,
.book-card:focus-within .card-share,
.card-share:focus-visible { opacity: 1; transform: translateY(0); }
.card-share:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.card-share:active { transform: scale(.96); }
.card-share svg { display: block; }
/* 移动端：没 hover，Share 按钮始终可见（小屏触控必备） */
@media (hover: none) { .card-share { opacity: 1; transform: translateY(0); } }

.book-info { padding: 10px 12px 14px; display: flex; flex-direction: column; flex: 1; }
.book-title {
  font-size: .88rem; line-height: 1.35; font-weight: 700; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.4em;
}
.book-author { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.book-rate { font-size: .8rem; color: #ffa400; font-weight: 800; }
.book-words { font-size: .72rem; color: var(--muted); }
.book-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.book-tags em {
  font-style: normal; font-size: .68rem; padding: 2px 7px; border-radius: 999px;
  background: #fff0f3; color: var(--primary);
}

/* 数量徽章 */
.count-badge {
  padding: 5px 14px; border-radius: 999px; background: #fff0f3; color: var(--primary);
  font-size: .82rem; font-weight: 700;
}

/* 列表页卡片（书库/分类/榜单缩略图）保持小尺寸 */
.rank-board-cover .book-cover { width: 60px; height: 88px; border-radius: 8px; }

.split { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.book-list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff;
  border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.list-rank { width: 28px; height: 28px; border-radius: 50%; background: #fff0f3; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; }
.list-info { flex: 1; }
.list-info h4 { font-size: .95rem; margin-bottom: 2px; }
.list-info p { font-size: .8rem; color: var(--muted); }
.list-score { color: #ffa400; font-weight: 800; }

.rank-list { list-style: none; counter-reset: rank; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rank-num { width: 28px; height: 28px; border-radius: 50%; background: #f3f3f3; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; flex-shrink: 0; }
.rank-num.top { background: var(--primary); color: #fff; }
.rank-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-heat { font-size: .8rem; color: var(--muted); }

.tags-cloud { text-align: center; }
.tags-cloud h2 { margin-bottom: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tag-pill { padding: 8px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: .9rem; cursor: pointer; }
.tag-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.page-title { font-size: 2rem; margin-bottom: 20px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-label { color: var(--muted); font-size: .9rem; }
.filter-pill { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.filter-pill.active, .filter-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.book-detail { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; margin-bottom: 48px; }
.detail-info h1 { font-size: 2rem; margin: 12px 0; }
.detail-meta { color: var(--muted); margin-bottom: 12px; }
.detail-meta .dot { margin: 0 8px; color: #ddd; }
.detail-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.detail-rating strong { font-size: 1.8rem; color: var(--primary); }
.stars { color: #ffa400; letter-spacing: 2px; }
.detail-desc { color: var(--muted); margin-bottom: 24px; line-height: 1.8; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-tags span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #fff0f3; color: var(--primary); font-size: .8rem; margin-right: 8px; margin-bottom: 8px; }

.chapter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.chapter-list a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border-radius: var(--radius); color: var(--text); }
.chapter-list a:hover { color: var(--primary); box-shadow: var(--shadow); }
.chapter-list span { color: var(--muted); font-size: .85rem; }

.rank-tabs { display: flex; gap: 12px; margin-bottom: 24px; }
.rank-tab { padding: 10px 20px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-weight: 700; }
.rank-tab.active, .rank-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.rank-board { list-style: none; }
.rank-board-item { display: grid; grid-template-columns: 50px 80px 1fr auto; align-items: center; gap: 16px; padding: 16px; background: #fff; border-radius: var(--radius); margin-bottom: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.rank-board-num { width: 36px; height: 36px; border-radius: 50%; background: #f3f3f3; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.rank-board-num.top { background: var(--primary); color: #fff; }
.rank-board-cover .book-cover { width: 60px; height: 88px; }
.rank-board-cover .cover-art big { font-size: 1.8rem; }
.rank-board-title { font-weight: 700; display: block; margin-bottom: 4px; }
.rank-board-info p { font-size: .85rem; color: var(--muted); }
.rank-board-data { margin-top: 4px; }
.rank-board-score { font-size: 1.4rem; color: #ffa400; font-weight: 800; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 0%, #fff0f5 0%, #fff 60%); }
.auth-logo { font-size: 2.2rem; font-weight: 800; margin-bottom: 24px; background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-card { background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 24px; }
.auth-card label { display: block; margin-bottom: 16px; }
.auth-card label span { display: block; margin-bottom: 6px; font-weight: 700; font-size: .9rem; }
.auth-card input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; outline: none; }
.auth-card input:focus { border-color: var(--primary); }
.auth-card button { margin-top: 8px; }
.auth-tip { text-align: center; margin-top: 16px; color: var(--muted); }
.auth-tip a { color: var(--primary); font-weight: 700; }

.reader { background: #fff; min-height: 100vh; }
.reader-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border); }
.reader-header .logo { font-size: 1.3rem; }
.reader-title { font-weight: 700; color: var(--muted); }
.reader-tools { display: flex; gap: 8px; }
.tool-btn { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.reader-body { max-width: 720px; margin: 0 auto; padding: 40px 20px; font-size: var(--reader-size); line-height: 2; font-family: 'Playfair Display', Georgia, serif; }
.reader-body h1 { font-size: 1.8rem; margin-bottom: 24px; font-family: 'Nunito', sans-serif; }
.reader-body p { margin-bottom: 1em; text-indent: 2em; }

/* ===== 阅读页 v2：夜间模式 / 字号 / 行距 / 设置面板 / 自动跳转 ===== */
:root {
  --reader-size: 18px;
  --reader-bg: #ffffff;
  --reader-text: #1f1f23;
  --reader-border: #ececec;
  --reader-muted: #888;
  --reader-toolbar: rgba(255, 255, 255, 0.92);
  --reader-accent: #ff6b8a;
}
body.theme-light { --reader-bg: #ffffff; --reader-text: #1f1f23; --reader-border: #ececec; --reader-muted: #777; --reader-toolbar: rgba(255, 255, 255, 0.94); }
body.theme-sepia { --reader-bg: #f5ecd9; --reader-text: #4a3823; --reader-border: #d9c9a8; --reader-muted: #8a7250; --reader-toolbar: rgba(245, 236, 217, 0.94); }
body.theme-dark  { --reader-bg: #15171c; --reader-text: #d8dde4; --reader-border: #2c3038; --reader-muted: #888c95; --reader-toolbar: rgba(21, 23, 28, 0.94); }

.reader-body-page { background: var(--reader-bg); color: var(--reader-text); transition: background .25s ease, color .25s ease; }

.reader-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--reader-toolbar); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--reader-border);
}
.reader-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.reader-back {
  color: var(--reader-muted); text-decoration: none; font-weight: 700; font-size: .95rem;
  padding: 6px 14px; border-radius: 8px; transition: .2s;
}
.reader-back:hover { background: rgba(255, 107, 138, 0.1); color: var(--reader-accent); }
.reader-book-title { font-weight: 700; font-size: 1rem; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-tools { display: flex; gap: 6px; }
.reader-tools .tool-btn { background: transparent; border: 1px solid var(--reader-border); color: var(--reader-text); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .95rem; transition: .2s; }
.reader-tools .tool-btn:hover { background: var(--reader-accent); color: #fff; border-color: var(--reader-accent); }

/* 设置面板 */
.settings-panel {
  position: fixed; top: 60px; right: 16px; z-index: 100;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--reader-toolbar); backdrop-filter: blur(12px);
  border: 1px solid var(--reader-border); border-radius: 14px;
  padding: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
body.theme-dark .settings-panel { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6); }
.settings-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--reader-border);
}
.settings-row:last-child { border-bottom: 0; }
.settings-label { font-weight: 700; font-size: .9rem; color: var(--reader-muted); }
.settings-control { display: flex; align-items: center; gap: 8px; }
.size-btn {
  min-width: 36px; height: 32px; padding: 0 10px;
  background: transparent; border: 1px solid var(--reader-border);
  color: var(--reader-text); border-radius: 6px; cursor: pointer;
  font-size: .9rem; font-weight: 700;
}
.size-btn:hover { background: var(--reader-accent); color: #fff; border-color: var(--reader-accent); }
.size-display {
  display: inline-block; min-width: 40px; text-align: center;
  font-weight: 800; color: var(--reader-accent); font-size: .95rem;
}
.theme-btn {
  padding: 6px 10px; background: transparent; border: 1px solid var(--reader-border);
  color: var(--reader-text); border-radius: 6px; cursor: pointer;
  font-size: .82rem; font-weight: 600;
}
.theme-btn:hover { border-color: var(--reader-accent); }
.theme-btn.active { background: var(--reader-accent); color: #fff; border-color: var(--reader-accent); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--reader-border); border-radius: 999px; transition: .25s;
}
.slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .25s;
}
.switch input:checked + .slider { background: var(--reader-accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.hint { font-size: .75rem; color: var(--reader-muted); margin-left: 6px; }

/* 阅读主体 */
.reader-article {
  max-width: 760px; margin: 0 auto;
  padding: 40px 24px 80px;
  transition: max-width .25s;
}
.reader-article.narrow { max-width: 600px; }
.reader-article-head { text-align: center; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--reader-border); }
.back-to-info {
  display: inline-block; font-size: .85rem; color: var(--reader-muted);
  text-decoration: none; margin-bottom: 16px; padding: 4px 12px;
  border-radius: 999px; border: 1px solid var(--reader-border);
  transition: .2s;
}
.back-to-info:hover { color: var(--reader-accent); border-color: var(--reader-accent); }
.reader-chapter-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 700;
  color: var(--reader-text);
  margin-bottom: 8px;
}
.reader-chapter-meta { color: var(--reader-muted); font-size: .9rem; }

#readerBody {
  font-size: var(--reader-size);
  line-height: 1.8;
  color: var(--reader-text);
  font-family: 'Lora', 'Playfair Display', Georgia, serif;
}
#readerBody p {
  margin-bottom: 1em;
  text-indent: 2em;
  text-align: justify;
}

/* 自动跳转下一章面板 */
.autonext-panel {
  margin: 48px auto; padding: 20px 24px; max-width: 520px;
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.12) 0%, rgba(138, 75, 255, 0.12) 100%);
  border: 1px solid var(--reader-accent); border-radius: 14px;
  text-align: center;
}
body.theme-dark .autonext-panel {
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.18) 0%, rgba(138, 75, 255, 0.18) 100%);
}
.autonext-panel p { font-size: 1rem; color: var(--reader-text); margin-bottom: 12px; }
.autonext-panel p strong { color: var(--reader-accent); font-size: 1.4rem; padding: 0 4px; }
.autonext-actions { display: flex; justify-content: center; gap: 12px; }
.btn-white {
  background: var(--reader-toolbar); color: var(--reader-text);
  border: 1px solid var(--reader-border);
}
.btn-white:hover { background: var(--reader-border); }

/* 章节底部导航 */
.chapter-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 48px 0 24px;
  padding: 16px 0; border-top: 1px solid var(--reader-border); border-bottom: 1px solid var(--reader-border);
}
.chapter-nav-btn {
  flex: 1; text-align: center; padding: 10px 14px;
  background: transparent; border: 1px solid var(--reader-border); border-radius: 8px;
  color: var(--reader-text); text-decoration: none; font-weight: 700; font-size: .9rem;
  transition: .2s;
}
.chapter-nav-btn:hover { background: var(--reader-accent); color: #fff; border-color: var(--reader-accent); }
.chapter-nav-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.chapter-nav-list { flex: 1.2; }

/* 阅读页底部 */
.reader-footer {
  padding: 24px; text-align: center; color: var(--reader-muted);
  border-top: 1px solid var(--reader-border); font-size: .85rem;
}

/* 浮动进度条 */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--reader-accent), #8a4bff);
  width: 0%; z-index: 200;
  transition: width .1s;
}

/* 章节列表行 */
.chapter-list { display: flex; flex-direction: column; gap: 8px; }
.chapter-row {
  display: flex; align-items: center; padding: 14px 18px;
  background: var(--reader-bg); border: 1px solid var(--reader-border); border-radius: 10px;
  text-decoration: none; color: var(--reader-text);
  transition: .2s;
}
.chapter-row:hover {
  border-color: var(--reader-accent); background: rgba(255, 107, 138, 0.05);
  transform: translateX(4px);
}
.chapter-num {
  display: inline-block; min-width: 56px; padding: 4px 10px;
  background: rgba(255, 107, 138, 0.12); color: var(--reader-accent);
  border-radius: 6px; font-weight: 800; font-size: .8rem;
  margin-right: 14px; text-align: center;
}
.chapter-name { flex: 1; font-weight: 600; font-size: .95rem; }
.chapter-arrow { color: var(--reader-muted); font-size: 1.2rem; }
.chapter-row:hover .chapter-arrow { color: var(--reader-accent); transform: translateX(4px); transition: .2s; }

@media (max-width: 720px) {
  .settings-panel { right: 8px; left: 8px; width: auto; }
  .reader-article { padding: 24px 16px 64px; }
  .reader-chapter-title { font-size: 1.5rem; }
  .chapter-nav { flex-direction: column; gap: 8px; }
  .chapter-nav-btn { padding: 12px; }
  .reader-bar-inner { padding: 10px 14px; }
  .reader-book-title { font-size: .9rem; }
}

/* 政策页样式 */
.policy-hero {
  text-align: center;
  padding: 32px 0 48px;
  border-bottom: 1px solid #f0e0ea;
  margin-bottom: 40px;
}
.policy-hero .tag {
  display: inline-block;
  background: rgba(255, 107, 138, 0.12);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.policy-hero h1 {
  font-size: 2.4rem;
  font-family: 'Playfair Display', serif;
  margin-bottom: 16px;
  color: var(--dark);
}
.policy-hero .lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
}
.policy-block { margin-bottom: 56px; }
.policy-block h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #fce8ef;
}
.policy-block p { color: var(--muted); line-height: 1.8; margin-bottom: 16px; }
.prohibit-list { list-style: none; padding: 0; margin: 0; counter-reset: prohibit; }
.prohibit-list li {
  counter-increment: prohibit;
  position: relative;
  padding: 16px 16px 16px 56px;
  margin-bottom: 12px;
  background: #fff5f8;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  line-height: 1.7;
  color: #555;
}
.prohibit-list li::before {
  content: counter(prohibit);
  position: absolute;
  left: 14px;
  top: 16px;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}
.prohibit-list li strong { color: var(--dark); display: block; margin-bottom: 4px; }
.permit-list { list-style: none; padding: 0; margin: 0; }
.permit-list li {
  padding: 12px 16px 12px 36px;
  margin-bottom: 8px;
  background: #f7f4ff;
  border-left: 3px solid var(--secondary);
  border-radius: 6px;
  line-height: 1.7;
  color: #555;
  position: relative;
}
.permit-list li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--secondary);
  font-weight: 800;
}
.enforce-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.enforce-card {
  background: linear-gradient(135deg, #fff5f8 0%, #f7f4ff 100%);
  padding: 24px;
  border-radius: 12px;
  text-align: center;
}
.enforce-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.enforce-card h3 { font-size: 1.05rem; color: var(--dark); margin-bottom: 8px; }
.enforce-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin: 0; }
.contact-list {
  background: #fafafa;
  padding: 20px 24px;
  border-radius: 10px;
  border: 1px solid #f0e0ea;
}
.contact-list p { margin: 6px 0; }
.policy-footer {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid #f0e0ea;
  margin-top: 40px;
}
.policy-footer p { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 720px) {
  .policy-hero h1 { font-size: 1.8rem; }
  .enforce-grid { grid-template-columns: 1fr; }
}
.reader-nav { display: flex; justify-content: center; gap: 12px; padding: 0 20px 40px; }
.reader-footer { text-align: center; padding: 20px; color: var(--muted); font-size: .85rem; }

.site-footer { background: #fff; border-top: 1px solid var(--border); padding: 40px 0 24px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-inner .brand p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.footer-inner .links { display: flex; gap: 20px; }
.footer-inner .links a { color: var(--muted); font-size: .9rem; }
.copy { width: 100%; text-align: center; color: #bbb; font-size: .8rem; margin-top: 16px; }

@media (max-width: 960px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-book { order: -1; }
  .split { grid-template-columns: 1fr; }
  .book-detail { grid-template-columns: 1fr; text-align: center; }
  .detail-cover { display: flex; justify-content: center; }
  .rank-board-item { grid-template-columns: 40px 60px 1fr auto; }
  .rank-board-cover .book-cover { width: 50px; height: 74px; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .search-box input { width: 120px; }
  .hero { padding: 40px 0; }
  .hero-text h1 { font-size: 2rem; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .book-info { padding: 8px 9px 11px; }
  .book-title { font-size: .8rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-legal { justify-content: center; }
}

/* ---- legal / company pages: footer links row ---- */
.footer-legal {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.footer-legal a {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  transition: color .2s;
}
.footer-legal a:hover { color: var(--primary); }

/* ---- legal page content helpers (About / Contact / Privacy / Terms / Disclaimer) ---- */
.policy-block h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--dark);
  margin: 6px 0 8px;
}
.policy-block a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.policy-block a:hover { color: var(--primary-dark); }
.policy-block .contact-list a { text-decoration: none; font-weight: 700; }
.policy-block .contact-list a:hover { text-decoration: underline; }
.legal-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.legal-badge-row .filter-pill {
  background: #fff0f3;
  color: var(--primary);
  border-color: transparent;
  cursor: default;
}

/* ---- auth pages: small legal row under the card ---- */
.auth-legal {
  margin-top: 18px;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
}
.auth-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--primary); }

/* ---- contact form (contact-us.html) ---- */
#contactForm label {
  display: block;
  margin: 0 0 16px;
  font-weight: 700;
  font-size: .92rem;
  color: #3a2b45;
}
#contactForm input,
#contactForm select,
#contactForm textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #e6ddf0;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#contactForm input:focus,
#contactForm select:focus,
#contactForm textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 138, .14);
}
#contactForm textarea { resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-note {
  font-size: .84rem;
  color: var(--muted);
  margin: -4px 0 16px;
}
.form-note a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
#cf-status {
  display: inline-block;
  margin-left: 12px;
  font-size: .9rem;
  font-weight: 700;
}
#cf-status.cf-ok { color: #1f9d55; }
#cf-status.cf-err { color: #d64545; }
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* disabled state for fake pagination arrows (real client-side paging built by app.js) */
.pagination a.is-disabled { opacity: .45; pointer-events: none; cursor: default; }

/* ===== 内容拆分（new/ search/ 与首页浏览入口）===== */
.section .book-grid.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) { .section .book-grid.grid-6 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 820px) { .section .book-grid.grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .section .book-grid.grid-6 { grid-template-columns: repeat(2, 1fr); } }

.browse-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.browse-chips .filter-pill { padding: 9px 18px; font-size: .92rem; }

.search-form { display: flex; gap: 10px; max-width: 660px; margin: 18px 0 4px; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: 12px 20px; border: 1px solid var(--border); border-radius: 999px; font-size: 1rem; background: #fff; outline: none; }
.search-form input[type="search"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 107, 138, .15); }
.search-form .btn { border-radius: 999px; padding: 12px 26px; white-space: nowrap; }
.result-count { color: var(--muted); margin: 14px 0 2px; font-size: .95rem; }
.search-empty { color: var(--muted); padding: 24px 4px; }

.seo-hot-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.seo-hot-list li { border-bottom: 1px dashed var(--border); padding-bottom: 10px; color: var(--muted); }
.seo-hot-list a { color: var(--text); font-weight: 600; text-decoration: none; }
.seo-hot-list a:hover { color: var(--primary); }
