:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #ef4444;
  --orange: #f97316;
  --yellow: #f59e0b;
  --green: #22c55e;
  --cyan: #06b6d4;
  --blue: #2563eb;
  --purple: #7c3aed;
  --pink: #ec4899;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.top-rainbow,
.footer-rainbow {
  height: 4px;
  background: linear-gradient(90deg, #ef4444, #f97316, #facc15, #22c55e, #06b6d4, #2563eb, #7c3aed, #ec4899);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.nav-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.logo-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--orange), var(--purple));
  box-shadow: 0 10px 26px rgba(239, 68, 68, 0.28);
}

.logo-mark::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(239,68,68,0.38), rgba(245,158,11,0.28), rgba(37,99,235,0.34));
  filter: blur(8px);
  z-index: -1;
}

.logo-mark span {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #fff;
  margin-left: 4px;
}

.logo-text {
  font-size: 22px;
  line-height: 1;
  background: linear-gradient(90deg, #ef4444, #f97316, #22c55e, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 700;
  color: #374151;
}

.nav-links a {
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--purple));
  opacity: 0;
  transform: scaleX(0.5);
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--blue);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: #f3f4f6;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
}

.hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background: #111827;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(239, 68, 68, 0.35), transparent 30%), linear-gradient(90deg, rgba(2, 6, 23, 0.88), rgba(15, 23, 42, 0.64), rgba(15, 23, 42, 0.92));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  min-height: 650px;
  margin: 0 auto;
  padding: 84px 20px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 52px;
  align-items: center;
  color: #fff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  font-weight: 700;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -1.5px;
  text-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.hero p {
  margin: 0;
  max-width: 720px;
  font-size: 20px;
  line-height: 1.85;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

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

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

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

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--red), var(--purple));
  box-shadow: 0 18px 36px rgba(124, 58, 237, 0.28);
}

.btn-light {
  color: #111827;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 36px rgba(255,255,255,0.16);
}

.hero-poster-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 460px;
  background: rgba(255,255,255,0.12);
  box-shadow: 0 28px 80px rgba(0,0,0,0.34);
  border: 1px solid rgba(255,255,255,0.22);
}

.hero-poster-card img {
  width: 100%;
  height: 460px;
  object-fit: cover;
}

.hero-poster-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0));
}

.hero-poster-info h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

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

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

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

.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 20px;
}

.page-hero {
  background: linear-gradient(135deg, rgba(239,68,68,0.92), rgba(124,58,237,0.92)), radial-gradient(circle at top right, rgba(255,255,255,0.3), transparent 34%);
  color: #fff;
  padding: 72px 20px;
}

.page-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 58px);
}

.page-hero p {
  margin: 0;
  max-width: 860px;
  line-height: 1.85;
  font-size: 18px;
  color: rgba(255,255,255,0.92);
}

.section {
  padding: 30px 0 48px;
}

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

.section-kicker {
  display: inline-flex;
  margin-bottom: 9px;
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
}

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

.section-more {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

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

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

.movie-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #e5e7eb, #f8fafc);
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.55));
  opacity: 0.8;
}

.play-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: all 0.25s ease;
}

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

.heat-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  background: linear-gradient(90deg, var(--red), var(--purple));
}

.movie-card-body {
  padding: 16px;
}

.movie-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.movie-meta-line span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f4f6;
}

.movie-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: var(--blue);
}

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

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

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  font-weight: 700;
  font-size: 12px;
}

.movie-card-compact {
  display: grid;
  grid-template-columns: 128px 1fr;
}

.movie-card-compact .poster-link {
  aspect-ratio: auto;
  min-height: 180px;
}

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

.category-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  padding: 22px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(124,58,237,0.9));
  box-shadow: var(--soft-shadow);
}

.category-card:nth-child(2n) {
  background: linear-gradient(135deg, rgba(37,99,235,0.92), rgba(6,182,212,0.9));
}

.category-card:nth-child(3n) {
  background: linear-gradient(135deg, rgba(249,115,22,0.92), rgba(236,72,153,0.9));
}

.category-card h2,
.category-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.category-card p {
  margin: 0;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
}

.category-card span {
  position: absolute;
  right: 20px;
  bottom: 18px;
  font-weight: 900;
}

.filter-panel {
  margin: 0 0 28px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 190px 190px 190px;
  gap: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.search-box span {
  font-weight: 900;
  color: var(--blue);
}

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

.filter-input:focus,
.filter-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 74px 116px 1fr auto;
  gap: 18px;
  align-items: center;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.rank-num {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--red), var(--purple));
}

.rank-item img {
  width: 116px;
  height: 150px;
  object-fit: cover;
  border-radius: 14px;
}

.rank-info h2,
.rank-info h3 {
  margin: 0 0 8px;
}

.rank-info p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.75;
}

.breadcrumb {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.24);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  z-index: 2;
}

.player-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(2,6,23,0.82), rgba(15,23,42,0.35));
}

.player-cover.hidden {
  opacity: 0;
  pointer-events: none;
}

.play-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  padding: 16px 26px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(90deg, var(--red), var(--purple));
  box-shadow: 0 20px 46px rgba(124,58,237,0.34);
  cursor: pointer;
}

.detail-title {
  margin: 26px 0 14px;
  font-size: clamp(30px, 4vw, 48px);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.detail-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  box-shadow: var(--soft-shadow);
  font-weight: 700;
}

.content-card {
  margin-top: 22px;
  padding: 26px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.content-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.content-card p {
  margin: 0 0 16px;
  color: #4b5563;
  line-height: 1.95;
}

.side-card {
  position: sticky;
  top: 96px;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

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

.side-card-body {
  padding: 18px;
}

.side-card-body h2 {
  margin: 0 0 12px;
}

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

.mini-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.mini-item img {
  width: 64px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
}

.mini-item strong {
  display: block;
  margin-bottom: 6px;
}

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

.site-footer {
  margin-top: 48px;
  background: #111827;
  color: #d1d5db;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer-brand p {
  max-width: 580px;
  margin: 16px 0 0;
  line-height: 1.8;
  color: #9ca3af;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 800;
}

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

.footer-copy {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 28px;
  color: #9ca3af;
  font-size: 14px;
}

.empty-state {
  display: none;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
}

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

.index-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.index-strip a {
  padding: 9px 13px;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}

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

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

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

  .side-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .nav-wrap {
    height: 62px;
  }

  .logo-text {
    font-size: 18px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 72px;
    display: none;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
  }

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

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

  .hero,
  .hero-content {
    min-height: 720px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 54px;
  }

  .hero-poster-card,
  .hero-poster-card img {
    min-height: 300px;
    height: 300px;
  }

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

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

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

  .movie-card-body {
    padding: 13px;
  }

  .rank-item {
    grid-template-columns: 46px 86px 1fr;
  }

  .rank-item .btn {
    grid-column: 1 / -1;
  }

  .rank-item img {
    width: 86px;
    height: 118px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .movie-grid,
  .movie-grid.three,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .movie-card-compact {
    grid-template-columns: 110px 1fr;
  }

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

  .btn {
    width: 100%;
  }
}
