* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-strong: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(34, 211, 238, 0.35);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-dark: #0891b2;
  --yellow: #facc15;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34rem),
    radial-gradient(circle at 85% 12%, rgba(14, 165, 233, 0.14), transparent 30rem),
    linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.32);
  font-weight: 900;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-nav a,
.mobile-panel a,
.footer-grid a {
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-grid a:hover {
  color: var(--cyan);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 32vw);
  padding: 6px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.site-search input,
.inline-filter input {
  min-width: 0;
  flex: 1;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  padding: 9px 12px;
}

.site-search input::placeholder,
.inline-filter input::placeholder {
  color: #64748b;
}

.site-search button,
.primary-button,
.secondary-button,
.play-button,
.filter-button {
  border: 0;
  color: #001018;
  background: var(--cyan);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.site-search button:hover,
.primary-button:hover,
.play-button:hover,
.filter-button:hover {
  transform: translateY(-1px) scale(1.02);
  background: #67e8f9;
  box-shadow: 0 16px 40px rgba(34, 211, 238, 0.22);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 999px;
}

.mobile-panel {
  display: grid;
  gap: 6px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-panel a {
  padding: 12px 14px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.hero {
  position: relative;
  min-height: clamp(560px, 82vh, 820px);
  overflow: hidden;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.08);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.66) 45%, rgba(2, 6, 23, 0.12) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.2) 42%, rgba(2, 6, 23, 0.26) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: clamp(560px, 82vh, 820px);
  padding: 72px 0 112px;
}

.hero-copy {
  max-width: 700px;
}

.kicker,
.section-kicker,
.breadcrumb,
.tag {
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero h1 {
  margin: 16px 0;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 660px;
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(17px, 2.2vw, 22px);
}

.hero-meta,
.movie-meta,
.detail-meta,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.hero-meta {
  margin: 26px 0;
  color: var(--muted-strong);
  font-weight: 700;
}

.rating {
  color: var(--yellow);
  font-weight: 900;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
}

.hero-arrow,
.hero-dot {
  border: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: width 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hero-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 26px;
}

.hero-arrow:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
}

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

.main-content {
  padding: 56px 0 72px;
}

.main-content.compact {
  padding-top: 34px;
}

.section {
  margin-bottom: 58px;
}

.section-head {
  display: flex;
  align-items: end;
  gap: 22px;
  margin-bottom: 26px;
}

.section-head h1,
.section-head h2 {
  margin: 5px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-line {
  flex: 1;
  min-width: 60px;
  height: 1px;
  margin-bottom: 9px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.58), transparent);
}

.search-panel,
.content-card,
.detail-panel,
.player-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 28px;
}

.search-panel h2,
.search-panel p {
  margin: 0;
}

.search-panel p {
  color: var(--muted);
}

.big-search {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
}

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

.big-search button {
  border: 0;
}

.movie-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-snap-type: x mandatory;
}

.movie-row .movie-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

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

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

.movie-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.32);
}

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

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

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

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

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

.play-chip,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.play-chip {
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: #001018;
  background: var(--cyan);
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-chip {
  opacity: 1;
  transform: translateY(0);
}

.rank-badge {
  top: 10px;
  left: 10px;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  color: #001018;
  background: linear-gradient(135deg, var(--yellow), #f97316);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.28);
}

.movie-card-body {
  padding: 14px;
}

.movie-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.movie-line {
  min-height: 46px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.movie-meta {
  margin-bottom: 10px;
  color: #94a3b8;
  font-size: 12px;
}

.category-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 11rem),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

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

.category-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

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

.category-card span {
  color: var(--cyan);
  font-weight: 900;
}

.category-mini-posters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.category-mini-posters img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
}

.content-card {
  padding: 24px;
}

.category-overview-block {
  display: grid;
  gap: 22px;
  margin-bottom: 24px;
}

.page-hero {
  padding: 54px 0 30px;
}

.page-hero-card {
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(8, 47, 73, 0.46)),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 18rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.page-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
}

.page-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted-strong);
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 8px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.filter-button {
  min-width: 112px;
}

.movie-card.is-hidden {
  display: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
  gap: 28px;
  align-items: start;
}

.player-panel {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.video-shell {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 18rem),
    linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.35));
}

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

.play-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-size: 18px;
}

.player-message {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 3;
  color: var(--muted-strong);
  text-align: center;
  pointer-events: none;
}

.detail-panel {
  padding: 24px;
}

.detail-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.detail-meta {
  color: var(--muted-strong);
  margin-bottom: 16px;
}

.detail-poster {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

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

.prose-card {
  padding: 24px;
  margin-top: 22px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.prose-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.prose-card p {
  margin: 0;
  color: var(--muted-strong);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.breadcrumb {
  margin-bottom: 24px;
  font-size: 14px;
}

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

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

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

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

.footer-grid h3 {
  margin: 0 0 12px;
}

.footer-grid a {
  display: block;
  margin: 8px 0;
  color: var(--muted-strong);
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 44px;
  height: 44px;
  color: #001018;
  background: var(--cyan);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.28);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

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

  .nav-toggle {
    display: flex;
  }

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

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

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

  .hero,
  .hero-inner {
    min-height: 620px;
  }

  .hero-bg::after {
    background:
      linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.68) 55%, rgba(2, 6, 23, 0.35) 100%);
  }

  .search-panel,
  .detail-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 560px) {
  .container {
    width: min(100% - 22px, 1180px);
  }

  .nav-wrap {
    min-height: 64px;
  }

  .brand-text small {
    display: none;
  }

  .hero,
  .hero-inner {
    min-height: 570px;
  }

  .hero-inner {
    padding-bottom: 94px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-actions,
  .big-search,
  .inline-filter {
    align-items: stretch;
    flex-direction: column;
    border-radius: 22px;
  }

  .hero-actions a,
  .big-search button,
  .filter-button {
    justify-content: center;
    width: 100%;
    text-align: center;
  }

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

  .movie-card-body {
    padding: 12px;
  }

  .movie-line {
    display: none;
  }

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