:root {
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --panel-light: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #f59e0b;
  --accent-strong: #f97316;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -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.16), transparent 32rem),
    radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.10), transparent 26rem),
    var(--bg);
  min-height: 100vh;
}

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.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #111827;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.35);
}

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

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(245, 158, 11, 0.14);
}

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

.header-search input,
.hero-search input,
.search-page-form input,
.local-filter {
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.header-search input {
  width: 210px;
  padding: 8px 8px 8px 14px;
}

.header-search button,
.hero-search button,
.search-page-form button {
  border: 0;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border-radius: 999px;
  padding: 9px 15px;
}

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

.mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  border-radius: 999px;
}

.hero-slider {
  width: min(1500px, calc(100% - 32px));
  margin: 24px auto 0;
}

.hero-stage {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 36px;
  box-shadow: var(--shadow);
  background: var(--panel);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
}

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

.hero-content {
  width: min(780px, calc(100% - 48px));
  padding: 0 0 72px 70px;
}

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

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 16px 0;
  font-size: clamp(40px, 7vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p,
.detail-one-line {
  margin: 0;
  max-width: 760px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.75;
}

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

.hero-tags {
  margin-top: 22px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  padding: 6px 10px;
  font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.section-more,
.rank-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 850;
  transition: 0.25s ease;
}

.primary-btn {
  color: #111827;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  padding: 12px 22px;
  box-shadow: 0 14px 34px rgba(245, 158, 11, 0.35);
}

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

.ghost-btn,
.section-more {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  padding: 11px 18px;
}

.ghost-btn:hover,
.section-more:hover {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.ghost-btn.small {
  min-height: 42px;
  white-space: nowrap;
}

.hero-panel {
  position: absolute;
  right: 26px;
  bottom: 26px;
  width: min(430px, calc(100% - 52px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(18px);
}

.hero-search label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-weight: 800;
}

.hero-search div,
.search-page-form {
  display: flex;
  gap: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
}

.hero-search input,
.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
}

.hero-category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-category-links a,
.mini-links a {
  color: var(--muted-strong);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.38);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  transition: 0.25s ease;
}

.hero-category-links a:hover,
.mini-links a:hover {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
}

.hero-rank-link {
  display: inline-flex;
  margin-top: 18px;
  color: #fde68a;
  font-weight: 800;
}

.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.hero-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  transition: 0.25s ease;
}

.hero-thumb img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--panel-light);
}

.hero-thumb span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 700;
}

.hero-thumb.active,
.hero-thumb:hover {
  color: var(--text);
  border-color: rgba(251, 191, 36, 0.48);
  background: rgba(245, 158, 11, 0.12);
}

.section-wrap {
  width: min(1380px, calc(100% - 32px));
  margin: 76px auto;
}

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

.section-heading h2 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compact-heading {
  align-items: center;
  margin-bottom: 18px;
}

.compact-heading h2 {
  font-size: 28px;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  transition: 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.36);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #334155);
}

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

.movie-card:hover .poster-link img,
.category-tile:hover .category-cover img {
  transform: scale(1.06);
}

.year-badge,
.rank-badge,
.category-count {
  position: absolute;
  z-index: 2;
  color: #111827;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 9px;
}

.year-badge {
  top: 10px;
  left: 10px;
}

.rank-badge {
  top: 10px;
  right: 10px;
}

.card-body {
  padding: 15px;
}

.card-meta {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-body h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.card-body h2 a:hover,
.rank-info h2 a:hover,
.category-tile h2 a:hover {
  color: #fde68a;
}

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

.small-card .card-body p {
  min-height: auto;
  -webkit-line-clamp: 2;
}

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

.category-tile {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.84);
  transition: 0.25s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(251, 191, 36, 0.45);
}

.category-cover {
  position: relative;
  overflow: hidden;
  height: 170px;
  border-radius: 20px;
  background: var(--panel-light);
}

.category-count {
  position: static;
  display: inline-flex;
  margin-bottom: 10px;
}

.category-tile h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.split-section {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 28px;
  align-items: start;
}

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

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

.rank-row {
  display: grid;
  grid-template-columns: 58px 76px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.86);
  padding: 12px;
  transition: 0.25s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  border-color: rgba(251, 191, 36, 0.42);
}

