/* ==========================================================================
   追剧聚合 · 午夜放映厅
   A warm-black repertory-cinema look: ember light, film grain, serif display.
   ========================================================================== */

:root {
  --bg: #0b0a09;
  --bg-soft: #100e0c;
  --surface: #15120f;
  --surface-2: #1b1713;
  --line: #2a241f;
  --line-soft: #201b16;
  --text: #f5efe6;
  --muted: #a89c8c;
  --faint: #6f6457;
  --ember: #ff5a1f;
  --ember-2: #ff8a3d;
  --amber: #f2b24a;
  --crimson: #d64532;
  --ok: #86c08a;
  --warn: #e8a33d;
  --bad: #d0654f;
  --idle: #5f564b;
  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --radius: 14px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(255, 90, 31, 0.16), transparent 62%),
    radial-gradient(900px 480px at 8% 4%, rgba(242, 178, 74, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E");
}

::selection {
  background: rgba(255, 90, 31, 0.35);
  color: #fff;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.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: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--amber);
  color: #1b0d05;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(11, 10, 9, 0.74);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  align-self: center;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--ember), var(--amber));
  box-shadow: 0 0 22px rgba(255, 90, 31, 0.55);
  transform: rotate(45deg);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.topbar-meta {
  margin: 0 auto 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghost-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ghost-btn:hover {
  border-color: rgba(255, 90, 31, 0.55);
  color: var(--text);
  background: rgba(255, 90, 31, 0.06);
}

.ghost-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--amber);
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 84px) clamp(16px, 4vw, 40px) 18px;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--faint);
  text-transform: uppercase;
}

.eyebrow-line {
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--ember), transparent);
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(40px, 6.6vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.display-accent {
  background-image: linear-gradient(100deg, var(--ember) 8%, var(--ember-2) 45%, var(--amber) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(255, 90, 31, 0.22);
}

.lede {
  max-width: 580px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
}

.side-marquee {
  position: absolute;
  right: -6px;
  top: 190px;
  margin: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(168, 156, 140, 0.32);
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

/* ---------------------------------------------------------------- search */

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin-top: 36px;
  padding: 7px 7px 7px 20px;
  background: linear-gradient(180deg, #16120f, #100e0c);
  border: 1px solid #352b23;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 70px -34px rgba(255, 90, 31, 0.55);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.search:focus-within {
  border-color: rgba(255, 90, 31, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 4px rgba(255, 90, 31, 0.1),
    0 24px 80px -30px rgba(255, 90, 31, 0.65);
}

.search-icon {
  font-size: 21px;
  line-height: 1;
  color: var(--faint);
  transform: translateY(-1px);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  letter-spacing: 0.01em;
  outline: none;
  appearance: none;
}

.search input::placeholder {
  color: #6a5f52;
}

.search input::-webkit-search-cancel-button {
  appearance: none;
}

.key-hint {
  flex-shrink: 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
}

.search-btn {
  flex-shrink: 0;
  height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ember), var(--ember-2));
  color: #1b0d05;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 14px 34px -16px rgba(255, 90, 31, 0.9);
  transition: transform 0.18s var(--ease), filter 0.18s, box-shadow 0.2s;
}

.search-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -14px rgba(255, 90, 31, 1);
}

.search-btn:active {
  transform: scale(0.985);
}

/* ------------------------------------------------------------ chips/filters */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.chip:hover {
  color: var(--amber);
  border-color: rgba(242, 178, 74, 0.45);
  background: rgba(242, 178, 74, 0.05);
  transform: translateY(-1px);
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-btn {
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-btn:hover {
  color: var(--text);
  border-color: var(--line);
}

.cat-btn.is-active {
  color: #ffbd97;
  border-color: rgba(255, 90, 31, 0.42);
  background: rgba(255, 90, 31, 0.1);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: #241f19;
  border: 1px solid #352b23;
  transition: background 0.2s, border-color 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #8a7d6c;
  transition: transform 0.22s var(--ease), background 0.2s;
}

.switch input:checked + .switch-track {
  background: rgba(255, 90, 31, 0.18);
  border-color: rgba(255, 90, 31, 0.6);
}

.switch input:checked + .switch-track::after {
  transform: translateX(17px);
  background: var(--ember-2);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.switch-label {
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------- rail */

.rail {
  position: relative;
  max-width: var(--max);
  margin: 22px auto 0;
  padding: 16px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #12100d, #0e0c0a);
  overflow: hidden;
}

.rail::before,
.rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(168, 156, 140, 0.22) 0 5px,
    transparent 5px 16px
  );
  opacity: 0.7;
}

.rail::before {
  top: 0;
}

.rail::after {
  bottom: 0;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
}

.rail-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.rail-legend .dot {
  margin-left: 8px;
}

.rail-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
  align-items: center;
}

.tick {
  width: 7px;
  height: 22px;
  border-radius: 2px;
  background: #262019;
  animation: tick-in 0.3s var(--ease) both;
}

.tick--ok {
  background: var(--ok);
  box-shadow: 0 0 10px rgba(134, 192, 138, 0.35);
}

.tick--empty {
  background: #7d6a4a;
}

.tick--restricted {
  background: var(--warn);
}

.tick--unreachable,
.tick--fail {
  background: var(--bad);
}

.tick--skipped {
  background: transparent;
  border: 1px dashed #3a322a;
}

/* ---------------------------------------------------------------- results */

.results {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 34px auto 0;
  padding: 0 clamp(16px, 4vw, 40px);
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.results-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.results-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

/* ------------------------------------------------------------------ card */

.card {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  padding: 15px;
  background: linear-gradient(160deg, #181310 0%, #12100d 58%, #100e0c 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  animation: card-in 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 138, 61, 0.35), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: #3d3128;
  transform: translateY(-2px);
  box-shadow: 0 26px 60px -36px rgba(0, 0, 0, 0.9);
}

.card:hover::after {
  opacity: 1;
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 5px 13px;
  border-bottom-left-radius: 10px;
  background: #211b15;
  color: #b3a695;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.poster {
  position: relative;
  align-self: start;
}

.poster-frame {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #332b24;
  background: #0f0d0b;
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.95);
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.96) contrast(1.02);
}

.poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: rgba(242, 178, 74, 0.42);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255, 90, 31, 0.16), transparent 60%),
    #14110e;
}

