/* =========================================================
   图片查看弹层（前台通用）
   由 includes/lightbox.php 引入；与主题解耦，换主题同样可用
   ========================================================= */
[data-lightbox] { cursor: zoom-in; }

.lb-layer {
  position: fixed; inset: 0; z-index: 300; padding: 28px;
  display: flex; align-items: center; justify-content: center;
}
.lb-layer[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-mask {
  position: absolute; inset: 0;
  background: rgba(8, 10, 14, .88);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: lbFade .2s ease both;
}
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  position: relative; z-index: 1;
  width: min(1120px, 100%); height: min(82vh, 820px);
  display: flex; align-items: center; justify-content: center;
  animation: lbIn .24s ease both;
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}

.lb-figure {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.lb-img {
  display: block; max-width: 100%; max-height: calc(82vh - 76px);
  width: auto; height: auto; object-fit: contain;
  border-radius: 4px; background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.lb-cap { color: #fff; font-size: 14px; letter-spacing: .5px; text-align: center; opacity: .9; }
.lb-cap[hidden] { display: none; }

/* 图片左右切换过渡：下一张右入、上一张左入、首次打开缩放淡入 */
@keyframes lbSlideNext {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lbSlidePrev {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lbZoomIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}
.lb-img.lb-in-next { animation: lbSlideNext .3s cubic-bezier(.22, .61, .36, 1) both; }
.lb-img.lb-in-prev { animation: lbSlidePrev .3s cubic-bezier(.22, .61, .36, 1) both; }
.lb-img.lb-in-open { animation: lbZoomIn .28s ease both; }

/* 关闭：黑底白叉，与留言弹层同一视觉 */
.lb-close {
  position: absolute; top: 0; right: 0; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  background: #000; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .22s;
}
.lb-close:hover { background: #333; transform: rotate(90deg); }
.lb-close svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}

.lb-nav {
  position: absolute; top: 50%; z-index: 2;
  width: 50px; height: 50px; margin-top: -25px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-nav:hover { background: #000; }
.lb-nav[hidden] { display: none; }
.lb-nav svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-count {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 5px 14px; border-radius: 20px;
  background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 13px; letter-spacing: 1px;
}
.lb-count[hidden] { display: none; }

@media (max-width: 768px) {
  .lb-layer { padding: 12px; }
  .lb-stage { height: min(72vh, 620px); }
  .lb-img { max-height: calc(72vh - 76px); }
  .lb-close { top: -6px; right: -6px; width: 34px; height: 34px; }
  .lb-nav { width: 40px; height: 40px; margin-top: -20px; }
  .lb-prev { left: -4px; }
  .lb-next { right: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-mask, .lb-stage { animation: none; }
  .lb-img.lb-in-next, .lb-img.lb-in-prev, .lb-img.lb-in-open { animation: none; }
  .lb-close, .lb-nav { transition: none; }
}

/* MOBILE-FONT-PLUS-1PX-BEGIN */
/* 手机端字号统一 +1px：按各断点生效值逐项覆盖，em 相对字号随父级自动 +1 */
@media (min-width: 769px) and (max-width: 1024px) {
  .lb-cap { font-size: 15px; }
  .lb-count { font-size: 14px; }
}

@media (max-width: 768px) {
  .lb-cap { font-size: 15px; }
  .lb-count { font-size: 14px; }
}
/* MOBILE-FONT-PLUS-1PX-END */
