:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-solid: #111827;
  --line: rgba(148, 163, 184, 0.22);
  --text: #e5edf7;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --brand: #38bdf8;
  --brand-strong: #0ea5e9;
  --accent: #f59e0b;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.18), transparent 30%),
    radial-gradient(circle at 85% 8%, rgba(245, 158, 11, 0.12), transparent 28%),
    linear-gradient(135deg, #020617 0%, #0f172a 46%, #020617 100%);
  min-height: 100vh;
}

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

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

button,
input,
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);
}

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

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.site-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #2563eb);
  box-shadow: 0 14px 36px rgba(14, 165, 233, 0.3);
  font-size: 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--soft);
  font-weight: 650;
}

.site-nav a,
.mobile-nav a,
.footer-links a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover {
  color: var(--brand);
}

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

.site-search,
.mobile-search {
  position: relative;
}

.site-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select {
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
  border-radius: 999px;
  padding: 11px 16px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.site-search input {
  width: 260px;
}

.site-search input:focus,
.mobile-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(56, 189, 248, 0.82);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.search-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 80;
}

.search-panel.open {
  display: block;
}

.search-panel a,
.search-empty {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.search-panel a:last-child {
  border-bottom: 0;
}

.search-panel strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.search-panel small,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
}

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

.mobile-search input {
  width: 100%;
}

.hero-carousel {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: scale(1.02);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.8) 38%, rgba(2, 6, 23, 0.18) 100%),
    linear-gradient(0deg, #020617 0%, transparent 34%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 128px 0 112px;
  max-width: 780px;
  justify-self: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content h1,
.sub-hero h1,
.detail-copy h1 {
  margin: 12px 0 18px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  color: #fff;
}

.hero-content p {
  max-width: 680px;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.7;
  color: #dbeafe;
}

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

.hero-tags {
  margin: 26px 0;
}

.hero-tags span,
.tag-row span,
.category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.11);
  font-size: 12px;
  font-weight: 700;
}

.hero-actions,
.hero-controls,
.hero-quick {
  display: flex;
  align-items: center;
  gap: 14px;
}

.primary-btn,
.ghost-btn,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 850;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.primary-btn {
  color: #00111d;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8 45%, #0ea5e9);
  box-shadow: 0 18px 44px rgba(14, 165, 233, 0.32);
}

.ghost-btn,
.section-link {
  color: #e0f2fe;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(15, 23, 42, 0.45);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-link:hover,
.category-chip:hover {
  transform: translateY(-2px);
}

.hero-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(12px);
}

.hero-controls button {
  border: 0;
  color: #fff;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 999px;
}

.hero-controls > button {
  width: 38px;
  height: 38px;
  font-size: 28px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  opacity: 0.45;
}

.hero-dot.active {
  width: 30px;
  opacity: 1;
  background: var(--brand);
}

.hero-quick {
  position: absolute;
  z-index: 5;
  right: max(16px, calc((100vw - 1240px) / 2));
  bottom: 42px;
}

.hero-quick a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.72);
}

.page-section {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

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

.section-heading h2,
.panel-title h2,
.content-block h2,
.category-overview-body h2 {
  margin: 6px 0 0;
  color: #fff;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-heading.slim {
  margin-bottom: 20px;
}

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

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.55));
  box-shadow: 0 18px 54px rgba(2, 6, 23, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: 0 22px 70px rgba(14, 165, 233, 0.14);
}

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

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

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

