:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-solid: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --green: #22c55e;
  --orange: #f97316;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.58);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.15), transparent 30rem),
    radial-gradient(circle at 82% 2%, rgba(59, 130, 246, 0.18), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
}

body.is-menu-open {
  overflow: hidden;
}

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

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

input,
button,
select {
  font: inherit;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.logo-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 0.85rem;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 32px rgba(34, 211, 238, 0.25);
}

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

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-link,
.mobile-link {
  border-radius: 999px;
  color: #cbd5e1;
  transition: 0.25s ease;
}

.nav-link {
  padding: 0.65rem 1rem;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: white;
  background: rgba(34, 211, 238, 0.12);
}

.menu-toggle {
  display: none;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: white;
  background: rgba(15, 23, 42, 0.8);
}

.menu-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.24rem auto;
  border-radius: 999px;
  background: white;
}

.mobile-nav {
  display: none;
  padding: 0 1.25rem 1rem;
}

.mobile-link {
  display: block;
  padding: 0.9rem 1rem;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

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

.hero-bg,
.detail-backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg {
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.62) 42%, rgba(2, 6, 23, 0.2)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.05) 55%);
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 7rem 0 9.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p,
.lead-text {
  max-width: 760px;
  color: #dbeafe;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
}

.hero-tags,
.tag-row,
.detail-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hero-tags span,
.tag-row span,
.detail-meta span,
.card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
}

.hero-actions,
.section-heading,
.filter-bar,
.search-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-actions {
  margin-top: 1.7rem;
}

.btn-primary,
.btn-secondary,
.rank-action,
.hero-search button,
.mini-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: 0.25s ease;
}

.btn-primary,
.hero-search button,
.mini-search button,
.rank-action {
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 38px rgba(34, 211, 238, 0.22);
}

.btn-primary,
.btn-secondary {
  min-height: 3rem;
  padding: 0.85rem 1.35rem;
}

.btn-secondary {
  border: 1px solid var(--line);
  color: white;
  background: rgba(15, 23, 42, 0.72);
}

.btn-primary:hover,
.btn-secondary:hover,
.rank-action:hover,
.hero-search button:hover,
.mini-search button:hover {
  transform: translateY(-2px) scale(1.02);
}

.hero-panel {
  position: absolute;
  right: max(1.25rem, calc((100vw - 1240px) / 2));
  bottom: 2rem;
  left: max(1.25rem, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hero-search,
.mini-search {
  display: flex;
  align-items: center;
  width: min(560px, 100%);
  padding: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(18px);
}

.hero-search input,
.mini-search input,
.filter-bar input,
.filter-bar select,
.search-controls input,
.search-controls select {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: white;
  outline: none;
  background: rgba(15, 23, 42, 0.92);
}

.hero-search input,
.mini-search input {
  border: 0;
  padding: 0 1rem;
  background: transparent;
}

.hero-search button,
.mini-search button {
  flex: 0 0 auto;
  min-height: 2.65rem;
  padding: 0 1.1rem;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-dot {
  width: 0.72rem;
  height: 0.72rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: 0.25s ease;
}

.hero-dot.is-active {
  width: 2.2rem;
  background: var(--cyan);
}

main {
  width: 100%;
}

.section-block {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 0;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 1.35rem;
}

.section-heading span {
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.section-heading h2 {
  flex: 1;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.section-heading a {
  color: #bae6fd;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.78));
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.24);
  transition: 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, 0.38);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f172a;
}

.movie-card-wide .poster-wrap {
  aspect-ratio: 16 / 10;
}

.poster-wrap img,
.category-card img,
.rank-poster img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .poster-wrap img,
.category-card:hover img,
.rank-row:hover .rank-poster img {
  transform: scale(1.08);
}

.poster-shade,
.category-cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgba(2, 6, 23, 0.9));
}

.poster-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 3.15rem;
  height: 3.15rem;
  place-items: center;
  border-radius: 999px;
  opacity: 0;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  transform: translate(-50%, -50%) scale(0.8);
  transition: 0.25s ease;
}

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

.card-rank {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: grid;
  min-width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 0.75rem;
  color: #082f49;
  background: var(--cyan);
}

.card-body {
  padding: 1rem;
}

.card-body h3 {
  margin: 0.55rem 0 0.55rem;
  color: white;
  font-size: 1.05rem;
  line-height: 1.35;
}

.card-body p {
  display: -webkit-box;
  min-height: 3.2rem;
  margin: 0 0 0.9rem;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.62;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  gap: 0.35rem;
  font-size: 0.78rem;
}

.card-meta span,
.tag-row span {
  min-height: auto;
  padding: 0.25rem 0.5rem;
}

.tag-row {
  gap: 0.35rem;
}

.horizontal-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 300px);
  gap: 1rem;
  overflow-x: auto;
  padding: 0 0 1rem;
  scroll-snap-type: x proximity;
}

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

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

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

