:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-deep: #020617;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --gold: #facc15;
  --gold-deep: #eab308;
  --purple: #7e22ce;
  --pink: #db2777;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(126, 34, 206, 0.28), transparent 36rem),
    radial-gradient(circle at top right, rgba(219, 39, 119, 0.18), transparent 32rem),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(88, 28, 135, 0.92), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.nav-wrap,
.footer-grid,
.section-block,
.page-main,
.detail-main,
.quick-search-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #fff7ad);
  color: #111827;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.35);
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: rotate(12deg) scale(1.05);
}

.brand-text strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
  background: linear-gradient(90deg, #fde047, #fef9c3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

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

.desktop-nav a,
.mobile-panel a,
.footer-grid nav a,
.quick-links a {
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-grid nav a:hover,
.quick-links a:hover {
  color: var(--gold);
}

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

.header-search input,
.big-search input,
.filter-panel input {
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.header-search input {
  width: 190px;
  padding: 9px 14px;
}

.header-search input:focus,
.big-search input:focus,
.filter-panel input:focus {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.12);
}

.header-search button,
.big-search button,
.filter-buttons button,
.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.header-search button,
.big-search button,
.primary-button {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #111827;
  font-weight: 800;
}

.header-search button:hover,
.big-search button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #fde047, #facc15);
}

.menu-button {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-panel.is-open {
  display: grid;
  gap: 12px;
  animation: slideIn 0.25s ease;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s 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-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.65) 44%, rgba(2, 6, 23, 0.18) 100%),
    linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.2) 36%, rgba(15, 23, 42, 0.2) 100%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2));
  top: 50%;
  width: min(670px, calc(100% - 48px));
  transform: translateY(-50%);
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-content h1 {
  margin: 0;
  line-height: 1.08;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
}

.hero-content p,
.page-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.hero-tags,
.detail-tags,
.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.detail-tags span,
.movie-tags span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.15);
  color: #fde68a;
  font-size: 12px;
}

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

.ghost-button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

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

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

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

.quick-search-section {
  margin-top: -48px;
  position: relative;
  z-index: 5;
}

.quick-search-card,
.filter-panel,
.page-hero,
.player-wrap,
.detail-layout,
.site-footer,
.category-tile,
.movie-card,
.rank-list {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.quick-search-card {
  padding: clamp(24px, 4vw, 40px);
}

.quick-search-card h2,
.section-title h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
}

.quick-search-card p {
  color: var(--muted);
}

.big-search {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.big-search input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.quick-links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.section-block {
  padding: 56px 0 0;
}

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

.section-title span {
  display: block;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.section-title a {
  color: var(--gold);
  font-weight: 700;
}

.horizontal-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 20px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scrollbar-width: none;
}

.horizontal-row::-webkit-scrollbar {
  display: none;
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(255, 255, 255, 0.1);
}

.poster-link {
  display: block;
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.4), rgba(219, 39, 119, 0.28));
}

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

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

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

.poster-year,
.rank-index {
  position: absolute;
  top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.poster-year {
  left: 10px;
  background: rgba(0, 0, 0, 0.58);
}

.rank-index {
  right: 10px;
  background: var(--gold);
  color: #111827;
}

.movie-info {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.movie-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  font-size: 16px;
}

.movie-meta,
.movie-line {
  color: var(--soft);
  font-size: 13px;
}

.movie-line {
  min-height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-tags span {
  font-size: 11px;
  padding: 4px 8px;
}

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

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

.category-tile {
  position: relative;
  min-height: 154px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(147, 51, 234, 0.78), rgba(219, 39, 119, 0.62)),
    rgba(255, 255, 255, 0.08);
  transition: transform 0.24s ease, filter 0.24s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  filter: brightness(1.08);
}

.category-tile span {
  display: block;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
}

.category-tile em {
  color: rgba(255, 255, 255, 0.82);
  font-style: normal;
  font-size: 14px;
}

.page-main,
.detail-main {
  padding: 34px 0 70px;
}

.page-hero {
  padding: clamp(28px, 6vw, 56px);
  margin-bottom: 28px;
  background:
    linear-gradient(135deg, rgba(88, 28, 135, 0.42), rgba(2, 6, 23, 0.72)),
    rgba(255, 255, 255, 0.07);
}

.small-hero h1,
.rank-hero h1 {
  font-size: clamp(36px, 6vw, 58px);
}

.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  margin-bottom: 26px;
}

.filter-panel input {
  flex: 1;
  min-width: 180px;
  padding: 12px 16px;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-buttons button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.filter-buttons button.is-active,
.filter-buttons button:hover {
  background: var(--gold);
  color: #111827;
}

.empty-result {
  display: none;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.empty-result.is-visible {
  display: block;
}

.rank-hero {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 420px);
  gap: 30px;
  align-items: start;
}

.rank-list {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.rank-row b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #111827;
}

.rank-row em {
  color: var(--soft);
  font-style: normal;
  font-size: 13px;
}

.breadcrumb {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--soft);
  margin: 0 0 20px;
}

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

.player-section {
  margin-bottom: 28px;
}

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

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle, rgba(250, 204, 21, 0.14), rgba(0, 0, 0, 0.25) 26%, rgba(0, 0, 0, 0.62) 100%);
  color: var(--text);
  cursor: pointer;
}

.play-overlay span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #fef08a);
  color: #111827;
  font-size: 32px;
  box-shadow: 0 0 44px rgba(250, 204, 21, 0.45);
  padding-left: 5px;
}

.play-overlay.is-hidden {
  display: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  padding: 24px;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.detail-content h1 {
  font-size: clamp(34px, 5vw, 58px);
  margin-bottom: 12px;
}

.detail-line {
  color: var(--muted);
  font-size: 18px;
}

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

.detail-meta div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.detail-meta dt {
  color: var(--soft);
  font-size: 12px;
}

.detail-meta dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.detail-content h2 {
  margin: 28px 0 10px;
  font-size: 24px;
}

.detail-content p {
  color: var(--muted);
}

.detail-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.detail-switch a {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

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

.related-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(250, 204, 21, 0.55);
}

.related-card img {
  width: 92px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
}

.related-card strong {
  display: block;
  margin-top: 8px;
}

.related-card em {
  display: block;
  color: var(--soft);
  font-style: normal;
  font-size: 13px;
  margin-top: 6px;
}

.site-footer {
  margin-top: 70px;
  padding: 34px 0 24px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: rgba(2, 6, 23, 0.82);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.footer-grid p,
.copyright {
  color: var(--soft);
}

.footer-grid nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.back-top.is-visible {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

  .menu-button {
    display: block;
  }

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

  .hero-content {
    top: auto;
    bottom: 86px;
    transform: none;
  }

  .big-search,
  .filter-panel,
  .footer-grid,
  .detail-switch {
    flex-direction: column;
    align-items: stretch;
  }

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

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

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

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

  .rank-row em {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .nav-wrap,
  .footer-grid,
  .section-block,
  .page-main,
  .detail-main,
  .quick-search-section,
  .mobile-panel,
  .copyright {
    width: min(100% - 22px, 1180px);
  }

  .brand-text small {
    display: none;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-content h1 {
    font-size: 34px;
  }

  .hero-content p,
  .detail-line {
    font-size: 16px;
  }

  .movie-grid {
    gap: 12px;
  }

  .movie-info {
    padding: 11px;
  }

  .movie-line,
  .movie-tags {
    display: none;
  }

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

  .detail-layout {
    padding: 14px;
  }

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