:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-strong: rgba(15, 23, 42, 0.94);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --line: rgba(148, 163, 184, 0.18);
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --orange: #f97316;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 22px;
}

* {
  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.12), transparent 28rem),
    radial-gradient(circle at 85% 10%, rgba(249, 115, 22, 0.1), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 44%, #020617 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

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

.header-inner {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #fff;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.25);
}

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

.brand-text strong {
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fde68a, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

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

.nav-link,
.dropdown-panel a,
.mobile-menu a {
  color: var(--muted-strong);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 12px;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--amber-light);
  background: rgba(245, 158, 11, 0.12);
}

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 190px;
  padding: 10px;
  display: grid;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-panel a,
.mobile-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
}

.dropdown-panel a:hover,
.mobile-menu a:hover {
  color: var(--amber-light);
  background: rgba(148, 163, 184, 0.1);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-menu input,
.search-page-form input,
.filter-bar input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  outline: none;
  padding: 0 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  width: min(28vw, 360px);
}

.header-search input:focus,
.mobile-menu input:focus,
.search-page-form input:focus,
.filter-bar input:focus {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.header-search button,
.mobile-menu button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  padding: 0 16px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--orange));
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.85);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

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

.mobile-menu form {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.hero-carousel {
  position: relative;
  min-height: clamp(560px, 82vh, 860px);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity 0.7s ease, transform 1s ease;
}

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

.hero-slide > img,
.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 44%, rgba(2, 6, 23, 0.2) 100%),
    linear-gradient(0deg, #020617 0%, transparent 36%);
}

.hero-content {
  position: relative;
  width: min(1460px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
  margin-left: max(16px, calc((100vw - 1460px) / 2));
  padding-top: 48px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 8px;
  color: var(--amber-light);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 14px 0;
  font-size: clamp(2.8rem, 7vw, 6.3rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p,
.detail-one-line {
  max-width: 760px;
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.8;
}

.hero-meta,
.detail-meta,
.card-meta,
.rank-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.hero-meta span,
.detail-meta span {
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.25);
}

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

.button-ghost:hover {
  background: rgba(30, 41, 59, 0.9);
}

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

.hero-dots button {
  width: 34px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.35);
  cursor: pointer;
}

.hero-dots button.is-active {
  background: var(--amber-light);
}

.quick-categories,
.content-section,
.home-categories,
.detail-content,
.overview-list {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
}

.quick-categories {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: -54px;
  position: relative;
  z-index: 6;
}

.quick-categories a,
.category-preview,
.category-overview-block,
.article-card,
.side-card,
.movie-card,
.rank-row,
.filter-bar {
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.quick-categories a {
  min-height: 118px;
  padding: 18px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.quick-categories a:hover,
.movie-card:hover,
.category-preview:hover,
.rank-row:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.48);
}

.quick-categories strong {
  font-size: 1.12rem;
}

.quick-categories span,
.category-preview-head h2,
.category-overview-title p,
.card-body p,
.rank-info p,
.footer-grid p {
  color: var(--muted);
  line-height: 1.65;
}

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

.section-heading,
.category-preview-head,
.category-overview-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2,
.category-overview-title h2,
.article-card h2,
.side-card h2 {
  margin: 8px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.section-link,
.category-preview-head a {
  color: var(--amber-light);
  font-weight: 800;
}

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

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

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

.movie-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(190px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0f172a;
}

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

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.86));
  opacity: 0.9;
}

.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) scale(0.86);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  opacity: 0;
  z-index: 2;
  transition: 0.22s ease;
}

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

.card-rank {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #fff;
  font-weight: 900;
}

.card-body {
  padding: 14px;
}

.card-title {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.4;
}

.card-title:hover,
.rank-info a:hover {
  color: var(--amber-light);
}

.card-body p {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 10px 0 12px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.9rem;
}

.card-meta,
.rank-meta {
  gap: 8px;
  font-size: 0.82rem;
}

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

.card-tags span,
.detail-tags span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(245, 158, 11, 0.12);
}

.card-compact .card-body p,
.card-compact .card-tags {
  display: none;
}

.home-categories {
  display: grid;
  gap: 28px;
  padding: 70px 0 0;
}

.category-preview,
.category-overview-block {
  border-radius: 26px;
  padding: 24px;
}

