:root {
  --primary: #2563eb;
  --secondary: #0891b2;
  --accent: #14b8a6;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --soft: #f8fafc;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: white;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  box-shadow: 0 18px 35px rgba(8, 145, 178, 0.24);
}

.header-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #0f766e;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 12px 25px rgba(15, 23, 42, 0.16);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.nav-link,
.mobile-panel a {
  border-radius: 999px;
  padding: 10px 15px;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-panel a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  transform: translateY(-1px);
}

.top-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 34vw);
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.top-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  padding: 8px 10px;
}

.top-search input::placeholder {
  color: rgba(255, 255, 255, 0.74);
}

.top-search button,
.primary-button,
.ghost-button,
.text-button,
.filter-button,
.play-overlay button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
}

.top-search button {
  color: var(--primary);
  background: white;
  padding: 8px 16px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.18);
}

.mobile-panel {
  z-index: 3;
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 20px;
}

.mobile-panel a {
  display: inline-flex;
  margin: 4px;
}

.mobile-cats {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.header-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 24px;
  width: 100%;
  fill: #f8fafc;
  pointer-events: none;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  color: white;
  background: radial-gradient(circle at 12% 20%, rgba(20, 184, 166, 0.55), transparent 28%), radial-gradient(circle at 80% 10%, rgba(37, 99, 235, 0.55), transparent 34%), linear-gradient(135deg, #0f172a, #0e7490 52%, #0f766e);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.52), rgba(15, 23, 42, 0.86));
  z-index: 1;
}

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

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.15) contrast(1.08);
}

.hero-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 88px 0 74px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.72fr);
  gap: 44px;
  align-items: center;
}

.hero-copy {
  min-height: 430px;
  display: grid;
  align-content: center;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #cffafe;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  font-weight: 800;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-desc {
  width: min(690px, 100%);
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.hero-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
  color: #075985;
  background: white;
  box-shadow: 0 16px 28px rgba(255, 255, 255, 0.15);
}

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

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

.hero-side {
  position: relative;
}

.hero-carousel {
  display: grid;
  gap: 18px;
}

.hero-slide {
  display: none;
  overflow: hidden;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(18px);
}

.hero-slide.active {
  display: block;
  animation: fadeIn 0.55s ease both;
}

.hero-poster {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

.hero-card-body {
  padding: 24px;
}

.hero-card-body h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.18;
}

.hero-card-body p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.76);
}

.hero-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
}

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

.hero-dot.active {
  width: 34px;
  background: white;
}

.section {
  padding: 70px 0;
}

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

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

.section-head h2,
.page-title h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.section-head p,
.page-title p,
.detail-title p {
  margin: 10px 0 0;
  color: var(--muted);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: #dbeafe;
  padding: 10px 16px;
  white-space: nowrap;
}

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

.movie-card,
.category-tile,
.rank-item,
.detail-panel,
.search-panel,
.related-card,
.player-shell {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(226, 232, 240, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover,
.category-tile:hover,
.related-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
}

.poster-link {
  position: relative;
  overflow: hidden;
  display: block;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
}

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

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

.poster-year,
.poster-play {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-weight: 900;
}

.poster-year {
  top: 12px;
  left: 12px;
  color: white;
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(10px);
}

.poster-play {
  right: 12px;
  bottom: 12px;
  color: #075985;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.9);
}

.card-body {
  padding: 18px;
}

.card-meta,
.rank-meta,
.detail-meta,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 14px;
}

.card-body h3 {
  margin: 9px 0 8px;
  font-size: 19px;
  line-height: 1.3;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

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

.category-tile {
  border-radius: 24px;
  padding: 22px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-tile span {
  display: inline-flex;
  color: white;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 900;
}

.category-tile h3 {
  margin: 18px 0 8px;
  font-size: 23px;
}

.category-tile p {
  color: var(--muted);
  margin: 0;
}

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

.rank-item {
  display: grid;
  grid-template-columns: auto 86px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-radius: 24px;
  padding: 14px;
}

.rank-index {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
}

.rank-cover {
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 3 / 4;
  background: #dbeafe;
}

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

.rank-info h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

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

.page-hero {
  padding: 70px 0 32px;
}

.page-title {
  max-width: 820px;
}

.search-panel {
  border-radius: 28px;
  padding: 22px;
  margin-bottom: 28px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.search-grid input,
.search-grid select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: white;
  outline: 0;
}

.filter-button {
  min-height: 48px;
  color: white;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  padding: 0 18px;
}

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

.player-shell {
  overflow: hidden;
  border-radius: 30px;
  background: #020617;
}

.player-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.76));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-overlay button {
  display: inline-grid;
  place-items: center;
  min-width: 84px;
  height: 84px;
  color: #075985;
  background: white;
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.25);
  font-size: 18px;
}

.detail-panel {
  border-radius: 28px;
  padding: 26px;
  margin-top: 22px;
}

.detail-title {
  padding: 46px 0 28px;
}

.breadcrumb {
  margin-bottom: 14px;
}

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

.detail-meta {
  margin-top: 14px;
}

.detail-panel h2,
.side-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-panel p {
  margin: 0 0 16px;
  color: #334155;
}

.side-card {
  border-radius: 28px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow);
}

.side-poster {
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 3 / 4;
  margin-bottom: 18px;
  background: #dbeafe;
}

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

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

.related-card {
  overflow: hidden;
  border-radius: 20px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.related-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #dbeafe;
}

.related-card span {
  display: block;
  padding: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.site-footer {
  margin-top: 40px;
  padding: 46px 0;
  color: white;
  background: #0f172a;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
}

.footer-brand {
  margin-bottom: 8px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: #cffafe;
}

.empty-state {
  display: none;
  border-radius: 24px;
  padding: 28px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

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

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

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

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

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

  .rank-item .text-button {
    grid-column: 3 / 4;
    width: fit-content;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
  }

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

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

  .section {
    padding: 46px 0;
  }

  .section-head,
  .footer-grid {
    display: block;
  }

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

  .rank-info p,
  .rank-meta {
    display: none;
  }

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

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

  .card-body {
    padding: 14px;
  }

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