:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-2: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #06b6d4;
  --blue: #2563eb;
  --yellow: #facc15;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-lg: 24px;
  --radius: 16px;
  --max: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(8, 145, 178, 0.18), transparent 34rem), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.menu-open,
body.search-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.45);
  font-weight: 900;
  color: #ffffff;
}

.logo-text {
  display: grid;
  line-height: 1.15;
}

.logo-main {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.logo-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.main-nav a,
.mobile-panel a {
  color: #cbd5e1;
  border-radius: 12px;
  transition: 0.2s ease;
}

.main-nav a {
  padding: 10px 14px;
}

.main-nav a:hover,
.main-nav a.is-active,
.mobile-panel a:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.header-search {
  width: min(320px, 26vw);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
}

.header-search input,
.filter-input,
.filter-select {
  width: 100%;
  border: 0;
  outline: none;
  color: #ffffff;
  background: transparent;
}

.header-search input::placeholder,
.filter-input::placeholder {
  color: #64748b;
}

.header-search button,
.hero-button,
.section-link,
.pagination a,
.pagination span,
.filter-clear,
.play-overlay button {
  border: 0;
  cursor: pointer;
}

.header-search button,
.hero-button.primary,
.section-link.primary,
.filter-clear,
.play-overlay button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}

.header-search button {
  padding: 8px 12px;
  border-radius: 10px;
}

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.9);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 16px 18px;
  background: rgba(2, 6, 23, 0.98);
}

.mobile-panel a {
  display: block;
  padding: 12px;
}

.search-panel {
  position: fixed;
  inset: 84px 16px auto;
  z-index: 80;
  max-height: min(72vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.search-panel[hidden] {
  display: none;
}

.search-panel-inner {
  padding: 18px;
}

.search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.search-panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.search-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
  cursor: pointer;
}

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

.search-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.45);
}

.search-item img {
  width: 72px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  object-fit: cover;
  background: #0f172a;
}

.search-item h3 {
  margin: 2px 0 6px;
  font-size: 15px;
}

.search-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.hero-slides {
  position: absolute;
  inset: 0;
}

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

.hero-slide:focus {
  outline: none;
}

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

.hero-slide img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.08) brightness(0.7);
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.78) 38%, rgba(2, 6, 23, 0.12)), linear-gradient(0deg, #020617 0%, transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(var(--max), calc(100% - 32px));
  min-height: 620px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  align-items: center;
  gap: 54px;
  padding: 72px 0 106px;
}

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

.hero-kicker,
.page-kicker,
.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(103, 232, 249, 0.32);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 145, 178, 0.16);
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  margin: 24px 0 10px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-title {
  display: block;
  margin: 0 0 18px;
  color: #a5f3fc;
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-desc {
  max-width: 650px;
  margin: 0 0 26px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.9;
}

.hero-meta,
.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.hero-meta span,
.card-meta span,
.detail-meta span,
.rank-meta span,
.tag-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}

.hero-meta span,
.detail-meta span {
  padding: 7px 11px;
}

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

.hero-button,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.hero-button.secondary,
.section-link.secondary {
  border: 1px solid var(--line);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.74);
}

.hero-button:hover,
.section-link:hover,
.movie-card:hover,
.rank-item:hover,
.category-tile:hover {
  transform: translateY(-3px);
}

.hero-poster {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(37, 99, 235, 0.08));
  box-shadow: var(--shadow);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  object-fit: cover;
  background: #0f172a;
}

.hero-score {
  position: absolute;
  top: 22px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #111827;
  background: var(--yellow);
  font-weight: 900;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 5;
  width: min(var(--max), calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

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

.hero-dot {
  width: 38px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--cyan);
}

.hero-arrows {
  display: flex;
  gap: 10px;
}

.hero-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.75);
  cursor: pointer;
}

.section {
  padding: 58px 0;
}

.section.compact {
  padding-top: 28px;
}

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

.section-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.section-desc,
.page-desc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.78);
  transition: 0.22s ease;
}

