:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --panel-line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --cyan: #22d3ee;
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.46);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.nav-open {
  overflow: hidden;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.78);
  border-bottom: 1px solid var(--panel-line);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  color: var(--soft);
  padding: 10px 16px;
  border-radius: 999px;
  transition: 0.22s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: white;
  background: rgba(37, 99, 235, 0.86);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: white;
  border-radius: 10px;
}

.hero-carousel {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  background-position: center;
  background-size: cover;
  transition: opacity 0.7s ease, visibility 0.7s ease, transform 1s ease;
  transform: scale(1.02);
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.78) 46%, rgba(2, 6, 23, 0.12)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.04));
}

.hero-content {
  position: relative;
  width: min(1200px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1200px;
}

.hero-content h1,
.hero-content h2 {
  width: min(680px, 100%);
  margin: 0 0 18px;
  font-size: clamp(2.35rem, 5.2vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero-pill,
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.9);
  color: #eff6ff;
  font-size: 0.88rem;
  font-weight: 700;
}

.hero-one {
  width: min(640px, 100%);
  margin: 0 0 10px;
  color: #e2e8f0;
  font-size: clamp(1.03rem, 1.5vw, 1.24rem);
}

.hero-summary {
  width: min(640px, 100%);
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions,
.compact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-muted {
  background: rgba(15, 23, 42, 0.84);
  color: white;
  border: 1px solid var(--panel-line);
}

.btn-ghost {
  color: #e0f2fe;
  border: 1px solid rgba(125, 211, 252, 0.26);
  background: rgba(14, 165, 233, 0.08);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.62);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(37, 99, 235, 0.86);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 5;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 18px;
  height: 4px;
  border: 0;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.68);
  cursor: pointer;
  transition: width 0.22s ease, background 0.22s ease;
}

.hero-dot.active {
  width: 34px;
  background: var(--blue);
}

.page-main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.with-top {
  padding-top: 42px;
}

.content-section {
  padding: 46px 0;
}

.narrow-section {
  padding-top: 56px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2,
.page-hero h1,
.detail-panel h1,
.detail-content h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.section-head p,
.page-hero p,
.detail-lead {
  color: var(--muted);
  line-height: 1.8;
}

.section-link {
  color: #93c5fd;
  font-weight: 700;
}

.search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(360px, 100%);
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.search-box span {
  color: var(--muted);
  font-size: 1.2rem;
}

.search-box input {
  width: 100%;
  height: 48px;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--soft);
  background: rgba(2, 6, 23, 0.42);
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px 18px;
}

.compact-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.movie-card {
  min-width: 0;
}

.movie-card[hidden],
.ranking-item[hidden] {
  display: none;
}

.poster-link {
  display: block;
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, #111827, #1e293b);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.34s ease, filter 0.34s ease;
}

.movie-card:hover .poster-frame img {
  transform: scale(1.08);
  filter: saturate(1.08);
}

.poster-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.14));
  opacity: 0;
  transition: opacity 0.24s ease;
}

.poster-overlay span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.9);
  color: white;
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.36);
}

.movie-card:hover .poster-overlay {
  opacity: 1;
}

.badge {
  position: absolute;
  top: 10px;
  z-index: 2;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 8px;
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.badge-main {
  left: 10px;
  background: var(--blue);
}

.badge-year {
  right: 10px;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(10px);
}

.movie-card strong {
  display: -webkit-box;
  min-height: 42px;
  margin-top: 10px;
  overflow: hidden;
  color: white;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card:hover strong {
  color: #60a5fa;
}

.movie-card p {
  display: -webkit-box;
  min-height: 40px;
  margin: 6px 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #94a3b8;
  font-size: 0.78rem;
}

.card-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.82);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.category-grid.large {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-tile,
.category-card-large {
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.84)),
    var(--panel);
  box-shadow: var(--shadow);
}

.category-tile > a,
.category-card-large > a {
  display: block;
  padding: 20px;
}

.category-tile span,
.category-card-large h2 {
  display: block;
  color: white;
  font-weight: 800;
}

.category-tile p,
.category-card-large p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.tile-links,
.category-preview-links {
  display: grid;
  gap: 8px;
  padding: 0 20px 20px;
}

.tile-links a,
.category-preview-links a {
  color: #bfdbfe;
  font-size: 0.9rem;
}

