:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-2: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(245, 158, 11, 0.35);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #f59e0b;
  --accent-2: #d97706;
  --blue: #38bdf8;
  --radius: 20px;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.12), transparent 32rem), var(--bg);
  color: var(--text);
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

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

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #facc15);
  color: white;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.45);
  font-size: 14px;
}

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

.nav-link {
  color: #cbd5e1;
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: white;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.75);
  color: white;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: white;
}

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

.mobile-nav a {
  display: block;
  padding: 11px 0;
  color: #cbd5e1;
}

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

.hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: linear-gradient(135deg, #020617 0%, #0f172a 48%, #111827 100%);
}

.hero-glow {
  position: absolute;
  z-index: 1;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
}

.hero-glow-one {
  top: 70px;
  left: 14%;
  background: var(--accent);
  animation: floatGlow 7s ease-in-out infinite;
}

.hero-glow-two {
  right: 7%;
  bottom: 35px;
  background: var(--blue);
  animation: floatGlow 8s ease-in-out infinite reverse;
}

@keyframes floatGlow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, -18px, 0) scale(1.08); }
}

.hero-slide {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.18;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.9));
}

.hero-content {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 360px;
  gap: 54px;
  align-items: center;
  min-height: 560px;
  padding: 72px 0;
}

.hero-copy h1 {
  max-width: 840px;
  margin: 12px 0 16px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.hero-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 3vw, 40px);
  color: var(--accent);
}

.hero-copy p {
  max-width: 680px;
  margin: 0 0 26px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.8;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 35px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.62);
  color: white;
}

.hero-search,
.search-panel {
  display: flex;
  gap: 10px;
  width: min(100%, 680px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.hero-search input,
.search-panel input,
.search-panel select {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  border-radius: 999px;
  background: transparent;
  color: white;
  padding: 0 18px;
}

.search-panel select {
  flex: 0 0 160px;
  background: #111827;
  color: #e2e8f0;
}

.hero-search button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 0 22px;
  font-weight: 800;
  cursor: pointer;
}

.hero-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 28px;
  background: #111827;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  transition: transform 0.3s ease;
}

.hero-poster:hover {
  transform: rotate(0deg) translateY(-5px);
}

.hero-poster img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(12px);
  font-weight: 800;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
}

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

.section {
  padding: 64px 0;
}

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

.section-head h2,
.page-hero h1,
.detail-copy h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

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

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

.category-tile,
.category-overview-card a,
.text-panel,
.aside-panel,
.ranking-panel,
.player-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.88));
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.18);
}

.category-tile {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover,
.category-overview-card a:hover,
.movie-card:hover,
.rank-row:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.category-tile span {
  color: white;
  font-size: 22px;
  font-weight: 900;
}

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

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

.featured-grid .movie-card-large:nth-child(-n+3) {
  grid-column: span 2;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 14px 38px rgba(0,0,0,0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.movie-card figure {
  position: relative;
  height: 248px;
  margin: 0;
  overflow: hidden;
  background: #0f172a;
}

.movie-card-large figure {
  height: 360px;
}

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

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

.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(2,6,23,0.82));
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 25px rgba(245,158,11,0.34);
}

.card-body {
  padding: 16px;
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.13);
  color: #fbbf24;
  font-size: 12px;
  padding: 0 9px;
}

.movie-card h3 {
  display: -webkit-box;
  min-height: 48px;
  margin: 12px 0 8px;
  overflow: hidden;
  color: white;
  font-size: 18px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meta-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted-2);
  font-size: 13px;
}

.split-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 32px;
  align-items: start;
}

