:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #292524;
  --color-muted: #78716c;
  --color-soft: #f5f5f4;
  --color-border: #e7e5e4;
  --color-primary: #dc2626;
  --color-primary-dark: #991b1b;
  --color-accent: #db2777;
  --shadow-soft: 0 12px 36px rgba(68, 64, 60, 0.12);
  --shadow-card: 0 16px 34px rgba(41, 37, 36, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background: radial-gradient(circle at top left, rgba(254, 226, 226, 0.9), transparent 34rem), var(--color-bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.65;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(231, 229, 228, 0.9);
  backdrop-filter: blur(18px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.28);
}

.brand-name {
  font-size: 1.25rem;
  color: transparent;
  background: linear-gradient(90deg, var(--color-primary-dark), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.site-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  color: #57534e;
  font-weight: 700;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--color-text);
  background: var(--color-soft);
  cursor: pointer;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  color: #ffffff;
  background: #111827;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.92) 0%, rgba(17, 24, 39, 0.62) 45%, rgba(17, 24, 39, 0.08) 100%), linear-gradient(0deg, rgba(17, 24, 39, 0.84), transparent 46%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 88px 0 126px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--color-primary);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content .eyebrow,
.detail-info .eyebrow,
.sub-hero .eyebrow {
  color: #fecaca;
}

.hero-content h1 {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: clamp(2.8rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero-content p {
  max-width: 700px;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  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: #ffffff;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 16px 28px rgba(220, 38, 38, 0.28);
}

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

.btn-ghost.dark {
  color: var(--color-text);
  background: #ffffff;
  border-color: var(--color-border);
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--color-primary-dark);
  background: #fee2e2;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-tags .chip {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 36px;
  width: min(1200px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-arrow,
.hero-dot {
  border: 0;
  cursor: pointer;
}

.hero-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 2rem;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-dot {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.hero-dot.is-active {
  background: #ffffff;
}

.page-section {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.intro-band {
  text-align: center;
}

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

.section-heading.center,
.section-heading.compact {
  display: block;
}

.section-heading h2,
.sub-hero h1,
.detail-info h1 {
  margin: 0;
  color: #1c1917;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.section-heading p,
.sub-hero p {
  max-width: 760px;
  margin: 14px auto 0;
  color: var(--color-muted);
}

.section-more {
  color: var(--color-primary);
  font-weight: 900;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.quick-links a {
  padding: 12px 18px;
  border-radius: 999px;
  color: #57534e;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
}

.listing-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(68, 64, 60, 0.06);
}

.listing-tools label {
  display: grid;
  gap: 7px;
  color: #57534e;
  font-size: 0.86rem;
  font-weight: 800;
}

.search-field {
  flex: 1 1 320px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.listing-tools input,
.listing-tools select {
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0 15px;
  color: var(--color-text);
  background: #ffffff;
  outline: none;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(231, 229, 228, 0.92);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(68, 64, 60, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #1c1917;
}

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

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

.poster-badge,
.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(220, 38, 38, 0.92);
  font-size: 0.78rem;
  font-weight: 900;
}

.rank-badge {
  left: auto;
  right: 12px;
  background: rgba(17, 24, 39, 0.88);
}

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

.movie-card h3 {
  margin: 0 0 7px;
  font-size: 1.04rem;
  line-height: 1.28;
}

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

.movie-meta,
.movie-desc {
  margin: 0 0 10px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.movie-desc {
  display: -webkit-box;
  min-height: 3.1em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.category-band {
  width: 100%;
  max-width: none;
  padding-right: max(16px, calc((100% - 1200px) / 2));
  padding-left: max(16px, calc((100% - 1200px) / 2));
  background: linear-gradient(135deg, #fff1f2, #fef2f2 52%, #ffffff);
}

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

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

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.94), rgba(219, 39, 119, 0.86));
  box-shadow: var(--shadow-card);
}

.category-title {
  position: relative;
  z-index: 2;
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
}

.category-desc {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 280px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.92rem;
}

.category-thumbs {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(2, 54px);
  gap: 8px;
  transform: rotate(-6deg);
}

.category-thumbs img,
.category-thumbs span {
  width: 54px;
  height: 78px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.18);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
}

.ranking-panel,
.featured-panel,
.text-card,
.prev-next-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.ranking-panel,
.featured-panel {
  padding: 26px;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 34px 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: #fafaf9;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-item:hover {
  background: #fee2e2;
  transform: translateX(4px);
}

.ranking-number {
  color: var(--color-primary);
  font-weight: 900;
  text-align: center;
}

.ranking-item img {
  width: 58px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
}

.ranking-text strong,
.ranking-text em {
  display: block;
}

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

.ranking-text em {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-style: normal;
}

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

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

.movie-card-compact .movie-desc,
.movie-card-compact .tag-row {
  display: none;
}

.sub-hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 80px max(16px, calc((100% - 1200px) / 2));
  color: #ffffff;
  background: radial-gradient(circle at top right, rgba(244, 63, 94, 0.82), transparent 28rem), linear-gradient(135deg, #111827, #7f1d1d);
}

.sub-hero h1,
.sub-hero p {
  color: #ffffff;
}

.sub-hero p {
  max-width: 720px;
  margin: 14px 0 0;
}

.small-actions {
  margin-top: 24px;
  margin-bottom: 0;
}

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

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

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

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(127, 29, 29, 0.74));
}

.detail-content {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

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

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

.detail-poster {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.36);
}

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

.detail-info h1 {
  color: #ffffff;
}

.detail-one-line {
  max-width: 780px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
}

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

.detail-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.player-section {
  padding-bottom: 34px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: #0c0a09;
  box-shadow: 0 24px 64px rgba(12, 10, 9, 0.3);
}

.movie-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
  object-fit: contain;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.28));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 18px 40px rgba(220, 38, 38, 0.38);
  font-size: 2rem;
}

.player-cover strong {
  font-size: clamp(1.2rem, 3vw, 2rem);
}

.detail-text-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 34px;
}

.text-card {
  padding: 28px;
}

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

.text-card p {
  margin: 0;
  color: #57534e;
}

.prev-next-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.prev-next-card {
  padding: 22px;
}

.prev-next-card span {
  display: block;
  color: var(--color-primary);
  font-size: 0.84rem;
  font-weight: 900;
}

.prev-next-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.18rem;
}

.empty-state {
  display: none;
  padding: 28px;
  border-radius: var(--radius-md);
  color: var(--color-muted);
  background: #ffffff;
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.site-footer {
  margin-top: 48px;
  color: #d6d3d1;
  background: #1c1917;
}

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  color: #ffffff;
  font-size: 1.2rem;
}

.footer-inner p {
  margin: 0;
  color: #a8a29e;
}

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

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

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

  .split-section,
  .detail-text-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-menu {
    position: absolute;
    top: 72px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-card);
  }

  .site-menu.is-open {
    display: flex;
  }

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

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

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

  .detail-poster {
    max-width: 280px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .page-section,
  .detail-content {
    width: min(100% - 24px, 1200px);
  }

  .hero-content {
    width: min(100% - 24px, 1200px);
    padding-top: 72px;
  }

  .hero-actions,
  .listing-tools,
  .filter-group,
  .prev-next-section {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn,
  .listing-tools input,
  .listing-tools select {
    width: 100%;
  }

  .movie-grid,
  .compact-grid,
  .category-grid,
  .category-grid-large,
  .prev-next-section {
    grid-template-columns: 1fr;
  }

  .sub-hero {
    min-height: 280px;
  }

  .player-shell {
    border-radius: 18px;
  }
}
