*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --sand-50: #faf8f3;
  --sand-100: #f5f0e6;
  --sand-200: #ebe2cd;
  --sand-300: #ddc9a3;
  --sand-400: #d4b683;
  --sand-500: #c49a5c;
  --sand-600: #b07d44;
  --sand-700: #8f6235;
  --sand-800: #6d4a29;
  --sand-900: #4a3218;
  --dune-50: #fdf6ed;
  --dune-100: #fae9d1;
  --dune-200: #f5d4a3;
  --dune-300: #ebb76a;
  --dune-400: #e19838;
  --dune-500: #d97c1e;
  --dune-600: #c05f14;
  --dune-700: #9c4613;
  --dune-800: #7d3714;
  --dune-900: #642d13;
  --white: #ffffff;
  --black: #0f0b07;
  --shadow-soft: 0 18px 45px rgba(74, 50, 24, 0.12);
  --shadow-card: 0 10px 28px rgba(74, 50, 24, 0.11);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sand-50);
  color: var(--sand-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(221, 201, 163, 0.6);
  box-shadow: 0 8px 28px rgba(74, 50, 24, 0.08);
}

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

.brand,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--dune-500), var(--dune-700));
  box-shadow: 0 10px 24px rgba(192, 95, 20, 0.28);
}

.brand-text {
  font-size: 21px;
  background: linear-gradient(90deg, var(--dune-700), var(--sand-700));
  -webkit-background-clip: text;
  color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--sand-700);
  font-weight: 700;
}

.nav-link {
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--dune-600);
  transition: width 0.25s ease;
}

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

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--sand-100);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--sand-800);
  border-radius: 10px;
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 18px;
  border-top: 1px solid var(--sand-200);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-link,
.mobile-category-row a {
  display: block;
  padding: 10px 0;
  color: var(--sand-700);
  font-weight: 700;
}

.mobile-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.hero {
  position: relative;
  height: clamp(540px, 76vh, 760px);
  overflow: hidden;
  background: var(--sand-900);
}

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

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

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

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

.hero-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 11, 7, 0.88) 0%, rgba(15, 11, 7, 0.55) 42%, rgba(15, 11, 7, 0.18) 100%);
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 76px;
  width: min(1240px, calc(100% - 32px));
  transform: translateX(-50%);
  color: var(--white);
}

.hero-content h1 {
  max-width: 850px;
  margin: 14px 0 18px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

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

.hero-actions,
.intro-actions,
.slim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.section-link,
.rank-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary,
.rank-action {
  color: var(--white);
  background: linear-gradient(135deg, var(--dune-500), var(--dune-700));
  box-shadow: 0 12px 26px rgba(192, 95, 20, 0.25);
}

.btn-secondary {
  color: var(--dune-700);
  background: var(--dune-100);
}

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

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.section-link:hover,
.rank-action:hover {
  transform: translateY(-2px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.35);
  font-size: 36px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

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

.hero-dot.is-active {
  background: var(--white);
}

.home-intro,
.page-shell,
.detail-page {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.home-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 58px 0 24px;
}

.home-intro h1,
.page-hero h1,
.section-head h2,
.detail-info h1 {
  margin: 0;
  color: var(--sand-900);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.home-intro h1,
.page-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.home-intro p,
.page-hero p,
.section-head p {
  max-width: 780px;
  color: var(--sand-700);
  margin: 12px 0 0;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 9px;
  color: var(--dune-700);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-section {
  margin: 62px 0;
}

.no-top-space {
  margin-top: 26px;
}

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

.section-head h2 {
  font-size: clamp(26px, 3vw, 38px);
}

.section-link {
  color: var(--dune-700);
  background: var(--dune-100);
  white-space: nowrap;
}

.filter-panel {
  margin: 18px 0 28px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--sand-200);
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--sand-700);
  font-size: 13px;
  font-weight: 800;
}

.filter-form input,
.filter-form select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--sand-300);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--sand-900);
  background: var(--white);
  outline: none;
}

.filter-form input:focus,
.filter-form select:focus {
  border-color: var(--dune-500);
  box-shadow: 0 0 0 3px rgba(217, 124, 30, 0.14);
}

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(235, 226, 205, 0.85);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sand-200), var(--dune-100));
}

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

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

.movie-score {
  position: absolute;
  right: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 900;
}

.movie-body {
  padding: 15px;
}

.movie-body h2 {
  margin: 0 0 8px;
  min-height: 2.75em;
  color: var(--sand-900);
  font-size: 18px;
  line-height: 1.35;
}

.movie-body h2 a:hover,
.rank-content h2 a:hover {
  color: var(--dune-700);
}

.movie-body p {
  margin: 0 0 12px;
  min-height: 3.2em;
  color: var(--sand-700);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--sand-500);
  font-size: 12px;
  font-weight: 800;
}

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

.movie-body .tag-list {
  margin-top: 12px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--sand-700);
  background: var(--sand-100);
  font-size: 12px;
  font-weight: 800;
}

.hero-tags span {
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

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

.category-tile,
.category-card-link {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--sand-200);
  box-shadow: var(--shadow-card);
}

.category-tile {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: var(--white);
}

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

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.12));
}

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

.category-tile span {
  font-size: 22px;
  font-weight: 900;
}

.category-tile strong {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
}

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

