:root {
  color-scheme: dark;
  --bg: #0b1018;
  --bg-soft: #111827;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: rgba(17, 24, 39, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --amber: #f59e0b;
  --amber-strong: #d97706;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  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.18), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(239, 68, 68, 0.12), transparent 26rem),
    linear-gradient(180deg, #111827 0%, #0b1018 44%, #020617 100%);
  color: var(--text);
}

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

button,
input {
  font: inherit;
}

.shell,
.nav-shell,
.footer-grid {
  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);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--amber), var(--red));
  color: #fff;
  box-shadow: 0 14px 36px rgba(245, 158, 11, 0.32);
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
  flex: 1;
}

.main-nav a {
  transition: color 0.2s ease;
  white-space: nowrap;
}

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

.nav-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.nav-search input {
  width: 180px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 10px 12px 10px 16px;
}

.nav-search button,
.search-panel button {
  border: 0;
  color: #fff;
  background: var(--amber);
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-search button:hover,
.search-panel button:hover {
  background: var(--amber-strong);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.hero {
  position: relative;
  height: min(760px, 78vh);
  min-height: 560px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

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

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.62) 44%, rgba(2, 6, 23, 0.22) 100%),
    linear-gradient(0deg, rgba(11, 16, 24, 1) 0%, rgba(11, 16, 24, 0) 48%);
}

.hero-content {
  position: absolute;
  left: max(32px, calc((100vw - 1180px) / 2));
  bottom: 92px;
  width: min(720px, calc(100% - 64px));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-article h1 {
  margin: 18px 0 16px;
  line-height: 1.04;
  font-size: clamp(38px, 7vw, 72px);
}

.hero p,
.page-hero p {
  max-width: 700px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 21px);
  line-height: 1.75;
}

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

.hero-tags span,
.detail-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.card-action a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 800;
}

.primary-btn,
.card-action a {
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--red));
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.26);
}

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

.primary-btn.full {
  width: 100%;
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  font-size: 32px;
  cursor: pointer;
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

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

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

.quick-cats {
  margin-top: -44px;
  position: relative;
  z-index: 4;
}

.quick-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.quick-card,
.category-tile,
.movie-card,
.wide-item,
.side-card,
.detail-article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quick-card {
  padding: 20px;
  min-height: 126px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.quick-card:hover,
.movie-card:hover,
.wide-item:hover,
.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.55);
}

.quick-card strong,
.category-tile strong {
  display: block;
  font-size: 19px;
  margin-bottom: 8px;
}

.quick-card span,
.category-tile em {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
  font-style: normal;
}

.content-section {
  padding: 68px 0 0;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
}

.section-more {
  color: var(--amber);
  font-weight: 800;
}

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

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

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

.movie-card {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2937, #020617);
}

.poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.35s ease;
}

.movie-card:hover .poster {
  transform: scale(1.07);
}

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

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--amber), var(--red));
  color: #fff;
  z-index: 3;
}

.card-body {
  padding: 16px;
}

.card-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--soft);
  font-size: 13px;
}

.movie-card h2,
.wide-item h2,
.side-card h2 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.movie-card p,
.wide-item p,
.side-card p {
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  color: var(--amber);
  font-weight: 700;
}

.card-action a {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.scroll-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 18px;
  scroll-snap-type: x mandatory;
}

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

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

.wide-item {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 18px;
  padding: 14px;
}

.wide-poster,
.side-cover,
.category-cover {
  display: block;
  background-size: cover;
  background-position: center;
  background-color: #111827;
}

.wide-poster {
  min-height: 190px;
  border-radius: 16px;
}

.page-main {
  padding: 48px 0 76px;
}

.page-hero {
  position: relative;
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(239, 68, 68, 0.08)),
    rgba(17, 24, 39, 0.78);
  overflow: hidden;
}

.compact-hero h1,
.category-hero h1 {
  font-size: clamp(34px, 6vw, 58px);
}

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

.category-tile {
  position: relative;
  min-height: 235px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  isolation: isolate;
}

.category-cover,
.category-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.category-shade {
  z-index: -1;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.35));
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-top: 30px;
}

.rank-list .movie-card-wide {
  display: grid;
  grid-template-columns: 180px 1fr;
}

.rank-list .poster-link {
  aspect-ratio: auto;
  min-height: 240px;
}

.search-panel {
  display: flex;
  max-width: 680px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.search-panel input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 16px 20px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--soft);
  margin: 30px 0;
}

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

.detail-main {
  padding-bottom: 78px;
}

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

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

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

.play-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at center, rgba(245, 158, 11, 0.24), transparent 19rem),
    rgba(2, 6, 23, 0.42);
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--red));
  box-shadow: 0 20px 48px rgba(245, 158, 11, 0.34);
}

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

.detail-article h1 {
  font-size: clamp(32px, 5vw, 52px);
}

.detail-article h2 {
  margin: 28px 0 12px;
  color: #fff;
}

.detail-article p {
  color: var(--muted);
  line-height: 1.9;
  font-size: 17px;
}

.detail-article .lead {
  font-size: 19px;
  color: #fff;
}

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

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

.side-card {
  padding: 18px;
}

.side-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
}

.side-card h2 {
  font-size: 24px;
}

.site-footer {
  margin-top: 74px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 32px;
  color: var(--muted);
}

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

.footer-grid h2 {
  color: #fff;
  margin: 0 0 14px;
  font-size: 18px;
}

.footer-links {
  display: grid;
  gap: 9px;
}

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

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

  .nav-shell {
    justify-content: space-between;
  }

  .menu-toggle {
    display: flex;
  }

  body.menu-open .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 76px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
  }

  body.menu-open .main-nav a {
    padding: 12px;
  }

  .quick-grid,
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .player-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }
}

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

  .hero {
    height: 680px;
    min-height: 680px;
  }

  .hero-content {
    left: 20px;
    right: 20px;
    bottom: 88px;
    width: auto;
  }

  .hero-control {
    display: none;
  }

  .quick-cats {
    margin-top: 22px;
  }

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

  .page-hero {
    padding: 34px 24px;
  }

  .rank-list .movie-card-wide {
    display: block;
  }

  .rank-list .poster-link {
    aspect-ratio: 3 / 4;
  }

  .wide-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell,
  .nav-shell,
  .footer-grid {
    width: min(100% - 24px, 1180px);
  }

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

  .hero h1,
  .page-hero h1,
  .detail-article h1 {
    font-size: 34px;
  }

  .quick-grid,
  .feature-grid,
  .small-grid,
  .category-grid,
  .rank-list {
    grid-template-columns: 1fr;
  }

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

  .scroll-row {
    grid-auto-columns: 78%;
  }

  .search-panel {
    border-radius: 22px;
    flex-direction: column;
  }

  .detail-article {
    padding: 22px;
  }
}
