:root {
  --night-950: #071422;
  --night-900: #102a43;
  --night-850: #19334f;
  --night-800: #243b53;
  --night-700: #334e68;
  --night-600: #486581;
  --night-500: #627d98;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-300: #fcd34d;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.20);
  --soft-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 34%), linear-gradient(180deg, var(--night-900), var(--night-950) 48%, #050b13);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(51, 78, 104, 0.9);
  background: rgba(16, 42, 67, 0.95);
  backdrop-filter: blur(12px);
}

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

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

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber-400), #d97706);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.32);
}

.brand-mark::after {
  position: absolute;
  top: 9px;
  left: 12px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #ffffff;
  content: "";
}

.brand-text {
  background: linear-gradient(90deg, var(--amber-400), #d97706);
  background-clip: text;
  color: transparent;
  font-size: clamp(20px, 2.3vw, 28px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link,
.dropdown-button {
  border: 0;
  background: transparent;
  color: #d1d5db;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.dropdown-button:hover {
  color: var(--amber-400);
}

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: 34px;
  left: 0;
  display: grid;
  min-width: 168px;
  padding: 10px;
  border: 1px solid rgba(72, 101, 129, 0.65);
  border-radius: 14px;
  background: rgba(36, 59, 83, 0.98);
  box-shadow: var(--card-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.dropdown-panel a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #d1d5db;
}

.dropdown-panel a:hover {
  background: rgba(51, 78, 104, 0.9);
  color: var(--amber-400);
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

.header-search input,
.filter-input,
.search-input {
  width: 240px;
  border: 1px solid var(--night-600);
  border-radius: 12px;
  outline: none;
  background: var(--night-800);
  color: var(--text-main);
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.filter-input:focus,
.search-input:focus {
  border-color: var(--amber-400);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.header-search button,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button,
.btn-primary {
  background: var(--amber-500);
  color: #ffffff;
}

.btn-secondary {
  background: var(--night-700);
  color: #ffffff;
}

.header-search button:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--night-800);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  border-radius: 10px;
  background: #d1d5db;
}

main {
  min-height: 64vh;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  border-bottom: 1px solid rgba(51, 78, 104, 0.7);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: saturate(1.08) contrast(1.02);
}

.hero-slide::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 20, 34, 0.96) 0%, rgba(7, 20, 34, 0.72) 48%, rgba(7, 20, 34, 0.38) 100%), linear-gradient(0deg, var(--night-950), rgba(7, 20, 34, 0) 40%);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 48px;
  padding: 82px 0 72px;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 14px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber-300);
  font-size: 14px;
  font-weight: 700;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6.2vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.gradient-text {
  background: linear-gradient(90deg, var(--amber-400), #d97706);
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 720px;
  margin: 24px 0 0;
  color: #d1d5db;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.85;
}

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

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

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

.hero-tags span,
.tag-row span,
.movie-tags a,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(51, 78, 104, 0.75);
  color: #d1d5db;
  font-size: 12px;
}

.hero-poster {
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.26);
  border-radius: 28px;
  background: rgba(36, 59, 83, 0.72);
  box-shadow: var(--card-shadow);
  transform: perspective(1200px) rotateY(-4deg);
}

.hero-poster img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.hero-poster-info {
  padding: 22px;
}

.hero-poster-info h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.hero-poster-info span {
  color: var(--amber-400);
  font-size: 14px;
}

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

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

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

.section {
  padding: 72px 0;
}

.section.alt {
  background: rgba(16, 42, 67, 0.42);
}

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

.section-title {
  margin: 0;
  color: var(--amber-400);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
}

.section-header p,
.page-hero p,
.category-card p,
.movie-card p,
.horizontal-card p,
.detail-copy p {
  color: var(--text-muted);
  line-height: 1.7;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(72, 101, 129, 0.55);
  border-radius: 18px;
  background: rgba(36, 59, 83, 0.92);
  box-shadow: var(--soft-shadow);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: var(--card-shadow);
  transform: translateY(-4px);
}

.poster-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--night-900);
}

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

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

.type-badge,
.rank-badge,
.mini-rank {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.type-badge {
  right: 12px;
  bottom: 12px;
  min-height: 28px;
  padding: 0 10px;
  background: rgba(7, 20, 34, 0.72);
  color: var(--amber-300);
  font-size: 12px;
}

.rank-badge,
.mini-rank {
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  background: var(--amber-500);
  color: #ffffff;
}

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

.movie-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.movie-card h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 54px;
  margin: 10px 0 8px;
  color: #ffffff;
  font-size: 19px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 48px;
  margin: 0 0 14px;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.category-card {
  min-height: 190px;
  padding: 24px;
  border: 1px solid rgba(72, 101, 129, 0.56);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(36, 59, 83, 0.96), rgba(16, 42, 67, 0.92));
  box-shadow: var(--soft-shadow);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover {
  border-color: rgba(251, 191, 36, 0.45);
  transform: translateY(-4px);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
  color: #ffffff;
}

.category-card p {
  margin: 0;
  font-size: 14px;
}

.page-hero {
  padding: 58px 0;
  border-bottom: 1px solid rgba(51, 78, 104, 0.65);
  background: linear-gradient(180deg, rgba(16, 42, 67, 0.98), rgba(7, 20, 34, 0.78));
}

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

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

.page-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.12;
}

