:root {
  --sand-50: #faf7f1;
  --sand-100: #f3eadb;
  --sand-200: #e5d1b4;
  --sand-500: #a57a52;
  --sand-600: #865f3f;
  --sand-700: #68462e;
  --sand-800: #46301f;
  --sand-900: #24180f;
  --desert-300: #f4b86a;
  --desert-400: #ef9f3c;
  --desert-500: #df7d20;
  --desert-600: #c56218;
  --desert-700: #984717;
  --white: #ffffff;
  --text: #2d2118;
  --muted: #786353;
  --shadow: 0 18px 40px rgba(80, 54, 30, 0.16);
  --shadow-soft: 0 10px 24px rgba(80, 54, 30, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, var(--sand-50), #ffffff 38%, var(--sand-50));
  min-height: 100vh;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--sand-700), var(--desert-700));
  color: var(--sand-50);
  box-shadow: 0 12px 30px rgba(36, 24, 15, 0.22);
}

.main-nav {
  max-width: 1280px;
  height: 68px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sand-900);
  background: linear-gradient(135deg, var(--desert-300), #fff2cc);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 20px rgba(0, 0, 0, 0.18);
}

.logo-text {
  white-space: nowrap;
  font-size: 1.18rem;
}

.desktop-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link,
.mobile-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(255, 252, 245, 0.9);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

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

.header-search input,
.mobile-search input,
.inline-search input,
.hero-search input {
  border: 1px solid rgba(104, 70, 46, 0.16);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 220px;
  box-shadow: inset 0 1px 3px rgba(80, 54, 30, 0.08);
}

.header-search button,
.mobile-search button,
.hero-search button,
.primary-button,
.secondary-button,
.player-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--desert-500), var(--desert-700));
  box-shadow: 0 10px 24px rgba(197, 98, 24, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.hero-search button:hover,
.primary-button:hover,
.secondary-button:hover,
.player-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(197, 98, 24, 0.38);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #ffffff;
  border-radius: 2px;
}

.mobile-nav {
  display: none;
  padding: 0 24px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

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

.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
  background: var(--sand-900);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

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

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

.hero-slide.active img {
  animation: heroZoom 7s ease forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.32) 48%, rgba(0, 0, 0, 0.08));
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: min(1180px, calc(100% - 48px));
  transform: translateX(-50%);
  color: #ffffff;
}

.hero-content-inner {
  max-width: 740px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--desert-300);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.95;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

.hero-content p {
  margin: 0 0 24px;
  max-width: 680px;
  font-size: clamp(1rem, 2vw, 1.22rem);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
}

.hero-actions,
.detail-actions,
.pagination,
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

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

.hero-tags {
  margin-bottom: 18px;
}

.hero-tags span,
.tag-row span,
.detail-tags span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sand-700);
  background: var(--sand-100);
}

.hero-tags span {
  color: #fff7e8;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.hero-controls {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 13%;
  display: grid;
  grid-template-columns: repeat(2, 48px);
  gap: 10px;
}

.hero-control {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.36);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.3rem;
  backdrop-filter: blur(8px);
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 34px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

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

.hero-dot.active {
  width: 30px;
  background: var(--desert-300);
}

.hero-search-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--sand-50));
  border-bottom: 1px solid var(--sand-100);
}

.hero-search {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.hero-search input {
  min-width: 0;
  padding: 15px 20px;
  border-radius: 18px;
}

.main-section,
.page-content,
.detail-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px;
}

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

.section-heading h2,
.page-hero h1,
.detail-title,
.category-card h2 {
  margin: 0;
  color: var(--sand-900);
  letter-spacing: -0.03em;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

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

.section-link,
.pagination a,
.breadcrumbs a {
  color: var(--desert-700);
  font-weight: 800;
}

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

.movie-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--sand-100);
}

.movie-card.compact .poster-link {
  aspect-ratio: 3 / 4;
}

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

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

.poster-link::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 50%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.66), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-link::after {
  opacity: 1;
}

.rating-badge,
.rank-number {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 9px;
  color: #ffffff;
  background: var(--desert-600);
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(197, 98, 24, 0.28);
}

.play-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  opacity: 0;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-chip {
  opacity: 1;
  transform: translateY(0);
}

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

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

.movie-card-body h3 a:hover {
  color: var(--desert-700);
}

.movie-meta {
  margin: 0 0 8px;
  color: var(--sand-600);
  font-size: 0.86rem;
  font-weight: 700;
}

