:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-light: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --cyan-deep: #0891b2;
  --blue: #3b82f6;
  --orange: #fb923c;
  --green: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.18), transparent 32rem),
    radial-gradient(circle at 82% 2%, rgba(59, 130, 246, 0.18), transparent 34rem),
    linear-gradient(180deg, #0f172a 0%, #020617 52%, #020617 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand {
  font-size: 22px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #00111a;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}

.site-search {
  flex: 0 1 380px;
  display: flex;
  align-items: center;
  padding: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 999px;
}

.site-search input,
.filter-input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.site-search input {
  padding: 9px 14px;
}

.site-search input::placeholder,
.filter-input::placeholder {
  color: #64748b;
}

.site-search button,
.primary-btn,
.secondary-btn,
.rank-action,
.filter-button,
.mobile-toggle,
.hero-arrow,
.player-cover {
  border: 0;
  cursor: pointer;
}

.site-search button,
.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--cyan-deep), var(--blue));
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.24);
}

.site-search button {
  padding: 8px 18px;
  white-space: nowrap;
}

.desktop-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  font-size: 14px;
  color: #cbd5e1;
}

.desktop-links a,
.mobile-panel a,
.site-footer a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-links a:hover,
.mobile-panel a:hover,
.site-footer a:hover,
.card-body a:hover,
.rank-main a:hover,
.breadcrumb a:hover {
  color: var(--cyan);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  color: white;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}

