:root {
  --red-950: #4a0202;
  --red-900: #7f1d1d;
  --red-800: #991b1b;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --orange-400: #fb923c;
  --yellow-400: #facc15;
  --gray-950: #111827;
  --gray-900: #1f2937;
  --gray-800: #374151;
  --gray-700: #4b5563;
  --gray-600: #6b7280;
  --gray-500: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 10px 24px rgba(17, 24, 39, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  color: var(--gray-950);
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red-600), var(--orange-400));
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.28);
  font-size: 14px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--gray-700);
  font-size: 15px;
  font-weight: 600;
}

.main-nav a,
.nav-drop > a {
  transition: color 0.2s ease;
}

.main-nav a:hover,
.nav-drop:hover > a {
  color: var(--red-600);
}

.nav-drop {
  position: relative;
  padding: 22px 0;
}

.nav-menu {
  position: absolute;
  top: 62px;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 4px;
  min-width: 330px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  transition: all 0.2s ease;
}

.nav-drop:hover .nav-menu {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.nav-menu a {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--gray-700);
}

.nav-menu a:hover {
  background: #fff1f2;
}

.top-search,
.mobile-search,
.search-page-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-search input,
.search-page-form input,
.filter-panel input {
  width: 230px;
  height: 40px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 0 14px;
  outline: none;
  background: var(--white);
  color: var(--gray-900);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.filter-panel input:focus {
  border-color: var(--red-500);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.top-search button,
.mobile-search button {
  height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  color: var(--white);
  background: var(--red-600);
  cursor: pointer;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 99px;
  background: var(--gray-900);
}

.mobile-panel {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

.mobile-panel.is-open {
  display: grid;
  gap: 10px;
}

.mobile-panel a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--gray-700);
  font-weight: 700;
}

.mobile-panel a:hover {
  color: var(--red-600);
  background: #fff1f2;
}

.hero-section,
.page-hero,
.detail-hero {
  color: var(--white);
  background:
    radial-gradient(circle at 20% 15%, rgba(251, 146, 60, 0.36), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(250, 204, 21, 0.16), transparent 30%),
    linear-gradient(135deg, var(--red-950), var(--red-800) 52%, var(--red-700));
}

.hero-section {
  padding: 76px 0 88px;
}

.hero-container {
  display: grid;
  gap: 36px;
}

.hero-head {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #fecaca;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.red {
  color: var(--red-600);
}

.hero-head h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-head p,
.page-hero p,
.detail-one-line {
  margin: 18px auto 0;
  max-width: 760px;
  color: #fee2e2;
  font-size: clamp(17px, 2.4vw, 21px);
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

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

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

.btn-light {
  color: var(--red-700);
  background: var(--white);
  box-shadow: 0 14px 32px rgba(255, 255, 255, 0.22);
}

.btn-ghost {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
}

.btn-primary {
  border: 0;
  color: var(--white);
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  cursor: pointer;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 180px;
  gap: 16px;
}

.hero-tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--gray-900);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-tile-large {
  grid-column: span 3;
  grid-row: span 2;
}

.hero-tile img,
.movie-card img,
.rank-item img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.hero-tile:hover img,
.movie-card:hover img {
  transform: scale(1.08);
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.18), transparent);
}

.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 20px;
}

.hero-copy strong {
  color: var(--white);
  font-size: 18px;
  line-height: 1.25;
}

.hero-tile-large .hero-copy strong {
  font-size: clamp(24px, 4vw, 34px);
}

.hero-copy em {
  display: -webkit-box;
  overflow: hidden;
  color: #e5e7eb;
  font-size: 14px;
  font-style: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.section {
  padding: 64px 0;
}

.white-section {
  background: var(--white);
}

.soft-section {
  background: var(--gray-50);
}

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

.section-title h2,
.search-hot h2,
.detail-article h2,
.info-card h2,
.player-copy h2 {
  margin: 0;
  color: var(--gray-950);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
}

.section-link {
  color: var(--red-600);
  font-weight: 800;
}

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

.category-card,
.category-overview-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 24px;
  color: var(--white);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card span,
.category-overview-title {
  font-size: 20px;
  font-weight: 900;
}

.category-card p,
.category-overview-card p {
  margin: 0;
  color: #fee2e2;
  font-size: 14px;
}

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

.movie-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(229, 231, 235, 0.88);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.07);
  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.24);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  display: block;
  height: 208px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gray-900), var(--red-900));
}

.card-compact .poster-wrap {
  height: 174px;
}

.poster-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.poster-badge {
  right: 12px;
  top: 12px;
  padding: 5px 9px;
  background: var(--red-600);
}

.rank-badge {
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 30px;
  padding: 0 8px;
  background: linear-gradient(135deg, var(--yellow-400), var(--orange-400));
  color: var(--gray-950);
}

.movie-card-body {
  display: grid;
  gap: 10px;
  padding: 17px;
}

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

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

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

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--gray-500);
  font-size: 13px;
}

