* {
  box-sizing: border-box;
}

:root {
  --bg: #fff7ed;
  --bg-soft: #fffbeb;
  --card: rgba(255, 251, 235, 0.88);
  --card-strong: #ffffff;
  --text: #78350f;
  --muted: #92400e;
  --light: #fef3c7;
  --line: rgba(146, 64, 14, 0.16);
  --accent: #d97706;
  --accent-dark: #92400e;
  --accent-soft: #f59e0b;
  --shadow: 0 24px 60px rgba(120, 53, 15, 0.16);
  --radius: 24px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(251, 191, 36, 0.18), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(217, 119, 6, 0.16), transparent 28%),
    linear-gradient(180deg, #fff7ed 0%, #fffbeb 44%, #fff7ed 100%);
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(120, 53, 15, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 53, 15, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.2));
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 247, 237, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fffbeb;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 26px;
  background: linear-gradient(135deg, #f59e0b, #92400e);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(146, 64, 14, 0.22);
}

.brand-text,
.footer-brand {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
}

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

.nav-link {
  padding: 10px 14px;
  color: var(--muted);
  border-radius: 999px;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff7ed;
  background: var(--accent-dark);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  min-width: 320px;
  padding: 5px;
  border: 1px solid rgba(146, 64, 14, 0.2);
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.8);
}

.header-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 10px 14px;
}

.header-search button,
.primary-btn,
.secondary-btn,
.filter-panel button,
.player-button {
  border: 0;
  color: #fff7ed;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-dark));
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(146, 64, 14, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.filter-panel button:hover,
.player-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(146, 64, 14, 0.28);
}

.secondary-btn {
  color: var(--accent-dark);
  background: rgba(255, 251, 235, 0.92);
  border: 1px solid rgba(146, 64, 14, 0.18);
}

.mobile-nav-toggle,
.mobile-nav {
  display: none;
}

.page-shell,
.hero,
.site-footer {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 36px;
  align-items: center;
  padding: 54px 0 46px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

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

.hero h1,
.page-title h1,
.detail-title h1,
.section-heading h2,
.category-card h2,
.detail-panel h2,
.site-footer h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  line-height: 1.1;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(42px, 7vw, 88px);
  letter-spacing: -0.06em;
}

.hero-lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
}

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

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.hero-stat {
  padding: 18px;
  background: rgba(255, 251, 235, 0.78);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.hero-stat strong {
  display: block;
  font-size: 28px;
  color: var(--accent-dark);
}

.hero-stat span {
  color: var(--muted);
  font-size: 13px;
}

.hero-slider {
  position: relative;
  min-height: 500px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(24px) scale(0.98);
  transition: 0.6s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.hero-card {
  position: relative;
  overflow: hidden;
  height: 500px;
  border-radius: 34px;
  background: #1c1208;
  box-shadow: var(--shadow);
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.hero-card.image-missing::before,
.poster-wrap.image-missing::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 25% 20%, rgba(251, 191, 36, 0.38), transparent 32%),
    linear-gradient(135deg, #92400e, #451a03 72%);
}

.hero-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 28%, rgba(28, 18, 8, 0.92) 100%);
}

.hero-card-content {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 2;
  color: #fffbeb;
}

.hero-card-content h2 {
  margin: 12px 0 10px;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(28px, 4vw, 46px);
}

.hero-card-content p {
  margin: 0;
  color: #fde68a;
  line-height: 1.75;
}

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

.hero-badges span,
.tag-row span,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(146, 64, 14, 0.12);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-card-content .hero-badges span {
  color: #fffbeb;
  background: rgba(255, 251, 235, 0.18);
  border-color: rgba(255, 251, 235, 0.28);
  backdrop-filter: blur(10px);
}

.slider-dots {
  position: absolute;
  right: 26px;
  bottom: -28px;
  display: flex;
  gap: 8px;
}

.slider-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(146, 64, 14, 0.24);
  cursor: pointer;
}

.slider-dots button.active {
  width: 28px;
  background: var(--accent-dark);
}

.section-block {
  padding: 44px 0;
}

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

