:root {
  --bg: #090914;
  --bg-soft: #12121f;
  --bg-card: rgba(22, 22, 36, 0.84);
  --bg-card-solid: #171727;
  --text: #f7f7fb;
  --muted: #a8a8b8;
  --line: rgba(255, 255, 255, 0.1);
  --pink: #ec4899;
  --pink-deep: #be185d;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --gold: #fbbf24;
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(236, 72, 153, 0.28), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(139, 92, 246, 0.22), transparent 30%),
    linear-gradient(180deg, #0a0a15 0%, #10101c 48%, #090914 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(9, 9, 20, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner,
.footer-inner,
.section,
.page-main,
.hero-content,
.hero-controls,
.hero-search {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 36px rgba(236, 72, 153, 0.32);
}

.brand-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

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

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: rgba(236, 72, 153, 0.16);
  transform: translateY(-1px);
}

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

.top-search input,
.inline-search input,
.hero-search input,
.filter-bar input,
.filter-bar select {
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 12px 16px;
  min-width: 0;
}

.top-search input {
  width: 220px;
}

.top-search button,
.inline-search button,
.hero-search button,
.btn,
.text-link {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(236, 72, 153, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-search button:hover,
.inline-search button:hover,
.hero-search button:hover,
.btn:hover,
.text-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(236, 72, 153, 0.34);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  box-shadow: none;
}

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

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #fff;
  border-radius: 999px;
}

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

.hero-track,
.hero-slide,
.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.72s ease;
}

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

.hero-bg {
  background-position: center;
  background-size: cover;
  transform: scale(1.06);
  filter: saturate(1.08);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(9, 9, 20, 0.96) 0%, rgba(9, 9, 20, 0.76) 45%, rgba(9, 9, 20, 0.44) 100%),
    linear-gradient(0deg, rgba(9, 9, 20, 0.94) 0%, transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 56px;
  padding-top: 54px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pink);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.08;
  max-width: 860px;
  letter-spacing: -0.04em;
}

.hero h2 {
  margin: 22px 0 10px;
  font-size: clamp(28px, 4vw, 48px);
}

.hero-text,
.page-hero p,
.detail-one-line,
.section-head p,
.movie-info p,
.category-overview-card p,
.site-footer p {
  color: var(--muted);
}

.hero-text {
  max-width: 720px;
  font-size: 19px;
}

.hero-tags,
.tag-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #f5e8ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

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

.hero-poster {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(139, 92, 246, 0.26));
}

.hero-poster img,
.movie-poster img,
.detail-poster,
.category-card img,
.category-covers img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-controls {
  position: relative;
  z-index: 4;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 116px;
  pointer-events: none;
}

