:root {
  --page-bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.10);
  --brand: #dc2626;
  --brand-deep: #be123c;
  --brand-soft: rgba(220, 38, 38, 0.10);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 45%, #fff7ed 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand {
  font-size: 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #ec4899);
  box-shadow: 0 14px 34px rgba(220, 38, 38, 0.32);
}

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

.site-nav a {
  padding: 10px 15px;
  border-radius: 999px;
  color: #475569;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-soft);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: #0f172a;
}

.hero {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  background: #0f172a;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
}

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

.hero-copy {
  max-width: 720px;
  color: #ffffff;
}

.hero-tags,
.detail-tags,
.card-tags,
.movie-card-tags,
.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.detail-tags span,
.movie-card-tags span,
.meta-pills span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
}

.hero-tags .hot {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #ec4899);
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
}

.hero .lead {
  margin: 0 0 8px;
  color: #e5e7eb;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 700;
}

.hero .summary {
  max-width: 680px;
  margin: 0 0 28px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.primary-button,
.secondary-button,
.section-link,
.player-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.player-trigger {
  min-height: 48px;
  padding: 0 24px;
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, var(--brand), #ec4899);
  box-shadow: 0 18px 42px rgba(220, 38, 38, 0.32);
}

.secondary-button,
.section-link {
  min-height: 44px;
  padding: 0 18px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.section-link {
  color: var(--brand);
  border-color: rgba(220, 38, 38, 0.20);
  background: var(--brand-soft);
}

.primary-button:hover,
.secondary-button:hover,
.section-link:hover,
.player-trigger:hover {
  transform: translateY(-2px);
}

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

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

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

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

.hero-dot.active {
  width: 32px;
  background: #ffffff;
}

.hero-search {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 0;
  padding: 16px;
  display: flex;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

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

.hero-search button {
  min-width: 128px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), #ec4899);
}

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

.main-shell.tight {
  padding-top: 36px;
}

.content-section {
  margin-bottom: 76px;
}

.content-section.panel,
.detail-panel,
.player-section,
.category-card,
.search-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.content-section.panel,
.detail-panel,
.player-section,
.search-panel {
  padding: clamp(22px, 3vw, 34px);
}

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

.page-heading {
  align-items: flex-start;
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-heading h2,
.page-heading h1,
.detail-info h1,
.player-section h2,
.detail-panel h2 {
  margin: 0;
  color: #0f172a;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.section-heading h2,
.page-heading h1,
.detail-info h1 {
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.06;
}

.section-heading p,
.page-heading p {
  margin: 10px 0 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.8;
}

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

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

.movie-card a {
  display: block;
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #e2e8f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.movie-grid.compact .poster-frame,
.movie-card-small .poster-frame {
  aspect-ratio: 4 / 3;
}

.movie-card-large .poster-frame {
  aspect-ratio: 21 / 9;
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.55s ease;
}

.poster-gradient {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.18), transparent);
  transition: opacity 0.25s ease;
}

.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #111827;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.76);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.poster-year,
.poster-region {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.poster-year {
  right: 10px;
  top: 10px;
  background: rgba(220, 38, 38, 0.86);
}

.poster-region {
  left: 10px;
  bottom: 10px;
  background: rgba(15, 23, 42, 0.65);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.movie-card:hover .poster-gradient,
.movie-card:hover .poster-play,
.movie-card:hover .poster-region {
  opacity: 1;
}

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

.movie-card:hover .poster-region {
  transform: translateY(0);
}

.movie-card-body {
  display: block;
  padding: 12px 2px 0;
}

.movie-card-body strong {
  display: block;
  color: #111827;
  font-size: 16px;
  line-height: 1.45;
  transition: color 0.2s ease;
}

.movie-card:hover .movie-card-body strong {
  color: var(--brand);
}

.movie-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.movie-card-meta span:first-child {
  padding: 2px 8px;
  border-radius: 7px;
  color: #475569;
  background: #f1f5f9;
}

.movie-card-body p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.movie-card-tags {
  margin-top: 10px;
}

.movie-card-tags span {
  color: #475569;
  background: #f1f5f9;
}

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

.category-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -48px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(236, 72, 153, 0.14));
}

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

.category-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 950;
}

.category-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
}

.filter-bar .filter-input {
  flex: 1 1 260px;
}

.filter-pill {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: #475569;
  background: #ffffff;
  font-weight: 800;
}

.filter-pill.active,
.filter-pill:hover {
  color: var(--brand);
  border-color: rgba(220, 38, 38, 0.22);
  background: var(--brand-soft);
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 58px 150px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
}

.rank-num {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 18px;
  font-weight: 950;
}

.ranking-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #e2e8f0;
}

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

.ranking-info strong {
  display: block;
  margin-bottom: 7px;
  font-size: 19px;
  font-weight: 950;
}

.ranking-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ranking-meta {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  color: #64748b;
  font-size: 13px;
}

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

.breadcrumb a {
  color: var(--brand);
  font-weight: 800;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(240px, 430px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  margin-bottom: 34px;
  padding: clamp(22px, 4vw, 44px);
  border-radius: var(--radius-lg);
  color: #ffffff;
  background: radial-gradient(circle at 16% 12%, rgba(236, 72, 153, 0.28), transparent 32%), linear-gradient(135deg, #111827, #311827 55%, #0f172a);
  box-shadow: var(--shadow);
}

.detail-poster {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

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

.detail-info h1 {
  color: #ffffff;
}

.detail-info .lead {
  margin: 18px 0;
  color: #f8fafc;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.7;
}

.detail-info .summary {
  margin: 0 0 22px;
  color: #cbd5e1;
  line-height: 1.9;
}

.detail-tags span {
  color: #ffffff;
}

.detail-actions {
  margin-top: 24px;
}

.detail-actions .secondary-button {
  color: #ffffff;
}

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

.player-section h2,
.detail-panel h2 {
  margin-bottom: 20px;
  font-size: clamp(26px, 3vw, 36px);
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  aspect-ratio: 16 / 9;
}

.player-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: radial-gradient(circle at 50% 42%, rgba(220, 38, 38, 0.34), rgba(2, 6, 23, 0.62) 44%, rgba(2, 6, 23, 0.86));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-trigger {
  min-width: 170px;
  min-height: 56px;
  font-size: 18px;
}

.detail-panel {
  margin-bottom: 34px;
}

.detail-panel p {
  margin: 0 0 18px;
  color: #334155;
  line-height: 2;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.detail-meta-grid div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

.detail-meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: #cbd5e1;
  font-size: 12px;
}

.detail-meta-grid strong {
  color: #ffffff;
}

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

.empty-result {
  display: none;
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-result.visible {
  display: block;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

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

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

.footer-links a:hover,
.footer-brand:hover {
  color: var(--brand);
}

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

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

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

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

  .site-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 78px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    border-radius: 12px;
  }

  .hero,
  .hero-content {
    min-height: 76vh;
  }

  .hero-control {
    display: none;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search button {
    min-height: 48px;
  }

  .section-heading,
  .page-heading,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .ranking-item {
    grid-template-columns: 44px 96px minmax(0, 1fr);
  }

  .ranking-item .section-link {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 18px;
  }

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

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

  .ranking-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .ranking-cover {
    grid-column: 1 / -1;
  }
}
