/* ============================================
   MengyunBlog Lightbox — 正文图片灯箱
   设计语言：纯色遮罩 + 1px 边框控件 + 150ms 过渡
   ============================================ */

#articleContent img {
  cursor: zoom-in;
}

.mengyun-lb-lock {
  overflow: hidden !important;
}

.mengyun-lb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 18, 20, 0.93);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.15s;
}

.mengyun-lb.is-open {
  opacity: 1;
  visibility: visible;
}

.mengyun-lb-img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.98);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s;
  user-select: none;
  -webkit-user-drag: none;
}

.mengyun-lb.is-open .mengyun-lb-img {
  transform: scale(1);
}

.mengyun-lb-img.is-zoomed {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-out;
}

.mengyun-lb-img.is-loading {
  opacity: 0;
}

/* 顶栏：计数 + 标题 + 关闭 */
.mengyun-lb-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}

.mengyun-lb-bar .mengyun-lb-btn,
.mengyun-lb-nav {
  pointer-events: auto;
}

.mengyun-lb-counter {
  flex: none;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.mengyun-lb-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.mengyun-lb-btn {
  flex: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.mengyun-lb-btn:hover,
.mengyun-lb-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.mengyun-lb-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.mengyun-lb-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* 左右切换：桌面悬停显现，触屏常驻 */
.mengyun-lb-nav {
  position: fixed;
  top: 50%;
  margin-top: -22px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s;
}

.mengyun-lb:hover .mengyun-lb-nav,
.mengyun-lb-nav:focus-visible {
  opacity: 1;
}

/* 单图时箭头禁用，悬停也不提亮 */
.mengyun-lb:hover .mengyun-lb-nav:disabled,
.mengyun-lb-nav:disabled {
  opacity: 0.35;
}

.mengyun-lb-prev {
  left: 14px;
}

.mengyun-lb-next {
  right: 14px;
}

@media (hover: none) {
  .mengyun-lb-nav {
    opacity: 0.85;
    background: rgba(17, 18, 20, 0.5);
  }
}

/* 加载中 */
.mengyun-lb-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mengyunLbSpin 0.8s linear infinite;
  display: none;
}

.mengyun-lb.is-loading-state .mengyun-lb-spinner {
  display: block;
}

@keyframes mengyunLbSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  .mengyun-lb-caption {
    display: none;
  }

  .mengyun-lb-img {
    max-width: 96vw;
    max-height: 82vh;
  }

  .mengyun-lb-bar {
    padding: 10px 12px;
  }
}

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

  .mengyun-lb-spinner {
    animation: none;
  }
}
