/* ============================================================
   17kan小说 · 设计系统
   Design Read: 中文网文阅读馆，暖纸/绿灯的编辑-图书馆气质。
   Dials: VARIANCE 5 / MOTION 3 / DENSITY 6。
   调色板: 松绿主色 + 暖骨白纸（taste-skill 认可的 Forest 家族），不用 AI 紫。
   字体: 宋体系衬线做正文/书名（阅读/出版语境），系统 CJK 无衬线做界面。
   圆角规则(锁定): 卡片 10px / 控件 8px / 封面 4px。
   主题锁: 整页只跟随一个主题（[data-theme] 或系统），区块不反色。
   ============================================================ */

:root {
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

  --paper: #f2ede2;      /* 暖骨白 · 页面底 */
  --surface: #fbf7ee;    /* 卡片/浮层 */
  --surface-2: #ece5d6;  /* 次级填充 */
  --ink: #221d16;        /* 暖近黑正文（非纯黑） */
  --ink-soft: #6d6555;   /* 次级文字 */
  --ink-faint: #9a9080;  /* 弱化文字 */
  --line: #ddd4c2;       /* 分隔线 */
  --line-soft: #e7dfd0;
  --accent: #23574a;     /* 松绿主色（唯一强调色） */
  --accent-ink: #1a4136; /* 深松绿 · hover */
  --on-accent: #f6f2e8;  /* 主色上的文字 */
  --amber: #a86a1f;      /* 暖赭 · 极少量点缀（章节数/热度） */
  --shadow: 24px 40px -32px rgba(40, 32, 18, 0.45);
  --shadow-sm: 0 2px 10px -6px rgba(40, 32, 18, 0.35);

  --radius-card: 10px;
  --radius-ctrl: 8px;
  --radius-cover: 4px;
  --wrap: 1180px;
}

