:root {
  color-scheme: light;
  --bg: #f9fafb;
  --text: #1f2937;
  --muted: #6b7280;
  --soft: #f3f4f6;
  --line: #e5e7eb;
  --white: #ffffff;
  --orange: #f97316;
  --orange-deep: #ea580c;
  --rose: #ec4899;
  --red: #ef4444;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --green: #16a34a;
  --purple: #9333ea;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 28px;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  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%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: #fff;
  background: linear-gradient(90deg, var(--orange), var(--red), var(--rose));
  box-shadow: 0 16px 35px rgba(239, 68, 68, 0.22);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--orange);
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: rotate(12deg) scale(1.04);
}

.brand-text {
  font-size: 1.38rem;
}

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

.nav-link {
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.95;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffedd5;
  opacity: 1;
}

.header-search,
.mobile-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-input {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.header-search input::placeholder,
.mobile-search input::placeholder {
  color: rgba(255, 255, 255, 0.76);
}

.header-search input {
  width: 210px;
  padding: 10px 16px;
}

.header-search button,
.mobile-search button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--orange-deep);
  background: #fff;
  font-weight: 800;
}

.menu-button {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.1rem;
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

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

.mobile-search {
  margin-bottom: 12px;
}

.mobile-search input {
  flex: 1;
  width: 100%;
  padding: 10px 16px;
}

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

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

.hero {
  position: relative;
  height: 590px;
  overflow: hidden;
  color: #fff;
  background: #030712;
}

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

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

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.52) 45%, rgba(0, 0, 0, 0.18));
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2));
  right: 24px;
  bottom: 72px;
  z-index: 2;
  max-width: 780px;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #fed7aa;
  font-weight: 800;
}

.eyebrow span:first-child {
  padding: 6px 12px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
}

.hero h1,
.hero h2 {
  margin: 0 0 18px;
  font-size: clamp(2.25rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero p {
  max-width: 720px;
  margin: 0 0 24px;
  color: #e5e7eb;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--orange);
}

.btn-primary:hover {
  background: var(--orange-deep);
}

.btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-dots {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 72px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

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

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

.section {
  padding: 44px 0;
}

.section-soft {
  margin: 32px 0;
  padding: 34px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff7ed, #fdf2f8);
}

.section-blue {
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

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

.section-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.2;
  color: #111827;
}

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

.more-link {
  flex: 0 0 auto;
  color: var(--orange-deep);
  font-weight: 900;
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.poster-link {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #111827;
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  padding: 16px;
  color: #fff;
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.08));
  transition: opacity 0.22s ease;
}

.poster-shade p {
  margin: 0;
  font-size: 0.9rem;
}

.movie-card:hover .poster-shade {
  opacity: 1;
}

.year-badge,
.rank-badge,
.play-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
}

.year-badge {
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  background: rgba(0, 0, 0, 0.68);
  font-size: 0.76rem;
}

.rank-badge {
  top: 10px;
  right: 10px;
  padding: 5px 9px;
  background: #dc2626;
  font-size: 0.74rem;
}

.play-badge {
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--orange);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.movie-card:hover .play-badge {
  opacity: 1;
}

.movie-info {
  padding: 16px;
}

.movie-info h3 {
  overflow: hidden;
  display: -webkit-box;
  margin: 0 0 8px;
  min-height: 1.42em;
  color: #111827;
  font-size: 1rem;
  line-height: 1.42;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: var(--orange-deep);
}

.movie-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.tag-row span {
  border-radius: 999px;
  padding: 3px 8px;
  color: #c2410c;
  background: #fff7ed;
  font-size: 0.74rem;
  font-weight: 800;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--rose));
  box-shadow: var(--shadow-soft);
}

.category-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -44px;
  bottom: -56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

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

.category-card p {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.86);
}

.category-card span {
  position: relative;
  z-index: 1;
  font-weight: 900;
}

.page-hero {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--red), var(--rose));
}

.page-hero .container {
  padding: 54px 0;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.filter-input {
  width: min(440px, 100%);
  border-color: var(--line);
  color: var(--text);
  background: var(--soft);
  padding: 12px 16px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--text);
  background: #fff;
  font-weight: 800;
}

.filter-chip:hover {
  border-color: #fed7aa;
  color: var(--orange-deep);
}

.empty-state {
  display: none;
  padding: 42px;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: #fff;
}

.empty-state.is-visible {
  display: block;
}

.ranking-list {
  display: grid;
  gap: 16px;
}

.rank-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.rank-card a {
  display: flex;
  min-height: 190px;
}

.rank-poster {
  position: relative;
  flex: 0 0 145px;
  background: #111827;
}

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

.rank-number {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, var(--orange));
  font-weight: 900;
}

.rank-body {
  padding: 18px;
}

.rank-body h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.rank-body p {
  margin: 0 0 12px;
  color: var(--muted);
}

.breadcrumb {
  padding: 18px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: var(--orange-deep);
  font-weight: 800;
}

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

.player-shell {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #030712;
  box-shadow: var(--shadow);
}

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

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

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.18);
}

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

.player-cover span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--red));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  font-size: 2rem;
}

.detail-card {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  padding: 26px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-card h1 {
  margin: 0 0 12px;
  color: #111827;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.detail-lead {
  margin: 0 0 18px;
  color: #4b5563;
  font-size: 1.08rem;
}

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

.meta-item {
  border-radius: 16px;
  padding: 14px;
  background: #f9fafb;
}

.meta-item b {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}

.prose h2 {
  margin: 26px 0 10px;
  color: #111827;
}

.prose p {
  margin: 0 0 14px;
  color: #4b5563;
}

.side-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.side-panel img {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #111827;
}

.side-panel h2 {
  margin: 18px 0 10px;
  font-size: 1.25rem;
}

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

.small-related {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.small-related img {
  width: 74px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  background: #111827;
}

.small-related h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.3;
}

.small-related p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

@media (max-width: 1040px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

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

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

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

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

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

  .side-panel {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .header-inner {
    height: 62px;
  }

  .brand-text {
    font-size: 1.08rem;
  }

  .hero {
    height: 540px;
  }

  .hero-content {
    left: 18px;
    right: 18px;
    bottom: 86px;
  }

  .hero-dots {
    left: 18px;
    right: auto;
    bottom: 42px;
  }

  .section {
    padding: 32px 0;
  }

  .section-soft {
    padding: 22px;
  }

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

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

  .movie-info {
    padding: 12px;
  }

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

  .rank-card a {
    min-height: 150px;
  }

  .rank-poster {
    flex-basis: 112px;
  }

  .detail-card {
    padding: 20px;
  }

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

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

  .side-panel {
    display: block;
  }

  .player-cover span {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 420px) {
  .movie-grid,
  .movie-grid.compact,
  .related-grid {
    grid-template-columns: 1fr;
  }

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