:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --teal: #0d9488;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --shadow: 0 10px 25px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(229, 231, 235, .86);
  backdrop-filter: blur(12px);
}

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

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
  font-size: 13px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.desktop-nav a,
.mobile-panel a {
  color: #374151;
  font-weight: 600;
  transition: color .2s ease;
}

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

.header-search {
  display: flex;
  align-items: center;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.header-search input,
.mobile-search input,
.hero-search input,
.filter-search input,
.filter-grid select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.header-search input {
  padding: 10px 12px 10px 16px;
}

.header-search button,
.mobile-search button,
.hero-search button {
  border: 0;
  color: #fff;
  background: var(--blue);
  padding: 10px 16px;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: #111827;
  border-radius: 4px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 16px;
  background: #fff;
}

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

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

.mobile-search {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

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

.home-hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background-color: #1e3a8a;
  background-size: cover;
  background-position: center;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% -10%;
  height: 55%;
  background: radial-gradient(circle at center, rgba(59, 130, 246, .38), transparent 64%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 32px));
  padding: 88px 0;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-hero .eyebrow {
  color: #bfdbfe;
}

.hero-inner h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -.04em;
}

.hero-subtitle {
  margin: 20px auto 0;
  max-width: 760px;
  color: #e5e7eb;
  font-size: clamp(18px, 2.2vw, 26px);
}

.hero-copy {
  margin: 14px auto 0;
  max-width: 760px;
  color: #d1d5db;
}

.hero-copy a {
  color: #bfdbfe;
  font-weight: 800;
}

.hero-search {
  width: min(680px, 100%);
  margin: 30px auto 0;
  display: flex;
  overflow: hidden;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
}

.hero-search input {
  padding: 16px 20px;
  color: #111827;
}

.hero-search button {
  padding: 16px 28px;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.primary-button,
.glass-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.primary-button,
.primary-link {
  color: #fff;
  background: var(--blue);
  padding: 13px 26px;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .24);
}

.primary-button:hover,
.primary-link:hover {
  transform: translateY(-2px);
  background: var(--blue-dark);
  box-shadow: 0 18px 36px rgba(37, 99, 235, .32);
}

.glass-button {
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .24);
  padding: 13px 26px;
  backdrop-filter: blur(10px);
}

.glass-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .28);
}

.glass-button.dark {
  color: var(--blue);
  border-color: var(--line);
  background: #fff;
}

.page-stack {
  padding: 48px 0 64px;
}

.section-block,
.category-overview,
.content-card,
.filter-panel {
  background: var(--card);
  border: 1px solid rgba(229, 231, 235, .86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-block,
.category-overview {
  margin-bottom: 42px;
  padding: 28px;
}

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

.section-head h2,
.category-overview h2,
.content-card h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -.025em;
}

.section-head a,
.section-head span {
  color: var(--blue);
  font-weight: 800;
}

.hot-section {
  background: linear-gradient(135deg, #fff7ed, #fef2f2);
}

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

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

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

.movie-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(37, 99, 235, .34);
  box-shadow: var(--shadow-lg);
}

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #1e40af, #0f766e);
}

.movie-cover img,
.wide-cover img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .32s ease;
}

.movie-card:hover .movie-cover img,
.wide-card:hover .wide-cover img {
  transform: scale(1.05);
}

.duration,
.type-badge,
.rank-badge,
.hot-number {
  position: absolute;
  z-index: 2;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.duration {
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, .74);
}

.type-badge {
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  background: rgba(37, 99, 235, .9);
}

.rank-badge {
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f97316, #dc2626);
}

.cover-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0);
  font-size: 48px;
  opacity: 0;
  transition: opacity .22s ease, background .22s ease;
}

.movie-card:hover .cover-play {
  opacity: 1;
  background: rgba(0, 0, 0, .32);
}

.movie-body {
  padding: 16px;
}

.movie-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.movie-body h3 {
  margin: 8px 0 8px;
  color: #111827;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
}

.movie-body h3 a:hover,
.wide-body h3 a:hover {
  color: var(--blue);
}

.movie-body p,
.wide-body p,
.category-overview span,
.content-card p {
  color: var(--muted);
}

.movie-body p {
  min-height: 45px;
  margin: 0 0 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  color: var(--blue);
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.large-tags span {
  padding: 7px 12px;
}

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

.wide-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
  transition: transform .22s ease, box-shadow .22s ease;
}

