:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --green: #22c55e;
  --radius: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 0%, rgba(34, 211, 238, 0.17), transparent 32rem),
    radial-gradient(circle at 82% 14%, rgba(37, 99, 235, 0.18), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent 82%);
  z-index: -1;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

.logo-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.24);
  color: #fff;
  font-size: 14px;
}

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

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

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 2px;
  background: #fff;
}

.mobile-nav {
  display: none;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
}

.mobile-nav.open {
  display: grid;
}

.hero {
  position: relative;
  height: min(720px, calc(100vh - 72px));
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 108px max(24px, calc((100vw - 1200px) / 2)) 112px;
  opacity: 0;
  transform: scale(1.02);
  background-position: center;
  background-size: cover;
  transition: opacity 0.9s ease, transform 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.55), rgba(2, 6, 23, 0.18)),
    linear-gradient(0deg, var(--bg), rgba(2, 6, 23, 0.05) 46%, rgba(2, 6, 23, 0.88));
}

.hero-content {
  width: min(720px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.03;
  letter-spacing: -0.06em;
}

.hero-summary {
  max-width: 640px;
  margin: 22px 0 0;
  color: #e2e8f0;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-tags,
.tag-row,
.detail-meta,
.inline-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.hero-tags span,
.tag-row span,
.detail-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  padding: 6px 12px;
  font-size: 13px;
}

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

.primary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  box-shadow: 0 20px 46px rgba(37, 99, 235, 0.28);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover {
  transform: translateY(-2px);
}

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

.hero-dots button {
  width: 34px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.hero-dots button.active {
  background: var(--cyan);
}

.search-strip,
.section-block,
.page-main,
.site-footer {
  width: min(1200px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.search-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 24px;
  align-items: center;
  margin-top: -48px;
  position: relative;
  z-index: 4;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.search-strip h2,
.section-heading h2,
.filter-panel h2,
.story-card h2,
.next-card h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.search-strip p:not(.eyebrow),
.page-hero p,
.category-card-large p,
.story-card p,
.detail-one-line {
  color: var(--soft);
}

.home-search,
.filter-controls {
  display: flex;
  gap: 12px;
}

.home-search input,
.filter-controls input,
.filter-controls select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  background: rgba(2, 6, 23, 0.72);
  color: #fff;
  padding: 0 16px;
}

.home-search button {
  min-width: 96px;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  font-weight: 800;
}

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

.flat-top {
  padding-top: 28px;
}

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

.section-heading a,
.text-button {
  color: var(--cyan);
  font-weight: 800;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 26px 70px rgba(34, 211, 238, 0.14);
}

.card-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(37, 99, 235, 0.16));
}

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

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

.card-year,
.play-corner {
  position: absolute;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.card-year {
  left: 12px;
  padding: 0 10px;
  background: rgba(2, 6, 23, 0.66);
}

.play-corner {
  right: 12px;
  width: 28px;
  background: rgba(34, 211, 238, 0.82);
}

.card-body {
  padding: 16px;
}

.card-meta {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

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

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

.tag-row span {
  padding: 4px 9px;
  font-size: 12px;
}

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

.category-tile {
  min-height: 170px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.15), transparent),
    rgba(15, 23, 42, 0.72);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

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

.category-tile span {
  display: block;
  margin-bottom: 12px;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
}

.category-tile strong,
.category-tile em {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

.category-tile em {
  margin-top: 12px;
  color: #dbeafe;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.compact-heading h2 {
  font-size: 28px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 54px 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  padding: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  border-color: rgba(34, 211, 238, 0.42);
}

.rank-number {
  color: var(--cyan);
  font-size: 25px;
  font-weight: 900;
  text-align: center;
}

.rank-row img {
  width: 74px;
  height: 96px;
  border-radius: 13px;
  object-fit: cover;
}

.rank-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rank-info strong,
.rank-info em,
.rank-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info em {
  color: var(--cyan);
  font-size: 13px;
  font-style: normal;
}

.rank-info small {
  color: var(--muted);
}

.side-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.movie-card.compact {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
}

.movie-card.compact .card-poster {
  aspect-ratio: auto;
  min-height: 154px;
}

.movie-card.compact .card-body h3 {
  font-size: 16px;
}

.page-main {
  padding: 46px 0 72px;
}

.page-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(37, 99, 235, 0.08)),
    rgba(15, 23, 42, 0.78);
  padding: clamp(32px, 6vw, 68px);
  box-shadow: var(--shadow);
}

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

.inline-link-row {
  margin-top: 22px;
}

.inline-link-row a {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 7px 12px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 22px;
  align-items: center;
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
  padding: 22px;
}

.category-large-grid {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.category-card-large {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  padding: 20px;
}

.poster-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 180px;
}

.poster-stack img {
  height: 100%;
  min-height: 180px;
  border-radius: 16px;
  object-fit: cover;
}

.category-card-large h2 {
  margin: 0;
  font-size: 30px;
}

.category-card-large ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.category-card-large li a {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #dbeafe;
  padding: 6px 10px;
  font-size: 13px;
}

.empty-state {
  display: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.empty-state.show {
  display: block;
}

.is-hidden {
  display: none !important;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
}

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

.detail-main {
  padding-top: 28px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: stretch;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

.movie-player,
.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.movie-player {
  object-fit: contain;
  background: #000;
}

.player-cover {
  display: grid;
  place-items: center;
  border: 0;
  background-position: center;
  background-size: cover;
  cursor: pointer;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.player-cover-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 34%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.38));
}

.big-play {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  font-size: 30px;
  box-shadow: 0 18px 50px rgba(34, 211, 238, 0.35);
}

.detail-info {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.76);
  padding: 28px;
}

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

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

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 28px;
}

.story-card,
.next-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  padding: 26px;
}

.story-card h2:not(:first-child) {
  margin-top: 24px;
}

.next-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.next-card a {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  padding: 12px;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 42px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 30px;
}

.footer-brand p {
  max-width: 560px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.footer-links a {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--soft);
  padding: 8px 12px;
}

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

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

  .two-column,
  .detail-hero,
  .detail-content-grid,
  .search-strip,
  .filter-panel,
  .footer-inner {
    grid-template-columns: 1fr;
  }

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

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

  .menu-button {
    display: block;
  }

  .hero {
    min-height: 620px;
  }

  .hero-slide {
    padding: 92px 20px 92px;
  }

  .hero h1,
  .page-hero h1,
  .detail-info h1 {
    letter-spacing: -0.035em;
  }

  .search-strip,
  .page-main,
  .section-block,
  .site-footer {
    width: min(100% - 24px, 1200px);
  }

  .home-search,
  .filter-controls,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .movie-grid,
  .category-grid,
  .side-card-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .rank-row {
    grid-template-columns: 42px 64px minmax(0, 1fr);
  }

  .rank-row img {
    width: 64px;
    height: 84px;
  }

  .player-shell {
    border-radius: 20px;
  }

  .detail-info,
  .story-card,
  .next-card {
    padding: 20px;
  }
}
