:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.78);
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #22d3ee;
  --accent-strong: #06b6d4;
  --gold: #facc15;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.20), transparent 32rem),
    radial-gradient(circle at 90% 12%, rgba(99, 102, 241, 0.16), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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;
  background: rgba(2, 6, 23, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1240px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #00111d;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.35);
}

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

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

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(34, 211, 238, 0.12);
}

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

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: white;
}

.category-strip {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.category-strip-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 10px 0;
}

.category-strip a {
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.category-strip a:hover {
  color: var(--accent);
}

.hero {
  position: relative;
  height: 640px;
  overflow: hidden;
  background: #020617;
}

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 0.8s ease, visibility 0.8s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.62) 42%, rgba(2, 6, 23, 0.18) 100%),
    linear-gradient(0deg, #020617 0%, transparent 52%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 1240px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-desc {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted-strong);
  font-size: 18px;
}

.hero-meta,
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.hero-meta {
  margin: 20px 0 0;
}

.hero-meta span,
.meta-line span,
.detail-meta-grid span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.42);
}

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

.tag-row span {
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
  font-size: 12px;
}

.hero-tags {
  margin: 18px 0 0;
}

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

.primary-button,
.ghost-button,
.section-more,
.filter-toolbar button,
.search-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: 0.2s ease;
}

.primary-button,
.filter-toolbar button,
.search-panel button {
  color: #042f3a;
  background: var(--accent);
}

.primary-button:hover,
.filter-toolbar button:hover,
.search-panel button:hover {
  background: #67e8f9;
  transform: translateY(-1px);
}

.ghost-button,
.section-more {
  border: 1px solid var(--line);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.ghost-button:hover,
.section-more:hover {
  border-color: rgba(34, 211, 238, 0.55);
  color: var(--accent);
}

.hero-controls {
  position: absolute;
  right: max(24px, calc((100% - 1240px) / 2));
  bottom: 86px;
  z-index: 5;
  display: flex;
  gap: 10px;
}

.hero-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: white;
  font-size: 26px;
}

.hero-dots {
  position: absolute;
  left: max(24px, calc((100% - 1240px) / 2));
  bottom: 86px;
  z-index: 5;
  display: flex;
  gap: 8px;
}

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

.hero-dot.active {
  background: var(--accent);
}

.hero-search {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  width: min(640px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
}

.hero-search input,
.search-panel input,
.filter-toolbar input,
.filter-toolbar select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  color: white;
  background: rgba(2, 6, 23, 0.62);
}

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

.hero-search button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: #062c33;
  background: var(--accent);
  font-weight: 800;
}

.category-panel,
.content-section,
.page-shell,
.detail-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.category-panel,
.content-section {
  padding-top: 54px;
}

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

.section-heading h2,
.compact-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

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

.category-card,
.category-overview-card {
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(99, 102, 241, 0.08)),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.category-card:hover,
.category-overview-card:hover,
.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.38);
}

.category-card span,
.category-overview-card h2 {
  display: block;
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.category-card strong {
  display: block;
  margin: 8px 0;
  color: var(--accent);
  font-size: 34px;
}

.category-card small,
.category-overview-card p,
.category-overview-card small {
  color: var(--muted);
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.18);
  transition: 0.2s ease;
}

.cover-box {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 15%, rgba(34, 211, 238, 0.28), transparent 40%),
    linear-gradient(135deg, #172554, #020617 70%);
}

.cover-box img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover img {
  transform: scale(1.06);
}

.cover-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 38px;
  font-weight: 900;
}

.play-chip,
.rank-badge {
  position: absolute;
  z-index: 4;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.play-chip {
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  color: #042f3a;
  background: var(--accent);
}

.rank-badge {
  left: 10px;
  top: 10px;
  padding: 5px 9px;
  color: #422006;
  background: var(--gold);
}

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

.movie-card h2 {
  min-height: 2.8em;
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
}

.movie-card h2 a:hover,
.ranking-table a:hover,
.breadcrumb a:hover {
  color: var(--accent);
}

.meta-line {
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
}

.meta-line span {
  padding: 2px 7px;
}

.card-desc {
  min-height: 3.2em;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.page-shell,
.detail-shell {
  padding-top: 44px;
}

.compact-hero {
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.24), transparent 22rem),
    rgba(15, 23, 42, 0.70);
  box-shadow: var(--shadow);
}

.compact-hero p:last-child {
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--muted-strong);
}

.category-overview-grid {
  margin-top: 26px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-count {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #042f3a;
  background: var(--accent);
  font-weight: 900;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 160px auto;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.70);
}

.filter-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.filter-toolbar input,
.filter-toolbar select {
  height: 44px;
  padding: 0 14px;
}

.empty-result {
  margin: 28px 0 0;
  color: var(--muted);
  text-align: center;
}

.year-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.year-cloud a {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.ranking-table th,
.ranking-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  text-align: left;
}

.ranking-table th {
  color: white;
  background: rgba(15, 23, 42, 0.9);
}

.ranking-table td {
  color: var(--muted-strong);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
}

.detail-hero {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(99, 102, 241, 0.08)),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.detail-poster {
  border-radius: 24px;
}

.detail-one-line {
  max-width: 820px;
  margin: 18px 0 24px;
  color: var(--muted-strong);
  font-size: 18px;
}

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

.detail-meta-grid span {
  color: var(--muted-strong);
}

.detail-meta-grid b {
  margin-right: 8px;
  color: white;
}

.player-section {
  margin-top: 34px;
}

.video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 0;
  color: white;
  background:
    radial-gradient(circle at center, rgba(34, 211, 238, 0.20), transparent 15rem),
    rgba(2, 6, 23, 0.38);
  backdrop-filter: blur(2px);
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  color: #042f3a;
  background: var(--accent);
  font-size: 30px;
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.35);
}

.player-overlay strong {
  font-size: 22px;
}

.player-overlay small {
  color: var(--muted-strong);
}

.detail-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.story-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.story-panel h2 {
  margin: 0 0 14px;
}

.story-panel p {
  margin: 0;
  color: var(--muted-strong);
}

.search-panel {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
}

.search-panel input {
  height: 48px;
  padding: 0 16px;
}

.search-summary {
  margin-bottom: 20px;
  color: var(--muted);
}

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

.footer-grid {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 26px;
  padding: 42px 0;
}

.footer-brand {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 900;
}

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

.site-footer p,
.site-footer li,
.copyright {
  color: var(--muted);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 8px;
}

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

.copyright {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  text-align: center;
  font-size: 14px;
}

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

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

@media (max-width: 820px) {
  .menu-button {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.96);
  }

  .main-nav.open {
    display: flex;
  }

  .hero {
    height: 620px;
  }

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

  .hero-controls {
    right: 16px;
    bottom: 96px;
  }

  .hero-dots {
    left: 16px;
    bottom: 102px;
  }

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

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

  .category-grid,
  .category-overview-grid,
  .detail-content-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .filter-toolbar {
    grid-template-columns: 1fr;
  }

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

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

  .compact-hero {
    padding: 32px;
  }
}

@media (max-width: 520px) {
  .brand-text {
    font-size: 17px;
  }

  .hero {
    height: 560px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .movie-grid,
  .large-grid {
    gap: 12px;
  }

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

  .movie-card h2 {
    font-size: 14px;
  }

  .card-desc {
    display: none;
  }

  .search-panel,
  .hero-search {
    flex-direction: column;
    border-radius: 22px;
  }

  .hero-search input {
    min-height: 42px;
  }
}
