/* Core layout */
:root {
  --bg: #12070a;
  --bg-soft: #201014;
  --panel: rgba(255, 247, 237, 0.08);
  --panel-strong: rgba(255, 247, 237, 0.14);
  --line: rgba(255, 236, 191, 0.18);
  --text: #fff7ed;
  --muted: #f8d9a7;
  --muted-2: #cba36e;
  --brand: #dc2626;
  --brand-2: #f59e0b;
  --brand-3: #7f1d1d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(220, 38, 38, 0.34), transparent 32rem),
    radial-gradient(circle at 92% 8%, rgba(245, 158, 11, 0.22), transparent 28rem),
    linear-gradient(135deg, #12070a 0%, #1f0f12 48%, #090405 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

body.menu-open {
  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 var(--line);
  background: rgba(18, 7, 10, 0.76);
  backdrop-filter: blur(18px);
}

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

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.35);
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.nav-dropdown > button,
.nav-dropdown-panel a {
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-dropdown > button:hover,
.nav-dropdown-panel a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > button {
  cursor: pointer;
  color: var(--muted);
  background: transparent;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(26, 10, 12, 0.96);
  box-shadow: var(--shadow);
  display: none;
  grid-template-columns: 1fr;
  gap: 4px;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  display: grid;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

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

main {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: stretch;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(18, 7, 10, 0.94) 0%, rgba(18, 7, 10, 0.74) 42%, rgba(18, 7, 10, 0.34) 100%),
    var(--hero-image, linear-gradient(135deg, #450a0a, #92400e));
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 34%, rgba(245, 158, 11, 0.26), transparent 22rem),
    linear-gradient(to bottom, transparent 0%, rgba(18, 7, 10, 0.86) 96%);
}

.hero-track {
  width: 100%;
  position: relative;
}

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

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

.hero-inner {
  width: min(1220px, calc(100% - 32px));
  height: 100%;
  min-height: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.72fr);
  gap: 56px;
  align-items: center;
  padding: 78px 0 110px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #fed7aa;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
}

.hero h1,
.page-hero h1,
.detail-title {
  margin: 0 0 18px;
  font-size: clamp(40px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero p,
.page-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 690px;
}

.hero-meta,
.detail-meta,
.card-meta,
.rank-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
}

.hero-meta span,
.detail-meta span,
.card-meta span,
.rank-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.07);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 32px rgba(220, 38, 38, 0.34);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.28);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  border: 1px solid var(--line);
}

.hero-poster-panel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 480px;
  border: 1px solid rgba(255, 236, 191, 0.24);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.9), rgba(146, 64, 14, 0.68));
  box-shadow: var(--shadow);
}

.hero-poster-panel img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
}

.hero-poster-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(18, 7, 10, 0.96), transparent);
}

.hero-card-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 2;
}

.hero-card-caption strong {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

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

.hero-dots button {
  width: 34px;
  height: 7px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.hero-dots button.is-active {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.content-section,
.page-section,
.detail-section {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 720px;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.poster {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(245, 158, 11, 0.28), transparent 13rem),
    linear-gradient(135deg, #450a0a, #78350f);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.35s ease, opacity 0.25s ease;
}

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

.poster.poster-missing::after,
.hero-poster-panel.poster-missing::after {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: rgba(255, 247, 237, 0.86);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.82), rgba(146, 64, 14, 0.8));
}

.poster-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(18, 7, 10, 0.78);
  color: #fed7aa;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.card-body {
  padding: 16px;
}

.card-meta {
  font-size: 12px;
  gap: 6px;
}

.card-meta span {
  padding: 2px 8px;
}

.movie-card h2 {
  margin: 10px 0 8px;
  font-size: 19px;
  line-height: 1.24;
}

.movie-card p {
  margin: 0;
  min-height: 52px;
  color: var(--muted);
  font-size: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag-row span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.16);
  color: #fed7aa;
  font-size: 12px;
}

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

.category-tile {
  position: relative;
  min-height: 180px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(245, 158, 11, 0.11));
}

