:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.2);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-strong: #06b6d4;
  --blue: #2563eb;
  --purple: #7c3aed;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
  --radius: 24px;
  --radius-small: 16px;
  --max: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.2), transparent 32rem),
    radial-gradient(circle at 82% 18%, rgba(124, 58, 237, 0.16), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

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

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

.brand-text {
  font-size: 1.05rem;
}

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

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

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(34, 211, 238, 0.12);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #ffffff;
  border-radius: 99px;
}

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: var(--bg-soft);
}

.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-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.hero-copy {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 1220px;
}

.hero-kicker,
.section-heading span,
.page-hero span,
.editor-panel > span,
.overview-copy span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1 {
  width: min(760px, 100%);
  margin: 18px 0 16px;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero p {
  width: min(680px, 100%);
  margin: 0 0 30px;
  color: var(--soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions,
.footer-links,
.detail-tag-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
.movie-card:hover,
.category-tile:hover,
.compact-card:hover,
.rank-item:hover {
  transform: translateY(-3px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #00111a;
  box-shadow: 0 18px 44px rgba(34, 211, 238, 0.2);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
}

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

.hero-dot {
  width: 38px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.36);
  cursor: pointer;
}

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

.section {
  padding: 64px 0;
}

.section-tight {
  padding-top: 42px;
}

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

.section-heading h2,
.page-hero h1,
.editor-panel h2,
.detail-copy h1,
.player-section h2,
.detail-main-text h2,
.detail-side-list h2,
.overview-copy h2 {
  margin: 0;
  color: #ffffff;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.section-heading a {
  color: var(--cyan);
  font-weight: 700;
}

.compact-heading {
  align-items: center;
}

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

.category-tile,
.category-overview-card,
.editor-panel,
.movie-card,
.rank-item,
.filter-panel,
.detail-main-text,
.detail-side-list,
.player-shell {
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.category-tile {
  min-height: 178px;
  padding: 20px;
  border-radius: var(--radius-small);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover,
.movie-card:hover,
.compact-card:hover,
.rank-item:hover {
  border-color: rgba(34, 211, 238, 0.48);
}

.category-tile span {
  display: block;
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 800;
}

.category-tile p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.category-tile div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--cyan);
  font-size: 0.85rem;
}

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(37, 99, 235, 0.12));
}

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
}

.card-content {
  padding: 18px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.card-tags span,
.detail-tag-links a {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: #67e8f9;
  font-size: 0.78rem;
  font-weight: 700;
}

.movie-card h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 1.12rem;
  line-height: 1.35;
}

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

.card-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-meta a {
  color: var(--cyan);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 24px;
}

.editor-panel {
  align-self: start;
  padding: 24px;
  border-radius: var(--radius);
}

.editor-panel h2 {
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.compact-list {
  display: grid;
  gap: 12px;
}

.compact-card {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.compact-card img {
  width: 66px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
}

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

.compact-card strong {
  color: #ffffff;
}

.compact-card em {
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.86rem;
}

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

.rank-list-compact .rank-item:nth-child(n + 7) {
  display: none;
}

.rank-item {
  display: grid;
  grid-template-columns: 54px 82px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-number {
  color: var(--cyan);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}

.rank-poster img {
  width: 82px;
  height: 110px;
  border-radius: 16px;
  object-fit: cover;
}

.rank-copy h3 {
  margin: 0 0 8px;
  color: #ffffff;
}

.rank-copy p {
  margin: 0 0 10px;
  color: var(--muted);
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.18), rgba(37, 99, 235, 0.08)),
    var(--bg-soft);
}

.small-hero {
  padding: 82px 0;
}

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

.page-hero h1 {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.page-hero p {
  width: min(760px, 100%);
  margin: 0;
  color: var(--soft);
  font-size: 1.05rem;
}

.category-overview {
  display: grid;
  gap: 20px;
}

.category-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr);
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius);
}

.overview-copy h2 {
  margin-top: 8px;
  margin-bottom: 10px;
  font-size: 2rem;
}

.overview-copy p {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--soft);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px;
  border-radius: var(--radius-small);
}

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

.search-box input,
.sort-box select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 6, 23, 0.58);
  color: #ffffff;
  padding: 0 14px;
}

.search-box input:focus,
.sort-box select:focus {
  border-color: rgba(34, 211, 238, 0.7);
}

.movie-card.is-hidden,
.rank-item.is-hidden {
  display: none;
}

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

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  filter: blur(2px);
}

.detail-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.72)),
    linear-gradient(0deg, var(--bg), transparent 54%);
}

.detail-content {
  position: relative;
  z-index: 2;
  padding: 42px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 0.94rem;
}

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

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

.detail-poster img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.detail-one-line {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--soft);
  font-size: 1.15rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  gap: 12px;
  margin: 0 0 22px;
}

.detail-meta div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(15, 23, 42, 0.56);
}

.detail-meta dt {
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-meta dd {
  margin: 4px 0 0;
  color: #ffffff;
  font-weight: 800;
}

.player-section {
  padding-top: 36px;
}

.player-section h2 {
  margin-bottom: 18px;
  font-size: 2rem;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000000;
}

.player-shell video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.72));
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #00111a;
  font-size: 2rem;
  box-shadow: 0 18px 50px rgba(34, 211, 238, 0.24);
}

.detail-body-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
}

.detail-main-text,
.detail-side-list {
  padding: 26px;
  border-radius: var(--radius);
}

.detail-main-text h2,
.detail-side-list h2 {
  margin-bottom: 12px;
  font-size: 1.6rem;
}

.detail-main-text p {
  margin: 0 0 24px;
  color: var(--soft);
  font-size: 1.02rem;
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 0;
  color: var(--muted);
}

.footer-inner strong {
  color: #ffffff;
}

.footer-inner p {
  margin: 6px 0 0;
}

.footer-links a {
  color: var(--cyan);
  font-weight: 700;
}

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

  .split-section,
  .detail-body-section,
  .category-overview-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.96);
  }

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

  .nav-link {
    border-radius: 12px;
  }

  .hero {
    height: 540px;
  }

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

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

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

  .rank-item {
    grid-template-columns: 44px 72px 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .footer-inner,
  .section,
  .hero-copy,
  .detail-content,
  .page-hero > div {
    width: min(100% - 22px, var(--max));
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .section-heading,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .rank-copy p {
    display: none;
  }
}
