:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-light: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #38bdf8;
  --accent-strong: #2563eb;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.16), transparent 28%), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(18px);
}

.site-nav {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #ffffff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted-strong);
  font-size: 15px;
}

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

.nav-links a:hover {
  color: #ffffff;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.8);
  padding: 9px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: #ffffff;
}

.page-main {
  padding-top: 68px;
}

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

.hero {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.08) 100%), linear-gradient(0deg, rgba(2, 6, 23, 1) 0%, rgba(2, 6, 23, 0) 34%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2));
  bottom: 64px;
  z-index: 2;
  width: min(660px, calc(100% - 48px));
}

.eyebrow,
.inline-meta {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.05em;
}

.hero-content h1,
.hero-content h2 {
  margin: 14px 0 16px;
  font-size: clamp(36px, 7vw, 74px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 620px;
  margin: 0 0 22px;
  color: var(--muted-strong);
  font-size: 18px;
}

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

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

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

.btn-primary {
  background: #ffffff;
  color: #0f172a;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.hero-controls {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 72px;
  z-index: 4;
  display: flex;
  gap: 12px;
}

.hero-control,
.carousel-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover,
.carousel-button:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
}

.hero-dots {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2));
  bottom: 32px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 36px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.hero-dot.is-active {
  background: #ffffff;
}

.section {
  padding: 64px 0;
}

.section.alt {
  background: rgba(15, 23, 42, 0.5);
}

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

.section-head h2,
.section-head h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.section-head p,
.lead {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
}

.search-panel {
  margin-top: -36px;
  position: relative;
  z-index: 5;
}

.search-box {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  outline: 0;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.8);
}

.search-box input:focus {
  border-color: rgba(56, 189, 248, 0.8);
}

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

.category-tile {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.7));
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.55);
}

.category-tile h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.92);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(148, 163, 184, 0.36);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0f172a;
}

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.poster-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent 55%);
  opacity: 0.88;
}

.poster-meta,
.rank-badge {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 12px;
}

.rank-badge {
  left: auto;
  right: 12px;
  background: rgba(37, 99, 235, 0.88);
  font-weight: 800;
}

.movie-card-body {
  padding: 18px;
}

.movie-card-body h3 {
  margin: 0 0 10px;
  min-height: 54px;
  font-size: 18px;
  line-height: 1.45;
}

.movie-card-body h3 a:hover,
.ranking-info h3 a:hover {
  color: var(--accent);
}

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

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.movie-tags span,
.detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.86);
  color: var(--muted-strong);
  font-size: 12px;
}

.carousel-wrap {
  position: relative;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.carousel-track .movie-card {
  scroll-snap-align: start;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 70px 116px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.82);
}

.ranking-rank {
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
}

.ranking-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
}

.ranking-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-info h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.ranking-info p {
  margin: 0 0 8px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.breadcrumb a:hover {
  color: #ffffff;
}

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

.player-card,
.detail-panel,
.related-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.player-card {
  overflow: hidden;
  margin-bottom: 24px;
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.video-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.08), rgba(0, 0, 0, 0.36));
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-button {
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #020617;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.35);
}

.play-button svg {
  width: 34px;
  height: 34px;
  margin-left: 4px;
}

.detail-panel {
  padding: 28px;
}

.detail-title h1 {
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted-strong);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0 24px;
}

.content-block {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.content-block h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.content-block p {
  margin: 0 0 22px;
  color: var(--muted-strong);
}

.related-panel {
  padding: 22px;
  position: sticky;
  top: 92px;
}

.related-panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.related-panel .movie-card {
  margin-bottom: 14px;
}

.compact-card .poster-link {
  aspect-ratio: 16 / 10;
}

.compact-card .movie-card-body h3 {
  min-height: auto;
  font-size: 16px;
}

.compact-card .movie-card-body p {
  min-height: auto;
  -webkit-line-clamp: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.82);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
}

.footer-inner p {
  margin: 4px 0;
}

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

@media (max-width: 980px) {
  .category-grid,
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .related-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-nav {
    width: min(100% - 24px, 1180px);
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.98);
    overflow: hidden;
  }

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

  .nav-links a {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .hero {
    min-height: 78vh;
  }

  .hero-slide::after {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.72) 52%, rgba(2, 6, 23, 0.2) 100%);
  }

  .hero-content {
    bottom: 92px;
  }

  .hero-controls {
    right: 20px;
    bottom: 30px;
  }

  .hero-dots {
    bottom: 30px;
  }

  .section-head {
    display: block;
  }

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

  .search-box {
    display: block;
  }

  .ranking-row {
    grid-template-columns: 48px 92px 1fr;
    gap: 12px;
  }

  .ranking-rank {
    font-size: 24px;
  }

  .detail-panel {
    padding: 22px;
  }
}
