* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(30, 41, 59, 0.88);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --blue: #2563eb;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.2);
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
  --radius: 22px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.24), transparent 30rem),
    radial-gradient(circle at 88% 2%, rgba(34, 211, 238, 0.16), transparent 28rem),
    linear-gradient(180deg, #0f172a 0%, #111827 50%, #0f172a 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
  font: inherit;
}

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

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

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.35);
}

.brand-text {
  white-space: nowrap;
  font-size: 1.08rem;
}

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

.nav-link,
.mobile-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: white;
  background: rgba(37, 99, 235, 0.24);
}

.header-search {
  margin-left: auto;
  width: min(360px, 32vw);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.64);
}

.header-search input,
.mobile-search input,
.large-search input,
.search-tools input {
  width: 100%;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
}

.header-search input {
  padding: 8px 6px 8px 12px;
}

.header-search button,
.mobile-search button,
.large-search button {
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.header-search button {
  padding: 8px 14px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.72);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: white;
}

.mobile-panel {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.94);
}

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

.mobile-search {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
}

.mobile-search input {
  padding: 8px 10px;
}

.mobile-search button {
  padding: 8px 16px;
}

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

.hero-section {
  padding: 34px 0 24px;
}

.hero-slider {
  position: relative;
  height: min(64vh, 580px);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(34, 211, 238, 0.08));
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 0.9s ease;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-image {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(34, 211, 238, 0.12)),
    #111827;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  filter: saturate(1.1) contrast(1.04);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.68) 44%, rgba(15, 23, 42, 0.18) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.75) 0%, transparent 48%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(620px, 88%);
  min-height: 100%;
  padding: clamp(34px, 7vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-tags,
.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.hero-content h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-line {
  max-width: 650px;
  margin: 0 0 14px;
  color: white;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
}

.hero-summary {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

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

.primary-btn,
.ghost-btn,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.32);
}

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

.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.48);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

.hero-dot {
  width: 28px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.42);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--cyan);
}

.quick-search-panel,
.page-hero,
.detail-card,
.side-info,
.player-shell,
.category-card,
.movie-card,
.rank-item,
.search-tools {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 56px rgba(2, 6, 23, 0.24);
}

.quick-search-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  margin: 12px 0 48px;
  padding: clamp(22px, 5vw, 38px);
  border-radius: var(--radius);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quick-search-panel h2,
.page-hero h1,
.section-head h2,
.detail-card h1 {
  margin: 0;
  letter-spacing: -0.04em;
}

.quick-search-panel h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
}

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

.large-search {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.35);
}

.large-search input {
  padding: 12px 14px;
}

.large-search button {
  padding: 0 22px;
}

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

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

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 2.3rem);
}

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

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

.category-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border-radius: var(--radius);
  isolation: isolate;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.45);
}

.category-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(34, 211, 238, 0.1));
}

.category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
}

.category-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.92));
}

.category-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.category-kicker {
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 800;
}

.category-card h3 {
  margin: 8px 0;
  font-size: 1.45rem;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.42);
  background: var(--panel-strong);
}

.poster-link {
  position: relative;
  display: block;
}

.poster-wrap,
.rank-poster,
.side-poster,
.player-cover,
.hero-image {
  background:
    radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.18), transparent 16rem),
    linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.95));
}

.poster-wrap {
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.poster-image,
.rank-image,
.side-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.movie-card:hover .poster-image {
  transform: scale(1.05);
}

.image-missing {
  opacity: 0;
}

.corner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 700;
}

.movie-info {
  padding: 14px;
}

.movie-info h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.movie-info h3 a:hover {
  color: var(--cyan);
}

.movie-meta,
.movie-line {
  margin: 0;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.6;
}

.movie-line {
  margin-top: 8px;
  color: var(--muted);
}

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

.split-section {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
  align-items: start;
}

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

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

.rank-list.compact {
  gap: 10px;
}

.rank-item {
  overflow: hidden;
  border-radius: 18px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(34, 211, 238, 0.42);
}

.rank-link {
  display: grid;
  grid-template-columns: 52px 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

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

.rank-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
}

.rank-text h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.rank-text p,
.rank-text span {
  display: block;
  margin: 0;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.page-hero {
  margin: 34px 0 34px;
  padding: clamp(28px, 6vw, 58px);
  border-radius: 30px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.18), transparent 30rem),
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.9));
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
}

.page-hero p {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.center-actions {
  justify-content: center;
}

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

.search-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 20px;
}

.search-tools input {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.36);
}

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

.movie-card-wide {
  display: grid;
  grid-template-columns: 120px 1fr;
}

.movie-card-wide .poster-wrap {
  height: 100%;
}

.empty-state {
  margin: 26px 0 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.72);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--soft);
  font-size: 0.92rem;
}

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

.player-shell {
  padding: 10px;
  border-radius: 24px;
}

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

.player-video {
  width: 100%;
  height: 100%;
  background: black;
}

.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  cursor: pointer;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}

.play-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.38);
  transform: translate(-50%, -50%);
}

.play-ring span {
  margin-left: 5px;
  font-size: 2rem;
}

.player-shell.is-playing .player-cover {
  display: none;
}

.detail-card {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 24px;
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.detail-card h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.detail-title-row p {
  margin: 10px 0 0;
  color: var(--muted);
}

.compact-btn {
  white-space: nowrap;
}

.detail-tags {
  margin: 22px 0 26px;
}

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

.detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.detail-side {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.side-poster {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  aspect-ratio: 2 / 3;
}

.side-info {
  padding: 20px;
  border-radius: 22px;
}

.side-info h2 {
  margin-top: 0;
}

.side-info dl {
  margin: 0;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px 12px;
}

.side-info dt {
  color: var(--soft);
}

.side-info dd {
  margin: 0;
  color: var(--text);
}

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

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

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-inner strong {
  display: block;
  color: white;
  margin-bottom: 8px;
}

.footer-inner p {
  margin: 0;
}

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

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

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

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

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

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

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

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

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

  .hero-shade {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.95) 0%, rgba(15, 23, 42, 0.35) 100%);
  }

  .hero-content {
    justify-content: flex-end;
    width: 100%;
  }

  .quick-search-panel,
  .split-section,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
    grid-template-columns: 220px 1fr;
  }

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

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

@media (max-width: 640px) {
  main,
  .nav-wrap,
  .mobile-panel,
  .footer-inner {
    width: min(100% - 24px, 1280px);
  }

  .brand-text {
    font-size: 0.98rem;
  }

  .hero-section {
    padding-top: 18px;
  }

  .hero-slider {
    min-height: 520px;
    border-radius: 22px;
  }

  .hero-content {
    padding: 26px;
  }

  .hero-control {
    display: none;
  }

  .large-search,
  .search-tools,
  .footer-inner,
  .detail-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .large-search {
    border-radius: 22px;
  }

  .large-search button {
    min-height: 46px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-grid,
  .category-grid.large,
  .movie-grid,
  .category-list,
  .related-grid,
  .search-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .movie-card-wide {
    grid-template-columns: 100px 1fr;
  }

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

  .rank-link {
    grid-template-columns: 42px 62px 1fr;
    gap: 10px;
  }

  .side-poster {
    max-width: 260px;
  }
}
