@charset "utf-8";

/* Indigo Minimalist Stream Design System — Left Slim Nav + Wide Top Search + Clean White Canvas */
:root {
  --brand: #5252ee;
  --brand-hover: #4141d6;
  --brand-soft: #f0f0ff;
  --brand-soft-2: #dedeff;
  --accent-warm: #f59e0b;
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f5f6f9;
  --ink-1: #181a20;
  --ink-2: #525866;
  --ink-3: #8c93a3;
  --ink-inv: #ffffff;
  --border: #eceef3;
  --border-strong: #d8dce6;
  --shadow-sm: 0 2px 8px rgba(24, 26, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(82, 82, 238, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --sidebar-w: 188px;
  --topbar-h: 64px;
  --content-max: 1520px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --reader-font: 19px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font: 14px/1.6 var(--font-sans);
  background: var(--bg-page);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .15s, background .15s, border-color .15s, transform .15s; }
a:hover { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
img { display: block; max-width: 100%; object-fit: cover; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 200; background: var(--brand); color: var(--ink-inv); padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

.cms-icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; flex: none; display: inline-block; }
.cms-icon-img { object-fit: contain; border-radius: 3px; }

/* App Shell: Slim Left Column Sidebar + Right Stream Workspace */
.stream-shell { display: flex; min-height: 100vh; }
.stream-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w); display: flex; flex-direction: column;
  background: var(--bg-surface); border-right: 1px solid var(--border);
}
.stream-brand {
  height: var(--topbar-h); padding: 0 18px; display: flex; align-items: center; gap: 9px;
  font-size: 17px; font-weight: 800; color: var(--ink-1); white-space: nowrap; overflow: hidden; flex: none;
}
.stream-brand img { max-height: 30px; max-width: 140px; object-fit: contain; }
.stream-brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #7b68ff);
  color: var(--ink-inv); display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex: none;
}
.stream-side-scroll {
  flex: 1 1 auto; overflow-y: auto; padding: 4px 12px 20px; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 3px;
}
.stream-side-item {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 13px;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stream-side-item svg { width: 16px; height: 16px; flex: none; opacity: .78; }
.stream-side-item:hover { background: var(--bg-subtle); color: var(--ink-1); }
.stream-side-item[data-current="是"] {
  background: var(--brand); color: var(--ink-inv); font-weight: 700;
  box-shadow: 0 4px 12px rgba(82, 82, 238, .28);
}
.stream-side-item[data-current="是"] svg { opacity: 1; }
.stream-side-sep { height: 1px; background: var(--border); margin: 8px 6px; }

/* Right Main Workspace */
.stream-main-wrap {
  flex: 1 1 auto; min-width: 0; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}

/* Sticky Top Header: Wide Search Left + Model Quick Links Right */
.stream-topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h); padding: 0 24px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.stream-topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.stream-mobile-logo { display: none; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; color: var(--ink-1); white-space: nowrap; }
.stream-mobile-logo img { max-height: 28px; max-width: 112px; object-fit: contain; }
.stream-search-form {
  display: flex; align-items: center; width: min(460px, 100%); height: 40px;
  padding: 2px 4px 2px 16px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong); background: var(--bg-surface);
  transition: border-color .15s, box-shadow .15s;
}
.stream-search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stream-search-form input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 13.5px; outline: none; }
.stream-search-form button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.stream-search-form button:hover { background: var(--brand-soft); color: var(--brand); }
.stream-search-form button svg { width: 15px; height: 15px; }

