:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-soft: #0f1d33;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-solid: #101c30;
  --panel-bright: #14253f;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --brand: #38bdf8;
  --brand-2: #a78bfa;
  --accent: #f43f5e;
  --gold: #fbbf24;
  --green: #34d399;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.28);
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.22), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgba(244, 63, 94, 0.18), transparent 28rem),
    linear-gradient(180deg, #07111f 0%, #0a1020 48%, #090d18 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(167, 139, 250, 0.16));
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

main {
  overflow: hidden;
}

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

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #05111f;
  background: linear-gradient(135deg, var(--brand), var(--green));
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.28);
}

.brand-text {
  white-space: nowrap;
  font-size: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-link,
.nav-pill {
  color: var(--muted);
  padding: 10px 13px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.nav-pill:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
  transform: translateY(-1px);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  background: rgba(15, 23, 42, 0.8);
}

.header-search input,
.filter-inputs input {
  color: var(--text);
  border: 0;
  outline: 0;
  min-width: 190px;
  background: transparent;
  padding: 10px 12px;
}

.header-search button,
.btn,
.section-more,
.filter-buttons button,
.footer-bottom button {
  border: 0;
  color: #04111f;
  font-weight: 800;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--brand), var(--green));
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.header-search button:hover,
.btn:hover,
.section-more:hover,
.filter-buttons button:hover,
.footer-bottom button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.3);
}

.quick-nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px 14px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.nav-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.55);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.72);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 99px;
  background: var(--text);
}

.hero {
  position: relative;
  max-width: var(--container);
  margin: 28px auto 0;
  padding: 0 22px;
}

.hero-viewport {
  position: relative;
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: 38px;
  overflow: hidden;
  background: #080f1e;
  box-shadow: var(--shadow-lg);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.36;
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 17, 31, 0.96) 0%, rgba(8, 17, 31, 0.76) 42%, rgba(8, 17, 31, 0.22) 100%),
    linear-gradient(0deg, rgba(8, 17, 31, 0.98) 0%, transparent 48%);
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.55fr);
  gap: 42px;
  align-items: center;
  padding: 64px;
}

.hero-kicker,
.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.hero-summary {
  max-width: 670px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.6);
  font-size: 12px;
}

.hero-tags {
  margin-top: 20px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.btn.ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.65);
  box-shadow: none;
}

.hero-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.hero-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.18);
}

.hero-controls {
  position: absolute;
  right: 44px;
  bottom: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-arrow,
.hero-dot {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 24px;
}

.hero-dots {
  display: flex;
  gap: 7px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
}

.hero-dot.is-active {
  width: 26px;
  background: var(--brand);
}

.stats-strip,
.content-section,
.filter-panel,
.detail-content,
.player-section,
.category-blocks {
  max-width: var(--container);
  margin: 30px auto 0;
  padding-left: 22px;
  padding-right: 22px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stats-strip div,
.filter-panel,
.story-card,
.category-block,
.page-hero,
.player-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.68);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.stats-strip div {
  padding: 24px;
}

.stats-strip strong {
  display: block;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.stats-strip span {
  color: var(--subtle);
}

.content-section {
  padding-top: 30px;
}

.section-head,
.category-block-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2,
.category-block-head h2,
.filter-panel h2,
.story-card h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.section-more {
  flex: 0 0 auto;
}

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

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

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

.movie-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.3);
}

.card-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--panel-bright);
}

.card-poster img {
  transition: transform 0.35s ease;
}

.movie-card:hover .card-poster img {
  transform: scale(1.06);
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.72) 100%);
}

.play-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #06111f;
  font-size: 12px;
  font-weight: 900;
  background: var(--brand);
}

.rank-number {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #160b00;
  background: linear-gradient(135deg, var(--gold), #fb7185);
  box-shadow: 0 10px 24px rgba(251, 191, 36, 0.25);
}

.rank-number.small {
  font-size: 13px;
}

.card-body {
  padding: 14px;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--subtle);
  font-size: 12px;
}

.card-body h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.25;
}

.card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
}

.rank-card .card-poster {
  aspect-ratio: 3 / 4;
}

.rank-card .card-body {
  align-self: center;
}

.compact-list .rank-card:nth-child(n + 7) {
  display: none;
}

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

.category-tile {
  position: relative;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 6px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-solid);
}

.category-tile img {
  position: absolute;
  inset: 0;
  opacity: 0.36;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8, 17, 31, 0.9), rgba(8, 17, 31, 0.2));
}

