:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f8fafc;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --purple: #9333ea;
  --slate: #0f172a;
  --slate-2: #1e293b;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f1f5f9;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

.site-container {
  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 50%, #0f172a 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.32);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 800;
}

.logo svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #60a5fa;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo span,
.footer-logo {
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
}

.desktop-nav a,
.mobile-panel a {
  color: #cbd5e1;
  font-weight: 600;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.desktop-nav a:hover,
.mobile-panel a:hover {
  color: #fff;
}

.top-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-panel input {
  border: 0;
  outline: 0;
  color: #fff;
  background: #334155;
  border-radius: 999px;
  padding: 10px 14px;
  min-width: 210px;
}

.top-search input::placeholder,
.mobile-panel input::placeholder {
  color: #94a3b8;
}

.top-search button,
.mobile-panel button,
.primary-btn,
.secondary-btn,
.filter-actions button,
.player-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search button,
.mobile-panel button,
.primary-btn,
.filter-actions button,
.player-button {
  color: #fff;
  background: var(--blue);
  padding: 10px 18px;
}

.top-search button:hover,
.mobile-panel button:hover,
.primary-btn:hover,
.filter-actions button:hover,
.player-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.secondary-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  padding: 10px 18px;
  backdrop-filter: blur(12px);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
}

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

.mobile-panel.is-open {
  display: block;
}

.mobile-panel nav {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.mobile-panel a {
  padding: 10px 12px;
  border-radius: 12px;
}

.mobile-panel a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-panel form {
  display: flex;
  gap: 8px;
}

.mobile-panel input {
  flex: 1;
  min-width: 0;
}

main {
  min-height: 62vh;
}

.hero {
  position: relative;
  min-height: 560px;
  color: #fff;
  overflow: hidden;
  background: #020617;
}

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

.hero-track {
  display: flex;
  min-height: 560px;
  transition: transform 0.6s ease;
}

.hero-slide {
  position: relative;
  min-width: 100%;
  min-height: 560px;
  display: flex;
  align-items: center;
  isolation: isolate;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  filter: saturate(1.1);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.22)), linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0));
}

.hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
  align-items: center;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.3);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.page-hero h1 {
  margin: 22px 0 16px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p {
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
  margin: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.hero-meta span,
.meta-pill,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  padding: 7px 12px;
  font-size: 13px;
  font-style: normal;
}

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

.hero-poster {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  transform: rotate(2deg);
}

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

.hero-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.58);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.hero-control:hover {
  background: rgba(15, 23, 42, 0.84);
}

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

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

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

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

.hero-dots button.is-active {
  width: 32px;
  background: #fff;
}

.section {
  padding: 54px 0;
}

.section.compact {
  padding: 36px 0;
}

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

.section-head h2,
.content-panel h2,
.detail-section h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

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

.section-more {
  color: var(--blue);
  font-weight: 800;
}

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

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

.movie-card {
  min-width: 0;
}

.movie-card-link {
  display: block;
  overflow: hidden;
  height: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.movie-card-link:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #cbd5e1, #64748b);
}

.poster-wrap img,
.compact-card img,
.rank-item img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card-link:hover img,
.compact-card:hover img,
.rank-item:hover img {
  transform: scale(1.08);
}

.card-badge {
  position: absolute;
  top: 10px;
  z-index: 1;
  padding: 4px 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.card-badge.left {
  left: 10px;
}

.card-badge.right {
  right: 10px;
}

.card-body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.card-body strong {
  color: #111827;
  line-height: 1.35;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body span,
.card-body em,
.rank-info em,
.rank-info small,
.compact-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.card-body em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 12px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail .movie-card {
  flex: 0 0 184px;
  scroll-snap-align: start;
}

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

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

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--category-image);
  background-size: cover;
  background-position: center;
  opacity: 0.42;
  transition: transform 0.4s ease;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.12));
}

.category-card:hover::before {
  transform: scale(1.08);
}

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

.category-card strong {
  font-size: 24px;
  margin-bottom: 8px;
}

.category-card span {
  color: #cbd5e1;
  line-height: 1.6;
}

.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 24px;
}

