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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(6, 182, 212, 0.12), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

main {
  min-height: 70vh;
}

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

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(6, 182, 212, 0.22);
}

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

.nav-link {
  color: #334155;
  font-weight: 650;
  transition: color 0.2s ease;
}

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

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

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 8px 10px 8px 14px;
  background: transparent;
  color: var(--text);
}

.search-form button,
.btn,
.hero-button,
.filter-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-weight: 750;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-form button {
  padding: 8px 14px;
}

.btn,
.hero-button,
.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
}

.search-form button:hover,
.btn:hover,
.hero-button:hover,
.filter-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.26);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-suggestions.open {
  display: block;
}

.suggestion-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover {
  background: #f8fafc;
}

.suggestion-item img {
  width: 72px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(135deg, #dbeafe, #cffafe);
}

.suggestion-item strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.suggestion-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 22px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

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

.mobile-links {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mobile-links a {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  color: #334155;
  font-weight: 650;
}

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

.hero {
  position: relative;
  min-height: 74vh;
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.55) 48%, rgba(2, 6, 23, 0.18)), linear-gradient(0deg, rgba(2, 6, 23, 0.68), transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 74vh;
  display: flex;
  align-items: center;
  padding: 86px 0 96px;
}

.hero-copy {
  width: min(680px, 100%);
  color: #ffffff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.18);
  color: #67e8f9;
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 20px 0 0;
  color: #e2e8f0;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.75;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-button.secondary {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

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

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

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
}

.tag-row span {
  background: #ecfeff;
  color: #0891b2;
}

.hero-dots {
  position: absolute;
  z-index: 5;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
}

.hero-dot {
  width: 18px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

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

.page-hero {
  padding: 58px 0 34px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.section {
  padding: 62px 0;
}

.section.compact {
  padding: 34px 0 62px;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

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

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 750;
  white-space: nowrap;
}

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

.movie-card,
.category-card,
.info-panel,
.content-card,
.rank-card,
.search-result {
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-wrap,
.rank-poster,
.detail-poster,
.category-cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #cffafe 50%, #ede9fe);
}

.poster-wrap {
  aspect-ratio: 16 / 10;
}

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

.movie-card:hover .poster-img,
.rank-card:hover .poster-img,
.category-card:hover .poster-img {
  transform: scale(1.04);
}

.play-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.92);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(6, 182, 212, 0.28);
}

.card-body {
  padding: 18px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.movie-card h3,
.rank-card h3,
.search-result h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.movie-card h3 a:hover,
.rank-card h3 a:hover,
.search-result h3 a:hover {
  color: var(--primary);
}

.movie-card p,
.rank-card p,
.search-result p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

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

.category-card {
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.category-cover {
  aspect-ratio: 16 / 9;
}

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

.category-card h2,
.category-card h3 {
  margin: 0;
  font-size: 20px;
}

.category-card p {
  min-height: 58px;
  margin: 9px 0 14px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.category-link {
  color: var(--primary);
  font-weight: 800;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.filter-bar input,
.filter-bar select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 0 14px;
  color: var(--text);
  outline: 0;
}

.filter-bar input {
  flex: 1;
  min-width: 220px;
}

.filter-button {
  min-height: 44px;
  padding: 0 18px;
}

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

.rank-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 220px 1fr;
  gap: 18px;
  overflow: hidden;
  padding: 14px;
  align-items: center;
}

.rank-num {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-size: 20px;
  font-weight: 850;
}

.rank-poster {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
}

.detail-hero {
  padding: 44px 0 30px;
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.17), transparent 26rem);
}

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

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

.detail-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.05em;
  line-height: 1.08;
}

.detail-line {
  max-width: 880px;
  margin: 16px 0 0;
  color: #475569;
  font-size: 19px;
  line-height: 1.75;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.detail-meta span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
}

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

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #020617;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.2);
  aspect-ratio: 16 / 9;
}

.player-box video {
  width: 100%;
  height: 100%;
  display: block;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.58));
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.player-box.is-playing .player-overlay {
  opacity: 0;
  pointer-events: none;
}

.player-button-core {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 18px 34px rgba(6, 182, 212, 0.3);
  font-weight: 850;
}

.content-card {
  padding: 26px;
  margin-top: 24px;
}

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

.content-card p {
  margin: 0 0 16px;
  color: #334155;
  line-height: 1.9;
  font-size: 16px;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.info-panel {
  padding: 22px;
}

.detail-poster {
  margin-bottom: 18px;
  border-radius: 22px;
  aspect-ratio: 3 / 4;
}

.info-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row dt {
  color: var(--muted);
}

.info-row dd {
  margin: 0;
  text-align: right;
  font-weight: 750;
}

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

.search-page-box {
  padding: 22px;
  margin-bottom: 26px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.search-page-form {
  display: flex;
  gap: 12px;
}

.search-page-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  outline: 0;
}

.search-result {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 14px;
  margin-bottom: 16px;
  align-items: center;
}

.search-result .rank-poster {
  width: 100%;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 22px;
}

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

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

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

.footer-links {
  display: flex;
  align-content: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.footer-links a {
  color: #475569;
  font-weight: 650;
}

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

.footer-copy {
  padding: 18px 16px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

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

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

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

  .sticky-panel {
    position: static;
  }
}

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

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

  .hero,
  .hero-content {
    min-height: 68vh;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

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

  .rank-card,
  .search-result {
    grid-template-columns: 1fr;
  }

  .rank-num {
    position: absolute;
    left: 22px;
    top: 22px;
    z-index: 3;
  }

  .rank-poster {
    width: 100%;
  }

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

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .container,
  .footer-inner,
  .mobile-links {
    width: min(100% - 22px, 1180px);
  }

  .brand {
    font-size: 20px;
  }

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

  .hero-actions,
  .search-page-form {
    align-items: stretch;
    flex-direction: column;
  }

  .movie-grid,
  .category-grid,
  .mobile-links {
    grid-template-columns: 1fr;
  }

  .content-card,
  .info-panel {
    padding: 20px;
  }
}
