:root {
  --bg: #1c1917;
  --bg-deep: #0c0a09;
  --bg-soft: #292524;
  --panel: #1f1a17;
  --panel-light: #2d2926;
  --line: rgba(255, 255, 255, 0.08);
  --text: #fafaf9;
  --muted: #a8a29e;
  --muted-2: #78716c;
  --amber: #d97706;
  --amber-light: #f59e0b;
  --amber-deep: #b45309;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(28, 25, 23, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(41, 37, 36, 0.96);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.28);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber), #44403c);
  box-shadow: 0 12px 28px rgba(217, 119, 6, 0.22);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  color: #ffedd5;
  font-size: 20px;
  line-height: 1.1;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

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

.nav-link,
.nav-button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #d6d3d1;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-button:hover,
.nav-button.is-active {
  color: #fff;
  background: var(--amber);
}

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 180px;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(41, 37, 36, 0.98);
  box-shadow: var(--shadow);
}

.dropdown-panel.is-open {
  display: grid;
}

.dropdown-panel a {
  padding: 9px 11px;
  border-radius: 10px;
  color: #d6d3d1;
}

.dropdown-panel a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(310px, 28vw);
}

.header-search input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: #1c1917;
}

.header-search button,
.primary-button,
.secondary-button,
.filter-bar button {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  font-weight: 700;
  background: var(--amber);
  transition: transform 0.2s ease, background 0.2s ease;
}

.header-search button:hover,
.primary-button:hover,
.filter-bar button:hover {
  background: var(--amber-deep);
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-menu-button,
.mobile-nav {
  display: none;
}

.hero {
  position: relative;
  min-height: 560px;
  height: 72vh;
  overflow: hidden;
  background: var(--bg-deep);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background-image: linear-gradient(to top, rgba(28, 25, 23, 1), rgba(28, 25, 23, 0.65), rgba(28, 25, 23, 0.14)), var(--hero-image);
  background-size: cover;
  background-position: center;
  transition: opacity 0.9s ease;
}

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

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  z-index: 2;
}

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

.hero-badge,
.category-badge,
.year-badge,
.mini-badge,
.rank-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-badge,
.category-badge {
  padding: 6px 12px;
  color: #fff;
  background: var(--amber);
}

.hero h1 {
  margin: 18px 0 16px;
  max-width: 820px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 680px;
  margin: 0 0 28px;
  color: #d6d3d1;
  font-size: 19px;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transition: width 0.25s ease, background 0.25s ease;
}

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

.content-section {
  padding: 68px 0;
}

.section-dark {
  background: var(--bg);
}

.section-soft {
  background: var(--bg-soft);
}

.section-gradient {
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}

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

.section-heading h2,
.page-title h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
}

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

.section-more {
  color: var(--amber-light);
  font-weight: 700;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.movie-card a {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(217, 119, 6, 0.28), transparent 38%), #1c1917;
}

.poster-wide {
  aspect-ratio: 16 / 9;
}

.poster-thumb {
  width: 190px;
  min-height: 132px;
  flex: 0 0 190px;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.2s ease;
}

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

.image-hidden {
  opacity: 0;
}

.category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 9px;
}

.year-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
}

.rank-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--amber-light), var(--amber-deep));
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0 0 8px;
  display: -webkit-box;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: var(--amber-light);
}

.card-body p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span,
.meta-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: #d6d3d1;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.movie-card-horizontal a {
  display: flex;
  height: 100%;
}

.movie-card-horizontal .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.mini-badge {
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 8px;
  color: var(--amber-light);
  background: rgba(255, 255, 255, 0.07);
}

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

.category-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.24), rgba(41, 37, 36, 0.95));
}

.category-card h2,
.category-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.category-card p {
  margin: 0 0 18px;
  color: #d6d3d1;
}

.category-card span {
  color: var(--amber-light);
  font-weight: 800;
}

.page-hero {
  padding: 132px 0 58px;
  background: radial-gradient(circle at 20% 20%, rgba(217, 119, 6, 0.22), transparent 35%), linear-gradient(135deg, #1c1917, #292524);
  border-bottom: 1px solid var(--line);
}

.page-title {
  max-width: 820px;
}

.breadcrumb {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

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

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 120px;
  gap: 12px;
  margin-bottom: 28px;
}

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

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.player-panel,
.detail-card,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.player-panel {
  overflow: hidden;
}

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

.player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background-image: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.24)), var(--poster-image);
  background-size: cover;
  background-position: center;
}

.player-cover.is-hidden {
  display: none;
}

.play-circle {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 32px;
  background: var(--amber);
  box-shadow: 0 18px 45px rgba(217, 119, 6, 0.35);
}

.player-info {
  padding: 20px;
}

.player-info h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.player-info p {
  margin: 0;
  color: var(--muted);
}

.detail-card {
  margin-top: 22px;
  padding: 24px;
}

.detail-card h2,
.side-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.detail-card p {
  margin: 0 0 18px;
  color: #d6d3d1;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.meta-grid strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.side-panel {
  padding: 18px;
}

.side-poster {
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, rgba(217, 119, 6, 0.22), transparent 44%), #1c1917;
}

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

.side-meta {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.hidden-by-filter {
  display: none !important;
}

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

  .header-search {
    width: min(430px, 44vw);
    margin-left: auto;
  }

  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-nav.is-open {
    display: grid;
    gap: 4px;
    padding: 10px 16px 16px;
    border-top: 1px solid var(--line);
    background: rgba(28, 25, 23, 0.98);
  }

  .mobile-nav a {
    padding: 10px 12px;
    border-radius: 10px;
    color: #d6d3d1;
  }

  .mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
  }

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

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

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

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

  .header-inner {
    min-height: 64px;
  }

  .brand-text small,
  .header-search {
    display: none;
  }

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

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

  .hero-content {
    bottom: 70px;
  }

  .hero h1 {
    font-size: 42px;
  }

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

  .hero-arrow {
    display: none;
  }

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

  .movie-grid,
  .featured-grid,
  .list-grid,
  .rank-list,
  .related-grid,
  .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .movie-card-horizontal a {
    display: block;
  }

  .poster-thumb {
    width: 100%;
    min-height: auto;
    aspect-ratio: 16 / 10;
  }

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

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

  .content-section {
    padding: 46px 0;
  }

  .page-hero {
    padding-top: 110px;
  }
}
