:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --panel-soft: rgba(30, 41, 59, 0.66);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --sky: #38bdf8;
  --sky-deep: #0284c7;
  --orange: #fb923c;
  --gold: #facc15;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.22), transparent 34rem),
    radial-gradient(circle at 80% 8%, rgba(251, 146, 60, 0.16), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

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

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

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;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 54%, #fb923c 100%);
  box-shadow: 0 16px 40px rgba(14, 165, 233, 0.28);
}

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

.main-nav a,
.mobile-panel a {
  color: var(--muted-strong);
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: white;
  background: rgba(56, 189, 248, 0.13);
}

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

.header-search {
  position: relative;
  width: min(260px, 28vw);
}

.header-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  outline: none;
  color: white;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 999px;
  padding: 12px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  color: white;
  background: rgba(15, 23, 42, 0.72);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 99px;
}

.mobile-panel {
  display: none;
  position: fixed;
  inset: 72px 16px auto 16px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow);
  z-index: 60;
}

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

.mobile-panel a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.58);
}

.hero {
  position: relative;
  min-height: 74vh;
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.hero-track {
  position: relative;
  min-height: 74vh;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.72s ease, transform 0.72s ease;
  transform: scale(1.03);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.78) 36%, rgba(2, 6, 23, 0.35) 72%, rgba(2, 6, 23, 0.78) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.2) 50%, rgba(2, 6, 23, 0.74) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 86px 0 116px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 54px;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  max-width: 760px;
  margin: 22px 0 18px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-desc {
  max-width: 690px;
  margin: 0 0 28px;
  color: var(--muted-strong);
  font-size: clamp(16px, 2vw, 20px);
}

.hero-meta,
.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: #e2e8f0;
}

.meta-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.66);
  font-size: 13px;
  font-weight: 700;
}

.hero-actions,
.section-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.74);
  font-weight: 900;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.92);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 16px 40px rgba(14, 165, 233, 0.27);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.hero-card {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 30px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.56);
  box-shadow: var(--shadow);
}

.hero-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.hero-card-info {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(14px);
}

.hero-card-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: white;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
}

.hero-control:hover {
  background: rgba(14, 165, 233, 0.52);
}

.hero-control.prev {
  left: 22px;
}

.hero-control.next {
  right: 22px;
}

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

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

.hero-dot.is-active {
  width: 34px;
  background: white;
}

.page-hero {
  padding: 74px 0 44px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background:
    radial-gradient(circle at 16% 10%, rgba(14, 165, 233, 0.22), transparent 32rem),
    radial-gradient(circle at 88% 0%, rgba(251, 146, 60, 0.12), transparent 28rem);
}

.page-hero h1,
.detail-title {
  margin: 14px 0 14px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.page-hero p,
.detail-lead {
  max-width: 780px;
  color: var(--muted-strong);
  font-size: 18px;
}

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

.breadcrumb a {
  color: #bae6fd;
}

.section {
  padding: 58px 0;
}

.section.compact {
  padding: 38px 0;
}

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

.section-title {
  margin: 10px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-subtitle {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.68);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(15, 23, 42, 0.95);
}

.poster-wrap {
  display: block;
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
}

.poster-wrap::after {
  content: "▶";
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  background: rgba(14, 165, 233, 0.82);
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.movie-card:hover .poster-wrap::after {
  opacity: 1;
  transform: scale(1);
}

.poster-wrap img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .poster-wrap img {
  transform: scale(1.06);
}

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

.movie-title {
  display: -webkit-box;
  min-height: 52px;
  margin: 0 0 8px;
  overflow: hidden;
  color: white;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-line {
  display: -webkit-box;
  min-height: 48px;
  margin: 10px 0 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rating-badge,
.rank-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, #fde68a, #facc15);
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.rank-badge {
  left: 12px;
  right: auto;
  color: white;
  background: linear-gradient(135deg, #fb923c, #ef4444);
}

.horizontal-row {
  display: flex;
  gap: 20px;
  padding: 6px 0 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.horizontal-row .movie-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

.panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.64), rgba(15, 23, 42, 0.72));
  box-shadow: var(--shadow);
}

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

.category-tile {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.18), transparent 12rem),
    rgba(15, 23, 42, 0.76);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.4);
}

.category-tile h2,
.category-tile h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 160px 150px;
  gap: 14px;
  margin: 26px 0 28px;
  padding: 16px;
}

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

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

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

.rank-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.66);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 146, 60, 0.38);
}

.rank-item img {
  width: 92px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.rank-number {
  color: var(--orange);
  font-size: 22px;
  font-weight: 950;
}

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

.detail-main,
.detail-side {
  padding: 24px;
}

.player-section {
  padding: 22px;
  margin-bottom: 24px;
}

.site-player {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.24), rgba(2, 6, 23, 0.76));
  text-align: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 22px 48px rgba(14, 165, 233, 0.36);
  font-size: 28px;
}

.player-cover strong {
  width: min(520px, calc(100% - 44px));
  font-size: clamp(18px, 3vw, 28px);
  line-height: 1.25;
}

.detail-cover {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.72);
}

.detail-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.detail-block h2,
.detail-block h3 {
  margin: 0 0 12px;
  color: white;
  font-size: 24px;
}

.detail-block p {
  margin: 0;
  color: var(--muted-strong);
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.footer {
  margin-top: 42px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 30px;
  padding: 42px 0;
}

.footer h3,
.footer h4 {
  margin: 0 0 14px;
}

.footer p,
.footer a,
.footer li {
  color: var(--muted);
  font-size: 14px;
}

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

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

.copyright {
  padding: 18px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 50%;
  color: white;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

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

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

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

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

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

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

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

  .hero-content {
    grid-template-columns: 1fr;
    padding: 58px 0 104px;
  }

  .hero-card {
    max-width: 320px;
  }

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

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

  .rank-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 64px;
  }

  .mobile-panel {
    inset: 64px 12px auto 12px;
  }

  .logo {
    font-size: 18px;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
  }

  .hero,
  .hero-track,
  .hero-slide {
    min-height: 82vh;
  }

  .hero-control {
    display: none;
  }

  .hero h1 {
    letter-spacing: -0.05em;
  }

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

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

  .movie-title {
    min-height: 44px;
    font-size: 15px;
  }

  .movie-line {
    display: none;
  }

  .category-grid,
  .filter-panel,
  .footer-inner,
  .detail-side {
    grid-template-columns: 1fr;
  }

  .detail-main,
  .detail-side,
  .player-section {
    padding: 16px;
  }

  .page-hero {
    padding: 48px 0 32px;
  }
}