.section-heading h2,
.page-title h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-heading p,
.page-title p,
.category-card p,
.detail-title p,
.detail-panel p,
.site-footer p {
  color: var(--muted);
  line-height: 1.8;
}

.section-more {
  color: var(--accent-dark);
  font-weight: 800;
}

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

.movie-card,
.category-card,
.detail-panel,
.filter-panel,
.rank-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(120, 53, 15, 0.09);
  backdrop-filter: blur(16px);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 52px rgba(120, 53, 15, 0.16);
}

.poster-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #451a03;
}

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

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

.play-pill,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.play-pill {
  right: 12px;
  bottom: 12px;
  min-width: 56px;
  padding: 6px 10px;
  color: #451a03;
  background: #fef3c7;
}

.rank-badge {
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  color: #fff7ed;
  background: linear-gradient(135deg, #f59e0b, #7c2d12);
}

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

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

.movie-card h2 a:hover {
  color: var(--accent);
}

.movie-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.movie-line {
  min-height: 48px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.category-card {
  padding: 22px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.category-card h2 {
  font-size: 24px;
}

.category-card strong {
  color: var(--accent-dark);
  font-size: 30px;
}

.filter-panel {
  position: sticky;
  top: 92px;
  z-index: 30;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  padding: 14px;
  margin-bottom: 24px;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  color: var(--text);
  background: rgba(255, 251, 235, 0.9);
  border: 1px solid rgba(146, 64, 14, 0.2);
  border-radius: 16px;
  outline: 0;
  padding: 12px 14px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 28px;
  padding-top: 34px;
}

.player-panel {
  overflow: hidden;
  background: #0f0803;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050505;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(251, 191, 36, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.48));
  cursor: pointer;
  transition: opacity 0.25s ease;
}

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

.player-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 14px 24px;
  font-size: 18px;
  font-weight: 800;
}

.player-note {
  margin: 0;
  padding: 12px 18px 18px;
  color: #fde68a;
  font-size: 13px;
}

.detail-title {
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(120, 53, 15, 0.09);
}

.detail-title h1 {
  font-size: clamp(30px, 5vw, 54px);
}

.detail-poster {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  background: #451a03;
}

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

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  margin-top: 28px;
}

.detail-panel {
  padding: 26px;
}

.detail-panel h2 {
  margin-bottom: 14px;
  font-size: 28px;
}

.detail-panel p {
  margin: 0 0 16px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 26px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

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

.rank-row {
  display: grid;
  grid-template-columns: 64px 96px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.rank-num {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff7ed;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-dark));
  border-radius: 16px;
  font-weight: 900;
}

.rank-row img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  background: #451a03;
}

.rank-row h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.rank-row p {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  display: none;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 251, 235, 0.8);
  border: 1px dashed rgba(146, 64, 14, 0.3);
  border-radius: 24px;
}

.site-footer {
  margin-top: 54px;
  padding: 42px 0 34px;
  border-top: 1px solid var(--line);
}

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

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

.footer-links a {
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 251, 235, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.footer-bottom {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

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

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

  .header-search {
    min-width: 220px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    min-height: 66px;
  }

  .main-nav,
  .header-search {
    display: none;
  }

  .mobile-nav-toggle {
    margin-left: auto;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--accent-dark);
    background: #fef3c7;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .mobile-nav {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 14px;
    background: rgba(255, 251, 235, 0.96);
    border: 1px solid var(--line);
    border-radius: 18px;
  }

  .mobile-nav.is-open {
    display: grid;
    gap: 8px;
  }

  .mobile-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
  }

  .hero {
    min-height: auto;
    padding-top: 30px;
  }

  .hero-slider,
  .hero-card {
    min-height: 420px;
    height: 420px;
  }

  .hero-stats,
  .footer-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }

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

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

  .rank-row {
    grid-template-columns: 46px 76px 1fr;
  }

  .rank-row .primary-btn {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .page-shell,
  .hero,
  .site-footer {
    width: min(100% - 22px, 1280px);
  }

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

  .hero-card-content {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }

  .detail-panel,
  .detail-title {
    padding: 20px;
  }
}
