:root {
  --emerald-900: #064e3b;
  --emerald-800: #065f46;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --rose-600: #e11d48;
  --sky-600: #0284c7;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --stone-100: #f5f5f4;
  --stone-50: #fafaf9;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  --soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--stone-50);
  color: #1f2937;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(90deg, var(--emerald-800), var(--teal-700));
  box-shadow: 0 12px 32px rgba(6, 95, 70, 0.26);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark,
.footer-brand span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 650;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a,
.site-footer a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.site-footer a:hover {
  color: #a7f3d0;
}

.header-search {
  position: relative;
  margin-left: auto;
  width: min(310px, 30vw);
}

.site-search-input,
.local-filter-input,
.local-filter-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  padding: 11px 18px;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-search-input::placeholder {
  color: rgba(236, 253, 245, 0.82);
}

.site-search-input:focus {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.20);
}

.site-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 120;
  display: none;
  max-height: 390px;
  overflow: auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: #1f2937;
}

.search-result {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.search-result img {
  width: 52px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #e5e7eb;
}

.search-result strong {
  display: block;
  font-size: 14px;
  color: #111827;
}

.search-result span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
}

.menu-button {
  display: none;
  color: #fff;
  border: 0;
  background: transparent;
  font-size: 28px;
}

.mobile-nav {
  display: none;
  padding: 0 22px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: #ecfdf5;
  font-weight: 650;
}

.hero-carousel {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background: var(--slate-950);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.55s ease, transform 0.65s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.64), rgba(2, 6, 23, 0.22)), var(--hero-image);
  background-position: center;
  background-size: cover;
  filter: saturate(1.08);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(250, 250, 249, 1), rgba(250, 250, 249, 0));
}

.hero-panel {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 44px));
  margin-left: max(22px, calc((100vw - 1240px) / 2 + 22px));
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.38);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  color: #fff;
}

.eyebrow,
.section-kicker {
  color: #10b981;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel h1 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-panel h2 {
  margin: 0 0 16px;
  color: #d1fae5;
  font-size: clamp(24px, 3vw, 38px);
}

.hero-panel p {
  margin: 0;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.8;
}

.hero-tags,
.card-tags,
.detail-tags,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-tags {
  margin-top: 20px;
}

.hero-tag,
.tag,
.mini-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
}

.hero-tag {
  color: #ecfdf5;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(167, 243, 208, 0.28);
  padding: 7px 13px;
}

.tag {
  color: #065f46;
  background: #d1fae5;
  padding: 8px 13px;
}

.mini-tag {
  color: #047857;
  background: #ecfdf5;
  padding: 5px 9px;
  font-size: 12px;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 24px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: var(--emerald-600);
  color: #fff;
  box-shadow: 0 12px 24px rgba(5, 150, 105, 0.35);
}

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

.ghost-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.12);
}

.ghost-button.light {
  color: #064e3b;
  border-color: rgba(6, 78, 59, 0.18);
  background: #ecfdf5;
}

.hero-prev,
.hero-next {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 38px;
  line-height: 1;
  transform: translateY(-50%);
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

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

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

.hero-dot.is-active {
  width: 28px;
  background: #10b981;
}

.home-search-block,
.section-wrap,
.hot-section,
.filter-bar {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
}

.home-search-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 32px;
  align-items: center;
  margin-top: -44px;
  position: relative;
  z-index: 8;
  border-radius: 26px;
  background: #fff;
  padding: 28px;
  box-shadow: var(--shadow);
}

.home-search-block h2,
.section-heading h2,
.page-hero h1,
.detail-body h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.18;
}

.home-search-block p {
  margin: 10px 0 0;
  color: #6b7280;
  line-height: 1.7;
}

.wide-search {
  position: relative;
}

.wide-search .site-search-input,
.filter-bar input,
.filter-bar select {
  color: #111827;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.wide-search .site-search-input::placeholder,
.filter-bar input::placeholder {
  color: #6b7280;
}

.section-wrap,
.hot-section {
  padding: 58px 0;
}

.section-wrap.narrow {
  max-width: 900px;
}

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

.section-heading a {
  color: var(--emerald-700);
  font-weight: 800;
}

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

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

.category-card {
  min-height: 170px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #d1fae5;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card span {
  display: block;
  color: #064e3b;
  font-size: 22px;
  font-weight: 900;
}

.category-card p {
  margin: 14px 0 0;
  color: #4b5563;
  line-height: 1.7;
}

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

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

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 150, 105, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.card-body {
  padding: 14px;
}

.card-body h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #111827;
}

.card-body p {
  min-height: 54px;
  margin: 9px 0 12px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}

