:root {
  color-scheme: dark;
  --bg-1: #020617;
  --bg-2: #0f172a;
  --bg-3: #111827;
  --panel: rgba(15, 23, 42, 0.74);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --blue: #60a5fa;
  --cyan: #67e8f9;
  --green: #34d399;
  --gold: #fbbf24;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg-1);
  color: var(--text);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.22), transparent 34rem),
    radial-gradient(circle at 85% 0%, rgba(6, 182, 212, 0.18), transparent 28rem),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-1));
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(2, 6, 23, 0.88);
  border-color: var(--line);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--bg-1);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 32px rgba(96, 165, 250, 0.38);
}

.brand-text,
.footer-brand {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link,
.mobile-link {
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: var(--text);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 10px;
  background: currentColor;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(18px);
}

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

.mobile-link {
  padding: 14px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

main {
  padding-bottom: 56px;
}

.hero {
  position: relative;
  min-height: 760px;
  padding-top: 110px;
  overflow: hidden;
}

.hero-track {
  position: relative;
  min-height: 650px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 64px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-slide::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.52)),
    var(--hero-bg) center / cover no-repeat;
  filter: blur(8px) saturate(1.08);
  transform: scale(1.04);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.hero-slide.is-active::before {
  opacity: 0.38;
}

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

.kicker,
.hero-kicker {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 690px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.8;
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  color: #dffbff;
  background: rgba(8, 145, 178, 0.15);
}

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

.primary-btn,
.ghost-btn,
.section-more,
.hero-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.primary-btn,
.hero-search button {
  color: var(--bg-1);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 18px 34px rgba(96, 165, 250, 0.28);
}

.ghost-btn,
.section-more {
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
}

.hero-poster {
  position: relative;
  display: block;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(2deg);
}

.hero-poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.9));
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 2 / 2.82;
  object-fit: cover;
}

.hero-control {
  position: absolute;
  left: 50%;
  bottom: 84px;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
  z-index: 6;
}

.hero-dot {
  width: 38px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.32);
  cursor: pointer;
}

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

.hero-search {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 7;
  display: flex;
  gap: 10px;
  width: min(720px, calc(100% - 32px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.hero-search input,
.filter-input,
.filter-select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.78);
}

.hero-search input {
  flex: 1;
  border-color: transparent;
  padding: 0 18px;
  background: transparent;
}

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

.page-hero,
.detail-hero {
  padding: 58px 0 32px;
}

.compact-hero {
  max-width: 860px;
}

.page-hero h1,
.detail-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.page-hero p,
.detail-line {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.page-section {
  padding: 38px 0;
}

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

.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.section-head p:not(.kicker) {
  max-width: 760px;
  margin: 0;
  color: var(--subtle);
  line-height: 1.8;
}

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

.category-tile,
.overview-card a,
.story-card {
  display: block;
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.42));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-tile:hover,
.overview-card a:hover,
.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 232, 249, 0.42);
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.category-covers img {
  width: 100%;
  aspect-ratio: 1 / 1.35;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
}

.category-tile strong,
.overview-card h2 {
  display: block;
  margin: 0 0 8px;
  font-size: 20px;
}

.category-tile em,
.overview-card p,
.mini-title-list span {
  display: block;
  color: var(--subtle);
  font-style: normal;
  line-height: 1.7;
}

.mini-title-list {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
}

.poster-link img {
  width: 100%;
  aspect-ratio: 2 / 2.82;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.7);
  transition: transform 0.35s ease;
}

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

.type-badge,
.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--bg-1);
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.rank-badge {
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #fde68a);
}

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

.movie-card h2,
.movie-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

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

.movie-meta {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 13px;
}

.movie-line {
  display: -webkit-box;
  min-height: 66px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--subtle);
  font-size: 14px;
  line-height: 1.6;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 12px;
  margin-bottom: 24px;
}

.wide-filter {
  grid-template-columns: minmax(0, 1fr) 180px;
}

.filter-input,
.filter-select {
  padding: 0 18px;
}

.filter-select {
  cursor: pointer;
}

.rank-panel {
  padding-bottom: 70px;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rank-row {
  display: grid;
  grid-template-columns: 46px 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.66);
}

.rank-row:hover {
  border-color: rgba(103, 232, 249, 0.42);
}

.rank-num {
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.rank-row img {
  width: 64px;
  height: 86px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.7);
}

.rank-info strong,
.rank-info em {
  display: block;
}

.rank-info strong {
  margin-bottom: 7px;
}

.rank-info em {
  color: var(--subtle);
  font-style: normal;
  font-size: 13px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--subtle);
}

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

.detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

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

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 2.82;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.7);
}

.detail-tags {
  margin-bottom: 30px;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--text);
  background: radial-gradient(circle at center, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.62));
  cursor: pointer;
}

.player-overlay span {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  color: var(--bg-1);
  font-size: 34px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 20px 50px rgba(96, 165, 250, 0.38);
}

.player-overlay.is-hidden {
  display: none;
}

.detail-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 16px 0 8px;
}

.story-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding: 46px 0;
}

.site-footer p,
.site-footer a {
  color: var(--subtle);
  line-height: 1.8;
}

.site-footer a {
  display: block;
  margin-top: 8px;
}

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

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

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--subtle);
  text-align: center;
}

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

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

  .hero-slide {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero {
    min-height: 820px;
  }

  .hero-track {
    min-height: 700px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    align-content: start;
    padding-top: 30px;
  }

  .hero-poster {
    width: min(280px, 76vw);
    margin: 0 auto;
    transform: rotate(0);
  }

  .hero-search {
    border-radius: 24px;
    align-items: stretch;
    flex-direction: column;
  }

  .hero-search input,
  .hero-search button {
    width: 100%;
  }

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

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

  .detail-poster {
    width: min(280px, 78vw);
  }

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

@media (max-width: 540px) {
  .container {
    width: min(100% - 22px, 1180px);
  }

  .brand-text {
    font-size: 20px;
  }

  .hero h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: 36px;
  }

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

  .filter-bar,
  .wide-filter {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 38px 56px minmax(0, 1fr);
  }

  .rank-row img {
    width: 56px;
    height: 78px;
  }
}
