: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);
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --accent-strong: #059669;
  --danger: #f97316;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.55);
  --radius: 22px;
  --container: 1180px;
  font-family: Inter, 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(16, 185, 129, 0.16), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #08111f 42%, #020617 100%);
  color: var(--text);
}

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

img {
  display: block;
  max-width: 100%;
  background: linear-gradient(135deg, #111827, #0f766e);
}

button,
input,
select {
  font: inherit;
}

main {
  min-height: 70vh;
}

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

.nav-shell {
  width: min(100% - 32px, var(--container));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  color: white;
  box-shadow: 0 12px 36px rgba(16, 185, 129, 0.32);
  font-size: 14px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted-strong);
  font-size: 14px;
}

.desktop-nav a {
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: white;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: white;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

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

.mobile-nav a {
  display: block;
  padding: 12px 10px;
  color: var(--muted-strong);
  border-radius: 12px;
}

.mobile-nav a:hover {
  background: rgba(148, 163, 184, 0.1);
  color: white;
}

.mobile-nav.is-open {
  display: block;
}

.hero-slider {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-slide.is-active img {
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.26) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 40%, rgba(2, 6, 23, 0.42) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, var(--container));
  min-height: 660px;
  margin: 0 auto;
  padding-top: 120px;
  padding-bottom: 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.58fr);
  align-items: center;
  gap: 48px;
}

.hero-copy {
  max-width: 680px;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #bbf7d0;
  background: var(--accent-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 13px;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 20px 0 10px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.hero-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.08;
}

.hero-copy p {
  margin: 0 0 26px;
  color: var(--muted-strong);
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions,
.section-actions,
.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.78);
  color: white;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.4);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 48px rgba(16, 185, 129, 0.28);
}

.hero-panel {
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.hero-mini-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-mini-card:hover {
  background: rgba(30, 41, 59, 0.82);
  transform: translateX(3px);
}

.hero-mini-card img {
  width: 72px;
  height: 86px;
  object-fit: cover;
  border-radius: 14px;
}

.hero-mini-card strong {
  display: block;
  margin-bottom: 6px;
  color: white;
}

.hero-mini-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.hero-dots button {
  width: 36px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.hero-dots button.is-active {
  background: var(--accent);
}

.page-hero,
.detail-hero {
  padding: 128px 0 48px;
  background:
    radial-gradient(circle at 20% 0%, rgba(16, 185, 129, 0.18), transparent 28rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(2, 6, 23, 0));
}

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

.page-hero h1,
.detail-title h1 {
  margin: 16px 0 14px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-hero p,
.detail-title p {
  max-width: 780px;
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.85;
  font-size: 16px;
}

.section {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding: 34px 0;
}

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

.section-title h2 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.28);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(16, 185, 129, 0.42);
  background: var(--bg-card-strong);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.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);
}

.play-float {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%) scale(0.76);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.92);
  color: white;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 16px 42px rgba(16, 185, 129, 0.32);
}

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

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
  box-shadow: 0 10px 28px rgba(239, 68, 68, 0.28);
}

.card-body {
  padding: 16px;
}

.card-title {
  display: block;
  color: white;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title:hover {
  color: #6ee7b7;
}

.card-meta {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-desc {
  min-height: 48px;
  margin: 0 0 14px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.tag-row span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  font-size: 12px;
}

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

.movie-card.compact .card-title {
  font-size: 15px;
}

.movie-card.compact .card-desc,
.movie-card.compact .tag-row {
  display: none;
}

.category-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.16), transparent 48%),
    rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(16, 185, 129, 0.42);
}

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

.category-card p {
  margin: 12px 0 18px;
  color: var(--muted-strong);
  line-height: 1.7;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin-top: 26px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.78);
}

.search-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 6, 23, 0.58);
  color: white;
}

.search-panel input:focus {
  border-color: rgba(16, 185, 129, 0.55);
}

.search-panel button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.filter-empty {
  display: none;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.74);
  color: var(--muted-strong);
  text-align: center;
}

.filter-empty.is-visible {
  display: block;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 54px 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  transition: border-color 0.22s ease, background 0.22s ease;
}

.rank-row:hover {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(30, 41, 59, 0.84);
}

.rank-number {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
}

.rank-row img {
  width: 80px;
  height: 104px;
  object-fit: cover;
  border-radius: 14px;
}

.rank-info strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.rank-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.breadcrumb a:hover {
  color: #6ee7b7;
}

.detail-layout {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding: 18px 0 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
}

.player-card,
.detail-card,
.related-card {
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.16), rgba(2, 6, 23, 0.66));
  cursor: pointer;
  z-index: 3;
}

.player-cover.is-hidden {
  display: none;
}

.player-button {
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.9);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 20px 58px rgba(16, 185, 129, 0.34);
}

.player-title {
  padding: 20px 22px 22px;
}

.player-title h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.player-title p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.75;
}

.detail-card {
  padding: 26px;
}

.detail-card h2,
.related-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.detail-card p {
  color: var(--muted-strong);
  line-height: 1.9;
  margin: 0 0 18px;
}

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

.meta-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.meta-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.meta-item strong {
  color: white;
  font-size: 14px;
}

.side-poster {
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.82);
}

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

.side-poster-body {
  padding: 18px;
}

.related-card {
  margin-top: 20px;
  padding: 18px;
}

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

.related-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.36);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.related-item:hover {
  border-color: rgba(16, 185, 129, 0.36);
}

.related-item img {
  width: 74px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
}

.related-item strong {
  display: block;
  color: white;
  margin-bottom: 6px;
}

.related-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.footer-grid {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

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

.site-footer h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer a:hover {
  color: #6ee7b7;
}

.footer-brand {
  margin-bottom: 14px;
}

.footer-bottom {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: #64748b;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .desktop-nav {
    gap: 15px;
  }

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

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

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

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

  .detail-side {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
  }

  .related-card {
    margin-top: 0;
  }
}

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

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

  .hero-content {
    grid-template-columns: 1fr;
    padding-top: 112px;
    gap: 26px;
  }

  .hero-panel {
    display: none;
  }

  .section-head {
    display: block;
  }

  .section-actions {
    margin-top: 16px;
  }

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

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

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

  .rank-row {
    grid-template-columns: 42px 64px 1fr;
  }

  .rank-row .button {
    grid-column: 2 / 4;
  }

  .rank-row img {
    width: 64px;
    height: 84px;
  }

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

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

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

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

  .grid.movies,
  .grid.movies.compact-grid,
  .grid.categories {
    grid-template-columns: 1fr;
  }

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

  .player-button {
    width: 72px;
    height: 72px;
    font-size: 26px;
  }
}
