/* ── 图片灯箱 ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 1.5rem;
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 90vw;
  max-height: 78vh;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.lightbox-media-video {
  width: min(90vw, 960px);
  max-height: 78vh;
  display: block;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  background: #000;
}

.lightbox-img[hidden],
.lightbox-media-video[hidden] {
  display: none;
}

/* 关闭按钮 */
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.lightbox-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  font-family: var(--font-sans);
}

/* 下方操作栏 */
.lightbox-bar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox-download-btn {
  display: inline-block;
  padding: 0.45rem 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.lightbox-download-btn:hover {
  background: rgba(196, 149, 90, 0.4);
  border-color: rgba(196, 149, 90, 0.7);
  color: #fff;
}

/* ── 卡片内下载按钮 ── */
.card-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.download-btn {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  color: var(--color-ink-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-sepia);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition);
  white-space: nowrap;
}

.download-btn:hover {
  color: var(--color-sichuan-red);
  border-color: var(--color-gold);
  background: var(--color-bg-dark);
}

@media (max-width: 640px) {
  .lightbox-overlay {
    padding: 1rem;
  }

  .lightbox-stage,
  .lightbox-img,
  .lightbox-media-video {
    max-width: 100%;
  }

  .lightbox-media-video {
    width: 100%;
  }
}
