:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #1e293b;
  --panel-2: #273449;
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --shadow: 0 24px 60px 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 top left, rgba(245, 158, 11, 0.12), transparent 28rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

main {
  min-height: 64vh;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark,
.footer-brand span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #111827;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.32);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.brand-text em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-top: 4px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted-2);
  font-size: 14px;
  white-space: nowrap;
}

.nav-link {
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.header-search {
  position: relative;
}

.header-search input,
.mobile-search input,
.search-page-form input,
.filter-panel input,
.filter-panel select {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.84);
  color: var(--text);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
  width: 230px;
  padding: 10px 42px 10px 14px;
}

.header-search button {
  position: absolute;
  right: 5px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #111827;
  cursor: pointer;
}

.header-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding: 16px;
  background: rgba(15, 23, 42, 0.98);
}

.mobile-nav.open {
  display: block;
}

.mobile-search input {
  flex: 1;
  padding: 10px 12px;
}

.mobile-search button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #111827;
  padding: 10px 16px;
  font-weight: 700;
}

.mobile-nav nav {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mobile-link {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted-2);
  background: rgba(148, 163, 184, 0.07);
}

.mobile-link:hover {
  color: var(--accent);
  background: rgba(148, 163, 184, 0.12);
}

.hero-carousel {
  position: relative;
  height: clamp(480px, 68vh, 680px);
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.72) 55%, #0f172a), linear-gradient(90deg, #0f172a 0%, rgba(15, 23, 42, 0.78) 38%, rgba(15, 23, 42, 0.14) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0 0 76px;
  max-width: 1180px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 16px;
}

.hero-content h1,
.page-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-content p,
.page-hero p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted-2);
  font-size: clamp(16px, 2.2vw, 20px);
}

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

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

.hero-tags span,
.tag-row span,
.tag-cloud span,
.meta-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted-2);
  padding: 5px 10px;
  font-size: 12px;
}

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

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

.btn-primary {
  background: var(--accent);
  color: #111827;
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.26);
}

.btn-primary:hover,
.section-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: white;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-nav:hover {
  background: rgba(0, 0, 0, 0.72);
}

.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: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.page-hero {
  padding: 86px 0 64px;
  background: radial-gradient(circle at 20% 10%, rgba(245, 158, 11, 0.16), transparent 28rem), linear-gradient(135deg, #111827, #0f172a 56%, #020617);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

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

section.container,
.detail-wrap {
  padding: 52px 0;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
}

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

.section-more {
  color: #111827;
  background: var(--accent);
  min-width: 108px;
}

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

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

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px;
}

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

.movie-card,
.list-card,
.category-tile,
.content-panel,
.side-info,
.related-box,
.filter-panel {
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover,
.category-tile:hover,
.list-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.48);
  box-shadow: var(--shadow);
}

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

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

.movie-card.large .poster-wrap {
  aspect-ratio: 16 / 13;
}

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

.movie-card:hover .poster-wrap img,
.list-card:hover img,
.side-poster:hover img {
  transform: scale(1.06);
}

.year-badge,
.rank-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.rank-badge {
  left: 12px;
  right: auto;
  background: var(--accent);
  color: #111827;
}

.movie-body {
  padding: 16px;
}

.movie-body h3,
.list-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card.large .movie-body h3 {
  font-size: 24px;
}

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

.movie-card.large .movie-body p {
  -webkit-line-clamp: 3;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-row {
  margin-top: 12px;
}

.tag-row span:first-child,
.meta-row span:first-child {
  color: var(--accent);
}

.list-card {
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.list-card a {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
}

.list-card img {
  width: 132px;
  height: 86px;
  object-fit: cover;
  border-radius: 14px;
  background: #020617;
  transition: transform 0.4s ease;
}

.list-rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-weight: 900;
}

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

.category-tile {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.category-tile span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.category-tile strong {
  margin-top: 18px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.category-tile em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr;
  gap: 16px;
  padding: 18px;
  margin-bottom: 24px;
}

.filter-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  padding: 12px 14px;
}

.search-page-form {
  width: min(720px, 100%);
  margin-top: 26px;
}

.search-page-form input {
  flex: 1;
  min-height: 48px;
  padding: 0 16px;
}

.detail-wrap {
  padding-top: 30px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 22px;
  font-size: 14px;
}

.breadcrumb a:hover,
.side-info a:hover {
  color: var(--accent);
}

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

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

.player-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #020617;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.video-node,
.player-overlay,
.player-overlay img,
.player-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-node {
  background: #020617;
}

.player-overlay {
  border: 0;
  padding: 0;
  color: white;
  cursor: pointer;
  z-index: 2;
  overflow: hidden;
  background: #020617;
}

.player-overlay img {
  object-fit: cover;
}

.player-shade {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.05), rgba(2, 6, 23, 0.72));
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-size: 30px;
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 20px 45px rgba(245, 158, 11, 0.32);
}

.player-card.is-playing .player-overlay {
  opacity: 0;
  pointer-events: none;
}

.detail-content h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.content-panel {
  padding: 24px;
  margin-bottom: 18px;
}

.content-panel h2,
.side-info h2,
.related-box h2,
.site-footer h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.content-panel p {
  margin: 0;
  color: var(--muted-2);
}

.content-panel p + p {
  margin-top: 14px;
}

.lead-text {
  color: var(--text) !important;
  font-weight: 700;
}

.tag-cloud {
  margin-top: 4px;
}

.side-poster {
  overflow: hidden;
  border-radius: 20px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.side-info,
.related-box {
  padding: 20px;
}

.side-info dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.side-info dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.side-info dt {
  color: var(--muted);
}

.side-info dd {
  margin: 0;
  color: var(--text);
  text-align: right;
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: #0b1220;
  margin-top: 40px;
}

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

.footer-grid p,
.footer-grid a {
  color: var(--muted);
  font-size: 14px;
}

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

.footer-grid a:hover {
  color: var(--accent);
}

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

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

.empty-state {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: rgba(30, 41, 59, 0.7);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

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

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

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

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

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

  .related-box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .header-search {
    display: none;
  }

  .hero-carousel {
    height: 560px;
  }

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

  .hero-nav {
    display: none;
  }

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

  .feature-grid,
  .footer-grid,
  .filter-panel,
  .detail-side {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .header-inner {
    height: 68px;
  }

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

  .brand-text em {
    display: none;
  }

  .container,
  .header-inner,
  .hero-content,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 24px, 1180px);
  }

  .hero-carousel {
    height: 520px;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: 34px;
  }

  .hero-actions,
  .search-page-form {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .list-card img {
    width: 96px;
    height: 76px;
  }

  .list-rank {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
  }

  .content-panel,
  .side-info,
  .related-box {
    padding: 18px;
  }
}
