:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --muted: #94a3b8;
  --text: #f8fafc;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-strong: #fbbf24;
  --danger: #ef4444;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(245, 158, 11, 0.14), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  min-height: 100vh;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner,
.content-section,
.home-search,
.detail-layout,
.page-hero {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #111827;
  background: linear-gradient(135deg, var(--accent-strong), #f97316);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.28);
}

.brand-text {
  font-size: 20px;
}

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

.nav-link {
  color: var(--soft);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 10px 16px 16px;
}

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

.hero {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-track {
  position: relative;
  width: 100%;
  min-height: 610px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  transition: opacity 0.55s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  align-items: center;
  gap: 42px;
  padding: 72px max(24px, calc((100% - var(--max)) / 2)) 90px;
}

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

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

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.02;
  margin: 24px 0 18px;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 640px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.58);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}

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

.primary-button,
.ghost-button,
.home-search-form button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.home-search-form button {
  color: #111827;
  border: none;
  background: linear-gradient(135deg, var(--accent-strong), #f97316);
  box-shadow: 0 18px 38px rgba(245, 158, 11, 0.25);
  cursor: pointer;
}

.ghost-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.64);
}

.primary-button:hover,
.ghost-button:hover,
.home-search-form button:hover {
  transform: translateY(-2px);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  min-height: 480px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(30, 41, 59, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow);
}

.hero-poster img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.hero-poster:hover img {
  transform: scale(1.04);
}

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

.hero-controls button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  border-radius: 999px;
  cursor: pointer;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  opacity: 0.55;
}

.hero-dot.is-active {
  width: 28px;
  opacity: 1;
  background: var(--accent-strong);
}

.home-search {
  margin-top: -36px;
  position: relative;
  z-index: 10;
  display: grid;
  gap: 18px;
}

.home-search-form,
.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.home-search-form label,
.search-box {
  flex: 1;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.home-search-form input,
.search-box input,
.sort-select {
  width: 100%;
  min-height: 48px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.64);
  padding: 0 14px;
  outline: none;
}

.home-search-form input:focus,
.search-box input:focus,
.sort-select:focus {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

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

.quick-categories a,
.category-card {
  min-height: 108px;
  display: grid;
  align-content: end;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.8));
  padding: 18px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.quick-categories a:hover,
.category-card:hover,
.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.36);
}

.quick-categories span,
.category-card strong {
  font-size: 18px;
  font-weight: 800;
}

.quick-categories em,
.category-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

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

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

.section-heading h2,
.page-hero h1,
.detail-title-block h1,
.story-section h2 {
  margin: 12px 0 8px;
  letter-spacing: -0.02em;
}

.section-heading h2,
.page-hero h1 {
  font-size: clamp(30px, 5vw, 48px);
}

.section-heading p,
.page-hero p,
.story-section p {
  color: var(--soft);
  line-height: 1.8;
}

.section-more {
  color: var(--accent-strong);
  font-weight: 800;
}

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

.movie-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.76);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.poster-link {
  display: block;
}

.poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 10%, rgba(245, 158, 11, 0.38), transparent 35%),
    linear-gradient(135deg, #1e293b, #020617);
}

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

.poster.is-empty::after {
  content: "免费高清影院";
  position: absolute;
  inset: auto 14px 14px;
  color: rgba(248, 250, 252, 0.88);
  font-weight: 800;
  line-height: 1.4;
}

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

.quality-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  background: var(--accent-strong);
  border-radius: 999px;
  padding: 4px 8px;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.28);
}

.movie-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.movie-meta {
  gap: 6px;
}

.movie-meta span {
  padding: 4px 7px;
  font-size: 11px;
}

.movie-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.movie-card h3 a:hover {
  color: var(--accent-strong);
}

.movie-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  font-size: 13px;
}

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

.tag-row span {
  color: var(--accent-strong);
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(245, 158, 11, 0.09);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.76);
  padding: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateX(3px);
  border-color: rgba(251, 191, 36, 0.36);
}

.rank-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #111827;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-strong), #f97316);
}

.rank-title {
  font-weight: 800;
}

.rank-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.small-hero > div {
  min-height: 220px;
  display: grid;
  align-content: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.64)),
    radial-gradient(circle at 82% 8%, rgba(245, 158, 11, 0.28), transparent 32%);
  box-shadow: var(--shadow);
  padding: 32px;
}

.category-overview {
  width: min(var(--max), calc(100% - 32px));
  margin: 34px auto 0;
}

.category-card {
  min-height: 188px;
}

.category-posters {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  opacity: 0.34;
}

.category-posters span {
  background-position: center;
  background-size: cover;
}

.toolbar {
  width: min(var(--max), calc(100% - 32px));
  margin: 34px auto 0;
  align-items: center;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.chip {
  min-height: 42px;
  color: var(--soft);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.54);
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
}

.chip.is-active,
.chip:hover {
  color: #111827;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.library-section {
  padding-top: 34px;
}

.empty-state {
  display: none;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 38px;
}

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

.detail-layout {
  padding-top: 34px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 18px;
}

.breadcrumb a:hover {
  color: var(--accent-strong);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
}

.player-panel,
.detail-aside,
.story-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.video-shell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

.play-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.15), rgba(2, 6, 23, 0.56));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-layer.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-button {
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 50%;
  color: #111827;
  background: linear-gradient(135deg, var(--accent-strong), #f97316);
  box-shadow: 0 24px 60px rgba(245, 158, 11, 0.36);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.play-button:hover {
  transform: scale(1.06);
}

.play-button span {
  display: inline-block;
  margin-left: 4px;
  font-size: 32px;
}

.detail-title-block,
.story-section {
  padding: 24px;
}

.detail-title-block h1 {
  font-size: clamp(28px, 4vw, 46px);
}

.detail-aside {
  padding: 18px;
  align-self: start;
}

.large-poster {
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.detail-tags {
  margin-bottom: 18px;
}

.full-width {
  width: 100%;
}

.story-section {
  margin-top: 28px;
}

.story-section h2 {
  font-size: 24px;
}

.story-section p {
  margin: 0 0 20px;
  font-size: 16px;
}

.related-section {
  padding-top: 34px;
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.62);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  padding: 36px 0;
}

.footer-brand {
  font-size: 20px;
  margin-bottom: 12px;
}

.site-footer p,
.copyright {
  color: var(--muted);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-content: start;
}

.footer-links a {
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

.footer-links a:hover {
  color: var(--accent-strong);
  border-color: rgba(251, 191, 36, 0.36);
}

.copyright {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  font-size: 13px;
}

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

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

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

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

  .menu-toggle {
    display: flex;
  }

  .hero,
  .hero-track {
    min-height: 720px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 44px 16px 92px;
  }

  .hero-poster {
    min-height: 280px;
  }

  .hero-poster img {
    min-height: 280px;
  }

  .home-search-form,
  .toolbar,
  .section-heading,
  .footer-inner,
  .detail-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .detail-grid {
    display: grid;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner,
  .content-section,
  .home-search,
  .detail-layout,
  .page-hero,
  .toolbar,
  .category-overview,
  .copyright {
    width: min(100% - 24px, var(--max));
  }

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

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

  .movie-grid,
  .quick-categories,
  .category-overview,
  .rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

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

  .rank-item {
    grid-template-columns: 44px 1fr;
  }

  .rank-meta {
    grid-column: 2;
  }

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

  .movie-card p,
  .tag-row {
    display: none;
  }

  .small-hero > div {
    padding: 22px;
  }

  .play-button {
    width: 72px;
    height: 72px;
  }
}