.page-hero p {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: 18px;
}

.filter-bar,
.search-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid rgba(72, 101, 129, 0.55);
  border-radius: 18px;
  background: rgba(36, 59, 83, 0.72);
}

.filter-input,
.search-input {
  width: min(100%, 420px);
}

.empty-state {
  display: none;
  padding: 56px 24px;
  border-radius: 20px;
  background: rgba(36, 59, 83, 0.72);
  color: var(--text-muted);
  text-align: center;
}

.empty-state.show {
  display: block;
}

.rank-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
}

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

.horizontal-card {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(72, 101, 129, 0.52);
  border-radius: 18px;
  background: rgba(36, 59, 83, 0.88);
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.horizontal-card:hover {
  border-color: rgba(251, 191, 36, 0.45);
  transform: translateY(-2px);
}

.horizontal-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
}

.horizontal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.horizontal-card h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 20px;
}

.horizontal-card p {
  margin: 0 0 10px;
  font-size: 14px;
}

.horizontal-card span {
  color: var(--amber-400);
  font-size: 13px;
}

.sidebar-panel,
.detail-panel {
  padding: 24px;
  border: 1px solid rgba(72, 101, 129, 0.52);
  border-radius: 20px;
  background: rgba(36, 59, 83, 0.82);
  box-shadow: var(--soft-shadow);
}

.sidebar-panel {
  position: sticky;
  top: 104px;
}

.sidebar-panel h2,
.detail-panel h2 {
  margin: 0 0 18px;
  color: #ffffff;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(72, 101, 129, 0.8);
  border-radius: 22px;
  background: #000000;
  box-shadow: var(--card-shadow);
  aspect-ratio: 16 / 9;
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.24);
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.play-button {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--amber-500);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(245, 158, 11, 0.34);
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-button:hover {
  background: #d97706;
  transform: scale(1.06);
}

.play-button span {
  width: 0;
  height: 0;
  margin-left: 6px;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 24px solid #ffffff;
}

.player-error {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.92);
  color: #fecaca;
  font-size: 14px;
}

.player-error.show {
  display: block;
}

.detail-copy {
  display: grid;
  gap: 20px;
  margin-top: 26px;
}

.detail-copy p {
  margin: 0;
  white-space: pre-line;
}

.detail-title-block {
  margin: 28px 0 0;
}

.detail-title-block h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.18;
}

.detail-meta {
  margin-bottom: 20px;
}

.detail-cover-card img {
  width: 100%;
  border-radius: 18px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.related-small {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.related-small img {
  width: 112px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
}

.related-small h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-small span {
  color: var(--text-soft);
  font-size: 12px;
}

.site-footer {
  border-top: 1px solid rgba(51, 78, 104, 0.8);
  background: rgba(16, 42, 67, 0.96);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding: 48px 0;
}

.footer-brand p {
  max-width: 420px;
  color: var(--text-soft);
  line-height: 1.75;
}

.site-footer h3 {
  margin: 0 0 14px;
  color: var(--amber-400);
}

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

.site-footer a {
  color: var(--text-soft);
}

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

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(51, 78, 104, 0.7);
  color: var(--text-soft);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
}

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

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

  .hero-content,
  .detail-layout,
  .rank-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    max-width: 420px;
    transform: none;
  }

  .sidebar-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .header-inner {
    min-height: 66px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 66px;
    right: 0;
    left: 0;
    display: none;
    padding: 18px;
    border-bottom: 1px solid rgba(51, 78, 104, 0.9);
    background: rgba(16, 42, 67, 0.98);
  }

  .site-nav.open {
    display: grid;
  }

  .dropdown-panel {
    position: static;
    display: grid;
    margin-top: 8px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .header-search {
    display: grid;
  }

  .header-search input {
    width: 100%;
  }

  .hero {
    min-height: 720px;
  }

  .hero-content {
    padding-top: 54px;
    gap: 28px;
  }

  .hero-poster img {
    height: 320px;
  }

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

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

  .horizontal-card {
    grid-template-columns: 132px minmax(0, 1fr);
  }
}

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

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

  .hero h1,
  .page-hero h1 {
    word-break: break-word;
  }

  .hero-actions {
    display: grid;
  }

  .btn-primary,
  .btn-secondary,
  .header-search button {
    width: 100%;
  }

  .horizontal-card,
  .related-small {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .related-small img {
    width: 108px;
    height: 68px;
  }
}
