:root {
  color-scheme: dark;
  --bg: #070912;
  --panel: rgba(255, 255, 255, 0.10);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --muted: #a7b0c0;
  --soft: #6f7a8c;
  --blueberry-400: #9d8df9;
  --blueberry-500: #7d60f5;
  --blueberry-600: #6d3eed;
  --night-400: #7d9aff;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(125, 96, 245, 0.32), transparent 28rem),
    radial-gradient(circle at 85% 4%, rgba(125, 154, 255, 0.24), transparent 30rem),
    linear-gradient(135deg, #050611 0%, #080b1d 48%, #130a25 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "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.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
}

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

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

button,
input {
  font: inherit;
}

.glass-effect {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.065));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.text-glow {
  text-shadow: 0 0 18px rgba(157, 141, 249, 0.75);
}

.card-hover,
.movie-card,
.category-card,
.rank-row {
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
}

.card-hover:hover,
.movie-card:hover,
.category-card:hover,
.rank-row:hover {
  transform: translateY(-6px);
  border-color: rgba(157, 141, 249, 0.58);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-16px);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-twinkle {
  animation: twinkle 3s ease-in-out infinite;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 18, 0.78);
  backdrop-filter: blur(20px);
}

.nav-shell {
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--blueberry-400), var(--night-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--blueberry-500), var(--night-400));
  box-shadow: 0 0 30px rgba(125, 96, 245, 0.55);
}

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

.nav-links a {
  color: #d9deea;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--blueberry-400);
  text-shadow: 0 0 14px rgba(157, 141, 249, 0.65);
}

.nav-search {
  width: min(300px, 28vw);
}

.nav-search input,
.home-search input,
.filter-search input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.nav-search input:focus,
.home-search input:focus,
.filter-search input:focus {
  border-color: var(--blueberry-400);
  box-shadow: 0 0 0 4px rgba(125, 96, 245, 0.16);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.10);
  cursor: pointer;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.home-shell {
  padding-top: 28px;
}

.hero-carousel {
  position: relative;
  min-height: clamp(520px, 66vw, 760px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: #060812;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 96, 245, 0.28), transparent 28rem),
    linear-gradient(90deg, rgba(5, 6, 17, 0.94), rgba(5, 6, 17, 0.54) 48%, rgba(5, 6, 17, 0.86)),
    linear-gradient(0deg, rgba(5, 6, 17, 0.92), transparent 58%);
}

.hero-content {
  position: relative;
  max-width: 760px;
  padding: clamp(32px, 7vw, 86px);
  z-index: 4;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--blueberry-400);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-kicker::before,
.section-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blueberry-400);
  box-shadow: 0 0 16px var(--blueberry-400);
}

.hero-content h1 {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  background: linear-gradient(90deg, #fff, var(--blueberry-400), var(--night-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-content p {
  margin: 0 0 26px;
  max-width: 660px;
  color: #d3daea;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions,
.home-search,
.detail-meta,
.meta-line,
.tag-row,
.detail-tags,
.category-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn,
.home-search button,
.text-link,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.btn:hover,
.home-search button:hover,
.text-link:hover,
.section-link:hover {
  transform: translateY(-2px);
  border-color: rgba(157, 141, 249, 0.72);
}

.btn-primary,
.home-search button {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blueberry-600), var(--night-400));
  box-shadow: 0 18px 40px rgba(125, 96, 245, 0.32);
}

.btn-ghost,
.section-link,
.text-link {
  color: #e7eaf5;
  background: rgba(255, 255, 255, 0.10);
}

.hero-dots {
  position: absolute;
  right: 38px;
  bottom: 36px;
  z-index: 5;
  display: flex;
  gap: 10px;
}

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

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

.quick-panel,
.page-hero {
  margin: 28px 0 58px;
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
}

.quick-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  gap: 28px;
  align-items: center;
}

.quick-panel span {
  color: var(--blueberry-400);
  font-weight: 800;
}

.quick-panel h2,
.page-hero h1,
.section-head h2 {
  margin: 5px 0 10px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
}

.quick-panel p,
.page-hero p,
.section-head p,
.movie-info p,
.category-card p,
.site-footer p {
  color: var(--muted);
  margin: 0;
}

.home-search {
  align-items: stretch;
}

.home-search input {
  flex: 1;
  min-width: 220px;
}

.home-search button {
  border: 0;
  min-width: 96px;
}

.content-section {
  margin: 0 0 64px;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

.movie-card-large {
  grid-column: span 2;
}

.movie-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.movie-card-large .movie-thumb {
  aspect-ratio: 16 / 9;
}

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

.movie-card:hover .movie-thumb img,
.rank-row:hover .movie-thumb img,
.category-card:hover img {
  transform: scale(1.08);
}

.movie-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4, 5, 14, 0.78), transparent 58%);
}