.category-preview-head h2 {
  max-width: 820px;
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 500;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
}

.small-hero {
  width: min(1460px, calc(100% - 32px));
  min-height: 340px;
  margin: 26px auto 0;
  padding: 60px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.18), transparent 25rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.84));
  box-shadow: var(--shadow);
}

.search-page-form {
  display: flex;
  gap: 12px;
  max-width: 720px;
  margin-top: 26px;
}

.search-page-form input {
  min-height: 52px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 22px;
  border-radius: 18px;
}

.filter-hint {
  min-width: max-content;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 58px 82px 1fr max-content;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 12px;
  border-radius: 18px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 900;
  color: #fff;
  background: rgba(245, 158, 11, 0.2);
}

.rank-thumb {
  width: 82px;
  height: 96px;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
}

.rank-info a {
  font-size: 1.04rem;
  font-weight: 850;
}

.rank-info p {
  display: -webkit-box;
  margin: 8px 0;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.rank-action {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  font-weight: 850;
}

.detail-hero {
  min-height: 560px;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  filter: blur(2px);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.58)),
    linear-gradient(0deg, #020617 0%, transparent 46%);
}

.detail-wrap {
  position: relative;
  z-index: 2;
  width: min(1460px, calc(100% - 32px));
  min-height: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  align-items: center;
  gap: 46px;
  padding: 42px 0;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--amber-light);
}

.detail-info h1 {
  max-width: 960px;
}

.player-section {
  width: min(1220px, calc(100% - 32px));
  margin: -70px auto 0;
  position: relative;
  z-index: 5;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-shell video,
.player-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-shell video {
  background: #000;
}

.player-poster {
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #000;
  z-index: 3;
}

.player-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.42);
}

.player-poster span {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  box-shadow: 0 18px 50px rgba(249, 115, 22, 0.36);
  font-size: 1.7rem;
}

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

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  padding-top: 38px;
}

.article-card,
.side-card {
  border-radius: 24px;
  padding: 28px;
}

.article-card p {
  color: var(--muted-strong);
  font-size: 1rem;
  line-height: 1.9;
}

.side-card dl {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  margin: 22px 0 0;
}

.side-card dt {
  color: var(--muted);
}

.side-card dd {
  margin: 0;
  color: var(--text);
}

.related-section {
  padding-bottom: 40px;
}

.overview-list {
  display: grid;
  gap: 26px;
  padding-top: 46px;
}

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

.footer-grid {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
}

.footer-brand {
  margin-bottom: 18px;
}

.footer-grid h3 {
  margin: 0 0 14px;
}

.footer-grid a:not(.brand) {
  display: block;
  margin: 9px 0;
  color: var(--muted);
}

.footer-grid a:not(.brand):hover {
  color: var(--amber-light);
}

.footer-bottom {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 30px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

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

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

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

@media (max-width: 760px) {
  .header-inner {
    min-height: 68px;
  }

  .brand-text small {
    display: none;
  }

  .hero-carousel {
    min-height: 620px;
  }

  .hero-content {
    width: calc(100% - 32px);
    margin: 0 auto;
    justify-content: end;
    padding-bottom: 96px;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: clamp(2.3rem, 13vw, 4rem);
  }

  .quick-categories,
  .movie-grid,
  .category-grid,
  .compact-grid,
  .footer-grid,
  .detail-wrap {
    grid-template-columns: 1fr;
  }

  .quick-categories {
    margin-top: 22px;
  }

  .movie-row {
    grid-template-columns: repeat(6, minmax(170px, 1fr));
  }

  .small-hero {
    padding: 34px 22px;
    min-height: 300px;
  }

  .section-heading,
  .category-preview-head,
  .category-overview-title,
  .filter-bar,
  .search-page-form {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-hint {
    min-width: 0;
  }

  .rank-row {
    grid-template-columns: 42px 74px 1fr;
  }

  .rank-action {
    grid-column: 2 / -1;
    justify-content: center;
  }

  .detail-wrap {
    min-height: auto;
    padding: 28px 0 110px;
  }

  .detail-poster {
    width: min(320px, 70vw);
  }

  .player-section {
    margin-top: -92px;
  }

  .article-card,
  .side-card,
  .category-preview,
  .category-overview-block {
    padding: 20px;
  }
}
