:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-2: #fb923c;
  --radius: 24px;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.14), transparent 34rem),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input {
  font: inherit;
}

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

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff7ed;
  font-size: 13px;
  box-shadow: 0 12px 34px rgba(245, 158, 11, 0.28);
}

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

.nav-link,
.mobile-link {
  color: var(--soft);
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

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

.mobile-toggle span {
  width: 19px;
  height: 2px;
  background: currentColor;
  border-radius: 99px;
}

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

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

.mobile-link {
  padding: 12px 14px;
  border-radius: 12px;
}

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

.hero {
  position: relative;
  min-height: 620px;
  margin: 28px 0 58px;
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(280px, 0.52fr);
  gap: 34px;
  align-items: center;
  padding: 76px;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 0.58s ease, transform 0.58s ease;
}

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

.hero-bg,
.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.08);
}

.hero-bg::after,
.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(251, 191, 36, 0.18), transparent 24rem),
    linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent 45%);
}

.hero-content,
.hero-poster,
.hero-controls,
.hero-search,
.detail-poster,
.detail-copy {
  position: relative;
  z-index: 2;
}

.hero-kicker,
.detail-kicker,
.page-hero span,
.section-heading span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fbbf24;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
  margin: 14px 0 18px;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero p,
.page-hero p,
.detail-one-line {
  max-width: 680px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.8;
}

.hero-tags,
.tag-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.56);
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
}

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

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

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

.button.primary {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.25);
}

.button.ghost {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.62);
  color: var(--text);
}

.hero-poster {
  justify-self: end;
  width: min(360px, 100%);
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.56);
  transform: rotate(2deg);
}

.hero-poster img,
.poster-link img,
.detail-poster img,
.rank-item img,
.player-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-controls {
  position: absolute;
  left: 76px;
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-arrow,
.hero-dot {
  border: 0;
  cursor: pointer;
  color: var(--text);
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  font-size: 28px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: rgba(203, 213, 225, 0.4);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 28px;
  background: #f59e0b;
}

.hero-search,
.panel-search {
  display: flex;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  padding: 8px;
  backdrop-filter: blur(12px);
}

.hero-search {
  position: absolute;
  right: 46px;
  bottom: 38px;
  width: min(420px, calc(100% - 92px));
}

.hero-search input,
.panel-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
}

.hero-search button,
.panel-search button {
  border: 0;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-weight: 900;
  padding: 10px 18px;
  cursor: pointer;
}

.section {
  margin: 54px 0;
}

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

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(25px, 3.4vw, 36px);
  letter-spacing: -0.05em;
}

.section-heading a {
  color: #fbbf24;
  font-weight: 900;
}

.section-heading.slim {
  align-items: start;
}

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.64));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(251, 191, 36, 0.48);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0f172a;
}

.poster-link img {
  transition: transform 0.4s ease, filter 0.4s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.06);
  filter: saturate(1.08);
}

.poster-glow {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), transparent);
}

.poster-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
}

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

.card-meta {
  display: flex;
  gap: 8px;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.movie-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.movie-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact .movie-card-body {
  padding: 13px;
}

.compact h3 {
  font-size: 16px;
}

.compact p {
  -webkit-line-clamp: 1;
}

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

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

.category-card {
  position: relative;
  min-height: 172px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
}

.category-card:hover {
  border-color: rgba(251, 191, 36, 0.42);
}

.category-orb {
  position: absolute;
  right: -28px;
  top: -38px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  filter: blur(1px) saturate(1.16);
}

.category-card strong {
  position: relative;
  display: block;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.category-card p {
  position: relative;
  max-width: 78%;
  color: var(--muted);
  line-height: 1.7;
}

.category-card em {
  position: relative;
  color: #fbbf24;
  font-style: normal;
  font-weight: 900;
}

.movie-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x proximity;
}

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

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.rank-panel,
.content-panel,
.info-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.76);
  padding: 22px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
}

.rank-list,
.rank-full-list {
  display: grid;
  gap: 12px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 48px 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.4);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(251, 191, 36, 0.38);
}

.rank-number {
  color: #f59e0b;
  font-size: 20px;
  font-weight: 1000;
  text-align: center;
}

