:root {
  color-scheme: dark;
  --page-bg: #070b18;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-solid: #111827;
  --card: rgba(17, 24, 39, 0.86);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #38bdf8;
  --blue-deep: #2563eb;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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(37, 99, 235, 0.28), transparent 30rem),
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.17), transparent 28rem),
    linear-gradient(180deg, #081226 0%, var(--page-bg) 45%, #030712 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 13, 28, 0.76);
  backdrop-filter: blur(22px);
}

.header-inner,
.footer-inner,
.hero,
.content-section,
.breadcrumb,
.detail-shell,
.category-hero,
.search-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand {
  font-size: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep) 52%, var(--purple));
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.36);
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--soft);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.12);
}

.nav-menu {
  position: relative;
}

.nav-menu-button {
  border: 0;
  cursor: pointer;
  background: transparent;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  display: none;
  width: 210px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow);
}

.nav-menu:hover .nav-dropdown {
  display: grid;
  gap: 4px;
}

.nav-dropdown a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--soft);
}

.nav-dropdown a:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #ffffff;
}

.header-search {
  margin-left: auto;
  display: flex;
  width: min(360px, 30vw);
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}

.header-search input,
.mobile-search input,
.search-box input,
.search-box select {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
}

.header-search input {
  padding: 0 14px;
}

.header-search button,
.mobile-search button,
.search-box button,
.primary-button,
.ghost-button,
.play-large {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.header-search button {
  padding: 9px 16px;
}

.header-search button:hover,
.mobile-search button:hover,
.search-box button:hover,
.primary-button:hover,
.ghost-button:hover,
.play-large:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.38);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.9);
}

.mobile-panel.is-open {
  display: grid;
  gap: 8px;
}

.mobile-search {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.mobile-search input {
  padding: 0 8px;
}

.mobile-search button {
  padding: 10px 14px;
}

.hero {
  position: relative;
  margin-top: 28px;
  min-height: 650px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.58), rgba(15, 23, 42, 0.82) 45%, rgba(88, 28, 135, 0.58));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -42% 18%;
  height: 350px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.34), transparent 66%);
  filter: blur(10px);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 420px;
  gap: 40px;
  align-items: center;
  padding: 70px;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 13, 28, 0.92), rgba(8, 13, 28, 0.64) 45%, rgba(8, 13, 28, 0.9)),
    var(--hero-image) center / cover no-repeat;
  opacity: 0.7;
}

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

.hero-copy,
.hero-poster {
  position: relative;
  z-index: 2;
}

.hero-kicker,
.section-head p,
.eyebrow,
.breadcrumb,
.card-topline,
.meta-row,
.detail-meta {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero h1 {
  margin: 14px 0 18px;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-lead {
  max-width: 680px;
  color: #dbeafe;
  font-size: 19px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-weight: 800;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-tags span,
.tag-row span,
.detail-tags span,
.rank-number {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(15, 23, 42, 0.62);
}

.hero-poster {
  justify-self: end;
  width: 100%;
  max-width: 390px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  transform: rotate(2deg);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
}

.hero-dots {
  position: absolute;
  left: 70px;
  bottom: 46px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 44px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.26);
}

.hero-dot.is-active {
  background: linear-gradient(90deg, var(--blue), var(--purple));
}

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

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

.section-head h2,
.category-hero h1,
.search-panel h1,
.detail-title {
  margin: 8px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.86));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(30, 64, 175, 0.24), rgba(88, 28, 135, 0.24));
}

.poster-link img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.86);
  backdrop-filter: blur(10px);
}

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

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

.movie-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card p {
  margin: 10px 0 14px;
  min-height: 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.movie-card-compact h3 {
  font-size: 16px;
}

.movie-card-compact p {
  min-height: 42px;
  font-size: 13px;
}

.tag-row,
.detail-tags,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  min-height: 26px;
  font-size: 12px;
}

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

.category-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.72) 56%, rgba(126, 34, 206, 0.22));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.44);
}

.category-card span {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.category-card strong {
  display: block;
  margin-top: 12px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.7;
}

.category-posters {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  transform: rotate(-5deg);
  opacity: 0.64;
}

.category-posters img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.breadcrumb {
  margin-top: 28px;
  color: var(--muted);
}

.breadcrumb a {
  color: #bae6fd;
}

.category-hero,
.search-panel {
  margin-top: 28px;
  padding: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.42), rgba(15, 23, 42, 0.78) 55%, rgba(88, 28, 135, 0.34));
  box-shadow: var(--shadow);
}

.category-hero p,
.search-panel p {
  max-width: 760px;
  color: var(--soft);
  line-height: 1.8;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 160px auto;
  gap: 12px;
  margin-top: 24px;
}

.search-box input,
.search-box select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.search-box select option {
  color: #111827;
}

.search-box button {
  min-height: 48px;
  padding: 0 20px;
  font-weight: 800;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 70px 86px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.74);
}

.rank-number {
  justify-content: center;
  min-height: 44px;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(126, 34, 206, 0.9));
}

.rank-item img {
  width: 86px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.rank-item h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.rank-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.rank-link {
  padding: 10px 16px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(56, 189, 248, 0.12);
}

.detail-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 36px;
  margin-top: 28px;
  align-items: start;
}

.detail-poster {
  position: sticky;
  top: 100px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 20px;
}

.detail-panel,
.player-card,
.text-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.26);
}

.detail-panel {
  padding: 34px;
}

.detail-title {
  margin-bottom: 18px;
}

.detail-meta {
  gap: 14px;
  color: var(--soft);
}

.detail-tags {
  margin: 22px 0;
}

.detail-line {
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
}

.player-card {
  margin-top: 26px;
  padding: 14px;
}

.player-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #020617;
}

.player-wrap video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.62));
}

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

.play-large {
  width: 86px;
  height: 86px;
  font-size: 32px;
}

.text-panel {
  margin-top: 26px;
  padding: 34px;
}

.text-panel h2 {
  margin: 0 0 16px;
  font-size: 26px;
}

.text-panel p {
  color: var(--soft);
  line-height: 2;
}

.site-footer {
  margin-top: 70px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.68);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 34px 0;
  color: var(--muted);
}

.footer-brand {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  max-width: 520px;
}

.footer-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
}

.is-filtered-out {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero-slide {
    grid-template-columns: 1fr 300px;
    padding: 52px;
  }

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

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

@media (max-width: 820px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .mobile-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

  .hero {
    min-height: 760px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 36px 24px 80px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero-poster {
    justify-self: start;
    max-width: 240px;
    transform: none;
  }

  .hero-dots {
    left: 24px;
    bottom: 30px;
  }

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

  .search-box {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 52px 70px 1fr;
  }

  .rank-link {
    grid-column: 2 / 4;
    justify-self: start;
  }

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

  .detail-poster {
    position: static;
    max-width: 320px;
  }

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

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .footer-inner,
  .hero,
  .content-section,
  .breadcrumb,
  .detail-shell,
  .category-hero,
  .search-panel {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    border-radius: 22px;
  }

  .hero-slide {
    padding: 28px 18px 80px;
  }

  .hero-lead {
    font-size: 16px;
  }

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

  .category-hero,
  .search-panel,
  .detail-panel,
  .text-panel {
    padding: 24px;
  }
}
