:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eff6ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #f97316;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%, #f1f5f9 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.28);
}

.brand-text {
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.nav-link {
  color: #334155;
  font-size: 15px;
  font-weight: 650;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--brand);
}

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

.header-search input,
.mobile-nav input,
.toolbar input,
.hero-search-panel input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

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

.header-search button,
.mobile-nav button,
.hero-search-panel button {
  border: 0;
  color: #fff;
  background: var(--brand);
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.menu-button {
  display: none;
  border: 0;
  color: var(--text);
  background: #f1f5f9;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 20px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px 16px;
}

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

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  font-weight: 650;
}

.mobile-nav form {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.mobile-nav input {
  padding: 12px 14px;
}

main,
.page-main,
.detail-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  padding: 38px 0 18px;
}

.hero-shell {
  position: relative;
  overflow: hidden;
  min-height: 570px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #dbeafe 0%, #1e293b 60%, #020617 100%);
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: center;
  padding: 70px 76px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.22;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px) saturate(1.12);
}

.hero-bg::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(30, 64, 175, 0.55), rgba(2, 6, 23, 0.92));
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
}

.hero-kicker {
  margin: 0 0 14px;
  color: #bfdbfe;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.hero-content h1,
.detail-info h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-summary {
  max-width: 650px;
  margin: 22px 0;
  color: #e2e8f0;
  font-size: 18px;
  line-height: 1.8;
}

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

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
}

.hero .tag-row span,
.detail-hero .tag-row span {
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

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

.primary-button,
.ghost-button,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 850;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.35);
}

.ghost-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.section-more {
  color: var(--brand);
  background: #eff6ff;
}

