* {
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --brand: #ef4444;
  --brand-dark: #dc2626;
  --brand-soft: rgba(239, 68, 68, 0.12);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 46%, #f8fafc 100%);
  color: var(--text);
}

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: 40;
  color: #ffffff;
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.35);
}

.brand-text {
  font-size: 24px;
  line-height: 1;
  background: linear-gradient(90deg, #fca5a5, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link,
.sub-nav a {
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link {
  padding: 10px 14px;
  color: #e2e8f0;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.9);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #ffffff;
}

.sub-nav {
  display: flex;
  gap: 8px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 14px;
  overflow-x: auto;
}

.sub-nav a {
  flex: 0 0 auto;
  padding: 8px 14px;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sub-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  color: #ffffff;
  background: radial-gradient(circle at top left, rgba(239, 68, 68, 0.32), transparent 34%), linear-gradient(135deg, #0f172a, #450a0a 56%, #111827);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
}

.hero-glow {
  position: absolute;
  inset: auto -120px -170px auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.36);
  filter: blur(80px);
}

.hero-track {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  min-height: 560px;
  margin: 0 auto;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.72fr);
  gap: 42px;
  align-items: center;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  filter: blur(20px) saturate(1.1);
  transform: scale(1.08);
}

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

.eyebrow {
  margin: 0 0 12px;
  color: #fca5a5;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-desc {
  width: min(680px, 100%);
  margin: 22px 0;
  color: #e2e8f0;
  font-size: 18px;
  line-height: 1.9;
}

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

.hero-tags span,
.detail-meta span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
}

.tag-row span {
  background: #f1f5f9;
  color: #475569;
}

.tag-row.large span {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 16px 28px rgba(239, 68, 68, 0.28);
}

.btn-soft {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.hero-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 26px;
  box-shadow: var(--shadow);
  aspect-ratio: 2 / 3;
  background: rgba(255, 255, 255, 0.08);
}

.hero-poster img,
.poster-link img,
.ranking-cover img,
.detail-poster img,
.rank-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

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

.hero-dot.is-active {
  width: 34px;
  background: #ef4444;
}

.category-strip,
.content-section,
.footer-inner,
.page-hero,
.detail-hero,
.player-section {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: -46px;
  position: relative;
  z-index: 3;
}

.category-card,
.category-overview-card,
.copy-card,
.movie-card,
.ranking-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.category-card {
  display: block;
  padding: 22px;
  min-height: 150px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-card:hover,
.movie-card:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.category-card strong {
  display: block;
  margin-bottom: 10px;
  color: #0f172a;
  font-size: 20px;
}

.category-card span,
.category-overview-card p,
.section-heading p,
.card-summary,
.ranking-main p,
.copy-card p,
.footer-inner p,
.page-hero p,
.detail-one-line {
  color: var(--muted);
  line-height: 1.8;
}

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

.section-heading {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 10px 18px;
  align-items: end;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.03em;
}

.section-heading p {
  grid-column: 1 / -1;
  margin: 0;
}

.section-heading span {
  height: 4px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, transparent);
}

.section-heading.light h2,
.section-heading.light p {
  color: #ffffff;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr 1fr;
  gap: 12px;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.filter-bar label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  background: #f8fafc;
}

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

.movie-card {
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

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

.movie-card:hover .poster-link img {
  transform: scale(1.05);
}

.poster-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 16px;
}

.card-title {
  display: block;
  min-height: 48px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.card-title:hover,
.text-link:hover,
.ranking-title:hover {
  color: var(--brand);
}

.card-meta {
  margin: 8px 0;
  color: #94a3b8;
  font-size: 13px;
}

.card-summary {
  display: -webkit-box;
  min-height: 78px;
  margin: 0 0 12px;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 14px;
}

.rank-section {
  padding: 60px 0;
  background: linear-gradient(135deg, #0f172a, #1e293b 48%, #450a0a);
}

.rank-section .section-heading,
.rank-grid {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 42px 70px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rank-card img {
  height: 92px;
  border-radius: 12px;
}

.rank-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #ef4444;
  font-weight: 900;
}

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

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

.rank-card b {
  color: #fca5a5;
}

.page-hero,
.detail-hero {
  margin-top: 36px;
  padding: 58px;
  border-radius: 28px;
  color: #ffffff;
  background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.36), transparent 36%), linear-gradient(135deg, #0f172a, #334155);
  box-shadow: var(--shadow);
}

.compact-hero h1,
.ranking-hero h1,
.search-hero h1 {
  margin-bottom: 14px;
}

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

.category-overview-card {
  padding: 24px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-title {
  display: inline-block;
  margin-bottom: 10px;
  color: #0f172a;
  font-size: 24px;
  font-weight: 900;
}

.category-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.category-sample a,
.text-link {
  color: #dc2626;
  font-weight: 800;
}

.category-sample a {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 13px;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 60px 96px minmax(0, 1fr) 96px;
  gap: 18px;
  align-items: center;
  padding: 14px;
}

.ranking-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  font-weight: 900;
}

.ranking-cover {
  display: block;
  height: 132px;
  overflow: hidden;
  border-radius: 14px;
  background: #e2e8f0;
}

.ranking-title {
  display: inline-block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
}

.ranking-score {
  display: grid;
  place-items: center;
  gap: 4px;
  color: #dc2626;
}

.ranking-score strong {
  font-size: 26px;
}

.ranking-score span {
  color: #94a3b8;
  font-size: 12px;
}

.detail-hero {
  padding: 28px 42px 42px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: #cbd5e1;
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 2 / 3;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.08);
}

.detail-one-line {
  margin: 20px 0;
  color: #e2e8f0;
  font-size: 18px;
}

.detail-meta {
  margin-bottom: 14px;
}

.player-section {
  padding-top: 34px;
}

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

.movie-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #020617;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #ffffff;
  background-image: linear-gradient(rgba(2, 6, 23, 0.32), rgba(2, 6, 23, 0.82)), var(--poster-image);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  padding-left: 5px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 20px 42px rgba(239, 68, 68, 0.42);
  font-size: 30px;
}

