:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: rgba(15, 18, 31, 0.86);
  --panel-strong: rgba(20, 24, 40, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #aeb7c9;
  --soft: #d8deea;
  --gold: #f4bf46;
  --gold-strong: #ff9f1c;
  --red: #ff4d67;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(244, 191, 70, 0.22), transparent 34rem),
    radial-gradient(circle at top right, rgba(255, 77, 103, 0.18), transparent 30rem),
    linear-gradient(135deg, #080a12 0%, #11172a 48%, #080a12 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

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

.header-inner,
.footer-inner,
.page-shell,
.hero-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.logo-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #14120a;
  box-shadow: 0 16px 36px rgba(244, 191, 70, 0.28);
}

.logo-text {
  font-size: 1.18rem;
}

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

.desktop-nav a,
.mobile-nav a,
.footer-links a {
  color: var(--soft);
  text-decoration: none;
  border-radius: 999px;
  transition: 0.2s ease;
}

.desktop-nav a,
.mobile-nav a {
  padding: 10px 15px;
  font-weight: 700;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a.is-active {
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #ffd56d);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

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

.mobile-nav {
  display: none;
  flex-direction: column;
  align-items: stretch;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

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

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

.hero-slide {
  display: none;
  min-height: 650px;
  padding: 74px 0 58px;
  background-image:
    linear-gradient(90deg, rgba(8, 10, 18, 0.95) 0%, rgba(8, 10, 18, 0.75) 42%, rgba(8, 10, 18, 0.34) 70%, rgba(8, 10, 18, 0.82) 100%),
    linear-gradient(0deg, rgba(8, 10, 18, 1), rgba(8, 10, 18, 0.18) 42%, rgba(8, 10, 18, 0.94)),
    var(--hero-image);
  background-position: center;
  background-size: cover;
}

.hero-slide.is-active {
  display: block;
  animation: heroFade 0.45s ease both;
}

@keyframes heroFade {
  from {
    opacity: 0.28;
    transform: scale(1.012);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  min-height: 516px;
}

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

.eyebrow,
.meta-pill,
.tag-row span,
.category-badge,
.play-chip,
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.eyebrow {
  gap: 10px;
  padding: 8px 13px;
  margin-bottom: 18px;
  background: rgba(244, 191, 70, 0.16);
  border: 1px solid rgba(244, 191, 70, 0.32);
  color: #ffe5a3;
  font-weight: 800;
}

.hero-copy h1,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
}

.hero-copy p {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.85;
}

.hero-actions,
.detail-actions,
.search-bar,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions,
.detail-actions {
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  transition: 0.2s ease;
}

.btn-primary {
  color: #121212;
  background: linear-gradient(135deg, var(--gold), #ffd66d);
  box-shadow: 0 18px 42px rgba(244, 191, 70, 0.24);
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

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

.hero-poster {
  position: relative;
  align-self: stretch;
}

.hero-poster-card {
  position: relative;
  overflow: hidden;
  min-height: 450px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

.hero-poster-card img {
  position: absolute;
  inset: 0;
}

.hero-poster-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(8, 10, 18, 0.92), transparent 58%);
}

.hero-poster-info {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  z-index: 2;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(14px);
}

.hero-poster-info strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.hero-poster-info span {
  color: var(--muted);
}

.hero-controls {
  position: absolute;
  right: calc((100vw - min(1180px, calc(100vw - 32px))) / 2);
  bottom: 28px;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 42px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.hero-dot.is-active {
  background: var(--gold);
}

.page-shell {
  padding: 48px 0 72px;
}

.page-hero {
  margin-bottom: 34px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.page-hero p {
  max-width: 850px;
  margin-top: 15px;
  color: var(--soft);
  line-height: 1.85;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 950;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-more {
  color: #ffe19a;
  text-decoration: none;
  font-weight: 800;
}

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

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

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

.movie-card.hidden {
  display: none;
}

.movie-card a {
  display: block;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  transition: 0.2s ease;
}

.movie-card a:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 191, 70, 0.38);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
}

.poster-frame {
  position: relative;
  aspect-ratio: 3 / 4.25;
  overflow: hidden;
  margin: 0;
  background: linear-gradient(135deg, rgba(244, 191, 70, 0.12), rgba(255, 77, 103, 0.08));
}

.poster-frame::after {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  content: "";
  background: linear-gradient(0deg, rgba(8, 10, 18, 0.88), transparent);
}

.play-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 7px 12px;
  color: #111827;
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #fff2bd);
  font-weight: 950;
}

.card-body {
  padding: 15px;
}

.meta-row {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.movie-card h3 {
  display: -webkit-box;
  min-height: 2.7em;
  margin: 8px 0;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-card p {
  display: -webkit-box;
  min-height: 4.65em;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span,
.meta-pill,
.category-badge {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffe6a7;
  background: rgba(244, 191, 70, 0.1);
  font-size: 0.76rem;
  font-weight: 800;
}

.tag-row span {
  padding: 5px 8px;
}

.meta-pill,
.category-badge {
  padding: 7px 11px;
}

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

.category-card {
  display: block;
  min-height: 180px;
  padding: 24px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(244, 191, 70, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 191, 70, 0.42);
}

.category-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.35rem;
}

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

.search-panel {
  display: grid;
  gap: 14px;
  margin: 26px 0 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.search-bar input,
.filter-row select {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 10, 18, 0.72);
  outline: none;
}

.search-bar input {
  flex: 1 1 260px;
  padding: 0 18px;
}

.filter-row select {
  min-width: 140px;
  padding: 0 14px;
}

.empty-state {
  display: none;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.ranking-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.ranking-list,
.mini-list,
.content-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.ranking-list {
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 56px 76px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-number,
.mini-rank {
  color: var(--gold);
  font-weight: 950;
}

.rank-row img {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
}

.rank-row strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.rank-row p,
.rank-row em {
  color: var(--muted);
  font-style: normal;
}

.rank-row p {
  max-width: 660px;
  margin: 0;
  line-height: 1.5;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(90deg, rgba(8, 10, 18, 0.95), rgba(8, 10, 18, 0.70), rgba(8, 10, 18, 0.95)),
    var(--detail-image);
  background-position: center;
  background-size: cover;
}

.detail-hero-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 34px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 3 / 4.25;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: #ffe5a3;
  text-decoration: none;
}

.detail-title h1 {
  font-size: clamp(2.2rem, 5vw, 5rem);
}

.detail-title p {
  max-width: 820px;
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.85;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

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

.player-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-box video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.play-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(8, 10, 18, 0.76), rgba(8, 10, 18, 0.18));
  cursor: pointer;
}

.play-mask.is-hidden {
  display: none;
}

.play-button {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #fff0b6);
  box-shadow: 0 18px 60px rgba(244, 191, 70, 0.36);
  font-size: 2rem;
}

.content-panel {
  margin-top: 22px;
  padding: 26px;
}

.content-panel h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  font-weight: 950;
}

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

.side-panel {
  position: sticky;
  top: 96px;
  align-self: start;
}

.side-panel h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 950;
}

.mini-list {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.mini-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.mini-card:last-child {
  border-bottom: 0;
}

.mini-card img {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
}

.mini-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mini-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.86);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0;
}

.footer-inner p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.footer-links a {
  padding: 8px 0;
}

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

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

  .hero-poster-card {
    min-height: 380px;
  }

  .detail-poster {
    max-width: 320px;
  }

  .side-panel {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero-carousel,
  .hero-slide {
    min-height: auto;
  }

  .hero-slide {
    padding: 42px 0 70px;
  }

  .hero-shell {
    min-height: auto;
    gap: 24px;
  }

  .hero-poster-card {
    min-height: 320px;
    border-radius: 24px;
  }

  .hero-controls {
    right: 16px;
    left: 16px;
    justify-content: center;
  }

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

  .category-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 24px;
  }

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

  .rank-row {
    grid-template-columns: 36px 58px 1fr;
  }

  .rank-row .rank-meta {
    display: none;
  }

  .detail-hero-inner {
    padding: 34px 0;
  }

  .content-panel {
    padding: 21px;
  }
}

@media (max-width: 470px) {
  .header-inner,
  .footer-inner,
  .page-shell,
  .hero-shell,
  .detail-hero-inner {
    width: min(100% - 22px, 1180px);
  }

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

  .hero-copy h1,
  .detail-title h1 {
    font-size: 2.3rem;
  }
}
