* {
  box-sizing: border-box;
}

:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(30, 41, 59, 0.88);
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-light: #818cf8;
  --accent-deep: #312e81;
  --danger: #f97316;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.48);
  --radius: 24px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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: 80;
  background: rgba(2, 6, 23, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.38);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-copy em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted-strong);
  font-size: 14px;
}

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

.desktop-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover {
  color: white;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  color: white;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: white;
  border-radius: 99px;
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.94);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted-strong);
}

.hero-carousel {
  position: relative;
  height: 620px;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(79, 70, 229, 0.36), transparent 28%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.58) 52%, rgba(2, 6, 23, 0.22)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.72) 28%, transparent 68%);
}

.hero-content {
  position: absolute;
  left: max(28px, calc((100vw - 1240px) / 2));
  bottom: 108px;
  width: min(640px, calc(100% - 56px));
}

.hero-kicker,
.section-heading span,
.page-hero span,
.category-card-large span {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.74);
  color: white;
  font-size: 13px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
}

.hero-content h1 {
  margin: 18px 0 16px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-content p {
  width: min(560px, 100%);
  margin: 0 0 22px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-meta span,
.pill-row span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted-strong);
  font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.text-link,
.hero-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 22px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.hero-search button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 18px 42px rgba(79, 70, 229, 0.36);
}

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

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

.hero-arrow {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: white;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translateY(-50%) scale(1.06);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

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

.hero-dot.is-active {
  width: 34px;
  background: white;
}

.hero-search {
  position: absolute;
  right: max(28px, calc((100vw - 1240px) / 2));
  bottom: 108px;
  width: min(420px, calc(100% - 56px));
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  padding: 0 14px;
  outline: none;
}

.hero-search input::placeholder {
  color: rgba(226, 232, 240, 0.68);
}

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

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

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

.section-heading h2,
.page-hero h1,
.info-panel h1,
.text-panel h2,
.detail-side h2 {
  margin: 10px 0 0;
  color: white;
  letter-spacing: -0.04em;
}

.section-heading h2 {
  font-size: 34px;
}

.section-heading a {
  color: var(--accent-light);
  font-weight: 700;
}

.slim-heading {
  margin-bottom: 18px;
}

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

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

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

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

.catalogue-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 28px 0 40px;
}

.movie-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(129, 140, 248, 0.44);
  background: var(--panel-strong);
}

.card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f172a;
}

.wide-cover {
  aspect-ratio: 16 / 9;
}

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

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

.card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), transparent 58%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.play-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.9);
  color: white;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.meta-line,
.genre-line {
  color: var(--accent-light);
  font-size: 13px;
}

.card-body h3 {
  margin: 8px 0 9px;
  color: white;
  font-size: 18px;
  line-height: 1.4;
}

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

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag-line span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.11);
  color: var(--muted-strong);
  font-size: 12px;
}

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

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

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 54px 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  border-color: rgba(129, 140, 248, 0.42);
  background: var(--panel-strong);
}

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

.rank-num {
  color: var(--accent-light);
  font-size: 24px;
  font-weight: 900;
}

.rank-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rank-main strong {
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-play {
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 700;
}

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

.category-tile {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.28), transparent 40%),
    rgba(15, 23, 42, 0.72);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.44);
}

.category-tile span {
  color: white;
  font-size: 22px;
  font-weight: 900;
}

.category-tile strong {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}

.category-tile em,
.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-style: normal;
}

.category-tile em a,
.mini-links a {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.page-hero {
  margin: 22px 0 32px;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 15% 10%, rgba(79, 70, 229, 0.32), transparent 28%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.72));
  box-shadow: var(--shadow);
}

.small-hero {
  padding: 38px;
}

.page-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.page-hero p {
  width: min(780px, 100%);
  margin: 16px 0 0;
  color: var(--muted-strong);
  font-size: 17px;
  line-height: 1.8;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

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

.filter-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.filter-title strong {
  color: white;
  font-size: 20px;
}

.filter-title span {
  color: var(--muted);
  font-size: 13px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 14px;
}

.filter-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 13px;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.48);
  color: white;
  outline: none;
  padding: 0 14px;
}

.filter-grid input:focus,
.filter-grid select:focus {
  border-color: rgba(129, 140, 248, 0.72);
}

.empty-state {
  display: none;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  color: var(--muted-strong);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.category-list-large {
  display: grid;
  gap: 22px;
}

.category-card-large {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
}

.category-cover-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.category-cover-stack img {
  aspect-ratio: 3 / 4;
  width: 100%;
  border-radius: 18px;
  object-fit: cover;
}

.category-card-large h2 {
  margin: 16px 0 10px;
  color: white;
  font-size: 32px;
}

.category-card-large p {
  margin: 0 0 18px;
  color: var(--muted-strong);
  line-height: 1.8;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  margin-top: 22px;
}

.detail-primary,
.detail-side {
  min-width: 0;
}

.player {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: black;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

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

.player-cover {
  z-index: 3;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover img {
  object-fit: cover;
}

.player-mask {
  background:
    radial-gradient(circle, rgba(79, 70, 229, 0.24), transparent 32%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18));
}

.big-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  font-size: 34px;
  box-shadow: 0 22px 54px rgba(79, 70, 229, 0.48);
}

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

.info-panel,
.text-panel,
.detail-side {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
}

.info-panel h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.genre-line {
  margin: 12px 0;
}

.lead-text,
.text-panel p {
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.9;
}

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

.text-panel h2,
.detail-side h2 {
  margin-top: 0;
  font-size: 24px;
}

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

.side-list {
  display: grid;
  gap: 14px;
}

.side-list .compact-card {
  grid-template-columns: 116px minmax(0, 1fr);
}

.side-list .compact-card .card-body {
  padding: 12px;
}

.side-list .compact-card .card-body p,
.side-list .compact-card .tag-line {
  display: none;
}

.full-rank {
  margin-top: 28px;
}

.rank-spotlight {
  margin-bottom: 28px;
}

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

.footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.4fr;
  gap: 34px;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 12px;
  color: white;
  font-size: 22px;
  font-weight: 900;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
  color: var(--muted-strong);
}

.copyright {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 30px;
  color: var(--muted);
  font-size: 13px;
}

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

  .nav-toggle {
    display: block;
  }

  .hero-search {
    left: max(28px, calc((100vw - 1240px) / 2));
    right: auto;
    bottom: 28px;
  }

  .hero-content {
    bottom: 128px;
  }

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

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

  .detail-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .nav-wrap {
    height: 66px;
  }

  .brand-copy em {
    display: none;
  }

  .hero-carousel {
    height: 700px;
  }

  .hero-content {
    bottom: 178px;
  }

  .hero-content p {
    font-size: 16px;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search input,
  .hero-search button {
    height: 46px;
  }

  .hero-arrow {
    display: none;
  }

  .content-section {
    padding-top: 48px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .featured-grid,
  .compact-grid,
  .two-column-grid,
  .catalogue-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .compact-card,
  .side-list .compact-card {
    grid-template-columns: 128px minmax(0, 1fr);
  }

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

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

  .rank-play {
    display: none;
  }

  .filter-title {
    align-items: start;
    flex-direction: column;
  }

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

  .page-hero,
  .small-hero,
  .info-panel,
  .text-panel,
  .detail-side,
  .filter-panel {
    padding: 22px;
    border-radius: 22px;
  }

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

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

@media (max-width: 460px) {
  .mobile-nav {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .hero-content,
  .hero-search {
    left: 16px;
    width: calc(100% - 32px);
  }

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

  .big-play {
    width: 68px;
    height: 68px;
    font-size: 28px;
  }
}
