/* ==========================================================================
   文枢阅读 · 官网样式（暖橙番茄风）
   ========================================================================== */
:root {
  --brand: #ff5a2c;
  --brand-dark: #e8431a;
  --brand-darker: #c93a15;
  --brand-soft: #fff1ea;
  --brand-soft-2: #ffe6db;
  --accent: #ffb020;
  --gold: #f5a623;
  --ink: #241c15;
  --ink-2: #5b4b3f;
  --muted: #9a897c;
  --line: #f0e4da;
  --line-2: #f7efe8;
  --bg: #fff9f5;
  --card: #fff;
  --green: #1fa971;
  --green-soft: #e8f7f0;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(120, 70, 40, 0.06);
  --shadow: 0 10px 30px rgba(120, 70, 40, 0.1);
  --shadow-lg: 0 18px 48px rgba(120, 70, 40, 0.16);
  --container: 1200px;
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.text-brand { color: var(--brand); }
.text-muted { color: var(--muted); }
.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;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; transition: all .2s ease; white-space: nowrap;
  background: var(--card); color: var(--ink);
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 8px 20px rgba(255, 90, 44, .28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(255, 90, 44, .36); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 22px rgba(120, 70, 40, .08); }
.header-inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: .5px; flex: none; }
.logo svg { width: 34px; height: 34px; }
.logo .logo-sub { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 2px; margin-left: 2px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; transition: all .18s; }
.main-nav a:hover, .main-nav a.active { color: var(--brand); background: var(--brand-soft); }

.header-search { margin-left: auto; position: relative; }
.header-search input {
  width: 230px; padding: 9px 38px 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); outline: none; transition: all .2s;
}
.header-search input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.header-search button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; color: var(--brand); padding: 6px; display: flex;
}
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 12% -10%, #ffe3d5 0%, rgba(255, 227, 213, 0) 60%),
    radial-gradient(760px 420px at 92% 0%, #ffe9c9 0%, rgba(255, 233, 201, 0) 60%),
    linear-gradient(180deg, #fff5ee 0%, var(--bg) 100%);
  padding: 64px 0 54px;
}
.hero::after {
  content: ""; position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255, 90, 44, .16), rgba(255, 90, 44, 0) 70%); border-radius: 50%;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); color: var(--brand-dark); font-weight: 600;
  padding: 7px 16px; border-radius: 999px; box-shadow: var(--shadow-sm); font-size: 13px;
}
.hero h1 { font-size: clamp(30px, 4.4vw, 50px); margin: 20px 0 14px; letter-spacing: .5px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 17px; color: var(--ink-2); max-width: 540px; }
.hero-search { display: flex; gap: 10px; margin: 26px 0 18px; max-width: 540px; }
.hero-search input {
  flex: 1; padding: 14px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; outline: none; box-shadow: var(--shadow-sm);
}
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.hero-stats { display: flex; gap: 34px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats .num { font-size: 26px; font-weight: 800; color: var(--brand-dark); }
.hero-stats .lab { font-size: 13px; color: var(--muted); }

.hero-covers { position: relative; height: 360px; }
.hero-covers a {
  position: absolute; width: 172px; aspect-ratio: 3/4; display: block; overflow: hidden;
  border-radius: 12px; box-shadow: var(--shadow-lg); border: 3px solid #fff; background: #f7efe8;
}
.hero-covers img { width: 100%; height: 100%; object-fit: cover; }
.hero-covers a:nth-child(1) { left: 4%; top: 30px; transform: rotate(-7deg); z-index: 3; }
.hero-covers a:nth-child(2) { left: 33%; top: 0; z-index: 4; width: 186px; }
.hero-covers a:nth-child(3) { left: 64%; top: 34px; transform: rotate(7deg); z-index: 3; }

/* ---------------- 区块 ---------------- */
.section { padding: 46px 0; }
.section.tight { padding: 30px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-title { position: relative; padding-left: 16px; font-size: 24px; }
.section-title::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 24px; border-radius: 3px; background: linear-gradient(var(--brand), var(--accent)); }
.section-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.section-more { color: var(--brand); font-weight: 600; font-size: 14px; flex: none; }
.section-more:hover { text-decoration: underline; }

/* 分类胶囊 */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); font-weight: 600; font-size: 14px; transition: all .18s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.chip.is-on { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(255,90,44,.25); }
.chip .cnt { opacity: .7; font-size: 12px; margin-left: 4px; }

