﻿/* ==========================================================================
   TX漫画 — 前端样式表
   参考 dongman.la 的信息结构，去掉动漫资讯，最近更新改为顶部图片模式
   ========================================================================== */

:root {
  --brand: #ff5b3c;
  --brand-2: #ff8f3c;
  --brand-dark: #e8401f;
  --brand-soft: #fff2ee;
  --ink: #1b1f27;
  --ink-2: #495060;
  --muted: #8b91a3;
  --muted-2: #aab0c0;
  --bg: #f5f6fa;
  --card: #fff;
  --line: #eef0f6;
  --line-2: #e3e6ef;
  --dark: #14161d;
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-s: 0 2px 8px rgba(23, 28, 45, .05);
  --shadow: 0 8px 28px rgba(23, 28, 45, .07);
  --shadow-l: 0 18px 50px rgba(23, 28, 45, .13);
  --container: 1280px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { -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: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
input, select { font: inherit; color: inherit; }

::selection { background: rgba(255, 91, 60, .22); }

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

/* ---------- 顶部条 / 头部 ---------- */
.topbar {
  background: #1b1f27;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
}
.topbar .container {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 34px;
}
.topbar a:hover { color: #fff; }
.topbar .dot { width: 6px; height: 6px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .16); }
.topbar-right { margin-left: auto; display: flex; gap: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-main {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(255, 91, 60, .3);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.brand-name em { font-style: normal; color: var(--brand); }
.brand-sub { font-size: 10px; color: var(--muted-2); letter-spacing: 2px; }

.search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search form {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 6px 0 14px;
  background: #f3f4f8;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: .2s;
}
.search form:focus-within {
  background: #fff;
  border-color: rgba(255, 91, 60, .45);
  box-shadow: 0 0 0 4px rgba(255, 91, 60, .1);
}
.search svg { width: 17px; height: 17px; color: var(--muted-2); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 13.5px;
}
.search input::placeholder { color: var(--muted-2); }
.search-submit {
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-l);
  padding: 8px;
  display: none;
  z-index: 60;
  max-height: 380px;
  overflow: auto;
}
.search-suggest.open { display: block; }
.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
}
.suggest-item:hover { background: var(--brand-soft); }
.suggest-item img { width: 34px; height: 45px; border-radius: 6px; object-fit: cover; background: #eef0f6; }
.suggest-item b { font-size: 13.5px; font-weight: 600; }
.suggest-item span { margin-left: auto; font-size: 12px; color: var(--muted); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13px;
  transition: .18s;
}
.icon-btn:hover { background: #f3f4f8; color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .count {
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--brand); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
}

/* ---------- 频道导航 ---------- */
.site-nav { border-bottom: 1px solid var(--line); background: #fff; }
.nav-scroller {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-scroller::-webkit-scrollbar { display: none; }
.nav-link {
  position: relative;
  flex: none;
  padding: 0 14px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .18s;
}
.nav-link:hover { color: var(--brand); }
.nav-link.active { color: var(--brand); font-weight: 700; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.genre-nav { border-bottom: 1px solid var(--line); background: #fbfbfd; }
.genre-nav .container {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.genre-nav .container::-webkit-scrollbar { display: none; }
.genre-nav a {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-2);
  transition: .18s;
}
.genre-nav a:hover { color: var(--brand); border-color: rgba(255, 91, 60, .45); background: var(--brand-soft); }

/* 滚动后收起题材条，让吸顶头部更矮 */
.site-header .header-main,
.site-header .nav-scroller,
.site-header .nav-link { transition: height .22s ease; }
.site-header.compact .genre-nav { display: none; }
.site-header.compact .header-main { height: 56px; }
.site-header.compact .nav-scroller { height: 42px; }
.site-header.compact .nav-link { height: 42px; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  transition: .18s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 91, 60, .26);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(255, 91, 60, .32); }
.btn-ghost { background: #f3f4f8; color: var(--ink-2); }
.btn-ghost:hover { background: #e9ebf2; color: var(--ink); }
.btn-line { background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); }
.btn-line:hover { border-color: rgba(255, 91, 60, .5); color: var(--brand); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

/* ---------- 顶部「最近更新」图片墙 ---------- */
.band-updates {
  position: relative;
  padding: 26px 0 8px;
  background:
    radial-gradient(1000px 320px at 12% -20%, rgba(255, 143, 60, .18), transparent 70%),
    radial-gradient(800px 300px at 88% -30%, rgba(255, 91, 60, .14), transparent 70%),
    linear-gradient(180deg, #fff 0%, #f7f8fc 100%);
  border-bottom: 1px solid var(--line);
}
.updates-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  padding: 22px 24px 26px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title h1, .panel-title h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .5px;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
}
.live-badge i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(255, 91, 60, .7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 6px rgba(255, 91, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 91, 60, 0); }
}
.tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tab {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: #f4f5f9;
}
.tab:hover { color: var(--brand); }
.tab.active { background: var(--ink); color: #fff; font-weight: 600; }
.tab.active:hover { color: #fff; }
.panel-head .btn-ghost { margin-left: auto; }
.panel-head .btn-ghost svg { width: 15px; height: 15px; }

/* ---------- 封面卡片 ---------- */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 22px 18px;
}
.cover-grid-lg { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.cover-grid-sm { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 18px 14px; }

.m-card { display: block; position: relative; }
.m-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #eceef5, #f6f7fb);
  box-shadow: 0 4px 14px rgba(23, 28, 45, .08);
  transition: box-shadow .28s, transform .28s;
}
.m-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}
.m-card:hover .m-cover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(23, 28, 45, .18); }
.m-card:hover .m-cover img { transform: scale(1.05); }

.m-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  color: #fff;
  background: rgba(20, 22, 29, .62);
  backdrop-filter: blur(6px);
}
.m-badge.is-finish { background: rgba(255, 255, 255, .92); color: var(--brand-dark); }
.m-badge.is-new { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }

.m-chapter {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 22px 9px 8px;
  font-size: 11.5px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(12, 14, 20, .82));
  display: flex;
  align-items: center;
  gap: 6px;
}
.m-chapter em { font-style: normal; opacity: .72; margin-left: auto; font-size: 10.5px; }

.m-hover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(16, 18, 26, .45);
  opacity: 0;
  transition: opacity .25s;
}
.m-card:hover .m-hover { opacity: 1; }
.m-hover .play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  display: grid;
  place-items: center;
  color: var(--brand);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transform: scale(.85);
  transition: transform .25s;
}
.m-card:hover .m-hover .play { transform: scale(1); }
.m-hover .play svg { width: 18px; height: 18px; margin-left: 2px; }

.m-title {
  margin-top: 9px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .18s;
}
.m-card:hover .m-title { color: var(--brand); }
.m-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.m-meta span { overflow: hidden; text-overflow: ellipsis; }
.m-meta .sep { color: var(--line-2); }

/* ---------- 排行榜 ---------- */
.rank-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.rank-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: 18px 20px 12px;
}
.rank-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.rank-card h3 { font-size: 15.5px; font-weight: 700; }
.rank-card header em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
}
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.rank-list li:first-child { border-top: 0; }
.rank-no {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: #f2f3f8;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.rank-no.n1 { background: linear-gradient(135deg, #ff7a45, #ff3d2e); color: #fff; }
.rank-no.n2 { background: linear-gradient(135deg, #ffb03a, #ff8a1f); color: #fff; }
.rank-no.n3 { background: linear-gradient(135deg, #ffd166, #ffb703); color: #fff; }
.rank-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name:hover { color: var(--brand); }
.rank-chapter { margin-left: auto; flex: none; font-size: 11.5px; color: var(--muted); }

/* ---------- 分区板块 ---------- */
.section { margin-top: 26px; }
.sec {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  padding: 22px 24px 26px;
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sec-title {
  position: relative;
  padding-left: 13px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .4px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.sec-sub { font-size: 12.5px; color: var(--muted); }
.sec-more {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
  transition: color .18s;
}
.sec-more:hover { color: var(--brand); }
.sec-more svg { width: 14px; height: 14px; }

/* ---------- 列表页 ---------- */
.page-hero {
  padding: 26px 0 0;
}
.page-hero .container { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.page-hero p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-hero .crumb { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.page-hero .crumb a:hover { color: var(--brand); }

.filter-bar {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 18px;
  box-shadow: var(--shadow-s);
}
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}
.filter-row:first-child { border-top: 0; }
.filter-label { flex: none; width: 48px; padding-top: 4px; font-size: 13px; color: var(--muted); }
.filter-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: #f5f6fa;
  display: inline-flex;
  align-items: center;
  transition: .16s;
}
.chip:hover { color: var(--brand); background: var(--brand-soft); }
.chip.active { background: var(--brand); color: #fff; font-weight: 600; }
.chip.active:hover { color: #fff; }

.list-toolbar {  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.list-toolbar .sort { display: flex; gap: 4px; margin-left: auto; }
.list-toolbar .sort button { padding: 5px 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); background: #eef0f6; }
.list-toolbar .sort button.active { background: var(--ink); color: #fff; }

.empty {
  padding: 70px 0;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--line-2); }
.empty b { display: block; font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 28px 0 6px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
}
.pagination a:hover { border-color: rgba(255, 91, 60, .5); color: var(--brand); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pagination .disabled { color: var(--muted-2); background: #f6f7fb; }
.pagination .dots { border: 0; background: none; }

/* ---------- 分类页题材卡片 ---------- */
.genre-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.genre-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f8fc;
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: .16s;
}
.genre-card span {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.genre-card:hover { border-color: rgba(255, 91, 60, .42); background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 详情页 ---------- */
.detail-hero {
  margin-top: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  gap: 26px;
}
.detail-cover {
  flex: none;
  width: 208px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(23, 28, 45, .18);
  background: #eef0f6;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-eyebrow { font-size: 11.5px; letter-spacing: 2px; color: var(--muted-2); font-weight: 600; }
.detail-info h1 { font-size: 27px; line-height: 1.3; font-weight: 800; margin: 6px 0 10px; }
.detail-facts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill-on { background: #eafaf1; color: #0f9d58; }
.pill-off { background: #f1f3f9; color: var(--ink-2); }
.pill-tag { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.pill-tag:hover { background: #ffe4dc; }
.detail-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--ink-2); }
.detail-meta b { color: var(--muted); font-weight: 400; margin-right: 4px; }
.detail-desc {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-desc.open { -webkit-line-clamp: unset; }
.detail-actions { margin-top: auto; padding-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-stats { display: flex; gap: 18px; margin-left: auto; font-size: 12px; color: var(--muted); }
.detail-stats b { display: block; font-size: 16px; color: var(--ink); font-weight: 700; }

.chapter-sec { margin-top: 22px; }
.chapter-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.toggle-group { display: inline-flex; padding: 3px; border-radius: 10px; background: #f2f3f8; }
.toggle-group button { height: 26px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); }
.toggle-group button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 2px 6px rgba(23, 28, 45, .08); }
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}
.chapter-grid::-webkit-scrollbar { width: 6px; }
.chapter-grid::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.chapter-chip {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f6f7fb;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: .16s;
}
.chapter-chip:hover { background: var(--brand-soft); color: var(--brand-dark); }
.chapter-chip.is-latest { background: #fff3ef; color: var(--brand-dark); font-weight: 600; }
.related { margin-top: 22px; }

/* ---------- 阅读器 ---------- */
body[data-page="reader"] { background: var(--dark); color: #e8eaf0; }
.reader-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 22, 29, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.reader-top .container { display: flex; align-items: center; gap: 12px; height: 56px; }
.reader-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.reader-back:hover { color: #fff; }
.reader-back svg { width: 16px; height: 16px; }
.reader-title { font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.reader-title em { font-style: normal; color: rgba(255, 255, 255, .5); font-weight: 400; margin-left: 8px; font-size: 12.5px; }
.reader-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.reader-tools button, .reader-tools a {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .74);
  background: rgba(255, 255, 255, .06);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: .16s;
}
.reader-tools button:hover, .reader-tools a:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.reader-tools button:disabled { opacity: .35; cursor: not-allowed; }
.reader-tools svg { width: 15px; height: 15px; }
.reader-progress { height: 2px; background: rgba(255, 255, 255, .08); }
.reader-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.reader-stage { padding: 18px 0 90px; }
.reader-pages { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.reader-page {
  position: relative;
  margin: 0;
  background: #1c1f28;
  border-radius: 4px;
  overflow: hidden;
  min-height: 200px;
}
.reader-page img { width: 100%; height: auto; display: block; }
.reader-page .page-no {
  position: absolute;
  right: 10px; bottom: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: rgba(255, 255, 255, .8);
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .2s;
}
.reader-page:hover .page-no { opacity: 1; }
.reader-end {
  max-width: 860px;
  margin: 16px auto 0;
  padding: 26px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.reader-end p { font-size: 13px; color: rgba(255, 255, 255, .6); }
.reader-end .acts { display: flex; gap: 8px; }
.reader-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(20, 22, 29, .94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.reader-bottom .container { display: flex; align-items: center; gap: 10px; height: 58px; }
.reader-bottom .page-indicator { font-size: 12px; color: rgba(255, 255, 255, .5); }
.reader-bottom .acts { margin-left: auto; display: flex; gap: 8px; }
.reader-bottom a, .reader-bottom button {
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.reader-bottom a:hover, .reader-bottom button:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.reader-bottom .primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.reader-bottom .primary:hover { filter: brightness(1.06); color: #fff; }
.reader-bottom svg { width: 15px; height: 15px; }

/* 目录抽屉 */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 10, 16, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 90;
  width: min(380px, 92vw);
  background: #fff;
  color: var(--ink);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .3);
  transform: translateX(102%);
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: none; }
.drawer header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer header h3 { font-size: 15px; font-weight: 700; }
.drawer header button { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.drawer header button:hover { background: #f3f4f8; color: var(--ink); }
.drawer-body { flex: 1; overflow: auto; padding: 14px 20px 24px; }
.drawer-body .chapter-grid { max-height: none; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.drawer-body .chapter-chip.current { background: var(--brand); color: #fff; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 34px 0 26px;
}
.footer-top { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 300px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.footer-cols { display: flex; gap: 54px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.footer-col a { display: block; font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-links { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.footer-links h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chips a {
  padding: 4px 11px;
  border-radius: 999px;
  background: #f6f7fb;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.link-chips a:hover { color: var(--brand); border-color: rgba(255, 91, 60, .4); background: var(--brand-soft); }
.copyright {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.copyright .right { margin-left: auto; }

/* ---------- 悬浮控件 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 60;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--brand); }
.to-top svg { width: 18px; height: 18px; }
body[data-page="reader"] .to-top { background: #262a35; color: rgba(255, 255, 255, .75); box-shadow: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 10px);
  z-index: 200;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(27, 31, 39, .92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 骨架屏 */
.skeleton .m-cover, .skeleton .m-title, .skeleton .m-meta {
  background: linear-gradient(100deg, #eef0f6 30%, #f7f8fc 50%, #eef0f6 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 12px;
  color: transparent;
}
.skeleton .m-title { height: 13px; margin-top: 10px; width: 82%; }
.skeleton .m-meta { height: 11px; width: 54%; margin-top: 7px; }
@keyframes shimmer {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .rank-board { grid-template-columns: 1fr; }
  .detail-cover { width: 172px; }
  .detail-info h1 { font-size: 23px; }
}
@media (max-width: 900px) {
  .container { padding: 0 16px; }
  .header-main { gap: 12px; }
  .brand-sub, .topbar .topbar-right .hide-sm { display: none; }
  .cover-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
  .cover-grid-lg { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .detail-hero { flex-direction: column; padding: 18px; gap: 18px; }
  .detail-cover { width: 132px; }
  .detail-stats { width: 100%; margin-left: 0; padding-top: 6px; }
  .updates-panel { padding: 18px 16px 20px; }
  .sec { padding: 18px 16px 20px; }
  .panel-title h1, .panel-title h2 { font-size: 19px; }
  .reader-title { max-width: 40vw; }
  .reader-tools .label { display: none; }
}
@media (max-width: 640px) {
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .header-main { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .header-actions .icon-btn span { display: none; }
  .brand-name { font-size: 17px; }
  .cover-grid, .cover-grid-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cover-grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-chapter { font-size: 10.5px; padding: 16px 6px 6px; }
  .m-chapter em { display: none; }
  .m-title { font-size: 12.5px; }
  .detail-info h1 { font-size: 20px; }
  .footer-cols { gap: 28px; }
  .pagination a, .pagination span { min-width: 30px; height: 30px; font-size: 12px; }
  .reader-bottom .page-indicator { display: none; }
  .reader-bottom a, .reader-bottom button { padding: 0 12px; font-size: 12px; }
  .reader-stage { padding-top: 10px; }
  .band-updates { padding-top: 16px; }
}