.hot-section {
  width: 100%;
  max-width: none;
  padding-left: max(22px, calc((100% - 1240px) / 2));
  padding-right: max(22px, calc((100% - 1240px) / 2));
  background: linear-gradient(135deg, #f1f5f9, #f5f5f4);
}

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

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

.rank-item {
  display: grid;
  grid-template-columns: 48px 56px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 84px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.rank-no {
  color: var(--rose-600);
  font-size: 24px;
  font-weight: 900;
}

.rank-item img {
  width: 56px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #e5e7eb;
}

.rank-title {
  display: block;
  color: #111827;
  font-weight: 800;
}

.rank-meta {
  display: block;
  grid-column: 3;
  color: #6b7280;
  font-size: 12px;
}

.latest-rows {
  display: grid;
  gap: 14px;
}

.latest-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.latest-row img {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  background: #e5e7eb;
}

.latest-row strong,
.latest-row em {
  display: block;
}

.latest-row strong {
  color: #111827;
  font-size: 18px;
}

.latest-row em {
  margin-top: 6px;
  color: #6b7280;
  font-style: normal;
}

.latest-row b {
  color: #fff;
  background: var(--emerald-600);
  border-radius: 999px;
  padding: 10px 18px;
}

.page-main {
  background: var(--stone-50);
}

.page-hero {
  padding: 70px max(22px, calc((100% - 1240px) / 2)) 64px;
  color: #fff;
  background: linear-gradient(135deg, var(--emerald-800), var(--teal-700));
}

.page-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.8;
}

.page-hero h1 {
  margin: 12px 0;
  color: #fff;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px 220px;
  gap: 14px;
  margin-top: 24px;
}

.filter-bar select {
  appearance: none;
}

.detail-main {
  background: #fff;
}

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

.detail-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(5px) saturate(1.15);
  transform: scale(1.04);
  opacity: 0.72;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.40));
}

.detail-content {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 44px));
  min-height: 610px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 46px;
  align-items: center;
  padding: 58px 0;
}

.detail-poster img {
  width: 300px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow);
  background: #e5e7eb;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.crumbs a {
  color: #a7f3d0;
}

.detail-info h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.06;
}

.one-line {
  max-width: 760px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.8;
}

.player-section {
  width: min(1100px, calc(100% - 44px));
  margin: -90px auto 0;
  position: relative;
  z-index: 6;
}

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

.movie-player {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: radial-gradient(circle at center, rgba(5, 150, 105, 0.22), rgba(2, 6, 23, 0.72));
  cursor: pointer;
}

.player-cover span {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--emerald-600);
  box-shadow: 0 18px 40px rgba(5, 150, 105, 0.38);
  font-size: 40px;
  padding-left: 6px;
}

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

.detail-body {
  color: #374151;
  line-height: 1.9;
}

.detail-body h2 {
  margin-top: 26px;
  margin-bottom: 12px;
  font-size: 28px;
}

.detail-body p {
  margin: 0 0 14px;
}

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

.movie-card.small .card-body p {
  min-height: auto;
}

.site-footer {
  background: linear-gradient(135deg, var(--slate-800), var(--slate-900));
  color: #d1d5db;
  padding: 48px max(22px, calc((100% - 1240px) / 2)) 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 34px;
}

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

.site-footer p {
  color: #cbd5e1;
  line-height: 1.8;
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

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

.footer-bottom {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  text-align: center;
}

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

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

  .header-search {
    width: min(420px, 44vw);
  }

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

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

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

@media (max-width: 820px) {
  .header-inner {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .header-search {
    order: 3;
    width: 100%;
  }

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

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

  .hero-carousel {
    min-height: 720px;
  }

  .hero-panel {
    width: calc(100% - 28px);
    margin: 0 14px;
    padding: 26px;
  }

  .hero-prev,
  .hero-next {
    display: none;
  }

  .home-search-block {
    grid-template-columns: 1fr;
    width: calc(100% - 28px);
    padding: 22px;
  }

  .section-wrap,
  .hot-section,
  .filter-bar {
    width: calc(100% - 28px);
  }

  .hot-section {
    padding-left: 14px;
    padding-right: 14px;
  }

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

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

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

  .latest-row {
    grid-template-columns: 110px 1fr;
  }

  .latest-row img {
    width: 110px;
  }

  .latest-row b {
    display: none;
  }

  .detail-content {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 34px 0 130px;
  }

  .detail-poster img {
    width: min(250px, 72vw);
  }

  .player-section {
    margin-top: -96px;
  }

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

@media (max-width: 520px) {
  .movie-grid,
  .related-grid,
  .rank-grid,
  .rank-grid.compact,
  .category-grid,
  .category-grid.large {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 44px 52px 1fr;
  }

  .card-body p {
    min-height: auto;
  }
}
