:root {
  --night-950: #050607;
  --night-900: #0d0f12;
  --night-850: #12161c;
  --night-800: #1a1d23;
  --night-700: #212529;
  --night-500: #495057;
  --night-400: #6c757d;
  --night-300: #adb5bd;
  --night-200: #dee2e6;
  --blood-800: #9d0208;
  --blood-700: #c1121f;
  --blood-600: #e63946;
  --blood-500: #ff4d4d;
  --mystery-600: #486581;
  --white: #ffffff;
  --shadow-glow: 0 0 20px rgba(255, 77, 77, 0.3);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 5%, rgba(230, 57, 70, 0.12), transparent 32rem),
    radial-gradient(circle at 90% 15%, rgba(72, 101, 129, 0.15), transparent 30rem),
    var(--night-900);
  color: #e9ecef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 15, 18, 0.95);
  border-bottom: 1px solid var(--night-700);
  backdrop-filter: blur(10px);
}

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

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

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blood-600), var(--blood-800));
  color: var(--white);
  box-shadow: var(--shadow-glow);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link,
.mobile-nav-link {
  color: var(--night-300);
  border-radius: 12px;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.nav-link {
  padding: 10px 14px;
}

.nav-link:hover,
.mobile-nav-link:hover,
.nav-link.is-active,
.mobile-nav-link.is-active {
  color: var(--white);
  background: var(--night-800);
}

.nav-link.is-active,
.mobile-nav-link.is-active {
  background: var(--blood-600);
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.22);
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--night-800);
  color: var(--white);
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--night-700);
  padding: 12px 16px 16px;
}

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

.mobile-nav-link {
  padding: 12px 14px;
}

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

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

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

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

.hero-shade,
.detail-bg::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(5, 6, 7, 0.94), rgba(13, 15, 18, 0.7), rgba(13, 15, 18, 0.25)),
    linear-gradient(0deg, var(--night-900), transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70vh;
  max-width: 820px;
  padding: 96px 0;
}

.hero-kicker,
.eyebrow {
  margin: 0 0 12px;
  color: var(--blood-500);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  color: var(--white);
  line-height: 1.05;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content h1 {
  max-width: 760px;
  font-size: clamp(42px, 8vw, 86px);
}

.hero-content p {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--night-200);
  font-size: clamp(17px, 2.2vw, 22px);
}

.hero-tags,
.detail-meta,
.genre-chips,
.stat-chips,
.card-tags,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags {
  margin-top: 22px;
}

.hero-tags span,
.detail-meta span,
.genre-chips span,
.stat-chips span,
.tag {
  border: 1px solid rgba(230, 57, 70, 0.26);
  border-radius: 999px;
  background: rgba(230, 57, 70, 0.12);
  color: var(--night-200);
  padding: 5px 10px;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--blood-600);
  color: var(--white);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  border: 1px solid var(--night-700);
  background: rgba(0, 0, 0, 0.45);
  color: var(--night-200);
}

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

.btn-primary:hover {
  background: var(--blood-700);
}

.btn-secondary:hover {
  background: rgba(26, 29, 35, 0.85);
  color: var(--white);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.hero-dot.is-active {
  width: 32px;
  background: var(--blood-500);
}

.search-band,
.page-section {
  padding: 56px 0;
}

.search-band {
  border-top: 1px solid rgba(230, 57, 70, 0.12);
  border-bottom: 1px solid rgba(230, 57, 70, 0.12);
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.08), rgba(72, 101, 129, 0.08));
}

.search-band-inner,
.section-header,
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.search-band h2,
.section-header h2,
.content-panel h2,
.ranking-panel h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(26px, 4vw, 38px);
}

.home-search,
.search-page-form {
  display: flex;
  gap: 12px;
  width: min(560px, 100%);
}

.home-search input,
.search-page-form input,
.filter-bar input {
  width: 100%;
  border: 1px solid var(--night-700);
  border-radius: 14px;
  outline: 0;
  background: var(--night-800);
  color: var(--white);
  padding: 13px 16px;
}

.home-search input:focus,
.search-page-form input:focus,
.filter-bar input:focus {
  border-color: var(--blood-600);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.18);
}

.section-header {
  margin-bottom: 28px;
}

.section-link {
  color: var(--blood-500);
  font-weight: 700;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--night-700);
  border-radius: var(--radius-lg);
  background: rgba(26, 29, 35, 0.9);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(230, 57, 70, 0.55);
  box-shadow: var(--shadow-card);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--night-950);
}

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

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

.poster-overlay {
  position: absolute;
  inset: auto 12px 12px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.64);
  color: var(--white);
  opacity: 0;
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(6px);
}

.movie-card:hover .poster-overlay {
  opacity: 1;
}

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--blood-600);
  color: var(--white);
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

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

.movie-meta-line,
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--night-400);
  font-size: 12px;
}

.movie-card h3 {
  margin: 10px 0 8px;
  color: var(--white);
  font-size: 18px;
  line-height: 1.35;
}

