:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.76);
  --panel-solid: #0f172a;
  --panel-soft: rgba(30, 41, 59, 0.72);
  --border: rgba(34, 211, 238, 0.22);
  --border-strong: rgba(34, 211, 238, 0.48);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-dark: #0891b2;
  --yellow: #facc15;
  --danger: #fb7185;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(8, 145, 178, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.16), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.12), transparent 34%),
    var(--bg);
  font-family: Inter, 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 {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(16px);
}

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

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

.logo-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #001019;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.46);
}

.logo-text {
  font-size: 24px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--soft);
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.10);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

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

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

.hero-slider {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

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

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

.hero-slide > img,
.detail-bg > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.12) contrast(1.06);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.75) 42%, rgba(2, 6, 23, 0.22) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 32px));
  min-height: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 0 150px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  max-width: 860px;
  margin: 0 0 18px;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 720px;
  margin: 0;
  color: var(--soft);
  font-size: 18px;
}

.hero-tags,
.movie-tags,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.hero-tags span,
.movie-tags span,
.detail-meta span,
.detail-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.72);
}

.hero-actions,
.detail-info .primary-btn {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.primary-btn {
  color: #031015;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 14px 32px rgba(34, 211, 238, 0.25);
}

.ghost-btn {
  border: 1px solid var(--border-strong);
  color: var(--cyan);
  background: rgba(15, 23, 42, 0.7);
}

.primary-btn:hover,
.ghost-btn:hover,
.movie-card:hover,
.category-card:hover {
  transform: translateY(-3px);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  font-size: 34px;
  line-height: 1;
}

.hero-prev {
  left: 28px;
}

.hero-next {
  right: 28px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 99px;
  background: rgba(203, 213, 225, 0.46);
}

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

.hero-thumbs {
  position: absolute;
  right: max(24px, calc((100vw - 1240px) / 2));
  bottom: 36px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 120px));
  gap: 12px;
}

.hero-thumb {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.75);
  opacity: 0.72;
}

.hero-thumb.active {
  border-color: var(--cyan);
  opacity: 1;
}

.hero-thumb img {
  width: 100%;
  height: 62px;
  object-fit: cover;
}

.hero-thumb span {
  display: block;
  overflow: hidden;
  padding: 8px;
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.intro-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 44px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro-block h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 42px);
}

.intro-block p,
.page-hero p,
.section-head p,
.category-card p,
.detail-text p,
.site-footer p {
  color: var(--muted);
}

.search-panel {
  margin: 36px 0 8px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.search-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}

.search-grid label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-weight: 700;
}

.search-grid input,
.search-grid select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.7);
  outline: none;
}

.search-grid input:focus,
.search-grid select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.search-results {
  display: none;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.search-results.open {
  display: grid;
  gap: 10px;
}

.search-result-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.search-result-item img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
}

.search-result-item strong,
.search-result-item span {
  display: block;
}

.search-result-item span {
  color: var(--muted);
  font-size: 13px;
}

.content-section {
  margin-top: 64px;
}

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

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
}

.section-head h2 span {
  width: 5px;
  height: 32px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.65);
}

.section-head p {
  margin: 6px 0 0;
}

.section-more {
  color: var(--cyan);
  font-weight: 800;
}

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

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

.movie-card,
.category-card,
.rank-panel,
.detail-text article {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover,
.category-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 24px 60px rgba(8, 145, 178, 0.22);
}

.poster-frame {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.28), rgba(15, 23, 42, 0.92)),
    var(--panel-solid);
}

.movie-card-large .poster-frame {
  min-height: 340px;
}

.poster-frame img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .poster-frame img {
  transform: scale(1.07);
}

.poster-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent 58%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.play-icon {
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #021018;
  background: rgba(34, 211, 238, 0.92);
  box-shadow: 0 0 42px rgba(34, 211, 238, 0.42);
}