.movie-desc {
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem;
}

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

.category-card {
  position: relative;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, var(--sand-50));
  box-shadow: var(--shadow-soft);
}

.category-card::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(239, 159, 60, 0.38), rgba(255, 255, 255, 0));
}

.category-card h2,
.category-card h3 {
  margin-top: 0;
}

.category-card p {
  min-height: 76px;
}

.category-card a {
  color: var(--desert-700);
  font-weight: 900;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 28px;
}

.rank-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item {
  display: grid;
  grid-template-columns: 54px 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.rank-index {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--desert-500), var(--sand-700));
  border-radius: 14px;
  font-weight: 900;
}

.rank-item img {
  width: 72px;
  height: 94px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-info h3 {
  margin: 0 0 7px;
}

.rank-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.rank-score {
  font-weight: 900;
  color: var(--desert-700);
}

.page-hero {
  background: radial-gradient(circle at 20% 10%, rgba(244, 184, 106, 0.44), transparent 28%), linear-gradient(135deg, var(--sand-900), var(--sand-700) 55%, var(--desert-700));
  color: #ffffff;
}

.page-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}

.page-hero h1 {
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 16px;
}

.page-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
}

.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 28px;
  padding: 18px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

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

.filter-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--sand-700);
  background: var(--sand-100);
  cursor: pointer;
  font-weight: 800;
}

.filter-btn.active,
.filter-btn:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--desert-500), var(--desert-700));
}

.inline-search input {
  min-width: min(330px, 100%);
}

.empty-state {
  display: none;
  padding: 36px;
  text-align: center;
  color: var(--muted);
  background: #ffffff;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.empty-state.show {
  display: block;
}

.pagination {
  justify-content: center;
  margin-top: 36px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  font-weight: 800;
}

.pagination span.active {
  color: #ffffff;
  background: var(--desert-600);
}

.detail-hero {
  position: relative;
  color: #ffffff;
  background: var(--sand-900);
  overflow: hidden;
}

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

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(8px) saturate(1.1);
  transform: scale(1.05);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--sand-900), rgba(36, 24, 15, 0.72));
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 46px 24px 58px;
}

.breadcrumbs {
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: #ffe4b6;
}

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

.player-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #000000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.player-wrap video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.18));
  cursor: pointer;
}

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

.player-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  font-size: 1.05rem;
}

.play-symbol {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--desert-700);
  background: #ffffff;
  border-radius: 50%;
}

.detail-side {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.detail-title {
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  margin-bottom: 18px;
}

.detail-side p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

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

.detail-meta .meta-pill {
  color: #fff4df;
  background: rgba(255, 255, 255, 0.14);
}

.detail-content-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow);
  background: var(--sand-100);
}

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

.detail-summary {
  display: grid;
  gap: 22px;
}

.content-card {
  padding: 28px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.content-card h2 {
  margin-top: 0;
  color: var(--sand-900);
}

.content-card p {
  margin-bottom: 0;
}

.site-footer {
  margin-top: 40px;
  color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(135deg, var(--sand-900), var(--sand-700));
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 28px;
}

.footer-logo {
  color: #ffffff;
  font-size: 1.18rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: start;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--desert-300);
}

.footer-bottom {
  padding: 18px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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

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

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

  .ranking-layout,
  .detail-layout,
  .detail-content-grid {
    grid-template-columns: 1fr;
  }

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

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

  .main-nav {
    height: 64px;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .hero-carousel {
    height: 72vh;
    min-height: 520px;
  }

  .hero-controls {
    right: 24px;
    bottom: 72px;
  }

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

  .filter-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-search input,
  .mobile-search input {
    width: 100%;
  }

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

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

@media (max-width: 640px) {
  .main-nav,
  .hero-content,
  .page-hero-inner,
  .main-section,
  .page-content,
  .detail-content,
  .detail-hero-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-content {
    width: calc(100% - 32px);
    bottom: 16%;
  }

  .hero-controls {
    display: none;
  }

  .hero-dots {
    bottom: 20px;
  }

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

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

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

  .rank-item {
    grid-template-columns: 42px 62px 1fr;
  }

  .rank-score {
    grid-column: 3;
  }

  .detail-side,
  .content-card {
    padding: 20px;
  }
}

@media (max-width: 430px) {
  .movie-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .movie-card-body h3 {
    font-size: 0.92rem;
  }

  .movie-meta {
    font-size: 0.76rem;
  }
}
