:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-soft: rgba(30, 41, 59, 0.62);
  --line: rgba(51, 65, 85, 0.78);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --soft: #64748b;
  --accent: #0ea5e9;
  --accent-strong: #38bdf8;
  --green: #4ade80;
  --red: #f87171;
  --purple: #c084fc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(14, 165, 233, 0.18), transparent 32rem),
    radial-gradient(circle at 85% 18%, rgba(192, 132, 252, 0.12), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(30, 41, 59, 0.88);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(18px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark,
.footer-brand span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0284c7);
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.28);
}

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

.brand-text strong {
  font-size: 1.18rem;
  letter-spacing: 0.02em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.main-nav a,
.mobile-panel a {
  color: #cbd5e1;
  font-weight: 650;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.mobile-panel a:hover,
.mobile-panel a.active {
  color: var(--accent-strong);
}

.header-search {
  position: relative;
  width: min(280px, 24vw);
}

.header-search input,
.mobile-search-box input,
.local-filter input,
.local-filter select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  padding: 12px 16px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search-box input:focus,
.local-filter input:focus,
.local-filter select:focus {
  border-color: rgba(14, 165, 233, 0.9);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.search-results {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(420px, 90vw);
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow);
}

.search-results.open {
  display: grid;
  gap: 8px;
}

.search-results a {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  color: var(--text);
}

.search-results a:hover {
  background: rgba(14, 165, 233, 0.1);
}

.search-results img {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(51, 65, 85, 0.5);
}

.search-results strong,
.search-results small {
  display: block;
}

.search-results small {
  color: var(--muted);
  margin-top: 3px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.8);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.96);
}

.mobile-panel nav,
.mobile-search-box {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.mobile-panel nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
}

.mobile-panel nav a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
}

.mobile-search-box {
  position: relative;
  padding: 0 0 18px;
}

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

.hero {
  position: relative;
  min-height: 620px;
  margin: 26px auto 52px;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.74);
  border-radius: 32px;
  box-shadow: var(--shadow);
  background: #020617;
}

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 36px;
  padding: clamp(32px, 6vw, 70px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) brightness(0.72);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.68) 48%, rgba(2, 6, 23, 0.34)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.12) 50%, rgba(2, 6, 23, 0.64));
}

.hero-content,
.hero-poster {
  position: relative;
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(14, 165, 233, 0.32);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.12);
}

.hero h1,
.hero h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero p {
  max-width: 680px;
  margin: 22px 0 0;
  color: #cbd5e1;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  line-height: 1.9;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0284c7);
  box-shadow: 0 14px 36px rgba(14, 165, 233, 0.28);
}

.btn-ghost {
  color: #e0f2fe;
  border-color: rgba(14, 165, 233, 0.34);
  background: rgba(15, 23, 42, 0.66);
}

.hero-poster {
  align-self: center;
  justify-self: end;
  width: min(340px, 28vw);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.12);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

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

.hero-poster span {
  display: block;
  padding: 16px 18px;
  color: #cbd5e1;
}

.hero-controls {
  position: absolute;
  left: clamp(28px, 6vw, 70px);
  right: clamp(28px, 6vw, 70px);
  bottom: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 34px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(226, 232, 240, 0.28);
}

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

.hero-arrows {
  display: flex;
  gap: 10px;
}

.hero-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.72);
}

.section {
  margin: 54px 0;
}

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

.section-title {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
}

.section-desc {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.section-link {
  color: var(--accent-strong);
  font-weight: 750;
}

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

.movie-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.68);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(14, 165, 233, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.poster-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(51, 65, 85, 0.88));
}

.poster-wrap img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover img {
  transform: scale(1.05);
}

.quality-badge,
.rank-badge,
.type-badge {
  position: absolute;
  top: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 850;
  color: #fff;
  background: rgba(14, 165, 233, 0.9);
  backdrop-filter: blur(8px);
}

.quality-badge {
  right: 10px;
}

.rank-badge {
  left: 10px;
  background: rgba(248, 113, 113, 0.9);
}

.type-badge {
  left: 10px;
  background: rgba(192, 132, 252, 0.86);
}

.card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.card-content strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-content span,
.card-content small {
  color: var(--muted);
  line-height: 1.55;
}

.card-content small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact-card {
  flex-direction: row;
}

.compact-card .poster-wrap {
  width: 92px;
  min-width: 92px;
}

.compact-card .poster-wrap img {
  height: 132px;
  aspect-ratio: auto;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px;
  border: 1px solid rgba(51, 65, 85, 0.74);
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 12%, rgba(14, 165, 233, 0.24), transparent 160px),
    rgba(15, 23, 42, 0.74);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, 0.68);
}

