:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-strong: rgba(30, 41, 59, 0.92);
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-deep: #0891b2;
  --blue: #2563eb;
  --yellow: #facc15;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 14px;
  --container: 1180px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

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

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

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 14px 30px rgba(34, 211, 238, 0.2);
}

.brand-name,
.footer-brand span:last-child {
  font-size: 1.55rem;
  background: linear-gradient(90deg, #67e8f9, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link {
  color: #cbd5e1;
  font-weight: 650;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #cbd5e1;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 14px 24px 20px;
  background: rgba(15, 23, 42, 0.98);
}

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

.mobile-link {
  color: #cbd5e1;
  font-weight: 650;
}

.hero-carousel {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: linear-gradient(135deg, #020617, #0f172a 62%, #0e7490);
}

.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-image-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-image-layer,
.detail-bg,
.poster-box,
.compact-thumb,
.rank-cover,
.overview-cover,
.detail-poster {
  background:
    radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.35), transparent 34%),
    linear-gradient(135deg, #0f172a, #1e3a8a 58%, #0891b2);
}

.hero-image-layer img,
.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.hero-image-layer img.is-missing,
.detail-bg img.is-missing,
.poster-img.is-missing,
.compact-img.is-missing,
.rank-cover img.is-missing,
.overview-cover img.is-missing,
.detail-poster img.is-missing {
  display: none;
}

.hero-left-fade,
.hero-bottom-fade {
  position: absolute;
  inset: 0;
}

.hero-left-fade {
  background: linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.9) 38%, rgba(2, 6, 23, 0.16) 100%);
}

.hero-bottom-fade {
  background: linear-gradient(0deg, #020617 0%, transparent 56%);
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-copy {
  max-width: 720px;
  display: grid;
  gap: 22px;
}

.hero-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.14);
  color: #a5f3fc;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.hero-copy h1,
.sub-hero h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-copy p,
.sub-hero p,
.detail-copy p {
  max-width: 720px;
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  line-height: 1.85;
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.category-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #a5f3fc;
  border: 1px solid rgba(34, 211, 238, 0.24);
  background: rgba(8, 145, 178, 0.14);
  font-size: 0.8rem;
  line-height: 1;
}

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

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

.primary-btn {
  background: linear-gradient(90deg, var(--cyan-deep), var(--blue));
  color: white;
  box-shadow: 0 16px 35px rgba(34, 211, 238, 0.22);
}

.primary-btn.small {
  min-height: 42px;
  padding-inline: 18px;
}

.ghost-btn {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.54);
  color: #fff;
  font-size: 2rem;
  backdrop-filter: blur(8px);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

.hero-dot {
  width: 18px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: #475569;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.section-block {
  padding: 64px 0;
}

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

.section-head > div {
  display: grid;
  gap: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

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

.section-mark {
  display: block;
  width: 5px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}

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

.tinted-block,
.side-panel,
.text-panel,
.player-card,
.filter-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.64));
  box-shadow: var(--shadow);
}

.tinted-block {
  padding-inline: 26px;
}

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

.horizontal-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 210px;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scrollbar-color: #334155 #0f172a;
}

.movie-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: var(--bg-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  border-color: rgba(34, 211, 238, 0.36);
  box-shadow: 0 22px 48px rgba(8, 145, 178, 0.15);
}

.poster-link,
.poster-box {
  display: block;
}

.poster-box {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

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

.poster-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 850;
  letter-spacing: 0.06em;
  z-index: 0;
}

.poster-img:not(.is-missing) {
  position: relative;
  z-index: 1;
}

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

.poster-year,
.poster-play {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.poster-year {
  top: 10px;
  right: 10px;
  padding: 5px 9px;
  color: #e0f2fe;
  font-size: 0.78rem;
  font-weight: 750;
}

.poster-play {
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%) scale(0.8);
  color: white;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.movie-info {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.movie-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.8em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: white;
  font-weight: 800;
  line-height: 1.4;
}

.movie-title:hover {
  color: var(--cyan);
}

.movie-desc {
  display: -webkit-box;
  overflow: hidden;
  min-height: 3.1em;
  margin: 0;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.movie-meta {
  gap: 7px;
  font-size: 0.78rem;
}

.movie-meta span {
  padding: 3px 7px;
}

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

.category-card,
.category-overview-card {
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 45%),
    rgba(15, 23, 42, 0.76);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover,
.category-overview-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
}

.category-card h3,
.category-overview-card h2,
.side-panel h2,
.text-panel h2 {
  margin: 0;
}

.category-card p,
.category-card small,
.category-overview-card p,
.category-overview-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.category-count {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.14);
  color: #a5f3fc;
  font-weight: 800;
  font-size: 0.82rem;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  gap: 28px;
}

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

