:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.74);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(16, 185, 129, 0.38);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #10b981;
  --accent-2: #14b8a6;
  --accent-3: #34d399;
  --danger: #f97316;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 0%, rgba(16, 185, 129, 0.18), transparent 34rem),
    radial-gradient(circle at 90% 8%, rgba(20, 184, 166, 0.12), transparent 30rem),
    linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.78));
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.site-logo span:last-child,
.footer-logo span:last-child {
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #052e2b;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.32);
  font-size: 14px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: #cbd5e1;
  font-size: 15px;
  transition: color 0.22s ease, transform 0.22s ease;
}

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

.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.mobile-nav.open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.66);
}

main {
  padding-top: 64px;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #020617;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(1.08) contrast(1.04);
}

.hero-slide img.is-hidden,
.category-covers img.is-hidden {
  opacity: 0;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.82) 45%, rgba(15, 23, 42, 0.32) 78%, rgba(2, 6, 23, 0.86) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 1180px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--accent-3);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-content h1,
.page-hero h1 {
  width: min(720px, 100%);
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-content p,
.page-hero p {
  width: min(680px, 100%);
  margin: 0 0 24px;
  color: #cbd5e1;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-tags,
.detail-tags,
.poster-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.detail-tags span,
.poster-tags span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(16, 185, 129, 0.36);
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.16);
  font-size: 13px;
}

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

.btn,
.hero-search button,
.filter-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.btn.primary,
.hero-search button {
  color: #052e2b;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 18px 44px rgba(16, 185, 129, 0.28);
}

.btn.ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(15, 23, 42, 0.72);
}

.btn.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.btn:hover,
.hero-search button:hover,
.filter-bar button:hover {
  transform: translateY(-2px);
}

.hero-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
}

.hero-arrow.prev {
  left: max(18px, calc((100% - 1180px) / 2));
}

.hero-arrow.next {
  right: max(18px, calc((100% - 1180px) / 2));
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.4);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
  width: 32px;
  background: var(--accent-3);
}

.hero-search {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 70px;
  width: min(540px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(16px);
}

.hero-search input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  outline: 0;
  background: rgba(15, 23, 42, 0.72);
  padding: 0 16px;
}

.hero-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--line-strong);
}

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

.content-section.tinted {
  width: 100%;
  max-width: none;
  padding: 72px max(16px, calc((100% - 1180px) / 2));
  background: rgba(15, 23, 42, 0.34);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

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

.section-heading.center {
  justify-content: center;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

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

.more-link {
  color: var(--accent-3);
  font-weight: 800;
}

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

.category-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.54));
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
}

.category-card strong {
  display: block;
  margin-top: 16px;
  font-size: 20px;
}

.category-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 84px;
}

.category-covers img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(20, 184, 166, 0.12));
}

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

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

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

.movie-card-link {
  display: block;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.22);
  transition: transform 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

.movie-card-link:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 70px rgba(16, 185, 129, 0.14);
}

.poster-frame {
  position: relative;
  height: 260px;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent 50%),
    linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.08));
}

.card-small .poster-frame {
  height: 190px;
}

.card-large .poster-frame {
  height: 330px;
}

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

.poster-fallback img {
  opacity: 0;
}

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

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.12) 55%, transparent);
}

.poster-tags {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  bottom: 12px;
}

.poster-tags span {
  font-size: 12px;
  padding: 4px 8px;
}

.rank-badge {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #052e2b;
  background: linear-gradient(135deg, #fbbf24, #34d399);
  font-weight: 900;
}

.movie-card-body {
  padding: 16px;
}

.movie-card-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.movie-card-body p {
  min-height: 46px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-2);
  font-size: 13px;
}

.movie-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}

.movie-rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 18px;
  scrollbar-width: none;
}

.movie-rail::-webkit-scrollbar {
  display: none;
}

.rail-item {
  width: 318px;
  flex: 0 0 318px;
  scroll-snap-align: start;
}

.rail-buttons {
  display: flex;
  gap: 10px;
}

.rail-buttons button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  font-size: 24px;
}

.split-section {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.62);
  transition: border-color 0.22s ease, transform 0.22s ease;
}

.compact-card:hover {
  transform: translateX(3px);
  border-color: var(--line-strong);
}

.compact-rank {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #052e2b;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  font-size: 13px;
  font-weight: 900;
}

.compact-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.compact-desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.page-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0 34px;
}

.page-hero.slim {
  min-height: 300px;
  display: flex;
  align-items: end;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, 180px);
  gap: 12px;
  margin-bottom: 26px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.search-filter {
  grid-template-columns: minmax(220px, 1fr) repeat(3, 170px);
}

.category-panels {
  display: grid;
  gap: 22px;
}

.category-panel,
.ranking-panel,
.detail-card,
.player-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: var(--shadow);
}

.category-panel {
  padding: 24px;
}

.category-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.category-panel h2,
.ranking-panel h2 {
  margin: 0 0 8px;
}

.category-panel p {
  margin: 0;
  color: var(--muted);
}

.ranking-grid {
  counter-reset: movie-rank;
}

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

.ranking-panel {
  padding: 18px;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--accent-3);
}

.player-card {
  margin-bottom: 24px;
  overflow: hidden;
}

.video-shell {
  position: relative;
  background: #000;
}

.hls-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.play-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  min-width: 136px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  color: #052e2b;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 20px 55px rgba(16, 185, 129, 0.38);
  font-weight: 900;
  cursor: pointer;
}

.play-overlay.is-hidden {
  display: none;
}

.detail-card {
  padding: clamp(22px, 4vw, 36px);
  margin-bottom: 34px;
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.detail-head h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.detail-head p {
  max-width: 780px;
  margin: 0;
  color: #cbd5e1;
  font-size: 18px;
}

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

.article-body {
  margin-top: 28px;
}

.article-body h2 {
  margin: 28px 0 10px;
  font-size: 24px;
}

.article-body p {
  margin: 0;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.9;
}

.related-section {
  width: 100%;
  padding: 18px 0 0;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.78);
}

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

.footer-grid p {
  max-width: 430px;
  color: var(--muted);
}

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

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

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

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

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--muted-2);
  text-align: center;
  font-size: 14px;
}

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

  .split-section {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .hero-carousel {
    min-height: 680px;
  }

  .hero-content {
    justify-content: flex-start;
    padding-top: 86px;
  }

  .hero-search {
    grid-template-columns: 1fr;
    border-radius: 24px;
    bottom: 64px;
  }

  .hero-arrow {
    display: none;
  }

  .content-section,
  .content-section.tinted {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .section-heading,
  .category-panel-head,
  .detail-head {
    display: block;
  }

  .category-grid,
  .movie-grid,
  .mini-grid,
  .related-grid,
  .ranking-panels,
  .compact-list.two-col {
    grid-template-columns: 1fr;
  }

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

  .poster-frame {
    height: 300px;
  }

  .rail-item {
    width: 82vw;
    flex-basis: 82vw;
  }

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