.ranking-panel,
.aside-panel {
  padding: 22px;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-row {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row a {
  display: grid;
  grid-template-columns: 36px 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 10px 12px;
}

.rank-row strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
}

.rank-row img {
  width: 74px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}

.rank-info {
  min-width: 0;
}

.rank-info b,
.rank-info em {
  display: block;
}

.rank-info b {
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info em {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 12px;
  font-style: normal;
}

.heat {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.ranking-full .rank-row a {
  grid-template-columns: 46px 92px minmax(0, 1fr) 92px;
}

.ranking-full .rank-row img {
  width: 92px;
  height: 92px;
}

.page-main {
  min-height: 60vh;
}

.page-hero {
  position: relative;
  padding: 88px 0 70px;
  background: radial-gradient(circle at 20% 20%, rgba(245,158,11,0.16), transparent 25rem), linear-gradient(135deg, #020617, #0f172a 55%, #111827);
  border-bottom: 1px solid var(--line);
}

.slim-hero {
  padding: 76px 0 58px;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  color: #cbd5e1;
  font-size: 14px;
}

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

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

.category-overview-card a {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  overflow: hidden;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

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

.category-overview-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-overview-body span {
  color: var(--accent);
  font-weight: 900;
}

.category-overview-body h2 {
  margin: 10px 0;
  font-size: 24px;
}

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

.category-overview-body b {
  color: white;
}

.search-panel {
  max-width: 880px;
  border-radius: 22px;
  padding: 10px;
}

.search-panel input,
.search-panel select {
  min-height: 46px;
  border: 1px solid rgba(148,163,184,0.14);
}

.empty-state {
  display: none;
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15,23,42,0.78);
  color: var(--muted);
  text-align: center;
}

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

.movie-card.is-hidden {
  display: none;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  padding: 58px 0 62px;
  border-bottom: 1px solid var(--line);
  background: #020617;
}

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

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(8px) saturate(1.1);
  transform: scale(1.05);
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2,6,23,0.98), rgba(2,6,23,0.72));
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
}

.detail-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

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

.detail-cover img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.detail-copy h1 {
  max-width: 900px;
  margin-bottom: 18px;
}

.detail-one-line {
  max-width: 860px;
  color: #cbd5e1;
  font-size: 19px;
  line-height: 1.85;
}

.detail-meta {
  margin: 18px 0;
}

.detail-meta span {
  padding: 7px 12px;
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 999px;
  background: rgba(15,23,42,0.68);
  color: #cbd5e1;
}

.detail-copy .btn {
  margin-top: 24px;
}

.detail-primary {
  min-width: 0;
}

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

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  background: linear-gradient(180deg, rgba(2,6,23,0.22), rgba(2,6,23,0.72));
  color: white;
  cursor: pointer;
}

.player-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-circle {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 18px 45px rgba(245,158,11,0.35);
  font-size: 28px;
}

.text-panel {
  margin-top: 22px;
  padding: 26px;
}

.text-panel h2,
.aside-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.text-panel p {
  margin: 0;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.95;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: #020617;
  padding: 52px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.site-footer p {
  max-width: 470px;
  color: var(--muted);
  line-height: 1.8;
}

.site-footer h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

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

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

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

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 35px rgba(0,0,0,0.28);
  cursor: pointer;
}

.back-top.is-visible {
  display: block;
}

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

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

  .hero-content,
  .split-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    display: none;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero,
  .hero-content {
    min-height: 620px;
  }

  .hero-content {
    display: flex;
    align-items: center;
  }

  .hero-search,
  .search-panel {
    flex-direction: column;
    border-radius: 24px;
  }

  .hero-search input,
  .search-panel input,
  .search-panel select,
  .hero-search button {
    width: 100%;
    min-height: 46px;
  }

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

  .featured-grid .movie-card-large:nth-child(-n+3) {
    grid-column: span 1;
  }

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

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

  .detail-cover {
    max-width: 280px;
  }

  .rank-row a,
  .ranking-full .rank-row a {
    grid-template-columns: 36px 64px minmax(0, 1fr);
  }

  .rank-row img,
  .ranking-full .rank-row img {
    width: 64px;
    height: 64px;
  }

  .heat {
    display: none;
  }
}

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

  .brand {
    font-size: 18px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .section {
    padding: 46px 0;
  }

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

  .movie-card figure {
    height: 280px;
  }

  .page-hero {
    padding: 56px 0 44px;
  }

  .detail-cover img {
    height: 390px;
  }
}