.poster-count {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 90, 31, 0.92);
  color: #1b0d05;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.poster-note {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 8, 7, 0.82);
  color: #f0e7da;
  font-size: 10.5px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
}

.card-body {
  min-width: 0;
  padding: 2px 2px 2px 0;
}

.card-title {
  margin: 2px 0 6px;
  padding-right: 46px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: 0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin: 0;
  color: #a39585;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sources {
  margin: 4px 0 0;
  color: #7f7365;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-reason {
  margin: 10px 0 0;
  padding-left: 9px;
  border-left: 2px solid #3a2e24;
  color: #8d8072;
  font-size: 11.5px;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 19px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s, background 0.2s, border-color 0.2s;
}

.pill--play {
  border: 0;
  background: linear-gradient(135deg, var(--ember), var(--ember-2));
  color: #1b0d05;
  box-shadow: 0 12px 28px -16px rgba(255, 90, 31, 0.95);
}

.pill--play::before {
  content: "▶";
  font-size: 9px;
  transform: translateY(-0.5px);
}

.pill--play:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.pill--detail {
  border: 1px solid rgba(214, 69, 50, 0.45);
  background: rgba(214, 69, 50, 0.1);
  color: #ffb3a4;
}

.pill--detail:hover {
  background: rgba(214, 69, 50, 0.19);
  border-color: rgba(214, 69, 50, 0.7);
}

/* ------------------------------------------------------------------ fold */

.fold-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.fold-toggle::after {
  content: "▾";
  font-size: 9px;
  line-height: 1;
  color: var(--faint);
  transition: transform 0.22s var(--ease), color 0.2s;
}

.fold-toggle:hover {
  color: var(--amber);
  border-color: rgba(242, 178, 74, 0.4);
  background: rgba(242, 178, 74, 0.05);
}

.fold-toggle[aria-expanded="true"] {
  color: var(--amber);
  border-color: rgba(242, 178, 74, 0.45);
  background: rgba(242, 178, 74, 0.07);
}

.fold-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
  color: var(--amber);
}

.fold {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #332b24;
  animation: fold-in 0.28s var(--ease) both;
}