.category-tile::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.16);
}

.category-tile strong {
  display: block;
  margin-bottom: 12px;
  font-size: 23px;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
}

.category-tile span {
  display: inline-flex;
  margin-top: 20px;
  color: #fed7aa;
  font-weight: 800;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 74px 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.075);
}

.rank-number {
  font-size: 28px;
  font-weight: 950;
  color: #fed7aa;
  text-align: center;
}

.rank-cover {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #450a0a, #78350f);
}

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

.rank-item h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.rank-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.rank-score {
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 170px auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.075);
}

.search-field {
  display: grid;
  gap: 6px;
}

.search-field span {
  color: var(--muted);
  font-size: 13px;
}

.filter-bar input,
.filter-bar select,
.filter-bar button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(18, 7, 10, 0.62);
  outline: none;
}

.filter-bar button {
  cursor: pointer;
  font-weight: 800;
}

.filter-count {
  color: var(--muted);
  white-space: nowrap;
}

.page-hero,
.detail-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.page-hero::before,
.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(18, 7, 10, 0.96), rgba(18, 7, 10, 0.7)),
    var(--hero-image, linear-gradient(135deg, #450a0a, #78350f));
  background-size: cover;
  background-position: center;
}

.page-hero::after,
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 18% 22%, rgba(245, 158, 11, 0.26), transparent 22rem);
}

.page-hero-inner,
.detail-hero-inner {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 82px 0;
}

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

.detail-poster {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #450a0a, #78350f);
}

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

.detail-title {
  font-size: clamp(38px, 6vw, 78px);
}

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

.text-panel,
.side-panel,
.player-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.text-panel h2,
.side-panel h2,
.player-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.text-panel p,
.side-panel p {
  color: var(--muted);
}

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

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.25)),
    var(--player-image, linear-gradient(135deg, #450a0a, #78350f));
  background-size: cover;
  background-position: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-shell.is-playing .player-cover {
  opacity: 0;
  visibility: hidden;
}

.player-start {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
  cursor: pointer;
  font-size: 32px;
  box-shadow: 0 20px 50px rgba(220, 38, 38, 0.42);
}

.player-message {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  text-align: center;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.player-message.is-visible {
  transform: translateY(0);
  opacity: 1;
}

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

.related-grid .movie-card h2 {
  font-size: 15px;
}

.related-grid .movie-card p {
  display: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(69, 10, 10, 0.92), rgba(120, 53, 15, 0.82));
}

.footer-grid {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 36px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 36px;
}

.footer-logo {
  font-size: 26px;
  font-weight: 950;
  margin-bottom: 12px;
}

.site-footer p {
  color: var(--muted);
}

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

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.footer-links a {
  color: var(--muted);
}

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

.footer-bottom {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(255, 236, 191, 0.2);
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: #fff;
  background: rgba(18, 7, 10, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  z-index: 40;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

.hidden-by-filter {
  display: none !important;
}

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

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

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

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

  .site-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-content: start;
    padding: 24px;
    background: rgba(18, 7, 10, 0.96);
    border-top: 1px solid var(--line);
  }

  body.menu-open .site-nav {
    display: grid;
  }

  .nav-dropdown-panel {
    position: static;
    width: 100%;
    display: grid;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.06);
  }

  .hero,
  .hero-inner {
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: 72px 0 96px;
  }

  .hero-poster-panel {
    min-height: 360px;
  }

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

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 48px 72px minmax(0, 1fr);
  }

  .rank-score {
    grid-column: 3;
    justify-self: start;
  }

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

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

@media (max-width: 560px) {
  .header-inner,
  .content-section,
  .page-section,
  .detail-section,
  .page-hero-inner,
  .detail-hero-inner,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 24px, 1220px);
  }

  .brand-text small {
    display: none;
  }

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

  .hero p,
  .page-hero p {
    font-size: 16px;
  }

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

  .footer-bottom {
    display: grid;
    gap: 8px;
  }
}
