:root {
  --page-bg: #0f172a;
  --panel-bg: #1e293b;
  --soft-panel: rgba(30, 41, 59, 0.72);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --amber: #d97706;
  --amber-light: #fbbf24;
  --border-soft: rgba(217, 119, 6, 0.28);
  --shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.36);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --container: 1180px;
}

* {
  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;
  background:
    radial-gradient(circle at 15% 0%, rgba(217, 119, 6, 0.18), transparent 34%),
    linear-gradient(145deg, #0f172a 0%, #111827 45%, #134e4a 130%);
  color: var(--text-main);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.76), transparent 84%);
  z-index: -1;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.logo-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  color: #111827;
  box-shadow: 0 12px 28px rgba(217, 119, 6, 0.32);
}

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

.main-nav a {
  color: var(--text-muted);
  font-size: 15px;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--amber-light);
}

.top-search {
  display: flex;
  align-items: center;
  width: 300px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
}

.top-search input,
.large-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text-main);
  background: transparent;
}

.top-search input::placeholder,
.large-search input::placeholder {
  color: var(--text-soft);
}

.top-search button,
.large-search button,
.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-search button,
.large-search button,
.primary-btn {
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  color: #111827;
  font-weight: 700;
}

.top-search button {
  padding: 7px 14px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.hero-carousel {
  position: relative;
  min-height: 680px;
  overflow: hidden;
}

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

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.34)), var(--hero-image);
  background-size: cover;
  background-position: center;
}

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

.hero-backdrop {
  background:
    radial-gradient(circle at 70% 45%, rgba(251, 191, 36, 0.18), transparent 24%),
    linear-gradient(to top, var(--page-bg), transparent 38%);
}

.hero-content {
  position: relative;
  width: min(var(--container), calc(100% - 32px));
  min-height: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: center;
  gap: 54px;
}

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

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  color: var(--amber-light);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-title-block h1 {
  margin: 0 0 20px;
  line-height: 1.08;
  font-size: clamp(38px, 7vw, 78px);
  letter-spacing: -0.05em;
}

.hero-copy p,
.page-hero p,
.detail-title-block p {
  max-width: 660px;
  margin: 0;
  color: var(--text-muted);
  font-size: 18px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 28px;
}

.hero-tags span,
.meta-line span,
.genre-line,
.poster-year {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: #fde68a;
}

.hero-tags span {
  padding: 6px 12px;
  font-size: 13px;
}

.hero-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
}

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

.primary-btn:hover,
.ghost-btn:hover,
.large-search button:hover,
.top-search button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(217, 119, 6, 0.26);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
  transform: rotate(2deg);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: var(--amber-light);
  backdrop-filter: blur(8px);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 34px;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
  z-index: 5;
}

.hero-dot {
  width: 34px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--amber-light);
}

.quick-search,
.content-section,
.page-hero,
.detail-hero-inner {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.quick-search {
  margin-top: -56px;
  position: relative;
  z-index: 6;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  background: rgba(30, 41, 59, 0.82);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.centered {
  text-align: center;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.03em;
}

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

.section-heading a,
.text-link {
  color: var(--amber-light);
  font-weight: 700;
}

.large-search {
  display: flex;
  gap: 10px;
  max-width: 780px;
  margin: 24px auto 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
}

.large-search input {
  padding: 0 14px;
}

.large-search button {
  padding: 12px 24px;
}

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

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

.category-tile {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  box-shadow: var(--shadow-strong);
}

.category-tile img,
.tile-shade,
.detail-hero-shade {
  position: absolute;
  inset: 0;
}

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

.category-tile:hover img,
.movie-card:hover img {
  transform: scale(1.06);
}

.tile-shade {
  background: linear-gradient(to top, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.1));
}

.category-tile strong,
.category-tile em {
  position: relative;
  z-index: 1;
}

.category-tile strong {
  font-size: 22px;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.7);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-strong);
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.75), transparent 48%);
}

.poster-year {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  font-size: 12px;
}

.rank-mark {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--amber-light);
  color: #111827;
  font-weight: 900;
}

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

.movie-card-body h3 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.35;
}

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

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
}

.meta-line span {
  padding: 3px 8px;
}

.genre-line {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 52px 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.7);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  border-color: var(--border-soft);
}

.rank-num {
  color: var(--amber-light);
  font-size: 24px;
  font-weight: 900;
}