.rank-number {
  font-size: 22px;
  font-weight: 950;
  color: var(--accent);
  text-align: center;
}

.rank-cover {
  width: 76px;
  height: 100px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--panel-light);
}

.rank-info h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.rank-info p,
.rank-info span {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.rank-info span {
  display: block;
  margin-top: 5px;
}

.rank-action {
  min-height: 38px;
  color: #111827;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  padding: 8px 14px;
}

.page-hero {
  width: min(1380px, calc(100% - 32px));
  margin: 24px auto 0;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  padding: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.compact-page-hero {
  min-height: 320px;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.22), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.92));
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted-strong);
}

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

.filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
}

.local-filter {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
}

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

.detail-hero {
  width: min(1380px, calc(100% - 32px));
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 38px;
  align-items: end;
  min-height: 560px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background:
    radial-gradient(circle at 15% 10%, rgba(245, 158, 11, 0.18), transparent 30rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.96));
  box-shadow: var(--shadow);
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 28px;
  background: var(--panel-light);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
}

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

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.detail-meta span {
  color: var(--muted-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  padding: 8px 12px;
}

.detail-tags {
  margin-top: 16px;
}

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

.video-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 30px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--text);
  border: 0;
  cursor: pointer;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.68));
  transition: 0.25s ease;
}

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

.play-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111827;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 18px 46px rgba(245, 158, 11, 0.45);
  font-size: 34px;
  padding-left: 5px;
}

.play-overlay strong {
  font-size: 20px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.detail-text-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.detail-article {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.78);
  padding: 26px;
}

.detail-article h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.detail-article p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.9;
}

.search-page-form {
  max-width: 760px;
  margin-top: 26px;
}

.search-summary {
  margin-bottom: 20px;
  color: var(--muted-strong);
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.92);
  padding: 48px 0;
}

.footer-grid {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr;
  gap: 30px;
}

.footer-brand {
  font-size: 22px;
  margin-bottom: 14px;
}

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

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

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

.footer-links a {
  color: var(--muted-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  transition: 0.25s ease;
}

.footer-links a:hover {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
}

.hidden-by-filter {
  display: none !important;
}

@media (max-width: 1180px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .header-search {
    margin-left: auto;
  }

  .hero-content {
    padding-left: 44px;
  }

  .hero-panel {
    position: relative;
    right: auto;
    bottom: auto;
    margin: auto 24px 24px;
  }

  .hero-slide {
    align-items: flex-start;
    padding-top: 70px;
  }

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

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

  .split-section,
  .detail-text-section {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 280px 1fr;
  }
}

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

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

  .main-nav,
  .header-search {
    display: none;
    width: 100%;
  }

  .main-nav.is-open,
  .header-search.is-open {
    display: flex;
  }

  .main-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link {
    text-align: center;
  }

  .header-search input {
    width: 100%;
  }

  .hero-stage {
    min-height: 760px;
    border-radius: 26px;
  }

  .hero-slide {
    padding-top: 44px;
  }

  .hero-content {
    width: calc(100% - 34px);
    padding: 0 0 0 24px;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .hero-panel {
    width: calc(100% - 32px);
    margin: auto 16px 16px;
    padding: 16px;
  }

  .hero-thumbs {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-heading {
    display: block;
  }

  .section-more {
    margin-top: 16px;
  }

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

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

  .category-tile {
    grid-template-columns: 100px 1fr;
  }

  .category-cover {
    height: 150px;
  }

  .rank-row {
    grid-template-columns: 44px 62px 1fr;
  }

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

  .page-hero {
    min-height: 300px;
    padding: 30px;
    border-radius: 26px;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    padding: 22px;
    border-radius: 26px;
  }

  .detail-poster {
    width: min(280px, 100%);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .movie-grid,
  .latest-grid,
  .category-movie-grid,
  .search-results {
    gap: 12px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h2 {
    font-size: 15px;
  }

  .card-body p,
  .tag-row {
    display: none;
  }

  .hero-search div,
  .search-page-form,
  .filter-bar {
    border-radius: 18px;
    flex-direction: column;
  }

  .hero-search button,
  .search-page-form button {
    width: 100%;
  }

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