:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.76);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --orange: #fb923c;
  --rose: #fb7185;
  --green: #34d399;
  --shadow: 0 22px 60px rgba(2, 6, 23, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.14), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.16), transparent 30rem),
    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;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.26));
  backdrop-filter: blur(18px);
  transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}

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

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-size: 15px;
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.28);
}

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

.desktop-nav a,
.mobile-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: color 0.25s ease, background 0.25s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: white;
  background: rgba(34, 211, 238, 0.12);
}

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

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

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

.mobile-nav.is-open {
  display: grid;
  gap: 6px;
}

.hero-carousel {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  background: var(--bg);
}

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

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.22)),
    linear-gradient(to right, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.82));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  min-height: 78vh;
  margin: 0 auto;
  padding: 128px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 44px;
  align-items: end;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--cyan);
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.12);
}

.hero-copy h1 {
  margin: 0 0 18px;
  max-width: 840px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 680px;
  margin: 0 0 26px;
  color: var(--muted-strong);
  font-size: 18px;
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

.tag-chip,
.hero-tag,
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  color: var(--muted-strong);
  font-size: 13px;
}

.hero-tag:first-child,
.meta-chip.accent {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.16);
  color: var(--cyan);
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 18px 40px rgba(34, 211, 238, 0.26);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
  transform: translateY(-2px);
}

.btn-secondary,
.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.78);
  color: white;
}

.hero-panel {
  align-self: end;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.hero-mini-grid {
  display: grid;
  gap: 12px;
}

.hero-mini {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.58);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-mini:hover {
  transform: translateX(4px);
  background: rgba(30, 41, 59, 0.86);
}

.hero-mini img {
  width: 96px;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  object-fit: cover;
}

.hero-mini strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.28;
}

.hero-mini span {
  color: var(--muted);
  font-size: 13px;
}

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

.hero-dot {
  width: 34px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.34);
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--cyan);
}

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

.main-stack {
  padding: 58px 0 76px;
  display: grid;
  gap: 76px;
}

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

.section-head h2,
.page-hero h1,
.detail-title,
.movie-detail h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-head p,
.page-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-link {
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
}

.section-link:hover {
  color: white;
}

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

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

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

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

.movie-card:hover .poster-link img {
  transform: scale(1.08);
  filter: saturate(1.12) brightness(1.06);
}

.poster-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.18), transparent);
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.movie-card:hover .poster-gradient {
  opacity: 0.95;
}

.poster-category,
.poster-year {
  position: absolute;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.82);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.poster-category {
  left: 10px;
}

.poster-year {
  right: 10px;
  color: white;
}

.poster-play,
.cover-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.9);
  color: white;
  font-size: 24px;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.movie-card:hover .poster-play,
.rank-item:hover .cover-play {
  opacity: 1;
  transform: scale(1);
}

.card-body {
  padding: 14px 2px 0;
}

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

.card-body h3 a {
  transition: color 0.2s ease;
}

.movie-card:hover .card-body h3 a {
  color: var(--cyan);
}

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

.card-meta,
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #64748b;
  font-size: 12px;
}

.glass-section {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.48));
  box-shadow: var(--shadow);
}

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

.category-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-soft);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.category-card:hover img {
  transform: scale(1.08);
  opacity: 0.82;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.32));
}

.category-card-content {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  padding: 20px;
}

.category-card h2,
.category-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

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

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

.rank-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 154px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.62);
  transition: transform 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.84);
}

.rank-number {
  width: 44px;
  color: var(--cyan);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.rank-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
}

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

.rank-title {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
}

.rank-title:hover {
  color: var(--cyan);
}

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

.page-hero {
  padding: 132px 0 54px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to bottom, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.72)),
    radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.16), transparent 28rem),
    var(--bg);
}

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

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(140px, 190px));
  gap: 12px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 6, 23, 0.72);
  color: white;
  padding: 0 14px;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: rgba(34, 211, 238, 0.62);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.empty-state {
  display: none;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state.is-visible {
  display: block;
}

.detail-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 110px 0 74px;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  background: black;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: black;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.24));
  color: white;
  cursor: pointer;
  transition: opacity 0.22s ease, visibility 0.22s ease, background 0.22s ease;
}

.player-overlay:hover {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.3));
}

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

.play-circle {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 24px 46px rgba(34, 211, 238, 0.28);
  font-size: 34px;
}

.player-overlay strong {
  max-width: min(680px, calc(100% - 32px));
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.2;
  text-align: center;
}

.player-overlay span:last-child {
  color: var(--muted-strong);
}

.player-error {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 14px;
  background: rgba(127, 29, 29, 0.72);
  color: white;
  text-align: center;
}

.movie-detail,
.sidebar-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
}

.movie-detail {
  margin-top: 24px;
  padding: 28px;
}

.movie-detail h1 {
  margin-bottom: 14px;
}

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

.movie-detail h2 {
  margin: 28px 0 10px;
  font-size: 24px;
}

.movie-detail p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 16px;
}

.sidebar-card {
  padding: 18px;
}

.sidebar-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  object-fit: cover;
}

.sidebar-card h2 {
  margin: 16px 0 8px;
  font-size: 22px;
}

.sidebar-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.info-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.info-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--muted-strong);
}

.info-table span:first-child {
  color: var(--muted);
}

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

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

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.site-footer p {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
}

.footer-links a:hover {
  color: white;
  border-color: rgba(34, 211, 238, 0.48);
}

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 14px;
}

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    display: none;
  }

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

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 640px) {
  .nav-shell {
    width: min(100% - 22px, 1180px);
    height: 64px;
  }

  .brand {
    font-size: 19px;
  }

  .hero-carousel,
  .hero-inner {
    min-height: 88vh;
  }

  .hero-inner {
    padding-top: 112px;
    padding-bottom: 58px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  .section-head {
    display: grid;
  }

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

  .glass-section {
    padding: 20px;
  }

  .rank-item {
    grid-template-columns: 42px 104px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .rank-number {
    width: 34px;
    font-size: 20px;
  }

  .rank-info p {
    display: none;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .movie-detail {
    padding: 22px;
  }

  .play-circle {
    width: 72px;
    height: 72px;
  }
}
