:root {
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --panel-light: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --line: rgba(148, 163, 184, 0.18);
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --red: #ef4444;
  --blue: #38bdf8;
  --green: #22c55e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 32rem),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber), #fb923c);
  color: white;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.35);
}

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

.brand-text strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  overflow: hidden;
}

.desktop-nav a,
.mobile-nav a {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a.is-active {
  color: var(--amber);
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  transform: translateY(-1px);
}

.header-search {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 13px;
  background: rgba(51, 65, 85, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.header-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.header-search input::placeholder {
  color: #64748b;
}

.header-search button {
  border: 0;
  color: white;
  border-radius: 10px;
  padding: 7px 12px;
  background: var(--amber);
}

.mobile-menu-button {
  display: none;
  border: 0;
  border-radius: 12px;
  color: white;
  background: rgba(51, 65, 85, 0.68);
  padding: 9px 12px;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-carousel {
  position: relative;
  height: clamp(430px, 58vw, 650px);
  overflow: hidden;
  background: #020617;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.16)),
    linear-gradient(0deg, #020617, rgba(2, 6, 23, 0.15) 45%, rgba(2, 6, 23, 0.1));
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1180px) / 2));
  bottom: clamp(64px, 11vw, 118px);
  width: min(620px, calc(100% - 48px));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.movie-detail-text h1 {
  margin: 0;
  font-size: clamp(34px, 5.8vw, 66px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.hero-summary {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--muted-strong);
  font-size: clamp(15px, 2vw, 19px);
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-tags span,
.tag-panel span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--muted-strong);
  padding: 7px 12px;
  font-size: 13px;
}

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

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

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--amber), #fb923c);
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.28);
}

.secondary-button {
  color: white;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.primary-button:hover {
  background: linear-gradient(135deg, var(--amber-dark), var(--amber));
}

.hero-arrow {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  font-size: 32px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.76);
  transform: translateY(-50%) scale(1.06);
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 24px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

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

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

.category-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.62);
}

.category-strip .container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-top: 18px;
  padding-bottom: 18px;
}

.category-strip a {
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.13);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
}

.category-strip a:hover {
  color: white;
  background: rgba(245, 158, 11, 0.92);
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.04em;
}

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

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

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

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

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

.movie-card {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.13);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.38);
  box-shadow: var(--shadow);
}

.movie-card-wide .movie-poster {
  aspect-ratio: 16 / 9;
}

.movie-card-small {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  border-radius: 14px;
}

.movie-card-small .movie-poster {
  height: 100%;
  min-height: 112px;
  aspect-ratio: auto;
}

.movie-card-small .movie-card-body {
  padding: 12px;
}

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

.movie-card-small .movie-card-meta {
  display: none;
}

.movie-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #1e293b);
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease, filter 0.25s ease;
}

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

.movie-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent 52%);
  pointer-events: none;
}

.movie-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: white;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

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

.region-badge {
  left: 10px;
  bottom: 10px;
}

.movie-play-mark {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: rgba(245, 158, 11, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.84);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

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

.movie-card-body h3 {
  margin: 0 0 7px;
  overflow: hidden;
  color: white;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-card:hover h3 {
  color: var(--amber);
}

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

.movie-card-meta {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  color: #64748b;
  font-size: 12px;
}

.movie-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  align-items: start;
}

.ranking-panel,
.text-panel,
.tag-panel,
.poster-panel,
.related-panel {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

.ranking-panel {
  position: sticky;
  top: 94px;
  padding: 20px;
}

.compact-heading {
  margin-bottom: 16px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 42px 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.68);
  padding: 9px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: translateX(3px);
}

.rank-number {
  color: var(--amber);
  font-weight: 900;
  text-align: center;
}

.rank-item img {
  width: 54px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #111827;
}

.rank-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rank-content strong,
.rank-content em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-content strong {
  color: white;
}

.rank-content em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.page-main {
  padding: 42px 0 62px;
}

.page-hero {
  margin-bottom: 32px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.62)),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 32rem);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 58px);
}

.page-hero p:last-child {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted-strong);
  font-size: 17px;
}

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

.category-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.92);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.category-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 142px;
  overflow: hidden;
}

.category-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card-body {
  padding: 22px;
}

.category-card-body h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.category-card-body p:last-child {
  margin: 0;
  color: var(--muted);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.84);
  padding: 14px;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  outline: 0;
  color: white;
  background: rgba(30, 41, 59, 0.82);
  padding: 12px 14px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(245, 158, 11, 0.75);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
  align-items: start;
}

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

.player-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: white;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.68));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.96);
  box-shadow: 0 18px 38px rgba(245, 158, 11, 0.28);
  font-size: 36px;
  padding-left: 6px;
}

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

.movie-detail-text {
  padding-top: 26px;
}

.movie-detail-text h1 {
  font-size: clamp(32px, 4vw, 52px);
}

.detail-one-line {
  margin: 18px 0 24px;
  color: var(--amber);
  font-size: 19px;
  font-weight: 700;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.detail-meta-grid div {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  padding: 16px;
}

.detail-meta-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.detail-meta-grid strong {
  display: block;
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-panel,
.tag-panel {
  margin-bottom: 18px;
  padding: 24px;
}

.text-panel h2,
.tag-panel h2,
.related-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.text-panel p {
  margin: 0;
  color: var(--muted-strong);
  white-space: pre-line;
}

.tag-panel div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-side {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 20px;
}

.poster-panel,
.related-panel {
  padding: 18px;
}

.poster-panel img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  object-fit: cover;
  background: #111827;
}

.full-button {
  width: 100%;
  margin-top: 16px;
}

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

.site-footer {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  background: #020617;
  color: var(--muted);
}

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

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

.site-footer p,
.site-footer ul {
  margin: 0;
  padding: 0;
}

.site-footer ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.site-footer a:hover {
  color: var(--amber);
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 18px 16px;
  text-align: center;
  font-size: 13px;
}

[hidden],
.is-filter-hidden {
  display: none !important;
}

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

  .mobile-menu-button {
    display: inline-flex;
    margin-left: auto;
  }

  .header-search {
    min-width: 220px;
  }

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

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

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

  .two-column-section,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .ranking-panel,
  .detail-side {
    position: static;
  }

  .detail-side {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .nav-shell {
    min-height: 66px;
  }

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

  .brand-text small {
    display: none;
  }

  .header-search {
    display: none;
  }

  .hero-carousel {
    height: 540px;
  }

  .hero-content {
    bottom: 76px;
  }

  .hero-arrow {
    display: none;
  }

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

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

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

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

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

@media (max-width: 450px) {
  .container,
  .nav-shell,
  .mobile-nav,
  .footer-grid {
    width: min(100% - 22px, 1180px);
  }

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

  .hero-content h1,
  .page-hero h1,
  .movie-detail-text h1 {
    font-size: 32px;
  }

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