:root {
  --brand: #dc2626;
  --brand-dark: #991b1b;
  --brand-soft: #fee2e2;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #ffffff;
  --soft: #f9fafb;
  --shadow: 0 20px 55px rgba(31, 41, 55, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #f9fafb 38%, #fff 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

img[data-missing="true"] {
  opacity: 0;
}

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

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
  color: var(--brand-dark);
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.3);
}

.logo-text {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.main-nav a,
.main-nav button {
  position: relative;
  color: #374151;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.main-nav a:hover,
.main-nav button:hover,
.dropdown-link.is-active {
  color: var(--brand);
}

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: -18px;
  width: 180px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.22s ease;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(8px);
}

.dropdown-link {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 14px;
}

.dropdown-link:hover {
  background: var(--brand-soft);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input {
  width: 220px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
}

.header-search input:focus {
  border-color: var(--brand);
}

.header-search button,
.primary-button {
  border: 0;
  padding: 11px 18px;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.24);
}

.primary-button.full {
  display: block;
  text-align: center;
}

.ghost-button {
  padding: 10px 17px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.ghost-button.dark {
  color: var(--brand-dark);
  border-color: var(--brand-soft);
  background: #fff;
}

.mobile-menu-button {
  display: none;
  margin-left: auto;
  border: 0;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 12px;
  padding: 9px 12px;
}

.mobile-panel {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 16px;
  gap: 10px;
}

.mobile-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.hero-section {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 12% 10%, rgba(254, 202, 202, 0.55), transparent 34%), linear-gradient(135deg, #dc2626 0%, #991b1b 58%, #450a0a 100%);
}

.hero-slider,
.hero-slide,
.hero-backdrop {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(69, 10, 10, 0.92) 0%, rgba(153, 27, 27, 0.72) 48%, rgba(69, 10, 10, 0.42) 100%);
}

.hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.36;
  transform: scale(1.05);
}

.hero-backdrop:has(img[data-missing="true"]) {
  background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.18), transparent 30%), linear-gradient(135deg, #dc2626, #7f1d1d);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 40px));
  padding: 150px 0 0;
  margin-left: max(20px, calc((100vw - 1280px) / 2 + 20px));
}

.hero-label {
  display: inline-flex;
  padding: 8px 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}

.hero-content h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.hero-content p {
  max-width: 720px;
  margin: 24px 0 30px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(17px, 2vw, 22px);
}

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

.hero-dots {
  position: absolute;
  z-index: 4;
  left: max(20px, calc((100vw - 1280px) / 2 + 20px));
  bottom: 138px;
  display: flex;
  gap: 10px;
}

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

.hero-dots button.is-active {
  background: #fff;
}

.hero-search-card {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 5;
  width: min(980px, calc(100% - 40px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-search-card span {
  color: var(--brand-dark);
  font-weight: 900;
}

.hero-search-card form {
  display: flex;
  gap: 10px;
}

.hero-search-card input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  outline: none;
}

.hero-search-card input:focus {
  border-color: var(--brand);
}

.hero-search-card button {
  border: 0;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--brand);
  font-weight: 800;
}

.section-block {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0;
}

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

.section-heading.compact {
  align-items: center;
}

.section-heading span,
.page-hero span {
  color: var(--brand);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-heading h2,
.page-hero h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
}

.section-heading a,
.text-link {
  color: var(--brand);
  font-weight: 800;
}

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

.category-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  padding: 20px;
  color: #fff;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ef4444, #7f1d1d);
  box-shadow: 0 16px 32px rgba(127, 29, 29, 0.18);
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(69, 10, 10, 0.82), rgba(69, 10, 10, 0.24));
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  transition: transform 0.35s ease;
}

.category-tile:hover img {
  transform: scale(1.08);
}

.category-tile strong,
.category-tile p,
.category-count {
  position: relative;
  z-index: 2;
}

.category-tile strong {
  display: block;
  margin-top: 60px;
  font-size: 24px;
}

.category-tile p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.category-count {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 800;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.86);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.movie-card[hidden] {
  display: none;
}

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

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: radial-gradient(circle at 35% 20%, #fecaca, transparent 34%), linear-gradient(135deg, #ef4444, #7f1d1d);
}

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

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

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

.poster-badge {
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  color: #fff;
  border-radius: 999px;
  background: rgba(153, 27, 27, 0.84);
  font-size: 12px;
  font-weight: 900;
}

.poster-play {
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--brand);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

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

.movie-card-meta,
.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.movie-card 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-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-list span {
  padding: 4px 8px;
  color: var(--brand-dark);
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
}