.movie-card:hover {
  border-color: rgba(6, 182, 212, 0.62);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

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

.poster-wrap {
  position: relative;
  overflow: hidden;
  background: #0f172a;
}

.poster-wrap img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .poster-wrap img,
.category-tile:hover img,
.rank-item:hover img {
  transform: scale(1.08);
}

.poster-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent);
}

.score-badge,
.type-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.score-badge {
  right: 10px;
  gap: 4px;
  padding: 5px 8px;
  color: #111827;
  background: var(--yellow);
}

.type-badge {
  left: 10px;
  padding: 5px 8px;
  color: #cffafe;
  background: rgba(8, 145, 178, 0.78);
}

.play-float {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  opacity: 0;
  transform: translateY(6px);
  transition: 0.22s ease;
}

.movie-card:hover .play-float {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

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

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

.card-body p {
  margin: 0;
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.card-meta span {
  padding: 4px 8px;
  font-size: 12px;
}

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

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.8);
  transition: 0.22s ease;
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  transition: transform 0.45s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.25));
}

.category-tile-content {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
}

.category-tile h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.category-tile p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 70px 150px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.78);
  transition: 0.22s ease;
}

.rank-no {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-size: 20px;
  font-weight: 900;
}

.rank-item img {
  width: 150px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  object-fit: cover;
  background: #0f172a;
  transition: transform 0.4s ease;
}

.rank-content h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.rank-content p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.page-hero {
  padding: 58px 0 34px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.14), transparent 32rem);
}

.page-hero h1 {
  margin: 18px 0 0;
  max-width: 900px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr) auto;
  gap: 12px;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.75);
}

.filter-input,
.filter-select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.55);
}

.filter-select option {
  background: #0f172a;
}

.filter-clear {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 800;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

.pagination a,
.pagination span {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.74);
}

.pagination span,
.pagination a:hover {
  color: #ffffff;
  border-color: rgba(6, 182, 212, 0.62);
  background: rgba(8, 145, 178, 0.35);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #67e8f9;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
  padding-bottom: 60px;
}

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

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.08));
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-overlay button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 18px;
}

.detail-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
}

.detail-card h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.05em;
}

.detail-card h2,
.aside-card h2 {
  margin: 28px 0 12px;
  font-size: 22px;
}

.detail-card p {
  color: #dbeafe;
  line-height: 2;
}

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

.tag-pill {
  padding: 7px 10px;
  color: #cbd5e1;
  font-size: 13px;
}

.detail-aside {
  display: grid;
  gap: 18px;
}

.aside-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
}

.aside-card-inner {
  padding: 18px;
}

.detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #0f172a;
}

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

.related-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.related-item:hover {
  background: rgba(30, 41, 59, 0.8);
}

.related-item img {
  width: 70px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  object-fit: cover;
  background: #0f172a;
}

.related-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.related-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.95);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 26px;
  padding: 44px 0;
}

.footer-inner h2,
.footer-inner h3 {
  margin: 0 0 12px;
}

.footer-inner p,
.footer-inner li {
  color: var(--muted);
  line-height: 1.8;
}

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

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

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 14px;
}

.empty-state {
  display: none;
  padding: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

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

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

  .hero-content {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

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

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

  .mobile-menu-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

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

  .hero,
  .hero-content {
    min-height: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    padding: 72px 0 104px;
  }

  .hero-poster {
    display: none;
  }

  .category-grid,
  .footer-inner,
  .detail-layout {
    grid-template-columns: 1fr;
  }

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

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

  .rank-action {
    grid-column: 2 / -1;
  }
}

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

  .logo-sub {
    display: none;
  }

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

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

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

  .rank-item {
    grid-template-columns: 44px 88px 1fr;
    gap: 12px;
    padding: 10px;
  }

  .rank-item img {
    width: 88px;
  }

  .card-body {
    padding: 12px;
  }

  .hero-controls {
    bottom: 18px;
  }

  .hero-arrow {
    width: 40px;
    height: 40px;
  }

  .hero-dot {
    width: 28px;
  }

  .detail-card,
  .aside-card-inner {
    padding: 18px;
  }
}
