:root {
  color-scheme: dark;
  --bg: #111;
  --panel: #1a1a1d;
  --panel-2: #222226;
  --line: rgba(255,255,255,.11);
  --text: #f7f7f7;
  --muted: #aaa;
  --hot: #ff3565;
  --blue: #26c7ff;
  --gold: #ffbd3f;
  --violet: #9b6cff;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: #111;
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img, video, iframe { max-width: 100%; }

.hidden { display: none !important; }
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.84);
}
.age-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 20px 80px rgba(0,0,0,.55);
}
.age-panel h1 { margin: 6px 0; }
.age-panel p { color: var(--muted); }
.age-actions { display: flex; gap: 10px; margin-top: 18px; }
.age-actions button, .age-actions a {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.age-actions button { background: var(--hot); color: white; font-weight: 700; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #2d2d2f;
  background: rgba(17,17,17,.96);
}
.header-inner {
  width: min(1180px, calc(100% - 24px));
  min-height: 74px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(280px, 520px);
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--hot), #9b1cff);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 26px; }
.brand small { color: var(--muted); font-size: 12px; }
.search-bar { display: flex; gap: 8px; }
.search-bar input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid #303036;
  border-radius: 6px;
  background: #080808;
  color: var(--text);
  padding: 0 12px;
}
.search-bar button {
  border: 0;
  border-radius: 6px;
  background: var(--hot);
  color: white;
  padding: 0 18px;
  font-weight: 700;
}
.main-nav {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.main-nav button, .main-nav a, .category-list button, .sort-tabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #303036;
  border-radius: 6px;
  background: linear-gradient(#2c2c30, #18181b);
  color: var(--text);
  padding: 0 12px;
}
.main-nav button.active, .main-nav a.active, .category-list button.active, .sort-tabs button.active {
  border-color: var(--hot);
  background: var(--hot);
}

.page-wrap {
  width: min(1180px, calc(100% - 24px));
  margin: 14px auto 90px;
}
.top-ad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.top-ad, .wide-ad, .box-ad, .inside-ad, .sticky-inner, .rail-ad {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.16);
  text-align: center;
  overflow: hidden;
}
.top-ad strong, .wide-ad strong, .box-ad strong, .inside-ad strong, .sticky-inner strong, .rail-ad strong { font-size: 24px; }
.top-ad span, .wide-ad span, .box-ad span, .inside-ad span, .sticky-inner span, .rail-ad span { color: rgba(255,255,255,.82); font-size: 13px; }
.ad-pink { background: linear-gradient(135deg, #ff3565, #7927ff); }
.ad-gold { background: linear-gradient(135deg, #ffbd3f, #ff3565); }
.ad-blue { background: linear-gradient(135deg, #26c7ff, #3045ff); }
.ad-violet { background: linear-gradient(135deg, #9b6cff, #ff3565); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb strong { color: var(--text); }
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.main-column { min-width: 0; }
.watch-card, .side-card {
  border: 1px solid #2c2c30;
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.player-frame video, .player-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}
.player-ad {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(320px, 74%);
  transform: translate(-50%, -50%);
  z-index: 5;
}
.inside-ad { min-height: 220px; }
.ad-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 8;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 18px;
}
.watch-info { padding: 14px; }
.watch-topline, .watch-meta, .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.watch-topline span, .watch-meta span, .tag-row span, .tag-cloud a {
  border: 1px solid #323238;
  border-radius: 999px;
  background: #242428;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
}
.watch-info h1 { margin: 10px 0 8px; font-size: clamp(22px, 3vw, 34px); line-height: 1.22; }
.watch-info p { margin: 0 0 12px; color: var(--muted); }
.watch-meta button {
  border: 0;
  border-radius: 999px;
  background: var(--hot);
  color: white;
  padding: 5px 14px;
  font-weight: 700;
}
.watch-link {
  display: block;
  margin-top: 8px;
  border-radius: 6px;
  background: #2b2b30;
  color: #fff;
  padding: 7px 9px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.watch-link:hover {
  background: var(--hot);
}
.demo-nav {
  width: auto;
  margin: 0;
  justify-content: end;
}
.demo-page {
  max-width: 1180px;
}
.demo-hero {
  border: 1px solid #2c2c30;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,53,101,.16), rgba(38,199,255,.08)),
    var(--panel);
  padding: 22px;
}
.demo-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 42px);
}
.demo-hero p {
  max-width: 760px;
  color: var(--muted);
  margin: 0;
}
.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.demo-actions button,
.demo-actions a,
.demo-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #303036;
  border-radius: 6px;
  background: var(--hot);
  color: white;
  padding: 0 14px;
  font-weight: 700;
}
.demo-actions a,
.demo-links a {
  background: #25252a;
}
.demo-status {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #303036;
  border-radius: var(--radius);
  background: #18181b;
  margin: 12px 0;
  padding: 0 14px;
  color: var(--muted);
}
.demo-status.ok { border-color: rgba(70, 211, 137, .55); color: #b6ffd6; }
.demo-status.bad { border-color: rgba(255, 53, 101, .65); color: #ffc0ce; }
.demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}
.demo-status.ok .demo-dot {
  background: #46d389;
  box-shadow: 0 0 18px #46d389;
}
.demo-status.bad .demo-dot {
  background: var(--hot);
  box-shadow: 0 0 18px var(--hot);
}
.pipeline-steps,
.demo-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.pipeline-steps article,
.demo-summary article {
  min-height: 82px;
  border: 1px solid #29292e;
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}
.pipeline-steps strong,
.demo-summary strong {
  display: block;
  color: var(--hot);
  font-size: 24px;
  line-height: 1;
}
.pipeline-steps span,
.demo-summary span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.demo-grid {
  display: grid;
  gap: 10px;
}
.demo-card {
  border: 1px solid #29292e;
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
}
.demo-card-top,
.demo-flow,
.demo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.demo-card-top {
  justify-content: space-between;
  align-items: center;
}
.demo-number,
.demo-state,
.demo-pill {
  border: 1px solid #323238;
  border-radius: 999px;
  background: #242428;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}
.demo-state.ok,
.demo-pill.ok {
  border-color: rgba(70, 211, 137, .42);
  color: #b6ffd6;
}
.demo-state.bad,
.demo-pill.bad {
  border-color: rgba(255, 53, 101, .55);
  color: #ffc0ce;
}
.demo-card h2 {
  margin: 12px 0;
  font-size: 18px;
  line-height: 1.35;
}
.demo-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.demo-detail div {
  border: 1px solid #29292e;
  border-radius: 6px;
  background: #151518;
  padding: 9px;
  min-width: 0;
}
.demo-detail dt {
  color: var(--muted);
  font-size: 12px;
}
.demo-detail dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.watch-page .content-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
}
.watch-page-card {
  box-shadow: 0 18px 70px rgba(0,0,0,.38);
}
.watch-full-player {
  aspect-ratio: 16 / 9;
}
.watch-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.nav-video {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid #303036;
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
}
.nav-video:last-child {
  justify-content: end;
  text-align: right;
}
.feed-note {
  color: var(--muted);
  font-size: 13px;
}
.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.theater-mode .site-header,
body.theater-mode .top-ad-grid,
body.theater-mode .breadcrumb,
body.theater-mode .sidebar,
body.theater-mode .inline-ad-row,
body.theater-mode .sticky-ad,
body.theater-mode .side-rail {
  display: none !important;
}
body.theater-mode .page-wrap {
  width: min(1280px, calc(100% - 24px));
  margin-top: 12px;
}
body.theater-mode .watch-page .content-layout {
  grid-template-columns: 1fr;
}
body.theater-mode .watch-full-player {
  aspect-ratio: 16 / 9;
}
.inline-ad-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 16px;
}
.wide-ad { min-height: 74px; }

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--hot);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.section-title h2 { margin: 0; }
.sort-tabs { display: flex; gap: 6px; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.video-card {
  overflow: hidden;
  border: 1px solid #29292e;
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
}
.video-card:hover, .video-card.active { border-color: var(--hot); }
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #060606;
}
.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.hd-badge, .duration, .play-mark {
  position: absolute;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}
.hd-badge { top: 7px; left: 7px; background: var(--hot); }
.duration { right: 7px; bottom: 7px; background: rgba(0,0,0,.75); }
.play-mark {
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,53,101,.9);
}
.card-body { padding: 9px; }
.card-body h3 {
  min-height: 56px;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.34;
}
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 8px;
}
.pagination a {
  min-width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #303036;
  border-radius: 6px;
  background: #222226;
  color: var(--text);
}
.pagination a.active { background: var(--hot); border-color: var(--hot); }

.sidebar {
  display: grid;
  gap: 12px;
}
.side-card { padding: 12px; }
.side-card h2 { margin: 0 0 10px; font-size: 18px; }
.category-list { display: grid; gap: 7px; }
.category-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.box-ad { min-height: 250px; }
.mini-list { display: grid; gap: 9px; }
.mini-item {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
}
.mini-item img {
  width: 86px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
}
.mini-item span { font-size: 12px; line-height: 1.3; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }

.side-rail {
  position: fixed;
  top: 142px;
  z-index: 30;
  width: 112px;
}
.side-left { left: 10px; }
.side-right { right: 10px; }
.rail-ad {
  min-height: 420px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.rail-pink { background: linear-gradient(180deg, #ff3565, #7927ff); }
.rail-blue { background: linear-gradient(180deg, #26c7ff, #3045ff); }
.sticky-ad {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 60;
  width: min(760px, calc(100% - 24px));
  transform: translateX(-50%);
}
.sticky-inner { min-height: 72px; }

@media (max-width: 1440px) {
  .side-rail { display: none; }
}
@media (max-width: 980px) {
  .content-layout { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-page .content-layout { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline-steps, .demo-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  body { padding-bottom: 82px; }
  .site-header { position: static; }
  .header-inner { grid-template-columns: 1fr; padding: 12px 0; }
  .brand small { display: none; }
  .top-ad-grid, .inline-ad-row { grid-template-columns: 1fr; }
  .content-layout { gap: 10px; }
  .watch-card { margin-inline: -4px; }
  .section-title { align-items: stretch; flex-direction: column; }
  .sort-tabs { overflow-x: auto; }
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-actions-row { grid-template-columns: 1fr; }
  .nav-video:last-child { justify-content: start; text-align: left; }
  .card-body h3 { min-height: 50px; font-size: 12px; }
  .tag-row { display: none; }
  .sidebar { grid-template-columns: 1fr; }
  .side-card:nth-of-type(2) { display: none; }
  .player-ad { width: min(260px, 82%); }
  .inside-ad { min-height: 150px; }
  .demo-nav { justify-content: start; }
  .pipeline-steps, .demo-summary, .demo-detail { grid-template-columns: 1fr; }
  .demo-hero { padding: 16px; }
}
