:root {
  --bg: #0B1220;
  --bg-deep: #070C16;
  --surface: #131E33;
  --surface-2: #192742;
  --surface-3: #203152;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --brand: #2563EB;
  --brand-hover: #3B82F6;
  --brand-soft: rgba(37, 99, 235, 0.16);
  --cyan: #06B6D4;
  --cyan-soft: rgba(6, 182, 212, 0.15);
  --gold: #F59E0B;
  --gold-soft: rgba(245, 158, 11, 0.16);
  --ink: #F1F5F9;
  --ink-2: #CBD5E1;
  --ink-3: #94A3B8;
  --max: 1440px;
  --r: 12px;
  --r-lg: 16px;
  --pill: 999px;
  --shadow-card: 0 6px 20px rgba(3, 7, 18, 0.35);
  --shadow-hover: 0 14px 32px rgba(6, 182, 212, 0.18);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 520px at 18% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
              radial-gradient(900px 420px at 88% -8%, rgba(6, 182, 212, 0.10), transparent 55%),
              var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 14px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 14px; }

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

/* HD3: Cinema Topbar + Mega Menu */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand img { height: 34px; width: auto; object-fit: contain; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.nav-main {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.nav-link {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-link[data-current="是"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(6, 182, 212, 0.22));
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

.nav-mega-wrap { position: relative; }
.nav-mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-mega-trigger:hover { border-color: var(--cyan); color: var(--cyan); }
.nav-mega-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(760px, 86vw);
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 54px rgba(2, 6, 23, 0.65);
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  z-index: 90;
}
.nav-mega-wrap:hover .nav-mega-panel,
.nav-mega-wrap:focus-within .nav-mega-panel { display: grid; }
.mega-col h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.mega-links { display: flex; flex-wrap: wrap; gap: 6px; }
.mega-links a {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
}
.mega-links a:hover,
.mega-links a[data-current="是"] { background: var(--brand); color: #fff; }

.search-inline {
  display: flex;
  align-items: center;
  width: 280px;
  height: 38px;
  padding: 0 4px 0 14px;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.search-inline:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.search-inline input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--ink);
}
.search-inline input::placeholder { color: var(--ink-3); }
.search-inline button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
}

.mobile-actions { display: none; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
}
.icon-btn svg { width: 18px; height: 18px; }

/* Subbar (sticky on PC & Mobile) */
.subbar {
  position: sticky;
  top: 65px;
  z-index: 65;
  background: rgba(11, 18, 32, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.subbar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subbar-inner::-webkit-scrollbar { display: none; }
.subbar a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  white-space: nowrap;
}
.subbar a:hover { color: #fff; border-color: var(--line-strong); }
.subbar a[data-current="是"] {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: rgba(6, 182, 212, 0.4);
}

.main-body { padding-top: 18px; padding-bottom: 44px; min-height: 62vh; }

/* Breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.crumbs a:hover { color: var(--cyan); }
.crumbs span[aria-current="page"] { color: var(--ink-2); font-weight: 600; }

/* Notice */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  margin-bottom: 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.notice-badge {
  padding: 2px 9px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.notice-links {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 13px;
  color: var(--ink-2);
}
.notice-links::-webkit-scrollbar { display: none; }
.notice-links a { white-space: nowrap; }
.notice-links a:hover { color: var(--cyan); }

/* Unified Ads */
.app-ads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.app-ads:not([data-ad-ready="1"]) { display: none; }
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
  border-radius: 10px;
  text-align: center;
  position: relative;
}
.app-item:hover { background: rgba(255, 255, 255, 0.05); }
.app-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.app-icon > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-item strong {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-item small {
  width: 100%;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-item[data-ad-level="9"]::after {
  content: "荐";
  position: absolute;
  top: 4px;
  right: 8px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--gold);
  color: #111;
  font-size: 10px;
  font-weight: 800;
}

.text-ads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.text-ads:not([data-ad-ready="1"]) { display: none; }
.text-ad {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(6, 182, 212, 0.16));
  border: 1px solid rgba(6, 182, 212, 0.32);
  color: #67E8F9;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-ad:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.ad-banner-slot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.ad-banner-slot[data-ad-count="1"] {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.ad-banner-slot[data-ad-count="2"],
.ad-banner-slot[data-ad-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ad-banner-slot:not([data-ad-ready="1"]) { display: none; }
.ad-banner-item {
  position: relative;
  display: block;
  aspect-ratio: 6.4 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.ad-banner-item > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-slot-ctrl {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--pill);
  background: rgba(7, 12, 22, 0.82);
  color: #fff;
  font-size: 11px;
}

.ad-float-host { position: relative; z-index: 80; }
.ad-float-bar { display: none; }
.ad-float-bar[data-ad-ready="1"] { display: block; }
.ad-float-bar--pc-corner {
  position: fixed;
  top: 74px;
  right: 16px;
  width: 400px;
  max-width: calc(100vw - 32px);
  z-index: 82;
}
.ad-float-bar--pc-corner .ad-float-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.ad-float-item { position: relative; }
.ad-float-close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--pill);
  background: rgba(7, 12, 22, 0.84);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
}
.ad-float-close:disabled { opacity: 0.78; cursor: not-allowed; }

/* SH3 Section Header */
.section-block { margin-bottom: 28px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.section-mark {
  width: 10px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--brand));
  flex-shrink: 0;
}
.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.section-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.more-pill {
  padding: 5px 14px;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.more-pill:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }

.surface-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}

/* Pills & Buttons */
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pills span, .pills a {
  padding: 3px 10px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.pills .pill-accent { background: var(--cyan-soft); color: var(--cyan); border-color: rgba(6, 182, 212, 0.35); }
.pills .pill-gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(245, 158, 11, 0.35); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}
.btn:hover { border-color: var(--cyan); color: #fff; }
.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(6, 182, 212, 0.35); }

/* F3 Capsule Filters + MF2 Mobile Collapsible */
.filter-deck {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.filter-head-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.filter-rows { display: flex; flex-direction: column; gap: 10px; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-row a {
  padding: 4px 12px;
  border-radius: var(--pill);
  font-size: 12.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
}
.filter-row a:hover { color: #fff; border-color: var(--line-strong); }
.filter-row a[data-current="是"] {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}
.filter-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.filter-sort-links { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-sort-links a {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--bg-deep);
}
.filter-sort-links a[data-current="是"] { color: var(--cyan); background: var(--cyan-soft); font-weight: 700; }
.filter-count { font-size: 12.5px; color: var(--ink-3); }

/* PG4 Dark Capsule Pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.pager a, .pager span {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.pager a:hover { border-color: var(--cyan); color: var(--cyan); }
.pager span[data-current="是"] {
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

/* D2 Dark Cinema Detail Head */
.detail-hero {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  padding: 22px;
  margin-bottom: 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(19, 30, 51, 0.96) 45%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
}
.detail-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}
.detail-cover--square { aspect-ratio: 1 / 1; }
.detail-cover > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.detail-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.detail-info h1 { font-size: 24px; font-weight: 800; line-height: 1.3; }
.detail-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: rgba(7, 12, 22, 0.45);
  border: 1px solid var(--line);
  font-size: 13px;
}
.detail-kv div { display: flex; gap: 8px; min-width: 0; }
.detail-kv span { color: var(--ink-3); flex-shrink: 0; }
.detail-kv strong { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }

/* E2 4-Layer Episode Widget */
.episode-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.episode-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.episode-tab:hover { border-color: var(--cyan); color: #fff; }
.episode-tab[aria-selected="true"],
.episode-tab[data-current="是"] {
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  border-color: transparent;
  color: #fff;
}
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}
.episode-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.episode-link:hover { border-color: var(--cyan); color: var(--cyan); }
.episode-link[data-current="是"] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: #93C5FD;
  font-weight: 700;
}

/* Neighbors NB1 */
.neighbors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.neighbor-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.neighbor-card:hover { border-color: var(--cyan); }
.neighbor-card small { font-size: 11.5px; color: var(--ink-3); }
.neighbor-card strong { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neighbor-card--next { text-align: right; }

/* Rank RK2 (sticky inside subbar, Zero Click Counts) */
.rank-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-block: 8px;
}
.rank-models, .rank-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.rank-models a, .rank-periods button {
  padding: 6px 14px;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.rank-models a[data-current="是"],
.rank-periods button.on {
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  border-color: transparent;
  color: #fff;
}
.rank-walls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.rank-wall {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}
.rank-wall h2 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 10px;
}
.rank-row:hover { background: rgba(255, 255, 255, 0.04); }
.rank-no {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--ink-3);
  flex-shrink: 0;
}
.rank-row:nth-child(1) .rank-no { background: linear-gradient(135deg, #F59E0B, #D97706); color: #111; }
.rank-row:nth-child(2) .rank-no { background: linear-gradient(135deg, #CBD5E1, #94A3B8); color: #111; }
.rank-row:nth-child(3) .rank-no { background: linear-gradient(135deg, #D97706, #92400E); color: #fff; }
.rank-thumb {
  position: relative;
  width: 48px;
  aspect-ratio: 3 / 4;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}
.rank-thumb--square { aspect-ratio: 1 / 1; }
.rank-thumb > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.rank-meta { min-width: 0; flex: 1; }
.rank-meta strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-meta small {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search Page 3-State */
.search-stage {
  padding: 24px 20px;
  margin-bottom: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.search-stage h1 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.search-big-form {
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  height: 44px;
  padding: 4px 4px 4px 16px;
  border-radius: var(--pill);
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
}
.search-big-form:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.search-big-form input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.search-big-form button {
  padding: 0 22px;
  border: 0;
  border-radius: var(--pill);
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
  font-weight: 700;
}
.hot-wrap { margin-top: 18px; }
.hot-title { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; font-weight: 600; }
.hot-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}
.hot-word {
  padding: 5px 14px;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.hot-word:hover { border-color: var(--cyan); color: var(--cyan); }

/* Chapter Directory & Sheet */
.chapter-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.chapter-tools button,
.chapter-tools select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.chapter-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chapter-link:hover { border-color: var(--cyan); color: var(--cyan); }
.chapter-sheet-trigger { display: none; width: 100%; margin-top: 10px; }

.empty-box {
  padding: 42px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  text-align: center;
  color: var(--ink-3);
}

/* FT3 Dark Cinema Footer */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 24px;
  margin-bottom: 18px;
}
.footer-brand strong { display: block; font-size: 16px; margin-bottom: 6px; }
.footer-brand p { font-size: 12.5px; color: var(--ink-3); }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.footer-col h4 { font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.footer-col a { display: block; font-size: 12.5px; color: var(--ink-3); padding: 2px 0; }
.footer-col a:hover { color: var(--cyan); }
.friends-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.friends-bar strong { color: var(--ink-2); }
.friends-bar a:hover { color: var(--cyan); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 12px;
  color: var(--ink-3);
}
.footer-disclaimer { margin-top: 8px; font-size: 12px; color: var(--ink-3); opacity: 0.78; }

/* Drawer & Modal Sheets */
dialog.drawer-sheet {
  margin: auto;
  width: min(560px, 94vw);
  max-height: 84vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
dialog.drawer-sheet::backdrop { background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(4px); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
}
.drawer-body { padding: 16px 18px; overflow-y: auto; max-height: calc(84vh - 60px); }
.drawer-group { margin-bottom: 16px; }
.drawer-group h3 { font-size: 13px; color: var(--cyan); margin-bottom: 8px; }
.drawer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-links a {
  padding: 5px 12px;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.drawer-links a[data-current="是"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.sheet-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.sheet-pager button { padding: 6px 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface-2); }
.sheet-pager button:disabled { opacity: 0.4; }

.back-top {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
}
.back-top[hidden] { display: none; }
.back-top:hover { border-color: var(--cyan); color: var(--cyan); }

/* MBN2 Mobile Floating Capsule Dock */
.bottom-dock { display: none; }

@media (max-width: 1099px) {
  .nav-main, .search-inline { display: none; }
  .mobile-actions { display: flex; }
  .rank-walls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-banner-slot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  body { padding-bottom: 84px; }
  .crumbs { display: none; }
  .wrap { padding-inline: 12px; }
  .topbar-inner { min-height: 54px; }
  .subbar {
    top: 55px;
  }
  .rank-top { gap: 6px; padding-block: 6px; }
  .rank-models { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .rank-models::-webkit-scrollbar { display: none; }
  .rank-models a { flex: none; }
  .app-ads {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 8px;
  }
  .app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .text-ads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .text-ads[data-ad-count="1"] { grid-template-columns: 1fr; }
  .ad-banner-slot,
  .ad-banner-slot[data-ad-count="1"],
  .ad-banner-slot[data-ad-count="2"],
  .ad-banner-slot[data-ad-count="4"] { grid-template-columns: 1fr; }

  .ad-float-bar--top {
    position: fixed;
    top: 104px;
    left: 10px;
    right: 10px;
    z-index: 75;
  }
  .ad-float-bar--bottom {
    position: fixed;
    bottom: 78px;
    left: 10px;
    right: 10px;
    z-index: 75;
  }

  .filter-head-mobile { display: flex; }
  .filter-rows { display: none; margin-top: 10px; }
  .filter-deck.is-open .filter-rows { display: flex; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row a { flex-shrink: 0; }

  .detail-hero { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .detail-cover { width: 150px; margin: 0 auto; }
  .detail-info h1 { font-size: 19px; text-align: center; }
  .detail-kv { grid-template-columns: 1fr; }
  .episode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .neighbors { grid-template-columns: 1fr; }
  .rank-walls { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-chapter-directory].is-mobile-preview .chapter-grid a:nth-child(n+7) { display: none; }
  [data-chapter-directory].is-mobile-preview .pager { display: none; }
  .chapter-sheet-trigger { display: inline-flex; }

  /* Mobile Search Hot Words: 1 per row centered multi-color */
  .hot-list { flex-direction: column; align-items: center; }
  .hot-word { background: transparent; border: 0; padding: 4px 10px; font-size: 14px; }
  .hot-word:nth-child(5n+1) { color: #38BDF8; }
  .hot-word:nth-child(5n+2) { color: #34D399; }
  .hot-word:nth-child(5n+3) { color: #FBBF24; }
  .hot-word:nth-child(5n+4) { color: #F472B6; }
  .hot-word:nth-child(5n+5) { color: #A78BFA; }

  .back-top { bottom: 86px; right: 12px; }
  .bottom-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 78;
    height: 58px;
    padding: 0 8px;
    border-radius: var(--pill);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.72);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
  }
  .bottom-dock > a,
  .bottom-dock > button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 11px;
    padding: 4px 0;
  }
  .bottom-dock > a[hidden] { display: none; }
  .bottom-dock svg { width: 19px; height: 19px; }
  .bottom-dock em { font-style: normal; line-height: 1; }
  .bottom-dock > a[data-current="是"] { color: var(--cyan); font-weight: 700; }
}
