:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --card: rgba(30, 41, 59, 0.68);
  --card-hover: rgba(30, 41, 59, 0.96);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --line: rgba(148, 163, 184, 0.18);
  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --yellow: #facc15;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(16, 185, 129, 0.18), transparent 32rem),
    radial-gradient(circle at 80% 18%, rgba(56, 189, 248, 0.11), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 78%);
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--emerald), #22d3ee);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.32);
}

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

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

.desktop-nav a,
.mobile-nav a {
  color: var(--soft);
  padding: 10px 16px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
  color: white;
  background: var(--emerald-soft);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.8);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: white;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 0 24px 18px;
  border-top: 1px solid var(--line);
}

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

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

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

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

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.74) 38%, rgba(2, 6, 23, 0.18) 78%),
    linear-gradient(0deg, #020617 0%, transparent 34%);
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-kicker,
.eyebrow {
  margin: 0 0 14px;
  color: var(--emerald);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-content h1,
.hero-content h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-desc {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.info-strip,
.movie-row-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-meta {
  margin-top: 24px;
}

.hero-meta span,
.info-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(12px);
}

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

.primary-btn,
.ghost-btn,
.quick-search-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.quick-search-form button {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.24);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.58);
}

.primary-btn:hover,
.ghost-btn:hover,
.quick-search-form button:hover {
  transform: translateY(-2px);
}

.hero-control {
  position: absolute;
  z-index: 6;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: white;
  background: rgba(2, 6, 23, 0.62);
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
  background: rgba(16, 185, 129, 0.8);
  transform: translateY(-50%) scale(1.04);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

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

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

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-top {
  padding-top: 38px;
  padding-bottom: 80px;
}

.home-stack {
  display: grid;
  gap: 82px;
  padding-top: 56px;
  padding-bottom: 92px;
}

.quick-search-section {
  position: relative;
  z-index: 8;
  max-width: 1280px;
  margin: -46px auto 0;
  padding: 0 24px;
}

.quick-search-card,
.page-hero,
.panel-section,
.ranking-panel,
.detail-info-card,
.text-card,
.poster-card,
.side-meta-card,
.player-card,
.filter-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.quick-search-card {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 480px);
  align-items: center;
  gap: 28px;
  padding: 28px;
}

.quick-search-card h2,
.section-heading h2,
.page-hero h1,
.text-card h2,
.side-meta-card h2,
.related-section h2 {
  margin: 0;
}

.quick-search-form {
  display: flex;
  gap: 12px;
}

.quick-search-form input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: white;
  background: rgba(2, 6, 23, 0.72);
  outline: none;
  padding: 0 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-search-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: rgba(16, 185, 129, 0.68);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

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

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--emerald);
  background: var(--emerald-soft);
}

.section-heading h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.section-more {
  color: var(--emerald);
  font-weight: 700;
}

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

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

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

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

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

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

.movie-card:hover .poster-wrap img {
  transform: scale(1.1);
  filter: brightness(0.78);
}

.rating-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: white;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(10px);
}

.rating-badge {
  right: 10px;
  color: var(--yellow);
}

.rank-badge {
  left: 10px;
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.play-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 44px;
  background: rgba(2, 6, 23, 0.3);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .play-hover {
  opacity: 1;
}

.movie-card h3 {
  margin: 12px 0 4px;
  color: white;
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

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

.card-meta {
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card-meta span + span::before {
  content: "•";
  margin-right: 8px;
  color: rgba(148, 163, 184, 0.6);
}

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

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

.category-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.46);
  transition: transform 0.45s ease, filter 0.45s ease;
}

.category-tile:hover img {
  transform: scale(1.08);
  filter: brightness(0.34);
}

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

.category-tile span {
  display: block;
  padding: 82px 18px 8px;
  font-size: 24px;
  font-weight: 900;
}

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

.panel-section,
.ranking-panel {
  padding: 30px;
}

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

.movie-row-link {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: background 0.2s ease, transform 0.2s ease;
}

.movie-row-link:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.movie-row-cover {
  position: relative;
  height: 112px;
  overflow: hidden;
}

.movie-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-row-body {
  min-width: 0;
  padding: 14px 18px 14px 0;
}

.movie-row-body h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.movie-row-body p {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--soft);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-row-meta {
  color: var(--muted);
  font-size: 13px;
}

.page-hero {
  padding: clamp(30px, 5vw, 56px);
  margin-bottom: 32px;
}

.slim-hero {
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(30, 41, 59, 0.74)),
    var(--panel);
}

