:root {
  --primary-50: #f0f9f4;
  --primary-100: #dcf2e4;
  --primary-600: #267f56;
  --primary-700: #1f6546;
  --accent-400: #f0a838;
  --accent-600: #cf6913;
  --ink-900: #3d3d3d;
  --ink-700: #525252;
  --ink-500: #737373;
  --paper-50: #fafaf9;
  --paper-200: #e7e5e4;
  --paper-300: #d6d3d1;
  --paper-400: #a8a29e;
  --paper-500: #78716c;
  --white: #ffffff;
  --shadow-md: 0 4px 18px rgba(34, 34, 34, 0.1);
  --shadow-lg: 0 18px 45px rgba(34, 34, 34, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-900);
  background: var(--paper-50);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--primary-100);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(14px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  box-shadow: var(--shadow-md);
}

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

.brand-name {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900);
}

.brand-tagline {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-500);
}

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

.nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-700);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--primary-600);
}

.menu-toggle {
  display: none;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--primary-700);
  background: var(--primary-50);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--primary-100);
}

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

.mobile-nav .nav-link {
  padding: 10px 12px;
  border-radius: 12px;
}

.mobile-nav .nav-link.active,
.mobile-nav .nav-link:hover {
  background: var(--primary-50);
}

.hero {
  position: relative;
  height: 70vh;
  min-height: 520px;
  max-height: 820px;
  overflow: hidden;
  background: var(--ink-900);
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62);
  transform: scale(1.02);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08));
}

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

.hero-copy {
  width: min(680px, 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--accent-400);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  color: var(--white);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-subtitle,
.page-hero p,
.detail-one-line {
  margin: 20px 0 28px;
  color: var(--paper-200);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.65;
}

.hero-feature {
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.hero-feature h2 {
  margin: 0 0 8px;
  color: var(--white);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 28px;
}

.hero-feature p {
  margin: 0 0 20px;
  color: var(--paper-200);
  line-height: 1.7;
}

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

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  color: var(--white);
  background: var(--primary-600);
}

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

.primary-button:hover {
  background: var(--primary-700);
}

.ghost-button {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-control {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.hero-control:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

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

.hero-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
}

.hero-dot.active {
  width: 30px;
  background: var(--primary-600);
}

.search-band {
  padding: 28px 0 0;
}

.search-panel,
.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--primary-100);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.search-panel h2 {
  margin: 0;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 28px;
}

.search-box {
  min-width: min(430px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border: 1px solid var(--primary-100);
  border-radius: 14px;
  background: var(--primary-50);
}

.search-box.wide {
  flex: 1 1 420px;
}

.search-box span {
  color: var(--primary-700);
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  color: var(--ink-900);
  background: transparent;
}

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

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

.section-heading h2 {
  margin: 0;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--ink-900);
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--ink-500);
  line-height: 1.7;
}

.section-more {
  flex-shrink: 0;
  color: var(--primary-700);
  font-weight: 700;
}

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

.movie-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.movie-grid.dense {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

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

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

.category-grid.overview {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.movie-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-link,
.poster-frame {
  display: block;
}

.poster-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ink-900);
}

.featured-card .poster-frame {
  aspect-ratio: 16 / 9;
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
}

.play-chip,
.rank-badge {
  position: absolute;
  color: var(--white);
  font-weight: 700;
}

.play-chip {
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-600);
}

.rank-badge {
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-600);
}

.card-body {
  padding: 16px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.card-tags a,
.card-tags span,
.tag-list span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--primary-700);
  background: var(--primary-50);
  font-size: 12px;
  font-weight: 700;
}

.card-tags span:nth-child(2),
.tag-list span:nth-child(2) {
  color: #8a470f;
  background: #fff3d7;
}

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

.movie-card h3 a:hover {
  color: var(--primary-700);
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--paper-500);
  font-size: 13px;
}

.category-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 168px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--primary-100);
  background: var(--white);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

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

.category-card.large .category-thumbs {
  grid-template-columns: repeat(4, 1fr);
}

.category-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  background: var(--ink-900);
}