.fold[hidden] {
  display: none;
}

.fold-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.fold-head strong {
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.source-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1.15fr) auto auto minmax(36px, 62px) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid #1f1a15;
  font-size: 12px;
}

.source-row:last-child {
  border-bottom: 0;
}

.source-name {
  color: #e6ddd0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

a.source-name:hover {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-cat {
  padding: 1px 6px;
  border: 1px solid #332b24;
  border-radius: 999px;
  color: #8b7f70;
  font-family: var(--font-mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.source-meta {
  color: #8b7f70;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.source-rank {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: #241e18;
  overflow: hidden;
}

.source-rank i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8c4a2a, var(--ember-2));
}

.source-open {
  color: var(--amber);
  font-size: 11.5px;
  text-decoration: none;
  white-space: nowrap;
}

.source-open:hover {
  text-decoration: underline;
}

.fold-legend {
  margin: 10px 0 0;
  color: #6a5f52;
  font-size: 10.5px;
  line-height: 1.7;
}

/* ----------------------------------------------------------------- empty */

.empty {
  margin-top: 22px;
  padding: 44px 24px;
  border: 1px dashed #3a2f26;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 90, 31, 0.03), transparent);
}

.empty-kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--faint);
}

.empty h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 23px;
}

.empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cloud-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed #2a241f;
}

.cloud-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

.cloud-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cloud-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.cloud-link:hover {
  color: var(--amber);
  border-color: rgba(242, 178, 74, 0.45);
}

.cloud-link .dot {
  width: 6px;
  height: 6px;
}

/* ---------------------------------------------------------------- skeleton */

.card--skeleton {
  animation: none;
  pointer-events: none;
}

.sk-poster {
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  background: linear-gradient(100deg, #15120f 20%, #1d1813 40%, #15120f 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.sk-line {
  height: 12px;
  margin-top: 12px;
  border-radius: 4px;
  background: linear-gradient(100deg, #15120f 20%, #1d1813 40%, #15120f 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.sk-line--title {
  height: 22px;
  width: 72%;
  margin-top: 6px;
}

.sk-line--short {
  width: 46%;
}

/* ---------------------------------------------------------------- footer */

.footer {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 84px auto 0;
  padding: 26px clamp(16px, 4vw, 40px) 64px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.9;
}

.footer p {
  margin: 0;
  max-width: 760px;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--amber);
}

.footer-right {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.noscript {
  padding: 20px;
  color: var(--amber);
}

/* ---------------------------------------------------------------- drawer */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 3, 2, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.drawer-backdrop.open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(440px, 94vw);
  background: #12100d;
  border-left: 1px solid var(--line);
  box-shadow: -40px 0 80px -40px rgba(0, 0, 0, 0.9);
  transform: translateX(102%);
  transition: transform 0.36s var(--ease);
}

.drawer.open {
  transform: none;
}

.drawer[hidden] {
  display: none;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-kicker {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--faint);
}

.drawer-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 23px;
}

.drawer-meta {
  margin: 6px 0 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
}

.drawer-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-close:hover {
  color: var(--text);
  border-color: rgba(255, 90, 31, 0.5);
}

.drawer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-filter {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-filter.is-active {
  color: #ffbd97;
  border-color: rgba(255, 90, 31, 0.5);
  background: rgba(255, 90, 31, 0.1);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px 40px;
  overscroll-behavior: contain;
}

.drawer-group {
  margin: 18px 0 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--faint);
  text-transform: uppercase;
}

.drawer-site {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #1d1813;
}

.drawer-site-name {
  color: #e6ddd0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-site-sub {
  margin-top: 2px;
  color: #7f7365;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-site-right {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #8b7f70;
  white-space: nowrap;
}

.circuit-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(208, 101, 79, 0.16);
  color: #e0917f;
}

.health-bar {
  width: 46px;
  height: 3px;
  margin: 4px 0 0 auto;
  border-radius: 2px;
  background: #241e18;
  overflow: hidden;
}

.health-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7a4a2a, var(--amber));
}

/* ------------------------------------------------------------------ dots */

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
  flex-shrink: 0;
}

.dot--ok,
.dot--reachable {
  background: var(--ok);
}