.stream-quick-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.stream-quick-link {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.stream-quick-link svg { width: 15px; height: 15px; opacity: .76; }
.stream-quick-link:hover { background: var(--bg-subtle); color: var(--brand); }
.stream-quick-link[data-current="是"] { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.stream-quick-link--cta {
  background: var(--brand); color: var(--ink-inv); font-weight: 600; border-radius: var(--radius-sm); padding: 0 14px;
}
.stream-quick-link--cta:hover { background: var(--brand-hover); color: var(--ink-inv); }

.stream-mobile-actions { display: none; align-items: center; gap: 8px; flex: none; }
.stream-icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.stream-icon-btn svg { width: 17px; height: 17px; }

.stream-mobile-subbar { display: none; }

/* Main Content Area */
.stream-main {
  flex: 1 1 auto; width: 100%; max-width: var(--content-max);
  margin: 0 auto; padding: 18px 24px 40px;
}
.acg-crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px; font-size: 13px; color: var(--ink-3);
}
.acg-crumbs a:hover { color: var(--brand); }
.acg-crumbs [aria-current="page"] { color: var(--ink-1); font-weight: 600; }

/* Notice Bar */
.acg-notice {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding: 9px 14px; border-radius: var(--radius-md);
  background: var(--brand-soft); border: 1px solid var(--brand-soft-2); font-size: 13px; color: var(--ink-2);
}
.acg-notice-badge {
  padding: 2px 8px; border-radius: 5px; background: var(--brand); color: var(--ink-inv);
  font-size: 11px; font-weight: 700; flex: none;
}
.acg-notice-links { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
.acg-notice-links a { color: var(--ink-1); font-weight: 600; }
.acg-notice-links a:hover { color: var(--brand); }

/* Unified APP Icon Ads */
.acg-app-ads {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 12px 10px; margin-bottom: 12px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-subtle); border: 1px solid var(--border);
}
.acg-app-ads[data-ad-tiered]:not([data-ad-ready]),
.acg-text-ads[data-ad-tiered]:not([data-ad-ready]),
.ad-banner-slot[data-ad-pc-limit]:not([data-ad-ready]),
.ad-float-bar:not([data-ad-ready]) { opacity: 0; }
.acg-app-ad {
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 5px; min-width: 0;
}
.acg-app-icon {
  position: relative; width: 56px; height: 56px; border-radius: 14px;
  overflow: hidden; border: 1px solid var(--border); background: var(--bg-surface); flex: none;
}
.acg-app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acg-app-ad[data-ad-level="9"] .acg-app-icon::after {
  content: "荐"; position: absolute; right: 0; top: 0;
  padding: 1px 4px; font-size: 10px; font-weight: 700; line-height: 1.2;
  background: var(--brand); color: var(--ink-inv); border-radius: 0 0 0 6px;
}
.acg-app-ad strong { font-size: 12px; font-weight: 600; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acg-app-ad small { font-size: 11px; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Unified Highlighted Text Ads */
.acg-text-ads { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.acg-text-ad {
  display: block; text-align: center; min-width: 0;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent;
}
.acg-text-ad:hover { transform: translateY(-1px); }
.acg-text-ad:nth-child(5n+1) { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.acg-text-ad:nth-child(5n+2) { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
.acg-text-ad:nth-child(5n+3) { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.acg-text-ad:nth-child(5n+4) { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.acg-text-ad:nth-child(5n+5) { color: #7e22ce; background: #faf5ff; border-color: #e9d5ff; }

/* Unified Banner Ads (6.4:1 proportional container) */
.ad-banner-slot {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.ad-banner-slot:has(> .ad-banner-item:only-child) {
  grid-template-columns: minmax(0, 760px); justify-content: center;
}
.ad-banner-slot:has(> .ad-banner-item:nth-child(2):last-child),
.ad-banner-slot:has(> .ad-banner-item:nth-child(4):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ad-banner-item {
  position: relative; display: block; width: 100%; aspect-ratio: 6.4 / 1;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-subtle);
}
.ad-banner-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-banner-item:hover { border-color: var(--brand); }
.ad-slot-ctrl {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  padding: 2px 8px; border: 0; border-radius: 999px;
  background: rgba(24, 26, 32, .72); color: #fff; font-size: 11px; line-height: 1.4;
}
.ad-float-host { display: contents; }
.ad-float-bar {
  position: fixed; z-index: 45;
  padding: 8px; border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(15, 18, 28, .16);
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
}
.ad-float-bar--pc-corner {
  top: calc(var(--topbar-h) + 12px); right: 18px; left: auto; transform: none;
  width: 420px; max-width: calc(100vw - var(--sidebar-w) - 36px);
  padding: 10px;
}
.ad-float-bar--pc-corner .ad-float-grid {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
  max-height: calc(100vh - var(--topbar-h) - 48px); overflow-y: auto;
}
.ad-float-bar--top { top: calc(var(--topbar-h) + 8px); left: 50%; transform: translateX(-50%); }
.ad-float-bar--bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }
.ad-float-grid { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; }
.ad-float-item { position: relative; width: 100%; }
.ad-float-bar .ad-banner-item { border-radius: var(--radius-sm); }
.ad-float-close {
  position: absolute; top: 4px; right: 4px; z-index: 4;
  min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px; background: rgba(24, 26, 32, .72); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.ad-float-close:disabled { opacity: .78; cursor: not-allowed; background: rgba(24, 26, 32, .58); }
.ad-float-close:not(:disabled):hover { background: var(--brand); }

/* Panels & Section Heads */
.acg-panel {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.acg-section { margin-bottom: 24px; }
.acg-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
}
.acg-section-head h1, .acg-section-head h2 {
  margin: 0; font-size: 17px; font-weight: 800; color: var(--ink-1);
  display: inline-flex; align-items: center; gap: 8px;
}
.acg-section-head h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--brand); flex: none;
}
.acg-more { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.acg-more:hover { color: var(--brand); }

/* Two-Column List Layout (Article / Person) */
.acg-list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.acg-list-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.acg-side-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acg-side-rank li a {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px;
}
.acg-side-rank li a:hover { background: var(--brand-soft); color: var(--brand); }
.acg-side-rank b {
  width: 22px; height: 22px; border-radius: 6px; background: var(--bg-subtle); color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
}
.acg-side-rank li:nth-child(-n+3) b { background: var(--brand); color: #fff; }
.acg-side-rank strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acg-side-rank small { font-size: 11px; color: var(--ink-3); }

/* Filter Deck & Mobile Collapsible */
.acg-filter-deck {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 18px;
}
.acg-filter-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 6px 0; border-bottom: 1px dashed var(--border);
}
.acg-filter-row:last-child { border-bottom: 0; }
.acg-filter-label { flex: 0 0 50px; font-size: 12px; font-weight: 700; color: var(--ink-3); line-height: 28px; }
.acg-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.acg-chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--ink-2);
  background: var(--bg-surface); border: 1px solid var(--border); white-space: nowrap;
}
.acg-chip:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.acg-chip[data-current="是"] { background: var(--brand); border-color: var(--brand); color: var(--ink-inv); font-weight: 700; }
.acg-chip[data-direction="倒序"]::after { content: " ↓"; }
.acg-chip[data-direction="正序"]::after { content: " ↑"; }
.acg-filter-more { display: none; }

/* Unified 3-State Search */
.acg-search-box {
  max-width: 720px; margin: 4px auto 20px; padding: 24px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-lg); text-align: center;
}
.acg-search-box h1 { margin: 0 0 14px; font-size: 20px; font-weight: 800; }
.acg-search-bar {
  display: flex; gap: 8px; max-width: 560px; margin: 0 auto;
  padding: 4px 4px 4px 16px; border-radius: var(--radius-md);
  border: 2px solid var(--brand); background: var(--bg-surface);
}
.acg-search-bar input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 14px; outline: none; }
.acg-search-bar button {
  height: 36px; padding: 0 22px; border: 0; border-radius: 7px;
  background: var(--brand); color: var(--ink-inv); font-weight: 700;
}
.acg-search-bar button:hover { background: var(--brand-hover); }
.acg-search-stat { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.acg-hot-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); text-align: center; }
.acg-hot-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.acg-hot-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-height: 76px; overflow: hidden; }
.acg-hot-word {
  padding: 5px 14px; border-radius: var(--radius-pill);
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.acg-hot-word:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* Unified Rank Hub (sticky under topbar on PC & Mobile) */
.acg-rank-top {
  position: sticky; top: var(--topbar-h); z-index: 29;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 8px 24px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.acg-rank-models, .acg-rank-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.acg-rank-tab {
  height: 34px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-surface);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.acg-rank-tab:hover { border-color: var(--brand); color: var(--brand); }
.acg-rank-tab[data-current="是"], .acg-rank-tab.on { background: var(--brand); border-color: var(--brand); color: var(--ink-inv); }
.acg-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.acg-rank-item {
  display: grid; grid-template-columns: 36px 96px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border);
}
.acg-rank-item:hover { border-color: var(--brand); background: var(--bg-subtle); }
.acg-rank-no {
  width: 30px; height: 30px; border-radius: 8px; background: var(--bg-subtle); color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.acg-rank-item:nth-child(1) .acg-rank-no { background: var(--brand); color: #fff; }
.acg-rank-item:nth-child(2) .acg-rank-no { background: #7b68ff; color: #fff; }
.acg-rank-item:nth-child(3) .acg-rank-no { background: var(--accent-warm); color: #fff; }
.acg-rank-cover { width: 96px; aspect-ratio: 16/10; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-subtle); }
.acg-rank-cover img { width: 100%; height: 100%; object-fit: cover; }
.acg-rank-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.acg-rank-body h3 { margin: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acg-rank-meta { font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px; }
.acg-rank-desc { margin: 0; font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.acg-rank-heat { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }

/* Shared Detail Header (PC 2-col, Mobile 3-band zero-void) */
.acg-detail-head {
  display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 22px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px;
}
.acg-detail-cover {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius-md);
  overflow: hidden; background: var(--bg-surface); box-shadow: var(--shadow-md);
}
.acg-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.acg-detail-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.acg-detail-top { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acg-detail-top h1, .acg-article-head h1 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.3; color: var(--ink-1); }
.acg-detail-extra { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acg-meta-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.acg-meta-pills span, .acg-meta-pills a {
  padding: 2px 10px; border-radius: var(--radius-sm); font-size: 12px;
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--ink-2);
}
.acg-meta-pills a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.acg-detail-desc { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.acg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.acg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--bg-surface);
  color: var(--ink-1); font-size: 13px; font-weight: 700;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acg-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.acg-btn--primary { background: var(--brand); border-color: var(--brand); color: var(--ink-inv); }
.acg-btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--ink-inv); }
.acg-site-head { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 14px; }
.acg-site-icon { width: 60px; height: 60px; }
.acg-article-head { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.acg-article-head h1 { margin-bottom: 10px; }

/* Neighbors, Prose & Chapter Sheet */
.acg-neighbors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.acg-neighbor {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
  border-radius: var(--radius-md); background: var(--bg-subtle); border: 1px solid var(--border);
}
.acg-neighbor:hover { border-color: var(--brand); background: var(--brand-soft); }
.acg-neighbor small { font-size: 11px; color: var(--ink-3); }
.acg-neighbor strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acg-neighbor--next { text-align: right; }
.acg-prose { font-size: 16px; line-height: 1.9; color: var(--ink-1); overflow-wrap: anywhere; }
.acg-prose p { margin: 1em 0; }
.acg-prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 12px auto; }

.acg-chapter-open-btn { display: none; }
.acg-sheet-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); flex: none;
}
.acg-sheet-select {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-surface); font-size: 13px; color: var(--ink-1);
}
.acg-sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; -webkit-overflow-scrolling: touch; }
.acg-sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--bg-surface);
  font-size: 12.5px; color: var(--ink-3); flex: none;
}

