:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --soft-blue: #eff6ff;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.header-shell {
  width: min(1180px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
}

.brand-text,
.footer-brand {
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link,
.mobile-link {
  font-weight: 650;
  color: #475569;
  transition: color 0.2s ease, background 0.2s ease;
}

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

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #f1f5f9;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #334155;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
}

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

.mobile-link {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
}

main {
  min-height: 70vh;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: opacity 0.6s ease, transform 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay,
.detail-hero-mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 25%, rgba(6, 182, 212, 0.28), transparent 34%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.62) 48%, rgba(15, 23, 42, 0.2) 100%);
}

.hero-content {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 80px;
  color: #ffffff;
}

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

.hero-content h1,
.page-hero h1,
.detail-hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p,
.detail-hero p {
  max-width: 720px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255, 255, 255, 0.82);
}

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

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

.hero-tags span,
.card-tags span,
.detail-tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.86rem;
}

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

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.34);
}

.ghost-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
}

.ghost-button.dark {
  color: var(--blue);
  background: #eff6ff;
  border-color: #bfdbfe;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.primary-button.full,
.ghost-button.full {
  width: 100%;
  margin-top: 12px;
}

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

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

.hero-dot.active {
  width: 28px;
  background: #ffffff;
}

.hero-search {
  position: absolute;
  left: 50%;
  bottom: 40px;
  z-index: 4;
  width: min(760px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-search label,
.search-control label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 800;
}

.hero-search div,
.search-control {
  display: flex;
  gap: 10px;
}

.hero-search input,
.search-control input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 0 16px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.hero-search input:focus,
.search-control input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.hero-search button {
  min-width: 96px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.content-section,
.soft-section,
.page-shell,
.detail-layout,
.player-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.content-section,
.soft-section {
  padding: 72px 0;
}

.soft-section {
  width: 100%;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.soft-section > .section-heading,
.soft-section > .category-grid {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading h2,
.side-panel h2,
.related-panel h2,
.detail-content-card h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-heading p,
.side-panel p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
}

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

.movie-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.card-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 70% 20%, rgba(6, 182, 212, 0.24), transparent 34%),
    linear-gradient(135deg, #1e3a8a, #0f172a);
  background-size: cover;
  background-position: center;
}

.card-poster::after,
.rank-cover::after,
.category-tile::after,
.category-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(15, 23, 42, 0.56));
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.7);
  font-weight: 900;
  font-size: 0.85rem;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.card-body strong {
  font-size: 1.12rem;
  line-height: 1.35;
}

.card-meta,
.card-desc {
  color: var(--muted);
  font-size: 0.94rem;
}

.card-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-tags {
  margin-top: auto;
  padding-top: 8px;
}

.card-tags span,
.detail-tag-cloud span {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #dbeafe;
}

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

.category-tile {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.28), transparent 36%),
    linear-gradient(135deg, #1d4ed8, #0f172a);
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.15);
}

.category-tile span {
  position: absolute;
  inset: auto 16px 16px;
  z-index: 2;
  color: #ffffff;
}

.category-tile strong,
.category-tile em {
  display: block;
}

.category-tile strong {
  font-size: 1.25rem;
  font-weight: 900;
}

.category-tile em {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-style: normal;
  font-size: 0.9rem;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 34px;
  align-items: start;
}

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

.rank-item {
  display: grid;
  grid-template-columns: auto 126px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.rank-number {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 900;
}

.rank-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 65% 20%, rgba(6, 182, 212, 0.22), transparent 35%),
    linear-gradient(135deg, #1e3a8a, #0f172a);
  background-size: cover;
  background-position: center;
}

.rank-info {
  min-width: 0;
}

.rank-info strong,
.rank-info em,
.rank-info small {
  display: block;
}