.category-card {
  position: relative;
  display: grid;
  min-height: 13rem;
  overflow: hidden;
  align-content: end;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: #0f172a;
  transition: 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.35);
}

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

.category-card strong,
.category-card em {
  position: relative;
  z-index: 1;
}

.category-card strong {
  margin-bottom: 0.4rem;
  font-size: 1.28rem;
}

.category-card em {
  color: #cbd5e1;
  font-style: normal;
  line-height: 1.6;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(8, 47, 73, 0.58));
}

.page-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  min-height: 22rem;
  padding: 6rem max(1rem, calc((100vw - 1240px) / 2)) 3.2rem;
}

.slim-hero,
.search-hero {
  min-height: 20rem;
}

.filter-shell {
  padding-top: 2rem;
}

.filter-bar,
.search-controls {
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.58);
}

.filter-bar input,
.search-controls input {
  flex: 1 1 320px;
  padding: 0 1rem;
}

.filter-bar select,
.search-controls select {
  flex: 0 1 190px;
  padding: 0 1rem;
}

.rank-list {
  display: grid;
  gap: 0.8rem;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 3.2rem 5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.74);
  transition: 0.25s ease;
}

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

.rank-index {
  display: grid;
  height: 3rem;
  place-items: center;
  border-radius: 0.85rem;
  color: #67e8f9;
  font-weight: 900;
  background: rgba(34, 211, 238, 0.1);
}

.rank-poster {
  display: block;
  width: 5rem;
  height: 5rem;
  overflow: hidden;
  border-radius: 0.9rem;
  background: #0f172a;
}

.rank-info h3 {
  margin: 0 0 0.35rem;
}

.rank-info p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  line-height: 1.55;
}

.rank-action {
  min-width: 4.6rem;
  min-height: 2.45rem;
}

.detail-hero {
  min-height: 34rem;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  filter: blur(18px) saturate(1.1);
  transform: scale(1.08);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.58));
}

.detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem 0 4rem;
}

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

.detail-info {
  align-self: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.breadcrumb a {
  color: #bae6fd;
}

.lead-text {
  margin: 1rem 0;
}

.detail-meta {
  margin: 1rem 0;
}

.detail-tags {
  margin-bottom: 1.5rem;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 1.45rem;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.movie-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1rem;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.62));
  cursor: pointer;
  z-index: 2;
}

.big-play {
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  margin: 0 auto;
  border-radius: 999px;
  font-size: 1.7rem;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 46px rgba(34, 211, 238, 0.32);
}

.video-shell.is-started .play-cover {
  display: none;
}

.player-message {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  margin: 0;
  color: #fecaca;
}

.detail-copy {
  display: grid;
  gap: 0.8rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(15, 23, 42, 0.66);
}

.detail-copy h2 {
  margin: 0.4rem 0 0;
}

.detail-copy p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.95;
}

.search-page-panel {
  padding-top: 2rem;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.empty-result {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.68);
}

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

.footer-inner {
  display: grid;
  gap: 1rem;
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.4rem 0;
  color: var(--muted);
}

.footer-logo {
  color: white;
  font-size: 1.15rem;
}

.footer-links,
.footer-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-links a,
.footer-categories a {
  color: #bae6fd;
}

.copyright {
  margin: 0;
  color: #64748b;
}

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

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

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

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

  .menu-toggle {
    display: block;
  }

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

  .hero-section {
    min-height: 82vh;
  }

  .hero-content {
    padding: 6rem 0 10rem;
  }

  .hero-panel,
  .page-hero,
  .section-heading,
  .detail-grid {
    display: grid;
  }

  .hero-panel {
    right: 1rem;
    bottom: 1.25rem;
    left: 1rem;
  }

  .hero-dots {
    justify-content: center;
  }

  .hero-actions,
  .filter-bar,
  .search-controls {
    align-items: stretch;
  }

  .hero-actions,
  .filter-bar,
  .search-controls,
  .footer-links,
  .footer-categories {
    display: grid;
  }

  .page-hero {
    min-height: 24rem;
    padding: 5rem 1rem 2rem;
  }

  .movie-grid,
  .featured-grid,
  .catalogue-grid,
  .search-results,
  .category-grid,
  .category-grid.large,
  .rank-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
    padding-top: 4rem;
  }

  .detail-poster {
    width: min(280px, 70vw);
  }

  .rank-row {
    grid-template-columns: 2.6rem 4.2rem 1fr;
  }

  .rank-action {
    grid-column: 2 / 4;
  }
}

@media (max-width: 520px) {
  .movie-grid,
  .featured-grid,
  .catalogue-grid,
  .search-results,
  .category-grid,
  .category-grid.large {
    grid-template-columns: 1fr;
  }

  .hero-search,
  .mini-search {
    border-radius: 1.2rem;
  }

  .hero-search,
  .mini-search,
  .section-heading {
    display: grid;
  }

  .hero-search button,
  .mini-search button {
    width: 100%;
  }
}
