:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --emerald: #059669;
  --emerald-dark: #047857;
  --teal: #0f766e;
  --cyan: #0891b2;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.nav-shell {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(5, 150, 105, 0.3);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: #334155;
  font-weight: 650;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--emerald-dark);
  background: #ecfdf5;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #334155;
  border-radius: 999px;
}

.mobile-panel {
  display: none;
  padding: 0 16px 16px;
}

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

.mobile-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: #334155;
  background: #f8fafc;
  font-weight: 650;
}

.hero-carousel {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: linear-gradient(135deg, #064e3b, #0f766e, #164e63);
}

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

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

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

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, .88), rgba(15, 23, 42, .58), rgba(15, 23, 42, .10));
}

.hero-content {
  position: absolute;
  top: 50%;
  left: max(24px, calc((100% - 1180px) / 2));
  width: min(640px, calc(100% - 48px));
  transform: translateY(-50%);
  color: #fff;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #d1fae5;
  background: rgba(5, 150, 105, .24);
  backdrop-filter: blur(10px);
  font-weight: 700;
}

.hero-content h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 600px;
  margin: 0 0 30px;
  color: #e2e8f0;
  font-size: clamp(17px, 2.2vw, 22px);
}

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

.primary-btn,
.ghost-btn,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  box-shadow: 0 16px 35px rgba(5, 150, 105, .3);
}

.primary-btn:hover,
.ghost-btn:hover,
.text-link:hover {
  transform: translateY(-2px);
}

.ghost-btn {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
}

.text-link {
  min-height: 0;
  padding: 0;
  color: var(--emerald-dark);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.hero-arrow:hover {
  background: rgba(255, 255, 255, .28);
}

.hero-arrow.prev {
  left: 24px;
}

.hero-arrow.next {
  right: 24px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}

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

.page-hero,
.ranking-hero {
  color: #fff;
  background: linear-gradient(135deg, #064e3b, #0f766e, #164e63);
}

.page-hero {
  padding: 86px 0;
}

.page-hero.mini {
  padding: 72px 0;
}

.page-hero p,
.ranking-hero p {
  margin: 0 0 10px;
  color: #a7f3d0;
  font-weight: 800;
}

.page-hero h1,
.ranking-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

.page-hero span,
.ranking-hero span {
  display: block;
  max-width: 720px;
  color: #e2e8f0;
  font-size: 18px;
}

.ranking-hero {
  min-height: 460px;
  background-size: cover;
  background-position: center;
}

.ranking-hero-inner {
  min-height: 460px;
  display: flex;
  align-items: center;
}

.ranking-hero span {
  margin-bottom: 28px;
}

.content-section {
  padding: 72px 0;
}

.content-section.white {
  background: #fff;
}

.content-section.soft {
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
}

.content-section.accent {
  color: #fff;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.section-bar {
  width: 5px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--emerald), var(--cyan));
}

.section-title h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.1;
}

.accent .section-bar {
  background: rgba(255, 255, 255, .65);
}

.card-grid {
  display: grid;
  gap: 24px;
}

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

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

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

.movie-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.movie-card:hover {
  border-color: rgba(5, 150, 105, .35);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.movie-card .poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.movie-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

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

.score,
.rank-badge {
  position: absolute;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  background: rgba(5, 150, 105, .92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.score {
  right: 12px;
}

.rank-badge {
  left: 12px;
  background: rgba(15, 23, 42, .78);
}

.card-body {
  padding: 18px;
}

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

.meta-line span,
.detail-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

.movie-card h3 {
  margin: 12px 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.movie-card h3 a:hover {
  color: var(--emerald-dark);
}

.movie-card p {
  margin: 0 0 14px;
  color: #475569;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  font-size: 12px;
  font-weight: 800;
}

.movie-card.horizontal {
  display: grid;
  grid-template-columns: 220px 1fr;
}

.movie-card.horizontal .poster {
  height: 100%;
  aspect-ratio: auto;
}

.movie-card.large {
  background: rgba(255, 255, 255, .96);
}

.movie-card.compact .poster {
  aspect-ratio: 4 / 3;
}

.movie-card.compact .card-body {
  padding: 14px;
}

.movie-card.compact h3 {
  font-size: 16px;
}

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

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

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

.category-tile {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  color: #fff;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  transition: transform .24s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
}

.category-tile span {
  font-size: 22px;
  font-weight: 900;
}

.category-tile strong {
  color: #dcfce7;
  font-size: 14px;
}

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

.category-card {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

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

.category-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
}

.category-copy h2 {
  margin: 2px 0 8px;
  font-size: 26px;
}

.category-copy p {
  color: #475569;
}

.filter-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  margin: -4px 0 28px;
}

.filter-box input,
.filter-box select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .05);
}

.filter-box input:focus,
.filter-box select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, .12);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 36px;
}

