:root {
  --dark-950: #0b0d10;
  --dark-900: #141618;
  --dark-850: #1a1d21;
  --dark-800: #24272c;
  --dark-750: #2b2f35;
  --dark-700: #353a42;
  --text-main: #ffffff;
  --text-soft: #d1d5db;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --primary: #1890ff;
  --primary-600: #0f75d8;
  --primary-soft: rgba(24, 144, 255, 0.18);
  --secondary: #13c2c2;
  --secondary-soft: rgba(19, 194, 194, 0.18);
  --warning: #facc15;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.08);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.28);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(24, 144, 255, 0.12), transparent 32rem),
    radial-gradient(circle at 82% 18%, rgba(19, 194, 194, 0.10), transparent 30rem),
    var(--dark-900);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(20, 22, 24, 0.94);
  border-bottom-color: var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

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

.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-grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 24px rgba(24, 144, 255, 0.24);
}

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

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

.nav-link {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 650;
  transition: color 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.header-search {
  display: flex;
  align-items: center;
  width: 260px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(36, 39, 44, 0.72);
}

.header-search input {
  width: 100%;
  min-width: 0;
  color: white;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 8px 10px 8px 14px;
}

.header-search button {
  flex: 0 0 auto;
  color: white;
  background: var(--primary);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.header-search button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  padding: 0 0 18px;
}

.mobile-panel-inner {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.hero {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  background: var(--dark-950);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.hero-slide.active {
  opacity: 1;
}

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 13, 16, 0.95) 0%, rgba(11, 13, 16, 0.65) 44%, rgba(11, 13, 16, 0.16) 100%),
    linear-gradient(0deg, var(--dark-900) 0%, rgba(20, 22, 24, 0.18) 48%, rgba(20, 22, 24, 0.04) 100%);
}

.hero-content-wrap {
  position: relative;
  z-index: 2;
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding-top: 76px;
  padding-bottom: 76px;
}

.hero-copy {
  width: min(660px, 100%);
  animation: slideUp 0.7s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9bd0ff;
  border: 1px solid rgba(24, 144, 255, 0.42);
  background: rgba(24, 144, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.hero h2 {
  margin: 18px 0 16px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 640px;
  margin: 0 0 24px;
  color: var(--text-soft);
  font-size: clamp(16px, 2vw, 20px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  color: white;
  border-radius: 12px;
  font-weight: 750;
  transition: transform 0.22s ease, background-color 0.22s ease, border-color 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  box-shadow: 0 18px 30px rgba(24, 144, 255, 0.24);
}

.btn-primary:hover {
  background: var(--primary-600);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hero-search {
  width: min(560px, 100%);
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 18px;
  background: rgba(36, 39, 44, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  color: white;
  background: transparent;
  border: 0;
  outline: 0;
}

.hero-search button {
  padding: 12px 18px;
  color: white;
  background: var(--secondary);
  border-radius: 13px;
  cursor: pointer;
  font-weight: 750;
}

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

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

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

.hero-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 46px;
  height: 46px;
  color: white;
  background: rgba(20, 22, 24, 0.58);
  border-radius: 999px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  transition: background-color 0.22s ease;
}

.hero-arrow:hover {
  background: rgba(20, 22, 24, 0.9);
}

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

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

.page-hero {
  padding: 128px 0 56px;
  background:
    linear-gradient(180deg, rgba(36, 39, 44, 0.96) 0%, rgba(20, 22, 24, 0.96) 100%),
    radial-gradient(circle at top right, rgba(24, 144, 255, 0.2), transparent 35rem);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--text-muted);
  font-size: 17px;
}

.main-space {
  padding: 64px 0;
}

.section {
  margin-bottom: 64px;
}

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

.section-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.18;
}

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

.section-more {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 750;
}

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

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

.movie-card {
  min-width: 0;
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  background: var(--dark-750);
  border-color: rgba(24, 144, 255, 0.32);
  box-shadow: var(--shadow-card);
}

.movie-card.hidden-by-filter {
  display: none;
}

.card-link {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--dark-800), var(--dark-700));
}

.movie-card.wide .poster-wrap {
  aspect-ratio: 16 / 10;
}

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

.movie-card:hover .poster-wrap img,
.category-tile:hover img,
.related-card:hover img,
.ranking-item:hover img {
  transform: scale(1.08);
}

.poster-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.68));
  pointer-events: none;
}

.score-badge,
.year-badge,
.type-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.score-badge {
  top: 10px;
  left: 10px;
  color: #1a1400;
  background: var(--warning);
  padding: 4px 8px;
}