/* Pagination & Empty */
.acg-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.acg-pager a, .acg-pager span {
  min-width: 36px; height: 36px; padding: 0 12px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-surface); font-size: 13px; color: var(--ink-2);
}
.acg-pager a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.acg-pager [aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--ink-inv); font-weight: 700; }
.acg-empty { padding: 36px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* Footer */
.acg-footer {
  border-top: 1px solid var(--border); background: var(--bg-subtle);
  padding: 20px 24px 28px; font-size: 12.5px; color: var(--ink-3);
}
.acg-footer-inner { max-width: var(--content-max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.acg-footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.acg-footer-links a:hover { color: var(--brand); }
.acg-friend-links {
  max-width: var(--content-max); margin: 12px auto 0; padding-top: 12px; border-top: 1px dashed var(--border);
  display: flex; flex-wrap: wrap; gap: 8px 14px;
}

/* Dialogs & Mobile Navigation Drawer */
dialog.acg-dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0;
  width: min(620px, calc(100vw - 24px)); max-height: 82vh;
  background: var(--bg-surface); color: var(--ink-1); box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}
dialog.acg-dialog[open] { display: flex; flex-direction: column; }
dialog.acg-dialog::backdrop { background: rgba(24, 26, 32, .48); backdrop-filter: blur(2px); }
.acg-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border); flex: none;
}
.acg-dialog-head strong { font-size: 15px; }
.acg-dialog-head button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-subtle); font-size: 18px; line-height: 1;
}
.acg-nav-drawer-body { display: grid; grid-template-columns: 96px minmax(0, 1fr); flex: 1 1 auto; min-height: 0; overflow: hidden; }
.acg-drawer-tabs {
  border-right: 1px solid var(--border); background: var(--bg-subtle);
  padding: 8px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.acg-drawer-tab {
  height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left; font-size: 13px; color: var(--ink-2);
}
.acg-drawer-tab[aria-selected="true"] { background: var(--brand); color: var(--ink-inv); font-weight: 700; }
.acg-drawer-panels { padding: 12px 14px; overflow-y: auto; }
.acg-drawer-quick { margin-bottom: 12px; }
.acg-drawer-group { margin-bottom: 12px; }
.acg-drawer-root { display: inline-flex; align-items: center; font-size: 14px; font-weight: 700; color: var(--ink-1); margin-bottom: 6px; }
.acg-drawer-root[data-current="是"] { color: var(--brand); }
.acg-drawer-subs { display: flex; flex-wrap: wrap; gap: 6px; }
.acg-drawer-subs a { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg-subtle); font-size: 12px; color: var(--ink-2); }
.acg-drawer-subs a[data-current="是"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }

