/* ==========================================================================
   清流 · QingLiu — Criterion Collection × Literary Magazine Stylesheet
   Warm Paper (宣纸) Light Mode & Cinema Dark (暗房) Mode
   ========================================================================== */

:root,
[data-theme="paper"] {
  --bg-page: #f5f0e6;
  --bg-elevated: #fcf9f3;
  --bg-subtle: #ede6d8;
  --bg-pill: #efe8da;
  --bg-pill-hover: #e5dccb;
  --bg-topbar: rgba(245, 240, 230, 0.90);
  --text-primary: #1b1814;
  --text-secondary: #564e43;
  --text-muted: #847a6c;
  --border-hairline: rgba(34, 28, 20, 0.12);
  --border-strong: rgba(34, 28, 20, 0.24);
  --accent-seal: #9c2f21;
  --accent-seal-soft: rgba(156, 47, 33, 0.10);
  --accent-gold: #806132;
  --accent-gold-soft: rgba(128, 97, 50, 0.12);
  --shadow-card: 0 2px 10px rgba(28, 22, 14, 0.04), 0 1px 2px rgba(28, 22, 14, 0.06);
  --shadow-card-hover: 0 14px 32px rgba(28, 22, 14, 0.10), 0 2px 6px rgba(28, 22, 14, 0.06);
  --still-filter: saturate(0.95) contrast(1.02);
}

[data-theme="cinema"] {
  --bg-page: #11100e;
  --bg-elevated: #191815;
  --bg-subtle: #22201c;
  --bg-pill: #1f1d19;
  --bg-pill-hover: #2a2722;
  --bg-topbar: rgba(17, 16, 14, 0.90);
  --text-primary: #efeae0;
  --text-secondary: #b0a79a;
  --text-muted: #7b7368;
  --border-hairline: rgba(240, 232, 218, 0.10);
  --border-strong: rgba(240, 232, 218, 0.22);
  --accent-seal: #d66853;
  --accent-seal-soft: rgba(214, 104, 83, 0.15);
  --accent-gold: #cca86e;
  --accent-gold-soft: rgba(204, 168, 110, 0.14);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 16px 36px rgba(0, 0, 0, 0.55);
  --still-filter: saturate(0.94) contrast(1.04) brightness(0.96);
}

:root {
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "PMingLiU", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --max-width: 1320px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.22s ease, color 0.22s ease;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* ----------------- Top Folio Bar ----------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-topbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-hairline);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 11px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #9c2f21;
  color: #f8f4ec;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.22;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 15.5px;
  letter-spacing: 0.05em;
}

.brand-text small {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.action-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-pill-hover);
}

.action-pill:active {
  transform: translateY(1px);
}

.action-sibling {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
}

.action-sibling:hover {
  color: var(--text-primary);
}

.action-serendipity {
  background: var(--accent-seal-soft);
  border-color: rgba(156, 47, 33, 0.30);
  color: var(--accent-seal);
  font-weight: 600;
}

[data-theme="cinema"] .action-sibling {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
}

.action-sibling:hover {
  color: var(--text-primary);
}

.action-serendipity {
  border-color: rgba(214, 104, 83, 0.35);
}

.action-serendipity:hover {
  background: var(--accent-seal);
  color: #fcf9f3;
  border-color: var(--accent-seal);
}

.mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d7a5a;
}

.action-pill[aria-pressed="true"] .mode-dot {
  background: #c2782b;
}

/* ----------------- Masthead ----------------- */

.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px 64px;
}

.masthead {
  padding: 36px 0 26px;
  border-bottom: 1px solid var(--border-hairline);
}

.masthead-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.masthead h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: 0.02em;
}

.masthead-lead {
  margin: 0 0 18px;
  max-width: 820px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.78;
}

.masthead-lead strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ledger-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ledger-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ledger-sep {
  opacity: 0.4;
}

/* ----------------- Controls & Shelves ----------------- */

.controls-panel {
  padding: 20px 0 14px;
}

.shelf-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-hairline);
}

.shelf-row::-webkit-scrollbar {
  display: none;
}

.shelf-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.shelf-tab:hover {
  background: var(--bg-pill);
  color: var(--text-primary);
}

