:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(30, 41, 59, 0.58);
  --panel-strong: rgba(30, 41, 59, 0.86);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #e2e8f0;
  --accent-dark: #0f172a;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 34rem),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.12), transparent 34rem),
    linear-gradient(180deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #0f172a;
  background: #e2e8f0;
  box-shadow: 0 0 0 6px rgba(226, 232, 240, 0.08);
}

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

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.14);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.mobile-nav {
  display: none;
  padding: 8px 24px 20px;
  border-top: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.98);
}

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

.mobile-link,
.mobile-title {
  padding: 11px 14px;
  border-radius: 12px;
}

.mobile-link {
  color: var(--soft);
  background: rgba(148, 163, 184, 0.08);
}

.mobile-link.muted {
  color: var(--muted);
}

.mobile-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero {
  position: relative;
  min-height: 520px;
  height: 72vh;
  overflow: hidden;
}

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

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

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.06);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.82) 44%, rgba(15, 23, 42, 0.20) 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.06) 42%, rgba(15, 23, 42, 0.10) 100%);
}

.hero-content {
  position: absolute;
  z-index: 2;
  left: calc(50% - 590px);
  top: 50%;
  width: min(620px, calc(100% - 48px));
  transform: translateY(-50%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(30, 41, 59, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.hero h1,
.page-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p {
  margin: 0 0 26px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span,
.detail-meta-row span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.btn.primary {
  color: var(--accent-dark);
  background: var(--accent);
}

.btn.primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn.ghost {
  color: var(--soft);
  border: 1px solid var(--line);
  background: rgba(30, 41, 59, 0.52);
}

.btn.ghost:hover {
  color: var(--text);
  background: rgba(51, 65, 85, 0.72);
}

.hero-controls {
  position: absolute;
  right: 42px;
  bottom: 42px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-arrow {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(30, 41, 59, 0.78);
  cursor: pointer;
  font-size: 28px;
  transition: all 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(51, 65, 85, 0.92);
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-dot.is-active {
  width: 32px;
  background: #e2e8f0;
}

.quick-search,
.section-block,
.ranking-preview,
.page-main,
.detail-main {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.quick-search {
  margin-top: -58px;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.quick-search h2,
.section-head h2,
.page-hero h1,
.content-panel h2,
.info-panel h2 {
  margin: 0;
}

.quick-search h2,
.section-head h2,
.content-panel h2,
.info-panel h2 {
  font-size: 26px;
}

.quick-search p,
.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.76);
  outline: none;
}

.home-search input {
  min-height: 48px;
  padding: 0 16px;
}

.home-search button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  color: var(--accent-dark);
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.category-pills {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pills a,
.card-tags span,
.detail-tags span {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--soft);
  background: rgba(148, 163, 184, 0.12);
  font-size: 13px;
}

.section-block,
.ranking-preview {
  padding-top: 66px;
  padding-bottom: 30px;
}

.section-block.highlighted {
  margin-top: 36px;
  padding-top: 38px;
  padding-bottom: 38px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(30, 41, 59, 0.30);
}

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

.section-more {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--soft);
  background: rgba(148, 163, 184, 0.12);
}

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

.all-grid {
  padding-top: 30px;
  padding-bottom: 50px;
}

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

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 232, 240, 0.42);
  background: rgba(30, 41, 59, 0.72);
}

.poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(226, 232, 240, 0.20), transparent 38%),
    linear-gradient(145deg, rgba(51, 65, 85, 0.92), rgba(15, 23, 42, 0.92));
}

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

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

.poster-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), transparent);
}

.poster-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  color: #0f172a;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
}

.play-mark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #0f172a;
  background: rgba(226, 232, 240, 0.94);
}

.card-body {
  padding: 16px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.card-body h3 {
  margin: 0 0 9px;
  font-size: 18px;
  line-height: 1.35;
}

.card-body h3 a:hover,
.rank-info h3 a:hover,
.info-panel a:hover {
  color: #ffffff;
}

.card-body p {
  display: -webkit-box;
  min-height: 46px;
  margin: 0 0 14px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.page-main,
.detail-main {
  padding-top: 44px;
  padding-bottom: 50px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 80% 20%, rgba(226, 232, 240, 0.10), transparent 22rem),
    linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.80));
  box-shadow: var(--shadow);
}

