:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.84);
  --bg-card-strong: rgba(30, 41, 59, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(251, 191, 36, 0.35);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --amber: #fbbf24;
  --amber-2: #f59e0b;
  --shadow: 0 28px 80px rgba(2, 6, 23, 0.55);
  --radius: 24px;
}

* {
  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.15), transparent 28rem),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.10), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

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

.header-inner {
  max-width: 1240px;
  height: 68px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: linear-gradient(135deg, var(--amber), #fde68a);
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.28);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
}

.main-nav a {
  position: relative;
  padding: 22px 0;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--amber);
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 15px;
  height: 2px;
  border-radius: 999px;
  background: var(--amber);
}

.top-search {
  width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}

.top-search input,
.filters input,
.filters select {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.top-search input {
  padding: 8px 10px;
}

.top-search button,
.filters button {
  border: 0;
  cursor: pointer;
  color: #111827;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.hero-carousel {
  position: relative;
  height: min(720px, 74vh);
  min-height: 520px;
  overflow: hidden;
  background: #020617;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease, transform 900ms ease;
  transform: scale(1.02);
}

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

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

.hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.15) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.18) 42%, rgba(2, 6, 23, 0.10) 100%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1240px) / 2));
  bottom: 80px;
  width: min(720px, calc(100% - 48px));
}

.hero-badges,
.detail-meta,
.card-meta,
.detail-tags,
.tag-row,
.footer-tags,
.quick-inner,
.related-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-badges span,
.detail-tags span,
.tag-row span,
.footer-tags span,
.quick-inner a,
.related-nav a {
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 999px;
  padding: 6px 11px;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.10);
  font-size: 13px;
}

.hero-content h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 22px);
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.btn.primary {
  color: #111827;
  background: linear-gradient(135deg, var(--amber), #fde68a);
  box-shadow: 0 16px 36px rgba(251, 191, 36, 0.25);
}

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

.btn.ghost:hover {
  border-color: var(--line-strong);
  background: rgba(30, 41, 59, 0.88);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(12px);
  font-size: 40px;
  line-height: 1;
  transform: translateY(-50%);
}

.hero-arrow:hover {
  color: #111827;
  background: var(--amber);
}

.hero-arrow.prev {
  left: 22px;
}

.hero-arrow.next {
  right: 22px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.42);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 34px;
  background: var(--amber);
}

.quick-categories {
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.54);
}

.quick-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px;
}

.quick-inner > span {
  color: var(--soft);
  font-weight: 700;
}

.content-section,
.page-hero,
.detail-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 58px 20px;
}

.page-main {
  min-height: 62vh;
}

.slim-hero {
  padding-top: 70px;
  padding-bottom: 38px;
}

.page-hero > div,
.detail-info,
.detail-text,
.soft-panel,
.search-panel,
.home-category-block,
.rank-hero-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.84), rgba(30, 41, 59, 0.50));
  box-shadow: var(--shadow);
}

.page-hero > div {
  padding: clamp(28px, 5vw, 56px);
}

.page-hero p:first-child,
.section-heading p {
  margin: 0 0 8px;
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.page-hero h1,
.section-heading h2,
.detail-info h1 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

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

.page-hero p:last-child {
  max-width: 860px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

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

.section-heading h2 {
  font-size: clamp(26px, 3vw, 38px);
}

.plain-link {
  color: var(--amber);
  font-weight: 800;
}

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

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

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

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

.movie-card {
  content-visibility: auto;
  contain-intrinsic-size: 420px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.34);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-6px);
  box-shadow: 0 26px 72px rgba(2, 6, 23, 0.58);
}

.card-link {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.7);
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.movie-card:hover .poster-wrap img,
.rank-hero-card:hover img {
  transform: scale(1.06);
}

.score-pill,
.rank-badge {
  position: absolute;
  top: 12px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
}

