:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eff6ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --cyan: #06b6d4;
  --accent: #f97316;
  --danger: #ef4444;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.topbar {
  width: min(1240px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand {
  font-size: 22px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.3);
  font-size: 14px;
}

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

.nav-links a,
.mobile-links a {
  color: #334155;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

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

.header-search,
.mobile-search,
.big-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.big-search input,
.filter-panel input,
.filter-panel select {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.header-search button,
.mobile-search button,
.big-search button,
.primary-button,
.ghost-button,
.section-heading a {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button,
.mobile-search button,
.big-search button,
.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.25);
}

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

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

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

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

.mobile-search input {
  flex: 1;
  padding: 11px 12px;
}

.mobile-search button {
  padding: 11px 16px;
}

.mobile-links {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mobile-links a {
  display: block;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 14px;
}

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

.hero-stage,
.hero-slide {
  position: absolute;
  inset: 0;
}

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

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

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 18%, rgba(6, 182, 212, 0.36), transparent 34%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.9), rgba(15, 23, 42, 0.66) 45%, rgba(15, 23, 42, 0.14));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 32px));
  min-height: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
  margin-left: max(16px, calc((100vw - 1240px) / 2));
  padding: 70px 0 96px;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.32);
  border: 1px solid rgba(147, 197, 253, 0.4);
  backdrop-filter: blur(14px);
  font-size: 14px;
  font-weight: 800;
}

.hero-content h1,
.page-hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p {
  margin: 0;
  color: #dbeafe;
  font-size: clamp(17px, 2vw, 22px);
  max-width: 760px;
}

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

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

.tag,
.genre-row span,
.detail-tags span,
.detail-tags a {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.hero-tags .tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(12px);
}

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

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
}

.ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
}

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

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

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

.hero-dot.is-active {
  width: 38px;
  background: #fff;
}

.quick-search-panel,
.content-section,
.page-hero,
.breadcrumb,
.detail-layout {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.quick-search-panel {
  position: relative;
  z-index: 4;
  margin-top: -54px;
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.quick-search-panel h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.quick-search-panel p {
  margin: 0 0 20px;
  color: var(--muted);
}

.big-search input {
  flex: 1;
  min-width: 0;
  padding: 15px 16px;
}

.big-search button {
  padding: 15px 24px;
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-heading a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 11px 16px;
  color: var(--primary);
  background: #dbeafe;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  border: 1px solid #dbeafe;
  box-shadow: var(--soft-shadow);
}

.category-card strong,
.category-card span:last-child {
  position: relative;
  z-index: 2;
  display: block;
}

.category-card strong {
  margin-bottom: 10px;
  font-size: 22px;
}

.category-card span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.category-glow {
  position: absolute;
  width: 112px;
  height: 112px;
  right: -28px;
  top: -28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(6, 182, 212, 0.22));
}

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

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

.movie-card {
  min-width: 0;
}

.movie-card-link {
  display: block;
  overflow: hidden;
  height: 100%;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #e2e8f0;
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.72));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0.86);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.movie-card-link:hover .poster-shade,
.movie-card-link:hover .poster-play {
  opacity: 1;
}

.movie-card-link:hover .poster-play {
  transform: translate(-50%, -50%) scale(1);
}

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

.movie-card-body {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.movie-card-body strong {
  font-size: 18px;
  line-height: 1.35;
}

.card-line {
  min-height: 45px;
  color: var(--muted);
  font-size: 14px;
}

.card-meta {
  color: #475569;
  font-size: 12px;
}

.card-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

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

.rank-item {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.rank-link {
  display: grid;
  grid-template-columns: 58px 118px 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--danger), var(--accent));
  font-weight: 900;
}

.rank-cover {
  overflow: hidden;
  height: 76px;
  border-radius: 14px;
  background: #e2e8f0;
}

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

.rank-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.rank-copy strong {
  font-size: 17px;
}

.rank-copy span,
.rank-copy em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.page-main {
  padding-bottom: 74px;
}

.page-hero {
  margin-top: 36px;
  padding: 64px;
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 70% 20%, rgba(125, 211, 252, 0.42), transparent 32%),
    linear-gradient(135deg, #1d4ed8, #0891b2);
  box-shadow: var(--shadow);
}

