:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-strong: #2563eb;
  --accent: #22d3ee;
  --hot: #f43f5e;
  --gold: #facc15;
  --radius: 22px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.26), transparent 34%),
    radial-gradient(circle at 80% 14%, rgba(34, 211, 238, 0.14), transparent 28%),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.88), rgba(15, 23, 42, 0.96));
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1240px, calc(100% - 28px));
  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-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-logo {
  font-size: 26px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.36);
}

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

.desktop-nav a,
.mobile-nav a {
  color: #dbeafe;
  font-size: 15px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: var(--accent);
}

.top-search,
.search-page-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.search-page-form input,
.local-filter input {
  width: 260px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 11px 16px;
  color: var(--text);
  outline: none;
  background: rgba(15, 23, 42, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.search-page-form input:focus,
.local-filter input:focus {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.top-search button,
.search-page-form button,
.primary-button,
.ghost-button,
.section-link {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-search button:hover,
.search-page-form button:hover,
.primary-button:hover,
.ghost-button:hover,
.section-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.36);
}

.ghost-button {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

.mobile-menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

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

.hero {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.78)),
    radial-gradient(circle at 28% 42%, rgba(56, 189, 248, 0.18), transparent 32%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 72px 0 86px;
}

.hero-kicker,
.kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1;
  letter-spacing: -0.07em;
  text-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  max-width: 680px;
  margin: 24px 0 0;
  color: #dbeafe;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.7;
}

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

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

.hero-tags span,
.tag-row span,
.detail-meta span,
.card-meta span {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 6px 10px;
  color: #dbeafe;
  font-size: 13px;
  background: rgba(15, 23, 42, 0.72);
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  background: rgba(15, 23, 42, 0.66);
  transform: translateY(-50%);
}

.hero-arrow.prev {
  left: 22px;
}

.hero-arrow.next {
  right: 22px;
}

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

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.hero-dot.active {
  width: 32px;
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
}

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

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

.section-heading h2,
.panel-title h2 {
  margin: 0;
  font-size: clamp(26px, 3.5vw, 40px);
  letter-spacing: -0.04em;
}

.section-heading p,
.panel-title p,
.page-hero p,
.detail-info p,
.text-card p,
.category-card-large p,
.site-footer p {
  color: var(--muted);
  line-height: 1.75;
}

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

.category-tile,
.category-card-large,
.text-card,
.rank-panel,
.movie-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.64));
  box-shadow: var(--shadow);
}

.category-tile {
  min-height: 182px;
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-4px);
}

.category-tile strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.category-tile p {
  min-height: 48px;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.category-tile div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tile span,
.category-links a {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  color: #bfdbfe;
  font-size: 12px;
  background: rgba(37, 99, 235, 0.18);
}

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

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
}

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

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

.movie-card:hover {
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: 0 24px 60px rgba(8, 47, 73, 0.36);
  transform: translateY(-6px);
}

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

.poster-frame img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.movie-card:hover .poster-frame img {
  filter: saturate(1.1) brightness(1.05);
  transform: scale(1.05);
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  box-shadow: 0 12px 26px rgba(244, 63, 94, 0.34);
}