.poster-year,
.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.rank-badge {
  left: auto;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.movie-info {
  padding: 16px;
}

.movie-title {
  display: block;
  color: #fff;
  font-weight: 850;
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-title:hover {
  color: var(--brand);
}

.movie-line {
  min-height: 44px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 12px;
}

.tag-row span {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 11px;
}

.categories-band {
  padding-top: 36px;
}

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

.category-tile {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
  box-shadow: var(--shadow);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.category-tile:hover img {
  transform: scale(1.08);
  opacity: 0.56;
}

.category-tile span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
}

.category-tile strong {
  display: block;
  color: #fff;
  font-size: 20px;
  margin-bottom: 6px;
}

.category-tile small {
  display: -webkit-box;
  color: #cbd5e1;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  align-items: start;
}

.ranking-panel,
.content-block,
.category-overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.ranking-panel {
  position: sticky;
  top: 96px;
  padding: 20px;
}

.panel-title {
  margin-bottom: 18px;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 42px 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.ranking-item:hover {
  border-color: rgba(56, 189, 248, 0.42);
}

.ranking-item img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.list-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #00111d;
  font-weight: 900;
  background: linear-gradient(135deg, #fde68a, #38bdf8);
}

.ranking-copy {
  min-width: 0;
}

.ranking-copy strong {
  display: block;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-copy small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-btn.wide {
  width: 100%;
  margin-top: 18px;
}

.sub-hero,
.detail-hero {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 88px 0 32px;
}

.sub-hero {
  text-align: center;
}

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

.chip-row.center {
  justify-content: center;
  margin-top: 24px;
}

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

.category-overview-card {
  overflow: hidden;
}

.category-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(148, 163, 184, 0.12);
}

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

.category-overview-body {
  padding: 22px;
}

.category-overview-body p {
  color: var(--muted);
  line-height: 1.7;
  margin: 12px 0 18px;
}

.filter-bar {
  width: min(860px, 100%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 12px;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  border-radius: 16px;
}

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

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

.detail-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 44px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 70% 10%, rgba(56, 189, 248, 0.14), transparent 32%),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.55);
}

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

.detail-one-line {
  color: #dbeafe;
  font-size: 20px;
  line-height: 1.8;
  margin: 0 0 24px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.detail-meta-grid span {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  color: var(--soft);
  background: rgba(2, 6, 23, 0.34);
}

.detail-meta-grid strong {
  color: var(--muted);
  font-size: 12px;
}

.large-tags {
  margin-bottom: 26px;
}

.player-section {
  padding-top: 36px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 30px;
  background: #000;
  box-shadow: 0 30px 100px rgba(2, 6, 23, 0.66);
  aspect-ratio: 16 / 9;
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  border: 0;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.25), rgba(2, 6, 23, 0.78)),
    rgba(2, 6, 23, 0.32);
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #00111d;
  font-size: 34px;
  background: linear-gradient(135deg, #e0f2fe, #38bdf8);
  box-shadow: 0 22px 70px rgba(14, 165, 233, 0.4);
}

.player-cover strong {
  padding: 0 20px;
  font-size: clamp(22px, 4vw, 38px);
  letter-spacing: -0.04em;
}

.detail-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 24px;
}

.content-block {
  padding: 28px;
}

.content-block p {
  color: var(--soft);
  font-size: 17px;
  line-height: 1.95;
  margin: 16px 0 0;
}

.compact-card .movie-line {
  min-height: auto;
}

.narrow-section {
  padding-top: 12px;
}

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

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

.site-footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer p {
  max-width: 560px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 20px;
  color: var(--soft);
  font-weight: 650;
}

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

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

  .hero-quick {
    display: none;
  }

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

  .split-section,
  .detail-layout,
  .detail-text {
    grid-template-columns: 1fr;
  }

  .ranking-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  .site-header-inner,
  .page-section,
  .sub-hero,
  .detail-hero,
  .site-footer-inner {
    width: min(100% - 24px, 1240px);
  }

  .hero-carousel {
    min-height: 620px;
  }

  .hero-content {
    width: min(100% - 24px, 1240px);
    padding: 92px 0 120px;
  }

  .hero-actions,
  .section-heading,
  .site-footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions a,
  .section-link {
    width: 100%;
  }

  .movie-grid,
  .small-grid,
  .related-grid,
  .catalog-grid,
  .category-overview-grid,
  .wide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

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

  .detail-layout {
    padding: 18px;
  }

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

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

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

  .play-icon {
    width: 68px;
    height: 68px;
    font-size: 26px;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .movie-grid,
  .small-grid,
  .related-grid,
  .catalog-grid,
  .category-overview-grid,
  .wide-list {
    grid-template-columns: 1fr;
  }

  .hero-controls {
    bottom: 18px;
  }

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