:root {
  --blue: #2563eb;
  --cyan: #06b6d4;
  --deep: #111827;
  --gray: #6b7280;
  --soft: #f3f6fb;
  --card: #ffffff;
  --line: #e5e7eb;
  --orange: #f97316;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #ffffff;
  background: linear-gradient(90deg, #2563eb 0%, #0891b2 100%);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.24);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand:hover {
  opacity: 0.88;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #0e7490;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

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

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

.nav-link {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #cffafe;
  transform: translateY(-1px);
}

.header-search {
  width: 300px;
  position: relative;
}

.header-search input,
.mobile-search input,
.library-search input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  outline: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  padding: 12px 48px 12px 18px;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input::placeholder,
.mobile-search input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.header-search input:focus,
.mobile-search input:focus {
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 3px rgba(207, 250, 254, 0.45);
}

.header-search button {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.12);
}

.mobile-panel {
  display: none;
  padding: 0 20px 18px;
  background: rgba(29, 78, 216, 0.95);
}

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

.mobile-search {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 14px;
}

.mobile-search input {
  padding-right: 18px;
}

.mobile-search button {
  border: 0;
  color: #075985;
  cursor: pointer;
  font-weight: 700;
  padding: 0 18px;
  border-radius: 999px;
  background: #ffffff;
}

.mobile-nav {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.mobile-link {
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.mobile-link.active,
.mobile-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

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

.hero-track {
  position: relative;
  min-height: 650px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.78fr);
  align-items: center;
  gap: 52px;
  padding: 96px max(24px, calc((100vw - 1240px) / 2)) 82px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s ease;
  background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.88), rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.38)), var(--cover);
  background-size: cover;
  background-position: center;
}

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% 28%, rgba(34, 211, 238, 0.28), transparent 34%), radial-gradient(circle at 80% 62%, rgba(249, 115, 22, 0.18), transparent 30%);
}

.hero-content,
.hero-image-panel {
  position: relative;
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  color: #ffffff;
  font-weight: 800;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #ef4444);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.32);
}

.hero h1 {
  margin: 22px 0 18px;
  color: #ffffff;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 760px;
  margin: 0 0 22px;
  color: #e5e7eb;
  font-size: clamp(18px, 2vw, 23px);
}

.hero-tags,
.card-tags,
.detail-tags,
.rank-tags,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-tag,
.card-tag,
.detail-tag,
.mini-tag,
.category-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-tag {
  color: #ffffff;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

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

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

.primary-btn {
  color: #ffffff;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  box-shadow: 0 15px 32px rgba(6, 182, 212, 0.32);
}

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

.ghost-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.secondary-btn {
  color: #075985;
  background: #e0f2fe;
}

.hero-image-panel {
  justify-self: end;
  width: min(390px, 100%);
  border-radius: 30px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-image-panel img {
  width: 100%;
  aspect-ratio: 3 / 4.2;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

.hero-dots {
  position: absolute;
  z-index: 4;
  right: max(24px, calc((100vw - 1240px) / 2));
  bottom: 34px;
  display: flex;
  gap: 10px;
}

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

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

.section,
.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 58px 20px;
}

.section.compact {
  padding-top: 36px;
}

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

.section-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.section-subtitle {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--gray);
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 8px 28px 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 18px 42px rgba(15, 23, 42, 0.16);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4.2;
  background: #e5e7eb;
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.58));
}

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%) scale(0.82);
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.88);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.year-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  color: #ffffff;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
}

.card-body {
  padding: 17px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.card-body h3 {
  min-height: 58px;
  margin: 8px 0;
  color: #111827;
  font-size: 19px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body h3 a:hover {
  color: #0891b2;
}

.card-desc {
  min-height: 68px;
  margin: 0 0 12px;
  color: var(--gray);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc.compact {
  -webkit-line-clamp: 2;
  min-height: 46px;
}

.card-tag {
  padding: 5px 9px;
  color: #2563eb;
  font-size: 12px;
  background: #dbeafe;
}

.category-band {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
}

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

.category-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.16);
}

.category-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
}

.category-card p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.category-pill {
  width: max-content;
  margin-top: auto;
  padding: 7px 12px;
  color: #075985;
  font-weight: 800;
  background: #e0f2fe;
}

