:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --bg-card: #172033;
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --muted-2: #94a3b8;
  --gold: #f59e0b;
  --gold-2: #fb923c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 46%, #0f172a 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

.media-img.is-broken {
  opacity: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.28);
  color: #fff;
  font-size: 15px;
}

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

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

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

.nav-link.active::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--gold);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(51, 65, 85, 0.88);
  color: #fff;
  font-size: 24px;
}

.mobile-nav {
  display: none;
  padding: 12px 16px 18px;
  border-top: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.98);
}

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

.mobile-link {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.72);
}

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

.hero-slider {
  position: relative;
  height: 610px;
  overflow: hidden;
  background: #020617;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease;
}

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

.hero-bg,
.detail-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.25), transparent 40%), #0f172a;
}

.hero-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.82) 34%, rgba(15, 23, 42, 0.2) 100%);
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 76px;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hero-content h1,
.hero-content h2.hero-movie-title,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  font-weight: 900;
  line-height: 1.05;
  text-wrap: balance;
}

.hero-content h1 {
  font-size: clamp(38px, 6vw, 78px);
}

.hero-movie-title {
  margin-top: 8px !important;
  font-size: clamp(32px, 4.6vw, 62px);
}

.hero-content p {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-meta span,
.detail-meta span,
.card-tags span,
.tag-row span,
.genre-row span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(10px);
}

.hero-meta span,
.detail-meta span {
  padding: 7px 13px;
  font-weight: 700;
}

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

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #fff;
  box-shadow: 0 18px 34px rgba(245, 158, 11, 0.28);
}

.btn-primary:hover,
.btn-ghost:hover,
.section-more:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-ghost,
.section-more {
  background: rgba(30, 41, 59, 0.82);
  color: #fff;
  border: 1px solid var(--line);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  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.is-active {
  width: 32px;
  background: var(--gold);
}

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

.content-section {
  margin-bottom: 64px;
}

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

.section-head h2,
.player-section h2,
.prose-section h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 900;
}

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

.movie-grid {
  display: grid;
  gap: 18px;
}

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

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

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

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

.scroll-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 290px);
  gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
}

.movie-card {
  min-width: 0;
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.86);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
  scroll-snap-align: start;
}

.movie-card:hover {
  transform: translateY(-5px) scale(1.015);
  background: rgba(40, 52, 73, 0.95);
  box-shadow: var(--shadow);
}

.card-link,
.card-body {
  display: block;
}

.poster-shell {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(245, 158, 11, 0.26), transparent 34%), #111827;
}

.featured-card .poster-shell {
  aspect-ratio: 16 / 10;
}

.poster-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

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

.card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent 66%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.movie-card:hover .card-shade {
  opacity: 1;
}

.card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.82);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

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

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.card-body {
  padding: 15px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  margin-bottom: 8px;
}

.card-tags span,
.tag-row span,
.genre-row span {
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-body strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 17px;
  line-height: 1.35;
}

.card-line {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: block;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 13px;
}

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

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

.category-card {
  min-height: 118px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.84));
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(30, 41, 59, 0.94));
}

.category-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 21px;
}

.category-card span {
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.6;
}

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

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

.rank-item a {
  display: grid;
  grid-template-columns: 54px 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.72);
  transition: transform 0.25s ease, background 0.25s ease;
}

.rank-item a:hover {
  transform: translateY(-3px);
  background: rgba(51, 65, 85, 0.82);
}

.rank-no {
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.rank-item img {
  width: 92px;
  height: 66px;
  object-fit: cover;
  border-radius: 14px;
  background: #111827;
}

.rank-info strong,
.rank-info em,
.rank-info span {
  display: block;
}

.rank-info strong {
  font-size: 17px;
}

.rank-info em {
  margin: 5px 0;
  color: var(--muted-2);
  font-style: normal;
  font-size: 13px;
}

.rank-info span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 16% 16%, rgba(245, 158, 11, 0.28), transparent 36%), linear-gradient(135deg, #111827, #0f172a);
}

.compact-hero {
  padding: 86px 0 76px;
}

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

.page-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
}

.page-hero p {
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 800;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
  padding: 0 14px;
  outline: none;
}

.filter-card[hidden] {
  display: none !important;
}

.detail-hero {
  min-height: 520px;
}

.detail-bg,
.detail-layer {
  position: absolute;
  inset: 0;
}

.detail-layer {
  background: linear-gradient(90deg, #0f172a 0%, rgba(15, 23, 42, 0.86) 50%, rgba(15, 23, 42, 0.42) 100%), linear-gradient(0deg, #0f172a, transparent 45%);
}

.detail-inner {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  min-height: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
  padding: 70px 0;
}

.detail-poster {
  border-radius: 26px;
  overflow: hidden;
  background: #111827;
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

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

.detail-one-line {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.tag-row,
.genre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-wrap {
  padding-top: 42px;
}

.player-section {
  margin-bottom: 52px;
}

.player-section h2 {
  margin-bottom: 18px;
}

.player-box {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.player-box video {
  width: 100%;
  height: 100%;
  display: block;
  background: #020617;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.24), rgba(2, 6, 23, 0.74));
  color: #fff;
  cursor: pointer;
}

.player-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.big-play {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 18px 38px rgba(245, 158, 11, 0.35);
  font-size: 34px;
}

.player-cover strong {
  font-size: 20px;
}

.prose-section {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(30, 41, 59, 0.72);
}

.prose-section p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 2;
}

.small-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.small-poster {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: #111827;
}

.small-poster img {
  width: 82px;
  height: 60px;
  object-fit: cover;
}

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

.small-card em {
  color: var(--muted-2);
  font-style: normal;
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #0f172a;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.footer-brand {
  display: inline-block;
  margin-bottom: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.footer-inner p,
.copyright {
  color: var(--muted-2);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
}

.footer-links a {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.78);
  color: var(--muted);
}

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 28px;
  font-size: 14px;
}

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

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

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero-slider {
    height: 590px;
  }

  .hero-content {
    bottom: 70px;
  }

  .hero-arrow {
    display: none;
  }

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

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

  .library-grid,
  .home-grid,
  .three-grid,
  .related-grid,
  .wide-rank {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .detail-inner {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .detail-poster {
    width: 220px;
  }
}

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

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

  .hero-slider {
    height: 620px;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-movie-title {
    font-size: 34px;
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .movie-grid,
  .library-grid,
  .home-grid,
  .three-grid,
  .related-grid,
  .category-grid,
  .compact-category-grid,
  .wide-rank {
    grid-template-columns: 1fr;
  }

  .rank-item a {
    grid-template-columns: 44px 80px minmax(0, 1fr);
  }

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

  .detail-poster {
    width: 190px;
  }
}
