:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.62);
  --panel-strong: rgba(15, 23, 42, 0.88);
  --line: rgba(148, 163, 184, 0.18);
  --text: #ffffff;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #ef4444;
  --accent-dark: #dc2626;
  --accent-soft: rgba(239, 68, 68, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 24px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(239, 68, 68, 0.15), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.nav-wrap {
  max-width: var(--max);
  height: 76px;
  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;
  min-width: max-content;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #fb7185);
  box-shadow: 0 0 34px rgba(239, 68, 68, 0.35);
  font-size: 15px;
}

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

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

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

.nav-link {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 650;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-form input {
  width: 230px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 8px 10px 8px 14px;
}

.search-form input::placeholder {
  color: var(--muted-2);
}

.search-form button,
.local-search-panel button {
  border: 0;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.search-form button:hover,
.local-search-panel button:hover,
.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mobile-nav {
  display: none;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px 16px;
}

.mobile-nav a {
  display: block;
  padding: 12px 10px;
  color: #cbd5e1;
  border-radius: 12px;
}

.mobile-nav a:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.1);
}

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

.hero {
  position: relative;
  height: 620px;
  margin-top: 76px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.68) 42%, rgba(2, 6, 23, 0.22) 100%),
    linear-gradient(0deg, #020617 0%, transparent 45%);
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 82px;
  width: min(var(--max), calc(100% - 44px));
  transform: translateX(-50%);
  max-width: 760px;
}

.hero-label,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 13px;
  color: #fecaca;
  background: var(--accent-soft);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 650px;
  margin: 0 0 24px;
  color: #cbd5e1;
  font-size: 18px;
}

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

.hero-tags span,
.tag-row span {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
}

.hero-buttons,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.detail-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 18px 50px rgba(239, 68, 68, 0.28);
}

.secondary-button,
.detail-actions a:not(.primary-button) {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #fff;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(12px);
  font-size: 30px;
  line-height: 1;
}

.hero-prev {
  left: 26px;
}

.hero-next {
  right: 26px;
}

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

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.48);
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.is-active {
  width: 34px;
  background: var(--accent);
}

.page-shell {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  padding: 70px 0;
}

.content-section + .content-section,
.content-section + .ranking-strip,
.ranking-strip + .content-section {
  margin-top: 72px;
}

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

.section-head h2,
.page-hero h1,
.story-panel h2 {
  margin: 12px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-more {
  color: #fca5a5;
  font-weight: 800;
}

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

.movie-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border 0.24s ease, transform 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(15, 23, 42, 0.88);
}

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

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.poster-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent 56%);
}

.quality-badge,
.rank-badge,
.play-chip {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.quality-badge {
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  color: #fff;
  background: var(--accent);
}

.rank-badge {
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  color: #fde68a;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.play-chip {
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(239, 68, 68, 0.88);
}

.card-body {
  padding: 17px;
}

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

.card-meta span,
.detail-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
}

.card-body h2 {
  margin: 12px 0 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
}

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

.card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 13px;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.category-card {
  position: relative;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.category-card img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  transition: transform 0.5s ease;
}

.category-card span {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.28));
}

.category-card strong,
.category-card p {
  position: relative;
  z-index: 2;
}

.category-card strong {
  font-size: 24px;
}

.category-card p {
  margin: 8px 0 0;
  color: #cbd5e1;
}

.ranking-strip {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ranking-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}

.ranking-list a {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.36);
}

.ranking-list a:hover,
.rank-row:hover {
  background: rgba(239, 68, 68, 0.12);
}

.ranking-list span,
.rank-num {
  color: #fca5a5;
  font-weight: 950;
}

.ranking-list strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.page-hero {
  margin-top: 76px;
  padding: 86px 22px 46px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0)),
    radial-gradient(circle at 18% 20%, rgba(239, 68, 68, 0.16), transparent 30%);
  border-bottom: 1px solid var(--line);
}

.page-hero > div {
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.page-hero p {
  max-width: 780px;
  margin: 16px 0 0;
  color: #cbd5e1;
  font-size: 18px;
}

.local-search-panel {
  margin-bottom: 28px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.local-search-panel form {
  display: flex;
  gap: 12px;
}

.local-search-panel input {
  flex: 1;
  min-width: 0;
  color: #fff;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  padding: 12px 16px;
}

.local-search-panel p {
  margin: 12px 0 0;
  color: var(--muted);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 54px 98px 1fr 70px;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.rank-row img {
  width: 98px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
}

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

.rank-info strong {
  font-size: 18px;
}

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

.rank-score {
  color: #fde68a;
  font-size: 20px;
  font-weight: 950;
  text-align: right;
}

.detail-hero {
  position: relative;
  margin-top: 76px;
  overflow: hidden;
  background: #020617;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  filter: blur(2px);
}

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.62) 55%, rgba(2, 6, 23, 0.88) 100%);
}

.detail-wrap {
  position: relative;
  z-index: 2;
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  padding: 44px 0 58px;
}

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

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

.detail-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 34px;
  align-items: end;
}

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

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info h1 {
  margin: 14px 0 14px;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.detail-one-line {
  max-width: 820px;
  margin: 0 0 18px;
  color: #cbd5e1;
  font-size: 18px;
}

.large-tags {
  margin-top: 16px;
}

.detail-page {
  padding-top: 48px;
}

.player-section {
  margin-bottom: 34px;
}

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

.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.big-play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 88px;
  height: 88px;
  color: #fff;
  background: rgba(239, 68, 68, 0.92);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 22px 70px rgba(239, 68, 68, 0.42);
  transform: translate(-50%, -50%);
  font-size: 30px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.big-play:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.player-shell.is-playing .big-play {
  opacity: 0;
  pointer-events: none;
}

.story-panel {
  margin-bottom: 28px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.story-panel p {
  margin: 16px 0 0;
  color: #cbd5e1;
  font-size: 17px;
}

[data-card].is-hidden {
  display: none !important;
}

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

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

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

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

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

  .brand-sub,
  .search-form {
    display: none;
  }

  .brand-name {
    font-size: 18px;
  }

  .hero,
  .page-hero,
  .detail-hero {
    margin-top: 66px;
  }

  .hero {
    height: 560px;
  }

  .hero-content {
    bottom: 76px;
    width: calc(100% - 32px);
  }

  .hero-arrow {
    display: none;
  }

  .page-shell,
  .detail-wrap {
    width: calc(100% - 32px);
  }

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

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

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

  .detail-poster {
    width: min(280px, 100%);
  }

  .rank-row {
    grid-template-columns: 38px 78px 1fr;
  }

  .rank-score {
    display: none;
  }

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

  .local-search-panel form {
    flex-direction: column;
  }
}