.compact-hero h1,
.category-hero h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.filter-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.66);
}

.filter-heading {
  margin-bottom: 16px;
  font-weight: 800;
}

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

.filter-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filter-panel input,
.filter-panel select {
  min-height: 44px;
  padding: 0 14px;
}

.empty-state {
  display: none;
  margin: 28px 0 60px;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

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

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

.category-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.category-cover {
  min-height: 220px;
  background: rgba(30, 41, 59, 0.76);
}

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

.category-body {
  padding: 22px;
}

.category-body h2 {
  margin: 0 0 10px;
}

.category-body p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-links a {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--soft);
  background: rgba(148, 163, 184, 0.12);
  font-size: 13px;
}

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

.full-ranking {
  padding-top: 30px;
}

.rank-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.66);
}

.rank-num {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #0f172a;
  background: #e2e8f0;
  font-weight: 900;
}

.rank-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.86);
}

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

.rank-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.rank-info p {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--soft);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rank-meta {
  color: var(--muted);
  font-size: 13px;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-start {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  color: var(--text);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.24), rgba(15, 23, 42, 0.70));
  cursor: pointer;
}

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

.player-start-icon {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #0f172a;
  background: rgba(226, 232, 240, 0.96);
  font-size: 30px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.42);
}

.player-loading,
.player-error {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: none;
  transform: translate(-50%, -50%);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
}

.player-loading.is-visible,
.player-error.is-visible {
  display: block;
}

.player-error {
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.player-controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  display: flex;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player-shell:hover .player-controls,
.player-shell.is-playing .player-controls {
  opacity: 1;
}

.player-controls button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  padding: 8px 12px;
  cursor: pointer;
}

.detail-title-block {
  padding: 28px 0 18px;
}

.detail-title-block h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
}

.detail-title-block p {
  margin: 0 0 18px;
  color: var(--soft);
  font-size: 19px;
  line-height: 1.75;
}

.content-panel,
.info-panel {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.62);
}

.content-panel p {
  margin: 14px 0 0;
  color: var(--soft);
  line-height: 1.95;
}

.info-panel dl {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px 14px;
  margin: 18px 0;
}

.info-panel dt {
  color: var(--muted);
}

.info-panel dd {
  margin: 0;
  color: var(--soft);
}

.sticky-panel {
  position: sticky;
  top: 90px;
}

.side-list .rank-card {
  grid-template-columns: 66px minmax(0, 1fr);
}

.side-list .rank-num {
  display: none;
}

.side-list .rank-info p,
.side-list .rank-meta {
  display: none;
}

.detail-related {
  padding-left: 0;
  padding-right: 0;
}

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

.site-footer {
  margin-top: 46px;
  border-top: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.78);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr) minmax(0, 1fr);
  gap: 24px;
}

.footer-inner p {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

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

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

.is-filtered-out {
  display: none !important;
}

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

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

  .detail-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .sticky-panel {
    position: static;
  }

  .hero-content {
    left: 24px;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .header-inner {
    padding: 0 18px;
  }

  .hero {
    height: 640px;
  }

  .hero-content {
    top: auto;
    bottom: 108px;
    transform: none;
  }

  .hero-shade {
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.72) 48%, rgba(15, 23, 42, 0.20) 100%);
  }

  .hero-controls {
    right: 24px;
    bottom: 28px;
    left: 24px;
    justify-content: space-between;
  }

  .quick-search {
    grid-template-columns: 1fr;
    margin-top: -32px;
  }

  .home-search {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .category-grid,
  .detail-sidebar,
  .footer-inner,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .quick-search,
  .section-block,
  .ranking-preview,
  .page-main,
  .detail-main {
    padding-left: 16px;
    padding-right: 16px;
  }

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

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

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

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

  .movie-card.is-compact {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
  }

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

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

  .rank-num {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
  }

  .page-hero {
    padding: 28px;
  }
}