.card-body {
  padding: 16px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.card-meta span {
  padding: 4px 8px;
  font-size: 12px;
}

.movie-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card p {
  min-height: 62px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.compact-card h2 {
  font-size: 16px;
}

.compact-card p {
  min-height: 42px;
  font-size: 13px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  align-items: start;
}

.rank-panel {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.wide-panel {
  position: static;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 62px 56px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-number {
  color: var(--gold);
  font-weight: 800;
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-year,
.rank-score {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.page-shell,
.detail-shell {
  padding: 34px 0 72px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: #bfdbfe;
}

.breadcrumb a::after {
  content: "/";
  margin-left: 10px;
  color: rgba(148, 163, 184, 0.42);
}

.page-hero {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: clamp(30px, 6vw, 70px);
  background:
    radial-gradient(circle at 86% 18%, rgba(34, 211, 238, 0.2), transparent 28%),
    linear-gradient(120deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.38));
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.slim-hero,
.ranking-hero,
.search-hero {
  background:
    radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.18), transparent 28%),
    linear-gradient(120deg, rgba(15, 23, 42, 0.98), rgba(37, 99, 235, 0.36));
}

.page-hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

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

.local-filter {
  margin-top: 24px;
}

.local-filter input {
  width: min(520px, 100%);
}

.category-list-large {
  display: grid;
  gap: 22px;
  margin-top: 34px;
}

.category-card-large {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 18px;
}

.category-cover {
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 16 / 10;
  background: #0f172a;
}

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

.category-card-large h2 {
  margin: 0;
  font-size: 30px;
}

.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 28px;
  background:
    radial-gradient(circle at 80% 16%, rgba(34, 211, 238, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.68));
  box-shadow: var(--shadow);
}

.detail-poster {
  overflow: hidden;
  border-radius: 26px;
  aspect-ratio: 2 / 3;
  background: #0f172a;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.44);
}

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

.detail-info h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.lead-text {
  max-width: 820px;
  margin: 18px 0;
  font-size: 18px;
}

.detail-meta {
  margin: 22px 0;
}

.genre-row span {
  border-color: rgba(34, 211, 238, 0.28);
  color: #a5f3fc;
  background: rgba(8, 145, 178, 0.12);
}

.player-section {
  margin-top: 34px;
}

.player-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 30px;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: var(--shadow);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: rgba(2, 6, 23, 0.52);
}

.player-overlay img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.player-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14), rgba(2, 6, 23, 0.74));
}

.play-pulse {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 34px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 0 0 18px rgba(56, 189, 248, 0.12), 0 18px 46px rgba(0, 0, 0, 0.42);
}

.player-overlay strong {
  position: relative;
  z-index: 2;
  margin-top: 126px;
  font-size: 22px;
}

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

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.text-card {
  padding: 26px;
}

.text-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.text-card p {
  margin: 0;
  font-size: 16px;
}

.search-page-form {
  margin-top: 24px;
  align-items: stretch;
}

.search-page-form input {
  width: min(560px, 100%);
}

.site-footer {
  margin-top: 84px;
  border-top: 1px solid var(--line);
  padding: 42px 0;
  background: rgba(2, 6, 23, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 220px;
  gap: 30px;
}

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

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

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

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

[hidden] {
  display: none !important;
}

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

  .mobile-menu-button {
    display: inline-flex;
  }

  .header-inner {
    gap: 14px;
  }

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

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

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

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

  .rank-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .container,
  .header-inner,
  .mobile-nav {
    width: min(100% - 22px, 1200px);
  }

  .header-inner {
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .site-logo {
    font-size: 21px;
  }

  .top-search {
    order: 3;
    width: 100%;
  }

  .top-search input {
    width: 100%;
  }

  .hero,
  .hero-content {
    min-height: 620px;
  }

  .hero-content {
    padding-top: 52px;
  }

  .hero-arrow {
    display: none;
  }

  .category-grid,
  .category-card-large,
  .detail-hero,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .movie-card p {
    min-height: auto;
  }

  .card-body {
    padding: 12px;
  }

  .detail-hero,
  .page-hero {
    border-radius: 24px;
    padding: 20px;
  }

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

  .player-wrap {
    border-radius: 20px;
  }

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

  .rank-score {
    display: none;
  }
}

@media (max-width: 460px) {
  .movie-grid,
  .compact-grid,
  .horizontal-grid {
    grid-template-columns: 1fr;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-info h1 {
    letter-spacing: -0.04em;
  }

  .hero-actions,
  .search-page-form {
    width: 100%;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .search-page-form button {
    width: 100%;
    text-align: center;
  }
}
