:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: rgba(15, 23, 42, 0.78);
  --panel-strong: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #ffffff;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(245, 158, 11, 0.10), transparent 32rem),
    radial-gradient(circle at 85% 10%, rgba(59, 130, 246, 0.10), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

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

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  max-width: 1240px;
  height: 74px;
  margin: 0 auto;
  padding: 0 22px;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #111827;
  box-shadow: 0 10px 35px rgba(245, 158, 11, 0.30);
}

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

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

.main-nav a,
.mobile-links a {
  color: var(--muted-strong);
  padding: 10px 14px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.mobile-links a:hover,
.mobile-links a.active {
  color: var(--text);
  background: rgba(245, 158, 11, 0.16);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
}

.top-search input,
.filter-input,
.filter-year,
.filter-category {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.92);
}

.top-search input {
  border: 0;
  padding: 8px 12px;
  background: transparent;
}

.top-search button,
.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.top-search button,
.primary-btn {
  color: #111827;
  background: linear-gradient(135deg, var(--accent), #f97316);
  box-shadow: 0 14px 40px rgba(245, 158, 11, 0.22);
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

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

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 16px 22px 22px;
  background: rgba(2, 6, 23, 0.96);
}

.mobile-brand {
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 900;
}

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

.hero-slider {
  position: relative;
  height: min(780px, calc(100vh - 74px));
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 42px;
  padding: 72px max(22px, calc((100vw - 1240px) / 2)) 92px;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity .7s ease, transform 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.hero-content {
  max-width: 740px;
}

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

.hero-content h1,
.hero-content h2 {
  margin: 0 0 24px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .95;
  letter-spacing: -0.07em;
}

.hero-content p {
  max-width: 660px;
  margin: 0 0 24px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.9;
}

.hero-chips,
.tag-row,
.detail-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-chips span,
.tag-row span,
.detail-meta-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.10);
  font-size: 13px;
  font-weight: 700;
}

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

.hero-poster {
  position: relative;
  justify-self: end;
  max-width: 380px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.hero-poster::after,
.poster::after,
.detail-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(2, 6, 23, .74));
  pointer-events: none;
}

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

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

.hero-dot {
  width: 36px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--accent);
}

.section-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 22px 0;
}

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

.section-heading h2,
.page-hero h1,
.detail-intro h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

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

.section-heading.compact {
  margin-bottom: 18px;
}

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

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

.category-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .25);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.category-card:hover,
.movie-card:hover,
.ranking-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.38);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.category-cover {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: .42;
  transform: scale(1.02);
}

.category-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.06), rgba(2, 6, 23, 0.92));
}

