:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --brand: #ef4444;
  --brand-dark: #b91c1c;
  --gold: #f59e0b;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, 0.16), transparent 38rem),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.header-inner {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 34px rgba(239, 68, 68, 0.36);
}

.brand strong,
.footer-brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #fecaca 42%, #f97316);
  -webkit-background-clip: text;
  color: transparent;
}

.brand em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-top: -4px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: var(--muted-strong);
  font-size: 15px;
}

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

.desktop-nav a:hover,
.desktop-nav .is-active,
.mobile-nav a:hover {
  color: #fca5a5;
}

.header-search,
.mobile-search,
.wide-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.86);
  border-radius: 999px;
  overflow: hidden;
}

.header-search input,
.mobile-search input,
.wide-search input {
  width: 210px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 11px 16px;
}

.header-search button,
.mobile-search button,
.wide-search button,
.primary-button {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--brand), #f97316);
  padding: 11px 18px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.wide-search button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.28);
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  padding: 8px 12px;
}

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

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

main {
  width: 100%;
}

.hero-carousel {
  position: relative;
  width: min(1320px, calc(100% - 32px));
  min-height: 650px;
  margin: 34px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
  background: var(--panel-strong);
}

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

.hero-slide {
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.hero-bg {
  background-size: cover;
  background-position: center;
  filter: saturate(1.15);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(680px, 58%);
  padding: 86px 0 86px 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-copy p:not(.eyebrow) {
  width: min(620px, 100%);
  margin: 22px 0 0;
  color: var(--muted-strong);
  font-size: 18px;
}

.hero-actions,
.quick-links,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-actions {
  margin-top: 28px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
}

.primary-button {
  padding: 12px 24px;
}

.ghost-button,
.quick-links a,
.section-link {
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.72);
  padding: 10px 18px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ghost-button:hover,
.quick-links a:hover,
.section-link:hover {
  border-color: rgba(248, 113, 113, 0.52);
  color: white;
  background: rgba(239, 68, 68, 0.14);
}

.hero-poster {
  position: absolute;
  right: 58px;
  bottom: 58px;
  z-index: 3;
  width: min(330px, 28vw);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.55);
  transform: rotate(2deg);
}

.hero-poster img,
.poster-link img,
.detail-cover,
.category-hero-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-tags {
  margin-top: 20px;
}

.tag-row span,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(248, 113, 113, 0.26);
  border-radius: 999px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.20);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.hero-dots {
  position: absolute;
  left: 72px;
  bottom: 34px;
  z-index: 4;
  display: flex;
  gap: 9px;
}

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

.hero-dot.is-active {
  width: 36px;
  background: #f97316;
}

.page-section,
.inner-hero,
.breadcrumb,
.detail-layout {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
}

.page-section {
  padding: 58px 0 0;
}

.quick-search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wide-search {
  flex: 1;
  max-width: 720px;
}

.wide-search input {
  width: 100%;
  padding: 15px 20px;
}

.wide-search button {
  padding: 15px 24px;
}

.quick-links a,
.section-link {
  border-radius: 999px;
  font-weight: 800;
}

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

.section-heading h2,
.panel-title h2,
.inner-hero h1,
.detail-content h1 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

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

.category-tile,
.category-hero-tile,
.ranking-panel,
.info-card,
.detail-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.58));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.category-tile {
  padding: 22px;
  min-height: 150px;
}

.category-tile span,
.category-hero-tile span {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 900;
}

.category-tile p,
.category-hero-tile p,
.movie-card p,
.inner-hero p,
.detail-content p,
.site-footer p {
  margin: 0;
  color: var(--muted);
}

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

