:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #dc2626;
  --red-dark: #991b1b;
  --black: #111827;
  --soft-red: #fee2e2;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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

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

.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.9);
  backdrop-filter: blur(18px);
}

.nav-shell {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.02em;
}

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

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

.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: #374151;
  font-weight: 650;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover {
  color: var(--red);
  background: var(--soft-red);
}

.menu-toggle {
  display: none;
  border: 0;
  background: #111827;
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 20px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

.hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  color: #ffffff;
  background: #0f172a;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(239, 68, 68, 0.48), transparent 34%), radial-gradient(circle at 80% 30%, rgba(124, 58, 237, 0.28), transparent 36%), linear-gradient(135deg, #111827 0%, #0f172a 45%, #450a0a 100%);
}

.hero-stage {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 86px 22px 64px;
}

.hero-slide {
  display: none;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.78fr);
  align-items: center;
  gap: 44px;
  min-height: 470px;
}

.hero-slide.active {
  display: grid;
  animation: fadeUp 0.55s ease both;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 720px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fecaca;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 750;
}

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

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

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

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 14px 32px rgba(220, 38, 38, 0.36);
}

.btn-dark {
  color: #ffffff;
  background: #111827;
}

.btn-light {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-poster {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.42);
  transform: rotate(2deg);
  background: rgba(255, 255, 255, 0.08);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.hero-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.6));
}

.hero-meta {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.hero-meta strong {
  font-size: 20px;
}

.hero-dots {
  position: relative;
  max-width: 1180px;
  margin: -38px auto 0;
  padding: 0 22px 44px;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 38px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

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

.section {
  padding: 56px 0;
}

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

.section-title h2,
.page-title h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.section-title p,
.page-title p,
.detail-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.category-tile {
  min-height: 150px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #fff1f2);
  border: 1px solid rgba(229, 231, 235, 0.92);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.category-tile span,
.category-tile p {
  color: var(--muted);
}

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

.movie-card {
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.95);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card.compact p {
  display: none;
}

.poster {
  position: relative;
  display: block;
  background: linear-gradient(135deg, #111827, #7f1d1d);
}

.poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.poster-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(17, 24, 39, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 14px;
}

.card-title {
  display: -webkit-box;
  min-height: 48px;
  margin-bottom: 8px;
  overflow: hidden;
  color: #111827;
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-title:hover {
  color: var(--red);
}

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

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

.tag-row span,
.meta-chip {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--red-dark);
  background: var(--soft-red);
  font-size: 12px;
  font-weight: 750;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.rank-panel,
.filter-panel,
.detail-panel,
.player-panel {
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.rank-panel {
  padding: 18px;
}

.rank-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
}

.rank-row:hover {
  background: #f9fafb;
}

.rank-row img {
  grid-row: span 2;
  width: 64px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-name {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta {
  color: var(--muted);
  font-size: 13px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
}

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

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

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.page-hero {
  padding: 54px 0 30px;
  background: linear-gradient(135deg, #fff7f7, #ffffff);
}

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

.breadcrumb a:hover {
  color: var(--red);
}

.detail-hero {
  padding: 44px 0;
  background: linear-gradient(135deg, #111827, #450a0a);
  color: #ffffff;
}

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

.detail-cover {
  overflow: hidden;
  border-radius: 30px;
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
}

.detail-cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

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

.detail-title p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 42px 0 62px;
}

.player-panel {
  overflow: hidden;
}

.player-box {
  position: relative;
  overflow: hidden;
  background: #000000;
  aspect-ratio: 16 / 9;
}

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

.play-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.28), rgba(0, 0, 0, 0.58));
  cursor: pointer;
}

.play-trigger span {
  display: inline-flex;
  width: 84px;
  height: 84px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #991b1b);
  box-shadow: 0 20px 42px rgba(220, 38, 38, 0.42);
  font-size: 34px;
  text-indent: 5px;
}

.play-trigger.is-hidden {
  display: none;
}

.detail-panel {
  margin-top: 20px;
  padding: 24px;
}

.detail-panel h2,
.rank-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-panel p {
  margin: 0 0 16px;
  color: #374151;
}

.side-list {
  display: grid;
  gap: 10px;
}

.library-index {
  column-count: 4;
  column-gap: 24px;
}

.library-index a {
  display: block;
  break-inside: avoid;
  padding: 9px 0;
  color: #374151;
  border-bottom: 1px dashed #e5e7eb;
}

.library-index a:hover {
  color: var(--red);
}

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

.empty-tip.show {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .hero-slide,
  .ranking-layout,
  .detail-main,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    max-width: 360px;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

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

  .main-nav.open {
    display: flex;
  }

  .hero-stage {
    padding-top: 52px;
  }

  .hero-slide {
    min-height: auto;
  }

  .hero-poster {
    transform: none;
  }

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

  .filter-panel .search-box {
    grid-column: 1 / -1;
  }

  .library-index {
    column-count: 2;
  }
}

@media (max-width: 520px) {
  .nav-shell,
  .container,
  .hero-stage,
  .hero-dots {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .section-title {
    display: block;
  }

  .library-index {
    column-count: 1;
  }
}
