/*
Theme Name: Xinghuo
Theme URI: https://gitlab.ai-ops.click/chufeng/sayknowseo
Description: Stream Shelf 短剧主题 — 人脸海报主导，去模板味。人机同页、可播、单广告位标注。
Author: SayKnow
Version: 0.7.23
Text Domain: xinghuo
Requires at least: 6.4
Requires PHP: 8.1
*/

:root {
  --xh-bg: #0b0b0f;
  --xh-elev: #14141a;
  --xh-card: transparent;
  --xh-text: #f4f4f6;
  --xh-muted: #9a9aa8;
  --xh-amber: #e24b5a; /* play / accent — not luxury gold */
  --xh-amber-2: #c93d4b;
  --xh-line: #2a2a34;
  --xh-rank: #e24b5a;
  --xh-heat: #e24b5a;
  --xh-max: 1240px;
  --xh-radius: 4px;
  --xh-radius-lg: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background: var(--xh-bg);
  color: var(--xh-text);
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
/* stream.js marks failed images: keep the box (card background shows), hide the broken icon + alt text. */
img.xh-img-broken { visibility: hidden; }
button { font: inherit; }

.xh-wrap { max-width: var(--xh-max); margin: 0 auto; padding: 0 16px; }

/* —— Nav: flat, no glass —— */
.xh-nav {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 0 14px;
  margin-bottom: 0;
  border-bottom: 0;
  position: relative; z-index: 40;
  background: transparent;
}
.xh-brand {
  display: inline-flex; align-items: center; gap: 0;
  font-weight: 700; letter-spacing: -.01em; color: var(--xh-text); font-size: 18px;
  flex-shrink: 0;
}
.xh-brand .star { display: none; } /* kill decorative badge */
.xh-nav-links {
  display: flex; gap: 18px; font-size: 14px; flex: 1; min-width: 0;
  font-weight: 500;
}
.xh-nav-links a { color: var(--xh-muted); }
.xh-nav-links a:hover { color: var(--xh-text); }
.xh-news-list { list-style: none; padding: 0; margin: 0; }
.xh-news-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--xh-line, #e5e7eb);
}
.xh-news-list a { color: var(--xh-text); font-weight: 600; }
.xh-prose { line-height: 1.7; margin: 16px 0 24px; }
.xh-prose p { margin: 0 0 0.85em; }
.xh-article .xh-muted { font-size: 13px; }
.xh-search {
  display: flex; align-items: center; gap: 8px;
  background: #1c1c1f; border: 0;
  border-radius: 4px; padding: 8px 12px; min-width: 180px; max-width: 240px; flex: 0 1 240px;
}
.xh-search input {
  flex: 1; border: 0; background: transparent; color: var(--xh-text); outline: none; font-size: 13px;
}
.xh-search input::placeholder { color: #66666e; }

/* —— Hero: full-bleed photo, soft corners, copy on image —— */
.xh-hero {
  position: relative;
  border-radius: var(--xh-radius-lg);
  overflow: hidden;
  margin: 8px 0 28px;
  border: 0;
  background: #1a1a1c;
  min-height: min(48vh, 400px);
}
.xh-hero-track { position: relative; min-height: inherit; }
.xh-hero-slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
}
.xh-hero-slide.is-active { opacity: 1; pointer-events: auto; position: relative; }
.xh-hero-bg {
  position: absolute; inset: 0;
  background: #222;
}
.xh-hero-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block;
}
.xh-hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(17,17,19,.88) 0%, rgba(17,17,19,.45) 38%, rgba(17,17,19,.12) 62%, rgba(17,17,19,.35) 100%),
    linear-gradient(0deg, rgba(17,17,19,.7) 0%, transparent 42%);
}
.xh-hero-copy {
  position: relative; z-index: 1;
  max-width: 480px;
  padding: 48px 32px 40px;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: min(48vh, 400px);
}
.xh-eyebrow {
  color: rgba(255,255,255,.55); font-size: 12px; margin-bottom: 10px;
  letter-spacing: 0; text-transform: none; font-weight: 500;
}
.xh-hero h1 {
  margin: 0 0 12px; font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.15;
}
.xh-hero p {
  color: rgba(242,242,243,.72); margin: 0 0 16px; max-width: 34em;
  font-size: 14px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.xh-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-bottom: 18px; font-size: 12px; color: rgba(255,255,255,.5);
}
.xh-pill {
  display: inline; font-size: 12px; padding: 0; border-radius: 0;
  border: 0; color: rgba(255,255,255,.5);
  background: transparent;
}
.xh-pill::after { content: none; }
.xh-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.xh-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: #111;
  padding: 10px 22px; border-radius: 4px; font-weight: 650; font-size: 14px;
  transition: opacity .15s ease;
  box-shadow: none;
}
.xh-cta:hover { opacity: .92; color: #111; transform: none; filter: none; }
.xh-diversion {
  font-size: 13px; color: rgba(255,255,255,.45);
  text-decoration: none;
}
.xh-diversion:hover { color: rgba(255,255,255,.85); text-decoration: underline; text-underline-offset: 3px; }
.xh-hero-dots {
  position: absolute; left: 32px; bottom: 16px; z-index: 2;
  display: flex; gap: 5px;
}
.xh-dot {
  width: 6px; height: 6px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.25); padding: 0; cursor: pointer;
}
.xh-dot.is-on { background: #fff; width: 16px; }

.xh-hero--slim { min-height: min(36vh, 280px); }
.xh-hero--slim .xh-hero-copy { min-height: min(36vh, 280px); padding: 32px 28px 36px; }
.xh-hero--slim h1 { font-size: clamp(24px, 3vw, 32px); }
.xh-hero--theater { min-height: min(58vh, 480px); border-radius: 0; margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); max-width: none; }
.xh-hero--theater .xh-hero-copy { min-height: min(58vh, 480px); max-width: 560px; padding-left: 40px; }
.xh-hero--empty .xh-hero-copy { min-height: 200px; }