.hero-poster {
  position: relative;
  z-index: 2;
  overflow: hidden;
  height: 455px;
  border-radius: 28px;
  background: linear-gradient(135deg, #1e3a8a, #f97316);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

.hero-poster img,
.poster-frame img,
.detail-poster img,
.rank-thumb img,
.category-cover-stack img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.image-hidden {
  opacity: 0;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 34px;
  transform: translateY(-50%);
  cursor: pointer;
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

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

.hero-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

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

.hero-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: -36px 34px 0;
  padding: 22px;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
}

.hero-search-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 850;
}

.hero-search-panel form > div {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.hero-search-panel input {
  padding: 14px 18px;
  font-size: 16px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-links a {
  padding: 11px 14px;
  color: #334155;
  background: #f1f5f9;
  border-radius: 999px;
  font-weight: 750;
}

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

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

.section-title-row h2,
.detail-copy h2,
.category-overview-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-title-row p,
.category-overview-card p,
.card-line,
.card-meta,
.page-hero p,
.detail-one-line,
.detail-copy p,
.rank-info p,
.site-footer p {
  color: var(--muted);
  line-height: 1.75;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 45px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.14);
}

.movie-card:hover .cover-image {
  transform: scale(1.06);
}

.poster-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5.6;
  background: radial-gradient(circle at 20% 20%, #93c5fd, #1e3a8a 52%, #020617);
}

.poster-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 850;
}

.card-body h3 a:hover,
.rank-info h2 a:hover,
.category-overview-card h2 a:hover {
  color: var(--brand);
}

.card-meta {
  margin: 0 0 8px;
  font-size: 13px;
}

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

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

.category-tile {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

.category-tile span {
  color: var(--brand);
  font-weight: 850;
}

.category-tile strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.page-main {
  padding-top: 36px;
}

.page-hero {
  padding: 52px;
  border-radius: 30px;
  color: #fff;
  background: radial-gradient(circle at 20% 20%, #60a5fa, #1e3a8a 52%, #0f172a);
  box-shadow: var(--shadow);
}

.compact-hero {
  min-height: 260px;
}

.page-hero > p:first-child {
  margin: 0 0 10px;
  color: #bfdbfe;
  font-weight: 850;
}

.page-hero > p:last-child {
  max-width: 760px;
  color: #e2e8f0;
  font-size: 18px;
}

.title-line {
  width: 76px;
  height: 5px;
  margin: 22px 0;
  background: #f97316;
  border-radius: 999px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.toolbar label {
  display: grid;
  gap: 8px;
  width: min(100%, 520px);
  color: var(--text);
  font-weight: 850;
}

.wide-toolbar label {
  width: 100%;
}

.toolbar input {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

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

.category-overview-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 45px rgba(15, 23, 42, 0.08);
}

.category-cover-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbeafe, #1e3a8a);
}

.category-cover-stack img {
  aspect-ratio: 1 / 1.15;
}

.category-overview-card strong {
  color: var(--brand);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 72px 86px minmax(0, 1fr) 62px;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.06);
}

.rank-index {
  color: var(--brand);
  font-size: 26px;
  font-weight: 900;
  text-align: center;
}

.rank-thumb {
  overflow: hidden;
  height: 112px;
  border-radius: 14px;
  background: linear-gradient(135deg, #bfdbfe, #1e3a8a);
}

.rank-info h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
}

.rank-info p {
  margin: 0 0 8px;
}

.rank-info span {
  color: var(--muted);
  font-size: 14px;
}

.rank-row > strong {
  color: #f97316;
  font-size: 20px;
  font-weight: 900;
}

.detail-main {
  padding-top: 28px;
}

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

.breadcrumb a:hover {
  color: var(--brand);
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  border-radius: 30px;
  color: #fff;
  background: radial-gradient(circle at 20% 20%, #3b82f6, #1e3a8a 50%, #0f172a 100%);
  box-shadow: var(--shadow);
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 4 / 5.6;
  border-radius: 24px;
  background: linear-gradient(135deg, #bfdbfe, #1e3a8a);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

.detail-info h1 {
  color: #fff;
}

.detail-one-line {
  max-width: 780px;
  color: #e2e8f0;
  font-size: 19px;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
}

.player-shell video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 14px;
  place-items: center;
  padding: 24px;
  border: 0;
  color: #fff;
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.35), rgba(2, 6, 23, 0.84));
  cursor: pointer;
}

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

.play-icon {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  padding-left: 5px;
  color: var(--brand);
  background: #fff;
  border-radius: 999px;
  font-size: 36px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.player-cover strong {
  font-size: clamp(20px, 4vw, 34px);
}

.detail-copy {
  margin-top: 34px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(15, 23, 42, 0.06);
}

.detail-copy p {
  margin: 0 0 24px;
  font-size: 17px;
}

.related-section {
  padding-bottom: 24px;
}

.site-footer {
  margin-top: 68px;
  padding: 42px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1fr;
  gap: 30px;
  max-width: 1220px;
  margin: 0 auto;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 900;
}

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

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

[data-card].is-hidden {
  display: none;
}

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

  .menu-button {
    display: inline-grid;
  }

  .header-inner {
    justify-content: space-between;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 54px 42px;
  }

  .hero-poster {
    display: none;
  }

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

  .hero-search-panel,
  .detail-hero,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  main,
  .page-main,
  .detail-main {
    padding: 0 14px;
  }

  .brand-text {
    font-size: 18px;
  }

  .hero {
    padding-top: 20px;
  }

  .hero-shell {
    min-height: 620px;
    border-radius: 22px;
  }

  .hero-slide {
    padding: 46px 24px;
  }

  .hero-summary {
    font-size: 16px;
  }

  .hero-search-panel {
    grid-template-columns: 1fr;
    margin: 14px 0 0;
  }

  .hero-search-panel form > div {
    flex-direction: column;
    border-radius: 18px;
  }

  .hero-search-panel button {
    min-height: 44px;
  }

  .section-title-row,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 16px;
  }

  .card-line {
    display: none;
  }

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

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

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

  .rank-row > strong {
    grid-column: 3;
  }

  .rank-thumb {
    height: 92px;
  }

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

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

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

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

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