/* 静态站全站样式 — Nginx 直出 */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  background: #f4f1ea;
  color: #2c2420;
  line-height: 1.65;
  padding: 0 1rem 2.5rem;
  margin: 0 auto;
  max-width: 960px;
}
a { color: #6b4f2a; }
/* 整站顶栏：笔趣阁式 — 顶部工具条 + 深蓝主导航 */
.site-header {
  margin-bottom: 1rem;
}
.site-util {
  background: #e7f2f8;
  border-bottom: 1px solid #c5dae8;
  font-size: 0.82rem;
  color: #3d5566;
}
.site-util-inner {
  padding: 0.42rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.site-util-left a {
  color: #2c5f8a;
  text-decoration: none;
}
.site-util-left a:hover { text-decoration: underline; }
.util-sep {
  margin: 0 0.45rem;
  color: #8aa3b5;
}
.site-util #static-auth-mount.auth-mount,
.site-util .auth-mount { margin: 0; }
/* 主分类导航（与 Vue categories 顺序一致） */
nav.site-nav {
  background: #1a5599;
  border-bottom: 2px solid #154a87;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.06);
}
.site-nav-inner {
  padding: 0.55rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  font-size: 0.9rem;
}
nav.site-nav a {
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  padding: 0.28rem 0.65rem;
  border-radius: 4px;
}
nav.site-nav a:hover {
  background: rgb(255 255 255 / 0.12);
  text-decoration: none;
}
nav.site-nav a.nav-current {
  font-weight: 700;
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}
nav.site-nav .nav-sep {
  width: 1px;
  height: 0.9rem;
  background: rgb(255 255 255 / 0.28);
  margin: 0 0.15rem;
  flex-shrink: 0;
}
body.index-body { max-width: 960px; margin: 0 auto; }
.page-inner { padding: 0 1rem; }
nav.top { margin: 1rem 0; font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
h1 { font-size: 1.35rem; margin: 0.75rem 0 1rem; text-align: center; }
h2 { font-size: 1.15rem; margin: 1rem 0 0.5rem; }
.site-title { font-size: 1.5rem; margin: 1rem 0; }
.book-list { list-style: none; padding: 0; margin: 0; }
.book-list li {
  padding: 0.65rem 0.75rem; margin-bottom: 0.45rem;
  background: #fffcf6; border: 1px solid #e5dcc8; border-radius: 8px;
}
.book-list a { font-weight: 600; text-decoration: none; }
.book-list a:hover { text-decoration: underline; }
.meta { font-size: 0.85rem; color: #6b635a; }
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-list li { margin: 0.35rem 0; }
.chapter-list a { text-decoration: none; }
.chapter-list a:hover { text-decoration: underline; }
/* 目录页点赞 / 收藏（数据来自 /api，写入 novel_engagement.json） */
.novel-engagement {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 0.85rem 0 1.25rem;
}
.eng-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #c9b896;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: #4a361f;
}
.eng-btn:hover { background: #f0e8d8; }
.eng-btn .eng-count { font-weight: 700; margin-left: 0.25rem; }
.eng-like { border-color: #d4a574; }
.eng-fav { border-color: #8b7355; }
.eng-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.cover { max-width: 200px; border-radius: 8px; margin: 0.5rem 0; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
pre.body {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: var(--reader-font-size, 18px); line-height: 1.85; margin: 0;
}
.reader-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
  margin: 0.25rem 0 0.7rem;
}
.reader-tools-label { font-size: 0.85rem; color: #6b635a; }
.reader-btn {
  padding: 0.35rem 0.72rem; border-radius: 8px; border: 1px solid #c9b896;
  background: #fff; font-family: inherit; font-size: 0.86rem; cursor: pointer; color: #4a361f;
}
.reader-btn:hover { background: #f0e8d8; }
.mobile-hint {
  margin: 0 0 0.55rem; font-size: 0.82rem; color: #6b635a;
  display: none;
}
.theme-dark {
  background: #1b1f23;
  color: #d8dde4;
}
.theme-dark main, .theme-dark .site-header, .theme-dark .site-footer {
  background: transparent;
}
.theme-dark .tts-btn,
.theme-dark .reader-btn {
  background: #2a3138; border-color: #475361; color: #d8dde4;
}
.theme-dark .muted,
.theme-dark .reader-tools-label,
.theme-dark .tts-hint,
.theme-dark .tts-slider-val { color: #aeb8c3; }
.theme-dark .tts-hint code { background: #3a4350; }
.theme-green {
  background: #dcebd4;
  color: #2f3a2d;
}
.theme-green .tts-btn,
.theme-green .reader-btn { background: #eff8e8; }
@media (max-width: 768px) {
  .mobile-hint { display: block; }
}
.pager { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #d4cbb8;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.pager .muted { color: #6b635a; font-size: 0.9rem; }
/* 章节页朗读（调用 /tts/stream，需 Nginx 反代或与 STATIC_TTS_API_BASE 同源） */
.chapter-tts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 1rem;
}
.tts-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #c9b896;
  background: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: #4a361f;
}
.tts-btn:hover { background: #f0e8d8; }
.tts-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.tts-btn-quiet { border-color: #b0c0cc; color: #3d5566; }
.tts-hint { font-size: 0.82rem; flex: 1 1 180px; color: #6b635a; line-height: 1.45; min-width: 0; }
.tts-sliders {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem 1rem;
  flex: 0 0 auto; margin-left: auto;
}
.tts-slider {
  display: inline-flex; align-items: center; gap: 0.35rem; margin: 0;
  font-size: 0.82rem; color: #4a433a;
}
.tts-slider-label { min-width: 2em; }
.tts-slider input[type="range"] { width: 6.25rem; vertical-align: middle; }
.tts-slider-val {
  min-width: 1.25em; font-variant-numeric: tabular-nums; color: #6b635a;
}
/* 首页推荐区块 */
main.index-wide { margin: 0; padding: 0 0 1.25rem; }
h1.home-title { font-size: 1.5rem; margin: 1rem 0 0.35rem; }
p.home-lead { color: #5c534c; font-size: 0.95rem; margin: 0 0 1.25rem; line-height: 1.55; }
h2.section-h { font-size: 1.12rem; margin: 1.75rem 0 0.85rem; padding-bottom: 0.35rem; border-bottom: 1px solid #d4cbb8; }
.rec-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.15rem;
}
.rec-card {
  background: #fffcf6; border: 1px solid #e5dcc8; border-radius: 10px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.rec-card.rec-recommend {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.rec-card.rec-recommend a.tile-link { flex: 0 0 160px; }
.rec-card.rec-recommend .rec-cover-wrap {
  flex: 0 0 160px;
  width: 160px;
  aspect-ratio: 3/4;
}
.rec-card.rec-recommend .rec-body { padding: 0.75rem 0.9rem 0.95rem 0; }
.rec-card a.tile-link { display: block; text-decoration: none; color: inherit; }
.rec-cover-wrap { display: block; background: #e8e0d4; aspect-ratio: 3/4; overflow: hidden; }
.rec-cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 0.88rem; color: #6b635a; }
.rec-body { padding: 0.75rem 0.9rem 0.95rem; }
.rec-body h3 { margin: 0 0 0.4rem; font-size: 1.02rem; line-height: 1.3; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.45rem; font-size: 0.86rem; }
.rec-actions a { text-decoration: underline; }
.all-books-link { margin: 0.5rem 0 0; font-size: 0.92rem; }
.empty-rec { color: #6b635a; padding: 1rem; background: #fffcf6; border: 1px dashed #c9b896; border-radius: 8px; }
/* 主页点赞/收藏排行徽章（与 Vue 样式保持接近） */
.eng-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #c45c26;
  background: rgba(196, 92, 38, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
}
.eng-badge-fav {
  color: #2e5b2a;
  background: rgba(46, 91, 42, 0.15);
}
/* 点赞/收藏：无封面，仅做列表 */
.eng-list { list-style: none; padding: 0; margin: 0; }
.eng-list-item {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem;
  background: #fffcf6;
  border: 1px solid #e5dcc8;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}
.eng-list-item .eng-badge { margin-bottom: 0; }
.eng-info { flex: 1 1 260px; min-width: 220px; }
.eng-title { font-weight: 800; font-size: 1.02rem; color: inherit; text-decoration: none; }
.eng-title:hover { text-decoration: underline; }
.eng-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.9rem;
}
.eng-actions a { text-decoration: underline; }
/* 书籍简介（目录页 / 推荐卡片摘要） */
.novel-intro {
  margin: 0.75rem 0 1.25rem;
  padding: 0.85rem 1rem;
  background: #f8f5ee;
  border-left: 3px solid #c9b896;
  font-size: 0.95rem;
  color: #3d3830;
  white-space: pre-wrap;
  word-break: break-word;
}
.rec-intro {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  color: #5c534c;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 静态页登录（与 Vue 共用 novel_jwt + /api）— 顶栏紧凑样式 */
.auth-mount { margin-bottom: 0; }
.site-util .auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 0.82rem;
}
.auth-bar input {
  padding: 0.28rem 0.45rem; border: 1px solid #a8c0d4; border-radius: 4px;
  font-family: inherit; font-size: 0.8rem; width: 6.2rem;
  background: #fff;
}
.auth-bar input[type="password"] { width: 6.8rem; }
.auth-bar button {
  padding: 0.28rem 0.55rem; border-radius: 4px; border: 1px solid #7a9ab8;
  background: #fff; font-family: inherit; font-size: 0.78rem; cursor: pointer;
  color: #2c5f8a;
}
.auth-bar button.primary { background: #1a5599; color: #fff; border-color: #154a87; }
.site-util .auth-bar a { color: #1a5599; }
.auth-bar .auth-msg {
  color: #a94442;
  flex: 1 1 100%;
  font-size: 0.78rem;
  margin: 0;
  text-align: right;
}
.auth-bar .auth-ok { color: #2d6a3e; }
.auth-bar .sep { color: #8aa3b5; margin: 0 0.2rem; }
.auth-bar .auth-link-quiet {
  background: none;
  border: none;
  padding: 0;
  color: #1a5599;
  text-decoration: underline;
  font-size: inherit;
  cursor: pointer;
}
/* 页脚（友情连接 / 声明 / Copyright / 网站地图） */
.site-footer {
  margin-top: 2.5rem;
  padding: 1.1rem 0 1.25rem;
  background: #e8f4fc;
  color: #333;
  font-size: 0.86rem;
  text-align: center;
  line-height: 1.8;
}
.site-footer .site-footer-inner { padding: 0; }
.site-footer a {
  color: #1a5599;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.footer-links { margin: 0 0 0.35rem; }
.footer-rule {
  border: none;
  border-top: 1px dashed #b0c4d4;
  margin: 0.75rem auto;
  max-width: 88%;
}
.footer-disclaimer {
  margin: 0.5rem 0;
  padding: 0 0.25rem;
  color: #3a3a3a;
}
.footer-copy { margin: 0.45rem 0 0; color: #2c2c2c; }
