:root {
  color-scheme: dark;
  --bg: #030712;
  --bg-soft: #0b1120;
  --panel: #111827;
  --panel-strong: #172033;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #f87171;
  --radius: 20px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 5%, rgba(59, 130, 246, 0.22), transparent 34rem),
    radial-gradient(circle at 90% 20%, rgba(34, 211, 238, 0.12), transparent 30rem),
    var(--bg);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled,
.site-header.menu-open {
  background: rgba(3, 7, 18, 0.92);
  border-color: var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

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

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

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.35);
}

.logo-text {
  font-size: 21px;
  background: linear-gradient(90deg, #bfdbfe, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.desktop-nav a,
.mobile-nav a {
  color: #cbd5e1;
  font-weight: 650;
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
  color: #60a5fa;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.7);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-button span {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: var(--shadow);
}

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

.hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: #020617;
}

.hero-stage,
.hero-slide {
  min-height: 100vh;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 18, 0.96) 0%, rgba(3, 7, 18, 0.78) 45%, rgba(3, 7, 18, 0.15) 100%),
    linear-gradient(0deg, #030712 0%, rgba(3, 7, 18, 0) 38%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1200px) / 2));
  bottom: 18vh;
  width: min(680px, calc(100% - 48px));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.hero h2,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-info p {
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.8;
  max-width: 760px;
}

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

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 650;
  background: rgba(51, 65, 85, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.hero-tags span,
.detail-tags span {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
  backdrop-filter: blur(10px);
}

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

.primary-button,
.ghost-button,
.hero-search button,
.filter-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.hero-search button,
.filter-bar button {
  background: linear-gradient(135deg, var(--blue), #2563eb);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.32);
}

.ghost-button {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(12px);
}

.primary-button:hover,
.ghost-button:hover,
.hero-search button:hover,
.filter-bar button:hover {
  transform: translateY(-2px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
  width: 34px;
  background: var(--blue);
}

.hero-search {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 86px;
  width: min(720px, calc(100% - 48px));
  padding: 10px;
  display: flex;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

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

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

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

.section {
  padding: 78px 0;
}

.soft-section {
  width: min(1240px, calc(100% - 16px));
  padding: 72px 20px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.2));
}

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

.section-heading h2,
.category-strip h3,
.detail-text h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.text-link {
  color: #60a5fa;
  font-weight: 800;
}

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

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

.movie-card a {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card a:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.48);
  box-shadow: var(--shadow);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
}

.movie-card-wide {
  width: 320px;
  flex: 0 0 320px;
}

.movie-card-rank .card-cover {
  aspect-ratio: 21 / 10;
}

.movie-card-small .card-cover {
  aspect-ratio: 16 / 9;
}

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

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

.card-shadow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.1));
  transition: opacity 0.3s ease;
}

.movie-card a:hover .card-shadow {
  opacity: 1;
}

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  opacity: 0;
  background: rgba(59, 130, 246, 0.92);
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(10px);
}

.play-badge::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 18px;
  border-left: 16px solid white;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

.movie-card a:hover .play-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.year-badge,
.rank-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(10px);
}

.rank-badge {
  left: 12px;
  right: auto;
  color: #fff7ed;
  background: rgba(234, 88, 12, 0.82);
}

.card-body {
  padding: 17px;
}

.card-body h3 {
  margin: 0 0 10px;
  min-height: 44px;
  font-size: 17px;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.movie-card a:hover h3 {
  color: #60a5fa;
}

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

.movie-rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 6px 4px 22px;
  scroll-snap-type: x proximity;
}

.movie-rail .movie-card {
  scroll-snap-align: start;
}

.category-strips {
  display: grid;
  gap: 22px;
}

.category-strip {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.7);
}

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

.mini-grid,
.compact-row,
.hero-mini-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.compact-card {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  border-radius: 16px;
  background: #0f172a;
}

.compact-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0.72;
  transition: transform 0.25s ease;
}

.compact-card:hover img {
  transform: scale(1.05);
}

.compact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.86), rgba(3, 7, 18, 0.08));
}

.compact-card span {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

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

.category-tile,
.category-overview-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.74));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.45);
}

.category-tile span,
.category-overview-link h2 {
  display: block;
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 900;
}

.category-tile small,
.category-overview-link p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.page-main {
  padding-top: 106px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 44px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.28), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86));
  box-shadow: var(--shadow);
}

.category-hero {
  grid-template-columns: 0.9fr 1.1fr;
  gap: 26px;
}

.compact-hero {
  min-height: 280px;
}

.trending-hero {
  min-height: 460px;
}

.trending-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.page-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.95), rgba(3, 7, 18, 0.38));
}

.trending-hero > div:last-child {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  color: #93c5fd;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  margin-bottom: 24px;
}

.search-panel[hidden] {
  display: none;
}

.search-panel.always-open {
  display: block;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 54px 86px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  border-color: rgba(59, 130, 246, 0.42);
}

.rank-number {
  font-weight: 950;
  color: #fbbf24;
  font-size: 18px;
  text-align: center;
}

.rank-row img {
  width: 86px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 34px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.22), transparent 28rem),
    rgba(15, 23, 42, 0.76);
  box-shadow: var(--shadow);
}

.poster-panel {
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.36);
}

.poster-panel img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 22px 0;
  list-style: none;
}

.detail-meta li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.38);
}

.detail-meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-meta strong {
  font-size: 15px;
}

.player-section {
  padding: 36px 0 0;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 30px;
  background: #000000;
  box-shadow: var(--shadow);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #ffffff;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.64));
  cursor: pointer;
}

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

.player-button {
  width: 86px;
  height: 86px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 18px 44px rgba(59, 130, 246, 0.46);
}

.player-button span {
  margin-left: 7px;
  border-left: 24px solid #ffffff;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
}

.player-overlay strong {
  font-size: 18px;
  letter-spacing: 0.05em;
}

.detail-text {
  color: #dbeafe;
}

.detail-text p {
  color: #cbd5e1;
  font-size: 17px;
  line-height: 2;
}

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

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

.site-footer p,
.site-footer a {
  color: var(--muted);
  line-height: 1.8;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

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

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

.no-results {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 24px;
}

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

  .menu-button {
    display: inline-flex;
  }

  .hero-content {
    bottom: 22vh;
  }

  .hero-search {
    bottom: 82px;
  }

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

  .category-strip,
  .category-hero,
  .detail-hero,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 46px 78px 1fr;
  }

  .rank-row em {
    grid-column: 3;
  }

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

@media (max-width: 640px) {
  .header-inner {
    height: 66px;
  }

  .logo-text {
    font-size: 18px;
  }

  .hero h1,
  .hero h2,
  .page-hero h1,
  .detail-info h1 {
    font-size: 36px;
  }

  .hero-content {
    bottom: 25vh;
  }

  .hero-arrow {
    display: none;
  }

  .hero-search {
    flex-direction: column;
    border-radius: 24px;
  }

  .section {
    padding: 54px 0;
  }

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

  .movie-grid,
  .rank-grid,
  .category-grid,
  .category-overview-grid,
  .mini-grid,
  .compact-row,
  .hero-mini-list {
    grid-template-columns: 1fr;
  }

  .page-hero,
  .detail-hero {
    padding: 24px;
    border-radius: 26px;
  }

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

  .rank-row {
    grid-template-columns: 42px 72px 1fr;
    gap: 10px;
  }

  .rank-row img {
    width: 72px;
    height: 48px;
  }
}
