/* ==========================================================================
   图片放大查看（灯箱）
   用途：资质证书等图片链接点击后在本页放大查看，而不是跳转到图片文件
        （服务器对图片返回 attachment 或错误 MIME 时，直接打开会变成下载）
   约束：线上 CSP 为 style-src 'self'，禁止内联样式，
        因此显示/隐藏全部靠 class 切换，脚本中不写 style 属性。
   ========================================================================== */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  padding: 32px;
  background: rgba(13, 20, 33, 0.9);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  text-align: center;
}

.lightbox.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 40px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0;
  padding: 0 32px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.6;
}

.lightbox-cap:empty {
  display: none;
}

/* 打开时锁滚动，避免背景跟着滑动 */
body.lb-lock {
  overflow: hidden;
}

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

  .lightbox-img {
    max-width: 94vw;
    max-height: 76vh;
  }

  .lightbox-close {
    top: 10px;
    right: 12px;
  }

  .lightbox-cap {
    bottom: 10px;
    font-size: 13px;
  }
}
