:root {
  --mountain-50: #f5f7f7;
  --mountain-100: #e6eceb;
  --mountain-200: #c8d4d2;
  --mountain-300: #9fb4b1;
  --mountain-500: #5f7773;
  --mountain-600: #4e635f;
  --mountain-700: #3f504d;
  --mountain-800: #263533;
  --mountain-900: #172220;
  --earth-50: #fff7ed;
  --earth-100: #ffedd5;
  --earth-300: #fdba74;
  --earth-500: #f97316;
  --earth-600: #ea580c;
  --forest-600: #16815a;
  --sky-600: #0284c7;
  --text: #182421;
  --muted: #60706c;
  --card: #ffffff;
  --shadow-soft: 0 14px 35px rgba(23, 34, 32, 0.08);
  --shadow-medium: 0 22px 50px rgba(23, 34, 32, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mountain-50);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(200, 212, 210, 0.8);
}

.nav-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--mountain-900);
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mountain-600), var(--earth-600));
  color: white;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.desktop-nav a,
.mobile-nav a {
  color: var(--mountain-700);
  font-weight: 650;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: var(--earth-600);
}

.nav-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--mountain-200);
  border-radius: 999px;
  overflow: hidden;
  background: white;
  min-width: 250px;
}

.nav-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 10px 12px 10px 16px;
  background: transparent;
}

.nav-search button {
  border: 0;
  padding: 10px 16px;
  cursor: pointer;
  color: white;
  background: var(--mountain-700);
}

.menu-toggle {
  display: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--mountain-900);
  background: var(--mountain-100);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mobile-nav.open {
  display: grid;
}

main {
  min-height: 70vh;
}

.hero-carousel {
  position: relative;
  height: 66vh;
  min-height: 520px;
  overflow: hidden;
  background: var(--mountain-900);
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.18)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px 76px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
}

.hero-content h1 {
  max-width: 820px;
  margin: 14px 0 14px;
  color: white;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
}

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

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

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

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--earth-600), var(--mountain-600));
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.44);
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translateY(-2px);
}

.hero-arrow.prev {
  left: 22px;
}

.hero-arrow.next {
  right: 22px;
}

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

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

.hero-dot.active {
  width: 34px;
  background: white;
}

.content-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 54px 22px;
}

.content-section.soft-bg {
  max-width: none;
  padding-left: max(22px, calc((100vw - 1280px) / 2 + 22px));
  padding-right: max(22px, calc((100vw - 1280px) / 2 + 22px));
  background: white;
}

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

.section-heading h2 {
  margin: 0;
  color: var(--mountain-900);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-more {
  color: var(--mountain-600);
  font-weight: 800;
  white-space: nowrap;
}

.section-more:hover {
  color: var(--earth-600);
}

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

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

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

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

.movie-card {
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--mountain-200);
}

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

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

.type-badge,
.rank-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 800;
}

.rank-badge {
  right: auto;
  left: 10px;
  min-width: 28px;
  text-align: center;
  background: linear-gradient(135deg, var(--earth-600), var(--mountain-600));
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 8px;
  color: var(--mountain-900);
  font-size: 18px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body h3 a:hover {
  color: var(--earth-600);
}

.card-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-line {
  margin: 0 0 12px;
  color: #33423f;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--mountain-700);
  background: var(--mountain-100);
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span {
  color: white;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.horizontal-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 2px 20px;
  scroll-snap-type: x mandatory;
}

.horizontal-row .movie-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
}

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

.category-card,
.category-overview-card a {
  display: block;
  padding: 16px;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.category-overview-card a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.category-preview {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 6px;
  height: 120px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--mountain-100);
}

.category-preview.large {
  grid-template-columns: repeat(4, 1fr);
  height: 160px;
}

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

.category-preview img:first-child {
  grid-row: span 2;
}

.category-preview.large img:first-child {
  grid-row: auto;
}

.category-card h3,
.category-overview-card h2 {
  margin: 16px 0 6px;
  color: var(--mountain-900);
}

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

.category-card span,
.category-overview-card span {
  color: var(--earth-600);
  font-weight: 800;
}

.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.rank-panel {
  position: sticky;
  top: 92px;
  padding: 22px;
  border-radius: 22px;
  background: var(--mountain-900);
  color: white;
  box-shadow: var(--shadow-medium);
}

.rank-panel h2 {
  margin: 0 0 16px;
}

.rank-panel ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-panel li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-panel a {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
}

.rank-panel strong {
  color: var(--earth-300);
}

.rank-panel span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-panel em {
  font-style: normal;
  color: white;
  font-weight: 800;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--mountain-200);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.filter-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mountain-50);
}

.filter-bar span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.page-hero {
  min-height: 340px;
  padding: 80px 22px;
  display: grid;
  place-items: center;
  color: white;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.35), transparent 32%),
    linear-gradient(135deg, var(--mountain-800), var(--mountain-600) 55%, var(--earth-600));
}

.page-hero > div {
  max-width: 860px;
}

.page-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}

.page-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--earth-300);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-inline-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.hero-inline-links a {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

.rank-table th {
  color: var(--mountain-800);
  background: var(--mountain-100);
}

.rank-table a {
  color: var(--mountain-800);
  font-weight: 800;
}

.detail-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 22px 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 28px;
  border-radius: 28px;
  color: white;
  background:
    radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.32), transparent 30%),
    linear-gradient(135deg, var(--mountain-900), var(--mountain-700));
  box-shadow: var(--shadow-medium);
}

.detail-poster {
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36);
}

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

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

.detail-line {
  max-width: 840px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

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

.detail-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.detail-info .tag-row span {
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.detail-info .btn {
  margin-top: 24px;
}

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

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  border: 0;
  color: white;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  text-align: center;
}

.video-shell.is-playing .play-overlay {
  opacity: 0;
  pointer-events: none;
}

.play-circle {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--earth-600), var(--mountain-600));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  font-size: 28px;
}

.play-overlay strong {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 18px;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.story-card {
  padding: 26px;
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.story-card h2 {
  margin: 0 0 12px;
  color: var(--mountain-900);
}

.story-card p {
  margin: 0;
  color: #2c3a37;
  font-size: 17px;
}

.site-footer {
  margin-top: 46px;
  padding: 46px 22px 28px;
  color: var(--mountain-100);
  background: var(--mountain-800);
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 34px;
}

.site-footer h3 {
  margin: 0 0 12px;
  color: white;
}

.site-footer p {
  color: var(--mountain-200);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer a:hover {
  color: var(--earth-300);
}

.copyright {
  max-width: 1280px;
  margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

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

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

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

  .nav-search {
    margin-left: auto;
  }

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

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

  .rank-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .nav-wrap {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    font-size: 20px;
  }

  .nav-search {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .hero-carousel {
    height: 74vh;
    min-height: 540px;
  }

  .hero-content {
    padding-bottom: 84px;
  }

  .hero-arrow {
    display: none;
  }

  .content-section {
    padding: 38px 16px;
  }

  .section-heading,
  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .all-grid,
  .ranking-grid,
  .related-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 16px;
  }

  .card-line {
    -webkit-line-clamp: 3;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

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

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

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

  .horizontal-row .movie-card {
    flex-basis: 250px;
  }
}