.wide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.wide-cover {
  position: relative;
  overflow: hidden;
  min-height: 130px;
}

.hot-number {
  left: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.wide-body {
  padding: 16px;
}

.wide-body h3 {
  margin: 10px 0;
  font-size: 20px;
  line-height: 1.25;
}

.wide-body p {
  margin: 0 0 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.category-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  color: #fff;
  border-radius: 18px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}

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

.category-card span,
.category-overview-head p {
  margin: 0 0 8px;
  font-weight: 800;
  color: #bfdbfe;
}

.category-card h3 {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 900;
}

.category-card p {
  margin: 0;
  color: #e5e7eb;
}

.page-hero {
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #0d9488);
}

.compact-hero {
  padding: 76px 0;
}

.compact-hero p:last-child {
  max-width: 760px;
  margin: 16px 0 0;
  color: #e5e7eb;
  font-size: 18px;
}

.rank-hero {
  background: linear-gradient(135deg, #7c2d12, #dc2626 55%, #ea580c);
}

.search-hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8 55%, #0f766e);
}

.category-overview-head {
  align-items: center;
}

.category-overview-head h2 {
  margin-bottom: 8px;
}

.filter-panel {
  margin-bottom: 24px;
  padding: 18px;
  background: #f8fafc;
}

.filter-search label,
.filter-grid span {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
}

.filter-search input,
.filter-grid select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.filter-count {
  margin: 14px 0 0;
  color: var(--muted);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 28px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue);
  font-weight: 800;
}

.detail-container {
  padding-bottom: 64px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 34px;
  align-items: center;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  box-shadow: var(--shadow);
  border: 1px solid rgba(219, 234, 254, .9);
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 20px;
  background: linear-gradient(135deg, #1e40af, #0f766e);
  box-shadow: var(--shadow-lg);
}

.detail-info h1 {
  color: #111827;
  font-size: clamp(34px, 5vw, 58px);
}

.detail-meta {
  margin-top: 18px;
}

.detail-meta span {
  color: #374151;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
}

.detail-one-line {
  margin: 22px 0;
  color: #374151;
  font-size: 19px;
}

.detail-actions {
  justify-content: flex-start;
}

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

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 9;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: radial-gradient(circle at center, rgba(37, 99, 235, .36), rgba(0, 0, 0, .68));
  transition: opacity .2s ease, visibility .2s ease;
}

.play-overlay span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 20px 50px rgba(37, 99, 235, .4);
  font-size: 30px;
}

.play-overlay strong {
  font-size: 20px;
}

.play-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.content-card {
  padding: 26px;
}

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

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

.site-footer {
  background: #111827;
  color: #d1d5db;
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 34px;
}

.footer-logo {
  color: #fff;
  margin-bottom: 14px;
}

.site-footer h3 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 18px;
}

.site-footer p {
  margin: 0;
  color: #9ca3af;
}

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

.site-footer a {
  color: #d1d5db;
}

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

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.footer-bottom {
  border-top: 1px solid rgba(75, 85, 99, .7);
  padding: 20px 16px;
  text-align: center;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 46px;
  height: 46px;
  display: none;
  border: 0;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 900;
}

.back-top.is-visible {
  display: block;
}

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

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

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

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

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

@media (max-width: 840px) {
  .site-header-inner {
    height: 64px;
  }

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

  .hero-search {
    border-radius: 20px;
    flex-direction: column;
  }

  .hero-search button {
    width: 100%;
  }

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

  .movie-grid,
  .featured-grid,
  .small-grid,
  .category-grid,
  .wide-grid,
  .filter-grid,
  .detail-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .detail-poster {
    width: min(320px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .container,
  .site-header-inner,
  .footer-grid {
    width: min(100% - 22px, 1280px);
  }

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

  .logo-mark {
    width: 30px;
    height: 30px;
  }

  .hero-inner {
    padding: 72px 0;
  }

  .section-block,
  .category-overview,
  .detail-hero {
    padding: 18px;
    border-radius: 16px;
  }

  .movie-grid,
  .featured-grid,
  .small-grid,
  .category-grid,
  .wide-grid,
  .filter-grid,
  .detail-content-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .wide-cover {
    aspect-ratio: 16 / 9;
  }

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

  .movie-card.compact .movie-cover {
    aspect-ratio: auto;
    min-height: 100%;
  }
}
