:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --nav-a: #0f172a;
  --nav-b: #1e293b;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--nav-a), var(--nav-b), var(--nav-a));
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.top-nav {
  max-width: 1240px;
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.36);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 600;
}

.nav-links a {
  color: #dbeafe;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-toggle {
  display: none;
  color: #ffffff;
  background: transparent;
  border: 0;
  font-size: 28px;
  cursor: pointer;
}

.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 520px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.35) 52%, rgba(0, 0, 0, 0.22));
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1240px, 100%);
  padding: 0 24px 76px;
  color: #ffffff;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 18px;
}

.hero-content h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 28px;
  color: #e5e7eb;
  font-size: 20px;
}

.hero-actions,
.quick-links,
.movie-meta-row,
.detail-meta,
.filter-tags,
.tag-cloud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.home-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn,
.home-search button {
  background: var(--brand);
  color: #ffffff;
  border: 0;
  cursor: pointer;
}

.primary-btn:hover,
.home-search button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.ghost-btn {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.hero-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: #ffffff;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-control.prev {
  left: 22px;
}

.hero-control.next {
  right: 22px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.quick-search-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  max-width: 1240px;
  margin: -34px auto 0;
  padding: 22px;
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.home-search input,
.catalog-search {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.home-search input:focus,
.catalog-search:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.quick-links a {
  padding: 10px 14px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  white-space: nowrap;
}

.page-wrap {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.inner-page {
  padding-top: 40px;
}

.content-section {
  margin: 70px 0;
}

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

.section-heading h2,
.split-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  font-weight: 900;
}

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

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.15);
}

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

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

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

.score-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #facc15;
  font-weight: 900;
  font-size: 13px;
}

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

.movie-meta-row span,
.detail-meta span,
.filter-tags button,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.movie-card h3 {
  margin: 12px 0 8px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 900;
  color: #0f172a;
}

.movie-card h3 a:hover {
  color: var(--brand);
}

.movie-card p {
  margin: 0;
  min-height: 52px;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.movie-card-large {
  position: relative;
}

.movie-card-large .poster-link {
  aspect-ratio: 16 / 8;
}

.movie-card-horizontal {
  display: grid;
  grid-template-columns: 42% 1fr;
  min-height: 180px;
}

.movie-card-horizontal .poster-link {
  aspect-ratio: auto;
  height: 100%;
}

.movie-rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 0 16px;
}

.rail-item {
  flex: 0 0 360px;
}

.rail-section {
  padding: 34px;
  border-radius: 26px;
  background: linear-gradient(90deg, #f1f5f9, #eff6ff);
}

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

.category-tile,
.category-card {
  min-height: 126px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.category-tile:hover,
.category-card:hover {
  transform: translateY(-3px);
}

.category-tile span,
.category-card span,
.page-hero span {
  display: inline-block;
  margin-bottom: 12px;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.category-tile strong,
.category-card h2 {
  display: block;
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

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

.split-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.split-heading a {
  color: var(--brand);
  font-weight: 800;
}

.page-hero {
  border-radius: 28px;
  padding: 54px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.1;
  font-weight: 900;
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
}

.filter-panel {
  display: grid;
  gap: 16px;
  margin: 34px 0;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

.filter-tags button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.filter-tags button.is-active,
.filter-tags button:hover {
  color: #ffffff;
  background: var(--brand);
}

.rank-list {
  display: grid;
  gap: 16px;
  margin: 36px 0;
}

.rank-row {
  display: grid;
  grid-template-columns: 112px 54px 1fr 72px;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.rank-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 16px;
  background: #0f172a;
}

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

.rank-number {
  color: #cbd5e1;
  font-size: 28px;
  font-weight: 900;
}

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

.rank-info h2 a:hover {
  color: var(--brand);
}

.rank-info p {
  margin: 0 0 10px;
  color: var(--muted);
}

.rank-score {
  color: #f59e0b;
  font-size: 28px;
  font-weight: 900;
  text-align: right;
}

.detail-page {
  background: #f8fafc;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 0;
}

.watch-main,
.watch-side,
.detail-article {
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-shell {
  position: relative;
  overflow: hidden;
  background: #000000;
  aspect-ratio: 16 / 9;
}

.movie-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-circle {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.44);
  font-size: 34px;
  text-indent: 4px;
}

.player-title {
  max-width: 80%;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.watch-info {
  padding: 24px;
}

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

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

.watch-info h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 900;
}

.watch-info p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
}

.watch-side {
  align-self: start;
  position: sticky;
  top: 88px;
  padding: 22px;
}

.watch-side h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 900;
}

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

.side-related {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 12px;
}

.side-related img {
  width: 112px;
  height: 70px;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
}

.side-related span {
  font-weight: 800;
  line-height: 1.35;
}

.side-related:hover span {
  color: var(--brand);
}

.detail-content {
  padding-top: 36px;
}

.detail-article {
  padding: 34px;
}

.detail-article h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 900;
}

.detail-article p {
  margin: 0 0 26px;
  color: #334155;
  font-size: 17px;
}

.tag-cloud {
  margin-top: 8px;
}

.site-footer {
  margin-top: 80px;
  background: #0f172a;
  color: #cbd5e1;
}

.footer-inner {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
}

.footer-inner p {
  max-width: 600px;
  margin: 14px 0 0;
  color: #94a3b8;
}

.footer-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 18px;
  color: #64748b;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 1024px) {
  .movie-grid,
  .category-grid,
  .category-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-grid,
  .feature-grid,
  .watch-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .watch-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .top-nav {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    padding: 12px 18px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-links.is-open {
    display: flex;
  }

  .hero-carousel {
    min-height: 560px;
    height: 74vh;
  }

  .hero-content {
    padding: 0 20px 74px;
  }

  .hero-content p {
    font-size: 17px;
  }

  .hero-control {
    width: 40px;
    height: 40px;
  }

  .quick-search-band,
  .home-search,
  .footer-inner,
  .rank-row {
    grid-template-columns: 1fr;
  }

  .quick-search-band {
    width: calc(100% - 26px);
    margin-top: -20px;
  }

  .page-wrap,
  .watch-layout,
  .footer-inner {
    width: calc(100% - 26px);
  }

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

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

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

  .rail-item {
    flex-basis: 84vw;
  }

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

  .rank-score {
    text-align: left;
  }

  .side-related {
    grid-template-columns: 96px 1fr;
  }
}
