:root {
  --night-950: #080b0f;
  --night-900: #0d1117;
  --night-850: #111821;
  --night-800: #161b22;
  --night-700: #21262d;
  --night-600: #30363d;
  --night-400: #8b949e;
  --night-300: #a7b0bb;
  --night-200: #c9d1d9;
  --night-100: #f0f6fc;
  --swamp-900: #121a16;
  --swamp-800: #1a2620;
  --swamp-700: #243329;
  --moss-800: #2a4227;
  --moss-700: #3a5937;
  --moss-600: #4d7348;
  --moss-500: #638f5c;
  --moss-400: #7aaa73;
  --moss-300: #96c48f;
  --amber: #f6c453;
  --shadow-swamp: 0 16px 40px rgba(3, 8, 5, .38);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--night-900);
  color: var(--night-100);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
select {
  font: inherit;
}

main {
  min-height: calc(100vh - 280px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(36, 51, 41, .92);
  background: rgba(13, 17, 23, .94);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1240px;
  height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--moss-600), var(--swamp-800));
  box-shadow: 0 10px 28px rgba(77, 115, 72, .28);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  color: var(--moss-300);
  font-size: 20px;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--night-400);
  font-size: 12px;
  margin-top: 3px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--night-300);
  font-weight: 650;
  transition: color .2s ease, transform .2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--moss-300);
}

.nav-link:hover {
  transform: translateY(-1px);
}

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

.menu-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 999px;
  background: var(--night-200);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--swamp-700);
  background: var(--night-800);
  padding: 14px 24px 20px;
}

.mobile-nav .nav-link {
  display: block;
  padding: 10px 0;
}

.hero {
  position: relative;
  min-height: 520px;
  height: 70vh;
  max-height: 820px;
  overflow: hidden;
  background: var(--night-950);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .7s ease, transform .7s ease;
  pointer-events: none;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.04);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 30%, rgba(150, 196, 143, .15), transparent 30%),
    linear-gradient(90deg, rgba(13, 17, 23, .96) 0%, rgba(13, 17, 23, .74) 45%, rgba(13, 17, 23, .24) 100%),
    linear-gradient(0deg, var(--night-900) 0%, transparent 52%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 92px 24px 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 46px;
  align-items: end;
}

.hero-copy {
  max-width: 740px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--moss-300);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1 {
  margin: 14px 0 18px;
  color: white;
  font-size: clamp(38px, 6vw, 72px);
  line-height: .98;
  font-weight: 880;
  letter-spacing: -.04em;
}

.hero-copy p,
.page-hero p {
  max-width: 690px;
  color: var(--night-200);
  font-size: 18px;
  line-height: 1.8;
}

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

.primary-button,
.ghost-button,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 760;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.primary-button {
  color: white;
  background: var(--moss-600);
  box-shadow: 0 12px 26px rgba(77, 115, 72, .28);
}

.primary-button:hover {
  background: var(--moss-500);
  transform: translateY(-2px) scale(1.02);
}

.ghost-button {
  border: 1px solid rgba(150, 196, 143, .38);
  color: var(--moss-300);
  background: rgba(22, 27, 34, .58);
}

.ghost-button:hover {
  border-color: var(--moss-300);
  transform: translateY(-2px);
}

.hero-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(150, 196, 143, .22);
  border-radius: 22px;
  box-shadow: var(--shadow-swamp);
  transform: translateY(18px);
}

.hero-poster img {
  aspect-ratio: 16 / 10;
  height: 100%;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  left: 16px;
  bottom: 16px;
  right: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--night-100);
  background: rgba(13, 17, 23, .74);
  backdrop-filter: blur(10px);
  font-size: 13px;
  line-height: 1.4;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-controls button {
  border: 0;
}

.hero-controls > button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--night-100);
  background: rgba(22, 27, 34, .72);
  backdrop-filter: blur(10px);
  font-size: 28px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: rgba(201, 209, 217, .38);
}

.hero-dot.active {
  width: 28px;
  border-radius: 999px;
  background: var(--moss-300);
}

.content-section {
  padding: 72px 24px;
  background: var(--night-900);
}