.page-hero h1 {
  max-width: 920px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-hero p:last-child {
  max-width: 840px;
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 18px;
}

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

.category-overview-card a {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.2s ease, background 0.2s ease;
}

.category-overview-card a:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
}

.category-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

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

.category-overview-body {
  padding: 28px;
}

.category-overview-body h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.category-overview-body p {
  margin: 0 0 20px;
  color: var(--soft);
}

.category-overview-body span {
  color: var(--emerald);
  font-weight: 800;
}

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

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, 0.8fr));
  gap: 16px;
  padding: 18px;
  margin-bottom: 30px;
}

.filter-panel label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 700;
}

.search-results {
  position: relative;
}

.empty-state {
  display: none;
  margin: 32px 0 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  text-align: center;
  background: var(--panel);
}

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

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

.detail-main,
.detail-side {
  display: grid;
  gap: 24px;
}

.player-card {
  padding: 14px;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.24), rgba(2, 6, 23, 0.56));
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.player-overlay span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  padding-left: 5px;
  border-radius: 999px;
  font-size: 38px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  box-shadow: 0 22px 46px rgba(16, 185, 129, 0.34);
}

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

.detail-info-card,
.text-card,
.side-meta-card,
.poster-card {
  padding: 26px;
}

.detail-info-card h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.lead-text {
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 18px;
}

.info-strip {
  margin-top: 22px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tag-cloud span {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--emerald);
  background: var(--emerald-soft);
  font-size: 13px;
  font-weight: 800;
}

.text-card h2 {
  margin-bottom: 14px;
  font-size: 26px;
}

.text-card p {
  margin: 0;
  color: var(--soft);
  font-size: 17px;
}

.poster-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 18px;
}

.full-btn {
  width: 100%;
}

.side-meta-card dl {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.side-meta-card dt {
  color: var(--muted);
  font-size: 13px;
}

.side-meta-card dd {
  margin: -6px 0 0;
  color: white;
}

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

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

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.footer-brand {
  color: white;
  font-size: 20px;
  font-weight: 900;
}

[data-search-item].is-hidden {
  display: none;
}

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

  .featured-grid,
  .hot-grid,
  .compact-grid {
    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 {
    grid-template-columns: 300px 1fr;
  }
}

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

  .nav-toggle {
    display: block;
  }

  .site-header-inner {
    height: 64px;
    padding: 0 18px;
  }

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

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

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(2, 6, 23, 0.82) 0%, rgba(2, 6, 23, 0.64) 48%, #020617 100%);
  }

  .hero-content {
    padding: 70px 22px 110px;
    justify-content: flex-end;
  }

  .hero-control {
    display: none;
  }

  .quick-search-card {
    grid-template-columns: 1fr;
  }

  .quick-search-form {
    flex-direction: column;
  }

  .movie-grid,
  .catalog-grid,
  .featured-grid,
  .hot-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

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

  .category-overview-card a {
    grid-template-columns: 150px 1fr;
  }

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

  .movie-row-link {
    grid-template-columns: 132px 1fr;
  }

  .movie-row-cover {
    height: 104px;
  }

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

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .page-container,
  .hero-content,
  .quick-search-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-content h1,
  .hero-content h2 {
    font-size: 42px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions a {
    flex: 1 1 100%;
  }

  .movie-grid,
  .catalog-grid,
  .featured-grid,
  .hot-grid,
  .compact-grid {
    gap: 14px;
  }

  .movie-card h3 {
    font-size: 15px;
  }

  .panel-section,
  .ranking-panel,
  .detail-info-card,
  .text-card,
  .side-meta-card,
  .poster-card,
  .page-hero {
    padding: 20px;
  }

  .category-overview-card a,
  .movie-row-link {
    grid-template-columns: 1fr;
  }

  .category-mosaic {
    min-height: 180px;
  }

  .movie-row-cover {
    height: 180px;
  }

  .movie-row-body {
    padding: 0 16px 16px;
  }
}
