:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --line-bright: rgba(16, 185, 129, 0.42);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --subtle: #64748b;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.18);
  --cyan: #22d3ee;
  --amber: #f59e0b;
  --danger: #fb7185;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --container: min(1180px, calc(100vw - 32px));
}

* {
  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(16, 185, 129, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(16, 185, 129, 0.16));
}

button,
input,
select {
  font: inherit;
}

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

.header-inner {
  width: var(--container);
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-link,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 800;
}

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

.logo-text,
.footer-logo span:last-child {
  font-size: 20px;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.nav-link,
.mobile-link {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 650;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: #34d399;
}

.header-search,
.mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-panel input,
.filter-panel select {
  min-width: 0;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
  width: 210px;
  padding: 10px 14px;
}

.header-search button,
.mobile-search button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #04111d;
  font-weight: 800;
  background: linear-gradient(135deg, #34d399, #22d3ee);
}

.header-search input:focus,
.mobile-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
  background: rgba(15, 23, 42, 0.98);
}

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

.mobile-menu {
  display: none;
  width: var(--container);
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-menu.is-open {
  display: grid;
  gap: 12px;
}

.mobile-search input {
  flex: 1;
  padding: 12px 14px;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-bg,
.detail-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
}

.hero-bg::after,
.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.96)),
    radial-gradient(circle at 18% 22%, rgba(16, 185, 129, 0.22), transparent 24rem);
}

.hero-content {
  position: relative;
  width: var(--container);
  min-height: 690px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 420px);
  align-items: center;
  gap: 54px;
  padding: 96px 0 82px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
  margin: 16px 0;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.08em;
}

.hero-copy p,
.page-hero p,
.detail-one-line {
  max-width: 710px;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.82;
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags {
  margin: 22px 0 0;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  font-size: 12px;
  font-weight: 700;
}

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

.primary-btn,
.ghost-btn,
.section-more,
.rank-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 850;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  color: #03131f;
  background: linear-gradient(135deg, #34d399, #22d3ee);
  box-shadow: 0 18px 42px rgba(16, 185, 129, 0.26);
}

.ghost-btn,
.section-more,
.rank-action {
  color: #d1fae5;
  border: 1px solid rgba(16, 185, 129, 0.38);
  background: rgba(15, 23, 42, 0.62);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover,
.rank-action:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.72);
  box-shadow: 0 18px 42px rgba(16, 185, 129, 0.18);
}

.hero-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 30px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: var(--shadow);
}

.hero-poster::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: inherit;
  pointer-events: none;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 5;
  width: var(--container);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.hero-arrow,
.hero-dot {
  pointer-events: auto;
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #d1fae5;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.hero-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
}

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

.hero-dot {
  width: 32px;
  height: 8px;
  border-radius: 999px;
  padding: 0;
}

.hero-dot.is-active {
  border-color: transparent;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
}

.page-main {
  width: var(--container);
  margin: 0 auto;
}

.page-hero {
  position: relative;
  min-height: 330px;
  margin: 34px 0 0;
  padding: 58px;
  display: flex;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 24rem);
}

.page-hero > div {
  position: relative;
  z-index: 1;
}

.page-hero-small {
  min-height: 260px;
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.24), transparent 26rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.94));
}

.content-section {
  width: var(--container);
  margin: 0 auto;
  padding: 54px 0 0;
}

.page-main .content-section {
  width: 100%;
}

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

.section-heading h2 {
  margin: 8px 0 8px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.section-heading p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.75;
}

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

.category-tile,
.category-detail-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s ease, border 0.24s ease, box-shadow 0.24s ease;
}

.category-tile {
  min-height: 216px;
  padding: 16px;
}

.category-tile:hover,
.category-detail-tile:hover,
.movie-card:hover,
.rank-row:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.46);
  box-shadow: 0 22px 70px rgba(16, 185, 129, 0.1);
}

.category-thumbs,
.category-detail-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.category-thumbs img {
  height: 82px;
  border-radius: 14px;
}

.category-tile strong {
  display: block;
  margin: 14px 0 6px;
  font-size: 19px;
}

.category-tile span,
.category-detail-tile p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

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

.category-detail-tile {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
}

