:root {
  color-scheme: light;
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --bg-soft: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --line: #e2e8f0;
  --cyan: #06b6d4;
  --cyan-dark: #0891b2;
  --blue: #2563eb;
  --card: #ffffff;
  --shadow: 0 22px 55px rgba(15, 23, 42, 0.14);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: var(--bg-soft);
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #fff;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 15px 40px rgba(2, 6, 23, 0.25);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.28);
}

.brand-text {
  font-size: 1.22rem;
  color: transparent;
  background: linear-gradient(90deg, #22d3ee, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link,
.mobile-link {
  color: #cbd5e1;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: #22d3ee;
}

.menu-button {
  width: 42px;
  height: 42px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
}

.menu-button span {
  width: 18px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 12px 22px 18px;
  background: #1e293b;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.mobile-nav.is-open {
  display: grid;
  gap: 12px;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  color: #fff;
  background: var(--bg-dark);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 56px;
  padding: 86px max(28px, calc((100vw - 1180px) / 2)) 110px;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.8s ease;
}

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

.hero-copy {
  max-width: 720px;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #22d3ee;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1 {
  margin: 16px 0 18px;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.hero-copy p,
.page-hero p {
  max-width: 760px;
  margin: 0 0 28px;
  color: #cbd5e1;
  font-size: 1.12rem;
}

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

.hero-tags a,
.tag,
.detail-topline span {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-tags .tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

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

.primary-button,
.ghost-button,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  min-height: 46px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.ghost-button {
  min-height: 46px;
  padding: 0 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.primary-button:hover,
.ghost-button:hover,
.section-link:hover {
  transform: translateY(-2px);
}

.hero-poster {
  position: relative;
  display: block;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  aspect-ratio: 2 / 3;
}

.hero-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: inherit;
}

.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-control {
  position: absolute;
  bottom: 34px;
  right: max(28px, calc((100vw - 1180px) / 2));
  width: 46px;
  height: 46px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.hero-prev {
  transform: translateX(-58px);
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 50px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  background: rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 36px;
  background: #22d3ee;
}

.search-panel {
  margin-top: -48px;
  position: relative;
  z-index: 3;
  padding: 0 0 28px;
}

.search-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  align-items: center;
  gap: 28px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.search-shell h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.search-shell p {
  margin: 0;
  color: var(--text-muted);
}

.search-field {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.content-section {
  padding: 74px 0;
}

.white-section {
  background: #fff;
}

.soft-section {
  background: linear-gradient(90deg, #f8fafc, #ecfeff);
}

.dark-section {
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #082f49);
}

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

.section-heading h2 {
  margin: 7px 0 4px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 0;
  color: var(--text-muted);
}

.dark-section .section-heading p {
  color: #cbd5e1;
}

.section-link {
  color: var(--cyan-dark);
  white-space: nowrap;
}

.dark-section .section-link {
  color: #67e8f9;
}

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

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

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

.movie-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.dark-section .movie-card {
  color: var(--text-main);
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f172a;
}

.movie-card.compact {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
}

.movie-card.compact .poster-link {
  aspect-ratio: auto;
  min-height: 220px;
}

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

.movie-card:hover .poster-link img,
.category-tile:hover img,
.category-card:hover img {
  transform: scale(1.07);
}

.poster-glow {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.8), transparent);
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-radius: 12px;
  box-shadow: 0 12px 25px rgba(239, 68, 68, 0.28);
}

.card-body {
  padding: 18px;
}

.meta-row,
.detail-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.movie-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 1.08rem;
  line-height: 1.35;
}

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

.movie-card p {
  min-height: 50px;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

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

.category-tile,
.category-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 22px;
  color: #fff;
  background: #0f172a;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.category-tile img,
.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.56;
  transition: transform 0.35s ease;
}

.category-tile::after,
.category-shade {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.2));
}

.category-tile span,
.category-tile em,
.category-card strong,
.category-card em {
  position: relative;
  z-index: 1;
}

.category-tile span,
.category-card strong {
  font-size: 1.3rem;
  font-weight: 900;
}

.category-tile em,
.category-card em {
  margin-top: 6px;
  color: #cbd5e1;
  font-style: normal;
  font-size: 0.92rem;
}

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

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

.rank-item {
  display: grid;
  grid-template-columns: auto 76px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-page-section .rank-item {
  min-height: 104px;
}

.rank-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}

.rank-item img {
  width: 76px;
  height: 72px;
  object-fit: cover;
  border-radius: 13px;
}

.list-rank,
.list-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.list-rank {
  width: 34px;
  height: 34px;
  color: #082f49;
  background: #67e8f9;
  border-radius: 12px;
  font-weight: 900;
}

.list-dot {
  width: 12px;
  height: 12px;
  background: #22d3ee;
  border-radius: 999px;
}

.rank-text {
  min-width: 0;
}

.rank-text strong,
.rank-text em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-text strong {
  font-size: 1.02rem;
}

.rank-text em {
  color: #cbd5e1;
  font-style: normal;
  font-size: 0.85rem;
}

.page-hero {
  color: #fff;
  padding: 84px 0 74px;
  background: radial-gradient(circle at 20% 0%, rgba(6, 182, 212, 0.38), transparent 34%), linear-gradient(135deg, #0f172a, #082f49 68%, #111827);
}

.small-hero {
  padding-bottom: 96px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #cbd5e1;
  font-weight: 700;
}

.breadcrumb a:hover {
  color: #67e8f9;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 28px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.filter-button {
  min-height: 42px;
  padding: 0 15px;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.dark-toolbar .filter-button {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-button.is-active,
.filter-button:hover {
  color: #fff;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  border-color: transparent;
}

.empty-state {
  display: none;
  margin: 34px 0 0;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
}

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

.detail-shell {
  padding: 34px 0 0;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.detail-shell .breadcrumb {
  color: #475569;
}

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

.detail-main {
  display: grid;
  gap: 24px;
}

.player-card,
.detail-card,
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.player-card {
  overflow: hidden;
  background: #020617;
}

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

.player-box video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.64), rgba(2, 6, 23, 0.22));
  cursor: pointer;
}

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

.play-circle {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 5px;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  box-shadow: 0 22px 55px rgba(6, 182, 212, 0.35);
  font-size: 2rem;
}

.detail-card,
.side-card {
  padding: 26px;
}

.detail-card h1 {
  margin: 12px 0 12px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.detail-card .lead {
  color: #334155;
  font-size: 1.12rem;
  font-weight: 700;
}

.detail-card h2,
.side-card h2 {
  margin: 28px 0 10px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.detail-card p {
  color: #475569;
  font-size: 1.02rem;
}

.detail-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 22px;
}

.cover-card img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 18px;
}

.full-button {
  width: 100%;
}

.side-ranks .rank-item {
  grid-template-columns: 62px minmax(0, 1fr);
  color: #0f172a;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.side-ranks .rank-item .list-dot {
  display: none;
}

.side-ranks .rank-item img {
  width: 62px;
  height: 74px;
}

.side-ranks .rank-text em {
  color: #64748b;
}

.related-section {
  padding-top: 54px;
}

.site-footer {
  color: #cbd5e1;
  background: #0f172a;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 42px 0;
}

.footer-brand p {
  max-width: 560px;
  color: #94a3b8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: start;
  justify-content: flex-end;
  font-weight: 700;
}

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

.copyright {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding-top: 20px;
  color: #64748b;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

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

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

  .hero-slide {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }

  .menu-button {
    display: flex;
  }

  .hero-carousel {
    min-height: 680px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding-top: 70px;
    gap: 26px;
  }

  .hero-poster {
    width: min(230px, 64vw);
  }

  .hero-control {
    display: none;
  }

  .search-shell,
  .toolbar,
  .detail-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

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

  .detail-side {
    position: static;
  }

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

@media (max-width: 640px) {
  .container,
  .header-inner,
  .footer-inner {
    width: min(100% - 22px, 1180px);
  }

  .hero-carousel {
    min-height: 700px;
  }

  .hero-slide {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: 2.35rem;
  }

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

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

  .movie-card.compact .poster-link {
    min-height: 178px;
  }

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

  .rank-item {
    grid-template-columns: auto 62px minmax(0, 1fr);
  }

  .rank-item img {
    width: 62px;
    height: 68px;
  }
}