.category-pill,
.play-badge {
  position: absolute;
  z-index: 2;
}

.category-pill {
  top: 12px;
  right: 12px;
  border-radius: 999px;
  padding: 5px 10px;
  color: white;
  background: rgba(109, 62, 237, 0.86);
  font-size: 0.78rem;
  font-weight: 800;
}

.play-badge {
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: rgba(125, 96, 245, 0.92);
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

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

.movie-info {
  padding: 16px;
}

.movie-title,
.category-title {
  display: block;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
}

.movie-title:hover,
.category-title:hover {
  color: var(--blueberry-400);
}

.tag-row {
  margin: 12px 0;
}

.tag-row span,
.detail-tags span,
.meta-line span,
.detail-meta span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
  color: #dbe2f2;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.meta-line {
  color: var(--soft);
  font-size: 0.86rem;
}

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

.movie-card-small .movie-info,
.movie-card-small p,
.movie-card-small .tag-row,
.movie-card-small .category-pill {
  display: none;
}

.movie-card-small {
  padding-bottom: 12px;
}

.movie-card-small .movie-title,
.movie-card-small .meta-line {
  padding: 0 12px;
  margin-top: 10px;
}

.movie-card-horizontal,
.rank-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.075);
}

.small-thumb {
  border-radius: 14px;
  aspect-ratio: 16 / 10;
}

.category-cloud a,
.slim-cloud a {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 9px 14px;
  color: #dfe5f3;
  background: rgba(255, 255, 255, 0.08);
}

.category-cloud a:hover,
.slim-cloud a:hover {
  border-color: var(--blueberry-400);
  background: rgba(125, 96, 245, 0.25);
}

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

.category-card {
  overflow: hidden;
  border-radius: 24px;
}

.category-cover {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 150px;
  overflow: hidden;
}

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

.category-card > div {
  padding: 20px;
}

.category-title {
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.filter-search {
  margin-top: 24px;
  max-width: 540px;
}

.slim-cloud {
  margin-top: 18px;
}

.empty-state {
  display: none;
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.075);
}

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

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

.rank-row {
  grid-template-columns: 64px 180px minmax(0, 1fr);
}

.rank-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.08rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blueberry-600), var(--night-400));
}

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

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

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

.player-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #000;
}

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

.play-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.18));
  cursor: pointer;
}

.play-layer span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blueberry-600), var(--night-400));
  box-shadow: 0 18px 60px rgba(125, 96, 245, 0.56);
  font-size: 2rem;
  transition: transform 0.25s ease;
}

.play-layer:hover span {
  transform: scale(1.08);
}

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

.detail-card,
.poster-card,
.side-box {
  border-radius: 24px;
  padding: 22px;
}

.detail-card {
  margin-top: 22px;
}

.detail-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.12;
}

.detail-card h2,
.side-box h2 {
  margin: 26px 0 10px;
  font-size: 1.25rem;
}

.detail-card p {
  color: #d3dae9;
}

.one-line {
  color: #fff;
  font-size: 1.08rem;
}

.detail-tags {
  margin-top: 24px;
}

.poster-card {
  margin-bottom: 22px;
}

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

.side-box {
  display: grid;
  gap: 12px;
}

.side-box .movie-card-horizontal {
  grid-template-columns: 96px minmax(0, 1fr);
  box-shadow: none;
}

.side-box .movie-info {
  padding: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 18, 0.72);
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 34px;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.site-footer a:not(.footer-logo) {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.site-footer a:hover {
  color: var(--blueberry-400);
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
  color: var(--soft);
  text-align: center;
}

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

  .movie-card-large {
    grid-column: span 1;
  }

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

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

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

  .detail-side {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 820px) {
  .nav-shell {
    flex-wrap: wrap;
    min-height: 64px;
    padding: 12px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links,
  .nav-search {
    display: none;
    width: 100%;
  }

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

  .nav-links.is-open {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

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

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

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

  .rank-row {
    grid-template-columns: 46px 112px minmax(0, 1fr);
  }

  .movie-card-horizontal {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .hero-dots {
    left: 32px;
    right: auto;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 22px, 1280px);
  }

  .hero-carousel {
    min-height: 620px;
    border-radius: 24px;
  }

  .hero-content {
    padding: 28px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .card-grid,
  .featured-grid,
  .small-grid {
    grid-template-columns: 1fr;
  }

  .rank-row,
  .movie-card-horizontal,
  .side-box .movie-card-horizontal {
    grid-template-columns: 1fr;
  }

  .rank-number {
    position: absolute;
    margin: 10px;
    z-index: 4;
  }

  .rank-row {
    position: relative;
  }

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