/* ============================================================
   lightbox.css — 截图灯箱浮层
   用原生 <dialog>：白送 Esc 关闭、焦点锁在窗内、背后内容 inert
   ============================================================ */

/* 浮层用 width 而不是 max-width：
   宽度档护栏只认两档，max-width 会被判成第 3 档；
   且 UA 给 <dialog> 的默认 max-width 会污染计算值 */
.lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1080px, 100% - 40px);
  max-width: none;
  max-height: min(88vh, 100% - 40px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--bg-deep);
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.lightbox[open] { display: flex; }

.lightbox::backdrop {
  background: rgba(8, 5, 12, 0.82);
  backdrop-filter: blur(4px);
}

.lightbox__img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  background: var(--surface);
}

.lightbox__caption {
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--text-body);
  border-top: 1px solid var(--line);
}

.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 10, 20, 0.78);
  color: var(--text);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.lightbox__close:hover {
  background: var(--brand);
  color: var(--text-invert);
}

@media (max-width: 560px) {
  .lightbox {
    width: calc(100% - 20px);
    max-height: 92vh;
  }
  .lightbox__img { max-height: 70vh; }
}
