:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.88);
  --panel-strong: #111827;
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #f97316;
  --accent-deep: #dc2626;
  --gold: #facc15;
  --green: #22c55e;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 4%, rgba(249, 115, 22, 0.14), transparent 26rem),
    radial-gradient(circle at 90% 15%, rgba(220, 38, 38, 0.13), transparent 24rem),
    linear-gradient(180deg, #020617 0%, #0f172a 50%, #020617 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.nav-shell {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 12px 35px rgba(249, 115, 22, 0.3);
}

.brand-text {
  font-size: 1.24rem;
  background: linear-gradient(135deg, #fb923c, #ef4444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

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

.nav-link {
  color: var(--muted-strong);
  font-weight: 650;
  transition: color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #fb923c;
  transform: translateY(-1px);
}

.header-search {
  position: relative;
  width: min(280px, 26vw);
}

.header-search input,
.filter-input,
.filter-select,
.search-hero input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  outline: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: var(--text);
  padding: 11px 46px 11px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input:focus,
.filter-input:focus,
.filter-select:focus,
.search-hero input:focus {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
  background: rgba(15, 23, 42, 0.98);
}

.header-search button,
.search-hero button {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  cursor: pointer;
}

.mobile-menu-button {
  display: none;
  border: 0;
  color: white;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted-strong);
}

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

.main-content {
  min-height: 64vh;
}

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

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

.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;
  filter: saturate(1.08) contrast(1.05);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.70), rgba(0, 0, 0, 0.12)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.86), rgba(2, 6, 23, 0.08) 44%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  z-index: 2;
}

.hero-copy {
  width: min(650px, 92%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  margin-bottom: 18px;
  background: rgba(249, 115, 22, 0.92);
  color: white;
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(249, 115, 22, 0.28);
}

.hero h1,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 610px;
  margin: 18px 0 0;
  color: rgba(226, 232, 240, 0.94);
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.8;
}

.hero-meta,
.detail-meta,
.card-meta,
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  color: var(--muted);
}

.hero-meta {
  margin-top: 22px;
  font-size: 1rem;
}

.hero-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.82);
  color: white;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}

.btn.ghost {
  backdrop-filter: blur(12px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: translateY(-50%) scale(1.08);
}

.hero-arrow.prev {
  left: 22px;
  transform: translateY(-50%);
}

.hero-arrow.next {
  right: 22px;
  transform: translateY(-50%);
}

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

.hero-dots button {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.is-active {
  width: 32px;
  background: var(--accent);
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.03em;
}

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

.section-link {
  color: #fb923c;
  font-weight: 800;
  white-space: nowrap;
}

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

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

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

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

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

.movie-card.large .poster-link {
  aspect-ratio: 16 / 8;
}

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

.movie-card:hover .poster-link img,
.rank-card:hover img,
.related-item:hover img {
  transform: scale(1.06);
}

.poster-badge,
.rank-index,
.score-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: white;
  background: rgba(0, 0, 0, 0.74);
  font-size: 0.78rem;
  font-weight: 800;
}

.card-body {
  padding: 18px;
}

.card-title {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.card-title:hover,
.rank-title:hover,
.related-title:hover {
  color: #fb923c;
}

.card-desc {
  min-height: 48px;
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.94rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  font-size: 0.86rem;
}

.card-meta span + span::before,
.detail-meta span + span::before,
.hero-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: rgba(148, 163, 184, 0.56);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span,
.category-chip {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(51, 65, 85, 0.78);
  color: var(--muted-strong);
  font-size: 0.8rem;
}

.horizontal-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-snap-type: x mandatory;
}

.horizontal-strip .movie-card {
  flex: 0 0 310px;
  scroll-snap-align: start;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(220, 38, 38, 0.10)),
    rgba(15, 23, 42, 0.88);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(249, 115, 22, 0.45);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

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

.category-card span {
  display: inline-block;
  margin-top: 20px;
  color: #fb923c;
  font-weight: 800;
}

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

.rank-card {
  position: relative;
  display: flex;
  gap: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.86);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.36);
}

.rank-card img {
  width: 160px;
  height: 106px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.rank-card div {
  padding: 14px 14px 14px 0;
}

.rank-title {
  display: block;
  margin-bottom: 8px;
  color: white;
  font-weight: 800;
}

.rank-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.rank-card span {
  color: #fb923c;
  font-size: 0.86rem;
  font-weight: 750;
}

.rank-index {
  left: 8px;
  right: auto;
  top: 8px;
  bottom: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.page-hero {
  padding: 118px 0 46px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 24% 8%, rgba(249, 115, 22, 0.22), transparent 28rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.36));
}

.page-hero p {
  max-width: 780px;
  margin: 16px 0 0;
  color: var(--muted-strong);
  line-height: 1.8;
  font-size: 1.05rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 14px;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.8);
}

.filter-select {
  appearance: none;
  padding-right: 18px;
}

.hidden-card {
  display: none !important;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 28px;
  padding: 96px 0 56px;
}

.breadcrumbs {
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: #fb923c;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.player-start {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.70));
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.player-start span {
  display: flex;
  width: 88px;
  height: 88px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 18px 55px rgba(249, 115, 22, 0.38);
  font-size: 2.4rem;
  line-height: 1;
  padding-left: 6px;
}

.player-start.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-message {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: none;
  border-radius: 14px;
  padding: 12px 16px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.78);
}

.player-message.is-visible {
  display: block;
}

.detail-panel,
.side-panel,
.text-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
}

.detail-panel {
  padding: 26px;
  margin-top: 24px;
}

.detail-title h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.detail-summary {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.detail-summary h2,
.text-panel h2,
.side-panel h2 {
  margin: 0 0 14px;
  font-size: 1.32rem;
}

.detail-summary p,
.text-panel p {
  color: var(--muted-strong);
  line-height: 1.95;
}

.text-panel {
  padding: 24px;
  margin-top: 24px;
}

.side-panel {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.related-list {
  display: grid;
  gap: 16px;
}

.related-item {
  display: flex;
  gap: 12px;
}

.related-item img {
  width: 126px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.related-title {
  display: block;
  color: white;
  font-weight: 800;
  line-height: 1.45;
}

.related-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.search-hero {
  position: relative;
  max-width: 760px;
  margin-top: 28px;
}

.search-hero input {
  min-height: 58px;
  padding-left: 24px;
  font-size: 1.02rem;
}

.search-hero button {
  width: 44px;
  height: 44px;
}

.empty-state {
  padding: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.76);
  color: var(--muted-strong);
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.98));
  color: var(--muted);
  padding: 48px 0 24px;
}

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr;
  gap: 30px;
}

.footer-brand {
  color: white;
  margin-bottom: 16px;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: white;
  font-size: 1rem;
}

.site-footer p {
  margin: 0;
  line-height: 1.8;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 9px;
}

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

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.9rem;
}

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

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

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

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

@media (max-width: 900px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .nav-shell {
    justify-content: space-between;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero {
    height: 68vh;
    min-height: 520px;
  }

  .hero-arrow {
    display: none;
  }

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

  .side-panel {
    position: static;
  }
}

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

  .hero {
    min-height: 600px;
  }

  .hero-slide::after {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.52));
  }

  .hero-content {
    align-items: flex-end;
    padding-bottom: 86px;
  }

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

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

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

  .rank-card {
    gap: 12px;
  }

  .rank-card img {
    width: 126px;
    height: 96px;
  }

  .detail-panel,
  .text-panel,
  .side-panel {
    padding: 18px;
  }

  .player-start span {
    width: 72px;
    height: 72px;
  }
}
