:root {
  --color-primary: #dc2626;
  --color-primary-dark: #991b1b;
  --color-accent: #facc15;
  --color-ink: #111827;
  --color-muted: #6b7280;
  --color-soft: #f9fafb;
  --color-line: #e5e7eb;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.10);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.10);
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  box-shadow: 0 12px 30px rgba(127, 29, 29, 0.30);
}

.navbar {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: var(--max-width);
  height: 68px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand:hover {
  color: var(--color-accent);
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  color: #fff;
  font-weight: 600;
}

.nav-links a {
  white-space: nowrap;
  opacity: 0.94;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-accent);
  opacity: 1;
}

.nav-search {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  justify-content: flex-end;
  gap: 8px;
}

.nav-search input,
.hero-search input {
  width: min(260px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  outline: none;
  background: rgba(255, 255, 255, 0.14);
}

.nav-search input::placeholder,
.hero-search input::placeholder {
  color: rgba(255, 255, 255, 0.80);
}

.nav-search button,
.hero-search button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: #111827;
  background: var(--color-accent);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-search button:hover,
.hero-search button:hover {
  transform: translateY(-1px);
  background: #fde047;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}

.mobile-menu {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px 24px 18px;
  background: #991b1b;
}

.mobile-menu a {
  display: block;
  padding: 10px 0;
  color: #fff;
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 18% 10%, rgba(250, 204, 21, 0.30), transparent 30%), linear-gradient(135deg, #7f1d1d, #dc2626 48%, #7f1d1d);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.12));
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: 48px;
  align-items: center;
  max-width: var(--max-width);
  min-height: 540px;
  margin: 0 auto;
  padding: 54px 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero h1 span {
  color: var(--color-accent);
}

.hero-desc {
  max-width: 720px;
  margin: 22px 0 28px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(18px, 2vw, 24px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  padding: 12px 22px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  color: #111827;
  background: var(--color-accent);
  box-shadow: 0 16px 35px rgba(250, 204, 21, 0.30);
}

.btn-primary:hover {
  background: #fde047;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.20);
}

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

.hero-search input {
  width: min(420px, 100%);
  min-height: 48px;
  border-radius: 14px;
}

.hero-showcase {
  position: relative;
  height: 430px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  background: rgba(17, 24, 39, 0.55);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  opacity: 0;
  transform: scale(1.04);
  background-image: var(--hero-image);
  background-position: center;
  background-size: cover;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.hero-slide-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.78));
}

.hero-slide-content {
  position: relative;
  z-index: 1;
}

.hero-slide-content strong {
  display: block;
  font-size: 28px;
  line-height: 1.2;
}

.hero-slide-content small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-dots {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 8px;
}

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

.hero-dot.is-active {
  width: 28px;
  background: var(--color-accent);
}

.stats-wrap {
  margin-top: -46px;
  padding: 0 24px 44px;
}

.stats-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.stat-card {
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.stat-card strong {
  display: block;
  color: var(--color-primary);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--color-muted);
  font-weight: 700;
}

.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 58px 24px;
}

.content-section.dark-section {
  max-width: none;
  margin: 0;
  padding-left: max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
  padding-right: max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
  color: #fff;
  background: #1f2937;
}

.section-heading {
  margin-bottom: 30px;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
}

.section-heading p {
  margin: 10px auto 0;
  max-width: 780px;
  color: var(--color-muted);
  font-size: 18px;
}

.dark-section .section-heading p {
  color: rgba(255, 255, 255, 0.72);
}

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

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.16);
}

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

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

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

.poster-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 46px;
  background: rgba(0, 0, 0, 0.0);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.movie-card:hover .poster-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.32);
}

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  border-radius: 999px;
  padding: 4px 8px;
  color: #111827;
  background: var(--color-accent);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

.movie-info {
  padding: 14px;
}

