:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eef6ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --nav: #0f172a;
  --accent: #38bdf8;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body.search-open {
  overflow-x: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #0f172a, #1e293b 50%, #0f172a);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
}

.nav-shell {
  max-width: 1240px;
  height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-size: 21px;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 12px;
  color: #cbd5e1;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

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

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  padding: 8px 12px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  backdrop-filter: blur(10px);
}

.search-box span {
  font-size: 13px;
  color: #93c5fd;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
}

.search-box input::placeholder {
  color: #94a3b8;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-nav {
  display: none;
  padding: 12px 24px 18px;
  border-top: 1px solid rgba(226, 232, 240, 0.16);
  background: #1e293b;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  color: #e2e8f0;
}

.search-results {
  position: absolute;
  top: 66px;
  right: max(24px, calc((100vw - 1240px) / 2 + 24px));
  width: min(420px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--text);
  display: none;
}

.search-results.is-open {
  display: block;
}

.search-results a {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.search-results img {
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}

.search-results strong {
  display: block;
  margin-bottom: 4px;
}

.search-results span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

main {
  min-height: 70vh;
}

.hero-carousel {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background: #0f172a;
  color: #ffffff;
}

.hero-stage {
  min-height: 640px;
  position: relative;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.15);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 35%, rgba(59, 130, 246, 0.25), transparent 32%), linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.28) 45%, rgba(15, 23, 42, 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  min-height: 640px;
  margin: 0 auto;
  padding: 88px 24px 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 54px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-copy h1 {
  font-size: clamp(42px, 7vw, 76px);
}

.hero-line {
  max-width: 680px;
  margin: 22px 0 20px;
  font-size: clamp(18px, 2.2vw, 24px);
  color: #e2e8f0;
}

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

.hero-tags span,
.detail-tags span,
.card-tags span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span,
.detail-tags span {
  padding: 6px 11px;
}

.card-tags span {
  padding: 4px 8px;
}

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

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

.primary-button {
  padding: 0 22px;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.3);
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--primary-dark);
}

.ghost-button {
  padding: 0 20px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.text-button {
  color: #bfdbfe;
}

.text-button:hover {
  color: #ffffff;
}

.hero-poster {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  overflow: hidden;
  transform: rotate(2deg);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.hero-poster img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-prev,
.hero-next,
.hero-dot {
  border: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.hero-prev,
.hero-next {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  padding: 0;
}

.hero-dot.is-active {
  width: 30px;
  background: #60a5fa;
}

.feature-section,
.content-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px;
}

.feature-section {
  padding-top: 86px;
}

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

.section-heading.centered {
  display: block;
  text-align: center;
  max-width: 740px;
  margin: 0 auto 36px;
}

.section-heading span {
  color: var(--primary);
  font-weight: 800;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
}

.section-heading p {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 17px;
}

.section-link {
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--primary);
  background: #ffffff;
}

.section-link:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.12);
}

.feature-grid,
.category-grid,
.movie-grid,
.rank-grid {
  display: grid;
  gap: 22px;
}

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

.feature-card,
.category-tile,
.movie-card,
.rank-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.feature-card {
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover,
.category-tile:hover,
.movie-card:hover,
.rank-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 24px;
  font-weight: 900;
}

.feature-card h3,
.movie-card h3,
.rank-card h3 {
  margin: 16px 0 8px;
  line-height: 1.3;
}

.feature-card p,
.movie-card p,
.rank-card p,
.category-tile span,
.detail-text-block p {
  color: var(--muted);
}

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

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

.category-tile {
  display: grid;
  gap: 10px;
  min-height: 154px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile strong {
  font-size: 23px;
}

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

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

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #dbeafe;
}

.poster-link img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.06);
}

.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.0);
  font-size: 42px;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.movie-card:hover .play-badge {
  opacity: 1;
  background: rgba(15, 23, 42, 0.32);
}

