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

:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(41, 37, 36, 0.12);
  --soft-shadow: 0 12px 30px rgba(41, 37, 36, 0.08);
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--white);
  background: linear-gradient(90deg, var(--stone-800), var(--stone-700), var(--stone-800));
  box-shadow: 0 10px 30px rgba(28, 25, 23, 0.18);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.brand-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--stone-900);
  background: var(--amber-500);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0.03em;
}

.brand-text em {
  font-size: 12px;
  color: var(--stone-300);
  font-style: normal;
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--stone-200);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: var(--amber-600);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 0 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

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

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(28, 25, 23, 0.98) 0%, rgba(28, 25, 23, 0.62) 48%, rgba(28, 25, 23, 0.08) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-bottom: 72px;
}

.hero-copy {
  max-width: 760px;
  color: var(--white);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--white);
  background: var(--amber-600);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.26);
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(40px, 7vw, 70px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p {
  margin: 0;
  color: var(--stone-200);
  font-size: 18px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-tags,
.detail-meta,
.detail-side-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span,
.detail-meta span,
.detail-side-info span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--stone-100);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn,
.home-search button,
.filter-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary,
.home-search button,
.btn.full {
  color: var(--white);
  background: var(--amber-600);
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.22);
}

.btn.ghost {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn:hover,
.home-search button:hover,
.filter-panel button:hover {
  transform: translateY(-2px);
}

.btn.primary:hover,
.home-search button:hover,
.btn.full:hover {
  background: var(--amber-500);
}

.btn.full {
  width: 100%;
  margin-top: 18px;
}

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

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

.hero-dot.active {
  width: 34px;
  background: var(--amber-500);
}

.hero-rail {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: stretch;
  margin-top: -42px;
  position: relative;
  z-index: 4;
}

.rail-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
  padding: 24px;
  border-radius: 18px;
  color: var(--white);
  background: linear-gradient(135deg, var(--stone-800), var(--stone-700));
  box-shadow: var(--shadow);
}

.rail-title span {
  color: var(--amber-400);
  font-size: 14px;
}

.rail-title strong {
  margin-top: 8px;
  font-size: 24px;
}

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

.search-panel {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 24px;
  align-items: center;
  margin-top: 46px;
  padding: 28px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.search-panel h2,
.content-section h2,
.ranking-box h2,
.page-hero h1,
.detail-article h1,
.detail-article h2,
.detail-recommend h2 {
  margin: 0;
  color: var(--stone-900);
}

.search-panel p,
.section-head p,
.category-tile p,
.category-card-large p,
.detail-article p {
  color: var(--stone-500);
  line-height: 1.75;
}

.home-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.home-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--stone-200);
  border-radius: 12px;
  color: var(--stone-800);
  background: var(--white);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.home-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.content-section {
  margin-top: 54px;
}

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

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

.section-head p {
  margin: 8px 0 0;
}

.section-head.slim {
  margin-bottom: 16px;
}

.section-more,
.text-link {
  color: var(--amber-700);
  font-weight: 800;
}

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

.category-tile {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  color: var(--white);
  background: var(--stone-800);
  box-shadow: var(--soft-shadow);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(28, 25, 23, 0.88), rgba(28, 25, 23, 0.18));
}

.category-tile span,
.category-tile p {
  position: relative;
  z-index: 1;
}

.category-tile span {
  display: block;
  margin-top: 92px;
  font-size: 20px;
  font-weight: 900;
}

.category-tile p {
  margin: 8px 0 0;
  color: var(--stone-200);
  font-size: 13px;
}

.category-tile:hover img {
  opacity: 0.54;
  transform: scale(1.06);
}

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

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

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

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--stone-800), var(--stone-600));
}

.movie-card:not(.compact) .poster-wrap {
  aspect-ratio: 2 / 3;
}

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

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

.play-mark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(217, 119, 6, 0.92);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.24);
}

.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--white);
  background: var(--amber-600);
  font-weight: 900;
}

.movie-info {
  padding: 16px;
}

