:root {
  --night-950: #05070d;
  --night-900: #0a1020;
  --night-800: #11182c;
  --silver-900: #1a2236;
  --silver-800: #263047;
  --silver-700: #3a4561;
  --silver-500: #8d98ad;
  --silver-300: #c9d2e3;
  --silver-200: #e4e9f4;
  --moonlight-700: #4c1d95;
  --moonlight-600: #6d28d9;
  --moonlight-500: #8b5cf6;
  --moonlight-400: #a78bfa;
  --moonlight-300: #c4b5fd;
  --gold: #fbbf24;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-glow: 0 20px 70px rgba(139, 92, 246, 0.22);
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--silver-200);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 30rem),
    linear-gradient(180deg, var(--night-950), var(--night-900) 42%, #070a12);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 13, 0.88);
  border-bottom: 1px solid rgba(201, 210, 227, 0.12);
  backdrop-filter: blur(18px);
}

.nav-inner {
  width: min(1280px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-text {
  color: #fff;
  font-size: 20px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--moonlight-500), var(--moonlight-700));
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.55);
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: var(--silver-300);
  font-size: 15px;
}

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

.nav-links a:hover,
.mobile-panel a:hover,
.site-footer a:hover {
  color: #fff;
}

.nav-search,
.mobile-search,
.inline-filter,
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-search input,
.mobile-search input,
.inline-filter input,
.filter-bar input,
.filter-bar select {
  min-width: 0;
  color: #fff;
  background: rgba(38, 48, 71, 0.62);
  border: 1px solid rgba(201, 210, 227, 0.14);
  border-radius: 999px;
  outline: none;
  padding: 10px 16px;
}

.nav-search input {
  width: 180px;
}

.nav-search button,
.mobile-search button,
.inline-filter button,
.filter-bar button {
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--moonlight-500), var(--moonlight-700));
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.24);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  color: #fff;
  background: rgba(38, 48, 71, 0.7);
  border: 1px solid rgba(201, 210, 227, 0.16);
  border-radius: 12px;
  padding: 8px 12px;
}

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

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

.mobile-panel a {
  color: var(--silver-300);
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 210, 227, 0.08);
}

.hero-carousel {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background: var(--night-950);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

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

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  transform: scale(1.04);
}

.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero-bg::before {
  background: linear-gradient(90deg, rgba(5, 7, 13, 0.95), rgba(5, 7, 13, 0.5), rgba(5, 7, 13, 0.92));
}

.hero-bg::after {
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.1), var(--night-950));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100% - 32px));
  text-align: center;
  padding: 92px 0 108px;
}

.hero-kicker,
.section-kicker {
  color: var(--moonlight-300);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 18px 0 20px;
  color: #fff;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.05;
  text-shadow: 0 16px 54px rgba(0, 0, 0, 0.6);
}

.hero-content p {
  width: min(820px, 100%);
  margin: 0 auto 28px;
  color: var(--silver-200);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-tags,
.tag-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
  color: var(--silver-200);
  background: rgba(38, 48, 71, 0.72);
  border: 1px solid rgba(201, 210, 227, 0.14);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--moonlight-500), var(--moonlight-700));
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  color: #fff;
  border: 1px solid rgba(201, 210, 227, 0.2);
  background: rgba(38, 48, 71, 0.5);
}

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

.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  color: #fff;
  background: rgba(38, 48, 71, 0.45);
  border: 1px solid rgba(201, 210, 227, 0.18);
  border-radius: 50%;
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
  font-size: 36px;
  line-height: 1;
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

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

.hero-dot.is-active {
  width: 30px;
  background: var(--moonlight-400);
}

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

.section {
  padding: 72px 0;
}

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

.section-head.center {
  justify-content: center;
  text-align: center;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section-head h2,
.side-panel h2,
.rank-panel h2,
.content-card h2,
.player-section h2 {
  margin: 4px 0 0;
  color: #fff;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
}

.section-head a,
.related-section .section-head a {
  color: var(--moonlight-300);
  font-weight: 700;
}

.scroll-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 22px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-snap-type: x mandatory;
}

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

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

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

.movie-card {
  overflow: hidden;
  background: rgba(38, 48, 71, 0.42);
  border: 1px solid rgba(201, 210, 227, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: var(--shadow-glow);
}

.poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.28), rgba(17, 24, 44, 0.86));
}

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

.movie-card:hover .poster img,
.category-card:hover img,
.compact-item:hover img {
  transform: scale(1.08);
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
}

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(139, 92, 246, 0.85);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
}

.card-body {
  padding: 16px;
}

.card-body h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 17px;
  line-height: 1.35;
}

.card-body h2 a:hover {
  color: var(--moonlight-300);
}

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

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--silver-500);
  font-size: 13px;
}

.tag-row {
  justify-content: flex-start;
  margin-top: 12px;
}

.tag-row span {
  color: var(--moonlight-300);
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(167, 139, 250, 0.22);
}

.category-section {
  width: 100%;
  max-width: none;
  padding: 72px max(16px, calc((100vw - 1280px) / 2));
  background: rgba(26, 34, 54, 0.24);
}

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

.category-tile,
.category-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 210, 227, 0.11);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(17, 24, 44, 0.78));
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile {
  min-height: 160px;
  padding: 24px;
  display: grid;
  gap: 8px;
}

.category-tile:hover,
.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.55);
}

.category-tile span,
.category-card-body span {
  font-size: 32px;
}

.category-tile strong,
.category-card h2 {
  color: #fff;
  font-size: 22px;
}

