:root {
  color-scheme: dark;
  --page: #020617;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: #0f172a;
  --panel-soft: rgba(30, 41, 59, 0.72);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --radius-sm: 14px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 158, 11, 0.14), transparent 30rem),
    radial-gradient(circle at 88% 0%, rgba(59, 130, 246, 0.12), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

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

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

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: white;
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.26);
}

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

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

.nav-link,
.search-toggle,
.menu-toggle,
.mobile-panel a,
.mobile-panel button {
  border: 0;
  color: var(--soft);
  background: transparent;
  border-radius: 12px;
  padding: 10px 14px;
  transition: 0.22s ease;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.is-active,
.search-toggle:hover,
.menu-toggle:hover,
.mobile-panel a:hover,
.mobile-panel button:hover {
  color: #fff;
  background: rgba(30, 41, 59, 0.82);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle {
  display: none;
  font-size: 22px;
}

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

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

.mobile-panel button {
  text-align: left;
}

.hero {
  position: relative;
  min-height: 70vh;
  height: clamp(520px, 70vh, 780px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.78) 38%, rgba(2, 6, 23, 0.25) 78%, rgba(2, 6, 23, 0.74) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.2) 36%, transparent 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.hero-copy {
  max-width: 660px;
  padding-top: 44px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 6vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero p {
  margin: 20px 0 0;
  color: #dbeafe;
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.75;
}

.hero-meta,
.detail-meta,
.card-meta,
.filter-row,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-meta {
  margin: 22px 0 30px;
}

.hero-meta span,
.detail-meta span,
.card-meta span,
.movie-tags span,
.rank-line span,
.breadcrumb a,
.breadcrumb span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--soft);
  border: 1px solid var(--line);
  font-size: 13px;
}

.hero-actions,
.section-head,
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.btn,
.btn-outline,
.player-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 13px 18px;
  border-radius: 15px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition: 0.22s ease;
}

.btn,
.player-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.23);
}

.btn:hover,
.player-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.32);
}

.btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.12);
}

.hero-control {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translateY(-1px);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  transition: 0.22s ease;
}

.hero-dots button.is-active {
  width: 46px;
  background: var(--accent);
}

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

.section {
  padding: 58px 0;
}

.section-title,
.page-hero h1,
.detail-block h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  color: #fff;
  letter-spacing: -0.035em;
}

.section-desc,
.page-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

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

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

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

.movie-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.42);
  overflow: hidden;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.52);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

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

.movie-card.wide {
  display: grid;
  grid-template-columns: 140px 1fr;
}

.movie-card.wide .card-poster {
  aspect-ratio: auto;
  height: 100%;
}

.card-poster img,
.category-tile img,
.compact-card img,
.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

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

.card-poster::after,
.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.88));
}

.play-mark {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(245, 158, 11, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: 0.24s ease;
}

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

.year-badge,
.rank-badge {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.rank-badge {
  left: 10px;
  right: auto;
  background: rgba(245, 158, 11, 0.92);
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.card-body h3 a:hover {
  color: #fbbf24;
}

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

.card-meta {
  gap: 6px;
}

.card-meta span {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 12px;
}

.card-tags {
  margin-top: 10px;
  color: #fcd34d;
  font-size: 12px;
  line-height: 1.6;
}

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

.category-tile {
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
}

.category-tile img {
  position: absolute;
  inset: 0;
}

.category-tile span,
.category-tile small {
  position: relative;
  z-index: 2;
}

.category-tile span {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.category-tile small {
  display: block;
  margin-top: 8px;
  color: #cbd5e1;
  line-height: 1.6;
}

.page-hero {
  padding: 62px 0 28px;
}

.page-hero .panel {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 0%, rgba(245, 158, 11, 0.18), transparent 24rem),
    rgba(15, 23, 42, 0.62);
  box-shadow: var(--shadow);
}

.filter-panel {
  display: grid;
  gap: 14px;
  margin-top: 26px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.52);
}

.filter-panel input,
.search-head input {
  width: 100%;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 14px;
  padding: 13px 15px;
  color: #fff;
  background: rgba(2, 6, 23, 0.56);
}

.filter-row button,
.pagination a,
.search-head button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--soft);
  background: rgba(30, 41, 59, 0.62);
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-row button:hover,
.filter-row button.is-active,
.pagination a:hover,
.pagination a.is-current,
.search-head button:hover {
  color: #fff;
  border-color: rgba(245, 158, 11, 0.58);
  background: rgba(245, 158, 11, 0.16);
}

.rank-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.54);
}

.rank-item {
  display: grid;
  grid-template-columns: 58px 72px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 16px;
  transition: 0.2s ease;
}

.rank-item:hover {
  background: rgba(30, 41, 59, 0.7);
}

.rank-num {
  color: #fbbf24;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
}

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

.rank-info h2,
.rank-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.rank-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.breadcrumb {
  margin-bottom: 20px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.player-card,
.detail-block,
.side-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.12), rgba(2, 6, 23, 0.7));
}

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

.player-error {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 4;
  color: #fecaca;
  text-align: center;
}

.detail-block,
.side-card {
  padding: 24px;
  margin-top: 22px;
}

.detail-title h1 {
  font-size: clamp(30px, 4vw, 50px);
}

.detail-title p,
.detail-block p {
  color: var(--soft);
  line-height: 1.85;
}

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.poster-frame {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #111827;
}

.poster-frame img {
  aspect-ratio: 2 / 3;
}

.compact-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.compact-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.36);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.compact-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.62);
}

.compact-card img {
  width: 74px;
  height: 100px;
  border-radius: 10px;
}

.compact-card strong,
.compact-card em {
  display: block;
}

.compact-card strong {
  color: #fff;
  line-height: 1.4;
}

.compact-card em {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.search-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

.search-layer.is-open {
  display: block;
}

.search-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.search-dialog {
  position: relative;
  width: min(720px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 90px));
  margin: 72px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow);
}

.search-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.search-results {
  max-height: 610px;
  overflow: auto;
  padding: 12px 16px 18px;
}

.search-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  transition: 0.18s ease;
}

.search-item:hover {
  background: rgba(30, 41, 59, 0.62);
}

.search-item img {
  width: 56px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
}

.search-item strong,
.search-item span {
  display: block;
}

.search-item strong {
  color: #fff;
}

.search-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

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

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

.is-hidden-card {
  display: none !important;
}

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

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

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

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

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

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

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

  .hero-content {
    align-items: flex-end;
    padding-bottom: 96px;
  }

  .hero-control {
    display: none;
  }

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

  .movie-card.wide {
    grid-template-columns: 112px 1fr;
  }

  .rank-item {
    grid-template-columns: 42px 60px 1fr;
  }

  .rank-item .btn-outline {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .page-hero .panel,
  .detail-block,
  .side-card {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .container,
  .page-container,
  .detail-shell,
  .footer-inner,
  .hero-content {
    width: min(100% - 24px, 1180px);
  }

  .search-toggle {
    display: none;
  }

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

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

  .card-body {
    padding: 12px;
  }

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

  .movie-card.wide {
    display: block;
  }

  .rank-list {
    padding: 12px;
  }

  .rank-item {
    grid-template-columns: 36px 54px 1fr;
    gap: 10px;
    padding: 8px;
  }

  .rank-item img {
    width: 54px;
    height: 76px;
  }

  .rank-info p,
  .rank-line {
    display: none;
  }
}