.content-section.bg-deep {
  background: var(--night-800);
}

.content-section.bg-swamp {
  background: var(--swamp-900);
}

.content-section > .section-heading,
.content-section > .filter-panel,
.content-section > .movie-grid,
.content-section > .category-grid,
.content-section > .category-overview-grid,
.content-section > .rail-wrap,
.content-section > .empty-state {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

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

.section-heading h2 {
  margin: 0;
  color: var(--moss-300);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 820;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 9px 0 0;
  color: var(--night-400);
  line-height: 1.7;
}

.section-more {
  min-height: 38px;
  padding: 0 16px;
  color: var(--moss-300);
  border: 1px solid rgba(150, 196, 143, .28);
  background: rgba(22, 27, 34, .5);
}

.section-more:hover {
  border-color: var(--moss-300);
  background: rgba(77, 115, 72, .16);
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(36, 51, 41, .86);
  border-radius: 18px;
  background: var(--night-800);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .17);
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(150, 196, 143, .38);
  background: var(--night-700);
  box-shadow: var(--shadow-swamp);
}

.movie-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--night-700);
}

.movie-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}

.movie-card:hover .movie-thumb img {
  transform: scale(1.08);
  filter: brightness(.82);
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.85);
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: white;
  background: rgba(77, 115, 72, .92);
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
}

.movie-card:hover .play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #211600;
  background: var(--amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 840;
  box-shadow: var(--shadow-soft);
}

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

.movie-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
  color: var(--night-100);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.48;
  transition: color .2s ease;
}

.movie-card:hover .movie-title {
  color: var(--moss-300);
}

.movie-meta,
.movie-one-line {
  color: var(--night-400);
  font-size: 13px;
}

.movie-meta {
  margin: 8px 0;
}

.movie-one-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  line-height: 1.55;
}

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.movie-tags a,
.movie-tags span,
.detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--moss-300);
  background: rgba(42, 66, 39, .64);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card.rail {
  flex: 0 0 288px;
}

.rail-wrap {
  position: relative;
}

.movie-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 4px 18px;
  scrollbar-width: none;
}

.movie-rail::-webkit-scrollbar {
  display: none;
}

.rail-control {
  position: absolute;
  z-index: 3;
  top: 40%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(150, 196, 143, .24);
  border-radius: 50%;
  color: var(--night-100);
  background: rgba(13, 17, 23, .75);
  backdrop-filter: blur(8px);
  font-size: 30px;
}

.rail-control.left {
  left: -12px;
}

.rail-control.right {
  right: -12px;
}

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

.category-tile,
.category-card a {
  display: block;
  height: 100%;
  border: 1px solid rgba(36, 51, 41, .88);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(42, 66, 39, .84), rgba(22, 27, 34, .94));
  padding: 22px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.category-tile:hover,
.category-card a:hover {
  transform: translateY(-4px);
  border-color: rgba(150, 196, 143, .38);
  box-shadow: var(--shadow-swamp);
}

.category-tile strong,
.category-card h2 {
  display: block;
  color: var(--moss-300);
  font-size: 22px;
  margin: 0 0 10px;
}

.category-tile span,
.category-card p {
  color: var(--night-300);
  font-size: 14px;
  line-height: 1.65;
}

.category-card {
  overflow: hidden;
}

.category-card a {
  padding: 0;
  overflow: hidden;
}

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

.category-covers img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 14px;
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(36, 51, 41, .9);
  border-radius: 16px;
  background: var(--night-800);
  color: var(--night-400);
}

.search-box input,
.filter-panel select {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--night-100);
  background: transparent;
}

.filter-panel select {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(36, 51, 41, .9);
  border-radius: 16px;
  background: var(--night-800);
}

.empty-state {
  margin-top: 12px;
  padding: 18px;
  border-radius: 14px;
  color: var(--night-300);
  background: var(--night-800);
}

.page-hero {
  min-height: 360px;
  display: flex;
  align-items: end;
  padding: 110px 24px 62px;
  background-color: var(--night-950);
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--swamp-700);
}

