:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.95);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.48);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34rem),
    radial-gradient(circle at 78% 8%, rgba(6, 182, 212, 0.13), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.brand-mark {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #1d4ed8, #0f172a 58%, #334155);
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
}

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

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border-radius: 0.75rem;
  color: var(--soft);
  font-size: 0.94rem;
  transition: background 0.22s ease, color 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(51, 65, 85, 0.64);
  color: #ffffff;
}

.header-search,
.mobile-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select,
.search-hero input {
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  outline: none;
  padding: 0 0.85rem;
}

.header-search input {
  width: 15rem;
}

.header-search button,
.mobile-search button,
.search-hero button,
.primary-btn,
.secondary-btn,
.rank-action,
.ghost-link,
.play-overlay span {
  border: 0;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  padding: 0.72rem 1rem;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.25);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-hero button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.rank-action:hover,
.ghost-link:hover,
.play-overlay:hover span {
  transform: translateY(-1px);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.34);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: var(--text);
  background: rgba(15, 23, 42, 0.78);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 1rem 1.2rem 1.25rem;
}

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

.mobile-panel nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.page-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}

.hero {
  position: relative;
  min-height: 74vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.72) 48%, rgba(2, 6, 23, 0.28)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.9), transparent 45%);
}

.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.8s ease, transform 5.4s ease;
}

.hero-bg img.active {
  opacity: 0.62;
  transform: scale(1.01);
}

.hero-inner {
  position: relative;
  z-index: 2;
  min-height: 74vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.7fr);
  align-items: end;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #bfdbfe;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero h1 {
  max-width: 48rem;
  margin: 1rem 0;
  font-size: clamp(2.6rem, 6.2vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.hero-copy {
  max-width: 42rem;
  color: var(--soft);
  font-size: 1.12rem;
  line-height: 1.8;
}

.hero-actions,
.hero-tabs,
.section-head,
.meta-pills,
.tag-row,
.breadcrumb,
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 1.5rem;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.hero-tabs {
  margin-top: 2rem;
}

.hero-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.68);
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.hero-tab.active {
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(37, 99, 235, 0.42);
}

.hero-feature {
  display: grid;
  gap: 1rem;
}

.hero-slide-card {
  display: none;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  padding: 1rem;
  backdrop-filter: blur(16px);
}

.hero-slide-card.active {
  display: grid;
  gap: 1rem;
}

.hero-slide-card img {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  border-radius: 1rem;
}

.hero-slide-card h2 {
  margin: 0;
  font-size: 1.6rem;
}

.hero-slide-card p {
  color: var(--soft);
  line-height: 1.7;
}

.section {
  margin-top: 3rem;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.section-lead {
  color: var(--muted);
  max-width: 48rem;
  line-height: 1.8;
}

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

.movie-card,
.category-card,
.panel,
.rank-item,
.search-hero,
.detail-card,
.video-panel {
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(2, 6, 23, 0.22);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(15, 23, 42, 0.94);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

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

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

.poster-badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.9);
}

.movie-card-body {
  padding: 0.9rem;
}

.movie-card h3,
.rank-info h3,
.detail-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.35;
}

.movie-card p,
.rank-info p,
.detail-copy,
.category-body p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  line-height: 1.65;
}

.movie-meta {
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.5;
}

.tag-row {
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.tag-row span,
.meta-pills span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(30, 41, 59, 0.72);
  padding: 0.28rem 0.58rem;
  font-size: 0.76rem;
}

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

.category-card {
  overflow: hidden;
}

.category-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.35rem;
}

.category-preview img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0.9rem;
}

.category-body {
  padding: 1.2rem;
}

.category-body h2 {
  margin: 0.55rem 0 0.45rem;
  font-size: 1.45rem;
}

.ghost-link {
  display: inline-flex;
  margin-top: 0.4rem;
  padding: 0.62rem 0.9rem;
  background: rgba(37, 99, 235, 0.18);
  box-shadow: none;
}

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

.panel {
  padding: 1.25rem;
}

.panel h3 {
  margin: 0 0 0.45rem;
}

.panel p {
  color: var(--muted);
  line-height: 1.7;
}

.breadcrumb {
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a:hover {
  color: #ffffff;
}

.filter-bar {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.65);
}

.filter-bar input {
  min-width: min(22rem, 100%);
  flex: 1 1 18rem;
}

.filter-bar select {
  flex: 0 1 11rem;
}

.rank-list {
  display: grid;
  gap: 0.8rem;
}

.rank-item {
  display: grid;
  grid-template-columns: 3.5rem 5.7rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
}

.rank-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: #93c5fd;
  text-align: center;
}

.rank-cover img {
  width: 5.7rem;
  aspect-ratio: 3 / 4;
  border-radius: 0.8rem;
  object-fit: cover;
}

.rank-action {
  display: inline-flex;
  align-items: center;
  padding: 0.58rem 0.9rem;
}

.search-hero {
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.76)),
    var(--panel);
}

.search-hero h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.search-hero form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.search-hero input {
  flex: 1;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.video-panel {
  overflow: hidden;
}

.video-shell {
  position: relative;
  background: #000000;
}

.video-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.72));
  cursor: pointer;
}

.play-overlay span {
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  font-size: 1.8rem;
}

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

.video-copy {
  padding: 1.2rem;
}

.video-copy h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.8rem, 4vw, 3.3rem);
  letter-spacing: -0.05em;
}

.detail-card {
  padding: 1rem;
}

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

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.7fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.detail-copy h2,
.related-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
}

.detail-copy p {
  color: var(--soft);
  font-size: 1rem;
}

.related-section {
  margin-top: 2rem;
}

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

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

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

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

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  color: var(--muted);
}

.footer-inner strong {
  color: var(--text);
  font-size: 1.05rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-links a:hover {
  color: #ffffff;
}

@media (max-width: 1100px) {
  .header-search {
    display: none;
  }

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

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

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

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

  .hero-inner {
    align-items: center;
    min-height: auto;
  }

  .hero {
    min-height: auto;
  }

  .category-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .header-inner,
  .page-main,
  .footer-inner {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

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

  .hero {
    border-radius: 1.25rem;
  }

  .hero-inner {
    padding: 1.4rem;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .movie-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .rank-item {
    grid-template-columns: 2.5rem 4.5rem minmax(0, 1fr);
  }

  .rank-action {
    grid-column: 3;
    width: max-content;
  }

  .search-hero form,
  .footer-inner {
    flex-direction: column;
  }

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