.movie-info h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  color: var(--stone-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-info p {
  min-height: 48px;
  margin: 10px 0 12px;
  color: var(--stone-500);
  line-height: 1.6;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.movie-tags span,
.detail-tags a {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--amber-700);
  background: rgba(245, 158, 11, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.movie-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--stone-400);
  font-size: 13px;
}

.movie-card.compact {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 150px;
}

.movie-card.compact .poster-wrap {
  height: 100%;
}

.movie-card.compact .movie-info p {
  min-height: 0;
}

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

.ranking-box {
  margin-top: 54px;
  padding: 24px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--stone-50);
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: rgba(245, 158, 11, 0.12);
  transform: translateX(3px);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--white);
  background: var(--stone-800);
  font-weight: 900;
}

.rank-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.rank-score {
  color: var(--amber-700);
  font-size: 13px;
  font-weight: 800;
}

.page-main {
  min-height: 70vh;
}

.page-hero {
  padding: 82px 0;
  color: var(--white);
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.26), transparent 34%), linear-gradient(135deg, var(--stone-800), var(--stone-900));
}

.page-hero.small {
  padding: 64px 0;
}

.page-hero h1 {
  margin: 16px 0 12px;
  color: var(--white);
  font-size: clamp(34px, 5vw, 54px);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
  padding: 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

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

.category-list-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 36px;
  margin-bottom: 60px;
}

.category-card-large {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  padding: 18px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.category-cover {
  overflow: hidden;
  border-radius: 16px;
  background: var(--stone-800);
  aspect-ratio: 4 / 5;
}

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

.category-card-large h2 {
  margin: 4px 0 8px;
  color: var(--stone-900);
}

.category-card-large ul {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--stone-600);
  line-height: 1.8;
}

.sticky-box {
  position: sticky;
  top: 88px;
}

.watch-section {
  padding: 26px 0 38px;
  color: var(--white);
  background: linear-gradient(180deg, var(--stone-900), var(--stone-800));
}

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

.breadcrumb a {
  color: var(--amber-400);
}

.watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: stretch;
}

.player-card,
.detail-side {
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.28);
}

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.movie-player,
.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.movie-player {
  background: #000000;
}

.player-cover {
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: var(--white);
  background: #000000;
  cursor: pointer;
  z-index: 2;
  overflow: hidden;
}

.player-cover.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
}

.player-button {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  color: var(--white);
  background: var(--amber-600);
  font-size: 32px;
  box-shadow: 0 18px 48px rgba(217, 119, 6, 0.36);
}

.detail-side {
  padding: 16px;
}

.detail-side img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 16px;
  background: var(--stone-900);
}

.detail-side-info span {
  color: var(--white);
}

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

.detail-article,
.detail-recommend {
  padding: 26px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

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

.detail-article h2 {
  margin-top: 30px;
  font-size: 24px;
}

.detail-article p.lead {
  color: var(--stone-700);
  font-size: 18px;
  font-weight: 700;
}

.detail-article p {
  font-size: 16px;
}

.detail-meta span {
  color: var(--stone-700);
  background: var(--stone-100);
}

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

.mini-grid {
  display: grid;
  gap: 16px;
}

.site-footer {
  color: var(--stone-300);
  background: var(--stone-900);
  margin-top: 70px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 34px;
  padding: 44px 0;
}

.footer-logo {
  color: var(--white);
  font-size: 24px;
  font-weight: 900;
}

.footer-brand p {
  max-width: 560px;
  line-height: 1.8;
}

.site-footer h3 {
  color: var(--white);
  margin: 0 0 14px;
}

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

.site-footer a:hover {
  color: var(--amber-400);
}

.footer-bottom {
  padding: 18px 0;
  text-align: center;
  color: var(--stone-500);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.is-hidden-card {
  display: none !important;
}

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

  .split-section,
  .detail-content,
  .watch-grid {
    grid-template-columns: 1fr;
  }

  .detail-side {
    display: none;
  }

  .ranking-box,
  .sticky-box {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .brand-text strong {
    font-size: 17px;
  }

  .hero {
    height: auto;
    min-height: 600px;
  }

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

  .hero-rail,
  .search-panel,
  .filter-panel,
  .filter-panel.wide,
  .footer-grid,
  .category-card-large {
    grid-template-columns: 1fr;
  }

  .rail-grid,
  .category-list-page {
    grid-template-columns: 1fr;
  }

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

  .movie-card.compact {
    grid-template-columns: 120px 1fr;
  }
}

@media (max-width: 540px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .hero h1,
  .page-hero h1 {
    font-size: 34px;
  }

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

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

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

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

  .watch-section {
    padding-top: 18px;
  }

  .detail-article,
  .detail-recommend {
    padding: 20px;
  }
}