.dot--restricted {
  background: var(--warn);
}

.dot--unreachable {
  background: var(--bad);
}

.dot--missing,
.dot--skipped {
  background: var(--idle);
}

/* ------------------------------------------------------------- animations */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fold-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tick-in {
  from {
    transform: scaleY(0.2);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-marquee {
    display: none;
  }

  .topbar-meta {
    display: none;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 40px;
  }

  .search {
    padding-left: 16px;
  }

  .search input {
    font-size: 15px;
  }

  .key-hint {
    display: none;
  }

  .search-btn {
    padding: 0 20px;
  }

  .card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    padding: 13px;
  }

  .card-title {
    font-size: 18px;
    padding-right: 34px;
  }

  .source-row {
    grid-template-columns: 8px minmax(0, 1fr) auto auto;
  }

  .source-cat,
  .source-rank {
    display: none;
  }

  .footer-right {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .card,
  .fold,
  .tick {
    animation: none !important;
  }
}

/* ==========================================================================
   Theme switch (dark = 午夜放映厅, light = 白日场)
   ========================================================================== */

.theme-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-btn:hover {
  color: var(--text);
  border-color: rgba(255, 90, 31, 0.5);
  background: rgba(255, 90, 31, 0.06);
}

.theme-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="dark"] .icon-moon,
:root[data-theme="light"] .icon-sun {
  display: none;
}

.drawer-site-name a,
a.drawer-site-name {
  text-decoration: none;
}

a.drawer-site-name:hover {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------ light theme */

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ece1;
  --bg-soft: #efe6d9;
  --surface: #fbf6ec;
  --surface-2: #f6efe2;
  --line: #dccdb8;
  --line-soft: #e8dccb;
  --text: #241d17;
  --muted: #6c5f52;
  --faint: #9b8c7a;
  --ember: #dd4c14;
  --ember-2: #f06a26;
  --amber: #a86a12;
  --crimson: #b53a28;
  --ok: #2f7a45;
  --warn: #a5691a;
  --bad: #a3402f;
  --idle: #b9ab99;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(224, 78, 21, 0.1), transparent 62%),
    radial-gradient(900px 480px at 8% 4%, rgba(168, 106, 18, 0.06), transparent 60%),
    var(--bg);
}

:root[data-theme="light"] body::after {
  background: radial-gradient(120% 90% at 50% 0%, transparent 58%, rgba(110, 82, 48, 0.16) 100%);
}

:root[data-theme="light"] .grain {
  opacity: 0.035;
  mix-blend-mode: multiply;
}

:root[data-theme="light"] ::selection {
  background: rgba(224, 78, 21, 0.22);
  color: #241d17;
}

:root[data-theme="light"] .topbar {
  background: rgba(243, 236, 225, 0.82);
}

:root[data-theme="light"] .skip-link {
  background: var(--ember);
  color: #fff8ef;
}

:root[data-theme="light"] .side-marquee {
  color: rgba(120, 95, 65, 0.42);
}

:root[data-theme="light"] .display-accent {
  text-shadow: 0 0 40px rgba(224, 78, 21, 0.16);
}

