:root {
  --primary: #4a7c54;
  --primary-dark: #3d6744;
  --primary-soft: #f4f7f5;
  --accent: #e88f1a;
  --accent-soft: #fff7ed;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
  --page: #f9fafb;
  --dark: #0f172a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
}

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

img {
  display: block;
  max-width: 100%;
  background: linear-gradient(135deg, #edf2ef, #fff7ed);
}

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  transition: box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-soft);
}

.header-inner {
  height: 76px;
  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: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(74, 124, 84, 0.28);
}

.brand-name {
  font-size: 1.28rem;
}

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

.nav-link {
  font-size: 0.96rem;
  color: #4b5563;
  font-weight: 600;
  transition: color 0.2s ease;
}

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

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--primary-soft);
  padding: 10px;
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: var(--primary-dark);
}

.mobile-nav {
  display: none;
  padding: 10px 16px 18px;
  border-top: 1px solid var(--line);
  background: white;
}

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

.mobile-nav-link {
  padding: 12px 14px;
  border-radius: 12px;
  color: #4b5563;
  font-weight: 700;
}

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

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

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

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.45) 55%, rgba(15, 23, 42, 0.18)),
    radial-gradient(circle at 16% 34%, rgba(232, 143, 26, 0.32), transparent 32%);
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  padding: 56px 0 72px;
  color: white;
}

.hero-content > * {
  max-width: 760px;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  color: white;
  background: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0 0 22px;
  max-width: 680px;
  color: #e5e7eb;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  color: #d1d5db;
}

.hero-meta span {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(6px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  color: white;
  font-size: 2.2rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

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

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

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

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

.hero-dot.is-active {
  width: 34px;
  background: white;
}

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

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

.button-primary {
  color: white;
  background: var(--primary);
  box-shadow: 0 14px 28px rgba(74, 124, 84, 0.25);
}

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

.button-outline {
  color: var(--primary-dark);
  border: 2px solid var(--primary);
  background: white;
}

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

.wide-section {
  padding: 64px 0;
  background: white;
}

.soft-gradient {
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
}

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

.heading-bar {
  width: 5px;
  height: 38px;
  border-radius: 999px;
  background: var(--primary);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.movie-card {
  min-width: 0;
}

.movie-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

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

.movie-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background: var(--primary-soft);
}

.movie-card.is-compact .movie-thumb {
  aspect-ratio: 16 / 9;
}

.movie-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.movie-card-link:hover .movie-thumb img {
  transform: scale(1.09);
}

.badge {
  position: absolute;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge-primary {
  top: 12px;
  left: 12px;
  color: white;
  background: var(--primary);
}

.badge-dark {
  top: 12px;
  right: 12px;
  color: white;
  background: rgba(15, 23, 42, 0.78);
}

.rank-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
}

.play-float {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.78);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card-link:hover .play-float {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

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

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

.movie-card p {
  flex: 1;
  margin: 0 0 14px;
  color: #4b5563;
  font-size: 0.92rem;
}

.movie-card-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.movie-card-genre {
  margin-top: 8px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #374151;
  background: white;
  font-weight: 800;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.pill-link span {
  color: var(--primary);
  font-size: 0.84rem;
}

.pill-link:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
}

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

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

.category-tile {
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius);
  color: white;
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.category-tile img,
.category-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.category-tile img {
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.category-layer {
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.2));
}

.category-label,
.category-tile strong,
.category-tile small {
  position: relative;
  z-index: 1;
}

.category-label {
  width: max-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.category-tile strong {
  margin-top: 10px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.category-tile small {
  color: #e5e7eb;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 28px;
  align-items: start;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 44px 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-row:hover,
.ranking-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ranking-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}

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

.ranking-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.ranking-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.ranking-card {
  display: grid;
  grid-template-columns: 68px 138px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-big-number {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 950;
  text-align: center;
}

.ranking-card img {
  width: 138px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
}

.ranking-card-body {
  display: grid;
  gap: 6px;
}

.ranking-card-body strong {
  font-size: 1.2rem;
}

.ranking-card-body small {
  color: var(--primary-dark);
  font-weight: 800;
}

.ranking-card-body em {
  color: var(--muted);
  font-style: normal;
}

.home-search-card,
.info-panel,
.text-card,
.detail-card,
.player-card {
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}

.home-search-card {
  padding: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.home-search-card p {
  color: rgba(255, 255, 255, 0.82);
}

.section-more {
  margin-top: 22px;
}

.page-hero {
  padding: 74px 0;
  color: white;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(35, 61, 38, 0.92)),
    radial-gradient(circle at 20% 30%, rgba(232, 143, 26, 0.3), transparent 34%);
}

.page-hero h1 {
  margin: 18px 0 10px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: #e5e7eb;
  font-size: 1.05rem;
}

.detail-page {
  padding: 34px 0 70px;
}

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

.detail-main {
  display: grid;
  gap: 24px;
}

.player-card {
  overflow: hidden;
}

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.movie-video {
  width: 100%;
  height: 100%;
  background: black;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  color: white;
  border: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.25));
  cursor: pointer;
}

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

.player-overlay.is-loading .player-play-icon {
  animation: pulse 1s infinite alternate;
}

.player-play-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary-dark);
  background: white;
  font-size: 1.8rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.player-overlay strong {
  font-size: 1.2rem;
}

.player-overlay small {
  color: #d1d5db;
}

.player-message {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  color: #fecaca;
  text-align: center;
  font-weight: 700;
}

@keyframes pulse {
  from {
    transform: scale(0.95);
  }
  to {
    transform: scale(1.06);
  }
}

.detail-card {
  padding: 28px;
}

.detail-badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  color: white;
  background: var(--primary);
  font-weight: 800;
}

.detail-card h1 {
  margin: 18px 0 16px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
}

.detail-meta a,
.detail-meta span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.detail-section {
  margin-top: 28px;
}

.detail-section h2,
.info-panel h2 {
  margin: 0 0 12px;
  font-size: 1.28rem;
}

.detail-section p {
  margin: 0;
  color: #374151;
}

.lead-text {
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-list span {
  padding: 6px 12px;
  border-radius: 999px;
  color: #374151;
  background: #f3f4f6;
  font-size: 0.9rem;
  font-weight: 700;
}

.detail-sidebar {
  display: grid;
  gap: 24px;
  position: sticky;
  top: 96px;
}

.info-panel {
  padding: 22px;
}

.info-panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-panel dt {
  color: var(--muted);
  font-size: 0.86rem;
}

.info-panel dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.related-panel .movie-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(170px, 1fr));
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
}

