/* 图片灯箱 · 结构与 v2.css 的配色变量对齐，自动跟随明暗与 8 套配色 */

.qlb {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: color-mix(in srgb, var(--v2-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .2s ease;
}
.qlb[hidden] { display: none; }
.qlb.is-open { opacity: 1; }

.qlb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  cursor: default;
}

.qlb-img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: var(--v2-radius, 12px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  cursor: zoom-in;
  transition: transform .24s cubic-bezier(.22, .61, .36, 1);
  transform-origin: center center;
}
.qlb-img.is-zoomed {
  cursor: zoom-out;
  transform: scale(1.7);
}

.qlb-cap {
  max-width: min(92vw, 720px);
  color: var(--v2-muted, #888);
  font-size: .85rem;
  line-height: 1.6;
  letter-spacing: .04em;
  text-align: center;
}

.qlb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--v2-surface, #fff) 88%, transparent);
  color: var(--v2-muted, #888);
  font-size: .78rem;
  letter-spacing: .08em;
}
.qlb-counter:empty { display: none; }

.qlb-close,
.qlb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--v2-border, rgba(0, 0, 0, .12));
  border-radius: 50%;
  background: color-mix(in srgb, var(--v2-surface, #fff) 92%, transparent);
  color: var(--v2-text, #333);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.qlb-close { top: 20px; right: 20px; }
.qlb-nav { top: 50%; transform: translateY(-50%); }
.qlb-prev { left: 16px; }
.qlb-next { right: 16px; }
.qlb-close:hover, .qlb-nav:hover,
.qlb-close:focus-visible, .qlb-nav:focus-visible {
  border-color: var(--v2-accent);
  color: var(--v2-accent);
  outline: none;
}
.qlb-nav[hidden] { display: none; }

@media (max-width: 768px) {
  .qlb { padding: 2vh 2vw; }
  .qlb-img { max-width: 96vw; max-height: 76vh; }
  .qlb-img.is-zoomed { transform: scale(1.4); }
  .qlb-nav { width: 36px; height: 36px; }
  .qlb-prev { left: 8px; }
  .qlb-next { right: 8px; }
  .qlb-close { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .qlb, .qlb-img { transition: none; }
}