.category-detail-thumbs img {
  height: 92px;
  border-radius: 14px;
}

.category-detail-tile span {
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 800;
}

.category-detail-tile h2 {
  margin: 8px 0;
  font-size: 28px;
  letter-spacing: -0.05em;
}

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

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

.movie-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.76);
  transition: transform 0.24s ease, border 0.24s ease, box-shadow 0.24s ease;
}

.movie-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

.movie-poster img {
  transition: transform 0.42s ease, filter 0.42s ease;
}

.movie-card:hover .movie-poster img {
  transform: scale(1.06);
  filter: saturate(1.14) brightness(1.06);
}

.poster-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #052e2b;
  background: linear-gradient(135deg, #34d399, #22d3ee);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
  transform: translateY(0);
}

.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #0f172a;
  background: linear-gradient(135deg, #f59e0b, #fde68a);
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.22);
}

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

.movie-meta-line,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--subtle);
  font-size: 12px;
}

.movie-card h3 {
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.movie-card h3 a:hover,
.rank-content h2 a:hover {
  color: #34d399;
}

.movie-card p {
  min-height: 68px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.movie-card-compact {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
}

.movie-card-compact .movie-poster {
  min-height: 198px;
}

.movie-card-compact .movie-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 14px;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
}

.filter-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  padding: 12px 14px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 92px 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.76);
  transition: transform 0.24s ease, border 0.24s ease, box-shadow 0.24s ease;
}

.rank-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
}

.rank-index {
  color: #fef3c7;
  font-size: 26px;
  font-weight: 950;
  text-align: center;
}

.rank-content h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.rank-content p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.62;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-hero {
  position: relative;
  min-height: 540px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: center;
  gap: 42px;
  padding: 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: var(--shadow);
}

.detail-poster,
.detail-info {
  position: relative;
  z-index: 1;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.detail-info h1 {
  font-size: clamp(38px, 5vw, 66px);
}

.detail-meta {
  gap: 10px;
  margin: 18px 0;
  color: #cbd5e1;
}

.detail-meta span {
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.32);
}

.detail-tags {
  margin-bottom: 22px;
}

.player-section {
  scroll-margin-top: 92px;
}

.movie-player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow);
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 12px;
  color: white;
  border: 0;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.2), rgba(2, 6, 23, 0.68));
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.movie-player.is-playing .player-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #022c22;
  background: linear-gradient(135deg, #34d399, #22d3ee);
  box-shadow: 0 18px 52px rgba(16, 185, 129, 0.32);
  font-size: 34px;
}

.article-block {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
}

.article-block h2 {
  margin: 0 0 12px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.article-block h2:not(:first-child) {
  margin-top: 28px;
}

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

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

.footer-inner {
  width: var(--container);
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 38px;
}

.footer-inner p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.75;
}

.footer-inner h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

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

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

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

[data-movie-card].is-hidden {
  display: none;
}

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

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

  .header-search {
    margin-left: auto;
  }

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

  .hero-poster,
  .detail-poster {
    max-width: 340px;
  }

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

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

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

  .hero-carousel,
  .hero-content {
    min-height: 640px;
  }

  .hero-content {
    padding-top: 72px;
    gap: 30px;
  }

  .hero-poster {
    display: none;
  }

  .page-hero,
  .detail-hero {
    padding: 28px;
  }

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

  .category-detail-tile,
  .movie-card-compact {
    grid-template-columns: 1fr;
  }

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

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

  .rank-index {
    position: absolute;
    margin-left: 8px;
    margin-top: 8px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.72);
  }

  .rank-action {
    grid-column: 2;
    justify-self: start;
  }

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

@media (max-width: 560px) {
  :root {
    --container: min(100vw - 22px, 1180px);
  }

  .header-inner {
    height: 64px;
    gap: 12px;
  }

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

  .hero-copy h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 38px;
  }

  .hero-copy p,
  .page-hero p,
  .detail-one-line {
    font-size: 15px;
  }

  .hero-controls {
    bottom: 22px;
  }

  .content-section {
    padding-top: 38px;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

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

  .detail-hero {
    gap: 24px;
  }

  .detail-poster {
    max-width: 260px;
  }

  .movie-player {
    border-radius: 18px;
  }
}