.rank-row img {
  width: 64px;
  height: 86px;
  border-radius: 12px;
  object-fit: cover;
}

.rank-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.rank-meta {
  color: var(--text-soft);
  font-size: 13px;
}

.page-hero {
  min-height: 340px;
  display: flex;
  align-items: center;
  padding: 72px 0 36px;
}

.compact-hero,
.category-hero {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.collection-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.7);
}

.collection-image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  object-fit: cover;
}

.collection-card h2 {
  margin: 0 0 8px;
}

.collection-card p {
  margin: 0;
  color: var(--text-muted);
}

.preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.preview-links a {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  font-size: 13px;
}

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

.ranking-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.72);
}

.ranking-poster {
  position: relative;
}

.ranking-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  object-fit: cover;
}

.ranking-poster span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 10px;
  background: var(--amber-light);
  color: #111827;
  font-weight: 900;
}

.ranking-info h2 {
  margin: 10px 0 8px;
  line-height: 1.3;
}

.ranking-info p {
  margin: 0 0 12px;
  color: var(--text-muted);
}

.detail-hero {
  position: relative;
  min-height: 520px;
  background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.38)), var(--detail-image);
  background-size: cover;
  background-position: center;
}

.detail-hero-shade {
  background: linear-gradient(to top, var(--page-bg), transparent 42%);
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
  padding: 48px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
  color: var(--text-muted);
  font-size: 14px;
}

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

.detail-title-block {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: end;
  gap: 32px;
}

.detail-title-block > img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow-strong);
}

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

.player-card,
.story-card,
.side-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(30, 41, 59, 0.76);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.player-shell {
  position: relative;
  background: #020617;
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: var(--text-main);
  background: radial-gradient(circle at center, rgba(217, 119, 6, 0.22), rgba(15, 23, 42, 0.62));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-circle {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  color: #111827;
  font-size: 32px;
  box-shadow: 0 18px 38px rgba(217, 119, 6, 0.38);
}

.story-card {
  margin-top: 22px;
  padding: 28px;
}

.story-card h2,
.side-card h2 {
  margin: 0 0 14px;
}

.story-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 17px;
}

.side-card {
  padding: 22px;
}

.side-card dl {
  margin: 0;
}

.side-card dt {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 13px;
}

.side-card dd {
  margin: 2px 0 0;
  color: var(--text-main);
  font-weight: 700;
}

.next-prev {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.next-prev a {
  color: var(--text-muted);
}

.next-prev a:hover {
  color: var(--amber-light);
}

.related-grid .compact-card .movie-card-body p {
  min-height: auto;
}

.search-panel {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 60;
  width: min(760px, calc(100% - 32px));
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow-strong);
  transform: translateX(-50%);
}

.search-result-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-result-item img {
  width: 58px;
  height: 78px;
  border-radius: 10px;
  object-fit: cover;
}

.search-result-item strong {
  display: block;
  margin-bottom: 2px;
}

.search-result-item span,
.search-result-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer {
  margin-top: 84px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.86);
}

.footer-inner {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--amber-light);
}

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

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

  .hero-poster {
    display: none;
  }

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

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

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    min-height: 64px;
    padding: 12px 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    margin: 0;
    padding: 10px 0 2px;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
  }

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

  .hero-copy h1,
  .page-hero h1,
  .detail-title-block h1 {
    font-size: 38px;
  }

  .hero-copy p,
  .page-hero p,
  .detail-title-block p {
    font-size: 16px;
  }

  .quick-search {
    padding: 24px;
  }

  .large-search {
    flex-direction: column;
    border-radius: 22px;
  }

  .large-search input {
    min-height: 44px;
  }

  .category-grid,
  .movie-grid,
  .rank-list,
  .collection-grid,
  .ranking-layout {
    grid-template-columns: 1fr 1fr;
  }

  .collection-card,
  .ranking-card,
  .detail-title-block {
    grid-template-columns: 1fr;
  }

  .detail-title-block > img {
    max-width: 220px;
  }

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

@media (max-width: 560px) {
  .category-grid,
  .movie-grid,
  .rank-list,
  .collection-grid,
  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 42px 58px minmax(0, 1fr);
  }

  .rank-meta {
    display: none;
  }

  .hero-actions,
  .page-actions,
  .footer-links {
    width: 100%;
    flex-direction: column;
  }

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

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