[data-theme="dark"] {
  --paper: #15120c;
  --surface: #1e1a12;
  --surface-2: #2a251b;
  --ink: #eae3d2;
  --ink-soft: #a59b86;
  --ink-faint: #7b7261;
  --line: #322c20;
  --line-soft: #29241a;
  --accent: #74b7a0;
  --accent-ink: #8fccb6;
  --on-accent: #10231d;
  --amber: #d3a15c;
  --shadow: 24px 40px -30px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 2px 12px -6px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
main { flex: 1 0 auto; }

/* 细纹底：极淡的纸纹，固定层不参与滚动重绘 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 100, 60, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.6;
}

/* ---------------- 站头 ---------------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.head-inner { display: flex; align-items: center; gap: 12px; height: 56px; flex-wrap: nowrap; min-width: 0; }
.brand-mark {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 24px;
  color: var(--ink);
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 0; }
.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(132px, 36vw);
  object-fit: contain;
  object-position: left center;
  background: transparent;
  flex: 0 0 auto;
}
[data-theme="dark"] .brand-logo {
  background: #f6f2e8;
  border-radius: 6px;
  padding: 2px 6px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-link {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
  font-size: 15px;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: var(--radius-ctrl);
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-active { color: var(--accent-ink); font-weight: 600; }
.theme-toggle {
  flex: 0 0 auto;
  margin-inline-start: auto;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-ctrl);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
  transition: color .2s, border-color .2s, transform .1s;
}
.theme-toggle:hover { color: var(--accent-ink); border-color: var(--accent); }
.theme-toggle:active { transform: translateY(1px); }

/* ---------------- 通用块 ---------------- */
.section { padding-block: 46px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title { font-family: var(--font-serif); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
.section-more { font-size: 14px; color: var(--ink-soft); }
.section-more:hover { color: var(--accent-ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--radius-ctrl);
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .1s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-read {
  min-width: 172px;
  min-height: 48px;
  padding: 12px 28px;
  font-size: 16px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-read::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
  margin-top: 1px;
}
.btn-read:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}

/* ---------------- 首页 Hero（非居中，左内容 / 右真实封面书架）---------------- */
.hero { padding-block: 56px 30px; }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero-eyebrow { font-size: 13px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  margin: 16px 0 0;
  letter-spacing: 0.01em;
}
.hero-lede { font-size: 17px; color: var(--ink-soft); max-width: 34ch; margin: 18px 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-search { margin-top: 22px; max-width: 420px; }

/* 书架：真实封面交错排布 */
.shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.shelf .book-card:nth-child(3n+2) { transform: translateY(22px); }
.shelf .book-cover { box-shadow: var(--shadow); }
.shelf-skeleton { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.shelf-skeleton span { aspect-ratio: 3/4; border-radius: var(--radius-cover); background: var(--surface-2); }
.shelf-skeleton span:nth-child(3n+2) { transform: translateY(22px); }

/* ---------------- 分类导航条 ---------------- */
.cat-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;   /* chip 是唯一的胶囊件，规则内单独说明 */
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  transition: border-color .2s, color .2s, background .2s;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.cat-chip .cat-count { font-size: 12px; color: var(--ink-faint); }
.cat-chip.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cat-chip.is-active .cat-count { color: color-mix(in srgb, var(--on-accent) 70%, transparent); }
/* 番茄式四栏：热门/主题/角色/情节。旧 cat-strip 在注入 tag-board 后藏掉。 */
body:has(.tag-board) .cat-strip { display: none; }
.tag-board { margin: 6px 0 18px; }
.tag-tabs {
  display: flex; flex-wrap: wrap; gap: 2px 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.tag-tab {
  padding: 10px 18px 12px;
  font-size: 16px; font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0.04em;
}
.tag-tab:hover { color: var(--accent-ink); }
.tag-tab.is-active {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chips .cat-chip { padding: 7px 13px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .tag-tab { transition: none; }
}
.seo-intro { color: var(--ink-soft); font-size: 15px; line-height: 1.75; max-width: 52em; margin: 0 0 16px; }
.topic-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 18px; font-size: 14px; }
.topic-links a { color: var(--accent-ink); }

/* ---------------- 书卡网格 ---------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 22px;
}
.book-card { display: flex; flex-direction: column; gap: 10px; }
.book-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-cover);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.book-card:hover .book-cover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
/* 缺封面：已烘焙的首字书脊改成站内通用封面 */
.cover-spine {
  position: absolute; inset: 0; z-index: 1;
  background: #2f5245 url(default-cover.jpg) center / cover no-repeat;
}
.cover-glyph,
.cover-strip { display: none; }
/* rN 已烘焙的源站占位图：露出通用封面 */
img[src*="d21ca920e63ba5e820f07ad60a3b82855680512a4c70ad683d0f6ee2e85ac972"],
img[src*="c0eb794e9a029833ceba1c53e5815dbfe67b7b3d7f59cddbe73a92833f17e3d8"],
img[src*="9d72f71ddf698ba7ef9f46798c77c573c41c7725b11ee81b403361e2bc841e75"],
img[src*="0d471edb90dcd178a3698cd43a02ace0a13c9b98e6feb9de906217fd37c7d901"],
img[src*="18a70d88dd2f8ad0fbb26fcf231b4c4cde3ae203b6b0ed68455edd4682038f5a"],
img[src*="8b39e830333ae3f3d791a29c53e5815dbfe67b7b3d7f59cddbe73a92833f17e3d8"] {
  object-position: 200vw 0;
  background: #2f5245 url(default-cover.jpg) center / cover no-repeat;
}
.book-title {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card:hover .book-title { color: var(--accent-ink); }
.book-meta { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-desc {
  font-size: 13px; color: var(--ink-faint); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------------- 浏览/分类页控件 ---------------- */
.page-head { padding-block: 34px 8px; }
.page-title { font-family: var(--font-serif); font-size: 30px; margin: 0 0 6px; }
.page-sub { color: var(--ink-soft); font-size: 14.5px; }
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin: 22px 0 6px; }
.sort-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-ctrl); }
.sort-tab { border: 0; background: transparent; color: var(--ink-soft); font-size: 14px; padding: 7px 14px; border-radius: 6px; }
.sort-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding-block: 40px 8px; }
.pager .btn-ghost[disabled] { opacity: .4; pointer-events: none; }
.pager-info { font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------------- 搜索 ---------------- */
.field {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  padding: 4px 4px 4px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field input {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  font-family: inherit; font-size: 16px; padding: 10px 0; outline: none; min-width: 0;
}
.field input::placeholder { color: var(--ink-faint); }
.field .btn-primary { padding: 10px 20px; }
.search-status { margin: 20px 0 4px; font-size: 14px; color: var(--ink-soft); min-height: 20px; }
.search-scan { display: inline-block; height: 3px; width: 120px; background: var(--surface-2); border-radius: 2px; overflow: hidden; vertical-align: middle; margin-inline-start: 10px; }
.search-scan i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.search-hot { margin-top: 28px; max-width: 530px; }
.search-hot-title { font-family: var(--font-serif); font-size: 18px; margin: 0 0 14px; }
.search-hot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.search-hot-grid .book-cover { box-shadow: var(--shadow); }

/* ---------------- 详情页 ---------------- */
.detail-top {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; padding-block: 16px;
}
.detail-cover {
  width: 220px; aspect-ratio: 3/4; flex: 0 0 auto;
  border-radius: var(--radius-cover); overflow: hidden; position: relative;
  box-shadow: var(--shadow); background: var(--surface-2);
}
.detail-cover .book-cover { position: absolute; inset: 0; box-shadow: none; }
.detail-head { display: flex; flex-direction: column; align-items: center; max-width: 42rem; }
.detail-title { font-family: var(--font-serif); font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 12px; }
.detail-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--ink-soft); font-size: 14.5px; margin-bottom: 20px; }
.detail-meta b { color: var(--ink); font-weight: 600; }
.book-ended {
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.tag { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.tag-amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.detail-desc { margin-top: 26px; }
.detail-desc h2, .detail-catalog h2, .detail-recs h2 { font-family: var(--font-serif); font-size: 20px; margin: 0 0 12px; }
.detail-desc p { font-family: var(--font-serif); color: var(--ink); line-height: 1.9; margin: 0 0 0.9em; max-width: 70ch; text-indent: 2em; }
.detail-desc p:last-child { margin-bottom: 0; }
.detail-desc p.is-empty { color: var(--ink-faint); font-style: italic; text-indent: 0; }

/* rN 静态书页：覆盖已上线内联左右栏与手机端 .cover{margin-bottom:20px} */
main.book-page { padding: 12px 16px 28px; }
main.book-page nav { margin: 0 0 12px; }
main.book-page article { margin: 0; padding: 0; }
.book-page .head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}
.book-page .head > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.book-page .head h1,
.book-page .head p { margin: 0; padding: 0; }
.book-page .head h1 { font-size: 1.6rem; line-height: 1.25; }
/* 线上书页「开始阅读」是纯文字链：用 CSS 做成主按钮，不重烤 6 万页 */
.book-page .head > div > p:last-child,
.book-page .read-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0;
}
.book-page .head > div > p:last-child a:first-child,
.book-page .read-actions .btn-read {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 172px;
  padding: 12px 28px;
  border-radius: var(--radius-ctrl);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: background .2s, transform .1s, box-shadow .2s;
}
.book-page .head > div > p:last-child a:first-child::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
  margin-top: 1px;
}
.book-page .head > div > p:last-child a:first-child:hover,
.book-page .read-actions .btn-read:hover {
  background: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.book-page .head > div > p:last-child a:first-child:active,
.book-page .read-actions .btn-read:active { transform: translateY(1px); }
.book-page .head > div > p:last-child a:not(:first-child),
.book-page .read-actions .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.book-page .head > div > p:last-child a:not(:first-child):hover,
.book-page .read-actions .btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}
.book-page .cover {
  margin: 0 auto;
  padding: 0;
  line-height: 0;
}
.book-page .cover img,
.book-page .cover-placeholder {
  display: block;
  width: 150px;
  height: 210px;
  margin: 0 auto;
  object-fit: cover;
}
.book-page .cover-placeholder {
  background: #2f5245 url(default-cover.jpg) center / cover no-repeat;
  color: transparent;
  font-size: 0;
}
@media (max-width: 600px) {
  .book-page .cover { margin: 0 auto; }
}
.book-page .desc { text-align: left; margin-top: 22px; }
.book-page .desc h2,
.book-page section h2 { margin: 0 0 12px; }
.book-page .recs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 22px;
}
.book-page .rel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.book-page .rel img,
.book-page .rel .cover-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-cover);
  background: #2f5245 url(default-cover.jpg) center / cover no-repeat;
}
.book-page .rel .cover-placeholder {
  color: transparent;
  font-size: 0;
}

/* 目录固定 2/4 列，行高 44px 一刀齐；auto-fit 会把末行撑宽 */
.catalog-list,
main.book-page .catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 0;
}
@media (min-width: 640px) {
  .catalog-list,
  main.book-page .catalog {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.catalog-list a,
main.book-page .catalog a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: 15px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s, background .18s;
}
.catalog-list a:hover,
main.book-page .catalog a:hover {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}
.catalog-toggle { margin-top: 0; }
/* 线上「更多章节」是小字链：做成与章节同一行高的整行热区，不重烤 6 万页 */
.catalog-more,
main.book-page p.catalog-more {
  margin: 0;
  padding: 0;
}
.catalog-more a,
main.book-page p.catalog-more a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--surface);
  transition: color .18s, background .18s;
}
.catalog-more a::after,
main.book-page p.catalog-more a::after {
  content: "›";
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-1px);
}
.catalog-more a:hover,
main.book-page p.catalog-more a:hover {
  color: var(--accent-ink);
  background: var(--surface-2);
}

