* {
  box-sizing: border-box;
}

:root {
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #38bdf8;
  --green: #34d399;
  --shadow: 0 20px 50px rgba(8, 47, 73, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.16), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(59, 130, 246, 0.16), transparent 30%),
    linear-gradient(135deg, #020617 0%, #0f172a 46%, #111827 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

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

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.logo-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  color: #08111f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.34);
}

.site-logo span:last-child {
  color: transparent;
  background: linear-gradient(90deg, #67e8f9, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #cbd5e1;
  font-weight: 600;
}

.desktop-nav a,
.mobile-nav a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--cyan);
}

.nav-cats {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: #94a3b8;
  font-size: 14px;
}

.menu-toggle {
  display: none;
  border: 0;
  color: #cbd5e1;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px 18px;
  color: #cbd5e1;
  border-top: 1px solid var(--line);
}

.mobile-nav.open {
  display: flex;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  display: none;
  position: relative;
  min-height: 620px;
  padding: 84px 0 70px;
}

.hero-slide.active {
  display: block;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) brightness(0.62);
  transform: scale(1.04);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.78) 42%, rgba(2, 6, 23, 0.62) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.3) 55%, rgba(2, 6, 23, 0.1) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 46px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 13px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.11);
}

.hero h1 {
  margin: 0 0 18px;
  max-width: 780px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, #67e8f9, #60a5fa, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-desc {
  max-width: 720px;
  margin: 0 0 26px;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.85;
}

.hero-tags,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.tag,
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 145, 178, 0.13);
  border: 1px solid rgba(34, 211, 238, 0.2);
  font-size: 13px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  color: #04111d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 32px rgba(34, 211, 238, 0.22);
}

.btn-secondary {
  color: #dbeafe;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.62);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(34, 211, 238, 0.22);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow);
}

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

.hero-poster-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), transparent);
}

.hero-poster-caption strong {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}

.hero-poster-caption p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

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

.hero-dot {
  width: 36px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.42);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--cyan);
}

.section {
  padding: 64px 0;
}

.section.alt {
  background: rgba(15, 23, 42, 0.48);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.section-heading > span {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.09);
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

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

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

.movie-card {
  display: block;
  min-width: 0;
}

.poster-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover .poster-wrap {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 22px 44px rgba(34, 211, 238, 0.18);
}

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

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

.poster-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.08));
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-mask {
  opacity: 1;
}

.poster-mask p {
  margin: 0;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.6;
}

.year-badge,
.rank-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 9px;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(34, 211, 238, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.rank-badge {
  left: 10px;
  right: auto;
  color: #020617;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.card-info {
  padding-top: 12px;
}

.card-info h3 {
  display: -webkit-box;
  min-height: 46px;
  margin: 0 0 8px;
  overflow: hidden;
  color: #f8fafc;
  font-size: 16px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

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

.movie-meta {
  display: flex;
  gap: 10px;
  color: #94a3b8;
  font-size: 12px;
}

.card-genre {
  display: inline-flex;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  overflow: hidden;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.compact-card .poster-wrap {
  width: 90px;
  border-radius: 14px;
}

.compact-card .card-info {
  padding-top: 0;
}

.compact-card .card-info h3 {
  min-height: auto;
}

.scroll-row {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 4px 22px;
  scroll-snap-type: x mandatory;
}

.scroll-row .movie-card {
  flex: 0 0 185px;
  scroll-snap-align: start;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), transparent 42%),
    rgba(15, 23, 42, 0.74);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.46);
}

.category-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.category-card p {
  margin: 0 0 20px;
  color: #b6c2d3;
  line-height: 1.7;
}

.category-card span {
  color: var(--cyan);
  font-weight: 800;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px;
  gap: 14px;
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  outline: none;
  color: #f8fafc;
  background: #0f172a;
  padding: 0 14px;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.page-hero {
  padding: 68px 0 34px;
  background:
    radial-gradient(circle at 16% 12%, rgba(34, 211, 238, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.94));
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 780px;
  margin: 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.8;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: #94a3b8;
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
  padding: 42px 0 70px;
}

.player-box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-box video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #020617;
}

.player-overlay.hidden {
  display: none;
}

.player-overlay img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}

.player-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.18));
}

.play-btn {
  position: relative;
  z-index: 2;
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #02111f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 0 12px rgba(34, 211, 238, 0.14), 0 20px 46px rgba(0, 0, 0, 0.34);
  font-size: 34px;
  cursor: pointer;
}

.detail-title {
  margin: 26px 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.detail-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.74);
}

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

.detail-card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.9;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 90px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.78);
}

.sidebar h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.sidebar-list {
  display: grid;
  gap: 18px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(34, 211, 238, 0.42);
}

.rank-num {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #04111d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 900;
}

.rank-item h3 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-item p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-item img {
  width: 76px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  object-fit: cover;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
}

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

.footer-brand p,
.site-footer li,
.site-footer a {
  color: #94a3b8;
  line-height: 1.8;
}

.site-footer h3 {
  margin: 0 0 14px;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a:hover {
  color: var(--cyan);
}

.footer-bottom {
  padding: 18px;
  color: #64748b;
  text-align: center;
  border-top: 1px solid var(--line);
}

.empty-state {
  display: none;
  padding: 36px;
  color: #cbd5e1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

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

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

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 820px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero,
  .hero-slide {
    min-height: auto;
  }

  .hero-slide {
    padding: 54px 0 64px;
  }

  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    max-width: 360px;
  }

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

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

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

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

  .site-logo {
    font-size: 18px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
  }

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

  .hero-actions .btn {
    width: 100%;
  }

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

  .rank-item img {
    display: none;
  }
}
