:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-deep: #020617;
  --panel: rgba(30, 41, 59, 0.68);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #fbbf24;
  --accent-hover: #fcd34d;
  --accent-deep: #92400e;
  --danger: #f87171;
  --ring: rgba(251, 191, 36, 0.5);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 35rem),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 30rem),
    var(--bg);
  color: var(--text);
}

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

img {
  display: block;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.site-nav {
  min-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;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.site-logo {
  font-size: 20px;
}

.site-logo__mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.38);
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted-strong);
  font-weight: 600;
}

.nav-links a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: var(--muted-strong);
}

.hero {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-deep), var(--bg));
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-bg__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.8s ease, transform 7s ease;
  filter: saturate(1.05);
}

.hero-bg__image.is-active {
  opacity: 0.36;
  transform: scale(1.02);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.76), rgba(15, 23, 42, 0.4)),
    linear-gradient(0deg, var(--bg), transparent 34%);
}

.hero-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: 48px;
  align-items: center;
  padding: 72px 0 96px;
}

.hero-copy h1,
.sub-hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero-lead,
.sub-hero p {
  max-width: 720px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.85;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-search,
.search-panel,
.filter-box {
  display: flex;
  gap: 12px;
  margin: 28px 0 24px;
}

.hero-search input,
.search-panel input,
.filter-box input,
.search-panel select {
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.84);
  color: var(--text);
  outline: none;
  padding: 0 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-search input,
.search-panel input,
.filter-box input {
  flex: 1;
}

.hero-search input:focus,
.search-panel input:focus,
.filter-box input:focus,
.search-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.hero-search button,
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hero-search button,
.button--primary {
  background: var(--accent);
  color: #111827;
}

.hero-search button:hover,
.button--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.button--secondary {
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
}

.button--ghost {
  min-height: 42px;
  background: rgba(15, 23, 42, 0.56);
  color: var(--muted-strong);
  border: 1px solid var(--border);
  padding: 0 16px;
}

.button--secondary:hover,
.button--ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

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

.hero-panel {
  position: relative;
  min-height: 540px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.88));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

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

.hero-slide__poster {
  min-height: 310px;
  overflow: hidden;
}

.hero-slide__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide__content {
  padding: 26px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.98));
}

.hero-slide__content h2 {
  margin: 12px 0 10px;
  font-size: 26px;
}

.hero-slide__content p {
  min-height: 58px;
  margin: 0 0 18px;
  color: var(--muted-strong);
  line-height: 1.65;
}

.hero-slide__tags,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-slide__tags span,
.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.82);
  color: #e2e8f0;
  padding: 0 11px;
  font-size: 13px;
}

.hero-dots {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: flex;
  gap: 7px;
}

.hero-dots button {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.38);
  padding: 0;
}

.hero-dots button.is-active {
  width: 26px;
  background: var(--accent);
}

.sub-hero {
  padding: 88px 0 70px;
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 28rem),
    linear-gradient(180deg, var(--bg-deep), var(--bg));
  border-bottom: 1px solid var(--border);
}

.sub-hero--compact {
  padding: 68px 0 48px;
}

.sub-hero h1 {
  max-width: 900px;
  font-size: clamp(34px, 5vw, 62px);
}

.page-stack {
  padding: 56px 0;
}

.content-section {
  margin-bottom: 64px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 28px;
}

.section-heading a {
  color: var(--accent);
  font-weight: 800;
}

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

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

.movie-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(251, 191, 36, 0.18);
  transform: translateY(-4px) scale(1.015);
}

.movie-card__poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0f172a;
}

.movie-card__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent 55%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.movie-card:hover .movie-card__poster::after {
  opacity: 1;
}

.movie-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .movie-card__poster img {
  transform: scale(1.08);
}

.movie-card__year,
.rank-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(2, 6, 23, 0.82);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.movie-card__year {
  right: 10px;
}

