/* 全屏照片查看 — 只在作品页引入，不改 site.css 任何现有规则 */

.lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: rgba(3, 7, 15, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #f4f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

.lb.is-open { display: flex; }

body.lb-locked { overflow: hidden; }

/* 顶部：返回按钮 + 计数 */
.lb-bar {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 12px calc(16px + env(safe-area-inset-left));
}

.lb-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font: 500 .9rem inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.lb-back:hover {
  background: rgba(56, 189, 248, .2);
  border-color: rgba(56, 189, 248, .55);
}

.lb-back:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

.lb-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.lb-count {
  font-size: .82rem;
  color: rgba(255, 255, 255, .66);
  font-variant-numeric: tabular-nums;
  letter-spacing: .07em;
}

/* 舞台：完整、居中、不变形 */
.lb-stage {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px calc(16px + env(safe-area-inset-right)) 4px calc(16px + env(safe-area-inset-left));
}

.lb-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
  opacity: 0;
  transition: opacity .25s ease;
}

.lb-stage img.is-loaded { opacity: 1; }

/* 左右切换 */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(8, 16, 30, .68);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.lb-nav:hover {
  background: rgba(56, 189, 248, .24);
  border-color: rgba(56, 189, 248, .55);
}

.lb-nav:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.lb-nav.prev { left: calc(12px + env(safe-area-inset-left)); }
.lb-nav.next { right: calc(12px + env(safe-area-inset-right)); }

.lb-nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 底部说明 */
.lb-cap {
  flex: 0 0 auto;
  text-align: center;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: .84rem;
  color: rgba(255, 255, 255, .74);
}

@media (max-width: 640px) {
  .lb-stage { padding-left: 8px; padding-right: 8px; }
  .lb-nav { width: 40px; height: 40px; }
  .lb-nav.prev { left: 4px; }
  .lb-nav.next { right: 4px; }
  .lb-cap { font-size: .8rem; }
}

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