:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --rose: #fb7185;
  --shadow: 0 18px 70px rgba(8, 47, 73, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.12), transparent 26rem),
    radial-gradient(circle at 90% 12%, rgba(59, 130, 246, 0.12), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  left: 0;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.38), transparent);
  backdrop-filter: blur(0);
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.scrolled,
.site-header.menu-open {
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-space {
  height: 64px;
}

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

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.26);
  font-size: 15px;
}

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

.nav-link {
  color: #cbd5e1;
  font-weight: 650;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link.active {
  color: var(--cyan);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
}

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

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

.mobile-nav-link {
  padding: 12px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 650;
}

.mobile-nav-link:hover {
  background: rgba(30, 41, 59, 0.8);
}

.hero-carousel {
  position: relative;
  min-height: 70vh;
  margin-top: -64px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1.2s ease;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #020617 0%, rgba(2, 6, 23, 0.74) 35%, rgba(2, 6, 23, 0.18) 100%),
    radial-gradient(circle at 16% 72%, rgba(34, 211, 238, 0.18), transparent 28rem);
}

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

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 78px;
  max-width: 760px;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 16px 0 16px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero-content p {
  margin: 0;
  max-width: 680px;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.85;
}

.hero-tags,
.genre-strip,
.tag-line,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.hero-tags span,
.genre-strip span,
.tag-line span,
.detail-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

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

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

.primary-button {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 15px 42px rgba(34, 211, 238, 0.25);
}

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

.ghost-button {
  border: 1px solid rgba(226, 232, 240, 0.16);
  background: rgba(15, 23, 42, 0.68);
  color: #e2e8f0;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  right: max(32px, calc((100% - 1180px) / 2));
  bottom: 76px;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 28px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.35);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
  width: 54px;
  background: var(--cyan);
}

.quick-search,
.content-section,
.detail-shell,
.overview-stack {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.quick-search {
  margin-top: -36px;
  position: relative;
  z-index: 12;
}

.quick-search-inner,
.filter-panel,
.category-overview-card,
.detail-content,
.side-info-card,
.player-card,
.site-footer {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.quick-search-inner {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 24px;
  align-items: center;
  padding: 24px;
  border-radius: 22px;
}

.quick-search h2,
.section-head h2,
.page-hero h1,
.detail-content h1,
.ranking-side h2 {
  margin: 8px 0 0;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.quick-search h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.home-search,
.filter-grid {
  display: grid;
  gap: 12px;
}

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

.home-search input,
.filter-input,
.filter-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.66);
  color: #e2e8f0;
  outline: none;
}

.home-search input,
.filter-input {
  padding: 0 16px;
}

.filter-select {
  padding: 0 14px;
}

.home-search input:focus,
.filter-input:focus,
.filter-select:focus {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.home-search button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-weight: 800;
  cursor: pointer;
}

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

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

.section-head h2 {
  font-size: clamp(26px, 4vw, 42px);
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--cyan);
  font-weight: 800;
  white-space: nowrap;
}

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

.category-card,
.category-hero-link {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background-size: cover;
  background-position: center;
  padding: 18px;
}

.category-card::before,
.category-hero-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.8), transparent);
}

.category-card span,
.category-card strong,
.category-hero-link h2,
.category-hero-link p,
.category-hero-link .eyebrow {
  position: relative;
  z-index: 1;
}

.category-card span {
  color: white;
  font-size: 20px;
  font-weight: 900;
}

.category-card strong {
  margin-top: 8px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

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

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

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

.poster-link,
.row-cover,
.side-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.42), rgba(15, 23, 42, 0.9));
}

.poster-link {
  aspect-ratio: 16 / 10;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
}

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

.poster-link img.image-missing,
.row-cover img.image-missing,
.side-poster img.image-missing {
  opacity: 0;
}

.movie-card:hover .poster-link img,
.movie-row:hover .row-cover img {
  transform: scale(1.08);
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 58%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.movie-card:hover .poster-shade {
  opacity: 1;
}

.play-dot,
.player-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.92);
  color: white;
  box-shadow: 0 18px 45px rgba(34, 211, 238, 0.25);
}

.play-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%) scale(0.86);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.category-pill,
.year-pill,
.rank-badge {
  position: absolute;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.82);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
}

.category-pill {
  top: 10px;
  left: 10px;
  color: var(--cyan);
}

.year-pill {
  right: 10px;
  bottom: 10px;
}

.rank-badge {
  top: 10px;
  right: 10px;
  min-width: 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--amber), var(--rose));
  color: white;
}

.card-body {
  padding: 14px 2px 0;
}

.card-body h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.card-body h3 a:hover,
.row-title:hover {
  color: var(--cyan);
}

.card-body p,
.row-body p,
.detail-one-line,
.footer-inner p,
.category-hero-link p,
.page-hero p {
  color: var(--muted);
  line-height: 1.75;
}