.movie-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: var(--gray-300);
}

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

.tag-row span {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 12px;
  font-weight: 700;
}

.scroll-row {
  display: grid;
  grid-auto-columns: minmax(220px, 260px);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 0 18px;
  scroll-snap-type: x proximity;
}

.scroll-row .movie-card {
  scroll-snap-align: start;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 54px 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.rank-number {
  color: var(--red-600);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.rank-item img {
  height: 84px;
  border-radius: 12px;
}

.rank-info {
  display: grid;
  min-width: 0;
  gap: 6px;
}

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

.rank-info em {
  display: -webkit-box;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 13px;
  font-style: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-year {
  color: var(--gray-500);
  font-weight: 800;
}

.page-hero {
  padding: 58px 0 62px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #fecaca;
  font-size: 14px;
  font-weight: 700;
}

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

.breadcrumb span::before,
.breadcrumb a + a::before,
.breadcrumb a + span::before {
  content: "/";
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.45);
}

.filter-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.05);
}

.filter-panel input {
  width: 100%;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: var(--white);
  border-color: var(--red-600);
  background: var(--red-600);
}

.empty-state {
  margin-top: 28px;
  padding: 48px 20px;
  border-radius: var(--radius);
  color: var(--gray-600);
  background: var(--white);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

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

.category-overview-card {
  color: var(--gray-900);
  background: var(--white);
}

.category-overview-title {
  color: var(--red-700);
}

.category-overview-card p {
  color: var(--gray-600);
}

.category-overview-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-overview-card div a {
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 13px;
}

.search-page-form {
  justify-content: center;
  margin-top: 26px;
}

.search-page-form input {
  width: min(100%, 460px);
  height: 48px;
}

.search-hot {
  margin-bottom: 28px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.search-hot div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.search-hot a {
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--red-700);
  background: #fff1f2;
  font-weight: 700;
}

.detail-hero {
  padding: 52px 0 66px;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  height: 460px;
  border: 8px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  box-shadow: var(--shadow);
  background: var(--gray-900);
}

.detail-info .breadcrumb {
  margin-bottom: 14px;
}

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

.detail-meta span {
  border-radius: 999px;
  padding: 7px 12px;
  color: #fee2e2;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.detail-tags {
  margin-top: 16px;
}

.detail-tags span {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
}

.detail-actions {
  justify-content: flex-start;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
  gap: 26px;
  align-items: center;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  color: var(--white);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.2));
  cursor: pointer;
  z-index: 4;
}

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

.play-circle {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: var(--red-700);
  background: var(--white);
  font-size: 28px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.player-copy {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.player-copy p {
  margin: 0;
  color: var(--gray-600);
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
}

.detail-article,
.info-card {
  padding: 28px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.detail-article h2:not(:first-child) {
  margin-top: 28px;
}

.detail-article p {
  margin: 14px 0 0;
  color: var(--gray-700);
  font-size: 17px;
  line-height: 1.9;
}

.info-card dl {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
}

.info-card dt {
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 800;
}

.info-card dd {
  margin: -8px 0 0;
  color: var(--gray-900);
  font-weight: 700;
}

.info-card a {
  color: var(--red-600);
}

.related-grid .movie-card {
  background: var(--white);
}

.site-footer {
  color: #d1d5db;
  background: var(--gray-950);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
  padding: 48px 0;
}

.footer-brand {
  color: var(--white);
}

.site-footer p {
  max-width: 420px;
  color: #9ca3af;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 18px;
}

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

.footer-links a:hover {
  color: var(--red-500);
}

.footer-bottom {
  padding: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .main-nav {
    gap: 16px;
  }

  .top-search {
    display: none;
  }

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

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

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

  .menu-toggle {
    display: block;
  }

  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }

  .hero-tile-large {
    grid-column: span 2;
    grid-row: span 2;
  }

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

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

  .rank-list {
    grid-template-columns: 1fr;
  }

  .detail-hero-grid,
  .player-layout,
  .detail-content-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    height: 440px;
    max-width: 340px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

  .brand {
    font-size: 18px;
  }

  .hero-section,
  .page-hero,
  .detail-hero {
    padding: 42px 0;
  }

  .hero-actions,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-grid,
  .movie-grid,
  .ranking-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

  .hero-tile-large {
    grid-column: span 1;
    grid-row: span 1;
  }

  .hero-grid {
    grid-auto-rows: 220px;
  }

  .section {
    padding: 44px 0;
  }

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

  .poster-wrap {
    height: 230px;
  }

  .rank-item {
    grid-template-columns: 42px 66px minmax(0, 1fr);
  }

  .rank-year {
    display: none;
  }

  .detail-poster {
    height: 400px;
    max-width: 100%;
  }

  .detail-article,
  .info-card,
  .player-copy {
    padding: 20px;
  }
}