.year-badge,
.rank-badge {
  position: absolute;
  z-index: 4;
  top: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(2, 6, 23, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.year-badge {
  right: 12px;
}

.rank-badge {
  left: 12px;
  color: #020617;
  background: var(--yellow);
}

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

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

.movie-card h3 a:hover {
  color: var(--cyan);
}

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

.movie-tags {
  gap: 7px;
  margin-bottom: 12px;
}

.movie-tags span {
  min-height: 24px;
  padding: 3px 9px;
  font-size: 12px;
}

.movie-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.movie-meta span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.movie-meta a {
  color: var(--cyan);
  white-space: nowrap;
}

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

.rank-panel {
  position: sticky;
  top: 96px;
  padding: 22px;
}

.rank-panel h2 {
  margin: 0 0 16px;
}

.rank-panel ol,
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rank-panel li a,
.rank-list li a {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.rank-panel li span,
.rank-list li span {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #020617;
  background: var(--cyan);
  font-weight: 900;
}

.rank-panel li strong,
.rank-list li strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-panel li em,
.rank-list li em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.ghost-btn.full {
  width: 100%;
  margin-top: 18px;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.small-hero {
  min-height: 340px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
}

.page-hero > div {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 60px 0;
}

.page-hero h1 {
  margin-bottom: 14px;
}

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

.category-card a {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 200px;
}

.category-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--panel-solid);
}

.category-mosaic img {
  width: 100%;
  height: 100%;
  min-height: 98px;
  object-fit: cover;
}

.category-body {
  padding: 24px;
}

.category-body h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.category-body span {
  color: var(--cyan);
  font-weight: 800;
}

.detail-hero {
  min-height: 560px;
}

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

.detail-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.96)),
    linear-gradient(0deg, rgba(2, 6, 23, 1), transparent 42%);
}

.detail-inner {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 68px;
}

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

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

.detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 36px;
  align-items: center;
}

.detail-poster {
  min-height: 430px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-info p {
  max-width: 820px;
  margin: 0 0 22px;
  color: var(--soft);
  font-size: 18px;
}

.detail-meta {
  margin-bottom: 16px;
}

.detail-tags {
  margin-bottom: 24px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: var(--text);
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), rgba(2, 6, 23, 0.78));
}

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

.player-overlay span {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #020617;
  background: var(--cyan);
  box-shadow: 0 0 48px rgba(34, 211, 238, 0.52);
  font-size: 32px;
}

.player-overlay strong {
  max-width: min(90%, 720px);
  text-align: center;
  font-size: 22px;
}

.player-status {
  margin: 0;
  padding: 12px 16px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.88);
}

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

.detail-text article {
  padding: 24px;
}

.detail-text h2 {
  margin: 0 0 12px;
  color: var(--text);
}

.detail-text p {
  margin: 0;
  text-align: justify;
}

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

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

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

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.site-footer a {
  color: var(--muted);
}

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

[data-filter-card].filtered-out {
  display: none;
}

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

  .split-layout {
    grid-template-columns: 1fr;
  }

  .rank-panel {
    position: static;
  }

  .hero-thumbs {
    display: none;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero-slider,
  .hero-content {
    min-height: 560px;
  }

  .hero-content {
    padding-bottom: 110px;
  }

  .hero-control {
    display: none;
  }

  .intro-block,
  .section-head,
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .category-card a,
  .detail-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .category-mosaic {
    min-height: 180px;
  }

  .detail-poster {
    max-width: 320px;
    min-height: 430px;
  }

  .search-result-item {
    grid-template-columns: 54px 1fr;
  }

  .search-result-item .primary-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .site-header-inner {
    height: 64px;
  }

  .logo-text {
    font-size: 19px;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 34px;
  }

  .poster-frame {
    min-height: 230px;
  }

  .rank-panel li a,
  .rank-list li a {
    grid-template-columns: 30px 1fr;
  }

  .rank-panel li em,
  .rank-list li em {
    grid-column: 2;
  }
}
