:root {
  --bg: #111114;
  --fg: #e8e6e3;
  --muted: #9a978f;
  --line: #2a2a30;
  --accent: #d9a441;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* 阅读器 */
.rbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(17,17,20,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.rtitle {
  color: var(--fg); font-size: 14px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.rcount { color: var(--muted); font-size: 13px; white-space: nowrap; }

.reader { display: flex; flex-direction: column; align-items: center; }
.pagewrap { width: 100%; max-width: 1280px; display: flex; justify-content: center; }
.pageimg { display: block; line-height: 0; }
.pageimg img { width: 100%; height: auto; display: block; }

.pager {
  display: flex; gap: 16px; justify-content: center; align-items: center;
  padding: 16px; font-size: 15px;
}
.pager a { padding: 10px 18px; border: 1px solid var(--line); border-radius: 6px; }

/* 每个槽位按自己的尺寸预留高度，避免广告加载时 CLS */
.ad {
  width: 100%; margin: 12px auto;
  display: flex; align-items: center; justify-content: center;
}
.ad-top { min-height: 90px; max-width: 728px; }
.ad-bottom { min-height: 250px; max-width: 300px; }
@media (max-width: 767px) { .ad-top { min-height: 100px; max-width: 300px; } }

/* 列表页 */
.topbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .5px; color: var(--fg); }
.cats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.cats a { color: var(--muted); }
.cats a:hover { color: var(--accent); }

.ptitle { font-size: 20px; margin: 20px 0 4px; text-transform: capitalize; }
.pintro { color: var(--muted); margin: 0 0 8px; }

.grid {
  display: grid; gap: 14px; padding: 12px 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card { color: var(--fg); display: flex; flex-direction: column; gap: 6px; }
.card img, .card .nocover {
  width: 100%; aspect-ratio: 250/353; object-fit: cover;
  border-radius: 6px; background: #1b1b20; display: block;
}
.ctitle { font-size: 13px; line-height: 1.35; max-height: 3.6em; overflow: hidden; }
.cmeta { font-size: 11px; color: var(--muted); }

/* 画廊封面页 */
.gallery { padding-top: 20px; }
.gmeta { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.coverwrap img { width: 250px; height: auto; border-radius: 8px; display: block; margin: 0 0 16px; }
.startbtn {
  display: inline-block; padding: 12px 26px; border-radius: 8px;
  background: var(--accent); color: #16130c; font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags a {
  font-size: 12px; padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted);
}

.pending {
  padding: 120px 16px; text-align: center; color: var(--muted); font-size: 15px;
}

.err { padding: 60px 16px; text-align: center; }
.err h1 { font-size: 48px; margin: 0 0 8px; }