.tag-list.large span {
  padding: 7px 11px;
  font-size: 14px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 28px;
  align-items: start;
}

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

.rank-list.large {
  gap: 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: auto 74px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.07);
}

.rank-row:hover {
  border-color: #fecaca;
  transform: translateX(4px);
}

.rank-row img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 16px;
  background: linear-gradient(135deg, #ef4444, #7f1d1d);
}

.rank-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  font-size: 20px;
  font-weight: 900;
}

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

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

.rank-info small {
  color: var(--muted);
}

.rank-score {
  color: #f59e0b;
  font-weight: 900;
}

.recommend-panel,
.content-card,
.stat-card,
.category-overview-card,
.filter-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.08);
}

.recommend-panel {
  padding: 28px;
  position: sticky;
  top: 92px;
}

.recommend-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.recommend-stats span {
  padding: 14px;
  border-radius: 18px;
  background: var(--soft);
  text-align: center;
}

.recommend-stats strong {
  display: block;
  color: var(--brand);
  font-size: 28px;
}

.page-hero {
  width: min(1280px, calc(100% - 40px));
  margin: 34px auto 0;
  padding: 58px;
  color: #fff;
  border-radius: 34px;
  background: radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.25), transparent 30%), linear-gradient(135deg, var(--brand), #7f1d1d);
  box-shadow: var(--shadow);
}

.page-hero span {
  color: #fecaca;
}

.page-hero p {
  max-width: 820px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

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

.category-overview-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  padding: 20px;
}

.category-overview-card h2 {
  margin: 5px 0 8px;
  font-size: 28px;
}

.category-overview-card span {
  color: var(--brand);
  font-weight: 900;
}

.mini-posters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.mini-posters img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #7f1d1d);
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 26px;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fff;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--brand);
}

.filter-count {
  white-space: nowrap;
  color: var(--brand-dark);
  font-weight: 900;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #450a0a;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(69, 10, 10, 0.96), rgba(127, 29, 29, 0.82), rgba(69, 10, 10, 0.78));
}

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: blur(4px);
  transform: scale(1.04);
}

.detail-inner {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 40px));
  min-height: 520px;
  margin: 0 auto;
  padding: 72px 0;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 42px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border: 8px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #ef4444, #7f1d1d);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fff;
}

.detail-info h1 {
  margin: 16px 0;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.05;
}

.detail-one-line {
  max-width: 850px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

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

.detail-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #09090b;
  box-shadow: var(--shadow);
}

.video-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #fff;
  border: 0;
  background: radial-gradient(circle at center, rgba(220, 38, 38, 0.42), rgba(0, 0, 0, 0.58));
  cursor: pointer;
}

.video-start span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  font-size: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.video-start[hidden] {
  display: none;
}

.player-tip {
  color: var(--muted);
}

.content-card {
  padding: 26px;
  margin-top: 22px;
}

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

.content-card p {
  margin: 0;
  color: #4b5563;
  font-size: 17px;
}

.detail-side {
  position: sticky;
  top: 92px;
}

.stat-card {
  padding: 26px;
  text-align: center;
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 4px 0;
  color: #f59e0b;
  font-size: 54px;
  line-height: 1;
}

.compact-card dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 12px;
  margin: 0;
}

.compact-card dt {
  color: var(--muted);
}

.compact-card dd {
  margin: 0;
  font-weight: 700;
}

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

.site-footer {
  margin-top: 40px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #450a0a);
}

.footer-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

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

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
}

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

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

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

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

@media (max-width: 900px) {
  .main-nav,
  .header-search {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

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

  .hero-section {
    min-height: 660px;
  }

  .hero-content {
    padding-top: 100px;
  }

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

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

  .section-heading {
    display: block;
  }

  .category-grid,
  .category-overview-grid,
  .split-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .category-overview-card,
  .detail-inner {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: min(300px, 76vw);
  }

  .detail-side,
  .recommend-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .section-block,
  .page-hero,
  .footer-inner,
  .detail-inner {
    width: calc(100% - 28px);
  }

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

  .hero-content {
    width: calc(100% - 28px);
    margin-left: 14px;
  }

  .hero-dots {
    left: 14px;
  }

  .page-hero {
    padding: 34px 24px;
    border-radius: 26px;
  }

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

  .category-grid {
    grid-template-columns: 1fr;
  }

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

  .rank-row {
    grid-template-columns: auto 58px 1fr;
  }

  .rank-row img {
    width: 58px;
    height: 58px;
  }

  .rank-score {
    display: none;
  }

  .footer-inner {
    display: block;
  }

  .footer-links {
    margin-top: 18px;
  }
}