.mobile-panel {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-panel a {
  display: block;
  padding: 12px 0;
  color: #cbd5e1;
  border-top: 1px solid var(--line);
}

.hero-carousel {
  position: relative;
  height: 540px;
  overflow: hidden;
  background: #020617;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.05);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.78) 38%, rgba(2, 6, 23, 0.24) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 1) 0%, transparent 42%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1280px) / 2 + 24px));
  bottom: 74px;
  width: min(680px, calc(100% - 48px));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 6px 14px;
  color: white;
  background: linear-gradient(135deg, var(--cyan-deep), var(--blue));
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.hero-content h1,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-content h1 {
  font-size: clamp(38px, 6vw, 72px);
  text-shadow: 0 20px 54px rgba(0, 0, 0, 0.52);
}

.hero-content p {
  max-width: 640px;
  margin: 20px 0 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
}

.hero-tags,
.tag-row,
.card-meta,
.detail-meta,
.breadcrumb,
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-tags {
  margin-top: 20px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: #a5f3fc;
  background: rgba(8, 145, 178, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 999px;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

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

.secondary-btn {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.secondary-btn:hover,
.filter-button:hover,
.rank-action:hover {
  border-color: rgba(34, 211, 238, 0.56);
  color: white;
  transform: translateY(-1px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 44px;
  height: 44px;
  color: white;
  background: rgba(0, 0, 0, 0.46);
  border-radius: 999px;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

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

.hero-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  background: rgba(255, 255, 255, 0.42);
  border: 0;
  border-radius: 999px;
  transition: width 0.3s ease, background 0.3s ease;
}

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

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

.section {
  padding: 54px 0;
}

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

.section-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
}

.section-desc,
.page-hero p,
.detail-title p,
.info-panel p,
.site-footer p {
  color: var(--muted);
  line-height: 1.8;
}

.movie-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 310px);
  gap: 22px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x proximity;
}

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

.movie-card,
.list-card,
.category-card,
.rank-row,
.info-panel,
.detail-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.22);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover,
.category-card:hover,
.rank-row:hover,
.list-card:hover {
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: 0 20px 58px rgba(8, 145, 178, 0.16);
  transform: translateY(-3px);
}

.poster-link,
.list-poster,
.rank-poster,
.detail-poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

.poster-link {
  aspect-ratio: 16 / 10;
}

.poster-link img,
.list-poster img,
.rank-poster img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover .poster-link img,
.list-card:hover img,
.rank-row:hover img {
  transform: scale(1.08);
}

.poster-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  color: white;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 999px;
  font-size: 12px;
}

.poster-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(0, 0, 0, 0.38);
  font-size: 46px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.card-body {
  padding: 18px;
}

.card-body h3,
.list-content h3,
.rank-main h2 {
  margin: 0;
  color: white;
  font-weight: 800;
  line-height: 1.42;
}

.card-body h3 {
  min-height: 46px;
  font-size: 17px;
}

.card-body p,
.list-content p,
.rank-main p {
  color: var(--muted);
  line-height: 1.65;
}

.card-body p {
  min-height: 54px;
  margin: 10px 0 14px;
  font-size: 14px;
}

.card-meta {
  color: #94a3b8;
  font-size: 13px;
}

.card-meta a,
.card-meta span {
  color: #cbd5e1;
}

.tag-row {
  margin-top: 14px;
}

.tag-row span {
  min-height: 24px;
  color: #67e8f9;
  font-size: 12px;
}

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

.category-card {
  min-height: 188px;
  padding: 24px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.category-card p {
  min-height: 76px;
  color: var(--muted);
  line-height: 1.75;
}

.category-card span {
  color: var(--cyan);
  font-weight: 800;
}

.list-stack,
.rank-list {
  display: grid;
  gap: 16px;
}

.list-card,
.rank-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  overflow: hidden;
}

.list-poster {
  height: 128px;
}

.list-content {
  padding: 18px 20px;
}

.list-content p {
  margin: 8px 0 12px;
}

.rank-row {
  grid-template-columns: 64px 116px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
}

.rank-number {
  color: var(--cyan);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.rank-poster {
  width: 116px;
  height: 76px;
  border-radius: 14px;
}

.rank-main h2 {
  font-size: 18px;
}

.rank-main p {
  margin: 6px 0 10px;
  font-size: 14px;
}

.rank-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 38px;
  color: white;
  background: rgba(8, 145, 178, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
}

.page-hero {
  padding: 72px 0 34px;
}

.page-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.page-hero p {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: 18px;
}

.breadcrumb {
  margin-bottom: 20px;
  color: #94a3b8;
  font-size: 14px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  margin-bottom: 26px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.filter-input {
  min-height: 46px;
  padding: 0 16px;
  background: rgba(2, 6, 23, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.filter-pills {
  justify-content: flex-end;
}

.filter-button {
  min-height: 42px;
  padding: 0 16px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.filter-button.is-active {
  color: white;
  background: linear-gradient(135deg, var(--cyan-deep), var(--blue));
}

.detail-hero {
  padding: 42px 0 28px;
}

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

.detail-title h1 {
  font-size: clamp(32px, 5vw, 58px);
}

.detail-title p {
  margin: 18px 0 0;
  font-size: 18px;
}

.detail-meta {
  margin-top: 20px;
}

.player-shell {
  margin-top: 28px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.movie-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.34));
}

.player-cover span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  padding-left: 6px;
  color: #00111a;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  font-size: 44px;
  box-shadow: 0 0 48px rgba(34, 211, 238, 0.42);
}

.player-cover.is-hidden {
  display: none;
}

.player-error {
  color: #fecaca;
  font-size: 18px;
  font-weight: 700;
}

.detail-card {
  padding: 22px;
}

.detail-poster {
  aspect-ratio: 16 / 11;
  border-radius: 18px;
}

.detail-card h2,
.info-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.detail-card .tag-row {
  margin-top: 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.info-panel {
  padding: 24px;
}

.info-panel p {
  margin: 0;
}

.related-section {
  padding: 42px 0 74px;
}

.site-footer {
  margin-top: 36px;
  padding: 48px 0 30px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.3), #020617 52%, #020617 100%);
  border-top: 1px solid var(--line);
}

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

.footer-brand {
  color: white;
  font-size: 22px;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: white;
  font-size: 17px;
}

.site-footer a {
  display: block;
  margin: 9px 0;
  color: #cbd5e1;
}

.copyright {
  width: min(1280px, calc(100% - 32px));
  margin: 30px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.is-hidden {
  display: none !important;
}

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

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

  .site-search {
    margin-left: auto;
  }

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

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

@media (max-width: 860px) {
  .nav-wrap {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .brand {
    font-size: 19px;
  }

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

  .hero-carousel {
    height: 620px;
  }

  .hero-shade {
    background: linear-gradient(0deg, rgba(2, 6, 23, 1) 0%, rgba(2, 6, 23, 0.52) 78%, rgba(2, 6, 23, 0.26) 100%);
  }

  .hero-content {
    left: 18px;
    bottom: 82px;
    width: calc(100% - 36px);
  }

  .movie-grid,
  .category-grid,
  .info-grid,
  .footer-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

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

  .filter-pills {
    justify-content: flex-start;
  }

  .rank-row {
    grid-template-columns: 48px 96px 1fr;
  }

  .rank-action {
    grid-column: 3;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .container,
  .nav-wrap,
  .mobile-panel,
  .footer-grid,
  .copyright {
    width: min(100% - 22px, 1280px);
  }

  .hero-arrow {
    display: none;
  }

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

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

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

  .list-card {
    grid-template-columns: 112px 1fr;
  }

  .list-poster {
    height: 100%;
  }

  .rank-row {
    grid-template-columns: 42px 82px 1fr;
    gap: 10px;
    padding: 12px;
  }

  .rank-poster {
    width: 82px;
    height: 58px;
  }

  .rank-main p {
    display: none;
  }
}