.page-hero > div {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.small-hero {
  background:
    radial-gradient(circle at 20% 10%, rgba(150, 196, 143, .12), transparent 32%),
    linear-gradient(135deg, var(--night-900), var(--swamp-900));
}

.category-hero h1 {
  font-size: clamp(42px, 6vw, 68px);
}

.detail-breadcrumb {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--night-400);
  font-size: 14px;
}

.detail-breadcrumb a:hover {
  color: var(--moss-300);
}

.detail-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
}

.player-card,
.movie-detail-card,
.side-box {
  border: 1px solid rgba(36, 51, 41, .86);
  border-radius: 20px;
  background: var(--night-800);
  box-shadow: var(--shadow-soft);
}

.player-card {
  overflow: hidden;
  margin-bottom: 22px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  background: black;
}

.video-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .06));
  transition: opacity .2s ease, visibility .2s ease;
}

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

.player-start {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--moss-600);
  box-shadow: 0 20px 44px rgba(77, 115, 72, .38);
  transition: transform .2s ease, background .2s ease;
}

.player-start:hover {
  transform: scale(1.06);
  background: var(--moss-500);
}

.player-start span {
  margin-left: 6px;
  font-size: 36px;
  line-height: 1;
}

.player-error {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  background: rgba(150, 33, 33, .88);
}

.movie-detail-card {
  padding: 28px;
}

.movie-detail-card h1 {
  margin: 0 0 16px;
  color: white;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.16;
}

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

.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--night-200);
  background: var(--night-700);
  font-size: 13px;
}

.detail-lead {
  margin: 0 0 20px;
  color: var(--moss-300);
  font-size: 18px;
  line-height: 1.75;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.movie-detail-card h2,
.side-box h2 {
  margin: 26px 0 12px;
  color: var(--moss-300);
  font-size: 22px;
}

.movie-detail-card h2:first-of-type {
  margin-top: 0;
}

.movie-detail-card p {
  color: var(--night-200);
  line-height: 1.9;
  font-size: 16px;
}

.detail-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-cover {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(36, 51, 41, .86);
  box-shadow: var(--shadow-swamp);
}

.side-cover img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.side-box {
  padding: 22px;
}

.side-box h2 {
  margin-top: 0;
}

.side-box dl {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px 14px;
  margin: 0;
}

.side-box dt {
  color: var(--night-400);
}

.side-box dd {
  margin: 0;
  color: var(--night-100);
}

.side-box a {
  color: var(--moss-300);
}

.detail-related {
  padding-top: 48px;
}

.site-footer {
  border-top: 1px solid var(--swamp-700);
  background: var(--night-800);
  padding: 48px 24px 26px;
}

.footer-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 38px;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--moss-300);
  font-size: 19px;
}

.site-footer p {
  margin: 0;
  color: var(--night-400);
  line-height: 1.8;
}

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

.footer-links a {
  color: var(--night-400);
  font-size: 14px;
}

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

.footer-bottom {
  max-width: 1240px;
  margin: 32px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--swamp-700);
  color: #69717b;
  font-size: 13px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

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

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

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

  .hero-poster,
  .detail-side {
    display: none;
  }
}

@media (max-width: 760px) {
  .header-inner {
    height: 64px;
    padding: 0 16px;
  }

  .desktop-nav {
    display: none;
  }

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

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

  .brand-copy strong {
    font-size: 18px;
  }

  .hero {
    min-height: 560px;
    height: 76vh;
  }

  .hero-inner {
    padding: 88px 18px 92px;
  }

  .hero-copy p,
  .page-hero p {
    font-size: 16px;
  }

  .hero-actions,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

  .movie-title {
    font-size: 14px;
    min-height: 42px;
  }

  .movie-one-line {
    display: none;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .page-hero {
    min-height: 300px;
    padding: 92px 18px 42px;
  }

  .detail-breadcrumb,
  .detail-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .movie-detail-card {
    padding: 20px;
  }

  .player-start {
    width: 70px;
    height: 70px;
  }

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

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

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

  .hero-controls {
    width: calc(100% - 28px);
    justify-content: space-between;
  }
}
