:root {
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  --radius: 22px;
}

* {
  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;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.36);
}

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

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-text small {
  color: #cbd5e1;
  font-size: 12px;
  margin-top: 3px;
}

.desktop-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(148, 163, 184, 0.18);
}

.top-search,
.mobile-search,
.inline-search {
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.top-search input,
.mobile-search input,
.inline-search input {
  width: 230px;
  min-width: 0;
  padding: 11px 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.top-search input::placeholder,
.mobile-search input::placeholder,
.inline-search input::placeholder {
  color: #94a3b8;
}

.top-search button,
.mobile-search button,
.inline-search button {
  border: 0;
  padding: 11px 18px;
  color: #fff;
  background: var(--emerald-dark);
  font-weight: 800;
}

.mobile-menu-button {
  display: none;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.18);
  color: #fff;
  padding: 9px 12px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding: 14px 24px 20px;
}

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

.mobile-nav {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.hero-carousel {
  position: relative;
  height: 600px;
  max-width: none;
  margin: 0 -24px 42px;
  overflow: hidden;
  background: var(--dark);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: center;
}

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.05);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 35%, rgba(16, 185, 129, 0.38), transparent 34%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.74) 42%, rgba(15, 23, 42, 0.12) 100%);
}

.hero-overlay {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(0deg, var(--bg), transparent);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 42px 24px;
  margin-left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  color: #fff;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 900;
}

.hero-content h1 {
  margin: 0 0 16px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.hero-summary {
  max-width: 640px;
  margin: 0 0 22px;
  color: #e2e8f0;
  font-size: 18px;
}

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

.hero-tags span,
.tag-row span {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.13);
  color: #047857;
  font-size: 12px;
  font-weight: 800;
}

.hero-content .hero-tags span {
  background: rgba(255, 255, 255, 0.12);
  color: #d1fae5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-actions.inline {
  margin-top: 20px;
}

.primary-button,
.ghost-button,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 900;
  transition: 0.2s ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.35);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(16, 185, 129, 0.45);
}

.ghost-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(10px);
}

.section-more {
  color: var(--emerald-dark);
  background: #ecfdf5;
}

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

.hero-dot {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  transition: 0.2s ease;
}

.hero-dot.active {
  width: 36px;
  background: #34d399;
}

.quick-search-panel,
.section-block,
.page-hero,
.category-overview-card,
.detail-hero,
.player-section,
.breadcrumb {
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.quick-search-panel {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin-bottom: 34px;
}

.quick-search-panel h2,
.section-head h2,
.page-hero h1,
.category-overview-head h2,
.detail-info h1,
.article-block h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.inline-search {
  background: #f1f5f9;
  border-color: var(--line);
}

.inline-search input {
  width: 100%;
  color: var(--text);
}

.section-block {
  padding: 30px;
  margin-bottom: 34px;
}

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

.section-head.compact {
  align-items: center;
}

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

.category-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  isolation: isolate;
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: 0.4s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.08));
  z-index: -1;
}

.category-tile:hover img {
  transform: scale(1.08);
}

.category-tile span {
  font-size: 20px;
  font-weight: 950;
}

.category-tile p {
  margin: 5px 0 0;
  color: #cbd5e1;
  font-size: 13px;
}

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #eef2f7;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.poster-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.42s ease;
}

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

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent 54%);
  opacity: 0.9;
}

.poster-frame figcaption {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  color: #fff;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
}

.card-body {
  padding: 16px;
}

.card-body h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.28;
}

.card-meta,
.card-line {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.card-line {
  color: #334155;
}

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

.ranking-panel {
  border-radius: 20px;
  padding: 22px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
}

.sticky-panel {
  position: sticky;
  top: 96px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 42px 56px minmax(0, 1fr);
  grid-template-areas:
    "num img title"
    "num img meta";
  gap: 2px 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  transition: 0.2s ease;
}

.rank-item:hover {
  background: rgba(16, 185, 129, 0.18);
}

.rank-number {
  grid-area: num;
  color: #34d399;
  font-weight: 950;
  font-size: 20px;
}

.rank-item img {
  grid-area: img;
  width: 56px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.rank-title {
  grid-area: title;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.rank-meta {
  grid-area: meta;
  color: #cbd5e1;
  font-size: 12px;
}

.page-hero {
  margin: 32px 0;
  padding: 46px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(16, 185, 129, 0.38), transparent 36%),
    linear-gradient(135deg, #0f172a, #1e293b);
}

.page-hero p {
  max-width: 780px;
  margin: 14px 0 0;
  color: #dbeafe;
}

.overview-stack {
  display: grid;
  gap: 28px;
}

.category-overview-card {
  padding: 28px;
}

.category-overview-head p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 14px;
  margin: 0 0 26px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: 0;
  background: #f8fafc;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.breadcrumb {
  margin: 26px 0 24px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--emerald-dark);
  font-weight: 800;
}

.detail-hero {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 34px;
  padding: 34px;
  margin-bottom: 34px;
  background:
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.14), transparent 36%),
    #fff;
}

.detail-poster {
  overflow: hidden;
  border-radius: 22px;
  aspect-ratio: 4 / 5;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.detail-line {
  max-width: 760px;
  color: #334155;
  font-size: 19px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.detail-meta-grid span {
  border-radius: 16px;
  padding: 13px;
  background: #f1f5f9;
  color: #334155;
}

.detail-meta-grid b {
  display: block;
  color: #0f172a;
  margin-bottom: 4px;
}

.player-section {
  padding: 30px;
  margin-bottom: 34px;
}

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

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

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.34));
  cursor: pointer;
}

.play-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding-left: 5px;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.42);
  font-size: 30px;
}

.article-block article,
.article-block p {
  color: #334155;
  font-size: 17px;
}

.article-block h2 + article,
.article-block h2 + p {
  margin-top: 12px;
}

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

.site-footer {
  color: #cbd5e1;
  background: #0f172a;
  padding: 48px 24px 28px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.site-footer h2 {
  color: #fff;
  margin: 0 0 14px;
  font-size: 18px;
}

.site-footer p {
  margin: 14px 0 0;
  max-width: 600px;
}

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

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

.copyright {
  max-width: 1280px;
  margin: 30px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.hidden-by-filter {
  display: none !important;
}

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

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

  .two-column,
  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .header-inner {
    padding: 0 16px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-button {
    display: inline-block;
    margin-left: auto;
  }

  main {
    padding: 0 16px 44px;
  }

  .hero-carousel {
    height: 560px;
    margin-left: -16px;
    margin-right: -16px;
  }

  .hero-content {
    margin-left: 0;
    padding: 28px 18px;
  }

  .quick-search-panel,
  .detail-hero,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .section-block,
  .page-hero,
  .category-overview-card,
  .detail-hero,
  .player-section {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .brand-text small {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

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

  .hero-content h1 {
    font-size: 36px;
  }

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

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