:root {
  --bg: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --card: #ffffff;
  --purple: #7c3aed;
  --pink: #db2777;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --dark: #0f172a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 44%, #f8fafc 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(18px);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.35);
}

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

.desktop-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  transition: background 0.2s ease, color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  padding: 10px;
}

.mobile-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 99px;
  background: #ffffff;
}

.mobile-nav {
  display: none;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

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

.mobile-nav a {
  padding: 12px;
  border-radius: 12px;
  color: #ffffff;
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  color: #ffffff;
  background: #111827;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.75s ease, transform 1.2s ease;
  background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(49, 46, 129, 0.66), rgba(131, 24, 67, 0.38)), var(--hero-image);
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-backdrop {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(0deg, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 120px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: #a78bfa;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
}

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

.hero-desc {
  max-width: 680px;
  margin: 26px 0 0;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.86);
}

.hero-tags,
.detail-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.hero-tags span,
.tag-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.tag-row span {
  background: #f3e8ff;
  color: #6d28d9;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 18px 32px rgba(124, 58, 237, 0.34);
}

.btn.ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
}

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

.hero-controls button {
  width: 32px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.38);
}

.hero-controls button.active {
  width: 56px;
  background: #ffffff;
}

.section,
.search-panel,
.page-hero {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 46px 0;
}

.search-panel {
  position: relative;
  z-index: 4;
  margin-top: -34px;
  padding: 24px;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: center;
  gap: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-panel h2,
.section-head h2,
.detail-text h2,
.detail-side h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.04em;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px) minmax(130px, 190px);
  gap: 12px;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  outline: none;
  background: #ffffff;
  color: var(--text);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
}

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

.text-link {
  color: #6d28d9;
  font-weight: 800;
}

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

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

.category-tile {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 22px;
  border-radius: var(--radius);
  color: #ffffff;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #4338ca, #9333ea 48%, #db2777);
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.category-tile span {
  font-weight: 900;
  font-size: 20px;
}

.category-tile strong {
  font-size: 34px;
  line-height: 1;
}

.category-tile p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

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

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

.movie-card {
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--soft-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.movie-card a {
  display: block;
  height: 100%;
}

.movie-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #312e81, #831843);
}

.movie-card-compact .movie-cover {
  aspect-ratio: 3 / 4;
}

.movie-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.movie-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.34));
}

.movie-score,
.rank-num {
  position: absolute;
  z-index: 2;
  top: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(10px);
}

.movie-score {
  right: 12px;
}

.rank-num {
  left: 12px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.movie-info {
  padding: 18px;
}

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

.movie-info h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.movie-line {
  min-height: 48px;
  margin: 10px 0 14px;
  color: #475569;
  line-height: 1.65;
  font-size: 14px;
}

.page-hero {
  margin-top: 0;
  padding: 76px 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.page-hero.slim {
  display: block;
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 5vw, 66px);
  letter-spacing: -0.06em;
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: #475569;
  font-size: 18px;
  line-height: 1.75;
}

.category-hero,
.ranking-hero {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 70px max(16px, calc((100% - 1200px) / 2)) 56px;
  color: #ffffff;
  background: linear-gradient(135deg, #1e1b4b, #4338ca 42%, #be185d);
}

.category-hero p,
.ranking-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.sticky-filter {
  position: sticky;
  top: 88px;
}

.detail-hero {
  position: relative;
  min-height: 620px;
  color: #ffffff;
  display: flex;
  align-items: flex-end;
  background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(49, 46, 129, 0.7), rgba(131, 24, 67, 0.46)), var(--detail-image);
  background-size: cover;
  background-position: center;
}

.detail-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.32), transparent 36%);
}

.detail-content {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0 58px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: end;
}

.detail-poster {
  overflow: hidden;
  border-radius: 26px;
  box-shadow: var(--shadow);
  background: #111827;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.breadcrumb {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.72);
}

.breadcrumb a {
  color: #ddd6fe;
}

.detail-info h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.detail-one-line {
  max-width: 820px;
  margin: 24px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  line-height: 1.75;
}

.detail-tags {
  margin: 16px 0 28px;
}

.detail-section {
  padding-top: 34px;
}

.player-panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.player-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.24), rgba(2, 6, 23, 0.68));
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.player-start.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.player-start span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding-left: 5px;
  font-size: 34px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 22px 48px rgba(124, 58, 237, 0.42);
}

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

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

.detail-text,
.detail-side {
  padding: 30px;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.detail-text.full {
  width: 100%;
}

.detail-text p {
  color: #475569;
  line-height: 1.9;
  font-size: 16px;
}

.detail-side dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.detail-side dt {
  color: var(--muted);
  font-size: 13px;
}

.detail-side dd {
  margin: -8px 0 8px;
  font-weight: 800;
  line-height: 1.6;
}

.detail-side a {
  color: #6d28d9;
}

.site-footer {
  margin-top: 54px;
  color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(135deg, #0f172a, #1e1b4b 50%, #111827);
}

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

.footer-logo {
  color: #ffffff;
}

.site-footer h3 {
  color: #ffffff;
  margin: 0 0 14px;
}

.site-footer p {
  max-width: 460px;
  line-height: 1.75;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.84);
}

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

.footer-bottom {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.56);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius);
  background: #ffffff;
}

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

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

  .detail-content {
    grid-template-columns: 200px 1fr;
  }

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

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

  .mobile-toggle {
    display: block;
  }

  .hero {
    min-height: 720px;
  }

  .hero-content {
    padding-top: 76px;
  }

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

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

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

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

  .detail-content {
    grid-template-columns: 1fr;
    padding-top: 70px;
  }

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

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

  .sticky-filter {
    position: relative;
    top: auto;
  }
}