.movie-info h3 {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-info h3 a:hover {
  color: var(--color-primary);
}

.movie-meta,
.movie-genre,
.movie-summary,
.movie-tags {
  margin: 7px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.movie-summary {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-tags {
  color: var(--color-primary);
  font-weight: 700;
}

.movie-card-compact .movie-info {
  padding: 12px;
}

.movie-card-compact .movie-info h3 {
  min-height: auto;
  -webkit-line-clamp: 1;
}

.movie-card-compact .movie-summary,
.movie-card-compact .movie-tags,
.movie-card-compact .movie-genre {
  display: none;
}

.category-section {
  max-width: none;
  padding-left: max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
  padding-right: max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
  background: linear-gradient(135deg, #fff, #fff1f2);
}

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

.category-card,
.category-overview-card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-icon {
  display: block;
  margin-bottom: 12px;
  font-size: 42px;
}

.category-card strong {
  display: block;
  font-size: 22px;
}

.category-card em {
  display: block;
  margin-top: 4px;
  color: var(--color-primary);
  font-style: normal;
  font-weight: 900;
}

.category-card p {
  margin: 10px 0 0;
  color: var(--color-muted);
}

.sub-hero {
  color: #fff;
  background: radial-gradient(circle at 12% 12%, rgba(250, 204, 21, 0.28), transparent 30%), linear-gradient(110deg, #7f1d1d, #dc2626);
}

.sub-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 70px 24px;
}

.sub-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.08;
}

.sub-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

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

.category-overview-main span {
  font-size: 40px;
}

.category-overview-main h2 {
  margin: 10px 0 8px;
}

.category-overview-main p {
  color: var(--color-muted);
}

.category-overview-main strong {
  color: var(--color-primary);
}

.category-overview-card ul {
  margin: 18px 0 0;
  padding: 16px 0 0 18px;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
}

.category-overview-card li + li {
  margin-top: 6px;
}

.category-overview-card a:hover {
  color: var(--color-primary);
}

.filter-panel {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.filter-search {
  display: grid;
  flex: 1 1 320px;
  gap: 6px;
  color: var(--color-muted);
  font-weight: 800;
}

.filter-search input,
.filter-selects select {
  min-height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--color-ink);
  background: #fff;
  outline: none;
}

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

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

.filter-count {
  min-width: 120px;
  margin: 0 0 10px auto;
  color: var(--color-muted);
  font-weight: 800;
  text-align: right;
}

.empty-state {
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  color: var(--color-muted);
  background: #fff;
  box-shadow: var(--shadow-card);
}

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

.detail-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.60)), var(--detail-bg);
  background-position: center;
  background-size: cover;
  filter: blur(2px);
  transform: scale(1.04);
}

.detail-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 70px;
}

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

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

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

.player-panel {
  min-width: 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: #000;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.movie-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.56));
  cursor: pointer;
}

.player-start span {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto;
  border-radius: 50%;
  color: #111827;
  background: var(--color-accent);
  font-size: 36px;
  box-shadow: 0 18px 40px rgba(250, 204, 21, 0.36);
}

.player-start strong {
  font-size: 20px;
}

.player-shell.is-playing .player-start {
  display: none;
}

.player-note {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.1;
}

.detail-one-line {
  margin: 16px 0;
  color: rgba(255, 255, 255, 0.90);
  font-size: 19px;
}

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

.detail-meta span,
.tag-list a,
.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag-list a:hover {
  background: rgba(250, 204, 21, 0.24);
  color: var(--color-accent);
}

.detail-text-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
}

.text-card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 26px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

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

.text-card p {
  margin: 0;
  color: #374151;
  font-size: 17px;
  line-height: 1.9;
  white-space: pre-line;
}

.wide-card {
  max-width: 860px;
  margin: 0 auto;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.ranking-table th,
.ranking-table td {
  border-bottom: 1px solid var(--color-line);
  padding: 14px 16px;
  text-align: left;
}

.ranking-table th {
  color: #fff;
  background: var(--color-primary);
}

.ranking-table a {
  font-weight: 800;
}

.ranking-table a:hover {
  color: var(--color-primary);
}

.rank-number {
  color: var(--color-primary);
  font-weight: 900;
}

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

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 46px 24px 24px;
}

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

.footer-grid h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 18px;
}

.footer-grid p,
.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li + li {
  margin-top: 7px;
}

.footer-grid a:hover {
  color: var(--color-accent);
}

.footer-badge {
  margin-top: 14px !important;
  color: var(--color-accent);
  font-weight: 800;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 20px;
  color: #9ca3af;
}

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

  .menu-toggle {
    display: flex;
  }

  .nav-search {
    flex: 0 1 320px;
  }

  .movie-grid,
  .featured-grid,
  .all-movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .hero-inner,
  .detail-layout,
  .detail-text-grid {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    height: 360px;
  }

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

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

@media (max-width: 680px) {
  .navbar {
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
  }

  .brand {
    font-size: 18px;
  }

  .nav-search {
    display: none;
  }

  .hero-inner,
  .content-section,
  .sub-hero-inner,
  .detail-inner,
  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    min-height: auto;
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .hero-showcase {
    height: 300px;
    border-radius: 20px;
  }

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

  .category-section,
  .dark-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filter-panel {
    align-items: stretch;
  }

  .filter-selects,
  .filter-selects select,
  .filter-count {
    width: 100%;
  }

  .filter-count {
    text-align: left;
  }

  .detail-info h1 {
    font-size: 34px;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .movie-grid,
  .featured-grid,
  .ranking-grid,
  .all-movie-grid,
  .category-grid,
  .category-overview-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .hero-search {
    display: grid;
  }

  .hero-search input,
  .hero-search button,
  .btn {
    width: 100%;
  }
}