:root[data-theme="light"] .search {
  background: linear-gradient(180deg, #fffaf1, #f7efe2);
  border-color: #d9c8b2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 22px 50px -32px rgba(150, 70, 25, 0.45);
}

:root[data-theme="light"] .search:focus-within {
  border-color: rgba(221, 76, 20, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 0 4px rgba(221, 76, 20, 0.1),
    0 22px 60px -28px rgba(150, 70, 25, 0.5);
}

:root[data-theme="light"] .search input::placeholder {
  color: #a3927d;
}

:root[data-theme="light"] .search-btn {
  color: #2a1206;
}

:root[data-theme="light"] .cat-btn.is-active,
:root[data-theme="light"] .drawer-filter.is-active {
  color: #b23a0c;
  border-color: rgba(200, 70, 20, 0.5);
  background: rgba(224, 78, 21, 0.09);
}

:root[data-theme="light"] .chip:hover {
  color: var(--amber);
  border-color: rgba(168, 106, 18, 0.4);
  background: rgba(168, 106, 18, 0.07);
}

:root[data-theme="light"] .switch-track {
  background: #e6dac9;
  border-color: #d2c1aa;
}

:root[data-theme="light"] .switch-track::after {
  background: #a8967f;
}

:root[data-theme="light"] .switch input:checked + .switch-track {
  background: rgba(224, 78, 21, 0.16);
  border-color: rgba(224, 78, 21, 0.55);
}

:root[data-theme="light"] .rail {
  background: linear-gradient(180deg, #fbf5ea, #f4ecdf);
}

:root[data-theme="light"] .rail::before,
:root[data-theme="light"] .rail::after {
  background-image: repeating-linear-gradient(
    90deg,
    rgba(120, 100, 80, 0.34) 0 5px,
    transparent 5px 16px
  );
  opacity: 0.55;
}

:root[data-theme="light"] .tick {
  background: #e3d7c6;
}

:root[data-theme="light"] .tick--empty {
  background: #c6a97a;
}

:root[data-theme="light"] .tick--skipped {
  border-color: #cbbca8;
}

:root[data-theme="light"] .card {
  background: linear-gradient(160deg, #fffaf1 0%, #fbf4e8 58%, #f8f0e3 100%);
  box-shadow: 0 18px 40px -38px rgba(90, 60, 30, 0.55);
}

:root[data-theme="light"] .card:hover {
  border-color: #cdbba4;
  box-shadow: 0 22px 50px -36px rgba(90, 60, 30, 0.4);
}

:root[data-theme="light"] .badge {
  background: #efe4d3;
  color: #7a6a58;
}

:root[data-theme="light"] .poster-frame {
  border-color: #d8c8b2;
  background: #e9dfd0;
  box-shadow: 0 12px 28px -18px rgba(60, 40, 20, 0.4);
}

:root[data-theme="light"] .poster-fallback {
  color: rgba(168, 106, 18, 0.5);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(224, 78, 21, 0.12), transparent 60%),
    #f3e9da;
}

:root[data-theme="light"] .card-meta {
  color: #6c5f52;
}

:root[data-theme="light"] .card-sources {
  color: #8a7a67;
}

:root[data-theme="light"] .card-reason {
  border-left-color: #d8c5ad;
  color: #7d6d5b;
}

:root[data-theme="light"] .pill--detail {
  border-color: rgba(181, 58, 40, 0.38);
  background: rgba(181, 58, 40, 0.08);
  color: #a03a27;
}

:root[data-theme="light"] .source-row {
  border-bottom-color: #eee2d2;
}

:root[data-theme="light"] .source-name {
  color: #2c241c;
}

:root[data-theme="light"] .source-cat {
  border-color: #ddcdb7;
  color: #7d6c59;
}

:root[data-theme="light"] .source-meta {
  color: #7d6c59;
}

:root[data-theme="light"] .source-rank {
  background: #e9dcca;
}

:root[data-theme="light"] .fold {
  border-top-color: #ddcdb7;
}

:root[data-theme="light"] .fold-legend {
  color: #8a7a67;
}

:root[data-theme="light"] .empty {
  border-color: #d9c7ae;
  background: linear-gradient(180deg, rgba(224, 78, 21, 0.04), transparent);
}

:root[data-theme="light"] .cloud-strip {
  border-top-color: #dccbb4;
}

:root[data-theme="light"] .sk-poster,
:root[data-theme="light"] .sk-line {
  background: linear-gradient(100deg, #f3e9da 20%, #faf3e7 40%, #f3e9da 60%);
}

:root[data-theme="light"] .drawer-backdrop {
  background: rgba(60, 45, 30, 0.26);
}

:root[data-theme="light"] .drawer {
  background: #fbf5ea;
  box-shadow: -30px 0 70px -40px rgba(80, 55, 30, 0.4);
}

:root[data-theme="light"] .drawer-site {
  border-bottom-color: #eee2d2;
}

:root[data-theme="light"] .drawer-site-name {
  color: #2c241c;
}

:root[data-theme="light"] .drawer-site-sub,
:root[data-theme="light"] .drawer-site-right {
  color: #7d6c59;
}

:root[data-theme="light"] .health-bar {
  background: #e9dcca;
}

:root[data-theme="light"] .circuit-tag {
  background: rgba(181, 58, 40, 0.12);
  color: #a3402f;
}