/* —— Rails —— */
.xh-section-title {
  margin: 0; font-size: 17px; font-weight: 650; color: var(--xh-text);
  letter-spacing: -.01em;
}
.xh-rail { margin-bottom: 30px; }
.xh-rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.xh-view-all { font-size: 13px; color: var(--xh-muted); font-weight: 400; }
.xh-view-all:hover { color: var(--xh-text); }

.xh-river {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.xh-river::-webkit-scrollbar { display: none; }
.xh-river .xh-card {
  flex: 0 0 132px; scroll-snap-align: start;
}
@media (min-width: 900px) {
  .xh-river .xh-card { flex-basis: 148px; }
}

.xh-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 10px; margin-bottom: 28px;
}
.xh-grid--poster .xh-card .cover { aspect-ratio: 2/3; }

/* Poster card: image first, title under — no chrome box */
.xh-card {
  background: transparent; border-radius: 0; overflow: visible;
  border: 0; color: inherit; display: block;
  transition: none;
}
.xh-card:hover { border-color: transparent; transform: none; }
.xh-card:hover .cover { opacity: .92; }
.xh-card .cover {
  aspect-ratio: 2/3;
  background: #1c1c1f;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}
.xh-card .cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block;
}
.xh-card .tag {
  position: absolute; top: 0; left: 0; right: 0;
  font-size: 0; padding: 0; /* hide genre chip — AI smell */
  background: transparent;
}
.xh-card .rank {
  position: absolute; left: 0; bottom: 0; top: auto; right: auto;
  min-width: 0; height: auto; padding: 4px 8px; border-radius: 0 4px 0 0;
  background: rgba(0,0,0,.65); color: #fff;
  display: block; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.xh-card .xh-badge { display: none; } /* corner 集数 badge — shown by layout-apptab only */
.xh-card .meta {
  display: block; padding: 8px 1px 0; font-size: 13px;
}
.xh-card .t {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--xh-text); font-weight: 500; line-height: 1.3;
}
.xh-card .score {
  color: var(--xh-muted); font-size: 11px; margin-top: 3px;
  display: block;
}