/* ---------------- 阅读器 ---------------- */
body.reader-body {
  background: var(--paper);
  touch-action: pan-y;
  overscroll-behavior-x: none;
}
.reader-head {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  transition: transform .3s ease;
}
.reader-head.hidden { transform: translateY(-100%); }
.reader-head-inner { display: flex; align-items: center; flex-wrap: nowrap; gap: 14px; height: 58px; min-width: 0; }
.reader-back { flex: 0 0 auto; white-space: nowrap; color: var(--ink-soft); font-size: 15px; }
.reader-back:hover { color: var(--accent-ink); }
.reader-book { flex: 1 1 0%; min-width: 0; font-family: var(--font-serif); font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-tools { flex: 0 0 auto; margin-inline-start: auto; display: flex; gap: 8px; }
.rtool { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-ctrl); color: var(--ink-soft); font-size: 14px; padding: 7px 12px; transition: color .2s, border-color .2s; }
.rtool:hover { color: var(--accent-ink); border-color: var(--accent); }

.reader-main { max-width: 760px; margin-inline: auto; padding: 40px 22px 20px; touch-action: pan-y; }
.chapter-swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.03em;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  white-space: nowrap;
}
.chapter-swipe-hint::before,
.chapter-swipe-hint::after {
  content: "‹";
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
}
.chapter-swipe-hint::after { content: "›"; }
.chapter-title { font-family: var(--font-serif); font-size: clamp(24px, 3.4vw, 32px); line-height: 1.3; margin: 0 0 6px; text-align: center; }
.chapter-sub { text-align: center; color: var(--ink-faint); font-size: 13.5px; margin-bottom: 34px; }
.chapter-content {
  font-family: var(--font-serif);
  font-size: var(--reader-fs, 20px);
  line-height: var(--reader-lh, 2);
  color: var(--ink);
  letter-spacing: 0.01em;
}
.chapter-content p { margin: 0 0 1.1em; text-indent: 2em; }
.chapter-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 46px 0 10px; }
.chapter-nav .btn-ghost { flex: 1; justify-content: center; }
.chapter-nav .btn-ghost[disabled] { opacity: .4; pointer-events: none; }

