:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #27364a;
  --border: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --ocean: #0ea5e9;
  --ocean-dark: #0284c7;
  --amber: #f59e0b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 36rem), var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.24);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ocean), #2563eb);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.32);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-text strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.logo-text small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: #ffffff;
  background: rgba(14, 165, 233, 0.18);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 28vw);
}

.header-search input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  border: 1px solid rgba(51, 65, 85, 0.95);
  border-radius: 12px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.9);
  outline: none;
  padding: 10px 12px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(14, 165, 233, 0.88);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.header-search button,
.btn,
.filter-button,
.player-button {
  border: 0;
  cursor: pointer;
  color: #ffffff;
  background: var(--ocean);
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 16px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.btn:hover,
.filter-button:hover,
.player-button:hover {
  background: var(--ocean-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.menu-toggle {
  display: none;
  border: 0;
  color: #ffffff;
  background: rgba(30, 41, 59, 0.95);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  border-top: 1px solid rgba(51, 65, 85, 0.75);
  background: rgba(15, 23, 42, 0.98);
}

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

.mobile-panel .container {
  padding: 12px 0 18px;
  display: grid;
  gap: 8px;
}

.mobile-panel a {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-soft);
  background: rgba(30, 41, 59, 0.5);
}

.hero-slider {
  position: relative;
  height: 64vh;
  min-height: 540px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08));
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-copy {
  width: min(680px, 90%);
  padding-top: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(2, 132, 199, 0.92);
  font-size: 14px;
  font-weight: 700;
}

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

.hero-copy p {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: clamp(16px, 2vw, 20px);
}

.hero-meta,
.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

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

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-50%) scale(1.04);
}

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

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

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

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

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

.section {
  padding: 54px 0;
}

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

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

.section-head h2,
.page-title h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

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

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.cards-normal {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.movie-card,
.category-card,
.panel,
.rank-card,
.detail-box,
.related-card {
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.18);
}

.movie-card,
.related-card,
.category-card,
.rank-card {
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover,
.related-card:hover,
.category-card:hover,
.rank-card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, 0.65);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: var(--shadow);
}

.poster {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

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

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

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(0, 0, 0, 0.72));
}

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(14, 165, 233, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.card-body {
  padding: 14px;
}

.card-body h3,
.category-card h3,
.rank-card h3,
.related-card h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.35;
}

.card-body p,
.category-card p,
.rank-card p,
.related-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.line-clamp-1 {
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  -webkit-line-clamp: 3;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(14, 165, 233, 0.12);
  font-size: 12px;
}

.scroller {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 3px 2px 18px;
  scroll-snap-type: x mandatory;
}

.scroller .movie-card {
  min-width: 290px;
  scroll-snap-align: start;
}

.category-card {
  padding: 20px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.category-card .mini-links {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}

.category-card .mini-links a {
  color: var(--text-muted);
  font-size: 13px;
}

.category-card .mini-links a:hover {
  color: var(--ocean);
}

.page-title {
  padding: 44px 0 24px;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 180px 160px auto;
  gap: 12px;
  padding: 16px;
  margin: 10px 0 28px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(51, 65, 85, 0.8);
}

.filter-empty {
  display: none;
  padding: 30px;
  color: var(--text-muted);
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.82);
}

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

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

.rank-card {
  display: grid;
  grid-template-columns: 78px 220px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ocean), #2563eb);
}

.rank-card .poster {
  border-radius: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
  gap: 28px;
  padding: 34px 0 60px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  padding-top: 24px;
}

.breadcrumbs a:hover {
  color: var(--ocean);
}

.movie-player {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #000000;
  box-shadow: var(--shadow);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
  border: 0;
  color: #ffffff;
  background: #000000;
  cursor: pointer;
}

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

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.56));
}

.cover-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(14, 165, 233, 0.95);
  font-size: 30px;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 60px rgba(14, 165, 233, 0.36);
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.movie-player:hover .player-controls,
.movie-player.is-playing .player-controls {
  opacity: 1;
}

.player-button {
  min-width: 82px;
  padding: 9px 13px;
}

.player-status {
  color: var(--text-soft);
  font-size: 13px;
}

.detail-box {
  padding: 24px;
  margin-top: 22px;
}

.detail-copy h1 {
  margin-bottom: 12px;
}

.detail-meta {
  margin: 12px 0 18px;
}

.detail-section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid rgba(51, 65, 85, 0.75);
}

.detail-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.detail-section p {
  margin: 0;
  color: var(--text-soft);
}

.sidebar-card {
  position: sticky;
  top: 96px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.8);
}

.sidebar-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
}

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

.related-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.related-row:hover {
  background: rgba(30, 41, 59, 0.86);
}

.related-row img {
  width: 96px;
  height: 62px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0;
}

.related-row strong {
  display: block;
  color: #ffffff;
  line-height: 1.35;
}

.related-row span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.site-footer {
  border-top: 1px solid rgba(30, 41, 59, 0.95);
  background: rgba(15, 23, 42, 0.95);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
  padding: 42px 0;
}

.footer-grid h2,
.footer-grid h3 {
  margin: 0 0 12px;
}

.footer-grid p,
.footer-grid a {
  color: var(--text-muted);
  font-size: 14px;
}

.footer-links {
  display: grid;
  gap: 8px;
}

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

.copyright {
  padding: 18px 0 28px;
  color: #64748b;
  font-size: 13px;
  border-top: 1px solid rgba(30, 41, 59, 0.75);
}

@media (max-width: 1180px) {
  .grid.cards-normal {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .rank-card {
    grid-template-columns: 60px 180px 1fr;
  }

  .rank-card .btn {
    grid-column: 3;
    justify-self: start;
  }
}

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

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

  .hero-slider {
    height: auto;
    min-height: 560px;
  }

  .hero-copy {
    padding: 90px 0 120px;
  }

  .hero-control {
    display: none;
  }

  .grid.cards-large,
  .grid.cards-normal,
  .grid.categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

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

  .sidebar-card {
    position: static;
  }

  .rank-card {
    grid-template-columns: 56px 120px 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 24px, 1280px);
  }

  .logo-text strong {
    font-size: 17px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.cards-large,
  .grid.cards-normal,
  .grid.categories {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 48px 1fr;
  }

  .rank-card .poster {
    grid-column: 1 / -1;
  }

  .rank-card .btn {
    grid-column: 1 / -1;
  }

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

.header-search-mobile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.header-search-mobile input {
  border: 1px solid rgba(51, 65, 85, 0.95);
  border-radius: 12px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.92);
  outline: none;
  padding: 10px 12px;
}

.header-search-mobile button {
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--ocean);
  font-weight: 700;
  padding: 10px 16px;
}