.rank-badge {
  left: 10px;
}

.movie-card__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.92);
  color: #111827;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.movie-card:hover .movie-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.movie-card__body {
  padding: 14px;
}

.movie-card__body h3 {
  margin: 0 0 9px;
  font-size: 15px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card__body h3 a:hover {
  color: var(--accent);
}

.movie-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.movie-card__meta span {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card__genre {
  display: inline-flex;
  max-width: 100%;
  border-radius: 8px;
  background: rgba(51, 65, 85, 0.72);
  color: #cbd5e1;
  padding: 5px 8px;
  font-size: 12px;
}

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

.category-card {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.9));
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.category-card h2 {
  margin: 0;
  font-size: 28px;
}

.category-card h2 a:hover,
.category-card__links a:hover {
  color: var(--accent);
}

.category-card__links {
  display: grid;
  gap: 9px;
  margin: 22px 0;
}

.category-card__links a {
  color: var(--muted-strong);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.filter-box {
  max-width: 560px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px;
  max-width: 920px;
}

.detail-page {
  padding: 32px 0 60px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.detail-main,
.detail-aside {
  display: grid;
  gap: 22px;
}

.player-card,
.detail-card,
.aside-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

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

.stream-player__video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.stream-player__start {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.22), rgba(2, 6, 23, 0.72));
  color: var(--text);
  font-weight: 800;
}

.stream-player.is-playing .stream-player__start {
  opacity: 0;
  pointer-events: none;
}

.play-circle {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.42);
}

.stream-player__controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.stream-player:hover .stream-player__controls,
.stream-player:focus-within .stream-player__controls {
  opacity: 1;
  transform: translateY(0);
}

.stream-player__controls button {
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: var(--text);
  padding: 9px 14px;
  font-weight: 700;
}

.stream-player__controls button:hover {
  background: var(--accent);
  color: #111827;
}

.stream-player__state {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  margin: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--muted-strong);
  padding: 7px 12px;
  font-size: 12px;
}

.detail-card {
  padding: 28px;
}

.detail-card h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.1;
}

.detail-card h2,
.aside-card h2 {
  margin: 28px 0 12px;
  font-size: 22px;
}

.detail-card p {
  color: var(--muted-strong);
  line-height: 1.9;
  font-size: 16px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-meta span {
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.78);
  color: var(--muted-strong);
  padding: 7px 12px;
  font-size: 13px;
}

.aside-card {
  padding: 18px;
}

.aside-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 16px;
}

.aside-card--text dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  margin: 0;
}

.aside-card--text dt {
  color: var(--muted);
}

.aside-card--text dd {
  margin: 0;
  color: var(--text);
}

.related-section {
  margin-top: 56px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.94);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 36px;
  padding: 44px 0 34px;
}

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

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

.footer-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding: 18px 0 26px;
  font-size: 14px;
}

.is-hidden {
  display: none !important;
}

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

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.98);
    padding: 18px;
    box-shadow: var(--shadow);
  }

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

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

  .hero {
    min-height: auto;
  }

  .hero-panel {
    min-height: 500px;
  }

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

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

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

@media (max-width: 720px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .site-nav {
    min-height: 64px;
  }

  .nav-links {
    top: 64px;
  }

  .hero-layout {
    padding: 42px 0 64px;
    gap: 30px;
  }

  .hero-copy h1,
  .sub-hero h1 {
    font-size: 38px;
  }

  .hero-search,
  .hero-actions,
  .search-panel,
  .filter-box {
    flex-direction: column;
  }

  .search-panel {
    display: flex;
  }

  .hero-search button,
  .button {
    width: 100%;
  }

  .hero-panel {
    min-height: 520px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .category-grid,
  .detail-aside {
    grid-template-columns: 1fr;
  }

  .detail-card {
    padding: 22px;
  }

  .stream-player__controls {
    opacity: 1;
    transform: none;
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