.score-pill {
  right: 12px;
  color: #111827;
  background: var(--amber);
  padding: 7px 9px;
}

.rank-badge {
  left: 12px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 11px;
}

.card-body {
  padding: 16px;
}

.card-meta {
  color: var(--soft);
  font-size: 12px;
}

.card-meta span + span::before {
  content: "•";
  margin-right: 9px;
  color: rgba(148, 163, 184, 0.55);
}

.card-body h3 {
  margin: 10px 0 8px;
  font-size: 19px;
  line-height: 1.28;
}

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

.tag-row span {
  color: #fef3c7;
  font-size: 12px;
  padding: 4px 8px;
}

.small-card .card-body h3 {
  font-size: 17px;
}

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

.category-tile {
  min-height: 160px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(251, 191, 36, 0.10), rgba(15, 23, 42, 0.88)),
    var(--bg-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.category-tile span {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

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

.home-category-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

.home-category-block {
  padding: 24px;
}

.block-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.block-title h2 {
  margin: 0;
  font-size: 28px;
}

.block-title a {
  color: var(--amber);
  font-weight: 800;
}

.home-category-block > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.center-more {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
}

.filters input,
.filters select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(2, 6, 23, 0.34);
}

.filters select option {
  color: #111827;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--bg-card);
}

.rank-hero-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.rank-hero-card {
  position: relative;
  padding: 14px;
  overflow: hidden;
}

.rank-hero-card span {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: var(--amber);
  font-weight: 900;
}

.rank-hero-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.rank-hero-card h2 {
  margin: 14px 0 6px;
  font-size: 18px;
}

.rank-hero-card p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.detail-main {
  min-height: 60vh;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 34px;
  align-items: center;
  padding-top: 54px;
}

.detail-poster {
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

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

.detail-info {
  padding: clamp(24px, 4vw, 44px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--soft);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--amber);
}

.detail-info h1 {
  font-size: clamp(34px, 5vw, 64px);
}

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

.detail-meta {
  margin: 18px 0;
  color: var(--text);
  font-weight: 700;
}

.detail-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(15, 23, 42, 0.58);
}

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

.related-nav {
  margin-top: 18px;
}

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

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  cursor: pointer;
  color: var(--text);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.16), rgba(2, 6, 23, 0.64));
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-icon {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: linear-gradient(135deg, var(--amber), #fde68a);
  font-size: 34px;
  box-shadow: 0 24px 60px rgba(251, 191, 36, 0.34);
}

.player-overlay span:last-child {
  font-size: 20px;
  font-weight: 900;
}

.detail-text {
  padding: 32px;
}

.detail-text p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

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

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 20px 30px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 34px;
}

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

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 17px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 8px;
}

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

.copyright {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .top-search {
    display: none;
  }

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .listing-grid,
  .category-tile-grid,
  .rank-hero-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .header-inner {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    display: none;
    order: 3;
    width: 100%;
    margin-left: 0;
    padding: 10px 0 4px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .main-nav a {
    padding: 5px 0;
  }

  .main-nav a.active::after {
    display: none;
  }

  .hero-carousel {
    height: 72vh;
    min-height: 560px;
  }

  .hero-layer {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.70) 54%, rgba(2, 6, 23, 0.10) 100%);
  }

  .hero-content {
    left: 20px;
    bottom: 72px;
    width: calc(100% - 40px);
  }

  .hero-arrow {
    display: none;
  }

  .content-section,
  .page-hero,
  .detail-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .listing-grid,
  .category-tile-grid,
  .rank-hero-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-body {
    padding: 13px;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 360px;
    margin: 0 auto;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 36px;
  }

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .listing-grid,
  .category-tile-grid,
  .rank-hero-list {
    grid-template-columns: 1fr;
  }

  .poster-wrap {
    aspect-ratio: 16 / 11;
  }

  .detail-poster .poster-wrap,
  .detail-poster img {
    aspect-ratio: 2 / 3;
  }
}
