:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: rgba(15, 23, 42, 0.82);
  --panel-strong: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 35%), var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

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

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), #8b5cf6);
  box-shadow: 0 12px 34px rgba(59, 130, 246, 0.38);
}

.brand-text {
  font-size: 1.2rem;
}

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

.nav-link,
.mobile-link {
  color: var(--muted-strong);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: #fff;
}

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

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 6px 0;
  background: #fff;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 24px 18px;
}

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

.hero-carousel {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 1.2s ease;
}

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

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

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

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 120px 0 190px;
  max-width: 760px;
  margin-left: max(16px, calc((100% - 1180px) / 2));
}

.eyebrow,
.section-kicker {
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero-content h1,
.hero-content h2,
.page-hero h1,
.detail-main h1 {
  margin: 14px 0 12px;
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.hero-content h1,
.hero-content h2 {
  font-size: clamp(2.8rem, 7vw, 5.9rem);
}

.hero-content h3 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
}

.hero-content p,
.page-hero p,
.lead-text {
  max-width: 760px;
  color: var(--muted-strong);
  font-size: 1.06rem;
}

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

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #dbeafe;
  font-size: 0.78rem;
}

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

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

.primary-button,
.ghost-button,
.home-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.home-search button {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.ghost-button {
  border: 1px solid rgba(226, 232, 240, 0.25);
  background: rgba(15, 23, 42, 0.54);
}

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

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

.hero-dot {
  width: 28px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.35);
  cursor: pointer;
}

.hero-dot.active {
  background: #fff;
}

.hero-thumbs {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 28px;
  width: min(1180px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  transform: translateX(-50%);
}

.hero-thumb {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  color: #fff;
  font-weight: 700;
}

.hero-thumb img {
  width: 52px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
}

.quick-search,
.section-block {
  padding: 54px 0;
}

.home-search,
.filter-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.home-search {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: var(--shadow);
}

.home-search input,
.filter-controls input,
.filter-controls select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(2, 6, 23, 0.65);
  color: var(--text);
  padding: 0 16px;
}

.category-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.category-chips a {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.58);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.category-chips a:hover {
  color: white;
  border-color: rgba(147, 197, 253, 0.48);
  transform: translateY(-1px);
}

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

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.filter-panel h2,
.site-footer h2,
.side-reel h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.section-heading a {
  color: #93c5fd;
  font-weight: 700;
}

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.75);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(147, 197, 253, 0.45);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.92));
}

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

.poster-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.86);
  font-size: 0.74rem;
  font-weight: 800;
}

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

.movie-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.movie-card h2 a:hover,
.rank-card h2 a:hover {
  color: #93c5fd;
}

.movie-card p,
.rank-card p,
.category-card p,
.filter-panel p,
.site-footer p {
  color: var(--muted);
}

.movie-card p {
  min-height: 52px;
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.movie-meta,
.detail-facts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.ranking-panel {
  position: sticky;
  top: 96px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.ranking-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
}

.ranking-list span {
  color: #93c5fd;
  font-weight: 900;
}

.ranking-list small {
  color: var(--muted);
}

.page-hero {
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 40%), linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.92));
}

.compact-page {
  padding: 70px 0;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.6rem);
}

.breadcrumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: #bfdbfe;
}

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

.category-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

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

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.12));
}

.category-card > *:not(img) {
  position: relative;
  z-index: 1;
}

.category-number {
  color: #93c5fd;
  font-weight: 900;
}

.category-card h2 {
  margin: 8px 0;
  font-size: 1.6rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  align-items: center;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.filter-controls {
  grid-template-columns: minmax(0, 1fr) 150px 150px;
}

.empty-result {
  display: none;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
}

.rank-grid {
  display: grid;
  gap: 16px;
}

.rank-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.7);
}

.rank-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.85);
}

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

.rank-poster span {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #8b5cf6);
  font-weight: 900;
}

.rank-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  padding: 32px 0 52px;
  border-bottom: 1px solid var(--line);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  filter: blur(10px);
  transform: scale(1.05);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.72), var(--bg));
}

.detail-hero .container {
  position: relative;
  z-index: 1;
}

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

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

.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), rgba(2, 6, 23, 0.48));
  cursor: pointer;
}

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

.player-start {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue-dark);
  font-size: 2rem;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
}

.detail-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-soft);
}

.detail-card img {
  width: 100%;
  border-radius: 18px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  padding: 54px 0 10px;
}

.detail-main {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.62);
}

.detail-main h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.detail-main h2 {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.detail-main p {
  color: var(--muted-strong);
}

.detail-tags {
  margin: 22px 0;
}

.side-reel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 12px;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.7);
}

.compact-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  transition: background 0.2s ease;
}

.compact-card:hover {
  background: rgba(148, 163, 184, 0.1);
}

.compact-card img {
  width: 58px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
  grid-row: span 2;
}

.compact-card span {
  font-weight: 800;
}

.compact-card small {
  color: var(--muted);
}

.site-footer {
  margin-top: 40px;
  padding: 44px 0 24px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer-links a {
  color: var(--muted-strong);
}

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

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

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

  .ranking-panel,
  .side-reel {
    position: static;
  }

  .detail-card {
    display: none;
  }
}

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

  .menu-toggle {
    display: block;
  }

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

  .hero-content {
    padding: 96px 0 230px;
    margin-left: 16px;
  }

  .hero-thumbs {
    grid-template-columns: 1fr;
    bottom: 24px;
  }

  .hero-thumb:nth-child(n+4) {
    display: none;
  }

  .home-search,
  .filter-panel,
  .filter-controls,
  .footer-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

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

  .header-inner {
    height: 64px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .movie-grid,
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 88px 1fr;
  }

  .quick-search,
  .section-block {
    padding: 36px 0;
  }

  .detail-main {
    padding: 18px;
  }
}