.compact-row,
.rank-card {
  display: grid;
  grid-template-columns: auto 74px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.7);
}

.compact-thumb,
.rank-cover {
  position: relative;
  width: 74px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 14px;
}

.compact-thumb span,
.rank-cover span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  color: white;
  font-weight: 800;
  z-index: 0;
}

.compact-img,
.rank-cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-number,
.rank-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-weight: 900;
}

.compact-body,
.rank-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.compact-body a,
.rank-title {
  color: white;
  font-weight: 800;
}

.compact-body p,
.rank-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.compact-body div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted-2);
  font-size: 0.84rem;
}

.side-panel {
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 92px;
}

.side-panel h2 {
  margin-bottom: 16px;
}

.sub-hero {
  padding: 82px 0 56px;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 32rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.96));
  border-bottom: 1px solid var(--line);
}

.sub-hero .container {
  display: grid;
  gap: 18px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 14px;
  padding: 18px;
  margin-bottom: 28px;
}

.filter-panel.advanced {
  grid-template-columns: minmax(0, 1fr) 180px 180px auto;
}

.filter-panel input,
.filter-panel select {
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.5);
  color: white;
  padding: 0 14px;
  outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.empty-state,
.search-summary {
  color: var(--muted);
  text-align: center;
}

.search-summary {
  margin: -10px 0 24px;
}

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

.category-overview-card {
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: unset;
}

.overview-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 18px;
}

.overview-cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  padding: 70px 0;
  background: #020617;
}

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

.detail-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.86) 44%, rgba(2, 6, 23, 0.66) 100%),
    linear-gradient(0deg, #020617 0%, transparent 64%);
}

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

.detail-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-poster img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy {
  display: grid;
  gap: 18px;
}

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

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

.player-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 38%),
    rgba(2, 6, 23, 0.55);
  color: white;
  transition: opacity 0.2s ease;
}

.player-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-overlay span {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 36px rgba(34, 211, 238, 0.22);
  font-size: 2rem;
}

.player-overlay strong {
  font-size: 1.1rem;
}

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

.text-panel {
  padding: 24px;
}

.text-panel h2 {
  margin-bottom: 16px;
}

.text-panel p {
  margin: 0 0 14px;
  color: #cbd5e1;
  line-height: 1.9;
}

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

.rank-card {
  grid-template-columns: 54px 96px minmax(0, 1fr);
  padding: 16px;
}

.rank-cover {
  width: 96px;
}

.site-footer {
  margin-top: 50px;
  padding: 44px 0 22px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 34px;
}

.site-footer h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

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

.footer-links {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

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

.copyright {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

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

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

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

  .hero-carousel {
    height: 620px;
  }

  .hero-content {
    align-items: end;
    padding-bottom: 96px;
  }

  .hero-copy h1,
  .sub-hero h1,
  .detail-copy h1 {
    font-size: 2.5rem;
  }

  .hero-arrow {
    display: none;
  }

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

  .section-head {
    display: grid;
    align-items: start;
  }

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

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

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

  .side-panel {
    position: static;
  }

  .detail-poster {
    width: min(260px, 74vw);
  }
}

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

  .brand-name {
    font-size: 1.25rem;
  }

  .movie-grid,
  .related-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .movie-info {
    padding: 11px;
  }

  .movie-desc,
  .movie-meta,
  .tag-row,
  .category-pill {
    font-size: 0.76rem;
  }

  .compact-row,
  .rank-card {
    grid-template-columns: 1fr;
  }

  .compact-thumb,
  .rank-cover {
    width: 100%;
    max-width: 170px;
  }

  .section-block {
    padding: 44px 0;
  }

  .tinted-block {
    padding-inline: 14px;
  }
}