.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.rank-item {
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.rank-link {
  display: grid;
  grid-template-columns: 58px 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0891b2;
  font-size: 22px;
  font-weight: 900;
}

.rank-link img {
  width: 76px;
  height: 104px;
  border-radius: 12px;
  object-fit: cover;
}

.rank-info {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.rank-info strong {
  color: #111827;
  font-size: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-info small {
  color: #64748b;
}

.mini-tag {
  padding: 4px 8px;
  color: #0e7490;
  font-size: 12px;
  background: #cffafe;
}

.page-hero {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.page-hero .page-shell {
  padding-top: 64px;
  padding-bottom: 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

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

.page-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

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

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

.library-search input {
  color: #111827;
  background: #f1f5f9;
}

.library-search input::placeholder {
  color: #94a3b8;
}

.library-search button,
.filter-chip {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
}

.library-search button {
  color: #ffffff;
  padding: 0 22px;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
}

.filter-chip {
  padding: 8px 13px;
  color: #334155;
  background: #f1f5f9;
}

.filter-chip.active,
.filter-chip:hover {
  color: #ffffff;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
}

.empty-state {
  display: none;
  padding: 46px 20px;
  text-align: center;
  color: #64748b;
  border-radius: 22px;
  background: #ffffff;
}

.empty-state.show {
  display: block;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000000;
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.24);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 0;
  cursor: pointer;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.72));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-circle {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 5px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  box-shadow: 0 16px 34px rgba(6, 182, 212, 0.36);
}

.detail-card,
.side-card {
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.detail-card {
  padding: 28px;
  margin-top: 24px;
}

.detail-title {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  color: #475569;
}

.detail-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  background: #f1f5f9;
}

.detail-tag {
  padding: 7px 12px;
  color: #2563eb;
  background: #dbeafe;
}

.detail-card h2 {
  margin: 28px 0 10px;
  font-size: 24px;
}

.detail-card p {
  margin: 0 0 14px;
  color: #475569;
  font-size: 17px;
}

.side-card {
  padding: 22px;
  position: sticky;
  top: 92px;
}

.side-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.side-poster {
  overflow: hidden;
  margin-bottom: 18px;
  border-radius: 18px;
}

.side-poster img {
  width: 100%;
  aspect-ratio: 3 / 4.2;
  object-fit: cover;
}

.related-list {
  display: grid;
  gap: 12px;
}

.related-link {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: #f8fafc;
}

.related-link:hover {
  background: #eef6ff;
}

.related-link img {
  width: 62px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
}

.related-link strong {
  display: block;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-link small {
  color: #64748b;
}

.site-footer {
  color: #cbd5e1;
  background: linear-gradient(180deg, #1f2937, #111827);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 46px 20px;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
}

.footer-brand p {
  max-width: 380px;
  color: #94a3b8;
}

.footer-group {
  display: grid;
  gap: 9px;
}

.footer-group strong,
.footer-brand strong {
  color: #ffffff;
  font-size: 18px;
}

.footer-group a:hover {
  color: #22d3ee;
}

.footer-copy {
  padding: 18px 20px;
  text-align: center;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 50%;
  color: #ffffff;
  background: #06b6d4;
  box-shadow: var(--shadow);
}

.back-top.show {
  display: inline-flex;
}

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

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

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

  .side-card {
    position: static;
  }
}

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

  .mobile-toggle {
    display: inline-flex;
  }

  .hero,
  .hero-track {
    min-height: 780px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 58px;
    padding-bottom: 90px;
  }

  .hero-image-panel {
    justify-self: start;
    max-width: 260px;
  }

  .section-head {
    display: block;
  }

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

@media (max-width: 640px) {
  .header-inner {
    min-height: 60px;
  }

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

  .hero,
  .hero-track {
    min-height: 740px;
  }

  .hero-slide {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-actions {
    display: grid;
  }

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

  .card-body {
    padding: 13px;
  }

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

  .card-desc,
  .card-tags,
  .card-meta span:nth-child(2) {
    display: none;
  }

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

  .rank-link img {
    width: 62px;
    height: 86px;
  }

  .library-search {
    grid-template-columns: 1fr;
  }

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