.rank-list,
.side-list,
.content-panel,
.filter-panel,
.detail-section,
.player-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.rank-list {
  padding: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 48px 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  transition: background-color 0.2s ease;
}

.rank-item:hover {
  background: #f8fafc;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  font-weight: 900;
}

.rank-item img {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  background: #e2e8f0;
}

.rank-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rank-info strong,
.compact-card strong {
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-list {
  padding: 18px;
  align-self: start;
}

.side-list h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

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

.compact-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.compact-card img {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: #e2e8f0;
}

.compact-card span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.page-hero {
  color: #fff;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.5), transparent 30%), linear-gradient(135deg, #020617, #1e293b 55%, #111827);
  padding: 76px 0;
}

.page-hero h1 {
  margin-top: 0;
}

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

.breadcrumb a {
  color: #bfdbfe;
}

.filter-panel {
  margin: -34px auto 34px;
  padding: 18px;
  position: relative;
  z-index: 2;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  gap: 12px;
  align-items: center;
}

.filter-grid input,
.filter-grid select,
.search-main input,
.search-main select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.filter-grid input:focus,
.filter-grid select:focus,
.search-main input:focus,
.search-main select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.filter-empty {
  display: none;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.detail-hero {
  color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(147, 51, 234, 0.42), transparent 30%), linear-gradient(135deg, #020617, #1e293b 60%, #0f172a);
  padding: 46px 0 58px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: end;
}

.detail-poster {
  overflow: hidden;
  border-radius: 22px;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #334155, #0f172a);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.detail-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.detail-copy p {
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.75;
  margin: 0 0 18px;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tag {
  background: #eef2ff;
  color: #3730a3;
}

.detail-hero .tag,
.detail-hero .meta-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #e0f2fe;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tag-small {
  padding: 5px 9px;
  font-size: 12px;
}

.detail-main {
  padding: 40px 0 60px;
}

.player-card {
  overflow: hidden;
  margin-bottom: 28px;
}

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

.player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15));
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.35);
}

.player-caption {
  padding: 18px 20px;
  color: var(--muted);
  border-top: 1px solid #111827;
  background: #020617;
}

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

.content-stack {
  display: grid;
  gap: 24px;
}

.detail-section {
  padding: 24px;
}

.detail-section p {
  color: #334155;
  line-height: 1.9;
  font-size: 16px;
}

.search-main {
  padding: 44px 0 64px;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px auto;
  gap: 12px;
  margin-bottom: 28px;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.site-footer {
  color: #cbd5e1;
  background: #0f172a;
  padding: 46px 0 0;
}

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

.footer-logo {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 12px;
}

.site-footer h2 {
  color: #fff;
  font-size: 16px;
  margin: 0 0 12px;
}

.site-footer p,
.site-footer li {
  color: #94a3b8;
  line-height: 1.8;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 36px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
  color: #94a3b8;
  padding: 18px;
}

@media (max-width: 1100px) {
  .desktop-nav {
    gap: 12px;
    font-size: 14px;
  }

  .top-search input {
    min-width: 160px;
  }

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

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

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

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

  .hero,
  .hero-slider,
  .hero-track,
  .hero-slide {
    min-height: 680px;
  }

  .hero-content,
  .detail-grid,
  .detail-layout,
  .rank-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    width: min(240px, 70vw);
    margin: 0 auto;
  }

  .hero-control {
    display: none;
  }

  .filter-grid,
  .search-box {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: min(260px, 82vw);
  }
}

@media (max-width: 640px) {
  .site-container {
    width: min(100% - 24px, 1180px);
  }

  .logo span {
    font-size: 20px;
  }

  .hero-content {
    gap: 24px;
  }

  .hero h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: 34px;
  }

  .hero p,
  .page-hero p,
  .detail-copy p {
    font-size: 16px;
  }

  .section-head {
    display: block;
  }

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

  .rail .movie-card {
    flex-basis: 156px;
  }

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

  .rank-item {
    grid-template-columns: 38px 58px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .rank-number {
    width: 32px;
    height: 32px;
  }

  .card-body {
    padding: 10px;
  }
}
