:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.76);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --card: #0f172a;
  --card-soft: rgba(30, 41, 59, 0.72);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-deep: #0891b2;
  --yellow: #facc15;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 32rem),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.16), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), #67e8f9 52%, #fff 100%);
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.24);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted-2);
  font-size: 15px;
}

.desktop-nav a:hover,
.footer-links a:hover,
.footer-tags a:hover,
.section-more:hover,
.card-body h3 a:hover,
.inline-links a:hover {
  color: var(--cyan);
}

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

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 0 16px 16px;
}

.mobile-nav a {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
}

.hero-carousel {
  position: relative;
  height: 72vh;
  min-height: 560px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transform: scale(1.02);
  background-position: center;
  background-size: cover;
  transition: opacity 700ms ease, transform 900ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.hero-overlay,
.detail-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #020617 0%, rgba(2, 6, 23, 0.92) 12%, rgba(2, 6, 23, 0.54) 52%, rgba(2, 6, 23, 0.25) 100%),
    linear-gradient(to right, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.34), rgba(2, 6, 23, 0.7));
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: end;
  gap: 54px;
  padding: 110px 0 72px;
}

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

.hero-pills,
.detail-tags,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-pills a,
.hero-pills span,
.detail-tags span,
.inline-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.hero-pills a:first-child {
  color: #fff;
  background: rgba(8, 145, 178, 0.88);
  border-color: rgba(103, 232, 249, 0.3);
}

.hero-copy h1,
.hero-copy h2,
.page-hero h1,
.detail-info h1 {
  margin: 18px 0 16px;
  color: #fff;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-copy h1,
.hero-copy h2 {
  font-size: clamp(42px, 6vw, 74px);
  text-shadow: 0 14px 50px rgba(0, 0, 0, 0.55);
}

.hero-one-line {
  margin: 0 0 12px;
  color: #e2e8f0;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 650;
}

.hero-summary {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted-2);
  font-size: 16px;
}

.hero-actions,
.section-head,
.category-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-primary,
.btn-ghost,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.btn-primary {
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 18px 46px rgba(34, 211, 238, 0.22);
}

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

.btn-primary:hover,
.btn-ghost:hover,
.section-more:hover {
  transform: translateY(-2px);
}

.hero-poster {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

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

.hero-poster span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #fff;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
  font-size: 13px;
}

.hero-controls {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 46px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-controls button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 32px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

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

.hero-dot {
  width: 20px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  transition: width 200ms ease, background 200ms ease;
}

.hero-dot.is-active {
  width: 42px;
  background: var(--cyan);
}

.section-block,
.search-panel,
.page-hero {
  padding: 58px 0;
}

.search-panel {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 26px;
  align-items: end;
  margin-top: 8px;
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-panel h2,
.section-head h2,
.category-preview h2,
.text-panel h2,
.side-card h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
}

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

.filter-grid input,
.filter-grid select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.86);
  padding: 0 14px;
}

.filter-grid input:focus,
.filter-grid select:focus {
  border-color: rgba(34, 211, 238, 0.74);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

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

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

.rail-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 285px;
  gap: 22px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scrollbar-color: rgba(34, 211, 238, 0.7) rgba(15, 23, 42, 0.8);
}

.movie-card {
  min-width: 0;
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0f172a;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.movie-card:hover .poster-wrap img,
.category-tile:hover img,
.mini-card:hover img {
  transform: scale(1.08);
}

.poster-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 60%);
}

.card-year,
.card-score,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
}

.card-year {
  left: 10px;
  top: 10px;
}

.card-score {
  right: 10px;
  bottom: 10px;
  color: #111827;
  background: var(--yellow);
}

.rank-badge {
  left: 10px;
  bottom: 10px;
  background: rgba(8, 145, 178, 0.92);
}

.card-body {
  padding: 12px 2px 0;
}

.card-body h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 16px;
  line-height: 1.32;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-meta a {
  color: var(--cyan);
}

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

.mini-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 98px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.68);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(30, 41, 59, 0.8);
}

.mini-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
}

.mini-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.mini-rank {
  position: absolute;
  left: 6px;
  top: 6px;
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #001018;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.mini-text {
  min-width: 0;
}

