:root {
  color-scheme: dark;
  --bg: #090b1a;
  --bg-deep: #050716;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --yellow: #facc15;
  --radius: 22px;
  --shadow: 0 28px 80px rgba(8, 8, 22, 0.45);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(139, 92, 246, 0.34), transparent 34rem),
    radial-gradient(circle at 88% 15%, rgba(236, 72, 153, 0.22), transparent 32rem),
    linear-gradient(135deg, #0f172a 0%, #351253 48%, #0f172a 100%);
  background-attachment: fixed;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(49, 46, 129, 0.95), rgba(88, 28, 135, 0.95), rgba(131, 24, 67, 0.95));
  border-bottom: 1px solid rgba(216, 180, 254, 0.22);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

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

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.34);
}

.logo-text {
  font-size: 20px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 300px;
}

.site-search input {
  width: 100%;
  min-width: 130px;
  padding: 11px 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  outline: none;
}

.site-search input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.site-search button,
.primary-btn,
.secondary-btn,
.hero-btn,
.search-panel button {
  border: 0;
  color: #ffffff;
  cursor: pointer;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.26);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.site-search button {
  padding: 11px 16px;
}

.site-search button:hover,
.primary-btn:hover,
.hero-btn:hover,
.search-panel button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 4px;
}

.main-wrap,
.section-inner,
.footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

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

.hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 22, 0.94) 0%, rgba(15, 23, 42, 0.72) 42%, rgba(15, 23, 42, 0.1) 100%),
    linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.15) 45%, rgba(15, 23, 42, 0.05) 100%);
}

.hero-content {
  position: absolute;
  left: max(16px, calc((100% - 1240px) / 2));
  bottom: 82px;
  width: min(690px, calc(100% - 32px));
}

.eyebrow,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}

.hero-content h1,
.hero-content h2 {
  margin: 20px 0 16px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-content p {
  margin: 0 0 22px;
  color: #e2e8f0;
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.movie-meta,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-meta {
  margin-bottom: 28px;
  color: #e2e8f0;
}

.hero-meta span,
.movie-meta span {
  color: var(--muted);
}

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

.hero-btn,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  font-weight: 700;
}

.hero-control {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
}

.hero-control:hover {
  background: rgba(139, 92, 246, 0.75);
}

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

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

.hero-dots {
  position: absolute;
  z-index: 5;
  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.4);
  cursor: pointer;
}

.hero-dots button.is-active {
  width: 30px;
  background: #ffffff;
}

.section {
  padding: 58px 0;
}

.section-muted {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(88, 28, 135, 0.12), rgba(15, 23, 42, 0));
}

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

.section-head h2,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.section-head p,
.page-hero p,
.detail-title p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.category-tile {
  position: relative;
  min-height: 162px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.category-tile::before {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.35), transparent 70%);
}

.category-tile:hover {
  transform: translateY(-6px) scale(1.01);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(216, 180, 254, 0.36);
}

.category-tile strong {
  position: relative;
  display: block;
  margin-bottom: 12px;
  font-size: 21px;
}

.category-tile span {
  position: relative;
  color: var(--muted);
  line-height: 1.7;
}

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

.movie-grid.poster-grid {
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease;
  backdrop-filter: blur(12px);
}

.movie-card:hover {
  transform: translateY(-7px);
  background: var(--panel-strong);
  border-color: rgba(216, 180, 254, 0.32);
}

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.26), rgba(236, 72, 153, 0.18));
}

.poster-grid .movie-cover,
.compact-card img {
  aspect-ratio: 2 / 3;
}

.movie-cover img,
.compact-card img,
.ranking-cover img,
.poster-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.movie-card:hover .movie-cover img,
.compact-card:hover img,
.ranking-item:hover img {
  transform: scale(1.08);
}

.movie-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 9px;
  font-size: 12px;
  color: #ffffff;
  border-radius: 9px;
  background: rgba(139, 92, 246, 0.78);
  backdrop-filter: blur(10px);
}

.play-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

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

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

