/* v5 covers lightbox — 站内作品灯箱样式
   沿用站点冷黑 / 珍珠白 / 冰青体系，不引入新的视觉主题。 */

.lb {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
}
.lb[hidden] { display: none; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 11, .92);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}

.lb-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: min(1180px, 100%);
  max-height: 100%;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: rgba(10, 12, 20, .82);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .6);
  overflow: hidden;
}

.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex: 0 0 auto;
}

.lb-counter {
  font: 500 12px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .14em;
  color: var(--cyan, #75e6ef);
}

.lb-tools { display: flex; align-items: center; gap: 6px; }

.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: var(--on-dark, #f5f6f8);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.lb-btn:hover, .lb-btn:focus-visible {
  background: rgba(117, 230, 239, .14);
  border-color: rgba(117, 230, 239, .5);
  outline: none;
}
.lb-btn:focus-visible { box-shadow: 0 0 0 2px rgba(117, 230, 239, .35); }
.lb-close { font-size: 15px; }
.lb-close:hover, .lb-close:focus-visible {
  background: rgba(255, 138, 138, .16);
  border-color: rgba(255, 138, 138, .5);
}

.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(117, 230, 239, .07), transparent 60%),
    rgba(6, 8, 14, .6);
}

.lb-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.lb-image {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, .3);
  transform-origin: center center;
  transition: transform .18s ease;
  cursor: zoom-in;
}
.lb-image-wrap.is-zoomed .lb-image { cursor: zoom-out; }

.lb-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 24px;
  text-align: center;
  color: var(--on-dark-soft, #abb2c0);
}
/* display:flex 会覆盖 hidden 属性的默认 display:none，必须显式复位 */
.lb-error[hidden] { display: none; }
.lb-image[hidden] { display: none; }
.lb-error p { margin: 0; font-size: 14px; }
.lb-error-hint { font-size: 12px !important; opacity: .7; }

.lb-nav {
  flex: 0 0 auto;
  width: 42px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: var(--on-dark, #f5f6f8);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.lb-nav:hover, .lb-nav:focus-visible {
  background: rgba(117, 230, 239, .14);
  border-color: rgba(117, 230, 239, .5);
  outline: none;
}

.lb-caption {
  flex: 0 0 auto;
  padding: 4px 16px 0;
  text-align: center;
}
.lb-title {
  font-size: 14px;
  color: var(--on-dark, #f5f6f8);
  letter-spacing: .01em;
}

.lb-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 16px 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(171, 178, 192, .72);
}

html.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  .lb { padding: 0; }
  .lb-shell {
    border-radius: 0;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-left: none;
    border-right: none;
  }
  .lb-image { max-height: min(64vh, 100%); }
  .lb-nav {
    width: 38px;
    height: 52px;
    font-size: 20px;
  }
  .lb-btn { min-width: 42px; height: 40px; }
  .lb-hint { font-size: 10px; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-image, .lb-btn, .lb-nav { transition: none !important; }
}