.page-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(34px, 6vw, 72px);
  border: 1px solid var(--panel-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.22), transparent 20rem),
    linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(2, 6, 23, 0.72));
  box-shadow: var(--shadow);
}

.page-hero h1 {
  max-width: 820px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.08;
}

.page-hero p {
  max-width: 720px;
  margin: 16px 0 0;
}

.channel-hero,
.rank-hero {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.28), transparent 26rem),
    radial-gradient(circle at bottom left, rgba(34, 211, 238, 0.16), transparent 22rem),
    linear-gradient(135deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.82));
}

.rank-strip,
.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rank-strip a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
}

.rank-num,
.ranking-number {
  color: #93c5fd;
  font-weight: 900;
}

.rank-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-score,
.ranking-score {
  color: #fde68a;
  font-weight: 800;
}

.ranking-list {
  display: grid;
  gap: 12px;
}

.ranking-item a {
  display: grid;
  grid-template-columns: 64px 74px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ranking-item a:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.5);
}

.ranking-item img {
  width: 74px;
  height: 102px;
  border-radius: 12px;
  object-fit: cover;
}

.ranking-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.ranking-copy strong {
  font-size: 1.08rem;
}

.ranking-copy em {
  color: #cbd5e1;
  font-size: 0.88rem;
  font-style: normal;
}

.ranking-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: #bfdbfe;
}

.watch-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(320px, 0.88fr);
  gap: 24px;
  align-items: start;
}

.player-column,
.detail-panel,
.detail-content article {
  border: 1px solid var(--panel-line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: var(--shadow);
}

.player-column {
  overflow: hidden;
}

.stream-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: black;
}

.video-element {
  width: 100%;
  height: 100%;
  display: block;
  background: black;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  color: white;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.24), rgba(2, 6, 23, 0.68));
  cursor: pointer;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.player-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.big-play {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.92);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.34);
  font-size: 2rem;
}

.player-message {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: none;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.88);
  color: white;
}

.stream-player.player-unavailable .player-message {
  display: block;
}

.detail-panel {
  padding: 28px;
}

.detail-panel h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.detail-lead {
  margin: 16px 0 24px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.detail-meta div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.46);
}

.detail-meta dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-meta dd {
  margin: 5px 0 0;
  color: white;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-list span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.22);
}

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

.detail-content article {
  padding: 28px;
}

.detail-content h2 {
  font-size: 1.35rem;
}

.detail-content p {
  margin: 14px 0 0;
  color: var(--soft);
  line-height: 1.9;
}

.related-section {
  padding-top: 34px;
}

.related-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.empty-state {
  margin: 24px 0 0;
  padding: 22px;
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
  text-align: center;
}

.site-footer {
  margin-top: 36px;
  border-top: 1px solid var(--panel-line);
  background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 0;
}

.footer-inner p {
  margin: 10px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.footer-links a {
  color: #bfdbfe;
}

.footer-copy {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: var(--muted);
  border-top: 1px solid var(--panel-line);
  text-align: center;
}

@media (max-width: 1100px) {
  .movie-grid,
  .compact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    display: grid;
    gap: 8px;
    padding: 18px;
    background: rgba(2, 6, 23, 0.97);
    border-bottom: 1px solid var(--panel-line);
    transform: translateY(-120%);
    transition: transform 0.24s ease;
  }

  body.nav-open .site-nav {
    transform: translateY(0);
  }

  .hero-carousel {
    height: 560px;
  }

  .hero-arrow {
    display: none;
  }

  .search-panel,
  .section-head,
  .footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-chips {
    justify-content: flex-start;
  }

  .movie-grid,
  .compact-grid,
  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-grid,
  .category-grid.large,
  .detail-content,
  .rank-strip {
    grid-template-columns: 1fr;
  }

  .ranking-item a {
    grid-template-columns: 46px 62px 1fr;
  }

  .ranking-score {
    grid-column: 3;
  }
}

@media (max-width: 540px) {
  .header-inner,
  .page-main,
  .hero-content,
  .footer-inner,
  .footer-copy {
    width: min(100% - 24px, 1200px);
  }

  .site-logo span:last-child {
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hero-carousel {
    height: 520px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .movie-grid,
  .compact-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .page-hero,
  .detail-panel,
  .detail-content article {
    padding: 22px;
    border-radius: 20px;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }

  .ranking-item a {
    grid-template-columns: 38px 56px 1fr;
    gap: 10px;
  }

  .ranking-item img {
    width: 56px;
    height: 78px;
  }
}
