:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111c32;
  --muted: #94a3b8;
  --text: #f8fafc;
  --text-soft: #dbeafe;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --line: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.97), rgba(30, 41, 59, 0.97), rgba(15, 23, 42, 0.97));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-mark,
.footer-brand span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: white;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.13);
  font-size: 14px;
}

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

.brand-text strong {
  font-size: 22px;
  letter-spacing: 0.04em;
}

.brand-text small {
  color: #fde68a;
  font-size: 12px;
  margin-top: 4px;
}

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

.nav-link,
.mobile-link {
  color: #e2e8f0;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: #fbbf24;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.top-search {
  width: min(270px, 24vw);
  position: relative;
}

.top-search input,
.mobile-search input,
.local-filter input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 46px 11px 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.local-filter input:focus {
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.top-search button {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  width: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  border: 0;
  background: rgba(148, 163, 184, 0.12);
  color: white;
  border-radius: 12px;
  padding: 9px 12px;
}

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

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

.mobile-panel nav {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mobile-search {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.mobile-search input {
  padding-right: 18px;
}

.mobile-search button,
.local-filter button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  padding: 0 18px;
  cursor: pointer;
}

.quick-links {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 12px;
}

.quick-links a {
  white-space: nowrap;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
}

.quick-links a:hover {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.48);
}

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: #0f172a;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-shade,
.detail-backdrop::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.66) 48%, rgba(2, 6, 23, 0.20) 100%), linear-gradient(0deg, rgba(2, 6, 23, 0.95), transparent 46%);
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 1180px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: white;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.24);
}

.hero h1,
.hero h2 {
  margin: 20px 0 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero h2 + h2 {
  font-size: clamp(26px, 3.4vw, 46px);
  color: #fde68a;
  margin-top: 12px;
}

.hero p {
  max-width: 720px;
  color: #e2e8f0;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.8;
  margin: 20px 0 0;
}

.hero-tags,
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span,
.filter-tags button,
.detail-meta span,
.card-meta span {
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.10);
  color: #fde68a;
  padding: 6px 11px;
  font-size: 13px;
}

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

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 24px;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 18px 40px rgba(217, 119, 6, 0.30);
}

.ghost-btn {
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.28);
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(14px);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.ghost-btn:hover {
  border-color: rgba(245, 158, 11, 0.55);
  color: #fbbf24;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.58);
  color: white;
  font-size: 36px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

.hero-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.50);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
  width: 34px;
  background: var(--accent);
}

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

.featured-section {
  background: rgba(15, 23, 42, 0.42);
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.section-more {
  color: #fbbf24;
  font-weight: 800;
}

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

.featured-grid .card-large:first-child {
  grid-column: span 2;
}

.movie-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(245, 158, 11, 0.35);
}

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

.card-large .poster {
  aspect-ratio: 16 / 10;
}

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

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

.poster-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.80), transparent 54%);
  opacity: 0.78;
}

.play-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.32);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-chip {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.category-chip,
.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.92);
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.rank-badge {
  left: auto;
  right: 12px;
  background: rgba(2, 6, 23, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  flex: 1;
}

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

.card-body h3 a:hover {
  color: #fbbf24;
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

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

.category-tile,
.category-card a {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  border-radius: var(--radius);
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 42%), linear-gradient(135deg, #172033, #0f172a);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover,
.category-card a:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.42);
}

.category-tile span,
.category-card h2 {
  font-size: 22px;
  font-weight: 900;
  margin: 0;
}

.category-tile small,
.category-card p {
  color: var(--muted);
  line-height: 1.6;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.category-covers img {
  height: 90px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

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

.movie-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 276px;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 2px 16px;
  scrollbar-width: none;
}

.movie-rail::-webkit-scrollbar,
.quick-links::-webkit-scrollbar {
  display: none;
}

.rail-btn {
  position: absolute;
  top: 40%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.rail-btn.left {
  left: -12px;
}

.rail-btn.right {
  right: -12px;
}

.compact-list,
.side-list {
  display: grid;
  gap: 12px;
}

.compact-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px 42px 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.74);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.compact-card:hover {
  transform: translateX(4px);
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(30, 41, 59, 0.92);
}

.compact-card img {
  width: 82px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
}

.compact-rank b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.17);
  color: #fbbf24;
}