.movie-card p {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 14px;
  overflow: hidden;
  color: var(--night-300);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-tags {
  margin-bottom: 14px;
}

.card-foot {
  border-top: 1px solid var(--night-700);
  padding-top: 12px;
}

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

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

.category-card,
.stat-card,
.content-panel,
.ranking-panel,
.prose-panel {
  border: 1px solid var(--night-700);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(26, 29, 35, 0.96), rgba(13, 15, 18, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.category-card {
  position: relative;
  min-height: 190px;
  padding: 24px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(230, 57, 70, 0.5);
}

.category-card h3 {
  margin: 34px 0 8px;
  color: var(--white);
  font-size: 24px;
}

.category-card p {
  color: var(--night-300);
}

.category-card small {
  color: var(--night-400);
}

.category-count {
  position: absolute;
  top: 18px;
  right: 18px;
  border-radius: 999px;
  background: rgba(230, 57, 70, 0.16);
  color: var(--blood-500);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

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

.ranking-panel {
  position: sticky;
  top: 88px;
  padding: 22px;
}

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

.ranking-list.full {
  gap: 12px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 42px 54px minmax(140px, 1fr) minmax(240px, 1.2fr) 92px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(5, 6, 7, 0.35);
  padding: 8px 10px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.ranking-panel .ranking-row {
  grid-template-columns: 32px 46px minmax(0, 1fr);
}

.ranking-panel .ranking-info,
.ranking-panel .ranking-hot {
  display: none;
}

.ranking-row:hover {
  border-color: rgba(230, 57, 70, 0.35);
  background: rgba(26, 29, 35, 0.76);
}

.ranking-number {
  color: var(--blood-500);
  font-weight: 900;
  text-align: center;
}

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

.ranking-title {
  color: var(--white);
  font-weight: 800;
}

.ranking-info,
.ranking-hot {
  color: var(--night-400);
  font-size: 13px;
}

.ranking-hot {
  justify-self: end;
  color: var(--blood-500);
  font-weight: 800;
}

.page-shell {
  min-height: 70vh;
}

.page-hero {
  padding: 72px 0 28px;
}

.compact-hero {
  max-width: 1280px;
}

.page-hero h1,
.detail-info h1 {
  font-size: clamp(36px, 6vw, 64px);
}

.page-hero p {
  max-width: 880px;
  color: var(--night-300);
  font-size: 18px;
}

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

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

.filter-bar {
  margin-bottom: 24px;
  border: 1px solid var(--night-700);
  border-radius: 18px;
  background: rgba(26, 29, 35, 0.72);
  padding: 14px;
}

.filter-bar span {
  min-width: fit-content;
  color: var(--night-300);
  font-weight: 700;
}

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

.stat-card {
  padding: 22px;
}

.stat-card h3 {
  margin: 0 0 16px;
}

.stat-chips b {
  color: var(--blood-500);
}

.detail-hero {
  position: relative;
  overflow: hidden;
  background: var(--night-950);
}

.detail-bg {
  position: absolute;
  inset: 0;
  opacity: 0.42;
}

.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(8px);
  transform: scale(1.06);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 56px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid rgba(230, 57, 70, 0.26);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

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

.detail-one-line {
  max-width: 900px;
  color: var(--night-200);
  font-size: 20px;
}

.detail-meta,
.genre-chips {
  margin-top: 18px;
}

.player-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--night-700);
  border-radius: var(--radius-xl);
  background: #000000;
  box-shadow: var(--shadow-card);
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.24));
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-start.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: var(--blood-600);
  box-shadow: var(--shadow-glow);
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.content-panel,
.prose-panel {
  padding: 28px;
}

.content-panel p,
.prose-panel li {
  color: var(--night-200);
  font-size: 17px;
}

.side-panel {
  position: sticky;
  top: 88px;
}

.movie-data-list {
  margin: 0 0 20px;
}

.movie-data-list div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--night-700);
  padding: 11px 0;
}

.movie-data-list dt {
  color: var(--night-400);
}

.movie-data-list dd {
  margin: 0;
  color: var(--night-200);
}

.tag.large {
  padding: 7px 12px;
}

.search-hero .search-page-form {
  margin-top: 24px;
}

.prose-panel ul {
  margin: 0;
  padding-left: 22px;
}

.prose-panel li + li {
  margin-top: 12px;
}

.site-footer {
  border-top: 1px solid var(--night-700);
  background: var(--night-950);
  color: var(--night-400);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 1fr 1fr;
  gap: 28px;
}

.site-footer h3 {
  margin: 0 0 12px;
  color: var(--white);
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

.site-footer a:hover {
  color: var(--blood-500);
}

.footer-brand {
  color: var(--white);
  font-size: 20px;
}

.copyright {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--night-700);
  margin-top: 30px;
  padding-top: 18px;
  font-size: 13px;
}

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

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--night-700);
  border-radius: var(--radius-lg);
  color: var(--night-300);
  padding: 30px;
  text-align: center;
}

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

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

  .split-layout,
  .detail-content-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .ranking-panel,
  .side-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .container-custom {
    width: min(100% - 24px, 1280px);
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

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

  .hero-carousel,
  .hero-content {
    min-height: 68vh;
  }

  .hero-content {
    padding: 84px 0;
  }

  .hero-control {
    display: none;
  }

  .search-band-inner,
  .section-header,
  .filter-bar,
  .home-search,
  .search-page-form {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

  .movie-card p,
  .card-tags,
  .card-foot {
    display: none;
  }

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

  .detail-poster {
    max-width: 240px;
  }

  .ranking-row,
  .ranking-list.full .ranking-row {
    grid-template-columns: 34px 48px minmax(0, 1fr);
  }

  .ranking-info,
  .ranking-hot {
    display: none;
  }

  .footer-grid,
  .copyright {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .movie-grid,
  .category-grid,
  .category-grid.wide {
    grid-template-columns: 1fr;
  }

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