/* 阅读设置浮层 */
.settings-pop {
  position: fixed; right: 22px; top: 66px; z-index: 45;
  width: 260px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
  display: none;
}
.settings-pop.open { display: block; }
.settings-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.settings-row:last-child { margin-bottom: 0; }
.settings-row .label { font-size: 14px; color: var(--ink-soft); }
.stepper { display: inline-flex; gap: 6px; }
.stepper button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; color: var(--ink); font-size: 16px; line-height: 1; }
.stepper button:hover { border-color: var(--accent); color: var(--accent-ink); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-ctrl); padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; padding: 6px 12px; border-radius: 6px; }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* 目录抽屉 */
.drawer-mask { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,8,0.4); display: none; }
.drawer-mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(420px, 88vw);
  background: var(--surface); border-inline-start: 1px solid var(--line);
  transform: translateX(100%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h3 { font-family: var(--font-serif); margin: 0; font-size: 18px; }
.drawer-close { border: 0; background: transparent; font-size: 22px; color: var(--ink-soft); line-height: 1; }
.drawer-body { overflow-y: auto; padding: 8px 0; }
.drawer-body a {
  display: block; padding: 11px 20px; font-size: 14.5px; color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer-body a:hover { color: var(--accent-ink); background: var(--surface-2); }
.drawer-body a.is-current { color: var(--accent-ink); font-weight: 600; }

/* ---------------- 状态：加载/空/错误 ---------------- */
.state { text-align: center; color: var(--ink-soft); padding: 56px 20px; }
.state-title { font-family: var(--font-serif); font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 22px; }
.skeleton-grid > span { display: block; }
.sk-cover { aspect-ratio: 3/4; border-radius: var(--radius-cover); background: var(--surface-2); }
.sk-line { height: 12px; border-radius: 4px; background: var(--surface-2); margin-top: 10px; }
.sk-line.short { width: 60%; }
.spin { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 站脚 ---------------- */
.site-foot { margin-top: 40px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.foot-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; padding-block: 34px; align-items: start; }
.foot-brand .brand-mark { font-size: 22px; }
.foot-brand .brand-logo { height: 28px; max-width: 140px; }
.foot-tag { color: var(--ink-soft); font-size: 14px; margin: 6px 0 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; font-size: 14px; color: var(--ink-soft); min-width: 0; }
.foot-links a { flex: 0 0 auto; white-space: nowrap; }
.foot-links a:hover { color: var(--accent-ink); }
.foot-note { grid-column: 1 / -1; color: var(--ink-faint); font-size: 12.5px; margin: 4px 0 0; }

/* ---------------- 入场动效（MOTION 3：仅轻量淡入，尊重减弱动效）---------------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fadeUp .6s cubic-bezier(.16,1,.3,1) both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .btn-read:hover,
  .book-page .head > div > p:last-child a:first-child:hover,
  .book-page .read-actions .btn-read:hover { transform: none; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { order: -1; }
  .shelf, .shelf-skeleton { grid-template-columns: repeat(3, 1fr); max-width: 420px; }
  .search-hot { max-width: 420px; }
  .detail-cover { width: 160px; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .head-inner { gap: 6px; height: 52px; }
  .brand-mark { font-size: 21px; }
  .brand-logo { height: 22px; max-width: min(96px, 28vw); }
  .nav-link { padding: 6px 6px; font-size: 13px; }
  .theme-toggle { width: 36px; height: 36px; font-size: 15px; }
  .book-grid, .skeleton-grid, .book-page .recs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 20px 16px; }
  .section-title { font-size: 22px; }
  .detail-cover { width: 132px; }
  .btn-read,
  .book-page .head > div > p:last-child a:first-child { width: min(100%, 280px); }
  .foot-inner { grid-template-columns: 1fr; }
  .foot-links { gap: 8px 12px; }
  .reader-main { padding: 28px 18px; }
  .chapter-swipe-hint { font-size: 12.5px; padding: 6px 12px; gap: 6px; margin-bottom: 14px; }
  .reader-head-inner { gap: 8px; }
  .rtool { padding: 7px 10px; }
  .mine-grid .book-title { font-size: 13px; }
  .mine-progress { font-size: 11.5px; }
}

/* ---------------- 我的：收藏 / 最近阅读（番茄式三列封面） ---------------- */
.mine-page { padding-bottom: 48px; }
.mine-panel { margin: 8px 0 36px; }
.mine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 12px;
  max-width: 520px;
}
.mine-card { position: relative; min-width: 0; }
.mine-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  min-width: 0;
}
.mine-grid .book-cover {
  box-shadow: var(--shadow-sm);
}
.mine-grid .book-title {
  font-size: 14px;
  line-height: 1.35;
}
.mine-progress {
  font-size: 12px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mine-remove {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mine-grid.is-edit .mine-remove { display: inline-flex; }
.mine-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 28px 8px 8px;
  margin: 0;
}
.mine-note {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 8px 0 12px;
}
button.section-more {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
button.section-more:hover { color: var(--accent-ink); }
.btn-fav.is-on,
.rtool.is-on {
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* ---------------- 番茄式排行榜（小说频道） ---------------- */
.fq-rank {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin: 10px 0 36px;
}
.fq-rank-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--paper) 70%, var(--surface));
}
.fq-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.fq-rank-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-right: 1px solid var(--line-soft);
  background: var(--paper);
}
.fq-rank-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  min-height: 42px;
  padding: 8px 14px;
  text-align: left;
  cursor: pointer;
}
.fq-rank-nav button.is-on {
  color: var(--accent-ink);
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}
.fq-rank-main { min-width: 0; padding: 14px 16px 8px; }
.fq-rank-gender {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.fq-rank-gender button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 36px;
  padding: 4px 4px 8px;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
}
.fq-rank-gender button.is-on {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.fq-rank-hint {
  margin: 0 0 12px;
  color: var(--ink-faint);
  font-size: 13px;
}
.fq-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fq-rank-item a {
  display: grid;
  grid-template-columns: 36px 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
}
.fq-rank-item:last-child a { border-bottom: 0; }
.fq-pos {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.fq-pos-1 { color: #c45a12; }
.fq-pos-2 { color: #8a7a4a; }
.fq-pos-3 { color: #a86a1f; }
.fq-rank-item .book-cover {
  width: 64px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-cover);
  box-shadow: var(--shadow-sm);
}
.fq-rank-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.fq-rank-copy .book-title {
  font-size: 16px;
  -webkit-line-clamp: 1;
}
.fq-rank-author,
.fq-rank-tags,
.fq-rank-heat {
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fq-rank-heat { color: var(--amber); }
.fq-rank-empty {
  margin: 28px 0;
  text-align: center;
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .fq-rank { grid-template-columns: 1fr; }
  .fq-rank-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 8px 10px;
    scrollbar-width: none;
  }
  .fq-rank-nav::-webkit-scrollbar { display: none; }
  .fq-rank-nav button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .fq-rank-nav button.is-on { box-shadow: none; background: var(--accent); color: var(--on-accent); }
  .fq-rank-item a { grid-template-columns: 28px 52px minmax(0, 1fr); gap: 10px; }
  .fq-rank-item .book-cover { width: 52px; }
  .fq-pos { font-size: 17px; }
}