.rank-info strong {
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info em {
  color: var(--blue);
  font-style: normal;
  font-size: 0.9rem;
  margin: 2px 0 4px;
}

.rank-info small {
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.side-panel,
.related-panel,
.detail-content-card {
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.side-panel {
  padding: 28px;
}

.sticky-panel {
  position: sticky;
  top: 96px;
}

.page-shell {
  padding-top: 96px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  display: flex;
  align-items: center;
  padding: 44px;
  border-radius: 32px;
  color: #ffffff;
  background:
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.36), transparent 32%),
    linear-gradient(135deg, #1d4ed8, #0f172a);
  box-shadow: var(--shadow);
}

.page-hero.small-hero,
.page-hero.category-hero,
.page-hero.search-hero,
.page-hero.ranking-hero {
  margin-top: 18px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.flush-top {
  padding-top: 52px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.breadcrumbs a:hover {
  color: #ffffff;
}

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

.category-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  min-height: 180px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card-cover {
  position: relative;
  background:
    radial-gradient(circle at 70% 20%, rgba(6, 182, 212, 0.24), transparent 34%),
    linear-gradient(135deg, #1e3a8a, #0f172a);
  background-size: cover;
  background-position: center;
}

.category-card-body {
  padding: 26px;
}

.category-card-body strong,
.category-card-body em {
  display: block;
}

.category-card-body strong {
  font-size: 1.5rem;
  font-weight: 900;
}

.category-card-body em {
  margin-top: 10px;
  color: var(--muted);
  font-style: normal;
}

.catalog-tools {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
  padding: 20px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.catalog-tools.stacked {
  gap: 22px;
}

.search-control {
  display: block;
}

.search-control.wide input {
  width: 100%;
}

.filter-groups {
  display: grid;
  gap: 18px;
}

.filter-group strong {
  display: block;
  margin-bottom: 10px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #334155;
  background: #f1f5f9;
  font-weight: 750;
}

.filter-chip:hover,
.filter-chip.active {
  color: #ffffff;
  background: var(--blue);
}

.detail-shell {
  padding-top: 72px;
}

.detail-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 75% 20%, rgba(6, 182, 212, 0.28), transparent 34%),
    linear-gradient(135deg, #1e3a8a, #0f172a);
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.detail-hero h1 {
  font-size: clamp(2.4rem, 6vw, 5.4rem);
}

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

.player-section {
  margin-top: -72px;
  position: relative;
  z-index: 3;
}

.movie-player {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  background: #020617;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.34);
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  border: 0;
  color: #ffffff;
  background:
    radial-gradient(circle at center, rgba(37, 99, 235, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0.82));
  text-align: center;
}

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

.play-circle {
  width: 82px;
  height: 82px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.42);
  font-size: 2rem;
  text-indent: 4px;
}

.player-overlay strong {
  max-width: min(680px, calc(100% - 40px));
  font-size: clamp(1.2rem, 3vw, 2rem);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 30px;
  padding: 52px 0 80px;
  align-items: start;
}

.detail-content-card,
.related-panel {
  padding: 30px;
}

.detail-content-card h2:not(:first-child) {
  margin-top: 30px;
}

.detail-content-card p {
  margin: 14px 0 0;
  color: #334155;
  font-size: 1.04rem;
}

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

.movie-facts div {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.movie-facts dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.movie-facts dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.detail-tag-cloud {
  margin-top: 22px;
}

.related-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.related-grid .movie-card {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
}

.related-grid .card-poster {
  aspect-ratio: auto;
  min-height: 132px;
}

.related-grid .card-body {
  padding: 14px;
}

.related-grid .card-tags {
  display: none;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mini-grid .movie-card {
  border-radius: 18px;
}

.mini-grid .card-body {
  padding: 12px;
}

.mini-grid .card-desc,
.mini-grid .card-tags,
.mini-grid .card-meta {
  display: none;
}

.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.footer-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
}

.footer-shell p {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
  color: #475569;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-copy {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .category-card-grid,
  .two-column-section,
  .detail-layout,
  .rankings-layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero-carousel {
    min-height: 680px;
  }

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

  .hero-search div {
    flex-direction: column;
  }

  .hero-search button {
    height: 46px;
  }

  .content-section,
  .soft-section {
    padding: 48px 0;
  }

  .movie-grid,
  .category-grid,
  .category-card-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

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

  .category-card-cover {
    min-height: 190px;
  }

  .rank-item {
    grid-template-columns: auto 96px minmax(0, 1fr);
    gap: 12px;
  }

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

  .page-hero {
    padding: 28px;
    border-radius: 24px;
  }

  .detail-hero {
    min-height: 500px;
  }

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

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

  .movie-facts {
    grid-template-columns: 1fr;
  }

  .related-grid .movie-card {
    grid-template-columns: 118px minmax(0, 1fr);
  }

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

  .footer-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .header-shell {
    height: 64px;
  }

  .brand-text {
    font-size: 1.15rem;
  }

  .hero-carousel {
    min-height: 640px;
  }

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

  .hero-dots {
    bottom: 162px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .page-shell,
  .detail-shell {
    padding-top: 76px;
  }

  .rank-item {
    grid-template-columns: 1fr;
  }

  .rank-cover {
    width: 100%;
  }

  .rank-number {
    position: absolute;
    z-index: 3;
    margin: 10px;
  }
}