.category-info span {
  width: max-content;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #111827;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.category-info h3,
.movie-card h3,
.ranking-body h2,
.text-panel h2,
.side-card h2 {
  margin: 0;
}

.category-info p,
.movie-card p,
.ranking-body p,
.page-hero p,
.text-panel p,
.site-footer p,
.detail-one-line {
  color: var(--muted-strong);
  line-height: 1.8;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

.poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform .35s ease;
}

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

.poster-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  color: #111827;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

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

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

.card-meta a {
  color: var(--accent);
  font-weight: 800;
}

.movie-card h3 {
  display: -webkit-box;
  min-height: 48px;
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.38;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card p {
  display: -webkit-box;
  min-height: 46px;
  overflow: hidden;
  margin: 0 0 12px;
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row span {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.rank-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 22px;
}

.rank-panel,
.spotlight-panel,
.text-panel,
.side-card,
.filter-bar,
.ranking-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
}

.rank-panel,
.spotlight-panel {
  padding: 24px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 48px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.rank-row:hover {
  background: rgba(245, 158, 11, 0.12);
}

.rank-no {
  color: var(--accent);
  font-weight: 900;
}

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

.rank-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.spotlight-panel {
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 100%;
  background:
    linear-gradient(160deg, rgba(245, 158, 11, 0.18), rgba(15, 23, 42, 0.82)),
    var(--panel);
}

.spotlight-panel h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.page-main {
  padding-top: 36px;
}

.page-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 68px 22px 26px;
}

.page-hero.small-hero,
.page-hero.category-hero {
  padding-top: 82px;
}

.page-hero p {
  max-width: 740px;
  margin: 18px 0 0;
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: #fde68a;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px;
}

.filter-bar.wide {
  grid-template-columns: minmax(0, 1fr) 210px 180px;
}

.filter-input,
.filter-year,
.filter-category {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
}

.empty-state {
  display: none;
  margin: 28px 0 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted-strong);
  text-align: center;
  background: rgba(15, 23, 42, 0.72);
}

.filter-grid.is-empty + .empty-state {
  display: block;
}

.ranking-wrap {
  display: grid;
  gap: 18px;
}

.ranking-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  padding: 14px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.ranking-poster {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

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

.ranking-poster span {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #111827;
  background: var(--accent);
  font-weight: 900;
}

.ranking-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.ranking-body h2 {
  font-size: 24px;
}

.ranking-body p {
  margin: 0;
}

.detail-main {
  background: var(--bg);
}

.detail-hero {
  min-height: 620px;
  padding: 82px 22px 62px;
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--line);
}

.detail-hero-inner {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 42px;
  align-items: end;
  max-width: 1240px;
  min-height: 500px;
  margin: 0 auto;
}

.detail-poster {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

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

.detail-intro h1 {
  margin-top: 16px;
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 76px);
}

.detail-one-line {
  max-width: 820px;
  margin: 0 0 22px;
  font-size: 19px;
}

.detail-meta-grid {
  margin-bottom: 16px;
}

.tag-row.large span {
  min-height: 32px;
  padding: 0 12px;
}

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

.detail-content,
.detail-sidebar {
  min-width: 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: var(--radius-xl);
  background: #000;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.78));
  cursor: pointer;
  transition: opacity .2s ease, visibility .2s ease;
}

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

.play-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  padding-left: 6px;
  border-radius: 50%;
  color: #111827;
  background: linear-gradient(135deg, var(--accent), #f97316);
  font-size: 36px;
  font-weight: 900;
  box-shadow: 0 20px 60px rgba(245, 158, 11, 0.34);
}

.play-title {
  max-width: 80%;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

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

.text-panel h2,
.side-card h2 {
  margin-bottom: 14px;
  font-size: 24px;
}

.text-panel p {
  margin: 0;
  font-size: 17px;
}

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

.detail-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-card {
  padding: 20px;
}

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

.mini-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-card:hover {
  background: rgba(245, 158, 11, 0.12);
}

.mini-card img {
  width: 58px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
}

.mini-card span {
  overflow: hidden;
  font-weight: 800;
  line-height: 1.45;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
}

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

.info-list dd {
  margin: 0;
  color: var(--text);
}

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

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 22px;
}

.footer-brand {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 22px;
}

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

.footer-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.05);
}

.footer-links a:hover {
  color: var(--text);
  background: rgba(245, 158, 11, 0.16);
}

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

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

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

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

  .hero-slider {
    height: auto;
    min-height: 760px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    align-items: end;
    padding-top: 54px;
  }

  .hero-poster {
    justify-self: start;
    max-width: 250px;
    order: -1;
  }

  .rank-section,
  .detail-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .detail-hero-inner {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

@media (max-width: 760px) {
  .header-inner {
    height: 66px;
    padding: 0 16px;
  }

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

  .hero-slider {
    min-height: 700px;
  }

  .hero-slide {
    padding: 40px 18px 78px;
  }

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

  .hero-content p,
  .detail-one-line,
  .page-hero p {
    font-size: 16px;
  }

  .section-wrap {
    padding: 52px 16px 0;
  }

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

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

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

  .rank-row {
    grid-template-columns: 40px 48px minmax(0, 1fr);
  }

  .rank-meta {
    display: none;
  }

  .filter-bar,
  .filter-bar.wide {
    grid-template-columns: 1fr;
  }

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

  .ranking-body h2 {
    font-size: 20px;
  }

  .ranking-body p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .detail-hero {
    min-height: auto;
    padding: 52px 16px;
  }

  .detail-hero-inner {
    display: block;
    min-height: 0;
  }

  .detail-poster {
    max-width: 210px;
    margin-bottom: 26px;
  }

  .detail-intro h1 {
    font-size: 40px;
  }

  .text-panel,
  .side-card {
    padding: 20px;
  }

  .play-circle {
    width: 68px;
    height: 68px;
    font-size: 28px;
  }

  .play-title {
    font-size: 18px;
  }

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

@media (max-width: 440px) {
  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .mobile-links {
    grid-template-columns: 1fr;
  }

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