/* =========================================================================
   NovaNovel Design System — 第八看
   现代极简 · 内容优先 · 高级留白
   ========================================================================= */

:root {
  /* 色彩 */
  --primary:        #FF6B35;
  --primary-hover:  #FF5722;
  --bg:             #F8F9FA;
  --card:           #FFFFFF;
  --text:           #111827;
  --text-2:         #6B7280;
  --border:         #E5E7EB;
  --success:        #10B981;
  --warning:        #F59E0B;
  --error:          #EF4444;

  --primary-soft:   rgba(255, 107, 53, 0.10);
  --primary-soft-2: rgba(255, 107, 53, 0.18);

  /* 圆角 */
  --r-btn:    12px;
  --r-card:   16px;
  --r-dialog: 20px;
  --r-pill:   999px;

  /* 阴影 */
  --shadow-card:  0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-pop:   0 12px 40px rgba(0, 0, 0, 0.12);

  /* 布局 */
  --max:     1440px;
  --content: 1280px;
  --header-h: 72px;

  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "PingFang SC", serif;

  /* 阅读器（运行时被 JS 覆盖） */
  --reader-font-size: 20px;
  --reader-line-height: 2.0;
  --reader-font: var(--font-sans);
}

/* 暗黑模式 */
html[data-theme="dark"] {
  --primary:        #FF7A47;
  --primary-hover:  #FF8A5C;
  --bg:             #0F1115;
  --card:           #171A21;
  --text:           #E7E9EE;
  --text-2:         #9AA1AD;
  --border:         #262B36;
  --primary-soft:   rgba(255, 122, 71, 0.12);
  --primary-soft-2: rgba(255, 122, 71, 0.22);
  --shadow-card:  0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-pop:   0 12px 40px rgba(0, 0, 0, 0.6);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

.container { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--r-btn); font-weight: 600; font-size: 15px;
  cursor: pointer; transition: all .2s ease; white-space: nowrap; line-height: 1;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px var(--primary-soft-2); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft-2); transform: translateY(-2px); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text-2); background: var(--card); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s ease, background-color .3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-card); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 4px 12px var(--primary-soft-2);
}
.logo-icon.small { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
.logo-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.logo-name em { color: var(--primary); font-style: normal; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 14px; border-radius: 10px; font-size: 15px; font-weight: 500;
  color: var(--text-2); transition: all .2s ease;
}
.main-nav a:hover { color: var(--text); background: var(--bg); }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); }