.compact-card strong {
  display: block;
  margin-bottom: 4px;
}

.compact-card small {
  color: var(--muted);
}

.page-hero {
  position: relative;
  padding: 74px 0;
  background: radial-gradient(circle at 15% 30%, rgba(245, 158, 11, 0.24), transparent 32%), linear-gradient(135deg, #111827, #020617 68%);
  border-bottom: 1px solid var(--line);
}

.small-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.04em;
}

.small-hero p {
  max-width: 860px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.8;
}

.local-filter {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  max-width: 760px;
}

.local-filter input {
  padding-right: 18px;
}

.filter-tags button {
  cursor: pointer;
}

.filter-tags button.is-active,
.filter-tags button:hover {
  color: white;
  background: var(--accent);
}

.empty-state {
  display: none;
  color: var(--muted);
  text-align: center;
  padding: 48px 0;
}

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

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
}

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px);
  transform: scale(1.04);
}

.detail-layout {
  position: relative;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 42px;
  align-items: center;
  padding: 72px 0;
}

.detail-poster {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #cbd5e1;
  margin-bottom: 20px;
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fbbf24;
}

.detail-info h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.detail-one-line {
  max-width: 760px;
  color: #e2e8f0;
  font-size: 20px;
  line-height: 1.75;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0;
}

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

.watch-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.20);
  padding: 24px;
}

.watch-panel h2,
.side-panel h2,
.text-block h2 {
  margin-top: 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.62));
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.player-overlay span {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  box-shadow: 0 24px 70px rgba(245, 158, 11, 0.36);
  font-size: 32px;
}

.player-shell.is-playing .player-overlay {
  display: none;
}

.text-block {
  margin-top: 26px;
}

.text-block p {
  color: #cbd5e1;
  line-height: 2;
  font-size: 17px;
}

.side-panel {
  position: sticky;
  top: 110px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.84), #020617);
  padding: 48px 0;
  color: #cbd5e1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 34px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 22px;
  margin-bottom: 14px;
}

.footer-grid p {
  line-height: 1.8;
  color: var(--muted);
}

.footer-grid h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.footer-links {
  display: grid;
  gap: 10px;
}

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

.footer-links a:hover {
  color: #fbbf24;
}

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

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .hero {
    height: 560px;
  }

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

  .featured-grid .card-large:first-child {
    grid-column: span 2;
  }

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

  .detail-poster {
    max-width: 320px;
  }

  .side-panel {
    position: static;
  }
}

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

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

  .brand-text small,
  .quick-links {
    display: none;
  }

  .nav-wrap {
    min-height: 64px;
  }

  .hero {
    height: 610px;
  }

  .hero-content {
    justify-content: end;
    padding-bottom: 84px;
  }

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

  .hero h2 + h2 {
    font-size: 25px;
  }

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

  .hero-actions,
  .local-filter {
    flex-direction: column;
  }

  .hero-arrow {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

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

  .featured-grid .card-large:first-child {
    grid-column: span 1;
  }

  .movie-rail {
    grid-auto-columns: 78vw;
  }

  .rail-btn {
    display: none;
  }

  .compact-card {
    grid-template-columns: 72px 34px 1fr;
  }

  .compact-card img {
    width: 72px;
    height: 56px;
  }

  .detail-hero {
    min-height: auto;
  }

  .detail-layout {
    gap: 24px;
    padding: 42px 0;
  }

  .watch-panel,
  .side-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .player-overlay span {
    width: 68px;
    height: 68px;
  }
}
