* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --red: #f43f5e;
  --green: #22c55e;
  --radius: 1rem;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.55);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.20), transparent 34rem),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 30rem),
    linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
}

body.is-locked {
  overflow: hidden;
}

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

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

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.36);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #60a5fa, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: #cbd5e1;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

.menu-button {
  display: none;
  border: 0;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 0.8rem;
  width: 2.6rem;
  height: 2.6rem;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 1rem;
  border-top: 1px solid var(--line);
}

.mobile-nav .nav-link {
  display: block;
  padding: 0.85rem 0;
}

main {
  min-height: 70vh;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1s ease;
  display: flex;
  align-items: center;
}

.hero-slide.active {
  opacity: 1;
}

.hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  max-width: 720px;
  padding-top: 4rem;
}

.hero-kicker,
.page-hero span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.6rem, 6vw, 5.3rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero-content p {
  margin: 0;
  color: #cbd5e1;
  max-width: 52rem;
  font-size: 1.12rem;
  line-height: 1.8;
}

.hero-tags,
.tag-row,
.genre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.hero-tags span,
.tag-row span,
.genre-row span {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.18);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.86rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.primary-button,
.ghost-button,
.hero-search button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1.2rem;
  border-radius: 0.75rem;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.hero-search button {
  background: #3b82f6;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.28);
}

.primary-button:hover,
.hero-search button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.ghost-button {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(203, 213, 225, 0.22);
  color: #e2e8f0;
}

.ghost-button:hover {
  border-color: rgba(96, 165, 250, 0.55);
  transform: translateY(-1px);
}

.hero-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.55rem;
}

.hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
  width: 2.2rem;
  background: #ffffff;
}

.search-band {
  margin-top: -3.5rem;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px);
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem;
  border-radius: 1.25rem;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-band h2,
.section-title-row h2,
.page-hero h1,
.detail-info h1,
.content-card h2,
.detail-side h2 {
  margin: 0;
}

.search-band p,
.page-hero p,
.content-card p,
.category-card p,
.wide-card p,
.movie-card p,
.site-footer p,
.detail-one-line {
  color: var(--muted);
  line-height: 1.75;
}

.hero-search,
.filter-panel {
  display: flex;
  gap: 0.8rem;
}

.hero-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 0.85rem;
  min-height: 2.9rem;
  color: #fff;
  background: rgba(2, 6, 23, 0.66);
  padding: 0 1rem;
}

.section-block {
  padding: 4rem 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.section-title-row h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.section-title-row a,
.text-link {
  color: #93c5fd;
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.16);
  transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-4px) scale(1.015);
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(96, 165, 250, 0.34);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.88);
}

.poster-wrap img,
.detail-poster img,
.wide-cover img,
.category-card-covers img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .poster-wrap img,
.wide-card:hover .wide-cover img,
.category-card:hover img {
  transform: scale(1.08);
}

.poster-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(2, 6, 23, 0.74));
}

.score-badge,
.rank-badge,
.list-rank {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: #fff;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.55rem;
  padding: 0.22rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.rank-badge {
  left: 0.75rem;
  right: auto;
  background: rgba(244, 63, 94, 0.86);
}

.card-body {
  padding: 1rem;
}

.card-body h3 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.card-body p {
  margin: 0 0 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: #94a3b8;
  font-size: 0.88rem;
}

.feature-strip {
  padding: 4rem 0;
  background: rgba(15, 23, 42, 0.44);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.category-chip-grid a {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(96, 165, 250, 0.22);
  color: #dbeafe;
  font-weight: 800;
}

.wide-grid,
.ranking-list,
.side-list {
  display: grid;
  gap: 1rem;
}

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

.wide-card {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: stretch;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: background 0.2s ease, transform 0.2s ease;
}

.wide-card:hover {
  background: rgba(30, 41, 59, 0.76);
  transform: translateY(-2px);
}

.wide-cover {
  aspect-ratio: 1 / 1;
  border-radius: 0.8rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.88);
}

.wide-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wide-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.wide-title-row h3 {
  margin: 0;
  flex: 1;
  line-height: 1.35;
}

.wide-title-row strong {
  color: #fbbf24;
}

.wide-card p {
  margin: 0.55rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-rank {
  position: static;
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  background: rgba(244, 63, 94, 0.82);
}

.page-hero {
  padding: 8rem 0 2rem;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 48rem;
  font-size: 1.06rem;
}

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

.category-card {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1.2rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--line);
}

.category-card h2 {
  margin: 0;
}

.category-card-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.category-card-covers a {
  aspect-ratio: 3 / 4;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.86);
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  margin-bottom: 1.5rem;
}

.empty-state {
  display: none;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

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

.detail-hero {
  min-height: 650px;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  background-size: cover;
  background-position: center;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 2.4rem;
  align-items: center;
}

.detail-poster {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  background: rgba(15, 23, 42, 0.88);
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  color: #93c5fd;
  margin-bottom: 1rem;
}

.detail-info h1 {
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.detail-one-line {
  max-width: 55rem;
  font-size: 1.08rem;
}

.detail-meta {
  margin: 1rem 0;
}

.detail-tags {
  margin-bottom: 1.7rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.4rem;
  padding: 3rem 0;
}

.detail-main,
.detail-side,
.content-card {
  min-width: 0;
}

.player-box {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1.2rem;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

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

.player-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.20), rgba(2, 6, 23, 0.78));
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.player-mask button {
  width: 4.8rem;
  height: 4.8rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: white;
  font-size: 1.8rem;
  background: #3b82f6;
  box-shadow: 0 18px 50px rgba(59, 130, 246, 0.45);
}

.player-mask strong {
  font-size: 1.25rem;
}

.content-card,
.detail-side {
  margin-top: 1.4rem;
  padding: 1.4rem;
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--line);
}

.content-card h2 + p {
  margin-top: 0.65rem;
}

.detail-side {
  margin-top: 0;
  align-self: start;
}

.side-list .wide-card {
  grid-template-columns: 6rem 1fr;
}

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

.small-card .card-body p {
  -webkit-line-clamp: 1;
}

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

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

.footer-brand {
  margin-bottom: 1rem;
}

.footer-links {
  display: grid;
  gap: 0.7rem;
  color: #cbd5e1;
}

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 2rem auto 0;
  padding-top: 1rem;
  color: #64748b;
  border-top: 1px solid var(--line);
}

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

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

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

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

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

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

  .menu-button {
    display: block;
  }

  .mobile-nav.is-open {
    display: block;
  }

  .hero-carousel {
    min-height: 620px;
    height: 82vh;
  }

  .hero-content {
    padding-top: 5rem;
  }

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

  .search-band,
  .detail-hero-grid,
  .category-card,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .movie-grid,
  .compact-grid,
  .wide-grid,
  .category-overview-grid,
  .category-chip-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wide-card,
  .side-list .wide-card {
    grid-template-columns: 5.5rem 1fr;
  }

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

@media (max-width: 480px) {
  .movie-grid,
  .compact-grid,
  .wide-grid,
  .category-overview-grid,
  .category-chip-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 1.1rem;
  }

  .hero-content h1,
  .detail-info h1 {
    font-size: 2.35rem;
  }
}
