:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #dc2626;
  --brand-dark: #b91c1c;
  --brand-soft: #fee2e2;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(229, 231, 235, 0.86);
  backdrop-filter: blur(16px);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

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

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

.site-logo::before,
.footer-logo::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #f97316);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.32);
}

.site-logo span {
  font-size: 20px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.desktop-nav a {
  padding: 8px 12px;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 2px;
  background: #111827;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.mobile-nav a {
  padding: 10px 12px;
  background: var(--surface-soft);
  font-weight: 700;
}

main {
  min-height: 65vh;
}

.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 520px;
  overflow: hidden;
  background: #111827;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.12)), var(--hero-url);
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 22% 25%, rgba(220, 38, 38, 0.44), transparent 34%), linear-gradient(0deg, rgba(17, 24, 39, 0.6), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.hero-copy {
  width: min(650px, 100%);
  color: #ffffff;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.section-kicker,
.detail-kicker {
  color: var(--brand);
  background: var(--brand-soft);
}

.hero-copy h1,
.hero-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.hero-copy p {
  max-width: 620px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

.hero-meta,
.detail-meta,
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta {
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-meta span,
.detail-meta span,
.breadcrumbs a,
.breadcrumbs span {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
}

.detail-meta span,
.breadcrumbs a,
.breadcrumbs span {
  background: var(--surface-soft);
  color: #374151;
}

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

.primary-btn,
.secondary-btn,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.primary-btn {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.32);
}

.primary-btn:hover,
.section-more:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.hero-control {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.hero-control:hover {
  background: rgba(255, 255, 255, 0.32);
}

.hero-control.prev {
  left: 22px;
}

.hero-control.next {
  right: 22px;
}

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

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

.hero-dots button.is-active {
  background: #ffffff;
}

.page-shell,
.detail-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.page-shell {
  padding: 52px 0;
}

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

.section-heading h1,
.section-heading h2,
.detail-title {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.04em;
  font-weight: 900;
}

.section-heading h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 42px);
}

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

.section-more {
  flex: 0 0 auto;
  background: var(--brand);
  color: #ffffff;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 14px;
  margin: 26px 0 32px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(220, 38, 38, 0.34);
  box-shadow: var(--shadow);
}

.poster-link {
  display: block;
}

.poster-card {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background-image: linear-gradient(145deg, rgba(17, 24, 39, 0.15), rgba(17, 24, 39, 0.72)), var(--poster-url);
  background-position: center;
  background-size: cover;
}

.poster-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(17, 24, 39, 0.78), transparent);
}

.poster-badge,
.poster-type {
  position: absolute;
  z-index: 2;
  top: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.poster-badge {
  left: 12px;
  background: var(--brand);
}

.poster-type {
  right: 12px;
  background: rgba(17, 24, 39, 0.68);
  backdrop-filter: blur(8px);
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
}

.card-body h3 a:hover {
  color: var(--brand);
}

.card-desc {
  display: -webkit-box;
  min-height: 48px;
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-desc.compact {
  min-height: 44px;
  font-size: 13px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6b7280;
  font-size: 12px;
}

.card-meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

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

.category-card {
  position: relative;
  min-height: 170px;
  padding: 22px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #111827, #374151);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.category-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -52px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.48);
}

.category-card h3 {
  position: relative;
  z-index: 2;
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 900;
}

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

.category-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.78);
}

.category-card span {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
}

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

.rank-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item a {
  display: grid;
  grid-template-columns: 44px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.rank-item a:hover {
  transform: translateY(-3px);
  border-color: rgba(220, 38, 38, 0.34);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 16px;
  font-weight: 900;
}

.rank-thumb {
  width: 58px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background-image: linear-gradient(145deg, rgba(17, 24, 39, 0.15), rgba(17, 24, 39, 0.62)), var(--poster-url);
  background-position: center;
  background-size: cover;
}

.rank-info {
  min-width: 0;
}

.rank-info strong,
.rank-info em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info strong {
  font-weight: 900;
}

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

.side-panel {
  position: sticky;
  top: 90px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.side-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.side-panel p {
  margin: 0 0 16px;
  color: var(--muted);
}

.detail-hero {
  padding: 38px 0;
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
  border-bottom: 1px solid var(--line);
}

.detail-shell {
  padding: 34px 0 54px;
}

.detail-intro {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  background-image: linear-gradient(145deg, rgba(17, 24, 39, 0.18), rgba(17, 24, 39, 0.72)), var(--poster-url);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.detail-title {
  margin: 12px 0 16px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.08;
}

.detail-summary {
  margin: 22px 0 0;
  color: #374151;
  font-size: 17px;
}

.watch-player {
  position: relative;
  overflow: hidden;
  margin-top: 34px;
  border-radius: 24px;
  background: #000000;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: radial-gradient(circle at center, rgba(220, 38, 38, 0.24), rgba(0, 0, 0, 0.38));
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.watch-player.is-playing .play-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-overlay span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 20px 50px rgba(220, 38, 38, 0.42);
  font-size: 38px;
  transform: translateX(3px);
}

.content-block {
  margin-top: 30px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.content-block h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 900;
}

.content-block p {
  margin: 0;
  color: #374151;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

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

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

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

.footer-inner p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

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

.footer-links a {
  padding: 8px 12px;
  background: var(--surface-soft);
  color: #374151;
  font-size: 14px;
  font-weight: 800;
}

.empty-message {
  display: none;
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
}

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

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

  .menu-toggle {
    display: block;
  }

  body.nav-open .mobile-nav {
    display: grid;
  }

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

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

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

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

  .side-panel {
    position: static;
  }

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

@media (max-width: 720px) {
  .hero-carousel {
    height: 76vh;
    min-height: 560px;
  }

  .hero-control {
    display: none;
  }

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

  .section-heading {
    display: block;
  }

  .section-more {
    margin-top: 16px;
  }

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

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

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 15px;
  }

  .card-desc {
    font-size: 13px;
  }

  .footer-inner {
    display: grid;
  }
}

@media (max-width: 460px) {
  .movie-grid,
  .movie-grid.compact-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

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

  .rank-item a {
    grid-template-columns: 36px 50px minmax(0, 1fr);
  }

  .rank-number {
    width: 32px;
    height: 32px;
  }
}
