:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #dc2626;
  --red-dark: #7f1d1d;
  --orange: #ea580c;
  --amber: #f59e0b;
  --teal: #0f766e;
  --cyan: #155e75;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

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

img,
video {
  display: block;
  width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(14px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 22px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

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

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

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: var(--red);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  background: var(--red);
}

.hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: linear-gradient(135deg, #7f1d1d 0%, #9a3412 52%, #b45309 100%);
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.22) 0 2px, transparent 3px), radial-gradient(circle at 80% 30%, rgba(255,255,255,0.18) 0 2px, transparent 3px);
  background-size: 64px 64px, 92px 92px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 84px 0 54px;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(8px) saturate(1.05);
  transform: scale(1.05);
  opacity: 0.38;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.78), rgba(0,0,0,0.34), rgba(0,0,0,0.58));
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
  gap: 42px;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  color: #fde68a;
  font-weight: 750;
}

.hero h1 {
  margin: 18px 0 18px;
  max-width: 820px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero h1 span {
  color: #fcd34d;
}

.hero p {
  max-width: 720px;
  margin: 0 0 28px;
  color: #f3f4f6;
  font-size: 18px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

.btn-primary {
  color: #7f1d1d;
  background: #fff;
}

.btn-outline {
  color: #fff;
  border-color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.08);
}

.btn-red {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
}

.hero-poster {
  position: relative;
  align-self: stretch;
  min-height: 520px;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0,0,0,0.42);
  transform: rotate(1.2deg);
}

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

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

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

.hero-tags span,
.detail-tags span,
.card-tags span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-nav {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 6;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.hero-dot {
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  color: #fff;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.hero-dot.active {
  border-color: #fcd34d;
  background: rgba(252, 211, 77, 0.22);
}

.hero-dot strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-dot small {
  color: #fde68a;
}

.section {
  padding: 66px 0;
}

.section.white {
  background: #fff;
}

.section.dark {
  color: #fff;
  background: linear-gradient(135deg, #134e4a, #155e75);
}

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

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.dark .section-heading p {
  color: #b2f5ea;
}

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

.movie-grid.featured {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2937, #7f1d1d);
}

.compact .poster-link {
  aspect-ratio: 16 / 10;
}

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

.movie-card:hover img,
.category-card:hover img {
  transform: scale(1.07);
}

.poster-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent 58%);
}

.poster-badge,
.poster-play {
  position: absolute;
  z-index: 2;
}

.poster-badge {
  left: 12px;
  top: 12px;
  max-width: calc(100% - 24px);
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(220, 38, 38, 0.92);
}

.poster-play {
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7f1d1d;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}

.card-body {
  padding: 15px;
}

.card-title {
  display: -webkit-box;
  min-height: 48px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.45;
}

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

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #6b7280;
  font-size: 12px;
}

.card-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f3f4f6;
}

.filter-panel {
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.search-input,
.filter-select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  outline: none;
}

.search-input {
  flex: 1 1 280px;
}

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

.result-count {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 24px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, #7f1d1d, #ea580c);
  box-shadow: var(--shadow);
}

.category-card:nth-child(3n+2) {
  background: linear-gradient(135deg, #0f766e, #155e75);
}

.category-card:nth-child(3n) {
  background: linear-gradient(135deg, #92400e, #b45309);
}

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

.category-card p {
  color: rgba(255,255,255,0.84);
}

.category-card .count {
  position: absolute;
  right: 22px;
  bottom: 18px;
  font-size: 42px;
  font-weight: 900;
  opacity: 0.22;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 48px 84px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  transition: transform 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.18);
}

.rank-row img {
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.rank-num {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

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

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

.rank-info em {
  margin-top: 3px;
  color: #b2f5ea;
  font-style: normal;
  font-size: 13px;
}

.rank-year {
  color: #99f6e4;
  font-size: 13px;
}

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

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

.detail-hero {
  padding: 34px 0 60px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #7f1d1d 48%, #92400e);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 390px);
  gap: 32px;
  align-items: start;
}

.player-card,
.info-card,
.content-card {
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(220,38,38,0.22), rgba(0,0,0,0.68));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-overlay span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7f1d1d;
  font-size: 42px;
  background: #fff;
  box-shadow: 0 22px 40px rgba(0,0,0,0.32);
}

.player-note {
  padding: 14px 18px;
  color: #374151;
  background: #f9fafb;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.detail-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.1;
}

.detail-lead {
  margin: 0 0 22px;
  color: #f3f4f6;
  font-size: 18px;
}

.side-poster {
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0,0,0,0.36);
}

.side-poster img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.info-card,
.content-card {
  padding: 24px;
}

.content-card {
  margin-top: 24px;
}

.info-table {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 11px 16px;
  color: #374151;
}

.info-table dt {
  color: #6b7280;
  font-weight: 750;
}

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

.content-card p {
  margin: 0;
  color: #374151;
  line-height: 1.9;
}

.cta-band {
  padding: 44px 0;
  background: linear-gradient(90deg, #d97706, #ea580c);
  color: #fff;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-footer {
  padding: 44px 0;
  color: #d1d5db;
  background: #111827;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

.footer-brand {
  margin-bottom: 10px;
  color: #fff;
  font-size: 20px;
}

.site-footer h3 {
  margin: 0 0 10px;
  color: #fff;
}

.site-footer a {
  display: block;
  margin: 5px 0;
  color: #d1d5db;
}

.site-footer a:hover {
  color: #fcd34d;
}

.empty-state {
  display: none;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #d1d5db;
  border-radius: 18px;
  background: #fff;
}

.no-results .empty-state {
  display: block;
}

.no-results .movie-grid {
  display: none;
}

@media (max-width: 980px) {
  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 74px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
  }

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

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

  .hero {
    min-height: 760px;
  }

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

  .hero-poster {
    min-height: 340px;
    transform: none;
  }

  .hero-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .movie-grid,
  .movie-grid.featured,
  .category-grid,
  .rank-list,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: 64px;
  }

  .brand-text strong {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .section {
    padding: 44px 0;
  }

  .hero {
    min-height: 820px;
  }

  .hero-slide {
    padding-top: 60px;
  }

  .hero h1 {
    font-size: 36px;
  }

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

  .hero-nav,
  .movie-grid,
  .movie-grid.featured,
  .category-grid,
  .rank-list,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 38px 70px minmax(0, 1fr);
  }

  .rank-year {
    display: none;
  }

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

  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }
}