.year-badge {
  right: 10px;
  bottom: 10px;
  color: white;
  background: rgba(0, 0, 0, 0.62);
  padding: 4px 8px;
}

.type-badge {
  top: 10px;
  right: 10px;
  color: white;
  background: rgba(24, 144, 255, 0.84);
  padding: 4px 8px;
}

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

.movie-title {
  margin: 0 0 8px;
  color: white;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card:hover .movie-title {
  color: #8dccff;
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 12px;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

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

.category-tile {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--dark-800);
  box-shadow: var(--shadow-card);
}

.category-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
  transition: transform 0.4s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.82)),
    linear-gradient(120deg, rgba(24, 144, 255, 0.22), transparent);
}

.category-tile-content {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 20px;
}

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

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, 180px);
  gap: 12px;
  margin-bottom: 28px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(36, 39, 44, 0.72);
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  outline: 0;
  padding: 12px 14px;
}

.filter-panel select option {
  color: #111827;
}

.empty-state {
  display: none;
  padding: 26px;
  color: var(--text-muted);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--dark-800);
}

.empty-state.show {
  display: block;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 64px 128px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--dark-800);
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.ranking-item:hover {
  transform: translateY(-3px);
  background: var(--dark-750);
  border-color: rgba(19, 194, 194, 0.30);
}

.ranking-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
}

.ranking-poster {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background: var(--dark-700);
}

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

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

.ranking-info p {
  margin: 0;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ranking-score {
  color: var(--warning);
  font-size: 20px;
  font-weight: 900;
}

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

.player-section {
  padding: 108px 0 44px;
  background:
    linear-gradient(180deg, rgba(11, 13, 16, 0.92), rgba(20, 22, 24, 1)),
    radial-gradient(circle at top right, rgba(24, 144, 255, 0.18), transparent 32rem);
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-lg);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.player-button-inner {
  display: grid;
  justify-items: center;
  gap: 12px;
  font-weight: 850;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.play-ring {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 18px 40px rgba(24, 144, 255, 0.34);
}

.play-ring::before {
  content: "▶";
  margin-left: 5px;
  font-size: 28px;
}

.player-error {
  display: none;
  margin-top: 12px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: 12px;
  padding: 12px 14px;
}

.player-error.show {
  display: block;
}

.detail-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(36, 39, 44, 0.78);
  box-shadow: var(--shadow-card);
}

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

.detail-title {
  margin: 18px 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.12;
}

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

.breadcrumbs a:hover {
  color: var(--primary);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0 20px;
}

.detail-meta span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.07);
}

.detail-copy {
  color: var(--text-soft);
  font-size: 17px;
}

.detail-copy h2 {
  margin: 32px 0 12px;
  color: white;
  font-size: 26px;
}

.detail-copy p {
  margin: 0 0 16px;
}

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

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--dark-950);
  padding: 46px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.footer-grid p {
  color: var(--text-muted);
}

.footer-links {
  display: grid;
  gap: 9px;
}

.footer-links a {
  color: var(--text-muted);
}

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

.footer-title {
  margin: 0 0 12px;
  color: white;
  font-size: 16px;
}

.copyright {
  margin-top: 34px;
  padding-top: 20px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  font-size: 14px;
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .mobile-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-header.menu-open .mobile-panel {
    display: block;
  }

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

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

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

  .detail-panel {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
  }

  .detail-panel img {
    margin-bottom: 0;
  }
}

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

  .nav-wrap {
    min-height: 64px;
  }

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

  .hero,
  .hero-content-wrap {
    min-height: 82vh;
  }

  .hero-content-wrap {
    padding-top: 84px;
    padding-bottom: 72px;
  }

  .hero p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-search {
    display: grid;
  }

  .hero-search button {
    width: 100%;
  }

  .hero-arrow {
    display: none;
  }

  .section-head {
    display: block;
  }

  .section-more {
    display: inline-flex;
    margin-top: 12px;
  }

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

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

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

  .ranking-item {
    grid-template-columns: 42px 96px 1fr;
    align-items: start;
  }

  .ranking-score {
    grid-column: 3;
    justify-self: start;
    font-size: 16px;
  }

  .detail-panel {
    display: block;
  }

  .detail-panel img {
    margin-bottom: 18px;
  }

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

@media (max-width: 420px) {
  .movie-grid,
  .related-grid,
  .search-result-grid {
    grid-template-columns: 1fr;
  }
}