/* ---------------- 书籍卡片 ---------------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 22px 20px; }
.book-card { position: relative; transition: transform .2s; }
.book-card:hover { transform: translateY(-4px); }
.book-cover {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #fdeee4, #f6e3d6); box-shadow: var(--shadow-sm);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.book-card:hover .book-cover img { transform: scale(1.05); }
.book-cover .tag {
  position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff; backdrop-filter: blur(4px);
}
.tag-finish { background: rgba(31, 169, 113, .92); }
.tag-serial { background: rgba(255, 90, 44, .92); }
.tag-free { background: rgba(255, 176, 32, .95); color: #4a2c00; }
.book-cover .rank {
  position: absolute; bottom: 0; left: 0; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-style: italic; color: #fff; font-size: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-top-right-radius: 12px;
}
.book-title {
  margin: 12px 0 4px; font-weight: 700; font-size: 15px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card:hover .book-title { color: var(--brand); }
.book-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.book-meta .dot::before { content: "·"; }

/* 横向榜单卡 */
.rank-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 26px; }
.rank-item { display: flex; gap: 14px; padding: 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line-2); transition: all .2s; }
.rank-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: transparent; }
.rank-item .no { flex: none; width: 26px; text-align: center; font-weight: 800; font-style: italic; color: var(--muted); font-size: 18px; }
.rank-item:nth-child(1) .no, .rank-item:nth-child(2) .no, .rank-item:nth-child(3) .no { color: var(--brand); }
.rank-item .cover { width: 62px; flex: none; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: #f6e3d6; }
.rank-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.rank-item .info { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rank-item .info h4 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .info .descr { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .info .sub { font-size: 12px; color: var(--brand-dark); margin-top: 3px; }

/* ---------------- 筛选栏（书库） ---------------- */
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 40; background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 26px;
}
.filter-row { display: flex; align-items: flex-start; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.filter-row:last-child { border-bottom: 0; padding-bottom: 0; }
.filter-row:first-child { padding-top: 0; }
.filter-label { flex: none; width: 76px; color: var(--muted); font-size: 13px; padding-top: 6px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-options a { padding: 5px 13px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.filter-options a:hover { color: var(--brand); background: var(--brand-soft); }
.filter-options a.is-on { background: var(--brand); color: #fff; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .result { color: var(--muted); font-size: 14px; }
.toolbar .result b { color: var(--brand); }
.toolbar .spacer { margin-left: auto; }
.sort-tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.sort-tabs button { border: 0; background: transparent; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; }
.sort-tabs button.is-on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.search-inline { position: relative; }
.search-inline input { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; outline: none; width: 210px; }
.search-inline input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 12px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0 10px; flex-wrap: wrap; }
.pagination button {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2);
}
.pagination button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pagination button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 详情页 ---------------- */
.crumbs { padding: 18px 0; color: var(--muted); font-size: 13.5px; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { margin: 0 8px; opacity: .6; }

.detail-top {
  display: grid; grid-template-columns: 240px 1fr; gap: 34px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow-sm);
}
.detail-cover { aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #f6e3d6; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 30px; margin-bottom: 12px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-gray { background: var(--line-2); color: var(--ink-2); }
.detail-stats { display: flex; gap: 30px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin-bottom: 18px; }
.detail-stats .num { font-size: 20px; font-weight: 800; color: var(--ink); }
.detail-stats .lab { font-size: 12.5px; color: var(--muted); }
.detail-desc { color: var(--ink-2); }
.detail-desc .fold { position: relative; max-height: 92px; overflow: hidden; }
.detail-desc .fold::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: linear-gradient(rgba(255,255,255,0), #fff); }
.detail-desc.is-open .fold { max-height: none; }
.detail-desc.is-open .fold::after { display: none; }
.detail-desc .toggle { color: var(--brand); cursor: pointer; font-weight: 600; font-size: 13.5px; background: none; border: 0; padding: 4px 0; }
.detail-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.notice-inline { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.chapter-panel { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 26px 30px; margin-top: 26px; box-shadow: var(--shadow-sm); }
.chapter-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.chapter-head h2 { font-size: 20px; }
.chapter-head .hint { font-size: 13px; color: var(--muted); }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 18px; margin-top: 14px; }
.chapter-item {
  display: flex; align-items: center; gap: 8px; padding: 11px 6px;
  border-bottom: 1px solid var(--line-2); color: var(--ink-2); font-size: 14px; cursor: default;
}
.chapter-item .no { color: var(--muted); font-size: 12.5px; flex: none; min-width: 42px; }
.chapter-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-item .badge { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
a.chapter-item, button.chapter-item { width: 100%; font: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); }
a.chapter-item { cursor: pointer; }
button.chapter-item { cursor: pointer; }
a.chapter-item:hover .name, button.chapter-item:hover .name { color: var(--brand); }
.chapter-item.is-locked .name { color: var(--muted); }
.badge-free { background: var(--green-soft); color: var(--green); }
.badge-pay { background: var(--brand-soft); color: var(--brand-dark); }
.badge-lock { color: var(--muted); }

.info-panel { background: linear-gradient(135deg, #fff4ec, #fff); border: 1px dashed var(--brand-soft-2); border-radius: var(--radius); padding: 16px 20px; margin-top: 22px; color: var(--ink-2); font-size: 14px; display: flex; gap: 12px; align-items: flex-start; }
.info-panel svg { flex: none; margin-top: 2px; color: var(--brand); }

/* ---------------- 通用卡片/特色 ---------------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); transition: transform .2s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .ico { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 16px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }

.cta-band { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-radius: var(--radius-lg); padding: 42px 44px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; background: rgba(255,255,255,.12); border-radius: 50%; }
.cta-band h2 { font-size: 26px; margin-bottom: 8px; position: relative; }
.cta-band p { margin: 0; opacity: .92; position: relative; }
.cta-band .btn { background: #fff; color: var(--brand-dark); position: relative; }

/* ---------------- 内容页（关于/协议） ---------------- */
.page-hero { background: linear-gradient(180deg, #fff2ea, var(--bg)); padding: 40px 0 30px; }
.page-hero h1 { font-size: 30px; }
.page-hero .desc { color: var(--muted); margin-top: 8px; }
.prose { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 40px 46px; box-shadow: var(--shadow-sm); }
.prose h2 { font-size: 20px; margin: 30px 0 12px; padding-left: 14px; position: relative; }
.prose h2::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 3px; background: var(--brand); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose .tip { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: 0 10px 10px 0; color: var(--brand-darker); }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; font-size: 14px; }
.prose th { background: var(--bg); width: 180px; }

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; }
.about-side { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 20px); }
.about-side dl { margin: 0; }
.about-side dt { color: var(--muted); font-size: 13px; margin-top: 14px; }
.about-side dd { margin: 2px 0 0; font-weight: 600; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: #2a1d15; color: #cbb8ab; margin-top: 60px; padding: 50px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 34px; }
.site-footer .logo { color: #fff; margin-bottom: 14px; }
.site-footer .logo .logo-sub { color: #9c8574; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.footer-about { font-size: 13.5px; color: #a58e7e; max-width: 340px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 36px; padding-top: 22px; font-size: 12.5px; color: #8d7767; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }
.footer-bottom .disclaim { max-width: 720px; }

/* ---------------- 返回顶部 ---------------- */
.to-top {
  position: fixed; right: 24px; bottom: 28px; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--brand); color: #fff; box-shadow: var(--shadow-lg);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s; z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-covers { display: none; }
  .cards-3 { grid-template-columns: 1fr; }
  .detail-top { grid-template-columns: 150px 1fr; gap: 20px; padding: 20px; }
  .detail-title { font-size: 23px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .rank-list { grid-template-columns: 1fr; }
  .prose { padding: 26px 22px; }
}
@media (max-width: 720px) {
  .main-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line-2); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; }
  .header-search { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .filter-label { width: 100%; padding-top: 0; margin-bottom: 4px; }
  .filter-row { flex-direction: column; gap: 6px; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .detail-top { grid-template-columns: 1fr; }
  .detail-cover { width: 150px; margin: 0 auto; }
  .detail-title { text-align: center; }
  .detail-tags, .detail-actions { justify-content: center; }
  .chapter-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 30px 24px; }
  .hero { padding: 40px 0 34px; }
}

/* ---------------- 付费引导弹窗 ---------------- */
.gate-modal { position: fixed; inset: 0; z-index: 200; display: none; }
.gate-modal.show { display: block; }
.gate-mask { position: absolute; inset: 0; background: rgba(36, 22, 12, .55); backdrop-filter: blur(2px); }
.gate-box {
  position: relative; width: min(400px, calc(100% - 36px)); margin: 0 auto; top: 50%;
  transform: translateY(-50%); background: #fff; border-radius: 20px; padding: 30px 24px 22px;
  text-align: center; box-shadow: var(--shadow-lg); animation: gateIn .22s ease;
}
@keyframes gateIn { from { opacity: 0; transform: translateY(-46%) scale(.96); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
.gate-close { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.gate-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.gate-douyin { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #25f4ee, #161823 45%, #fe2c55); color: #fff; font-weight: 800; font-size: 21px; }
.gate-mini { font-size: 12px; color: var(--muted); align-self: flex-end; margin-bottom: 6px; }
.gate-box h3 { font-size: 19px; margin-bottom: 8px; }
.gate-desc { color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.gate-name { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--brand-soft); border: 1px dashed var(--brand-soft-2); border-radius: 12px; padding: 12px 16px; margin: 16px 0 4px; }
.gate-name-text { font-weight: 800; font-size: 18px; color: var(--brand-dark); letter-spacing: 1px; }
.gate-tip { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }
body.gate-open { overflow: hidden; }

/* ---------------- 阅读页 ---------------- */
.reader-page { background: var(--bg); padding-bottom: 20px; }
.reader-wrap { max-width: 860px; }
.reader-crumbs { padding-top: 16px; }
.reader-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 16px;
  margin: 6px 0 22px; position: sticky; top: calc(var(--header-h) + 8px); z-index: 30; box-shadow: var(--shadow-sm);
}
.reader-tool-left { color: var(--muted); font-size: 13px; }
.reader-tools { display: flex; align-items: center; gap: 6px; }
.reader-tools button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.reader-tools button:hover { border-color: var(--brand); color: var(--brand); }
.reader-tools button.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.reader-title { font-size: 26px; margin: 10px 0 8px; }
.reader-meta { color: var(--muted); font-size: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); margin-bottom: 26px; }
.reader-content { font-size: var(--reader-size, 18px); line-height: 2.05; color: #2b2118; word-break: break-word; }
.reader-content p { margin: 0 0 1.1em; text-indent: 2em; }
.reader-content p:last-child { margin-bottom: 0; }
.reader-gate { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #fff3ea, #fff); border: 1px solid var(--brand-soft-2); border-radius: 16px; padding: 22px 24px; margin: 40px 0 10px; }
.reader-gate-ico { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.reader-gate-txt { flex: 1; min-width: 0; }
.reader-gate-txt h3 { font-size: 17px; margin-bottom: 4px; }
.reader-gate-txt p { margin: 0; color: var(--muted); font-size: 13.5px; }
.reader-gate-done { background: linear-gradient(135deg, #eef8f2, #fff); border-color: #cdeede; }
.reader-gate-done .reader-gate-ico { background: var(--green-soft); color: var(--green); }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; margin: 34px 0 50px; }
.reader-nav-btn { flex: 1; text-align: center; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.reader-nav-btn:hover { border-color: var(--brand); color: var(--brand); }
.reader-nav-btn.is-disabled { opacity: .5; cursor: not-allowed; }
.reader-nav-dir { flex: 0 0 100px; }

/* 阅读主题 */
html[data-theme="sepia"] body.reading,
html[data-theme="sepia"] .reader-page { background: #f6ecd9; }
html[data-theme="sepia"] .reader-content { color: #4a3a28; }
html[data-theme="night"] body.reading,
html[data-theme="night"] .reader-page { background: #161310; }
html[data-theme="night"] .reader-content { color: #c9beb2; }
html[data-theme="night"] .reader-title,
html[data-theme="night"] .reader-meta { color: #e8ddce; border-color: #322a22; }
html[data-theme="night"] .reader-toolbar,
html[data-theme="night"] .reader-nav-btn,
html[data-theme="night"] .reader-tools button { background: #221d18; border-color: #352c24; color: #c9beb2; }
html[data-theme="night"] .reader-tools button.is-on { background: var(--brand); color: #fff; }
html[data-theme="night"] .site-header { background: rgba(22, 19, 16, .94); border-color: #2a231c; }
html[data-theme="night"] .main-nav a { color: #c9beb2; }
html[data-theme="night"] .logo { color: #fff; }

@media (max-width: 720px) {
  .reader-toolbar { position: static; }
  .reader-gate { flex-direction: column; align-items: flex-start; }
  .reader-gate .btn { width: 100%; }
}