.soft-hero {
  background:
    radial-gradient(circle at 78% 28%, rgba(147, 197, 253, 0.55), transparent 30%),
    linear-gradient(135deg, #2563eb, #06b6d4);
}

.rank-hero {
  background:
    radial-gradient(circle at 70% 20%, rgba(251, 146, 60, 0.42), transparent 32%),
    linear-gradient(135deg, #991b1b, #ea580c);
}

.category-hero {
  background:
    radial-gradient(circle at 72% 18%, rgba(56, 189, 248, 0.38), transparent 35%),
    linear-gradient(135deg, #0f172a, #2563eb);
}

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

.category-overview-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 28px;
  box-shadow: var(--soft-shadow);
  background: #0f172a;
}

.category-overview-card img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.category-overview-card:hover img {
  transform: scale(1.08);
}

.overview-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.84));
}

.overview-copy {
  position: absolute;
  inset-inline: 20px;
  bottom: 20px;
  color: #fff;
}

.overview-copy strong,
.overview-copy em {
  display: block;
}

.overview-copy strong {
  font-size: 24px;
  margin-bottom: 8px;
}

.overview-copy em {
  color: #dbeafe;
  font-style: normal;
  font-size: 14px;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 170px 170px;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  padding: 12px 14px;
}

.empty-state {
  display: none;
  padding: 42px;
  color: var(--muted);
  text-align: center;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.empty-state.is-visible {
  display: block;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.86fr);
  gap: 28px;
  margin-top: 24px;
}

.detail-primary {
  display: grid;
  gap: 22px;
}

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

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

.play-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.34), rgba(15, 23, 42, 0.68));
  cursor: pointer;
}

.play-layer span {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.28);
  font-size: 30px;
}

.play-layer.is-hidden {
  display: none;
}

.detail-card,
.aside-card {
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.detail-card {
  padding: clamp(22px, 4vw, 36px);
}

.detail-tags {
  margin-bottom: 18px;
}

.detail-card h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

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

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.detail-meta span {
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.detail-card section {
  margin-top: 26px;
}

.detail-card h2,
.aside-card h2 {
  margin: 0 0 12px;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.detail-card p {
  margin: 0;
  color: #334155;
  font-size: 16px;
}

.genre-row span {
  color: #0f766e;
  background: #ccfbf1;
}

.detail-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}

.detail-nav a {
  display: block;
  padding: 14px;
  border-radius: 16px;
  color: var(--primary);
  background: #eff6ff;
  font-weight: 800;
}

.detail-aside {
  display: grid;
  align-content: start;
  gap: 22px;
}

.aside-card {
  padding: 20px;
}

.poster-side img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 20px;
  background: #e2e8f0;
}

.poster-side strong,
.poster-side span {
  display: block;
}

.poster-side strong {
  margin-top: 14px;
  font-size: 22px;
}

.poster-side span {
  color: var(--muted);
}

.aside-grid {
  display: grid;
  gap: 14px;
}

.aside-grid .movie-card-link {
  display: grid;
  grid-template-columns: 118px 1fr;
}

.aside-grid .poster-frame {
  height: 100%;
  aspect-ratio: auto;
}

.aside-grid .card-line {
  min-height: 0;
}

.site-footer {
  margin-top: 74px;
  padding: 54px 0 22px;
  color: #cbd5e1;
  background: #0f172a;
}

.footer-grid {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 30px;
}

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

.site-footer p {
  margin: 12px 0 0;
  color: #94a3b8;
}

.site-footer a {
  display: block;
  margin: 7px 0;
  color: #cbd5e1;
}

.site-footer a:hover {
  color: #38bdf8;
}

.footer-brand {
  color: #fff;
  font-size: 20px;
}

.footer-bottom {
  width: min(1240px, calc(100% - 32px));
  margin: 34px auto 0;
  padding-top: 22px;
  border-top: 1px solid #1e293b;
  color: #94a3b8;
  text-align: center;
}

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

  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

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

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

@media (max-width: 760px) {
  .topbar {
    height: 62px;
  }

  .brand {
    font-size: 19px;
  }

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

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

  .quick-search-panel {
    padding: 20px;
  }

  .big-search,
  .section-heading,
  .filter-panel,
  .detail-nav {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  .page-hero {
    padding: 36px 22px;
  }

  .rank-link {
    grid-template-columns: 46px 92px 1fr;
    gap: 10px;
  }

  .rank-cover {
    height: 68px;
  }

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

  .aside-grid .movie-card-link {
    grid-template-columns: 108px 1fr;
  }
}

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

  .hero-actions {
    display: grid;
  }

  .card-line {
    min-height: 0;
  }

  .rank-link {
    grid-template-columns: 42px 1fr;
  }

  .rank-cover {
    display: none;
  }
}