.search-field {
  display: grid;
  gap: 8px;
  color: #374151;
  font-weight: 800;
}

.search-field input,
.search-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-field input:focus,
.search-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(74, 124, 84, 0.12);
}

.search-status {
  margin: 0 0 22px;
  color: var(--muted);
  font-weight: 700;
}

.text-page {
  padding: 60px 0;
}

.text-card {
  max-width: 860px;
  margin: 0 auto;
  padding: 34px;
}

.text-card p {
  margin: 0 0 18px;
  color: #374151;
}

.site-footer {
  background: #111827;
  color: #d1d5db;
  padding: 54px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 36px;
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 14px;
  color: white;
}

.site-footer p {
  margin: 0;
  color: #9ca3af;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #1f2937;
  font-size: 0.9rem;
}

@media (max-width: 1080px) {
  .movie-grid,
  .category-grid,
  .category-grid.is-dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .detail-sidebar {
    position: static;
  }

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

  .search-field-wide {
    grid-column: 1 / -1;
  }
}

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

  .mobile-menu-button {
    display: block;
  }

  .header-inner {
    height: 66px;
  }

  .hero {
    height: 64vh;
    min-height: 460px;
  }

  .hero-content {
    padding: 42px 0 62px;
  }

  .hero-arrow {
    display: none;
  }

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

  .ranking-row {
    grid-template-columns: 42px 64px minmax(0, 1fr);
  }

  .ranking-meta {
    display: none;
  }

  .ranking-card {
    grid-template-columns: 50px 96px minmax(0, 1fr);
  }

  .ranking-card img {
    width: 96px;
  }

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

@media (max-width: 560px) {
  .container {
    width: min(100% - 24px, 1280px);
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .hero {
    min-height: 430px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-meta {
    gap: 8px;
  }

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

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

  .search-field-wide {
    grid-column: auto;
  }

  .detail-card,
  .info-panel,
  .text-card {
    padding: 20px;
  }

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