.mini-text strong,
.mini-text em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-text strong {
  color: #fff;
  font-size: 15px;
}

.mini-text em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(8, 145, 178, 0.16));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.category-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  height: 106px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 16px;
}

.category-thumbs img {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  transition: transform 240ms ease;
}

.category-tile strong,
.category-tile em {
  display: block;
}

.category-tile strong {
  margin-bottom: 8px;
  color: #fff;
  font-size: 20px;
}

.category-tile em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.page-hero {
  padding-top: 78px;
  padding-bottom: 34px;
}

.page-hero h1 {
  font-size: clamp(42px, 6vw, 72px);
}

.page-hero p {
  max-width: 760px;
  color: var(--muted-2);
  font-size: 18px;
}

.inline-links {
  margin-top: 22px;
}

.category-preview-list {
  display: grid;
  gap: 26px;
  padding-bottom: 64px;
}

.category-preview,
.text-panel,
.side-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.16);
}

.category-preview {
  padding: 22px;
}

.category-preview-head {
  margin-bottom: 18px;
}

.category-preview-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.empty-state {
  margin: 28px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted-2);
  background: rgba(15, 23, 42, 0.78);
  text-align: center;
}

.detail-hero {
  position: relative;
  min-height: 640px;
  background-size: cover;
  background-position: center;
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  padding: 46px 0 76px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 34px;
  color: var(--muted-2);
  font-size: 14px;
}

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

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

.detail-poster {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info h1 {
  max-width: 860px;
  font-size: clamp(42px, 6vw, 76px);
}

.detail-one-line {
  max-width: 820px;
  margin: 0 0 18px;
  color: #e2e8f0;
  font-size: 20px;
  font-weight: 650;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  padding: 48px 0 20px;
}

.detail-main {
  display: grid;
  gap: 24px;
}

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

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 18rem),
    rgba(2, 6, 23, 0.46);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.player-shell.is-playing .player-cover {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.play-circle {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 999px;
  color: #001018;
  background: var(--cyan);
  font-size: 28px;
  box-shadow: 0 18px 55px rgba(34, 211, 238, 0.28);
}

.play-title {
  font-size: 18px;
  font-weight: 800;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.text-panel {
  padding: 26px;
}

.text-panel h2,
.side-card h2 {
  margin-bottom: 14px;
  font-size: 24px;
}

.text-panel p {
  margin: 0;
  color: var(--muted-2);
  font-size: 16px;
}

.detail-side {
  display: grid;
  align-content: start;
  gap: 22px;
}

.side-card {
  padding: 22px;
}

.side-card dl {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px 14px;
  margin: 0;
}

.side-card dt {
  color: var(--muted);
}

.side-card dd {
  min-width: 0;
  margin: 0;
  color: #fff;
}

.side-links {
  display: grid;
  gap: 12px;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 1.2fr;
  gap: 28px;
  padding: 34px 0;
  color: var(--muted);
}

.footer-grid p {
  max-width: 460px;
  margin: 10px 0 0;
}

.footer-links,
.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-content: start;
}

.footer-links {
  flex-direction: column;
}

.footer-tags a {
  color: var(--muted-2);
}

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

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

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

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

  .menu-toggle {
    display: block;
  }

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

  .hero-carousel {
    height: auto;
    min-height: 720px;
  }

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

  .hero-content {
    gap: 28px;
    padding: 82px 0 84px;
  }

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

  .hero-controls {
    right: 18px;
    bottom: 28px;
  }

  .hero-dots {
    left: 18px;
    bottom: 42px;
    transform: none;
  }

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

  .movie-grid,
  .compact-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

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

  .detail-hero {
    min-height: auto;
  }

  .detail-hero-content {
    padding-bottom: 48px;
  }
}

@media (max-width: 520px) {
  .container,
  .nav-shell {
    width: min(100% - 24px, 1180px);
  }

  .brand {
    font-size: 17px;
  }

  .movie-grid,
  .compact-grid,
  .category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .rail-scroll {
    grid-auto-columns: 220px;
  }

  .card-body p {
    min-height: 40px;
  }

  .detail-layout {
    padding-top: 28px;
  }

  .text-panel,
  .side-card,
  .category-preview {
    padding: 18px;
  }
}
