* {
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --bg-card: #1f2937;
  --bg-elevated: #243044;
  --line: #334155;
  --text: #ffffff;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --orange: #ea580c;
  --amber: #f59e0b;
  --yellow: #facc15;
  --red: #ef4444;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(234, 88, 12, 0.18), transparent 36rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.14), transparent 34rem),
    linear-gradient(135deg, #0f172a 0%, #1e293b 46%, #0f172a 100%);
}

body.is-locked {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.site-header-inner {
  max-width: 1280px;
  height: 68px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 15px 28px rgba(239, 68, 68, 0.28);
}

.brand-name {
  font-size: 1.45rem;
}

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

.nav-link,
.mobile-link {
  color: var(--text-soft);
  font-weight: 700;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link {
  padding: 10px 16px;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(6, 182, 212, 0.95));
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: rgba(30, 41, 59, 0.95);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: currentColor;
}

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

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

.mobile-link {
  padding: 12px 14px;
}

.hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  isolation: isolate;
}

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

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

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) brightness(0.56);
  transform: scale(1.05);
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.72) 46%, rgba(15, 23, 42, 0.28) 100%),
    linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0) 42%),
    radial-gradient(circle at 72% 22%, rgba(245, 158, 11, 0.36), transparent 26rem);
}

.hero-inner {
  width: min(1280px, 100%);
  min-height: 650px;
  padding: 72px 24px 92px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.58fr);
  align-items: center;
  gap: 44px;
}

.hero-copy {
  animation: fadeUp 0.8s ease both;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.hero h1 {
  max-width: 850px;
  margin: 0 0 20px;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.hero p {
  max-width: 760px;
  margin: 0 0 28px;
  color: #e2e8f0;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  line-height: 1.75;
}

.hero-actions,
.filter-row,
.category-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px) scale(1.02);
}

.button-primary {
  color: #9a3412;
  background: #fff;
  box-shadow: 0 18px 34px rgba(255, 255, 255, 0.12);
}

.button-ghost {
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

.button-dark {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 18px 34px rgba(59, 130, 246, 0.2);
}

.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.44);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.hero-panel img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.hero-panel-body {
  padding: 22px;
}

.hero-panel-body strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.35rem;
}

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

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

.hero-dot.is-active {
  background: #fff;
}

.content-section,
.page-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.content-section {
  padding: 62px 0;
}

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

.section-heading h2,
.page-title h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.section-heading p,
.page-title p {
  max-width: 760px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.75;
}

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

.movie-card {
  border: 1px solid rgba(51, 65, 85, 0.86);
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.86);
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  border-color: rgba(250, 204, 21, 0.38);
  transform: translateY(-7px);
  box-shadow: 0 28px 46px rgba(0, 0, 0, 0.34);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #334155);
}

.poster {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

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

.play-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.28);
}

.movie-card-body {
  padding: 18px;
}

.movie-meta {
  margin-bottom: 9px;
  color: #fcd34d;
  font-size: 0.82rem;
  font-weight: 800;
}

.movie-card h3 {
  margin: 0 0 10px;
  font-size: 1.13rem;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: var(--yellow);
}

.movie-card p {
  min-height: 3.2em;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

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

.tag-row span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.14);
}

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

.category-card {
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 16rem),
    linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-6px);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
  font-size: 1.45rem;
}

.category-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.page-shell {
  padding: 54px 0 72px;
}

.page-title {
  margin-bottom: 34px;
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.16), transparent 18rem),
    rgba(15, 23, 42, 0.68);
  box-shadow: var(--shadow);
}

.filter-panel {
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid rgba(51, 65, 85, 0.95);
  border-radius: 24px;
  background: rgba(30, 41, 59, 0.86);
}

.search-input,
.select-input {
  min-height: 48px;
  border: 1px solid rgba(71, 85, 105, 0.86);
  border-radius: 14px;
  color: #fff;
  background: #334155;
  outline: none;
}

.search-input {
  flex: 1 1 320px;
  padding: 0 16px;
}

.select-input {
  padding: 0 14px;
}

.search-input:focus,
.select-input:focus {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

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

.rank-panel {
  padding: 22px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  border-radius: 24px;
  background: rgba(30, 41, 59, 0.86);
}

.rank-panel h2 {
  margin: 0 0 18px;
}

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

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

.rank-item:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: translateX(4px);
}

.rank-item img {
  width: 72px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  background: #111827;
}

.rank-item span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item small {
  grid-column: 2;
  margin-top: -20px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--text-muted);
  font-weight: 700;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.55fr);
  gap: 32px;
  align-items: start;
}

.detail-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.detail-copy p {
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.85;
}

.detail-poster {
  border-radius: 28px;
  overflow: hidden;
  background: #111827;
  box-shadow: var(--shadow);
}

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

.player-shell {
  position: relative;
  margin: 38px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.start-player {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.52), rgba(2, 6, 23, 0.22));
  cursor: pointer;
}

.start-player span {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 24px 48px rgba(239, 68, 68, 0.36);
  transition: transform 0.2s ease;
}

.start-player:hover span {
  transform: scale(1.08);
}

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

.detail-section {
  margin-top: 34px;
  padding: 30px;
  border: 1px solid rgba(51, 65, 85, 0.88);
  border-radius: 26px;
  background: rgba(30, 41, 59, 0.78);
}

.detail-section h2 {
  margin: 0 0 14px;
  font-size: 1.65rem;
}

.detail-section p {
  margin: 0 0 14px;
  color: var(--text-soft);
  line-height: 1.9;
}

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

.empty-state {
  display: none;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text-muted);
  text-align: center;
  background: rgba(30, 41, 59, 0.72);
}

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

.site-footer {
  margin-top: 28px;
  border-top: 1px solid rgba(51, 65, 85, 0.92);
  background: rgba(15, 23, 42, 0.92);
}

.footer-grid {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
}

.footer-brand {
  margin-bottom: 12px;
  font-size: 1.45rem;
  font-weight: 900;
}

.site-footer p,
.site-footer a {
  color: var(--text-muted);
  line-height: 1.75;
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

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

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

.copyright {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.7);
  color: var(--text-muted);
  font-size: 0.92rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .hero-inner,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 420px;
  }

  .rank-layout,
  .related-grid {
    grid-template-columns: 1fr;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .site-header-inner {
    padding: 0 18px;
  }

  .content-section,
  .page-shell,
  .footer-grid,
  .copyright {
    width: min(100% - 32px, 1280px);
  }

  .hero,
  .hero-inner {
    min-height: 720px;
  }

  .hero-inner {
    padding: 52px 18px 90px;
  }

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

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

  .page-title {
    padding: 28px;
  }

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

@media (max-width: 520px) {
  .brand-name {
    font-size: 1.12rem;
  }

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

  .hero-actions,
  .filter-row,
  .category-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .search-input,
  .select-input {
    width: 100%;
  }

  .detail-section {
    padding: 22px;
  }
}
