:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(30, 41, 59, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --brand: #34d399;
  --brand-2: #22d3ee;
  --accent: #fbbf24;
  --danger: #f87171;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 8%, rgba(16, 185, 129, 0.16), transparent 34rem),
    radial-gradient(circle at 86% 12%, rgba(34, 211, 238, 0.13), transparent 30rem),
    linear-gradient(180deg, #0f172a 0%, #020617 58%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.65;
}

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

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;
  background: rgba(2, 6, 23, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 800;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #001913;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.25);
}

.logo-text {
  font-size: 20px;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--soft);
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(16, 185, 129, 0.14);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 28vw);
}

.header-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: rgba(52, 211, 153, 0.78);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.header-search button,
.primary-btn,
.secondary-btn,
.play-cover {
  border: 0;
  cursor: pointer;
}

.header-search button {
  min-width: 58px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #001913;
  background: var(--brand);
  font-weight: 700;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  margin: 5px auto;
  background: var(--text);
  border-radius: 99px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 16px;
  background: rgba(2, 6, 23, 0.94);
}

.mobile-panel.open {
  display: block;
}

.mobile-links,
.mobile-sub-grid {
  display: grid;
  gap: 8px;
}

.mobile-sub-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.mobile-sub-link {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--soft);
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-track {
  position: absolute;
  inset: 0;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  filter: saturate(1.12);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.26) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.18) 45%, rgba(2, 6, 23, 0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 48px;
  align-items: center;
  padding: 76px 0 96px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  display: block;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.hero h1 {
  margin: 0 0 18px;
  max-width: 880px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0;
}

.hero-desc {
  max-width: 720px;
  color: var(--soft);
  font-size: 18px;
}

.hero-actions,
.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.primary-btn,
.secondary-btn {
  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, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  color: #001913;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.secondary-btn {
  color: white;
  border: 1px solid rgba(226, 232, 240, 0.22);
  background: rgba(15, 23, 42, 0.54);
}

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

.hero-tags,
.card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.hero-tags span,
.card-tags span,
.detail-tags span,
.meta-pill,
.breadcrumb a,
.breadcrumb span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(52, 211, 153, 0.24);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.11);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}

.hero-poster {
  border: 1px solid rgba(226, 232, 240, 0.18);
  padding: 12px;
  border-radius: 32px;
  background: rgba(15, 23, 42, 0.48);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 24px;
}

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

.hero-dot {
  width: 34px;
  height: 6px;
  border-radius: 99px;
  border: 0;
  background: rgba(226, 232, 240, 0.34);
  cursor: pointer;
}

.hero-dot.active {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

main {
  padding-bottom: 56px;
}

.section,
.page-hero {
  padding: 64px 0 0;
}

.page-hero {
  padding-bottom: 26px;
}

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

.section-kicker {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.section h2,
.page-hero h1,
.detail-main h1 {
  margin: 0;
  letter-spacing: -0.03em;
}

.section h2,
.page-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-head p,
.page-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.section-link {
  color: var(--brand);
  font-weight: 800;
}

.grid {
  display: grid;
  gap: 22px;
}

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

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

.movie-card,
.category-tile,
.panel-card,
.detail-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.72));
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 211, 153, 0.42);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
}

.card-cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

.card-cover img {
  width: 100%;
  aspect-ratio: 3 / 4.1;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.play-dot {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #001913;
  background: rgba(52, 211, 153, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #111827;
  background: var(--accent);
  font-weight: 900;
}

.card-body {
  padding: 16px;
}

.card-meta,
.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.card-body h3 {
  margin: 8px 0 8px;
  font-size: 18px;
  line-height: 1.32;
}

.card-body h3 a:hover {
  color: var(--brand);
}

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

.category-tile {
  padding: 22px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.24s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.38);
}

.category-tile strong {
  font-size: 20px;
}

.category-tile p {
  color: var(--muted);
  margin: 10px 0 16px;
}

.category-tile span {
  color: var(--brand);
  font-weight: 800;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 28px;
}

.compact-list {
  display: grid;
  gap: 12px;
}

.compact-card {
  display: grid;
  grid-template-columns: auto 74px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.68);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.compact-card:hover {
  border-color: rgba(52, 211, 153, 0.42);
  transform: translateX(4px);
}

.compact-card img {
  width: 74px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

.compact-card strong,
.compact-card em {
  display: block;
}

.compact-card strong {
  line-height: 1.35;
}

.compact-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  margin-top: 3px;
}

.compact-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--brand);
  font-weight: 900;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 170px 150px;
  gap: 12px;
  margin: 22px 0 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.58);
}

.hidden-by-filter {
  display: none !important;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.detail-hero {
  padding: 42px 0 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 30px;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 28px;
  background: black;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.74)),
    rgba(2, 6, 23, 0.25);
  color: white;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.play-cover span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #001913;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.play-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.detail-main h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
}

.detail-meta,
.detail-tags {
  margin-top: 16px;
}

.detail-panel {
  padding: 24px;
  margin-top: 24px;
}

.detail-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-panel p {
  margin: 0;
  color: var(--soft);
  white-space: pre-line;
}

.side-poster {
  position: sticky;
  top: 96px;
}

.side-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.side-poster .panel-card {
  margin-top: 18px;
  padding: 20px;
}

.side-poster .panel-card p {
  color: var(--muted);
  margin: 8px 0 0;
}

.site-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.96));
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1fr;
  gap: 32px;
  padding: 44px 0;
}

.footer-brand p,
.site-footer a,
.site-footer li {
  color: var(--muted);
}

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

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.site-footer a:hover {
  color: var(--brand);
}

.footer-logo {
  margin-bottom: 14px;
}

.copyright {
  border-top: 1px solid var(--line);
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

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

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

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

  .hero-poster,
  .side-poster {
    display: none;
  }

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

@media (max-width: 780px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero,
  .hero-content {
    min-height: 720px;
  }

  .hero-content {
    padding: 58px 0 92px;
  }

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

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

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

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

  .compact-card {
    grid-template-columns: auto 60px minmax(0, 1fr);
  }

  .compact-card img {
    width: 60px;
  }
}