.acg-bottom-nav { display: none; }
.acg-back-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 35;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--brand);
  box-shadow: var(--shadow-md); font-size: 16px; font-weight: 700;
}

@media (max-width: 1099px) {
  .acg-list-layout { grid-template-columns: 1fr; }
  .acg-list-side { position: static; }
  .ad-banner-slot,
  .ad-banner-slot:has(> .ad-banner-item:nth-child(2):last-child),
  .ad-banner-slot:has(> .ad-banner-item:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .stream-sidebar { display: none; }
  .stream-main-wrap { margin-left: 0; }
  .stream-mobile-logo { display: inline-flex; }
  .stream-quick-nav { display: none; }
  .stream-mobile-actions { display: flex; }
  .ad-float-bar--pc-corner { max-width: calc(100vw - 32px); }
}

@media (max-width: 767px) {
  body { padding-bottom: 60px; }
  .acg-crumbs { display: none; }
  .stream-topbar { height: 52px; padding: 0 12px; gap: 10px; }
  .stream-search-form { display: none; }
  .stream-mobile-subbar {
    position: sticky; top: 52px; z-index: 29;
    display: flex; align-items: center; gap: 6px; padding: 8px 12px;
    overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--bg-surface); scrollbar-width: none;
  }
  .stream-mobile-subbar::-webkit-scrollbar { display: none; }
  .stream-mobile-subbar a {
    flex: none; height: 28px; padding: 0 11px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; font-size: 12.5px; color: var(--ink-2); background: var(--bg-subtle);
  }
  .stream-mobile-subbar a[data-current="是"] { background: var(--brand); color: var(--ink-inv); font-weight: 700; }
  .stream-main { padding: 12px 12px 28px; }

  .acg-app-ads { grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 10px 6px; margin-bottom: 10px; padding: 10px 8px; }
  .acg-app-ads[data-ad-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .acg-app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .acg-text-ads { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .acg-text-ads:has(> .acg-text-ad:only-child) { grid-template-columns: 1fr; }
  .acg-text-ad { padding: 6px 8px; font-size: 12px; }
  .ad-banner-slot,
  .ad-banner-slot:has(> .ad-banner-item:only-child),
  .ad-banner-slot:has(> .ad-banner-item:nth-child(2):last-child),
  .ad-banner-slot:has(> .ad-banner-item:nth-child(4):last-child) {
    grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px;
  }
  .ad-float-bar { left: 8px; right: 8px; width: auto; transform: none; padding: 4px; }
  .ad-float-bar--top { top: 100px; }
  .ad-float-bar--bottom { bottom: 64px; }
  .ad-float-close { top: 4px; right: 4px; }

  /* Mobile 3-Band Detail Card */
  .acg-detail-head { grid-template-columns: 100px minmax(0, 1fr); gap: 12px 14px; padding: 14px; align-items: start; }
  .acg-detail-info { display: contents; }
  .acg-detail-top { align-self: center; gap: 8px; }
  .acg-detail-top h1 { font-size: 18px; }
  .acg-detail-extra { grid-column: 1 / -1; padding-top: 10px; border-top: 1px dashed var(--border); }
  .acg-detail-desc { font-size: 13.5px; line-height: 1.7; }
  .acg-detail-head .acg-actions {
    grid-column: 1 / -1; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px; margin-top: 2px;
  }
  .acg-detail-head .acg-btn { width: 100%; padding: 0 12px; }
  .acg-site-head { grid-template-columns: 52px minmax(0, 1fr); gap: 10px 12px; }
  .acg-site-icon { width: 52px; height: 52px; }
  .acg-site-cta { grid-column: 1 / -1; }
  .acg-site-cta .acg-btn { width: 100%; }
  .acg-article-head h1 { font-size: 20px; }
  .acg-prose { font-size: 15.5px; line-height: 1.85; }

  .acg-neighbors { grid-template-columns: 1fr; gap: 8px; }
  .acg-neighbor { flex-direction: row; align-items: center; justify-content: center; text-align: center; gap: 0; padding: 10px 14px; }
  .acg-neighbor small { flex: none; font-size: 13px; color: var(--ink-3); }
  .acg-neighbor small::after { content: "："; }
  .acg-neighbor strong { flex: 0 1 auto; min-width: 0; font-size: 13.5px; }
  .acg-neighbor--next { text-align: center; }

  [data-chapter-directory].is-mobile-preview [data-chapter-grid] > :nth-child(n+7) { display: none; }
  [data-chapter-directory].is-mobile-preview .acg-pager { display: none; }
  .acg-chapter-open-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    width: 100%; margin-top: 12px; height: 40px; border-radius: var(--radius-md);
    border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand);
    font-size: 13.5px; font-weight: 700;
  }
  .acg-chapter-sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 82vh; border-radius: 16px 16px 0 0; border-bottom: 0; }

  .acg-filter-deck { padding: 10px 12px; margin-bottom: 14px; }
  .acg-filter-row { flex-direction: row; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 0; }
  .acg-filter-row.is-collapsed { display: none; }
  .acg-filter-label { flex: 0 0 38px; font-size: 12px; line-height: 26px; }
  .acg-filter-chips { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-right: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .acg-filter-chips::-webkit-scrollbar { display: none; }
  .acg-chip { flex: none; height: 26px; padding: 0 10px; font-size: 12px; }
  .acg-filter-more {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    width: 100%; margin-top: 6px; padding: 5px 0 1px;
    border: 0; border-top: 1px dashed var(--border); background: transparent;
    color: var(--brand); font-size: 12px; font-weight: 700;
  }

  .acg-hot-list { flex-direction: column; align-items: center; max-height: none; gap: 6px; }
  .acg-hot-word { background: transparent; border: 0; padding: 4px 10px; font-size: 15px; }
  .acg-hot-word:nth-child(6n+1) { color: #5252ee; }
  .acg-hot-word:nth-child(6n+2) { color: #e11d48; }
  .acg-hot-word:nth-child(6n+3) { color: #d97706; }
  .acg-hot-word:nth-child(6n+4) { color: #059669; }
  .acg-hot-word:nth-child(6n+5) { color: #0284c7; }
  .acg-hot-word:nth-child(6n+6) { color: #7c3aed; }

  .acg-rank-top { top: 52px; flex-direction: column; align-items: stretch; gap: 6px; padding: 7px 12px; }
  .acg-rank-models { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .acg-rank-models::-webkit-scrollbar { display: none; }
  .acg-rank-models a { flex: none; }
  .acg-rank-periods { display: grid; grid-template-columns: repeat(4, 1fr); }
  .acg-rank-item { grid-template-columns: 26px 76px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .acg-rank-cover { width: 76px; }
  .acg-rank-desc { display: none; }

  .acg-bottom-nav {
    position: fixed; inset: auto 0 0; z-index: 42; height: 56px;
    display: flex; align-items: center; justify-content: space-around;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .acg-bottom-nav a, .acg-bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: transparent; color: var(--ink-3); font-size: 11px;
  }
  .acg-bottom-nav svg { width: 20px; height: 20px; }
  .acg-bottom-nav em { font-style: normal; }
  .acg-bottom-nav [data-current="是"] { color: var(--brand); font-weight: 700; }
  .acg-back-top { bottom: 70px; right: 14px; }
}

/* Lock cover aspect-ratio against intrinsic image expansion */
.vod-poster,
.comic-poster,
.novel-cover,
.person-portrait,
.person-work-cover,
.art-thumb,
.topic-cover,
.topic-hero-cover,
.acg-rank-cover,
.acg-detail-cover,
.ad-banner-item {
  position: relative;
  overflow: hidden;
}
.vod-poster > img,
.comic-poster > img,
.novel-cover > img,
.person-portrait > img,
.person-work-cover > img,
.art-thumb > img,
.topic-cover > img,
.topic-hero-cover > img,
.acg-rank-cover > img,
.acg-detail-cover > img,
.ad-banner-item > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
