:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-solid: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --rose: #fb7185;
  --amber: #f59e0b;
  --blue: #38bdf8;
  --purple: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(244, 63, 94, 0.12), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
  color: var(--text);
}

body.lock-scroll {
  overflow: hidden;
}

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(2, 6, 23, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--emerald), #22d3ee);
  color: #001b16;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.38);
}

.logo-text {
  font-size: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  margin-left: auto;
}

.nav-links a {
  padding: 9px 2px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #fff;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 32vw);
}

.nav-search input,
.hero-search input,
.page-filter input,
.search-page-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: var(--text);
  outline: none;
  padding: 11px 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input:focus,
.hero-search input:focus,
.page-filter input:focus,
.search-page-form input:focus {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.nav-search button,
.hero-search button,
.search-page-form button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  color: #052e2b;
  background: var(--emerald);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(15, 23, 42, 0.86);
  border-radius: 12px;
  padding: 9px 12px;
}

.hero-carousel {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1.2s ease;
  pointer-events: none;
}

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

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.76) 46%, rgba(2, 6, 23, 0.26) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.08) 42%, rgba(2, 6, 23, 0.45) 100%);
}

.hero-content {
  position: absolute;
  top: 50%;
  left: max(24px, calc((100vw - 1180px) / 2));
  width: min(640px, calc(100% - 48px));
  transform: translateY(-50%);
}

.hero-label,
.section-heading span,
.detail-kicker,
.category-kicker,
.page-hero span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.hero-content p {
  max-width: 610px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.7;
}

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

.hero-tags span,
.detail-tags span,
.tag-row span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.12);
  padding: 6px 10px;
  font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.prev-next a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  background: var(--emerald);
  color: #052e2b;
  box-shadow: 0 18px 42px rgba(16, 185, 129, 0.28);
}

.primary-btn:hover,
.nav-search button:hover,
.hero-search button:hover,
.search-page-form button:hover {
  background: #34d399;
  transform: translateY(-1px);
}

.ghost-btn,
.prev-next a {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

.ghost-btn:hover,
.prev-next a:hover {
  border-color: rgba(16, 185, 129, 0.54);
  background: rgba(16, 185, 129, 0.12);
}

.hero-panel {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 6;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

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

.hero-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-quick-links a {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.72);
}

.hero-dots {
  position: absolute;
  z-index: 7;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 132px;
  display: flex;
  gap: 9px;
}

.hero-dot {
  width: 38px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

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

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

.narrow-wrap {
  width: min(920px, calc(100% - 32px));
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading h2,
.page-hero h1,
.detail-info h1,
.detail-content h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-heading p,
.page-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.row-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.row-heading > a {
  color: #a7f3d0;
  font-weight: 700;
}

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

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

.category-tile {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: auto -40px -70px auto;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.category-tile:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.category-tile strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 24px;
}

.category-tile p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.category-tile em {
  display: inline-flex;
  margin-top: 18px;
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.tone-rose { background: linear-gradient(135deg, #f43f5e, #db2777); }
.tone-purple { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.tone-blue { background: linear-gradient(135deg, #2563eb, #0891b2); }
.tone-amber { background: linear-gradient(135deg, #d97706, #ea580c); }
.tone-emerald { background: linear-gradient(135deg, #059669, #0f766e); }
.tone-cyan { background: linear-gradient(135deg, #0284c7, #0e7490); }

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

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

.movie-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.74);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(15, 23, 42, 0.96);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #111827;
}

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

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

.poster-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.76), transparent 44%);
  opacity: 0.7;
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #052e2b;
  background: var(--emerald);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.3);
}

.card-body {
  padding: 16px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--subtle);
  font-size: 13px;
}

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

.card-body h3 a:hover {
  color: #a7f3d0;
}

.card-body p {
  min-height: 48px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.tag-row span {
  padding: 4px 8px;
  font-size: 12px;
}

.band-section {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.92));
  border-block: 1px solid var(--line);
}

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

.wide-list {
  display: grid;
  gap: 16px;
}

.wide-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.7);
  padding: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.wide-card:hover {
  transform: translateX(4px);
  border-color: rgba(16, 185, 129, 0.4);
}

.wide-card img {
  width: 112px;
  height: 150px;
  object-fit: cover;
  border-radius: 14px;
}

.wide-info b,
.wide-info em,
.wide-info small {
  display: block;
}

.wide-info b {
  font-size: 20px;
  margin-bottom: 8px;
}

.wide-info em,
.rank-row em {
  color: var(--subtle);
  font-style: normal;
}

.wide-info small {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.ranking-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(2, 6, 23, 0.36);
  padding: 24px;
  align-self: start;
  position: sticky;
  top: 96px;
}

.compact-heading h2 {
  font-size: 30px;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.55);
}

.rank-row:hover {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(16, 185, 129, 0.08);
}

.rank-row span {
  color: var(--emerald);
  font-weight: 900;
}

.rank-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row em {
  grid-column: 2;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extended-ranking {
  margin-top: 30px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-main {
  min-height: 70vh;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.25), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.94));
}

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

.small-hero > div,
.category-hero > div {
  padding: 70px 0;
}

.page-filter,
.search-page-form {
  display: flex;
  gap: 12px;
  width: min(620px, 100%);
  margin-top: 24px;
}

.breadcrumb {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--subtle);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #a7f3d0;
}

.detail-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 34px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 26px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.72));
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

.detail-info h1 {
  font-size: clamp(36px, 6vw, 64px);
}

.detail-one-line {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  max-width: 760px;
}

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

.player-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.54));
  cursor: pointer;
}