/* —— Rank board —— */
.xh-board { margin-bottom: 28px; }
.xh-board > .xh-section-title { margin-bottom: 10px; }
.xh-board-list { list-style: none; margin: 0; padding: 0; }
.xh-board-item {
  display: grid;
  grid-template-columns: 28px 48px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.xh-board-n {
  font-weight: 700; font-size: 18px; color: var(--xh-muted);
  font-variant-numeric: tabular-nums; text-align: center;
}
.xh-board-n.is-hot { color: var(--xh-amber); }
.xh-board-thumb {
  width: 48px; height: 68px; border-radius: 4px;
  background: #222; display: block; overflow: hidden;
  position: relative;
}
.xh-board-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block;
}
.xh-board-title {
  color: var(--xh-text); font-size: 14px; font-weight: 550;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.xh-board-sub {
  margin-top: 3px; font-size: 12px; color: var(--xh-muted);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.xh-board-play {
  font-size: 12px; font-weight: 600; color: #111;
  background: #fff; padding: 6px 12px; border-radius: 4px;
}
.xh-board-play:hover { opacity: .9; color: #111; }

.xh-cats {
  display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: 0;
}
.xh-cats a {
  padding: 10px 14px 12px; border-radius: 0; border: 0;
  background: transparent; color: var(--xh-muted); font-size: 13px;
  font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.xh-cats a:hover { color: var(--xh-text); border-bottom-color: var(--xh-text); }

.xh-split {
  display: grid; grid-template-columns: 1.5fr .85fr; gap: 18px; margin-bottom: 28px;
}
.xh-split .xh-hero { margin-bottom: 0; }
.xh-side-panel {
  background: transparent; border: 0;
  border-radius: 0; padding: 4px 0 0;
  max-height: min(48vh, 400px); overflow: auto;
}
.xh-side-panel .xh-board { margin-bottom: 0; }
.xh-side-panel .xh-board-item { grid-template-columns: 24px 40px 1fr; }
.xh-side-panel .xh-board-play { display: none; }

.xh-ad {
  border: 0; border-radius: 4px;
  padding: 12px 14px; margin: 4px 0 28px;
  background: #1a1a1c; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.xh-ad .lab {
  font-size: 10px; padding: 2px 6px; border-radius: 2px;
  background: #333; color: #aaa; flex-shrink: 0; letter-spacing: 0;
}
.xh-ad .body { flex: 1; font-size: 12px; color: var(--xh-muted); min-width: 120px; }
.xh-ad--img { display: block; position: relative; padding: 0; overflow: hidden; }
.xh-ad--img .lab { position: absolute; top: 8px; left: 8px; z-index: 1; }
.xh-ad-media, .xh-ad-media picture { display: block; width: 100%; }
.xh-ad-media img { display: block; width: 100%; height: auto; }

.xh-player {
  background: transparent;
  border-radius: 6px;
  aspect-ratio: auto;
  border: 0;
  display: block;
  overflow: visible;
  max-width: 100%;
}
.xh-player .sk-player { width: 100%; }
.xh-player video, .xh-player iframe { width: 100%; height: 100%; border: 0; }
.xh-detail { display: grid; grid-template-columns: 1.7fr .8fr; gap: 24px; }
.xh-detail > * { min-width: 0; } /* the nowrap 选集 strip must scroll, not widen the column */
.xh-detail-title { margin: 16px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.xh-detail-ep { color: var(--xh-muted); font-size: 13px; margin: 0 0 8px; }
.xh-detail-body { color: var(--xh-muted); font-size: 14px; margin-bottom: 14px; }
.xh-eps {
  display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 8px;
  overflow-x: auto; padding-bottom: 4px;
}
.xh-eps a, .xh-eps span {
  font-size: 12px; padding: 7px 11px; border-radius: 4px; flex-shrink: 0;
  background: #1c1c1f; border: 0; color: var(--xh-text);
}
.xh-eps .on { background: #fff; color: #111; }
.xh-eps a:hover { background: #2a2a2e; }
.xh-card-side { display: block; margin-bottom: 12px; }
.xh-card-side .cover-wide { aspect-ratio: 16/9; border-radius: 4px; background: #1c1c1f; overflow: hidden; position: relative; }
.xh-card-side .cover-wide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xh-card-side .meta { padding: 6px 0 0; }

/* Portrait-only cover in a landscape box (xinghuo_wide_cover_html): blurred same-URL backdrop + whole poster. */
.xh-fit { position: absolute; inset: 0; display: block; overflow: hidden; background: #111; }
.xh-fit > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
.xh-fit > .xh-fit-bg { object-fit: cover; filter: blur(24px) brightness(.55); transform: scale(1.2); }
.xh-fit > .xh-fit-fg { object-fit: contain; object-position: 50% 50%; }
.xh-card .cover .xh-fit-fg { object-fit: contain; object-position: 50% 50%; } /* outranks .xh-card .cover img */
@media (min-width: 901px) {
  .xh-hero-bg .xh-fit-fg { object-position: 82% 50%; } /* poster right, copy column left stays clear */
}
/* …and behind a 16:9 player (xinghuo_player_backdrop); the player chrome must let it show through. */
.xh-player--fit { position: relative; overflow: hidden; border-radius: 6px; }
.xh-player-bd {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  filter: blur(24px) brightness(.5); transform: scale(1.2); pointer-events: none;
}
.xh-player--fit .sk-player, .xh-player--fit video { background: transparent !important; } /* beats plugin + layout #000 */
.xh-player--fit .xh-player-empty { position: relative; color: #ccc; } /* paint above the positioned backdrop */
.xh-no-eps { color: var(--xh-muted); font-size: 13px; margin: 8px 0; }
.xh-eps .xh-no-eps { background: none; padding: 7px 0; }

.xh-empty { color: var(--xh-muted); font-size: 13px; margin: 8px 0; grid-column: 1 / -1; }
.xh-player-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px 16px; color: var(--xh-muted); text-align: center;
}
.xh-player-empty p { margin: 0; font-size: 13px; }
.xh-player-icon {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #333;
  background: radial-gradient(circle at 42% 50%, transparent 40%, #fff 41%, #fff 55%, transparent 56%);
  opacity: .4;
}

.xh-footer {
  border-top: 1px solid rgba(255,255,255,.06); padding: 20px 0 40px;
  color: #666; font-size: 12px; margin-top: 8px;
}
.xh-interlink { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }
.xh-interlink a { color: #888; }
.xh-interlink-label { color: #555; }

@media (max-width: 900px) {
  .xh-nav { flex-wrap: wrap; gap: 10px; }
  .xh-search { order: 3; width: 100%; max-width: none; flex: 1 1 100%; }
  .xh-hero, .xh-hero-copy, .xh-hero--slim .xh-hero-copy, .xh-hero--theater .xh-hero-copy {
    min-height: 0;
  }
  .xh-hero-copy { padding: 28px 18px 36px; min-height: 260px; }
  .xh-hero--theater { margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); }
  .xh-hero-dots { left: 18px; }
  .xh-detail { grid-template-columns: 1fr; }
  .xh-grid { grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
  .xh-split { grid-template-columns: 1fr; }
  .xh-side-panel { max-height: none; }
  .xh-board-item { grid-template-columns: 24px 40px 1fr auto; gap: 8px; }
}
@media (max-width: 480px) {
  .xh-river .xh-card { flex-basis: 128px; }
  .xh-grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .xh-card .t {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .xh-board-item { grid-template-columns: 22px 44px minmax(0, 1fr); gap: 8px; }
  .xh-board-play { display: none; }
  .xh-board-meta { min-width: 0; }
  .xh-player, .sk-player { max-width: 100%; }
  .xh-player video, .xh-player iframe {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
  }
}

/* —— 18+ gate (adult sites only; content stays rendered underneath, blurred) —— */
html.xh-age-open { overflow: hidden; }
html.xh-age-open .xh-wrap { filter: blur(12px); }
.xh-age {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.6);
}
.xh-age-box {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: 100%; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 24px max(40px, env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.07); border-radius: 20px 20px 0 0;
  background: #1b1b1f; color: #f2f2f4; text-align: center;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
.xh-age-handle { width: 36px; height: 4px; flex-shrink: 0; margin-bottom: 20px; border-radius: 999px; background: rgba(255,255,255,.24); }
.xh-age-brand { display: flex; align-items: center; gap: 10px; height: 45px; }
.xh-age-brand .xh-brand-mark { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; }
.xh-age-brand .xh-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.xh-age-brand .xh-brand-name { font-size: 22px; font-weight: 500; letter-spacing: .12em; color: #f2f2f4; }
.xh-age h2 { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; color: #f2f2f4; }
.xh-age p { width: 100%; margin: 0; font-size: 14px; line-height: 22px; color: #a1a1aa; }
.xh-age p a { border-radius: 2px; transition: color .15s; }
.xh-age p a:hover { color: #fff; }
.xh-age-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.xh-age-actions button {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; height: 48px;
  padding: 0 22px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; line-height: 22px; font-weight: 500; transition: filter .2s, border-color .2s, background-color .2s;
}
.xh-age-enter {
  border: 0; color: #fff;
  background: linear-gradient(158deg, #ff4a7b 14.6%, #ec237f 51.4%, #93226f 85.4%); /* reference pink on every skin/layout */
}
.xh-age-enter:hover { filter: brightness(1.1); }
.xh-age-leave { border: 1px solid rgba(255,255,255,.24); background: transparent; color: #f2f2f4; }
.xh-age-leave:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.05); }
.xh-age button:focus-visible, .xh-age a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (min-width: 768px) {
  html.xh-age-open .xh-wrap { filter: blur(16px); }
  .xh-age { align-items: center; padding: 24px; }
  .xh-age-box { width: 506px; max-height: calc(100dvh - 48px); gap: 20px; padding: 40px 40px 32px; border-radius: 20px; }
  .xh-age-handle { display: none; }
  .xh-age-brand { height: 54px; }
  .xh-age-brand .xh-brand-mark { width: 48px; height: 48px; border-radius: 12px; }
  .xh-age-brand .xh-brand-name { font-size: 26px; }
  .xh-age h2 { font-size: 28px; line-height: 38px; }
  .xh-age p { font-size: 15px; line-height: 24px; }
  .xh-age-actions button { height: 56px; padding: 0 28px; font-size: 16px; line-height: 24px; }
}
