:root {
  --bg: #090b10;
  --surface: #111827;
  --surface-soft: #171f2e;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.22);
  --orange: #ea580c;
  --red: #dc2626;
  --purple: #9333ea;
  --gold: #facc15;
  --radius: 20px;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #f8fafc;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #ffffff;
  background: linear-gradient(90deg, rgba(124, 45, 18, 0.96), rgba(220, 38, 38, 0.94), rgba(147, 51, 234, 0.92));
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

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

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

.nav-link,
.mobile-link {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: #ffedd5;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 9px;
}

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

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
}

.hero {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  color: #ffffff;
  background: #000000;
}

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

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

.hero-bg,
.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-shade,
.detail-mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 45%, rgba(234, 88, 12, 0.32), transparent 32%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.34)),
    linear-gradient(0deg, #090b10, transparent 38%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 52px;
  align-items: center;
  min-height: 640px;
  padding: 62px 0 118px;
}

.hero-copy {
  max-width: 720px;
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffedd5;
  background: rgba(249, 115, 22, 0.19);
  border: 1px solid rgba(251, 146, 60, 0.34);
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-line {
  margin: 0 0 14px;
  font-size: 21px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.hero-desc {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.8;
}

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

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

.btn-primary,
.home-search button {
  color: #ffffff;
  background: linear-gradient(90deg, var(--orange), var(--red));
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.32);
}

.btn-primary:hover,
.home-search button:hover,
.section-more:hover,
.text-link:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  transform: rotate(2deg);
}

.hero-poster img {
  aspect-ratio: 2 / 3;
  height: 520px;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  right: 18px;
  bottom: 18px;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.hero-controls {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 26px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

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

.hero-dot.active {
  background: #ffffff;
}

.hero-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  max-width: 560px;
  padding-bottom: 4px;
}

.hero-thumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 7px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.hero-thumb.active {
  border-color: rgba(255, 237, 213, 0.7);
  background: rgba(249, 115, 22, 0.32);
}

.hero-thumb img {
  width: 42px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.quick-search {
  position: relative;
  z-index: 3;
  margin-top: -48px;
}

.quick-search-box,
.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 24px;
  padding: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.quick-search-box h2,
.quick-search-box p {
  margin: 0;
}

.quick-search-box p {
  color: var(--muted);
  margin-top: 4px;
}

.home-search {
  display: flex;
  gap: 10px;
  width: min(520px, 100%);
}

.home-search input,
.search-input,
.filter-select {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0 18px;
  min-height: 46px;
  color: var(--text);
  background: #f8fafc;
  outline: none;
}

.home-search input:focus,
.search-input:focus,
.filter-select:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.15);
}

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

.soft-bg {
  background: linear-gradient(135deg, #fff7ed, #faf5ff);
}

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

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.section-head h2,
.category-card h2,
.page-hero h1,
.detail-info h1,
.story-block h2,
.side-panel h2,
.tile-body h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.section-head h2,
.category-card h2,
.page-hero h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.section-head p,
.category-card p,
.page-hero p,
.tile-body p,
.story-block p {
  color: var(--muted);
  line-height: 1.8;
}

.section-more,
.text-link {
  color: #ffffff;
  background: var(--surface);
}

.movie-grid,
.category-grid,
.category-showcase,
.ranking-page-grid {
  display: grid;
  gap: 22px;
}

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

.movie-card {
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.18);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #111827;
}

.poster-link img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.poster-gradient {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
}