.ranking-layout {
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 44px 94px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
  transition: transform .2s ease, border-color .2s ease;
}

.ranking-row:hover {
  border-color: rgba(5, 150, 105, .35);
  transform: translateX(4px);
}

.ranking-row img {
  width: 94px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}

.ranking-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  font-weight: 900;
}

.ranking-copy {
  min-width: 0;
}

.ranking-copy strong,
.ranking-copy em {
  display: block;
}

.ranking-copy strong {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-copy em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.player-section {
  padding: 28px 0;
  background: #020617;
}

.player-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: radial-gradient(circle at center, rgba(0, 0, 0, .08), rgba(0, 0, 0, .55));
  cursor: pointer;
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  padding-left: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  box-shadow: 0 22px 45px rgba(5, 150, 105, .35);
  font-size: 34px;
}

.player-state {
  position: absolute;
  left: 18px;
  bottom: 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.detail-content {
  background: #f8fafc;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
}

.detail-main,
.side-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

.detail-main {
  padding: 30px;
}

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

.breadcrumb a:hover {
  color: var(--emerald-dark);
}

.detail-main h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.detail-tags {
  margin: 18px 0 28px;
}

.story-block,
.review-block {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.story-block h2,
.review-block h2,
.side-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

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

.review-block {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
}

.detail-side {
  display: grid;
  gap: 20px;
  align-content: start;
}

.side-card {
  padding: 18px;
}

.poster-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 14px;
}

.primary-btn.full {
  width: 100%;
}

.side-related {
  display: grid;
  gap: 12px;
}

.side-related-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  transition: background .2s ease;
}

.side-related-item:hover {
  background: #f8fafc;
}

.side-related-item img {
  width: 92px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
}

.side-related-item strong,
.side-related-item em {
  display: block;
}

.side-related-item strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.side-related-item em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.site-footer {
  color: #cbd5e1;
  background: linear-gradient(135deg, #020617, #0f172a, #111827);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 34px;
  padding: 48px 0;
}

.footer-brand {
  margin-bottom: 12px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.site-footer p {
  max-width: 520px;
  color: #94a3b8;
}

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

.site-footer a {
  display: block;
  margin: 8px 0;
  color: #94a3b8;
}

.site-footer a:hover {
  color: #6ee7b7;
}

.footer-bottom {
  padding: 18px;
  border-top: 1px solid rgba(148, 163, 184, .18);
  color: #64748b;
  text-align: center;
}

@media (max-width: 1100px) {
  .card-grid.four,
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split-layout,
  .ranking-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

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

  .menu-toggle {
    display: block;
  }

  .hero-carousel {
    height: 540px;
  }

  .hero-content {
    left: 24px;
  }

  .hero-arrow {
    display: none;
  }

  .card-grid.two,
  .card-grid.three,
  .card-grid.four,
  .category-grid,
  .category-card-grid,
  .compact-grid,
  .footer-grid,
  .detail-side {
    grid-template-columns: 1fr;
  }

  .movie-card.horizontal {
    grid-template-columns: 1fr;
  }

  .movie-card.horizontal .poster {
    aspect-ratio: 16 / 10;
  }

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

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

  .content-section {
    padding: 52px 0;
  }

  .detail-main {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .container,
  .nav-shell,
  .footer-grid,
  .player-shell {
    width: min(100% - 24px, 1180px);
  }

  .hero-carousel {
    height: 500px;
  }

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

  .hero-actions {
    display: grid;
  }

  .ranking-row {
    grid-template-columns: 38px 78px 1fr;
  }

  .ranking-row img {
    width: 78px;
    height: 58px;
  }

  .player-frame {
    border-radius: 16px;
  }
}