.player-cover strong {
  font-size: 20px;
}

.detail-copy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.copy-card {
  padding: 28px;
}

.copy-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.empty-state {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 16px;
  color: #991b1b;
  background: #fee2e2;
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

.site-footer {
  margin-top: 40px;
  color: #cbd5e1;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto;
  gap: 28px;
  align-items: start;
  padding: 42px 0;
}

.footer-logo {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

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

.footer-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}

.footer-links a:hover {
  background: rgba(239, 68, 68, 0.9);
}

.footer-copy {
  color: #94a3b8;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 18px;
    background: #1e293b;
    box-shadow: var(--shadow);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 54px 0 80px;
  }

  .hero-track,
  .hero-slide {
    min-height: 760px;
  }

  .hero-poster {
    width: min(320px, 80%);
    margin: 0 auto;
  }

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

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

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

  .rank-grid,
  .detail-copy,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

@media (max-width: 680px) {
  .brand-text {
    font-size: 20px;
  }

  .hero h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 34px;
  }

  .category-strip,
  .movie-grid,
  .filter-bar,
  .ranking-row,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .category-strip {
    margin-top: 20px;
  }

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

  .page-hero,
  .detail-hero {
    padding: 34px 22px;
    border-radius: 22px;
  }

  .ranking-row {
    align-items: start;
  }

  .ranking-cover {
    height: auto;
    aspect-ratio: 2 / 3;
  }

  .ranking-score {
    justify-items: start;
  }

  .detail-poster {
    width: min(260px, 82%);
  }

  .rank-card {
    grid-template-columns: 34px 60px 1fr;
  }

  .rank-card b {
    grid-column: 2 / -1;
  }
}