.header-search { flex: 1; max-width: 460px; margin: 0 auto; position: relative; }
.header-search input {
  width: 100%; height: 42px; border: 1.5px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg); padding: 0 44px 0 18px; font-size: 14px; color: var(--text);
  transition: all .2s ease;
}
.header-search input::placeholder { color: var(--text-2); }
.header-search input:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px var(--primary-soft); }
.header-search .search-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2);
}
.header-search .search-btn:hover { color: var(--primary); }
.header-search svg { width: 18px; height: 18px; }

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-2); transition: all .2s ease;
}
.icon-btn:hover { color: var(--primary); background: var(--bg); }
.icon-btn svg { width: 20px; height: 20px; }
.header-actions .link-login { padding: 8px 14px; font-weight: 600; color: var(--text-2); border-radius: 10px; }
.header-actions .link-login:hover { color: var(--text); }
.header-actions .link-register { padding: 8px 18px; font-weight: 600; color: #fff; background: var(--primary); border-radius: var(--r-btn); }
.header-actions .link-register:hover { background: var(--primary-hover); }

/* =========================================================================
   首页
   ========================================================================= */
.section { padding: 40px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-title { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: var(--primary); }
.section-sub { font-size: 13px; color: var(--text-2); font-weight: 400; }
.see-all { font-size: 14px; color: var(--text-2); font-weight: 500; transition: color .2s; }
.see-all:hover { color: var(--primary); }

/* Hero */
.hero { padding: 28px 0 8px; }
.hero-banner {
  position: relative; border-radius: var(--r-dialog); overflow: hidden; min-height: 420px;
  background: linear-gradient(120deg, #1f2430, #2b3242);
  box-shadow: var(--shadow-card); display: flex;
}
.hero-slide {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 48px; padding: 56px;
  opacity: 0; transition: opacity .7s ease; pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-cover {
  width: 220px; height: 300px; flex-shrink: 0; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45); background: #11141b;
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 72px; font-weight: 800;
  color: rgba(255,255,255,.85); background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.hero-text { color: #fff; max-width: 560px; }
.hero-tag { display: inline-block; padding: 5px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.15); margin-bottom: 16px; backdrop-filter: blur(4px); }
.hero-title { font-size: 40px; line-height: 1.15; margin-bottom: 14px; }
.hero-author { font-size: 15px; opacity: .8; margin-bottom: 14px; }
.hero-desc { font-size: 15px; line-height: 1.8; opacity: .85; margin-bottom: 26px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; }
.hero .btn-primary { padding: 13px 28px; }
.hero-ghost { background: rgba(255,255,255,.15); color: #fff; }
.hero-ghost:hover { background: rgba(255,255,255,.25); transform: translateY(-2px); }
.hero-dots { position: absolute; bottom: 22px; left: 56px; display: flex; gap: 8px; z-index: 3; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; transition: all .3s; }
.hero-dot.active { background: #fff; width: 26px; border-radius: 5px; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(4px); transition: background .2s; }
.hero-arrow:hover { background: rgba(255,255,255,.3); }
.hero-arrow.prev { left: 18px; } .hero-arrow.next { right: 18px; }
.hero-arrow svg { width: 22px; height: 22px; }

/* 分类导航 */
.genre-nav-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 14px; }
.genre-nav-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: all .25s ease; box-shadow: var(--shadow-card);
}
.genre-nav-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: transparent; }
.genre-nav-card .gn-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: var(--primary-soft); transition: all .25s ease;
}
.genre-nav-card:hover .gn-icon { background: var(--primary); transform: scale(1.08) rotate(-4deg); }
.genre-nav-card .gn-name { font-size: 14px; font-weight: 600; }

/* =========================================================================
   小说卡片 / 网格
   ========================================================================= */
.novel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.novel-grid-6 { grid-template-columns: repeat(6, 1fr); }
.novel-grid-wide { grid-template-columns: repeat(5, 1fr); }

.novel-card {
  position: relative;
  background: var(--card); border-radius: var(--r-card); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease; height: 100%;
}
.novel-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.novel-card-link { display: flex; flex-direction: column; height: 100%; }
.novel-cover-wrap { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg); }
.novel-cover { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.novel-card:hover .novel-cover { transform: scale(1.06); }
.novel-cover-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 52px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); transition: transform .4s ease;
}
.novel-card:hover .novel-cover-placeholder { transform: scale(1.06); }
.novel-status {
  position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; color: #fff; backdrop-filter: blur(4px);
  background: rgba(17,24,39,.55);
}
.novel-status.completed { background: rgba(16,185,129,.92); }
.novel-status.ongoing { background: rgba(255,107,53,.92); }
.novel-score-badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; color: #fff; background: rgba(17,24,39,.6);
  backdrop-filter: blur(4px); display: flex; align-items: center; gap: 3px;
}
.novel-score-badge svg { width: 12px; height: 12px; fill: var(--warning); }
.novel-info { padding: 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.novel-title {
  font-size: 16px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.novel-card:hover .novel-title { color: var(--primary); }
.novel-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.novel-meta .meta-genre { color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: var(--r-pill); }
.novel-desc {
  font-size: 13px; color: var(--text-2); line-height: 1.7; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.novel-stats { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-2); margin-top: auto; padding-top: 4px; }
.novel-stats span { display: flex; align-items: center; gap: 3px; }
.novel-stats svg { width: 13px; height: 13px; opacity: .7; }

/* 排行榜列表项（带名次） */
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-item { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 12px; transition: background .2s; }
.rank-item:hover { background: var(--bg); }
.rank-no { width: 26px; flex-shrink: 0; text-align: center; font-size: 16px; font-weight: 800; font-style: italic; color: var(--text-2); }
.rank-item:nth-child(1) .rank-no { color: #FF6B35; }
.rank-item:nth-child(2) .rank-no { color: #F59E0B; }
.rank-item:nth-child(3) .rank-no { color: #FBBF24; }
.rank-cover { width: 48px; height: 64px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg); }
.rank-cover img { width: 100%; height: 100%; object-fit: cover; }
.rank-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.rank-body { min-width: 0; flex: 1; }
.rank-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item:hover .rank-name { color: var(--primary); }
.rank-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 横向滚动（新书榜） */
.h-scroll { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.h-scroll::-webkit-scrollbar { height: 6px; }
.h-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.h-scroll > * { scroll-snap-align: start; flex: 0 0 200px; }

/* 双栏（热门 + 排行榜） */
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 20px; }
.panel-title { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Tabs */
.tabs { display: inline-flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: var(--r-pill); }
.tab { padding: 7px 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--text-2); transition: all .2s; cursor: pointer; }
.tab.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-card); }

/* =========================================================================
   通用页面 / 面包屑 / 筛选
   ========================================================================= */
.page-content { padding: 32px 0 64px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 30px; margin-bottom: 6px; }
.page-subtitle { color: var(--text-2); font-size: 15px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-bottom: 22px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span.sep { opacity: .5; }
.empty-tip { text-align: center; color: var(--text-2); padding: 60px 0; }

.filter-bar { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 8px 20px; margin-bottom: 28px; box-shadow: var(--shadow-card); }
.filter-row { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.filter-row:last-child { border-bottom: none; }
.filter-label { flex-shrink: 0; width: 64px; font-size: 14px; font-weight: 600; color: var(--text-2); padding-top: 5px; }
.filter-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-opt { padding: 5px 14px; border-radius: var(--r-pill); font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .2s; }
.filter-opt:hover { color: var(--primary); }
.filter-opt.active { background: var(--primary); color: #fff; font-weight: 600; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card); font-weight: 600; color: var(--text-2); transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* 分类索引 */
.genre-index-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.genre-index-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: all .25s;
}
.genre-index-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.genre-index-card .gi-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: var(--primary-soft); transition: background .25s; }
.genre-index-card:hover .gi-icon { background: var(--primary); }
.genre-index-card .gi-name { font-size: 16px; font-weight: 700; }
.genre-index-card .gi-count { font-size: 13px; color: var(--text-2); }

/* =========================================================================
   小说详情页
   ========================================================================= */
.detail-hero { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-dialog); box-shadow: var(--shadow-card); padding: 32px; margin-bottom: 28px; }
.detail-top { display: flex; gap: 32px; }
.detail-cover { width: 200px; height: 270px; flex-shrink: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-hover); background: var(--bg); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 64px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.detail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-title { font-size: 30px; margin-bottom: 12px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.badge { padding: 4px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.badge.author { background: var(--bg); color: var(--text); }
.badge.genre { background: var(--primary-soft); color: var(--primary); }
.badge.status { background: var(--success); color: #fff; }
.badge.status.ongoing { background: var(--primary); }
.detail-stats { display: flex; gap: 36px; margin-bottom: 22px; flex-wrap: wrap; }
.detail-stat { text-align: left; }
.detail-stat .ds-num { font-size: 24px; font-weight: 800; line-height: 1; color: var(--text); }
.detail-stat .ds-num.score { color: var(--warning); }
.detail-stat .ds-label { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.detail-actions { display: flex; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.tag { padding: 5px 14px; border-radius: var(--r-pill); font-size: 13px; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); transition: all .2s; }
.tag:hover { border-color: var(--primary); color: var(--primary); }

.detail-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 24px 28px; margin-bottom: 24px; }
.detail-section h2 { font-size: 19px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.detail-desc { font-size: 15px; line-height: 1.9; color: var(--text-2); }
.detail-desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { display: inline-block; margin-top: 10px; color: var(--primary); font-weight: 600; font-size: 14px; cursor: pointer; }

/* 目录 */
.toc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toc-head h2 { margin: 0; }
.toc-order { font-size: 14px; color: var(--text-2); cursor: pointer; display: flex; align-items: center; gap: 5px; user-select: none; }
.toc-order:hover { color: var(--primary); }
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chapter-grid.reversed { display: grid; }
.chapter-link {
  display: flex; align-items: baseline; gap: 8px; padding: 11px 14px; border-radius: 10px; background: var(--bg);
  font-size: 14px; transition: all .2s; min-width: 0; border: 1px solid transparent;
}
.chapter-link:hover { background: var(--card); border-color: var(--primary); color: var(--primary); }
.chapter-link .ch-num { font-size: 12px; color: var(--text-2); flex-shrink: 0; font-weight: 600; }
.chapter-link:hover .ch-num { color: var(--primary); }
.chapter-link .ch-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-link.hidden-ch { display: none; }
.toc-more { text-align: center; margin-top: 18px; }

/* 评论区（UI） */
.comment-box { display: flex; gap: 12px; margin-bottom: 24px; }
.comment-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); display: grid; place-items: center; color: #fff; font-weight: 700; }
.comment-input-wrap { flex: 1; }
.comment-input { width: 100%; min-height: 84px; resize: vertical; border: 1.5px solid var(--border); border-radius: var(--r-btn); background: var(--bg); padding: 12px 14px; font-size: 14px; font-family: inherit; color: var(--text); }
.comment-input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.comment-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.comment-empty { text-align: center; color: var(--text-2); padding: 30px 0; }
.comment-item { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.comment-item .c-body { flex: 1; }
.comment-item .c-name { font-weight: 600; font-size: 14px; }
.comment-item .c-time { font-size: 12px; color: var(--text-2); margin-left: 8px; font-weight: 400; }
.comment-item .c-text { font-size: 14px; line-height: 1.7; margin: 4px 0 0; }

/* =========================================================================
   阅读页
   ========================================================================= */
.reader-topbar {
  position: sticky; top: 0; z-index: 50; height: 56px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.reader-topbar-inner { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reader-topbar .rt-left, .reader-topbar .rt-right { display: flex; align-items: center; gap: 4px; }
.rt-back { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-radius: 10px; max-width: 44vw; }
.rt-back:hover { color: var(--primary); background: var(--bg); }
.rt-back svg { width: 18px; height: 18px; flex-shrink: 0; }
.rt-back .rt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.reader-wrap { min-height: 100vh; }
.reader-article { padding: 40px 0 80px; }
.reader-container { max-width: 900px; }
.reader-paper { max-width: 780px; margin: 0 auto; }
.reader-chapter-title { font-size: 28px; line-height: 1.4; margin-bottom: 12px; text-align: center; }
.reader-meta { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 40px; }
.reader-content {
  font-family: var(--reader-font);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  color: var(--text);
}
.reader-content p { margin: 0 0 16px; text-indent: 2em; }

/* 阅读背景主题 */
html[data-reader-bg="paper"] body { background: #f7f3ea; }
html[data-reader-bg="paper"] .reader-content,
html[data-reader-bg="paper"] .reader-chapter-title { color: #3a3326; }
html[data-reader-bg="green"] body { background: #cce8cf; }
html[data-reader-bg="green"] .reader-content,
html[data-reader-bg="green"] .reader-chapter-title { color: #2a3a2c; }

.chapter-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0; }
.chapter-nav.bottom { margin-top: 48px; }
.nav-btn { padding: 12px 26px; border-radius: var(--r-btn); background: var(--card); border: 1px solid var(--border); font-weight: 600; color: var(--text); transition: all .2s; }
.nav-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.nav-btn.toc { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.nav-btn.disabled { opacity: .4; pointer-events: none; }

/* =========================================================================
   抽屉 / 弹窗（阅读设置）
   ========================================================================= */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; opacity: 0; visibility: hidden; transition: opacity .3s; }
.drawer-mask.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 360px; max-width: 86vw; z-index: 201;
  background: var(--card); box-shadow: var(--shadow-pop); transform: translateX(100%); transition: transform .3s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 18px; }
.drawer-body { padding: 22px; overflow-y: auto; }
.setting-group { margin-bottom: 26px; }
.setting-group > label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 56px; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); font-weight: 600; color: var(--text-2); transition: all .2s; }
.seg button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row button { width: 44px; height: 44px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--bg); font-size: 20px; font-weight: 700; color: var(--text); }
.size-row .size-val { flex: 1; text-align: center; font-weight: 700; font-size: 16px; }
.bg-swatches { display: flex; gap: 12px; }
.bg-swatch { width: 44px; height: 44px; border-radius: 11px; border: 2px solid var(--border); cursor: pointer; transition: all .2s; }
.bg-swatch.active { border-color: var(--primary); transform: scale(1.06); }
.bg-swatch[data-bg="white"] { background: #fff; }
.bg-swatch[data-bg="paper"] { background: #f7f3ea; }
.bg-swatch[data-bg="green"] { background: #cce8cf; }
.bg-swatch[data-bg="dark"] { background: #171a21; }

/* =========================================================================
   书架 / 登录
   ========================================================================= */
.shelf-tabs { display: flex; gap: 6px; margin-bottom: 24px; }
.shelf-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.shelf-empty { text-align: center; padding: 80px 0; color: var(--text-2); }
.shelf-empty svg { width: 64px; height: 64px; opacity: .3; margin-bottom: 16px; }
.shelf-empty .btn { margin-top: 20px; }
.shelf-progress { font-size: 12px; color: var(--primary); margin-top: 4px; }
.shelf-remove { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(17,24,39,.6); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .2s; z-index: 3; cursor: pointer; }
.novel-card:hover .shelf-remove { opacity: 1; }
.shelf-remove svg { width: 14px; height: 14px; }

.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-dialog); box-shadow: var(--shadow-card); padding: 40px 36px; }
.auth-card h1 { font-size: 26px; text-align: center; margin-bottom: 8px; }
.auth-sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: var(--r-pill); margin-bottom: 24px; }
.auth-tabs .tab { flex: 1; text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field input { width: 100%; height: 46px; border: 1.5px solid var(--border); border-radius: var(--r-btn); background: var(--bg); padding: 0 16px; font-size: 15px; color: var(--text); }
.field input:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px var(--primary-soft); }
.field-code { display: flex; gap: 10px; }
.field-code input { flex: 1; }
.field-code button { flex-shrink: 0; padding: 0 16px; border-radius: var(--r-btn); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.auth-oauth { margin-top: 26px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.oauth-row { display: flex; justify-content: center; gap: 14px; }
.oauth-btn { width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--border); display: grid; place-items: center; font-weight: 700; transition: all .2s; }
.oauth-btn:hover { border-color: var(--primary); transform: translateY(-2px); }

/* =========================================================================
   搜索页
   ========================================================================= */
.search-hero { max-width: 720px; margin: 0 auto 32px; }
.search-big { position: relative; }
.search-big input { width: 100%; height: 58px; border: 2px solid var(--border); border-radius: var(--r-pill); background: var(--card); padding: 0 64px 0 24px; font-size: 17px; color: var(--text); box-shadow: var(--shadow-card); }
.search-big input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-big button { position: absolute; right: 8px; top: 8px; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
.search-big svg { width: 20px; height: 20px; }
.search-meta { margin: 24px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-chip { padding: 6px 14px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--border); font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .2s; }
.search-chip:hover { border-color: var(--primary); color: var(--primary); }
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; cursor: pointer; transition: background .2s; }
.hot-item:hover { background: var(--bg); }
.hot-rank { width: 22px; font-weight: 800; font-style: italic; color: var(--text-2); }
.hot-item:nth-child(-n+3) .hot-rank { color: var(--primary); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--card); border-top: 1px solid var(--border); margin-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding: 48px 0 36px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-slogan { color: var(--text-2); font-size: 14px; line-height: 1.7; margin: 0; max-width: 280px; }
.footer-col h4 { font-size: 15px; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-2); font-size: 14px; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; }
.footer-bottom p { margin: 0; text-align: center; color: var(--text-2); font-size: 13px; }

/* =========================================================================
   移动端底部导航
   ========================================================================= */
.bottom-nav { display: none; }

/* =========================================================================
   响应式
   ========================================================================= */
@media (max-width: 1100px) {
  .genre-nav-grid { grid-template-columns: repeat(5, 1fr); }
  .novel-grid { grid-template-columns: repeat(3, 1fr); }
  .novel-grid-6 { grid-template-columns: repeat(4, 1fr); }
  .novel-grid-wide { grid-template-columns: repeat(4, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .genre-index-grid { grid-template-columns: repeat(4, 1fr); }
  .shelf-grid { grid-template-columns: repeat(4, 1fr); }
  .chapter-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 820px) {
  .header-search { display: none; }
  .main-nav { display: none; }
  .header-actions .link-login, .header-actions .link-register { display: none; }
  .header-inner { justify-content: space-between; }
  .hero-banner { min-height: 0; }
  .hero-slide { position: relative; flex-direction: column; text-align: center; padding: 32px 24px; gap: 22px; }
  .hero-slide:not(.active) { display: none; }
  .hero-cover { width: 140px; height: 190px; }
  .hero-title { font-size: 26px; }
  .hero-desc { -webkit-line-clamp: 2; }
  .hero-dots { left: 50%; transform: translateX(-50%); bottom: 14px; }
  .hero-arrow { display: none; }
  .novel-grid, .novel-grid-6, .novel-grid-wide { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .genre-nav-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .genre-nav-card { padding: 14px 6px; }
  .genre-nav-card .gn-icon { width: 40px; height: 40px; font-size: 20px; }
  .genre-index-grid { grid-template-columns: repeat(3, 1fr); }
  .shelf-grid { grid-template-columns: repeat(3, 1fr); }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-top { flex-direction: column; align-items: center; text-align: center; }
  .detail-cover { width: 150px; height: 200px; }
  .detail-badges, .detail-stats, .detail-actions { justify-content: center; }
  .detail-stats { gap: 24px; }
  .detail-title { font-size: 24px; }
  .reader-chapter-title { font-size: 22px; }
  .page-content { padding: 20px 0 40px; }
  .section { padding: 28px 0; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 16px; }
  .filter-label { width: 48px; }

  /* 移动端底部 Tab 栏 */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; height: 60px;
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-2); }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav svg { width: 22px; height: 22px; }
  body { padding-bottom: 60px; }
  body.reading { padding-bottom: 0; }
  body.reading .bottom-nav { display: none; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .genre-nav-grid, .genre-index-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-hero, .detail-section { padding: 20px; }
}

/* 动画 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: fadeUp .5s ease both; }
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 37%, var(--border) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

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