.shelf-tab.is-active {
  background: var(--text-primary);
  color: var(--bg-page);
  border-color: var(--text-primary);
}

.shelf-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  opacity: 0.72;
}

.filter-bar {
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.time-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.time-pills::-webkit-scrollbar {
  display: none;
}

.time-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.time-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.time-pill.is-active {
  background: var(--accent-gold-soft);
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.time-main {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.time-sub {
  font-size: 12px;
  opacity: 0.85;
}

.search-sort-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.platform-pills {
  display: inline-flex;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.plat-pill {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-right: 1px solid var(--border-hairline);
}

.plat-pill:last-child {
  border-right: 0;
}

.plat-pill.is-active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 230px;
  flex: 1 1 230px;
  max-width: 340px;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 6.5px 28px 6.5px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: var(--accent-gold);
}

.search-clear {
  position: absolute;
  right: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
}

.sort-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  font-size: 12.5px;
}

.sort-label {
  color: var(--text-muted);
}

.sort-box select {
  border: 0;
  background: transparent;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.results-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.results-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.clear-history-btn,
.reset-filters-btn {
  border: 0;
  background: transparent;
  color: var(--accent-seal);
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.action-collection.is-active {
  background: var(--text-primary);
  color: var(--bg-page);
  border-color: var(--text-primary);
}

.action-collection.is-active .pill-badge {
  background: rgba(255, 255, 255, 0.20);
  color: inherit;
}

.fav-star-icon {
  color: #c2852c;
}

.action-collection.is-active .fav-star-icon {
  color: #f3c86b;
}

.shelf-tab-personal {
  border-color: var(--border-hairline);
  background: var(--bg-elevated);
}

/* ----------------- Video Grid & Editorial Cards ----------------- */

.catalog-section {
  padding-top: 8px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.film-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.film-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.film-card.is-playing {
  border-color: var(--accent-seal);
  box-shadow: var(--shadow-card-hover);
  transform: none;
}

.film-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #12110f;
  overflow: hidden;
  cursor: pointer;
}

.film-card.is-playing .film-frame {
  cursor: default;
}

.inline-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.frame-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(18, 16, 14, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #faf6ee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.36);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.frame-play-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.film-frame:hover .frame-play-btn {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(156, 47, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.55);
}

.inline-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 6px 10px;
  background: #181614;
  color: #e8e1d5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
}

.inline-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #e28271;
  font-weight: 600;
  white-space: nowrap;
}

.inline-bar-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.inline-ctrl-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(242, 235, 222, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: #f3ede2;
  font-family: var(--font-sans);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.inline-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.inline-ctrl-origin {
  border-color: rgba(226, 130, 113, 0.45);
  background: rgba(156, 47, 33, 0.35);
  color: #ffdcd5;
  font-weight: 600;
}

.inline-ctrl-origin:hover {
  background: rgba(156, 47, 33, 0.65);
}

.film-media-slot {
  position: relative;
  width: 100%;
  height: 100%;
}

.film-img-direct {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: var(--still-filter);
  transition: transform 0.35s ease, opacity 0.2s ease;
}

.film-card:hover .film-img-direct {
  transform: scale(1.025);
}

.film-img-sprite {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  display: block;
  filter: var(--still-filter);
  image-rendering: auto;
}

.film-editorial-plate {
  width: 100%;
  height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, #25211c 0%, #171512 100%);
  color: #e9e2d4;
}

.film-plate-quote {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.frame-top-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.frame-top-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.frame-ep-pill {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(156, 47, 33, 0.86);
  backdrop-filter: blur(6px);
  color: #fcf8f0;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.inline-episode-bar,
.modal-episode-bar {
  padding: 8px 12px 10px;
  background: #151311;
  border-bottom: 1px solid rgba(242, 235, 222, 0.10);
  color: #eae3d6;
}

.modal-episode-bar {
  padding: 10px 20px 12px;
  background: #171512;
}

.ep-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 11.5px;
}

.ep-bar-label {
  color: #d6b47c;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ep-bar-now {
  color: #bfb7a8;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-pill-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.ep-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid rgba(242, 235, 222, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #dfd8ca;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.ep-pill:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(242, 235, 222, 0.34);
  color: #fff;
}

.ep-pill.is-active {
  background: #9c2f21;
  border-color: #c84b38;
  color: #fffaf3;
  font-weight: 600;
}

.ep-pill-title {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-sans);
  font-size: 10.5px;
  opacity: 0.9;
}

.frame-spine {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(18, 16, 14, 0.72);
  backdrop-filter: blur(6px);
  color: #f3ede2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.frame-top-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

.peek-cover-btn {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(18, 16, 14, 0.72);
  backdrop-filter: blur(6px);
  color: #f3ede2;
  border-radius: 4px;
  padding: 1.5px 6px;
  font-size: 10.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.frame-fs-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(18, 16, 14, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #faf6ee;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.95;
  transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.frame-fs-btn:hover {
  opacity: 1;
  background: #9c2f21;
  border-color: #d45542;
  color: #fff;
}

.film-card:hover .peek-cover-btn,
.peek-cover-btn.is-peeking {
  opacity: 1;
}

@media (hover: none) {
  .peek-cover-btn {
    opacity: 0.88;
  }
}

.frame-bottom-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

.peek-cover-btn.is-peeking {
  background: #9c2f21;
  border-color: #9c2f21;
}

.frame-bottom-badges {
  position: absolute;
  bottom: 10px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.frame-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.24);
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.frame-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c83e2b 0%, #ef6a51 100%);
  border-radius: 0 2px 2px 0;
  transition: width 0.2s ease;
}

.frame-still-tag {
  font-size: 10.5px;
  padding: 1.5px 6px;
  border-radius: 3px;
  background: rgba(18, 16, 14, 0.65);
  color: rgba(244, 239, 229, 0.88);
  letter-spacing: 0.04em;
}

.frame-duration {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(15, 14, 12, 0.82);
  color: #f7f3eb;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.film-body {
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.film-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.film-cat {
  color: var(--accent-seal);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.film-provenance {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.film-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.42;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.film-title:hover {
  color: var(--accent-seal);
}

.film-creator-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.film-creator {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.film-year {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.film-plat-badge {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.film-note {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.62;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.film-footer {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.quality-pill {
  color: var(--accent-gold);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.footer-right-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.fullscreen-open-btn,
.theater-open-btn {
  padding: 2.5px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.fullscreen-open-btn:hover,
.theater-open-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-pill);
  color: var(--text-primary);
}

/* ----------------- Pagination & Empty State ----------------- */

.load-more-wrap {
  margin-top: 32px;
  text-align: center;
}

.load-more-btn {
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.load-more-btn:hover {
  background: var(--text-primary);
  color: var(--bg-page);
}

.empty-state {
  margin: 48px auto;
  max-width: 440px;
  text-align: center;
  padding: 32px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.empty-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.empty-sub {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 0 0 18px;
}

/* ----------------- Footer ----------------- */

.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 28px 22px 42px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.footer-col {
  max-width: 640px;
}

.footer-col strong {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-size: 15px;
}

.footer-col p {
  margin: 6px 0 0;
  line-height: 1.65;
}

.footer-links {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.footer-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.frame-watched-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(24, 22, 19, 0.80);
  border: 1px solid rgba(214, 180, 124, 0.42);
  color: #ebd3a7;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card-fav-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(18, 16, 14, 0.76);
  backdrop-filter: blur(6px);
  color: #f3ede2;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.card-fav-btn:hover {
  background: rgba(34, 30, 25, 0.92);
  border-color: rgba(243, 200, 107, 0.65);
  color: #ffd778;
}

.card-fav-btn.is-fav {
  background: rgba(156, 47, 33, 0.92);
  border-color: rgba(243, 200, 107, 0.70);
  color: #ffe08a;
}

.history-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.history-remove-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
}

.history-remove-btn:hover {
  color: var(--accent-seal);
  background: var(--accent-seal-soft);
}

/* ----------------- Dedicated Full-Width Watch Page ----------------- */

.watch-view {
  padding: 20px 0 36px;
}

.watch-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.watch-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.watch-nav-left,
.watch-nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.watch-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-page);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.watch-back-btn:hover {
  opacity: 0.90;
}

.watch-home-btn,
.watch-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.watch-home-btn:hover,
.watch-ctrl-btn:hover {
  background: var(--bg-pill-hover);
}

.watch-fav-btn.is-fav {
  background: var(--accent-seal);
  border-color: var(--accent-seal);
  color: #fff8ee;
  font-weight: 600;
}

.watch-fs-btn,
.watch-webfs-btn {
  border-color: rgba(156, 47, 33, 0.38);
  font-weight: 600;
}

.watch-webfs-btn.is-active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-page);
}

.watch-theater-card {
  width: 100%;
  background: #161513;
  color: #efeae0;
  border: 1px solid rgba(242, 235, 222, 0.14);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.28);
}

.watch-stage-topbar {
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #11100e;
  border-bottom: 1px solid rgba(242, 235, 222, 0.09);
}

.watch-plat-tag {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(242, 235, 222, 0.18);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #c8bfb0;
}

.watch-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.watch-rel-card {
  display: flex;
  flex-direction: column;
  border-radius: 7px;
  overflow: hidden;
  background: #1e1c18;
  border: 1px solid rgba(242, 235, 222, 0.10);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.watch-rel-card:hover {
  transform: translateY(-2px);
  background: #26231e;
  border-color: rgba(242, 235, 222, 0.28);
}

.watch-rel-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f0e0c;
}

.watch-rel-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.watch-rel-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.38;
  color: #f2ede3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watch-rel-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9b9284;
}

@media (max-width: 720px) {
  .watch-view {
    padding: 12px 0 28px;
  }

  .watch-back-btn,
  .watch-home-btn,
  .watch-ctrl-btn {
    padding: 6px 11px;
    font-size: 12px;
  }

  .watch-theater-card {
    margin: 0 -14px;
    width: calc(100% + 28px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .watch-related-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------- Legacy Cinema Modal Rules Kept Clean ----------------- */

.cinema-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 7, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px 48px;
}

.cinema-dialog {
  width: 100%;
  max-width: 960px;
  background: #161513;
  color: #efeae0;
  border: 1px solid rgba(242, 235, 222, 0.14);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.cinema-topbar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #11100e;
  border-bottom: 1px solid rgba(242, 235, 222, 0.09);
}

.cinema-spine-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.spine-badge {
  padding: 2px 8px;
  border-radius: 4px;
  background: #9c2f21;
  color: #fcf9f3;
  font-weight: 600;
}

.modal-cat-tag {
  color: #d6b47c;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
}

.modal-dur-tag {
  color: #9e9689;
}

.cinema-top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cinema-reroll-btn,
.cinema-close-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(242, 235, 222, 0.16);
  background: #1f1d1a;
  color: #efeae0;
  font-size: 12.5px;
  cursor: pointer;
}

.cinema-reroll-btn:hover,
.cinema-close-btn:hover {
  background: #2c2924;
}

.cinema-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.cinema-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.cinema-poster-gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  cursor: pointer;
  background: #141210;
}

.cinema-poster-gate:hover .frame-play-btn {
  transform: translate(-50%, -50%) scale(1.07);
  background: rgba(156, 47, 33, 0.92);
}

.direct-open-bar {
  padding: 14px 20px;
  background: #1d1b18;
  border-bottom: 1px solid rgba(242, 235, 222, 0.09);
}

.direct-open-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.open-btn-fs {
  background: #f5efe4;
  color: #161411;
  border: 1px solid #f5efe4;
  font-weight: 700;
}

.open-btn-fs:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.open-btn-webfs {
  background: #27241f;
  color: #f6efe3;
  border: 1px solid rgba(245, 239, 228, 0.36);
  font-weight: 600;
}

.open-btn-webfs:hover {
  background: #36312a;
  border-color: rgba(245, 239, 228, 0.62);
  color: #ffffff;
}

.open-btn-webfs.is-active {
  background: #9c2f21;
  border-color: #d45542;
  color: #fffaf3;
}

.open-btn-restart {
  background: rgba(220, 179, 108, 0.14);
  color: #f6dfaf;
  border: 1px solid rgba(220, 179, 108, 0.45);
  font-family: var(--font-sans);
}

.open-btn-restart:hover {
  background: rgba(220, 179, 108, 0.25);
  border-color: rgba(235, 198, 130, 0.72);
  color: #fff8e7;
}

.open-btn-restart[hidden] {
  display: none !important;
}

/* 1-Click Tab-Filling Web Fullscreen (▣ 网页全屏) + iPhone iOS WebKit Fallback */
body.is-web-fullscreen {
  overflow: hidden !important;
}

body.is-web-fullscreen #watchStage {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  z-index: 9999 !important;
  background: #000 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

body.is-web-fullscreen #watchStage iframe {
  width: 100% !important;
  height: 100% !important;
}

.exit-webfs-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(14px, env(safe-area-inset-left, 14px));
  z-index: 10002;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(15, 14, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #faf6ee;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.32;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.50);
  transition: opacity 0.24s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.exit-webfs-btn.is-awake {
  opacity: 0.88;
}

.exit-webfs-btn:hover,
.exit-webfs-btn:focus-visible {
  opacity: 1 !important;
  background: rgba(156, 47, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.68);
  color: #ffffff;
}

.exit-webfs-btn[hidden] {
  display: none !important;
}

.open-btn-primary {
  background: #c84b38;
  color: #fff;
  border: 1px solid #c84b38;
}

.open-btn-primary:hover {
  background: #d95844;
}

.open-btn-secondary {
  background: #282520;
  color: #efeae0;
  border: 1px solid rgba(242, 235, 222, 0.20);
}

.open-btn-secondary:hover {
  background: #35312a;
}

.open-btn-ghost {
  background: transparent;
  color: #b5ac9e;
  border: 1px solid rgba(242, 235, 222, 0.14);
}

.open-btn-ghost:hover {
  color: #efeae0;
  border-color: rgba(242, 235, 222, 0.30);
}

.direct-open-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #938b7e;
}

.cinema-dossier {
  padding: 22px 24px 28px;
}

.cinema-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.38;
  color: #f6f1e7;
}

.cinema-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: #b4ab9d;
  margin-bottom: 16px;
}

.cinema-byline a {
  color: #dfc08c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cinema-editorial {
  margin: 0 0 18px;
  padding: 13px 16px;
  border-left: 3px solid #c84b38;
  background: rgba(255, 255, 255, 0.035);
  border-radius: 0 6px 6px 0;
  color: #e6dfd2;
  font-size: 14px;
  line-height: 1.7;
}

.cinema-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.metric-chip {
  padding: 5px 10px;
  border-radius: 5px;
  background: #211f1b;
  border: 1px solid rgba(242, 235, 222, 0.09);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cfc6b8;
}

.metric-chip strong {
  color: #f2ece1;
}

.cinema-synopsis-box {
  margin-bottom: 22px;
  border-top: 1px solid rgba(242, 235, 222, 0.09);
  padding-top: 12px;
  color: #a9a092;
  font-size: 13px;
}

.cinema-synopsis-box summary {
  cursor: pointer;
  color: #c8bfb0;
  font-weight: 500;
}

.cinema-synopsis-box p {
  margin: 10px 0 0;
  line-height: 1.72;
  white-space: pre-line;
}

.cinema-related h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: #d6cec0;
}

.related-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.related-item {
  padding: 11px 13px;
  border-radius: 6px;
  background: #1f1d19;
  border: 1px solid rgba(242, 235, 222, 0.09);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.related-item:hover {
  background: #282520;
  border-color: rgba(242, 235, 222, 0.24);
}

.related-item-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: #f0ebe1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}

.related-item-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #968e81;
}

/* ----------------- Mobile Refinements ----------------- */

@media (max-width: 720px) {
  .topbar-inner {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-text strong {
    font-size: 14px;
  }

  .brand-text small {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .action-pill {
    padding: 4px 8px;
    font-size: 11.5px;
    gap: 4px;
  }

  .page-shell {
    padding: 0 14px 48px;
  }

  .masthead {
    padding: 24px 0 20px;
  }

  .masthead-lead {
    font-size: 14px;
  }

  .search-sort-group {
    width: 100%;
    justify-content: stretch;
  }

  .search-box {
    max-width: none;
    flex: 1 1 100%;
    order: -1;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cinema-backdrop {
    padding: 0;
  }

  .cinema-dialog {
    border-radius: 0;
    min-height: 100vh;
    border: 0;
  }

  .cinema-dossier {
    padding: 18px 16px 28px;
  }

  .open-btn {
    flex: 1 1 auto;
  }
}
