:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --orange: #f97316;
  --shadow: rgba(245, 158, 11, 0.22);
  --radius: 20px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.15), transparent 34rem),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 30rem),
    var(--bg);
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  color: var(--text);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled,
.site-header.menu-open {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
  border-color: var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.header-inner {
  width: min(100% - 32px, var(--max));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  box-shadow: 0 0 35px var(--shadow);
  font-size: 14px;
}

.brand-text {
  font-size: 20px;
  background: linear-gradient(90deg, #fbbf24, var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link,
.mobile-link {
  color: #d1d5db;
  font-size: 15px;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

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

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

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

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

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

.mobile-link.active {
  background: rgba(245, 158, 11, 0.12);
}

.hero {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.05);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.52), rgba(2, 6, 23, 0.85)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.25) 55%, rgba(2, 6, 23, 0.7) 100%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - var(--max)) / 2));
  bottom: 12%;
  width: min(720px, calc(100% - 48px));
}

.hero-tags,
.tag-list,
.detail-meta,
.card-meta,
.filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.tag-list span,
.type-badge,
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.hero-content h1 {
  margin: 18px 0 18px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.05em;
  max-width: 900px;
}

.hero-content p {
  margin: 0 0 28px;
  max-width: 690px;
  color: #d1d5db;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

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

.primary-btn,
.ghost-btn,
.hero-search button,
.page-search button,
.ranking-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 13px 22px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.hero-search button,
.page-search button,
.ranking-play {
  background: linear-gradient(135deg, var(--accent), var(--orange));
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.24);
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(14px);
}

.primary-btn:hover,
.ghost-btn:hover,
.hero-search button:hover,
.page-search button:hover,
.ranking-play:hover {
  transform: translateY(-2px);
}

.hero-control {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

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

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

.section-wrap {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 56px 0;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(17, 24, 39, 0.74));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.quick-search {
  margin-top: -54px;
  position: relative;
  z-index: 8;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  align-items: center;
  gap: 24px;
}

.quick-search h2,
.section-heading h2,
.detail-content h1,
.page-hero h1 {
  margin: 0;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.quick-search p,
.page-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-search,
.page-search {
  display: flex;
  gap: 12px;
}

.hero-search input,
.page-search input,
.local-search {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
}

.hero-search input:focus,
.page-search input:focus,
.local-search:focus {
  border-color: rgba(245, 158, 11, 0.72);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

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

.section-heading span,
.page-hero span {
  display: block;
  margin-bottom: 8px;
  color: #fbbf24;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.section-heading a {
  flex: 0 0 auto;
  color: #fbbf24;
  font-weight: 800;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 24px 50px rgba(245, 158, 11, 0.15);
}

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

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent 54%);
}

.play-hover {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.86);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(245, 158, 11, 0.92);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(10px);
}

.rank-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.card-body {
  padding: 16px;
}

.card-title {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.movie-card:hover .card-title {
  color: #fbbf24;
}

.card-meta {
  margin: 9px 0;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: rgba(148, 163, 184, 0.6);
}

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

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

.category-tile {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.64));
  transition: transform 0.25s ease, border-color 0.25s ease;
}

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

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

.category-covers img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
}

.category-name {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.category-desc {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.two-column {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
}

.ranking-panel,
.update-panel {
  padding: 24px;
}

.inner-heading {
  margin-bottom: 18px;
}

.inner-heading h2 {
  font-size: 30px;
}

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

.mini-card {
  display: grid;
  grid-template-columns: auto 76px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  transition: background 0.2s ease, transform 0.2s ease;
}

.mini-card:hover {
  background: rgba(30, 41, 59, 0.98);
  transform: translateX(4px);
}

.mini-card img {
  width: 76px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
}

.mini-card strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
}

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

.mini-rank {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.horizontal-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 190px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-color: var(--accent) #1e293b;
}

.compact-card .card-body {
  padding: 13px;
}

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

.page-hero {
  width: min(100% - 32px, var(--max));
  margin: 0 auto 8px;
  min-height: 300px;
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  align-items: center;
  gap: 28px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 24rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.94));
}

