* {
  box-sizing: border-box;
}

:root {
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --line: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --brand: #f97316;
  --brand-2: #dc2626;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 34rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

button,
input {
  font: inherit;
}

main {
  min-height: 60vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.nav-shell {
  max-width: 1240px;
  height: 68px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-size: 17px;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.3);
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: scale(1.08) rotate(-3deg);
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.nav-link {
  padding: 9px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.28);
}

.menu-toggle {
  display: none;
  padding: 9px 12px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  padding: 12px 22px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.mobile-nav .nav-link {
  display: block;
  margin: 4px 0;
}

.hero-carousel {
  position: relative;
  height: 72vh;
  min-height: 560px;
  overflow: hidden;
  background: #020617;
}

.hero-stage,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  transition: opacity 0.75s ease, transform 1.2s ease;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.1));
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg), transparent 42%);
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 70px 22px 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.24);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.hero-content h1,
.page-hero h1,
.detail-hero h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 18px 35px rgba(0, 0, 0, 0.38);
}

.hero-content p,
.page-hero p,
.detail-hero p {
  max-width: 760px;
  margin: 0 0 24px;
  color: #dbeafe;
  font-size: clamp(16px, 2vw, 21px);
  text-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

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

.hero-tags span,
.tag-row span,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 12px;
}

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

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 14px;
  font-weight: 800;
  transition: 0.25s ease;
}

.primary-btn {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.28);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.primary-btn:hover {
  background: #ea580c;
}

.ghost-btn {
  color: #fff;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(10px);
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
  transition: 0.2s ease;
}

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

.hero-thumbs {
  position: absolute;
  right: max(22px, calc((100vw - 1240px) / 2 + 22px));
  bottom: 82px;
  z-index: 4;
  width: 360px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.hero-thumb {
  min-height: 92px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  border-radius: 16px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  transition: 0.25s ease;
}

.hero-thumb:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.58);
}

.hero-thumb span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.9);
}

.section-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 58px 22px;
}

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

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
}

.compact-heading h2 {
  font-size: 24px;
}

.section-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.22);
}

.section-more {
  color: #fdba74;
  font-size: 14px;
  font-weight: 800;
}

.section-more:hover {
  color: #fed7aa;
}

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

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(249, 115, 22, 0.34);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background-color: #111827;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.03) 64%);
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-frame::after {
  opacity: 0.55;
}

.play-badge {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(249, 115, 22, 0.92);
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0;
  transition: 0.25s ease;
}

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

.quality-badge,
.card-rank {
  position: absolute;
  z-index: 3;
  top: 12px;
  padding: 5px 9px;
  border-radius: 10px;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.quality-badge {
  right: 12px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.card-rank {
  left: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-style: normal;
}

.card-body {
  padding: 16px;
}

.movie-card h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 17px;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: #fb923c;
}

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

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 12px;
}

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

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

.movie-card.is-compact p {
  min-height: 42px;
  font-size: 13px;
}

.category-showcase {
  display: grid;
  gap: 34px;
}

.category-showcase h3 {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
  font-size: 22px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

.horizontal-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.horizontal-rail .movie-card {
  scroll-snap-align: start;
}

.rank-panel,
.prose-card,
.detail-main,
.detail-side,
.toolbar {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
}

.rank-panel {
  padding: 22px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 38px 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.09);
  transition: 0.22s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  background: rgba(51, 65, 85, 0.82);
  border-color: rgba(249, 115, 22, 0.28);
}

.rank-num {
  color: #334155;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
}

.rank-cover {
  width: 96px;
  aspect-ratio: 16 / 10;
  border-radius: 13px;
  background-size: cover;
  background-position: center;
}

.rank-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rank-copy strong {
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-copy small,
.rank-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rank-copy em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-hero,
.detail-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.soft-hero {
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.2), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.page-hero > div,
.detail-hero-inner {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: 70px 0;
}

.page-hero h1,
.detail-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
}

.toolbar {
  max-width: 1240px;
  margin: 42px auto 0;
  padding: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.search-box span {
  color: var(--brand);
  font-size: 20px;
}

.search-box input {
  width: 100%;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #64748b;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.filter-chip {
  padding: 8px 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.76);
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: #fff;
  background: var(--brand);
  border-color: rgba(249, 115, 22, 0.3);
}

.empty-state {
  display: none;
  margin-top: 20px;
  padding: 28px;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

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

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

.category-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  border-radius: 22px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: 0.25s ease;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: rgba(249, 115, 22, 0.38);
}

.category-card span {
  color: #fed7aa;
  font-size: 13px;
  font-weight: 900;
}

.category-card strong {
  color: #fff;
  font-size: 21px;
}

.category-card em {
  color: #cbd5e1;
  font-style: normal;
  font-size: 13px;
}

.detail-hero {
  position: relative;
  min-height: 520px;
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.97), rgba(2, 6, 23, 0.6), rgba(2, 6, 23, 0.12));
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg), transparent 50%);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
}

.player-section {
  padding-top: 0;
}

.video-player {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.movie-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: white;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.18), rgba(0, 0, 0, 0.72));
  border: 0;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  box-shadow: 0 18px 44px rgba(249, 115, 22, 0.38);
  font-size: 28px;
}

.player-overlay strong {
  font-size: 24px;
}

.player-overlay small {
  color: #cbd5e1;
}

.video-player.has-error .player-overlay {
  background: rgba(127, 29, 29, 0.84);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
}

.detail-main,
.detail-side,
.prose-card {
  padding: 28px;
}

.detail-main h2,
.detail-side h2,
.prose-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-main p,
.prose-card p {
  margin: 0 0 22px;
  color: #cbd5e1;
  font-size: 16px;
}

.detail-side dl {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px 16px;
  margin: 0 0 20px;
}

.detail-side dt {
  color: var(--muted-2);
}

.detail-side dd {
  margin: 0;
  color: #e2e8f0;
}

.site-footer {
  margin-top: 50px;
  background: linear-gradient(180deg, #020617, #0f172a);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.footer-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 22px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 34px;
}

.footer-brand p {
  max-width: 520px;
  color: var(--muted);
}

.site-footer h3 {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.site-footer a:not(.brand) {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}

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

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--muted-2);
  font-size: 13px;
}

.back-top {
  padding: 9px 13px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--brand);
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

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

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

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

  .hero-thumbs {
    display: none;
  }

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

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

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

@media (max-width: 760px) {
  .nav-shell {
    height: 64px;
    padding: 0 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .hero-carousel {
    min-height: 520px;
    height: 72vh;
  }

  .hero-content {
    padding: 58px 18px 118px;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-hero h1 {
    font-size: 38px;
  }

  .section-shell {
    padding: 42px 16px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .featured-grid,
  .medium-grid,
  .catalog-grid,
  .small-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .movie-card p {
    min-height: 40px;
  }

  .rank-item {
    grid-template-columns: 32px 82px 1fr;
  }

  .rank-cover {
    width: 82px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    padding: 36px 16px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .featured-grid,
  .medium-grid,
  .catalog-grid,
  .small-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    width: 100%;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

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