:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --soft: #e2e8f0;
  --brand: #10b981;
  --brand-dark: #059669;
  --brand-soft: #d1fae5;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  backdrop-filter: blur(18px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #0f766e);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.32);
}

.brand-text {
  font-size: 20px;
}

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: #334155;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #047857;
  background: var(--brand-soft);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 22px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-nav.is-open {
  display: grid;
  gap: 6px;
}

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

.hero-stage {
  position: relative;
  height: 560px;
}

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

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

.hero-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.18)), linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.08));
}

.hero-content {
  position: absolute;
  left: max(32px, calc((100% - 1180px) / 2));
  bottom: 92px;
  width: min(720px, calc(100% - 64px));
  color: #fff;
}

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

.hero-tags span,
.detail-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span,
.detail-tags span {
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
  border: 1px solid rgba(167, 243, 208, 0.25);
}

.hero-content h1 {
  margin: 16px 0 12px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 650px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.movie-meta {
  color: var(--muted);
  font-size: 13px;
}

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

.primary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.primary-button {
  min-height: 46px;
  padding: 0 24px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.35);
}

.primary-button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.ghost-button {
  min-height: 46px;
  padding: 0 24px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-dots {
  position: absolute;
  right: max(32px, calc((100% - 1180px) / 2));
  bottom: 44px;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 38px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
}

.hero-dot.is-active {
  background: #fff;
}

.hero-search-card {
  position: absolute;
  left: 50%;
  bottom: -38px;
  transform: translateX(-50%);
  width: min(860px, calc(100% - 32px));
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  z-index: 5;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: #047857;
  font-size: 13px;
  font-weight: 800;
}

.search-panel {
  position: relative;
}

.search-panel input,
.filter-bar input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--soft);
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text);
  background: #fff;
  outline: 0;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-panel input:focus,
.filter-bar input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 60;
}

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

.search-result-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
}

.search-result-item:hover {
  background: #ecfdf5;
}

.search-result-item img {
  width: 58px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
}

.search-result-item strong,
.compact-item strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-item small,
.compact-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.page-section {
  padding: 76px 0 0;
}

.page-main {
  padding: 36px 0 80px;
}

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

.section-head.slim {
  margin-bottom: 16px;
}

.section-head h2,
.page-title-block h1,
.content-card h2,
.rank-panel h2,
.category-overview-card h2 {
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.section-head p,
.page-title-block p,
.category-overview-card p,
.content-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #047857;
  font-weight: 800;
}

.section-link:hover {
  color: #065f46;
}

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

.category-card,
.category-overview-card,
.content-card,
.rank-panel {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.category-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  padding: 18px;
  display: flex;
  align-items: end;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.movie-card:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.16));
}

.category-card div {
  position: relative;
  z-index: 1;
  color: #fff;
}

.category-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.category-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e2e8f0;
}

.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);
}

.type-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.type-badge {
  left: 10px;
  top: 10px;
  padding: 4px 9px;
  color: #064e3b;
  background: rgba(209, 250, 229, 0.92);
}

.rank-badge {
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

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

.movie-card h3 {
  margin: 8px 0 6px;
  font-size: 16px;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: #047857;
}

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

.tag-row span {
  color: #047857;
  background: #ecfdf5;
}

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

.rank-panel {
  position: sticky;
  top: 88px;
  padding: 18px;
}

.rank-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rank-panel-head a {
  color: #047857;
  font-weight: 800;
}

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

.compact-item {
  display: grid;
  grid-template-columns: 34px 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.compact-item:hover {
  background: #f0fdf4;
}

.compact-item > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #047857;
  background: #d1fae5;
  font-weight: 900;
}

.compact-item img {
  width: 56px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
}

.page-title-block {
  margin-bottom: 28px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  border: 1px solid rgba(167, 243, 208, 0.75);
}

.page-title-block > p:first-child {
  margin: 0 0 4px;
  color: #047857;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-title-block h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.title-line {
  width: 72px;
  height: 5px;
  margin: 14px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #14b8a6);
}

.category-overview-grid {
  display: grid;
  gap: 18px;
}

.category-overview-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-cover {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: #e2e8f0;
}

.category-cover img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.category-overview-card h2 {
  font-size: 24px;
}

.mini-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.mini-title-row span {
  padding: 4px 10px;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  font-size: 12px;
  font-weight: 700;
}

.text-button {
  color: #047857;
}

.filter-bar {
  margin: 0 0 24px;
}

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

.breadcrumb a:hover {
  color: #047857;
}

.breadcrumb.inverted {
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumb.inverted a:hover {
  color: #fff;
}

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

.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(8px) scale(1.06);
  opacity: 0.58;
}

.detail-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.62)), linear-gradient(0deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.18));
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
  padding: 38px 0 54px;
  color: #fff;
}

.detail-title-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: end;
  gap: 30px;
  margin-top: 44px;
}

.detail-poster {
  width: 240px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: #0f172a;
}

.eyebrow {
  margin: 0 0 8px;
  color: #a7f3d0;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-title-row h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.detail-title-row p:not(.eyebrow) {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 24px;
  padding: 34px 0 80px;
}

.detail-main,
.detail-side {
  display: grid;
  gap: 22px;
}

.content-card {
  padding: 22px;
}

.content-card h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.content-card p {
  color: #334155;
  font-size: 16px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: #000;
  cursor: pointer;
  z-index: 3;
}

.player-cover.is-hidden {
  display: none;
}

.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
}

.play-circle {
  position: relative;
  z-index: 2;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 18px 42px rgba(16, 185, 129, 0.36);
  font-size: 34px;
  padding-left: 5px;
}

.info-list {
  margin: 0;
  display: grid;
  gap: 12px;
}

.info-list div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.info-list dt {
  color: var(--muted);
  font-weight: 700;
}

.info-list dd {
  margin: 0;
  color: #0f172a;
}

.info-list a {
  color: #047857;
  font-weight: 800;
}

.side-list .compact-item {
  grid-template-columns: 28px 54px minmax(0, 1fr);
}

.site-footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-inner strong {
  display: block;
  margin-bottom: 8px;
  color: #064e3b;
  font-size: 20px;
}

.footer-inner p {
  max-width: 680px;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 14px;
  white-space: nowrap;
}

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

.is-filtered-out {
  display: none !important;
}

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

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

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

  .rank-panel {
    position: static;
  }
}

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

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

  .home-hero,
  .hero-stage {
    min-height: 620px;
    height: 620px;
  }

  .hero-content {
    left: 22px;
    bottom: 126px;
    width: calc(100% - 44px);
  }

  .hero-content p {
    font-size: 16px;
  }

  .hero-dots {
    left: 22px;
    right: auto;
    bottom: 88px;
  }

  .hero-search-card {
    bottom: -54px;
  }

  .page-section {
    padding-top: 86px;
  }

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

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

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

  .category-cover img {
    height: 220px;
  }

  .detail-title-row {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }

  .detail-poster {
    width: 180px;
  }

  .detail-hero {
    min-height: 650px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .container,
  .header-inner,
  .mobile-nav,
  .footer-inner {
    width: min(100% - 22px, 1180px);
  }

  .brand-text {
    font-size: 18px;
  }

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

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

  .poster-link {
    height: 100%;
    min-height: 178px;
  }

  .movie-card p {
    height: auto;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .content-card {
    padding: 18px;
  }

  .play-circle {
    width: 66px;
    height: 66px;
    font-size: 28px;
  }
}
