:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-strong: rgba(30, 41, 59, 0.94);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --emerald: #10b981;
  --emerald-strong: #059669;
  --cyan: #22d3ee;
  --amber: #f59e0b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 28rem),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 50%, #020617 100%);
}

body.locked {
  overflow: hidden;
}

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: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ecfeff;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.28);
  font-size: 14px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #dbeafe;
  font-weight: 650;
}

.main-nav a {
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #34d399;
}

.nav-dropdown {
  position: relative;
  padding: 22px 0;
}

.dropdown-panel {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 220px;
  display: grid;
  gap: 4px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.dropdown-panel a {
  padding: 10px 12px;
  border-radius: 12px;
  color: #dbeafe;
}

.dropdown-panel a:hover {
  background: rgba(16, 185, 129, 0.12);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.38);
}

.header-search input,
.mobile-panel input,
.search-box input,
.filter-input {
  width: 240px;
  border: 0;
  outline: 0;
  color: #f8fafc;
  background: transparent;
  padding: 10px 14px;
}

.header-search input::placeholder,
.mobile-panel input::placeholder,
.search-box input::placeholder,
.filter-input::placeholder {
  color: #94a3b8;
}

.header-search button,
.mobile-panel button,
.search-box button,
.btn-primary,
.btn-secondary {
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-strong));
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 750;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.header-search button:hover,
.mobile-panel button:hover,
.search-box button:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.26);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

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

.mobile-panel form {
  display: flex;
  gap: 8px;
  margin: 14px auto;
  max-width: 640px;
  padding: 5px;
  background: rgba(2, 6, 23, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}

.mobile-panel input {
  width: 100%;
}

.mobile-panel nav,
.mobile-category-list {
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}

.mobile-panel a {
  padding: 11px 12px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.56);
  border-radius: 12px;
}

.mobile-category-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

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

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

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

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.75) 42%, rgba(2, 6, 23, 0.08) 100%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.86) 0%, rgba(2, 6, 23, 0.2) 70%);
}

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 84px;
  z-index: 2;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  color: #ecfeff;
  background: rgba(16, 185, 129, 0.9);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 750;
}

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

.hero p {
  max-width: 720px;
  color: #cbd5e1;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.8;
}

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

.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-nav:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translateY(-2px);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

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

.hero-dot.is-active {
  width: 34px;
  background: var(--emerald);
}

.section-block {
  padding: 54px 0;
}

.section-shell {
  padding: 34px;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.22), rgba(8, 145, 178, 0.16));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

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

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

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

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
  font-weight: 750;
  white-space: nowrap;
}

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

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

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

.movie-card {
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(16, 185, 129, 0.44);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.34);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(6, 78, 59, 0.62));
}

.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-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.6), rgba(2, 6, 23, 0.04));
}

.card-badge,
.rank-num {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  color: #ecfeff;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.rank-num {
  left: auto;
  right: 12px;
  color: #111827;
  background: linear-gradient(135deg, #fef3c7, #f59e0b);
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
}

.card-body h3 a:hover {
  color: #34d399;
}

.card-body p {
  min-height: 48px;
  margin: 0 0 14px;
  color: #a7b4c7;
  line-height: 1.65;
  font-size: 14px;
}

.card-meta,
.info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.card-meta span,
.info-line span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.card-list {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.card-list .poster-link {
  aspect-ratio: 16 / 11;
}

.card-list .card-body p {
  min-height: auto;
}

.page-hero {
  padding: 66px 0 44px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.36), rgba(8, 47, 73, 0.24));
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
}

.filter-input,
.sort-select,
.search-box input,
.search-filter select {
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  outline: 0;
}

.filter-input {
  width: min(360px, 100%);
}

.sort-select,
.search-filter select {
  padding: 11px 14px;
}

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

.category-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(6, 78, 59, 0.22));
  box-shadow: var(--shadow);
}

.category-card::before {
  content: "";
  position: absolute;
  inset: auto -30px -80px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 68%);
}

.category-card h2,
.category-card h3 {
  position: relative;
  margin: 0 0 12px;
  font-size: 26px;
}

.category-card p {
  position: relative;
  color: #a7b4c7;
  line-height: 1.75;
}

.category-card .section-link {
  position: absolute;
  left: 24px;
  bottom: 22px;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 76px 150px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 22px;
}

.ranking-index {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #111827;
  background: linear-gradient(135deg, #fef3c7, #f59e0b);
  font-weight: 900;
  font-size: 20px;
}

.ranking-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
}

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

.ranking-info h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.ranking-info p {
  margin: 0 0 10px;
  color: #a7b4c7;
  line-height: 1.65;
}

.detail-hero {
  padding: 42px 0;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.24), rgba(15, 23, 42, 0.78));
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

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

.player-card,
.detail-card,
.aside-card {
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.player-card {
  overflow: hidden;
}

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

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

.center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 84px;
  height: 84px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: rgba(16, 185, 129, 0.92);
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 40px rgba(16, 185, 129, 0.28);
  font-size: 32px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.center-play:hover {
  transform: translate(-50%, -50%) scale(1.07);
}

.video-box.is-playing .center-play {
  opacity: 0;
  pointer-events: none;
}

.player-caption,
.detail-card,
.aside-card {
  padding: 24px;
}

.detail-title h1 {
  margin-top: 16px;
}

.detail-card h2,
.aside-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

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

.detail-poster {
  overflow: hidden;
  border-radius: 22px;
  margin-bottom: 18px;
  background: rgba(15, 23, 42, 0.85);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

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

.breadcrumb a:hover {
  color: #34d399;
}

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

.related-mini a {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
}

.related-mini img {
  width: 78px;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 12px;
}

.related-mini strong {
  display: block;
  margin-bottom: 4px;
}

.related-mini span {
  color: #94a3b8;
  font-size: 13px;
}

.search-panel {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.38);
}

.search-box input {
  width: 100%;
}

.search-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer {
  margin-top: 64px;
  color: #cbd5e1;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.96));
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

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

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

.site-footer p {
  max-width: 480px;
  color: #94a3b8;
  line-height: 1.8;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.site-footer a:hover {
  color: #34d399;
}

.footer-bottom {
  padding: 18px 0 26px;
  text-align: center;
  color: #64748b;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
}

@media (max-width: 1024px) {
  .header-search {
    display: none;
  }

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

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

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

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

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

  .brand {
    font-size: 20px;
  }

  .hero {
    height: 76vh;
    min-height: 520px;
  }

  .hero-content {
    bottom: 72px;
  }

  .hero-nav {
    display: none;
  }

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

  .section-shell {
    padding: 22px;
  }

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

  .card-body {
    padding: 13px;
  }

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

  .card-body p,
  .tag-row {
    display: none;
  }

  .card-list {
    grid-template-columns: 1fr;
  }

  .ranking-item {
    grid-template-columns: 48px 96px minmax(0, 1fr);
  }

  .ranking-item .btn-secondary {
    grid-column: 2 / -1;
  }

  .ranking-index {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

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

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

  .movie-grid,
  .movie-grid.compact,
  .movie-grid.three,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

  .search-box {
    border-radius: 20px;
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

  .center-play {
    width: 68px;
    height: 68px;
  }
}