.category-card h3,
.category-card h2 {
  margin: 0 0 8px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.category-card p {
  margin: 0;
  color: var(--ink-500);
  line-height: 1.7;
}

.rank-compact {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rank-row,
.ranking-line {
  display: grid;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.rank-row {
  grid-template-columns: 44px 1fr auto;
  padding: 14px 16px;
}

.rank-row span,
.ranking-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--white);
  background: var(--primary-600);
  font-weight: 700;
}

.rank-row em,
.ranking-line em {
  color: var(--ink-500);
  font-style: normal;
  font-size: 13px;
}

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

.ranking-line {
  grid-template-columns: 48px 74px 1fr auto;
  padding: 12px;
}

.ranking-line img {
  width: 74px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
}

.page-hero,
.detail-hero {
  position: relative;
  background-size: cover;
  background-position: center;
}

.page-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  color: var(--white);
  background-color: var(--ink-900);
}

.compact-hero {
  min-height: 300px;
  background-image: linear-gradient(135deg, var(--ink-900), var(--primary-700));
}

.page-hero .container {
  padding: 76px 0;
}

.page-hero p {
  width: min(760px, 100%);
}

.filter-panel {
  margin-bottom: 28px;
  align-items: stretch;
}

.filter-panel.single {
  display: block;
}

.sticky-filter {
  position: sticky;
  top: 82px;
  z-index: 20;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-group button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink-700);
  background: var(--paper-200);
  cursor: pointer;
}

.filter-group button.active,
.filter-group button:hover {
  color: var(--white);
  background: var(--primary-600);
}

.detail-hero {
  color: var(--white);
}

.detail-hero-inner {
  min-height: 520px;
  padding: 70px 0;
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  gap: 44px;
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--paper-300);
}

.breadcrumbs a:hover {
  color: var(--white);
}

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

.detail-meta,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-meta span {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--paper-200);
  background: rgba(255, 255, 255, 0.14);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

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

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: var(--white);
  background: rgba(0, 0, 0, 0.46);
  cursor: pointer;
  z-index: 3;
}

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

.player-button {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary-600);
  box-shadow: var(--shadow-lg);
  font-size: 30px;
}

.detail-article,
.side-card,
.side-links {
  margin-top: 24px;
  padding: 24px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.detail-article h2,
.side-card h2 {
  margin: 0 0 14px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 26px;
}

.detail-article p {
  margin: 0 0 22px;
  color: var(--ink-700);
  line-height: 1.9;
}

.side-card dl {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px 14px;
  margin: 0;
}

.side-card dt {
  color: var(--ink-500);
}

.side-card dd {
  margin: 0;
  color: var(--ink-900);
  font-weight: 700;
}

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

.side-links a {
  color: var(--primary-700);
  font-weight: 700;
  line-height: 1.6;
}

.related-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.empty-state {
  display: none;
  padding: 22px;
  border-radius: 18px;
  text-align: center;
  color: var(--ink-500);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.empty-state.active {
  display: block;
}

.site-footer {
  margin-top: 72px;
  color: var(--paper-200);
  background: var(--ink-900);
}

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  gap: 26px;
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-brand p,
.copyright {
  margin: 8px 0 0;
  color: var(--paper-400);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--paper-300);
}

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

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

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

  .menu-toggle {
    display: inline-flex;
  }

  .search-panel,
  .filter-panel,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .featured-grid,
  .category-grid,
  .rank-compact,
  .detail-layout,
  .detail-hero-inner {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: min(300px, 80vw);
  }

  .ranking-line {
    grid-template-columns: 42px 68px 1fr;
  }

  .ranking-line em {
    grid-column: 3;
  }
}

@media (max-width: 640px) {
  .brand-tagline {
    display: none;
  }

  .hero {
    min-height: 620px;
  }

  .hero-control {
    display: none;
  }

  .hero-feature {
    padding: 18px;
  }

  .hero-actions,
  .footer-links {
    flex-direction: column;
  }

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

  .movie-grid,
  .movie-grid.dense,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-body {
    padding: 12px;
  }

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

  .movie-card p {
    min-height: 42px;
    font-size: 13px;
  }

  .detail-hero-inner {
    gap: 24px;
    padding: 44px 0;
  }

  .detail-copy h1 {
    font-size: 36px;
  }

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