.hero-dot {
  width: 34px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

.hero-dot.is-active {
  width: 56px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.hero-search {
  position: relative;
  z-index: 5;
  transform: translateY(-70px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(18, 18, 31, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-search input {
  flex: 1;
  min-height: 54px;
  font-size: 16px;
}

.section {
  padding: 54px 0;
}

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

.section-head h2,
.rank-head h2,
.detail-copy h2,
.category-overview-card h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
}

.section-head a,
.text-link {
  color: #fff;
}

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

.category-card {
  position: relative;
  min-height: 190px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--bg-card-solid);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.category-card img,
.category-shade {
  position: absolute;
  inset: 0;
}

.category-card img {
  opacity: 0.58;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-card:hover img {
  transform: scale(1.08);
  opacity: 0.78;
}

.category-shade {
  background: linear-gradient(0deg, rgba(9, 9, 20, 0.95), rgba(9, 9, 20, 0.12));
}

.category-card strong,
.category-card small {
  position: relative;
  z-index: 2;
}

.category-card strong {
  font-size: 22px;
}

.category-card small {
  color: var(--muted);
  margin-top: 6px;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  align-items: start;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(236, 72, 153, 0.42);
  box-shadow: 0 24px 70px rgba(236, 72, 153, 0.16);
}

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(139, 92, 246, 0.2));
}

.movie-poster img {
  transition: transform 0.32s ease;
}

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

.poster-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #1f1600;
  background: var(--gold);
  font-weight: 900;
  font-size: 12px;
}

.movie-info {
  padding: 15px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.movie-info h3 {
  margin: 8px 0 7px;
  font-size: 18px;
  line-height: 1.3;
}

.movie-info p {
  margin: 0 0 12px;
  display: -webkit-box;
  min-height: 3.1em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.movie-card-compact .movie-info p {
  font-size: 13px;
}

.rank-panel {
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: rgba(18, 18, 31, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: rgba(236, 72, 153, 0.14);
  transform: translateX(4px);
}

.rank-num {
  color: var(--pink);
  font-weight: 900;
}

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

.rank-score {
  color: var(--gold);
  font-weight: 900;
  text-align: right;
}

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

.page-hero {
  position: relative;
  overflow: hidden;
  margin: 28px auto 22px;
  padding: 54px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(139, 92, 246, 0.14)),
    rgba(18, 18, 31, 0.76);
  box-shadow: var(--shadow);
}

.small-hero h1,
.category-hero h1 {
  font-size: clamp(40px, 6vw, 64px);
}

.inline-search {
  margin-top: 26px;
  max-width: 720px;
}

.inline-search input {
  flex: 1;
}

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

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

.filter-section {
  padding-top: 20px;
}

.filter-bar {
  align-items: stretch;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.filter-bar input {
  flex: 1;
}

.filter-bar select {
  min-width: 138px;
  color-scheme: dark;
}

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

.category-overview-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--bg-card);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 180px;
}

.category-covers img {
  border-radius: 16px;
  min-height: 180px;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.play-cover {
  position: absolute;
  inset: 0;
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at center, rgba(236, 72, 153, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.66));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 18px 54px rgba(236, 72, 153, 0.34);
  font-size: 30px;
  padding-left: 5px;
}

.detail-side {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 16px;
  background: var(--bg-card);
}

.detail-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(139, 92, 246, 0.2));
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.detail-info {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 34px;
  background: var(--bg-card);
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.12;
}

.detail-one-line {
  font-size: 20px;
}

.detail-meta {
  margin: 18px 0 14px;
}

.detail-copy {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.detail-copy p {
  margin: 0;
  color: #dedeea;
  font-size: 17px;
}

.related-section {
  width: 100%;
}

.rank-page-section {
  padding-top: 0;
}

.wide-rank-panel {
  position: static;
}

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

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.footer-inner {
  padding: 36px 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.footer-links a:hover {
  color: #fff;
}

[data-card].is-hidden {
  display: none;
}

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

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

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

  .layout-two,
  .player-layout {
    grid-template-columns: 1fr;
  }

  .rank-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .site-nav {
    order: 4;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }

  .site-nav.is-open {
    display: flex;
  }

  .top-search {
    order: 3;
    width: 100%;
  }

  .top-search input {
    flex: 1;
    width: auto;
  }

  .hero {
    min-height: 760px;
  }

  .hero-content {
    min-height: 680px;
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 28px;
  }

  .hero-poster {
    width: min(260px, 70vw);
  }

  .hero-controls {
    min-height: 680px;
  }

  .hero-search,
  .filter-bar,
  .inline-search {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .page-hero,
  .detail-info {
    padding: 28px;
  }

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

@media (max-width: 560px) {
  .header-inner,
  .footer-inner,
  .section,
  .page-main,
  .hero-content,
  .hero-controls,
  .hero-search {
    width: min(var(--max), calc(100% - 22px));
  }

  .hero h1,
  .page-hero h1 {
    font-size: 36px;
  }

  .category-grid,
  .category-overview-grid,
  .movie-grid,
  .category-movie-grid,
  .compact-grid,
  .two-column-rank {
    grid-template-columns: 1fr;
  }

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

  .player-shell {
    border-radius: 22px;
  }

  .detail-info h1 {
    font-size: 32px;
  }
}