.category-card strong {
  display: block;
  color: #fff;
  font-size: 1.55rem;
}

.category-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.category-card span {
  display: inline-flex;
  margin-top: 18px;
  color: var(--accent-strong);
  font-weight: 800;
}

.local-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 14px;
  margin: 24px 0;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 26px;
}

.filter-chip,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.62);
}

.filter-chip {
  cursor: pointer;
}

.filter-chip.active,
.filter-chip:hover {
  color: #fff;
  border-color: rgba(14, 165, 233, 0.78);
  background: rgba(14, 165, 233, 0.18);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-hero {
  margin: 32px 0 34px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(51, 65, 85, 0.74);
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 8%, rgba(14, 165, 233, 0.18), transparent 240px),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.72));
  box-shadow: var(--shadow);
}

.page-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.06em;
}

.page-hero p {
  max-width: 820px;
  margin: 18px 0 0;
  color: #cbd5e1;
  line-height: 1.9;
}

.rank-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.rank-feature {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  border: 1px solid rgba(51, 65, 85, 0.76);
  border-radius: 30px;
  background: #020617;
}

.rank-feature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.58);
}

.rank-feature div {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
}

.rank-feature h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.05em;
}

.rank-feature p {
  color: #dbeafe;
  line-height: 1.8;
}

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

.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 26px;
  align-items: start;
  margin: 32px 0;
}

.player-shell,
.detail-panel,
.story-panel {
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: var(--shadow);
}

.player-shell {
  overflow: hidden;
}

.player-frame {
  position: relative;
  background: #000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.58));
}

.player-shell.is-playing .player-overlay {
  opacity: 0;
}

.play-button {
  pointer-events: auto;
  width: 94px;
  height: 94px;
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  background: rgba(14, 165, 233, 0.92);
  box-shadow: 0 18px 54px rgba(14, 165, 233, 0.34);
  transition: transform 0.2s ease;
}

.play-button:hover {
  transform: scale(1.06);
}

.player-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  color: var(--muted);
}

.detail-panel {
  padding: 22px;
}

.detail-poster {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.1);
}

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

.detail-panel h1 {
  margin: 18px 0 12px;
  color: #fff;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0;
}

.meta-row span {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 11px;
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.62);
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  margin: 24px 0 54px;
}

.story-panel {
  padding: clamp(22px, 4vw, 34px);
}

.story-panel h2 {
  margin: 0 0 16px;
  font-size: 1.6rem;
}

.story-panel p {
  margin: 0 0 18px;
  color: #cbd5e1;
  line-height: 1.95;
}

.aside-stack {
  display: grid;
  gap: 16px;
}

.aside-card {
  padding: 22px;
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.7);
}

.aside-card h3 {
  margin: 0 0 14px;
}

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

.site-footer {
  margin-top: 80px;
  border-top: 1px solid rgba(30, 41, 59, 0.82);
  background: rgba(2, 6, 23, 0.72);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 1.2rem;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
  line-height: 1.85;
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

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

.site-footer h3 {
  margin: 0 0 12px;
  color: #fff;
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: var(--soft);
  border-top: 1px solid rgba(30, 41, 59, 0.8);
}

.empty-state {
  display: none;
  padding: 32px;
  border: 1px dashed rgba(51, 65, 85, 0.9);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
}

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

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

  .main-nav {
    gap: 12px;
  }
}

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

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

  .hero,
  .hero-slide {
    min-height: 720px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    align-content: end;
    padding-bottom: 92px;
  }

  .hero-poster {
    display: none;
  }

  .category-grid,
  .rank-layout,
  .detail-top,
  .story-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .page-main,
  .footer-grid,
  .footer-bottom,
  .mobile-panel nav,
  .mobile-search-box {
    width: min(100% - 22px, 1280px);
  }

  .brand-text small {
    display: none;
  }

  .hero {
    margin-top: 14px;
    border-radius: 22px;
  }

  .hero-slide {
    padding: 24px 22px 82px;
  }

  .hero h1,
  .hero h2 {
    font-size: clamp(2.15rem, 13vw, 3.8rem);
  }

  .hero-controls {
    left: 22px;
    right: 22px;
  }

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

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

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

  .card-content small {
    -webkit-line-clamp: 1;
  }

  .compact-card {
    flex-direction: column;
  }

  .compact-card .poster-wrap {
    width: auto;
    min-width: 0;
  }

  .compact-card .poster-wrap img {
    height: auto;
    aspect-ratio: 2 / 3;
  }

  .player-info {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .movie-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
}