.category-hero-tile {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.category-hero-tile img {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: brightness(0.55);
  transition: transform 0.35s ease;
}

.category-hero-tile span,
.category-hero-tile p {
  position: relative;
  z-index: 1;
}

.category-hero-tile:hover img {
  transform: scale(1.06);
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

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

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

.movie-row {
  display: flex;
  overflow-x: auto;
  padding: 0 0 12px;
  scroll-snap-type: x proximity;
}

.movie-row .movie-card {
  flex: 0 0 210px;
  scroll-snap-align: start;
}

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.16);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(248, 113, 113, 0.48);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

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

.poster-link img {
  transition: transform 0.35s ease, filter 0.35s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.07);
  filter: brightness(0.78);
}

.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: rgba(239, 68, 68, 0.86);
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #111827;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  font-size: 14px;
}

.card-body {
  padding: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.card-body h2 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.32;
}

.card-body h2 a:hover {
  color: #fca5a5;
}

.card-body p {
  display: -webkit-box;
  min-height: 46px;
  overflow: hidden;
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-body .tag-row {
  margin-top: 12px;
}

.ranking-panel {
  position: sticky;
  top: 98px;
  padding: 22px;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.rank-row span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: rgba(239, 68, 68, 0.76);
  font-weight: 900;
}

.rank-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row em {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.section-link.full {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.inner-hero {
  padding: 72px 0 16px;
}

.inner-hero p {
  width: min(780px, 100%);
  font-size: 17px;
}

.inline-filter {
  margin-top: 24px;
}

.breadcrumb {
  padding: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

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

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

.movie-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.15), rgba(2, 6, 23, 0.72));
}

.play-overlay span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 20px 60px rgba(239, 68, 68, 0.42);
  font-size: 32px;
}

.play-overlay strong {
  display: block;
  font-size: 20px;
}

.play-overlay.is-hidden {
  display: none;
}

.detail-content {
  margin-top: 24px;
  padding: 28px;
}

.detail-content .lead {
  color: var(--muted-strong);
  font-size: 20px;
}

.detail-content h2 {
  margin: 28px 0 10px;
  font-size: 26px;
}

.detail-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.detail-cover {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  aspect-ratio: 2 / 3;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.info-card {
  padding: 22px;
}

.info-card h2 {
  margin: 0 0 14px;
}

.info-card p {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.info-card strong {
  color: var(--muted);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.site-footer {
  width: min(1320px, calc(100% - 32px));
  margin: 76px auto 0;
  padding: 36px 0 30px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 210px;
  gap: 28px;
}

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

.site-footer a:not(.footer-brand) {
  display: block;
  color: var(--muted-strong);
  margin: 6px 0;
}

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

.copyright {
  margin-top: 28px !important;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .menu-button {
    display: inline-flex;
    margin-left: auto;
  }

  .hero-copy {
    width: 68%;
  }

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

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

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

  .ranking-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  .header-inner,
  .page-section,
  .inner-hero,
  .breadcrumb,
  .detail-layout,
  .site-footer,
  .hero-carousel,
  .mobile-nav {
    width: min(100% - 24px, 1320px);
  }

  .brand em {
    display: none;
  }

  .hero-carousel {
    min-height: 720px;
    border-radius: 24px;
  }

  .hero-copy {
    width: auto;
    padding: 36px 24px 0;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 15px;
  }

  .hero-poster {
    right: 24px;
    left: 24px;
    bottom: 72px;
    width: auto;
    height: 260px;
    aspect-ratio: auto;
    transform: none;
  }

  .hero-dots {
    left: 24px;
    bottom: 28px;
  }

  .quick-search-panel,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .detail-side {
    display: grid;
  }

  .info-card,
  .tag-cloud {
    grid-column: 1 / -1;
  }

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

@media (max-width: 520px) {
  .mobile-search,
  .wide-search {
    align-items: stretch;
    flex-direction: column;
    border-radius: 20px;
  }

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

  .movie-grid,
  .compact-grid,
  .category-grid,
  .category-hero-grid,
  .footer-grid,
  .detail-side {
    grid-template-columns: 1fr;
  }

  .hero-carousel {
    min-height: 760px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

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