:root {
  color-scheme: dark;
  --stellar-dark: #080d23;
  --stellar-deep: #0d1533;
  --stellar-mid: #141b3d;
  --stellar-card: rgba(21, 31, 70, 0.78);
  --stellar-line: rgba(124, 170, 255, 0.18);
  --stellar-glow: #4a90e2;
  --stellar-cyan: #38bdf8;
  --stellar-pink: #ec4899;
  --text-main: #f8fbff;
  --text-soft: #b9c4dd;
  --text-muted: #8591ad;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --shadow-soft: 0 24px 90px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--stellar-dark);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(74, 144, 226, 0.28), transparent 38rem),
    radial-gradient(circle at 80% 10%, rgba(236, 72, 153, 0.18), transparent 32rem),
    linear-gradient(180deg, #090f2a 0%, #0b1028 46%, #080d23 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(124, 170, 255, 0.14);
  background: rgba(8, 13, 35, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--stellar-glow), var(--stellar-pink));
  color: white;
  box-shadow: 0 12px 32px rgba(74, 144, 226, 0.38);
}

.brand-text {
  font-size: 1.08rem;
}

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(74, 144, 226, 0.16);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px;
  border: 1px solid var(--stellar-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.header-search input,
.live-search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
}

.header-search input {
  width: 230px;
  padding: 8px 8px 8px 14px;
}

.header-search button,
.primary-button,
.ghost-button,
.filter-buttons button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.header-search button,
.primary-button {
  padding: 10px 18px;
  color: white;
  background: linear-gradient(135deg, var(--stellar-glow), var(--stellar-cyan));
  box-shadow: 0 14px 36px rgba(74, 144, 226, 0.32);
}

.header-search button:hover,
.primary-button:hover,
.ghost-button:hover,
.filter-buttons button:hover {
  transform: translateY(-2px);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--stellar-line);
  border-radius: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-nav {
  display: none;
  gap: 8px;
  padding: 0 24px 16px;
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 72px));
  overflow: hidden;
  background: #070b1e;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}

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

.hero-slide > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
  transform: scale(1.04);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 13, 35, 0.98), rgba(8, 13, 35, 0.72) 46%, rgba(8, 13, 35, 0.18)),
    linear-gradient(180deg, rgba(8, 13, 35, 0.28), rgba(8, 13, 35, 0.86));
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 48px));
  margin-left: max(24px, calc((100vw - 1400px) / 2 + 24px));
  padding: 80px 0;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--stellar-cyan);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.96;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.hero-text,
.page-hero p,
.detail-one-line {
  max-width: 760px;
  margin-top: 24px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.85;
}

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