.score,
.rank-badge {
  position: absolute;
  top: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  font-weight: 900;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.score {
  right: 12px;
}

.rank-badge {
  left: 12px;
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.movie-card-body {
  padding: 16px;
}

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

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

.movie-card p {
  min-height: 46px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.tag-row span {
  color: var(--orange);
  background: #fff7ed;
  border-color: #fed7aa;
}

.rank-section {
  background: #090b10;
  color: #ffffff;
}

.rank-section .section-head p,
.rank-section .category-card p {
  color: rgba(255, 255, 255, 0.68);
}

.rank-layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
}

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

.compact-item {
  display: grid;
  grid-template-columns: auto 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  padding: 10px;
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
}

.rank-section .compact-item {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.compact-item img {
  width: 56px;
  height: 74px;
  border-radius: 12px;
  object-fit: cover;
}

.compact-item strong,
.compact-item em {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.rank-section .compact-item em {
  color: rgba(255, 255, 255, 0.62);
}

.small-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.category-card {
  align-self: start;
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.24), rgba(147, 51, 234, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.category-pills,
.showcase-links,
.tile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pills a,
.showcase-links a,
.tile-links a {
  border-radius: 999px;
  padding: 8px 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

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

.showcase-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  border-radius: 24px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}

.showcase-card img {
  height: 168px;
  border-radius: 18px;
  object-fit: cover;
}

.showcase-card h3 {
  margin: 4px 0 8px;
  font-size: 22px;
}

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

.showcase-links a,
.tile-links a {
  color: var(--orange);
  background: #fff7ed;
  border-color: #fed7aa;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: #090b10;
}

.compact-hero {
  padding: 74px 0;
  background:
    radial-gradient(circle at top right, rgba(234, 88, 12, 0.34), transparent 34%),
    linear-gradient(135deg, #090b10, #1e1b4b 55%, #7c2d12);
}

.compact-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.75);
}

.filter-panel {
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-panel .search-input {
  flex: 1 1 320px;
}

.filter-select {
  flex: 0 1 170px;
}

.empty-state {
  display: none;
  border-radius: 22px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

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

.category-tile {
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.tile-posters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 170px;
  background: #111827;
}

.tile-posters img {
  height: 170px;
  object-fit: cover;
}

.tile-body {
  padding: 24px;
}

.tile-body h2 {
  font-size: 28px;
}

.tile-body .text-link {
  margin-top: 18px;
}

.ranking-page-grid {
  counter-reset: rank;
}

.detail-hero {
  min-height: 580px;
}

.detail-head {
  position: relative;
  z-index: 2;
  padding: 44px 0 70px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #ffedd5;
}

.detail-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 36px;
  align-items: end;
}

.detail-poster {
  overflow: hidden;
  border-radius: 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.detail-poster img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-info h1 {
  margin-top: 16px;
  font-size: clamp(36px, 6vw, 66px);
  line-height: 1;
}

.detail-line {
  max-width: 800px;
  margin: 18px 0;
  font-size: 20px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
}

.detail-meta {
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.72);
}

.detail-section {
  background: #f8fafc;
}

.main-detail,
.side-panel,
.story-block {
  border-radius: 26px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.main-detail {
  overflow: hidden;
}

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

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

.play-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18));
  cursor: pointer;
}

.play-layer.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.play-icon {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.92);
  box-shadow: 0 18px 38px rgba(220, 38, 38, 0.36);
  position: relative;
}

.play-icon::after {
  content: "";
  position: absolute;
  left: 32px;
  top: 24px;
  border-left: 22px solid #ffffff;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
}

.story-block {
  margin: 20px;
  padding: 26px;
  box-shadow: none;
  border: 1px solid #e2e8f0;
}

.story-block h2,
.side-panel h2 {
  margin-bottom: 14px;
  font-size: 26px;
}

.story-block p {
  margin: 0;
  color: #334155;
}

.side-panel {
  align-self: start;
  padding: 22px;
}

.side-panel .compact-item {
  grid-template-columns: auto 52px minmax(0, 1fr);
  box-shadow: none;
  background: #f8fafc;
}

.site-footer {
  color: rgba(255, 255, 255, 0.72);
  background: #090b10;
  padding: 46px 0;
}

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

.footer-brand {
  color: #ffffff;
  font-size: 22px;
}

.site-footer h3 {
  color: #ffffff;
  margin: 0 0 12px;
}

.site-footer p {
  max-width: 520px;
  line-height: 1.8;
}

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.72);
}

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

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

  .menu-toggle {
    display: block;
  }

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

  .hero-content,
  .detail-grid,
  .rank-layout,
  .detail-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    display: none;
  }

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

  .quick-search-box {
    align-items: stretch;
    flex-direction: column;
  }
}

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

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

  .hero,
  .hero-content {
    min-height: 620px;
  }

  .hero-content {
    padding: 52px 0 138px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-line,
  .detail-line {
    font-size: 17px;
  }

  .hero-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-thumbs {
    max-width: 100%;
  }

  .home-search {
    flex-direction: column;
  }

  .movie-grid,
  .ranking-page-grid,
  .category-grid,
  .category-showcase {
    grid-template-columns: 1fr;
  }

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

  .showcase-card img {
    height: 138px;
  }

  .tile-posters {
    height: 120px;
  }

  .tile-posters img {
    height: 120px;
  }

  .detail-poster {
    max-width: 240px;
  }

  .detail-info h1 {
    font-size: 38px;
  }

  .filter-select {
    flex: 1 1 100%;
  }
}
