:root {
  color-scheme: dark;
  --page-bg: #020617;
  --panel-bg: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --border-soft: rgba(148, 163, 184, 0.18);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --accent: #22d3ee;
  --accent-strong: #06b6d4;
  --accent-warm: #f59e0b;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --shadow-glow: 0 24px 80px rgba(8, 145, 178, 0.26);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 6%, rgba(34, 211, 238, 0.18), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(79, 70, 229, 0.18), transparent 32%),
    linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
  color: var(--text-main);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

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

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

.header-inner,
.footer-inner,
.page-shell {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, #06b6d4, #4f46e5 55%, #a855f7);
  box-shadow: 0 12px 36px rgba(34, 211, 238, 0.26);
}

.brand-name {
  font-size: 1.25rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link,
.mobile-nav a {
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav a:hover {
  color: var(--text-main);
  background: rgba(34, 211, 238, 0.12);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--text-main);
}

.mobile-nav {
  display: none;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
}

.mobile-nav.open {
  display: grid;
  gap: 6px;
}

.hero {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.18) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  min-height: 72vh;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

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

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #67e8f9;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.65rem, 7vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.hero p {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.85;
}

.hero-actions,
.section-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 22px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-main);
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.6);
  background: rgba(14, 116, 144, 0.28);
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.3);
}

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

.hero-dot {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  border: 0;
  background: rgba(226, 232, 240, 0.34);
  cursor: pointer;
}

.hero-dot.active {
  background: #67e8f9;
}

.page-shell {
  padding: 42px 0 72px;
}

.section-block {
  margin-bottom: 56px;
}

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

.section-heading h2,
.page-title h1,
.detail-main h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.section-heading p,
.page-title p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.8;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 18px 55px 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(-6px);
  border-color: rgba(103, 232, 249, 0.42);
  box-shadow: var(--shadow-glow);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0f172a;
}

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(2, 6, 23, 0.78);
  color: #a5f3fc;
  font-size: 0.82rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

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

.movie-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.movie-card h3,
.rank-content h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.35;
}

.movie-card p,
.rank-content p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(8, 145, 178, 0.1);
  color: #bae6fd;
  font-size: 0.76rem;
}

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

.category-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 24px;
  background:
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.22), transparent 36%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.72));
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 900;
}

.category-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
  line-height: 1.75;
}

.category-count {
  display: inline-flex;
  color: #67e8f9;
  font-weight: 900;
}

.page-title {
  margin-bottom: 28px;
  padding: 34px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.18), transparent 32%),
    rgba(15, 23, 42, 0.65);
}

.search-panel {
  margin-top: 26px;
}

.search-box {
  position: relative;
  display: flex;
  max-width: 700px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  overflow: hidden;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 16px 20px;
  background: transparent;
  color: var(--text-main);
}

.search-box button {
  border: 0;
  padding: 0 22px;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.search-results {
  display: none;
  max-width: 700px;
  margin-top: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.94);
  overflow: hidden;
}

.search-results.open {
  display: block;
}

.search-results a {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.search-results a:last-child {
  border-bottom: 0;
}

.search-results img {
  width: 42px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 72px 82px 1fr;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.64);
}

.rank-num {
  display: inline-flex;
  justify-content: center;
  color: #67e8f9;
  font-size: 1.45rem;
  font-weight: 900;
}

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

.rank-content span {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.24;
  filter: blur(8px) saturate(1.2);
  transform: scale(1.08);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.62), #020617 92%);
}

.detail-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 38px;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 52px;
}

.detail-poster img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glow);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.detail-main h1 {
  margin-bottom: 18px;
}

.detail-lead {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.player-section {
  margin-top: 28px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, 0.76);
  overflow: hidden;
}

.movie-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.movie-player video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.28);
  cursor: pointer;
}

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

.player-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #ffffff;
  font-size: 2rem;
  box-shadow: 0 20px 60px rgba(37, 99, 235, 0.45);
  cursor: pointer;
}

.detail-content {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.content-panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 26px;
  background: rgba(15, 23, 42, 0.66);
}

.content-panel h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  font-weight: 900;
}

.content-panel p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.9;
}

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

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr;
  gap: 28px;
  padding: 38px 0;
}

.footer-brand p,
.footer-links a,
.footer-categories a {
  color: var(--text-soft);
  line-height: 1.8;
}

.footer-links,
.footer-categories {
  display: grid;
  gap: 8px;
}

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

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

  .detail-wrap {
    grid-template-columns: 260px 1fr;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero,
  .hero-content {
    min-height: 78vh;
  }

  .movie-grid,
  .category-grid,
  .footer-inner,
  .detail-wrap {
    grid-template-columns: 1fr;
  }

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

  .ranking-row {
    grid-template-columns: 44px 72px 1fr;
    gap: 12px;
  }

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

@media (max-width: 520px) {
  .header-inner,
  .footer-inner,
  .page-shell,
  .detail-wrap,
  .hero-content {
    width: min(100% - 22px, var(--max-width));
  }

  .movie-grid {
    gap: 16px;
  }

  .page-title,
  .content-panel {
    padding: 22px;
  }

  .hero-actions,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