.ghost-button {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.hero-tags {
  margin-top: 22px;
}

.hero-controls {
  position: absolute;
  right: max(24px, calc((100vw - 1400px) / 2 + 24px));
  bottom: 34px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.hero-dot.active {
  width: 28px;
  background: var(--stellar-cyan);
}

.home-search-panel,
.content-section,
.detail-layout,
.player-section {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.home-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  margin-top: -44px;
  padding: 24px;
  border: 1px solid var(--stellar-line);
  border-radius: var(--radius-xl);
  background: rgba(13, 21, 51, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.home-search-panel p,
.section-heading p {
  color: var(--stellar-cyan);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.home-search-panel h2,
.section-heading h2,
.ranking-panel h2,
.detail-article h2,
.detail-info-card h2,
.ranking-side-card h2,
.site-footer h2 {
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.live-search-box {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 20px;
  border: 1px solid var(--stellar-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.content-section {
  padding: 72px 0 0;
}

.alt-section {
  padding-top: 90px;
}

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

.section-heading > a {
  min-width: max-content;
  color: var(--stellar-cyan);
  font-weight: 800;
}

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 170, 255, 0.12);
  border-radius: 24px;
  background: rgba(20, 27, 61, 0.76);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(74, 144, 226, 0.62);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #111b42, #090f2a);
}

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

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

.play-dot,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(74, 144, 226, 0.9);
  box-shadow: 0 12px 28px rgba(74, 144, 226, 0.36);
}

.play-dot {
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.rank-badge {
  left: 12px;
  top: 12px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  font-weight: 900;
}

.card-body {
  padding: 16px;
}

.card-meta {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.movie-card h2 {
  margin: 0;
  color: white;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.35;
}

.movie-card p {
  min-height: 3.3em;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-body .chip-row {
  margin-top: 14px;
}

.chip-row span {
  padding: 5px 9px;
  border: 1px solid rgba(124, 170, 255, 0.15);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(74, 144, 226, 0.12);
  font-size: 0.78rem;
}

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

.category-tile,
.category-card a {
  display: block;
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--stellar-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(74, 144, 226, 0.24), transparent 12rem),
    rgba(20, 27, 61, 0.78);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

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

.category-tile span,
.category-card h2 {
  display: block;
  font-size: 1.26rem;
  font-weight: 900;
}

.category-tile small,
.category-card p {
  display: block;
  margin-top: 10px;
  color: var(--text-soft);
  line-height: 1.65;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.ranking-panel,
.ranking-side-card,
.detail-info-card {
  position: sticky;
  top: 96px;
  padding: 24px;
  border: 1px solid var(--stellar-line);
  border-radius: 26px;
  background: rgba(13, 21, 51, 0.86);
  box-shadow: var(--shadow-soft);
}

.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(124, 170, 255, 0.12);
}

.rank-row span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: white;
  background: rgba(74, 144, 226, 0.24);
  font-weight: 900;
}

.rank-row strong {
  display: block;
  font-size: 0.98rem;
}

.rank-row em {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: normal;
}

.page-hero,
.detail-hero {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.page-hero {
  padding: 86px 0 28px;
  text-align: center;
}

.slim-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.slim-hero p {
  margin-left: auto;
  margin-right: auto;
}

.centered-actions {
  justify-content: center;
}

.hero-search {
  max-width: 760px;
  margin: 28px auto 0;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.filter-buttons button {
  padding: 8px 14px;
  color: var(--text-soft);
  border: 1px solid var(--stellar-line);
  background: rgba(255, 255, 255, 0.06);
}

.filter-buttons button.active {
  color: white;
  background: rgba(74, 144, 226, 0.38);
}

.category-card a {
  min-height: auto;
  padding: 0;
  overflow: hidden;
}

.category-card img {
  height: 210px;
  object-fit: cover;
  opacity: 0.76;
}

.category-card div {
  padding: 22px;
}

.category-card span {
  color: var(--stellar-cyan);
  font-weight: 800;
}

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

.wide-rank-row {
  display: grid;
  grid-template-columns: 44px 86px 1fr max-content;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--stellar-line);
  border-radius: 20px;
  background: rgba(20, 27, 61, 0.7);
}

.wide-rank-row span {
  color: var(--stellar-cyan);
  font-weight: 950;
  font-size: 1.2rem;
}

.wide-rank-row img {
  height: 116px;
  object-fit: cover;
  border-radius: 14px;
}

.wide-rank-row strong {
  font-size: 1.15rem;
}

.wide-rank-row p,
.wide-rank-row em {
  color: var(--text-soft);
  font-style: normal;
  line-height: 1.65;
}

.side-grid {
  grid-template-columns: 1fr;
  margin-top: 18px;
}

.compact .card-body p,
.side-grid .movie-card p {
  min-height: auto;
}

.detail-hero {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 38px;
  align-items: end;
  padding: 70px 0 36px;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid var(--stellar-line);
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
}

.detail-poster img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.player-section {
  padding: 12px 0 0;
}

.player-panel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(124, 170, 255, 0.18);
  border-radius: 30px;
  background: #020617;
  box-shadow: var(--shadow-soft);
}

.player-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.66));
  transition: opacity 0.22s ease;
}

.player-overlay span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  padding-left: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--stellar-glow), var(--stellar-pink));
  font-size: 2.1rem;
  box-shadow: 0 24px 60px rgba(74, 144, 226, 0.38);
}

.player-overlay strong {
  font-size: 1.1rem;
}

.player-panel.is-playing .player-overlay {
  opacity: 0;
  pointer-events: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  padding-top: 38px;
}

.detail-article {
  padding: 30px;
  border: 1px solid var(--stellar-line);
  border-radius: 26px;
  background: rgba(20, 27, 61, 0.72);
}

.detail-article h2 {
  margin-top: 26px;
}

.detail-article h2:first-child {
  margin-top: 0;
}

.detail-article p {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 2;
}

.detail-info-card dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px 16px;
  margin: 20px 0 0;
}

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

.detail-info-card dd {
  margin: 0;
  color: white;
}

.site-footer {
  width: min(1400px, calc(100% - 48px));
  margin: 90px auto 0;
  padding: 38px 0 28px;
  border-top: 1px solid rgba(124, 170, 255, 0.15);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 34px;
}

.footer-brand {
  font-size: 1.35rem;
  font-weight: 950;
}

.site-footer p,
.footer-links a,
.footer-bottom {
  color: var(--text-muted);
  line-height: 1.75;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 16px;
}

.footer-links a:hover {
  color: var(--stellar-cyan);
}

.footer-bottom {
  margin-top: 32px;
  font-size: 0.92rem;
}

[data-filter-card].hidden {
  display: none;
}

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

  .split-section,
  .detail-layout,
  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .ranking-panel,
  .ranking-side-card,
  .detail-info-card {
    position: static;
  }
}

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

  .menu-button {
    display: grid;
    place-items: center;
    margin-left: auto;
  }

  .mobile-nav.open {
    display: grid;
  }

  .hero-copy {
    width: min(680px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0 110px;
  }

  .hero-controls {
    right: 20px;
    left: 20px;
    justify-content: center;
  }

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

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

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

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

  .wide-rank-row {
    grid-template-columns: 34px 74px 1fr;
  }

  .wide-rank-row em {
    grid-column: 3;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .mobile-nav {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand-text {
    font-size: 0.96rem;
  }

  .hero {
    min-height: 680px;
  }

  .hero h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: 2.45rem;
  }

  .home-search-panel,
  .content-section,
  .detail-layout,
  .player-section,
  .page-hero,
  .detail-hero,
  .site-footer {
    width: min(100% - 28px, 1400px);
  }

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

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

  .wide-rank-row {
    grid-template-columns: 34px 68px 1fr;
    gap: 12px;
  }

  .wide-rank-row img {
    height: 92px;
  }
}