.card-body p {
  min-height: 52px;
  margin: 8px 0 10px;
  font-size: 14px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
}

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

.tag-line {
  margin-top: 10px;
}

.tag-line span {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 34px;
  align-items: start;
}

.rank-list {
  display: grid;
  gap: 14px;
}

.movie-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.55);
  transition: background 0.25s ease, transform 0.25s ease;
}

.movie-row:hover {
  background: rgba(30, 41, 59, 0.76);
  transform: translateY(-2px);
}

.row-cover {
  aspect-ratio: 16 / 10;
  border-radius: 16px;
}

.row-title {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 850;
}

.row-body p {
  margin: 0 0 10px;
  font-size: 14px;
}

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

.page-hero {
  min-height: 310px;
  display: flex;
  align-items: flex-end;
  margin-top: -64px;
  padding: 130px max(16px, calc((100% - 1180px) / 2)) 54px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 -90px 80px #020617;
}

.slim-hero {
  background:
    radial-gradient(circle at 18% 40%, rgba(34, 211, 238, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 1));
}

.page-hero > div {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.page-hero h1 {
  font-size: clamp(38px, 5vw, 64px);
}

.page-hero p {
  max-width: 760px;
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: #94a3b8;
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--cyan);
}

.filter-panel {
  margin-bottom: 26px;
  padding: 18px;
  border-radius: 20px;
}

.filter-label {
  display: block;
  margin-bottom: 12px;
  color: #e2e8f0;
  font-weight: 850;
}

.filter-grid {
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(130px, 0.75fr));
}

.overview-stack {
  display: grid;
  gap: 34px;
  padding-top: 64px;
}

.category-overview-card {
  padding: 18px;
  border-radius: 24px;
}

.category-hero-link {
  min-height: 220px;
  margin-bottom: 18px;
}

.category-hero-link h2 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 4vw, 46px);
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
}

.ranking-side {
  position: sticky;
  top: 88px;
}

.ranking-side h2 {
  margin-bottom: 20px;
  font-size: 28px;
}

.detail-shell {
  padding-top: 34px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
}

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

.player-card {
  padding: 12px;
  border-radius: 24px;
}

.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
}

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

.player-start {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 82px;
  height: 82px;
  border: 0;
  transform: translate(-50%, -50%);
  font-size: 34px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.player-start:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.player-wrap.playing .player-start {
  opacity: 0;
  pointer-events: none;
}

.player-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.74);
}

.player-loading::before {
  content: "";
  width: 48px;
  height: 48px;
  border: 4px solid rgba(34, 211, 238, 0.25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.player-wrap.loading .player-loading {
  display: flex;
}

.player-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.3));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player-wrap:hover .player-controls,
.player-wrap.playing .player-controls {
  opacity: 1;
}

.player-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  color: white;
  cursor: pointer;
}

.detail-content {
  padding: 30px;
  border-radius: 24px;
}

.detail-content h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.detail-one-line {
  margin: 16px 0;
  font-size: 18px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.detail-meta span {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.82);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 750;
}

.detail-content h2 {
  margin: 30px 0 10px;
  font-size: 24px;
}

.detail-content p {
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.95;
}

.detail-tags {
  margin-top: 26px;
}

.detail-side {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 18px;
}

.side-poster {
  aspect-ratio: 3 / 4;
  border-radius: 24px;
}

.side-info-card {
  padding: 22px;
  border-radius: 22px;
}

.side-info-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.side-info-card dl {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px 14px;
  margin: 0 0 20px;
}

.side-info-card dt {
  color: #64748b;
}

.side-info-card dd {
  margin: 0;
  color: #e2e8f0;
}

.full-button {
  width: 100%;
}

.site-footer {
  margin-top: 80px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.66), #020617);
  box-shadow: none;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 30px;
}

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

.footer-logo {
  margin-bottom: 16px;
}

.site-footer h3 {
  margin: 0 0 16px;
}

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

.site-footer a:hover {
  color: var(--cyan);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: #64748b;
  text-align: center;
}

[data-card].hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

  .two-column-section,
  .ranking-layout,
  .detail-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .ranking-side,
  .detail-side {
    position: static;
  }

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

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

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

  .hero-carousel {
    min-height: 76vh;
  }

  .hero-content {
    padding-bottom: 92px;
  }

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

  .hero-controls {
    right: auto;
    left: 16px;
    bottom: 44px;
  }

  .quick-search-inner,
  .home-search,
  .filter-grid,
  .movie-row {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .movie-grid,
  .compact-grid,
  .side-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

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

  .page-hero {
    min-height: 280px;
    padding-bottom: 42px;
  }

  .row-cover {
    width: 100%;
  }

  .detail-content {
    padding: 22px;
  }

  .side-poster {
    max-width: 320px;
  }
}

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .player-start {
    width: 68px;
    height: 68px;
  }
}