.category-tile em,
.category-card p {
  color: var(--silver-500);
  font-style: normal;
}

.split-layout,
.two-column,
.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.rank-panel,
.side-panel,
.content-card {
  background: rgba(17, 24, 44, 0.72);
  border: 1px solid rgba(201, 210, 227, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.sticky-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.rank-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 210, 227, 0.08);
}

.rank-number {
  color: var(--gold);
  font-weight: 900;
}

.rank-title {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta {
  color: var(--silver-500);
  font-size: 12px;
}

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

.compact-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: center;
  overflow: hidden;
  background: rgba(38, 48, 71, 0.32);
  border: 1px solid rgba(201, 210, 227, 0.1);
  border-radius: var(--radius-md);
}

.compact-item img {
  height: 100px;
  background: rgba(17, 24, 44, 0.9);
}

.compact-item strong,
.compact-item em {
  display: block;
}

.compact-item strong {
  color: #fff;
  margin-bottom: 6px;
}

.compact-item em {
  color: var(--silver-500);
  font-style: normal;
  font-size: 13px;
}

.page-main,
.detail-main {
  padding-top: 34px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  margin: 34px 0 18px;
  border: 1px solid rgba(201, 210, 227, 0.1);
  border-radius: 32px;
  background:
    radial-gradient(circle at 20% 0%, rgba(139, 92, 246, 0.32), transparent 35rem),
    linear-gradient(135deg, rgba(26, 34, 54, 0.86), rgba(5, 7, 13, 0.94));
  padding: clamp(34px, 7vw, 72px);
  box-shadow: var(--shadow-card);
}

.page-hero h1 {
  margin: 10px 0;
  color: #fff;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.1;
}

.page-hero p {
  width: min(720px, 100%);
  color: var(--silver-300);
  font-size: 18px;
}

.inline-filter,
.filter-bar {
  flex-wrap: wrap;
  margin-top: 24px;
}

.filter-bar input {
  width: min(460px, 100%);
}

.filter-bar select {
  min-width: 150px;
}

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

.category-card-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  height: 220px;
  overflow: hidden;
}

.category-card-media img {
  min-width: 0;
  background: rgba(17, 24, 44, 0.9);
}

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

.empty-state {
  display: none;
  margin: 30px 0;
  color: var(--silver-300);
  text-align: center;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
  color: var(--silver-500);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fff;
}

.detail-hero {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(201, 210, 227, 0.1);
  border-radius: 32px;
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.3), transparent 34rem),
    linear-gradient(135deg, rgba(26, 34, 54, 0.8), rgba(5, 7, 13, 0.95));
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-card);
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(201, 210, 227, 0.14);
  border-radius: 28px;
  background: rgba(17, 24, 44, 0.9);
  box-shadow: var(--shadow-glow);
}

.detail-info h1 {
  margin: 10px 0 16px;
  color: #fff;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.08;
}

.detail-desc {
  color: var(--silver-200);
  font-size: 19px;
}

.detail-info .detail-meta,
.detail-tags {
  justify-content: flex-start;
  margin: 20px 0;
}

.player-section {
  padding: 58px 0 28px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(201, 210, 227, 0.12);
  border-radius: 28px;
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

.movie-player {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: #fff;
  border: 0;
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.24), rgba(5, 7, 13, 0.78));
}

.player-overlay.is-hidden {
  display: none;
}

.big-play {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--moonlight-500), var(--moonlight-700));
  box-shadow: var(--shadow-glow);
  font-size: 32px;
}

.player-message {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: none;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 12px;
  padding: 10px 14px;
}

.player-message.is-visible {
  display: block;
}

.detail-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 36px 0 10px;
}

.content-card p {
  color: var(--silver-300);
}

.inline-links {
  display: grid;
  gap: 10px;
}

.inline-links a {
  color: var(--moonlight-300);
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
  padding-bottom: 8px;
}

.site-footer {
  margin-top: 70px;
  background: rgba(5, 7, 13, 0.88);
  border-top: 1px solid rgba(201, 210, 227, 0.1);
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 46px 0;
}

.footer-grid h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 18px;
}

.footer-grid p,
.footer-grid a {
  display: block;
  color: var(--silver-500);
  margin: 8px 0;
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  color: var(--silver-500);
  border-top: 1px solid rgba(201, 210, 227, 0.08);
  padding: 18px 0 28px;
  font-size: 13px;
}

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

  .menu-toggle {
    display: inline-flex;
  }

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

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

  .split-layout,
  .two-column,
  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .hero-carousel {
    min-height: 620px;
  }

  .hero-nav {
    display: none;
  }

  .movie-grid,
  .all-grid,
  .category-grid,
  .category-overview-grid,
  .compact-grid,
  .detail-content {
    grid-template-columns: 1fr 1fr;
  }

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

  .detail-poster {
    width: min(340px, 100%);
  }

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

@media (max-width: 560px) {
  .nav-inner {
    height: 64px;
  }

  .brand-text {
    font-size: 17px;
  }

  .hero-content {
    text-align: left;
    padding-top: 72px;
  }

  .hero-tags,
  .hero-actions {
    justify-content: flex-start;
  }

  .hero-dots {
    left: 16px;
    transform: none;
  }

  .section-head {
    display: block;
  }

  .movie-grid,
  .all-grid,
  .category-grid,
  .category-overview-grid,
  .compact-grid,
  .detail-content,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .compact-item {
    grid-template-columns: 118px 1fr;
  }

  .compact-item img {
    height: 86px;
  }

  .page-hero,
  .detail-hero,
  .player-shell {
    border-radius: 22px;
  }
}
