* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-strong: #06b6d4;
  --yellow: #facc15;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: white;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.36);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-text em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

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

.nav-link {
  color: var(--soft);
  font-size: 15px;
  font-weight: 650;
  transition: color 0.2s ease;
}

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

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: white;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

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

.mobile-link {
  padding: 11px 8px;
  color: var(--soft);
  font-weight: 650;
}

.hero {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  background-position: center;
  background-size: cover;
}

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #020617 4%, rgba(2, 6, 23, 0.78) 38%, rgba(2, 6, 23, 0.24) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  padding: 0 0 92px;
}

.badge-row,
.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.badge,
.tag,
.year-pill,
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.badge.cyan,
.category-pill {
  background: rgba(6, 182, 212, 0.9);
  color: white;
  border-color: rgba(103, 232, 249, 0.48);
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}

.hero p {
  margin: 0 0 18px;
  color: #e2e8f0;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.7;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.hero-summary {
  max-width: 680px;
  color: #cbd5e1;
  font-size: 15px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meta-row {
  margin: 22px 0;
  color: var(--soft);
  font-weight: 700;
}

.meta-row strong {
  color: var(--yellow);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--line);
  color: white;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.6);
}

.btn.primary {
  background: linear-gradient(135deg, var(--cyan-strong), #2563eb);
  border-color: rgba(103, 232, 249, 0.48);
  box-shadow: 0 18px 42px rgba(6, 182, 212, 0.25);
}

.hero-arrows {
  position: absolute;
  right: max(24px, calc((100% - 1180px) / 2));
  bottom: 72px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(255, 255, 255, 0.32);
}

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

.hero-dot {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.2s ease, background 0.2s ease;
}

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

.section {
  padding: 64px 0;
}

.section.alt {
  background: rgba(15, 23, 42, 0.38);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

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

.section-kicker {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section h2,
.page-title h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
}

.section-head p,
.page-title p,
.category-lead,
.detail-lead {
  color: var(--muted);
  line-height: 1.8;
}

.rail {
  display: flex;
  gap: 22px;
  padding: 2px 2px 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.rail .wide-card {
  width: 360px;
  flex: 0 0 360px;
  scroll-snap-align: start;
}

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

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

.movie-card,
.wide-card,
.category-card,
.search-result,
.rank-row {
  position: relative;
  color: inherit;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0f172a;
  box-shadow: var(--shadow);
}

.poster-wrap img,
.wide-thumb img,
.detail-poster img,
.search-result img,
.rank-row img,
.player-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-wrap img,
.wide-thumb img {
  transition: transform 0.32s ease;
}

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

.poster-shade,
.wide-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), transparent 48%, rgba(0, 0, 0, 0.18));
}

.poster-top,
.poster-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
}

.poster-top {
  top: 12px;
}

.poster-bottom {
  bottom: 12px;
}

.poster-top span,
.poster-top strong,
.poster-bottom span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
}

.poster-bottom span:first-child {
  color: var(--yellow);
}

.poster-hover,
.wide-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.88);
  color: white;
  transform: translate(-50%, -50%) scale(0.82);
  opacity: 0;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.movie-card h3,
.wide-card h3 {
  margin: 12px 0 6px;
  font-size: 16px;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.movie-card p,
.wide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card:hover h3,
.wide-card:hover h3,
.rank-row:hover strong {
  color: var(--cyan);
}

.wide-card {
  display: block;
}

.wide-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0f172a;
  box-shadow: var(--shadow);
}

.wide-kicker {
  margin-top: 12px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

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

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

.category-card {
  min-height: 188px;
  padding: 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(8, 47, 73, 0.55));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.48);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

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

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

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

.rank-row {
  display: grid;
  grid-template-columns: 52px 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.rank-row img {
  width: 72px;
  height: 96px;
  border-radius: 12px;
}

.rank-number {
  color: #64748b;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.rank-gold .rank-number {
  color: #facc15;
}

.rank-silver .rank-number {
  color: #e2e8f0;
}

.rank-bronze .rank-number {
  color: #fb923c;
}

.rank-title {
  display: grid;
  gap: 6px;
}

.rank-title strong {
  font-size: 17px;
  transition: color 0.2s ease;
}

.rank-title em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.rank-score {
  color: var(--yellow);
  font-weight: 900;
}

.page-hero {
  padding: 60px 0 36px;
  background: radial-gradient(circle at 12% 10%, rgba(34, 211, 238, 0.18), transparent 28rem);
}

.page-title {
  max-width: 780px;
}

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

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

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  margin: 28px 0;
}

.filter-panel input,
.filter-panel select,
.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus,
.search-box input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}

.empty-state {
  display: none;
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 32px;
  align-items: start;
}

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

.player-shell video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.2);
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-button {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.92);
  color: white;
  font-size: 34px;
  box-shadow: 0 0 42px rgba(6, 182, 212, 0.36);
  transition: transform 0.2s ease;
}

.player-overlay:hover .play-button {
  transform: scale(1.06);
}

.player-status {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 4;
  color: #e2e8f0;
  font-size: 13px;
}

.detail-card,
.detail-section {
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.detail-poster {
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 3 / 4;
  background: #0f172a;
}

.detail-info h1 {
  margin-bottom: 12px;
}

.detail-lead {
  margin-bottom: 18px;
}

.detail-meta {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  color: var(--soft);
  font-size: 14px;
}

.detail-meta span {
  color: var(--muted);
}

.detail-section {
  margin-top: 26px;
  padding: 28px;
}

.detail-section h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.detail-section p {
  color: var(--soft);
  line-height: 1.9;
}

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

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 28px;
}

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

.search-result {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.search-result img {
  width: 96px;
  height: 128px;
  border-radius: 12px;
}

.search-result h3 {
  margin: 0 0 6px;
}

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

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

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

.footer-grid p {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.8;
}

.footer-grid h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

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

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

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: #64748b;
  font-size: 13px;
}

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

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

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

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

  .menu-button {
    display: block;
  }

  .hero {
    min-height: 74vh;
  }

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

  .hero-arrows {
    right: 16px;
    bottom: 28px;
  }

  .hero-dots {
    display: none;
  }

  .section-head {
    display: block;
  }

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

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

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

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

  .rank-row {
    grid-template-columns: 44px 58px 1fr;
  }

  .rank-row img {
    width: 58px;
    height: 78px;
  }

  .rank-score {
    grid-column: 3;
  }

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

  .search-result img {
    width: 72px;
    height: 96px;
  }

  .search-result .btn {
    grid-column: 2;
    justify-self: start;
  }

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

@media (max-width: 480px) {
  .grid,
  .grid.four,
  .related-grid,
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rail .wide-card {
    width: 300px;
    flex-basis: 300px;
  }

  .movie-card h3,
  .wide-card h3 {
    font-size: 14px;
  }

  .movie-card p {
    font-size: 12px;
  }
}