.rank-item img {
  width: 58px;
  height: 80px;
  border-radius: 12px;
}

.rank-copy {
  display: grid;
  min-width: 0;
}

.rank-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-copy em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-hero {
  position: relative;
  min-height: 260px;
  margin: 28px 0 34px;
  padding: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(51, 65, 85, 0.42)),
    radial-gradient(circle at right, rgba(245, 158, 11, 0.2), transparent 24rem);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.small-hero h1,
.rank-hero h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fbbf24;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--soft);
  padding: 10px 15px;
  font-weight: 900;
  cursor: pointer;
}

.filter-row button.is-active,
.filter-row button:hover {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.34);
}

[data-search-card].is-hidden {
  display: none;
}

.detail-shell {
  padding-bottom: 20px;
}

.detail-hero {
  position: relative;
  min-height: 540px;
  margin: 22px 0 34px;
  padding: 54px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
}

.detail-copy h1 {
  font-size: clamp(38px, 5.8vw, 72px);
}

.detail-meta {
  margin-top: 18px;
}

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

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

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

.player-card video {
  background: #000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle at center, rgba(245, 158, 11, 0.2), transparent 19rem),
    linear-gradient(0deg, rgba(2, 6, 23, 0.44), rgba(2, 6, 23, 0.08));
  cursor: pointer;
}

.play-overlay span {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 36px;
  box-shadow: 0 18px 48px rgba(245, 158, 11, 0.34);
}

.player-card.is-playing .play-overlay {
  opacity: 0;
  pointer-events: none;
}

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

.content-panel h2,
.info-panel h2 {
  margin: 0 0 14px;
  letter-spacing: -0.04em;
}

.content-panel p {
  color: var(--soft);
  line-height: 1.95;
  margin: 0 0 22px;
}

.info-panel dl {
  margin: 0;
  display: grid;
  gap: 13px;
}

.info-panel div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.info-panel dt {
  color: var(--muted);
}

.info-panel dd {
  margin: 0;
  color: var(--text);
}

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

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  margin-bottom: 12px;
}

.site-footer p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 18px;
  color: #fbbf24;
  font-weight: 900;
}

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

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

  .hero-slide {
    padding: 54px;
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

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

  .mobile-toggle {
    display: flex;
  }

  .hero {
    min-height: 760px;
    border-radius: 26px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 34px;
    align-content: start;
  }

  .hero-poster {
    justify-self: start;
    width: 220px;
    transform: none;
  }

  .hero-controls {
    left: 34px;
    bottom: 114px;
  }

  .hero-search {
    left: 28px;
    right: 28px;
    bottom: 34px;
    width: auto;
  }

  .page-hero {
    display: grid;
    padding: 30px;
  }

  .panel-search {
    width: 100%;
  }

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

  .detail-hero {
    padding: 32px;
  }

  .detail-poster {
    width: min(260px, 100%);
  }

  .rank-full-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .home-shell,
  .page-shell,
  .header-inner,
  .mobile-nav,
  .footer-inner {
    width: min(100% - 22px, 1200px);
  }

  .header-inner {
    height: 64px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .hero {
    min-height: 710px;
    margin-top: 16px;
  }

  .hero-slide {
    padding: 24px;
  }

  .hero h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: 38px;
  }

  .hero p,
  .page-hero p,
  .detail-one-line {
    font-size: 15px;
  }

  .hero-controls {
    left: 24px;
    bottom: 104px;
  }

  .hero-search {
    left: 18px;
    right: 18px;
    bottom: 24px;
  }

  .library-grid,
  .movie-grid,
  .mini-grid,
  .category-grid,
  .category-grid.large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .movie-card h3 {
    font-size: 15px;
  }

  .movie-card p,
  .tag-row {
    display: none;
  }

  .category-card {
    min-height: 150px;
    padding: 18px;
  }

  .category-card p {
    max-width: none;
    font-size: 13px;
  }

  .detail-hero,
  .page-hero,
  .content-panel,
  .info-panel,
  .rank-panel {
    border-radius: 22px;
    padding: 20px;
  }

  .play-overlay span {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }

  .footer-inner {
    align-items: start;
    flex-direction: column;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}