.poster-year {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.75);
  font-size: 12px;
  font-weight: 800;
}

.movie-card-body {
  padding: 16px;
}

.movie-card h3 {
  margin-top: 12px;
  font-size: 18px;
}

.movie-card h3 a:hover,
.rank-card h3 a:hover {
  color: var(--primary);
}

.movie-card p {
  display: -webkit-box;
  min-height: 48px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0 0 14px;
  font-size: 14px;
}

.card-meta,
.rank-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

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

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

.rank-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-poster {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.rank-poster img {
  height: 126px;
  object-fit: cover;
}

.rank-poster span {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  font-weight: 900;
}

.rank-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.rank-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 12px;
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-hero {
  color: #ffffff;
  background: radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.34), transparent 34%), linear-gradient(135deg, #0f172a, #1e3a8a 55%, #111827);
}

.compact-hero {
  max-width: none;
  min-height: 320px;
  padding: 86px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.compact-hero > div {
  max-width: 820px;
}

.compact-hero h1 {
  font-size: clamp(40px, 6vw, 64px);
}

.compact-hero p {
  margin: 18px auto 0;
  color: #dbeafe;
  font-size: 18px;
}

.local-filter {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.local-filter input,
.local-filter select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #ffffff;
  outline: 0;
}

.local-filter input {
  flex: 1;
}

.local-filter input:focus,
.local-filter select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px #dbeafe;
}

.movie-card.is-hidden {
  display: none;
}

.breadcrumb {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--primary);
  font-weight: 700;
}

.detail-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 42px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border-radius: 30px;
  box-shadow: var(--shadow);
  background: #dbeafe;
}

.detail-poster img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.detail-info h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 62px);
}

.detail-line {
  margin: 0 0 20px;
  color: #334155;
  font-size: 20px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 28px;
}

.detail-meta div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.detail-meta dt {
  color: var(--muted);
  font-size: 13px;
}

.detail-meta dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.player-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 54px;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000000;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.25);
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.18));
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-start {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  font-size: 34px;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.4);
}

.detail-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

.detail-text-block {
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.detail-text-block h2 {
  margin: 0 0 16px;
  font-size: 26px;
}

.detail-text-block p {
  margin: 0 0 12px;
  font-size: 17px;
}

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

.site-footer {
  margin-top: 40px;
  color: #cbd5e1;
  background: linear-gradient(180deg, #0f172a, #020617);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 24px;
  display: flex;
  justify-content: space-between;
  gap: 26px;
}

.footer-brand {
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.footer-inner p {
  max-width: 560px;
  margin: 10px 0 0;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: start;
}

.footer-copy {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  border-top: 1px solid rgba(226, 232, 240, 0.12);
  color: #94a3b8;
  font-size: 14px;
}

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

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

  .search-box {
    width: 220px;
  }

  .hero-content {
    grid-template-columns: 1fr 280px;
  }

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

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

@media (max-width: 820px) {
  .nav-shell {
    height: auto;
    min-height: 72px;
    align-items: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand-text small {
    display: none;
  }

  .nav-actions {
    margin-left: auto;
  }

  .search-box {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 78px;
    width: auto;
    background: #1e293b;
  }

  .site-header {
    padding-bottom: 66px;
  }

  .search-results {
    top: 132px;
    left: 16px;
    right: 16px;
    width: auto;
  }

  .hero-carousel,
  .hero-stage {
    min-height: 760px;
  }

  .hero-content {
    min-height: 760px;
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 62px;
  }

  .hero-poster {
    max-width: 240px;
    transform: none;
  }

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

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

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

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

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .nav-shell,
  .feature-section,
  .content-section,
  .detail-hero,
  .player-section,
  .detail-content,
  .breadcrumb {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-content {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .hero-actions,
  .local-filter,
  .footer-links {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .ghost-button,
  .section-link {
    width: 100%;
  }

  .rank-card {
    grid-template-columns: 86px 1fr;
  }

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