.play-overlay span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #052e2b;
  background: var(--emerald);
  font-size: 32px;
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.42);
}

.play-overlay.hidden {
  display: none;
}

.detail-content {
  color: var(--muted);
  line-height: 1.9;
}

.detail-content h2 {
  color: var(--text);
  margin-top: 34px;
  font-size: 30px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.detail-meta-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.7);
  padding: 16px;
}

.detail-meta-grid span,
.detail-meta-grid strong {
  display: block;
}

.detail-meta-grid span {
  color: var(--subtle);
  font-size: 13px;
}

.detail-meta-grid strong {
  margin-top: 6px;
  color: var(--text);
}

.search-results:empty::before {
  content: "输入关键词查看相关影片";
  grid-column: 1 / -1;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.88);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 24px;
  align-items: center;
  color: var(--muted);
}

.footer-logo {
  color: var(--text);
  font-weight: 900;
  font-size: 20px;
}

.footer-inner p {
  margin: 0;
  line-height: 1.7;
}

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

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

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

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

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

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

  .detail-poster {
    max-width: 360px;
  }

  .ranking-panel {
    position: static;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .nav-shell {
    min-height: 66px;
    gap: 12px;
  }

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

  .nav-links,
  .nav-search {
    display: none;
  }

  .nav-links.open {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: var(--shadow);
  }

  .hero-carousel {
    min-height: 720px;
  }

  .hero-content {
    top: 43%;
  }

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

  .hero-search,
  .page-filter,
  .search-page-form {
    flex-direction: column;
  }

  .hero-dots {
    left: 24px;
    right: auto;
    bottom: 190px;
  }

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

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

  .card-body {
    padding: 13px;
  }

  .card-body p {
    min-height: 0;
  }

  .wide-card {
    grid-template-columns: 84px 1fr;
  }

  .wide-card img {
    width: 84px;
    height: 118px;
  }

  .extended-ranking {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .logo-text {
    font-size: 17px;
  }

  .hero-content h1 {
    font-size: 40px;
  }

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

  .hero-actions,
  .detail-actions {
    flex-direction: column;
  }

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

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

  .detail-hero {
    padding: 18px;
    border-radius: 24px;
  }

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

  .play-overlay span {
    width: 68px;
    height: 68px;
    font-size: 26px;
  }
}