.category-tile span,
.category-tile strong {
  position: relative;
  z-index: 1;
}

.category-tile span {
  font-size: 20px;
  font-weight: 900;
}

.category-tile strong {
  color: var(--brand);
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.5fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
}

.filter-inputs input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.6);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.filter-buttons button {
  padding: 8px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.75);
  box-shadow: none;
}

.filter-buttons button.active {
  color: #04111f;
  background: var(--brand);
}

.page-hero {
  max-width: var(--container);
  margin: 28px auto 0;
  padding: 54px 42px;
  overflow: hidden;
  position: relative;
}

.page-hero::before {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.3), transparent 68%);
}

.page-hero h1 {
  position: relative;
  max-width: 820px;
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -0.07em;
}

.page-hero p:last-child {
  position: relative;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.category-blocks {
  display: grid;
  gap: 24px;
}

.category-block {
  padding: 24px;
}

.result-count {
  margin: -10px 0 20px;
  color: var(--muted);
}

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  display: grid;
  align-items: center;
  margin-top: 0;
}

.detail-bg {
  position: absolute;
  inset: 0;
  opacity: 0.24;
}

.detail-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 17, 31, 0.96), rgba(8, 17, 31, 0.75), rgba(8, 17, 31, 0.94)),
    linear-gradient(0deg, #08111f 0%, transparent 45%);
}

.detail-layout {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 60px 22px 40px;
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 42px;
  align-items: center;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--subtle);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--brand);
}

.detail-info h1 {
  margin: 18px 0 16px;
  font-size: clamp(40px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.detail-line {
  max-width: 760px;
  color: var(--muted);
  font-size: 20px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.detail-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
}

.detail-tags {
  margin-bottom: 28px;
}

.player-section {
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.movie-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: var(--text);
  background: radial-gradient(circle, rgba(8, 17, 31, 0.2), rgba(8, 17, 31, 0.72));
  z-index: 3;
}

.play-overlay[hidden],
.player-shell.is-playing .play-overlay {
  display: none;
}

.play-icon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--brand-2));
  box-shadow: 0 18px 44px rgba(244, 63, 94, 0.32);
}

.play-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 7px;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 25px solid white;
}

.play-overlay strong {
  font-size: 20px;
}

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

.story-card {
  padding: 28px;
}

.story-card p:last-child {
  color: var(--muted);
  font-size: 17px;
}

.related-section {
  padding-bottom: 40px;
}

.site-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: rgba(8, 17, 31, 0.82);
}

.footer-grid,
.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 22px;
  padding-right: 22px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr;
  gap: 28px;
  padding-top: 36px;
  padding-bottom: 28px;
}

.footer-grid p,
.footer-links a,
.footer-bottom {
  color: var(--subtle);
}

.footer-grid h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.footer-bottom {
  padding-top: 18px;
  padding-bottom: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.is-hidden-by-search,
.is-hidden-by-filter {
  display: none !important;
}

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

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

  .hero-content {
    padding: 44px;
    grid-template-columns: 1fr 280px;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .main-nav {
    order: 4;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }

  .main-nav.is-open {
    display: flex;
  }

  .header-search {
    order: 3;
    width: 100%;
  }

  .header-search input {
    flex: 1;
    min-width: 0;
  }

  .hero-viewport,
  .hero-content {
    min-height: 720px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 34px;
  }

  .hero-poster {
    max-width: 240px;
    transform: rotate(0deg);
  }

  .stats-strip,
  .split-section,
  .filter-panel,
  .detail-layout,
  .detail-content,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .movie-grid,
  .featured-grid,
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    padding-top: 42px;
  }

  .detail-poster {
    max-width: 260px;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .quick-nav,
  .hero,
  .stats-strip,
  .content-section,
  .filter-panel,
  .detail-content,
  .player-section,
  .category-blocks,
  .footer-grid,
  .footer-bottom {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-viewport {
    min-height: 650px;
    border-radius: 24px;
  }

  .hero-content {
    min-height: 650px;
    padding: 24px;
  }

  .hero-controls {
    right: 24px;
    bottom: 22px;
  }

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

  .movie-grid,
  .featured-grid,
  .mini-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .page-hero {
    margin-left: 14px;
    margin-right: 14px;
    padding: 34px 22px;
  }

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

  .detail-hero {
    min-height: auto;
  }

  .player-section {
    margin-top: 0;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
}