.compact-hero {
  grid-template-columns: 1fr;
}

.page-hero h1 {
  font-size: clamp(36px, 5vw, 62px);
}

.page-hero p {
  max-width: 760px;
  font-size: 17px;
}

.filter-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
  display: grid;
  gap: 16px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.82);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
  color: #fff;
  border-color: rgba(245, 158, 11, 0.56);
  background: rgba(245, 158, 11, 0.18);
}

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

.ranking-list-wrap {
  padding-top: 36px;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 48px 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.84);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ranking-row:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.45);
}

.ranking-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  font-weight: 900;
}

.ranking-row img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  background: #111827;
}

.ranking-info strong,
.ranking-info small,
.ranking-info em {
  display: block;
}

.ranking-info strong {
  color: #fff;
  margin-bottom: 5px;
  font-size: 18px;
}

.ranking-info small {
  color: var(--muted);
  margin-bottom: 6px;
}

.ranking-info em {
  color: #cbd5e1;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb {
  width: min(100% - 32px, var(--max));
  margin: 0 auto 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.player-section {
  width: min(100% - 32px, var(--max));
  margin: 0 auto 34px;
}

.player-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #000;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.38);
  aspect-ratio: 16 / 9;
}

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.2));
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.04em;
}

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

.play-circle {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  box-shadow: 0 0 48px rgba(245, 158, 11, 0.38);
  font-size: 30px;
}

.detail-layout {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.detail-content,
.detail-side,
.story-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.84);
}

.detail-content {
  padding: 28px;
}

.detail-content h1 {
  font-size: clamp(32px, 5vw, 54px);
  margin-bottom: 18px;
}

.detail-meta {
  color: var(--muted);
  margin-bottom: 18px;
}

.detail-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.84);
}

.tag-list {
  margin-bottom: 24px;
}

.story-card {
  padding: 24px;
  margin-top: 20px;
}

.story-card h2,
.detail-side h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 24px;
}

.story-card p {
  margin: 0 0 14px;
  color: #d1d5db;
  line-height: 1.9;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.gradient-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.88));
}

.detail-side {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.related-wrap {
  padding-top: 38px;
}

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

.footer-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 16px 24px;
  color: var(--muted);
  font-weight: 700;
}

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

.footer-bottom {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: #64748b;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

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

  .two-column,
  .detail-layout,
  .page-hero,
  .quick-search {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }
}

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

  .mobile-toggle {
    display: inline-flex;
  }

  .hero {
    min-height: 82vh;
  }

  .hero-content {
    left: 20px;
    bottom: 16%;
    width: calc(100% - 40px);
  }

  .hero-control {
    display: none;
  }

  .section-wrap {
    padding: 36px 0;
  }

  .quick-search,
  .page-hero,
  .ranking-panel,
  .update-panel,
  .detail-content {
    padding: 22px;
    border-radius: 22px;
  }

  .hero-search,
  .page-search {
    flex-direction: column;
  }

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

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

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 15px;
  }

  .card-body p {
    -webkit-line-clamp: 2;
  }

  .ranking-row {
    grid-template-columns: 38px 74px minmax(0, 1fr);
  }

  .ranking-play {
    grid-column: 2 / -1;
    justify-self: start;
    padding: 9px 14px;
  }

  .ranking-row img {
    width: 74px;
    height: 54px;
  }

  .mini-card {
    grid-template-columns: auto 66px 1fr;
  }

  .mini-card img {
    width: 66px;
    height: 48px;
  }

  .footer-inner {
    flex-direction: column;
  }

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

@media (max-width: 460px) {
  .movie-grid,
  .featured-grid,
  .library-grid,
  .category-grid,
  .large-category-grid {
    grid-template-columns: 1fr;
  }

  .horizontal-row {
    grid-auto-columns: 76%;
  }

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