.page-shell {
  padding: 42px 0 18px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(32px, 6vw, 72px);
  background: radial-gradient(circle at top right, var(--dune-100), transparent 42%), linear-gradient(135deg, var(--white), var(--sand-100));
  box-shadow: var(--shadow-card);
  border: 1px solid var(--sand-200);
}

.ranking-hero,
.category-hero {
  background: linear-gradient(135deg, var(--sand-900), var(--dune-800));
  color: var(--white);
}

.ranking-hero h1,
.category-hero h1,
.ranking-hero p,
.category-hero p {
  color: var(--white);
}

.category-overview-grid {
  margin: 32px 0 60px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-card-link {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 230px;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--sand-200);
}

.category-covers img {
  width: 100%;
  height: 100%;
  min-height: 114px;
  object-fit: cover;
}

.category-card-body {
  padding: 28px;
}

.category-card-body h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.category-card-body p {
  color: var(--sand-700);
  margin: 0 0 18px;
}

.category-card-body strong {
  color: var(--dune-700);
}

.rank-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 60px;
}

.rank-item {
  display: grid;
  grid-template-columns: 70px 120px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
}

.rank-number {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--dune-500), var(--dune-700));
  font-size: 22px;
  font-weight: 900;
}

.rank-cover {
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 16 / 10;
  background: var(--sand-200);
}

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

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

.rank-content p {
  margin: 0 0 8px;
  color: var(--sand-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 24px 0;
  color: var(--sand-600);
  font-size: 14px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 38px;
  align-items: stretch;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 34px;
  background: linear-gradient(135deg, var(--white), var(--sand-100));
  border: 1px solid var(--sand-200);
  box-shadow: var(--shadow-card);
}

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

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

.detail-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-info h1 {
  margin-top: 18px;
  font-size: clamp(36px, 5vw, 64px);
}

.detail-lead {
  margin: 18px 0 26px;
  color: var(--sand-700);
  font-size: 19px;
}

.detail-meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.detail-meta-list li {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--sand-200);
}

.detail-meta-list span {
  display: block;
  color: var(--sand-500);
  font-size: 12px;
  font-weight: 900;
}

.detail-meta-list strong {
  display: block;
  margin-top: 4px;
  color: var(--sand-900);
}

.player-section {
  margin: 36px 0;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: #000000;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--white);
  background: radial-gradient(circle, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.46));
  cursor: pointer;
  transition: opacity 0.2s ease;
}

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

.play-button {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding-left: 6px;
  color: var(--white);
  background: linear-gradient(135deg, var(--dune-500), var(--dune-700));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  font-size: 34px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  align-items: start;
  margin-bottom: 72px;
}

.detail-main,
.detail-side {
  border-radius: 28px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--sand-200);
  box-shadow: var(--shadow-card);
}

.detail-main h2,
.detail-side h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-main p {
  margin: 0 0 26px;
  color: var(--sand-700);
  font-size: 17px;
  line-height: 1.85;
}

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

.side-related {
  display: grid;
  gap: 14px;
}

.side-related .movie-card {
  display: grid;
  grid-template-columns: 118px 1fr;
}

.side-related .movie-cover {
  aspect-ratio: 4 / 3;
  height: 100%;
}

.side-related .movie-body {
  padding: 12px;
}

.side-related .movie-body h2 {
  font-size: 15px;
  min-height: auto;
}

.side-related .movie-body p,
.side-related .tag-list {
  display: none;
}

.site-footer {
  margin-top: 78px;
  background: linear-gradient(180deg, var(--sand-100), var(--sand-200));
  border-top: 1px solid var(--sand-200);
}

.footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 34px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand p,
.footer-group p,
.footer-group a {
  color: var(--sand-700);
}

.footer-group h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.footer-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-group a:hover {
  color: var(--dune-700);
}

.footer-bottom {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: var(--sand-600);
  border-top: 1px solid var(--sand-300);
  text-align: center;
  font-size: 14px;
}

.movie-card.is-hidden,
.rank-item.is-hidden {
  display: none;
}

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

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

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

  .detail-side {
    position: static;
  }
}

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

  .menu-toggle {
    display: inline-flex;
  }

  .hero-arrow {
    display: none;
  }

  .home-intro,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .detail-poster img {
    min-height: auto;
  }

  .rank-item {
    grid-template-columns: 48px 92px 1fr;
  }

  .rank-action {
    grid-column: 2 / -1;
    width: max-content;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .home-intro,
  .page-shell,
  .detail-page,
  .footer-inner,
  .footer-bottom {
    width: min(100% - 24px, 1240px);
  }

  .hero {
    height: 620px;
  }

  .hero-content {
    bottom: 72px;
    width: min(100% - 28px, 1240px);
  }

  .movie-grid,
  .library-grid,
  .compact-grid,
  .hot-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .filter-form,
  .detail-meta-list {
    grid-template-columns: 1fr;
  }

  .movie-body {
    padding: 12px;
  }

  .movie-body h2 {
    font-size: 16px;
  }

  .category-tile {
    min-height: 170px;
  }

  .page-hero,
  .detail-hero,
  .detail-main,
  .detail-side {
    border-radius: 22px;
  }

  .side-related .movie-card {
    grid-template-columns: 96px 1fr;
  }
}
