:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: #111827;
  --bg-card-soft: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #f97316;
  --accent-strong: #ef4444;
  --green: #22c55e;
  --ring: rgba(249, 115, 22, 0.35);
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
}

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

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

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

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

.brand-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.28);
  transition: transform 0.25s ease;
}

.brand:hover .brand-icon {
  transform: scale(1.08) rotate(-2deg);
}

.brand-text {
  font-size: 22px;
  background: linear-gradient(90deg, #fb923c, #f43f5e);
  -webkit-background-clip: text;
  color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.desktop-nav a,
.mobile-panel a {
  color: var(--muted-strong);
  font-weight: 650;
  transition: color 0.22s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-panel a:hover,
.mobile-panel a.is-active {
  color: #fb923c;
}

.header-search,
.mobile-search,
.page-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.page-search input,
.filter-bar input {
  width: 220px;
  color: var(--text);
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.page-search input:focus,
.filter-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.header-search button,
.mobile-search button,
.page-search button {
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.page-search button:hover,
.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 16px 30px rgba(249, 115, 22, 0.3);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

.mobile-panel nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mobile-panel.is-open {
  display: block;
}

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

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

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

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.12)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.86), transparent 38%);
}

.hero-content {
  position: absolute;
  top: 52%;
  left: max(32px, calc((100vw - 1180px) / 2));
  width: min(620px, calc(100% - 64px));
  transform: translateY(-45%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.hero-content h1,
.page-hero h1,
.rank-hero h1,
.detail-side-card h1 {
  margin: 18px 0 14px;
  font-weight: 900;
  line-height: 1.08;
}

.hero-content h1 {
  font-size: clamp(42px, 6vw, 72px);
}

.hero-content p,
.page-hero p,
.rank-hero p {
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.movie-meta-line,
.footer-links,
.breadcrumb,
.tag-row,
.hero-tags,
.hero-actions,
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta span {
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
}

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

.hero-actions {
  margin-top: 26px;
}

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

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.btn-ghost {
  color: #fff;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.58);
}

.btn-ghost:hover {
  background: rgba(30, 41, 59, 0.86);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 48px;
  color: #fff;
  background: rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

.hero-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  background: rgba(255, 255, 255, 0.48);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 34px;
  background: var(--accent);
}

.page-main {
  padding-top: 96px;
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 900;
}

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

.section-more {
  flex: 0 0 auto;
  color: #fb923c;
  font-weight: 800;
}

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

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

.movie-card {
  min-width: 0;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.movie-card:hover {
  border-color: rgba(249, 115, 22, 0.42);
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow);
}

.movie-card-link {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  background: #111827;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.36s ease, filter 0.36s ease;
}

.movie-card:hover .poster-wrap img {
  transform: scale(1.06);
  filter: brightness(0.78);
}

.movie-duration,
.movie-year,
.rank-badge {
  position: absolute;
  z-index: 2;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.movie-duration {
  right: 10px;
  bottom: 10px;
}

.movie-year {
  left: 10px;
  top: 10px;
}

.rank-badge {
  right: 10px;
  top: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.play-hover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 44px;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.movie-card:hover .play-hover {
  opacity: 1;
  transform: scale(1);
}

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

.movie-card-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: #fb923c;
}

.movie-card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta-line {
  color: #64748b;
  font-size: 12px;
  margin-bottom: 12px;
}

.movie-meta-line span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: #475569;
}

.rail-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}

.rail-scroll .movie-card {
  scroll-snap-align: start;
}

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

.category-tile,
.category-overview-card {
  display: block;
  padding: 18px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.category-tile:hover,
.category-overview-card:hover {
  border-color: rgba(249, 115, 22, 0.45);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.category-thumbs,
.category-overview-head > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.category-thumbs img,
.category-overview-head img {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: cover;
  border-radius: 12px;
}

.category-tile strong,
.category-overview-card h2 {
  display: block;
  margin: 4px 0;
  font-size: 22px;
  font-weight: 900;
}

.category-tile span,
.category-overview-card span {
  color: #fb923c;
  font-weight: 800;
}

.category-tile p,
.category-overview-card p {
  color: var(--muted);
  line-height: 1.7;
}

.movie-card-horizontal .movie-card-link {
  display: grid;
  grid-template-columns: 230px 1fr;
}

.movie-card-horizontal .poster-wrap {
  height: 100%;
  min-height: 145px;
}

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

.page-hero,
.rank-hero {
  position: relative;
  padding: 54px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background:
    radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.2), transparent 22rem),
    linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.96));
  box-shadow: var(--shadow);
}

.compact-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.filter-bar {
  margin-top: 24px;
}

.filter-bar input {
  width: min(460px, 100%);
  border-radius: 16px;
}

.filter-bar span {
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
}

.rank-hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: center;
}

.rank-hero-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.rank-hero-card img {
  width: 160px;
  height: 210px;
  object-fit: cover;
  border-radius: 18px;
}

.rank-hero-card span {
  color: #fb923c;
  font-weight: 900;
}

.rank-hero-card strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
  font-weight: 900;
}

.rank-hero-card p {
  color: var(--muted);
  line-height: 1.7;
}

.breadcrumb {
  color: var(--muted);
  margin-bottom: 22px;
  font-size: 14px;
}

.breadcrumb a {
  color: #fb923c;
}

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

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

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.15));
  border: 0;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-overlay span {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  padding-left: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 50%;
  box-shadow: 0 22px 48px rgba(249, 115, 22, 0.35);
  font-size: 34px;
}

.play-overlay strong {
  font-size: 20px;
}

.player-shell.is-playing .play-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.detail-side-card {
  padding: 20px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.detail-side-card > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 22px;
  margin-bottom: 18px;
}

.detail-side-card h1 {
  font-size: 32px;
}

.detail-side-card p,
.detail-copy p {
  color: var(--muted-strong);
  line-height: 1.9;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.detail-meta div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.54);
}

.detail-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-meta dd {
  margin: 4px 0 0;
  color: #fff;
  font-weight: 800;
}

.detail-copy {
  padding-top: 48px;
  padding-bottom: 12px;
}

.detail-copy p {
  margin: 0;
  padding: 26px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 17px;
}

.page-search {
  margin-top: 24px;
}

.page-search input {
  width: min(520px, 100%);
  border-radius: 16px;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.78);
}

.site-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-logo {
  color: #fb923c;
  font-size: 22px;
  font-weight: 900;
}

.site-footer p {
  max-width: 520px;
  color: var(--muted);
}

.footer-links a {
  color: var(--muted-strong);
}

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

.is-hidden-by-filter {
  display: none;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 36px;
  color: var(--muted-strong);
  text-align: center;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 24px;
}

@media (max-width: 1180px) {
  .full-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rank-hero {
    grid-template-columns: 1fr;
  }
}

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

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

  .hero-slider {
    height: 620px;
    min-height: 620px;
  }

  .hero-content {
    left: 24px;
    width: calc(100% - 48px);
  }

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

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

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .container-wrap,
  .site-header-inner,
  .mobile-panel,
  .site-footer-inner {
    width: min(100% - 24px, 1180px);
  }

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

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

  .hero-arrow {
    display: none;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-content p {
    font-size: 16px;
  }

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

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

  .movie-grid,
  .full-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

  .movie-card-horizontal .movie-card-link,
  .rank-hero-card {
    grid-template-columns: 1fr;
  }

  .page-hero,
  .rank-hero {
    padding: 28px;
    border-radius: 24px;
  }

  .detail-side-card h1 {
    font-size: 26px;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }

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

  .mobile-search input,
  .mobile-search button {
    width: 100%;
  }
}