.movie-card h3,
.ranking-item h3,
.related-list h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
}

.movie-card h3 a:hover,
.ranking-item h3 a:hover,
.related-list a:hover {
  color: #d8b4fe;
}

.movie-card p,
.ranking-item p,
.detail-body p {
  color: var(--muted);
  line-height: 1.75;
}

.movie-card p {
  display: -webkit-box;
  min-height: 50px;
  margin: 0 0 14px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-list span {
  padding: 5px 9px;
  color: #dbeafe;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.compact-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.compact-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.compact-card span,
.compact-card small {
  display: block;
  padding: 0 12px;
}

.compact-card span {
  margin-top: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.compact-card small {
  margin: 7px 0 13px;
  color: var(--soft);
}

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

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

.ranking-item {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ranking-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.ranking-cover strong {
  position: absolute;
  left: 8px;
  top: 8px;
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #facc15, #ec4899);
}

.page-hero {
  padding: 70px 0 30px;
}

.breadcrumb {
  margin-bottom: 22px;
  color: var(--soft);
  font-size: 14px;
}

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

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

.player-section,
.detail-panel,
.side-panel,
.search-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #000000;
  aspect-ratio: 16 / 9;
}

.player-shell video {
  width: 100%;
  height: 100%;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  color: #ffffff;
  border: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-circle {
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 32px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.92), rgba(236, 72, 153, 0.92));
  box-shadow: 0 22px 48px rgba(236, 72, 153, 0.34);
}

.play-text {
  font-size: 18px;
  font-weight: 800;
}

.detail-panel {
  padding: 28px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.detail-title h1 {
  margin-bottom: 12px;
}

.detail-chips,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.detail-chips span,
.filters button,
.filters select {
  padding: 8px 13px;
  color: #e2e8f0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.detail-body {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.detail-body h2 {
  margin: 24px 0 12px;
  font-size: 24px;
}

.side-panel {
  padding: 20px;
  margin-bottom: 22px;
}

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

.poster-card .primary-btn {
  width: 100%;
  margin-top: 16px;
}

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

.related-list a {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
}

.related-list img {
  width: 70px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
}

.related-list h3 {
  font-size: 15px;
}

.related-list small {
  color: var(--soft);
}

.search-page-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.search-panel {
  padding: 22px;
}

.search-panel input,
.filters select {
  width: 100%;
  color: #ffffff;
  outline: none;
}

.search-panel input {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
}

.search-panel button {
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
}

.filters {
  margin-top: 18px;
}

.filters select {
  padding: 12px 14px;
}

.search-result-head {
  margin-bottom: 18px;
  color: var(--muted);
}

.site-footer {
  margin-top: 70px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 22, 0.42);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--soft);
}

.footer-logo {
  color: #ffffff;
  font-weight: 800;
}

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

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

.empty-state {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

@media (max-width: 1120px) {
  .nav-wrap {
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .site-search {
    order: 3;
    flex: 1 1 100%;
  }

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

  .movie-grid.poster-grid,
  .compact-row {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 820px) {
  .menu-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    order: 2;
  }

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

  .nav-link {
    padding: 12px 14px;
  }

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

  .hero-content {
    bottom: 70px;
  }

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

  .hero-control {
    display: none;
  }

  .section-head {
    display: block;
  }

  .movie-grid,
  .movie-grid.poster-grid,
  .category-grid,
  .ranking-list,
  .compact-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .ranking-item {
    grid-template-columns: 96px 1fr;
  }

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

@media (max-width: 560px) {
  .nav-wrap,
  .main-wrap,
  .section-inner,
  .footer-inner {
    width: min(100% - 24px, 1240px);
  }

  .logo-text {
    font-size: 17px;
  }

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

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

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

  .movie-grid,
  .movie-grid.poster-grid,
  .category-grid,
  .compact-row {
    grid-template-columns: 1fr;
  }

  .detail-panel,
  .side-panel,
  .search-panel {
    padding: 18px;
  }

  .play-circle {
    width: 76px;
    height: 76px;
  }
}
