/* ===== 图片弹窗 Image Popup =====
 * 类名统一加 ip- 前缀，避免与你页面的样式冲突。
 * 引入：<link rel="stylesheet" href="image-popup.css">
 */

/* 遮罩层（半透明 + 模糊，隐约可见底层页面） */
.ip-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 32, 58, 0.32);     /* ← 背景透明度，调大更暗 / 调小更通透 */
  backdrop-filter: blur(7px) saturate(115%);  /* ← 模糊度，调小底层更清晰 */
  -webkit-backdrop-filter: blur(7px) saturate(115%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
  z-index: 9999;
}

.ip-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* 首次加载入场：整体放慢，浮现感更强（auto + intro 时生效） */
.ip-overlay.is-intro {
  transition: opacity 1.2s ease, visibility 1.2s ease;
}

/* 弹窗主体（纯图片） */
.ip-modal {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 88vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(1.05) translateY(44px); /* 从略大、偏下、半透开始 */
  transition: opacity 0.9s ease, transform 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.ip-overlay.is-open .ip-modal {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.ip-overlay.is-intro .ip-modal {
  transition: opacity 1.4s ease, transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ip-modal img {
  display: block;
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
  background: #000;
}

/* 浮动关闭按钮 */
.ip-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

.ip-close:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: rotate(90deg) scale(1.05);
}

/* 底部提示文字（延迟淡入） */
.ip-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  letter-spacing: 1px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.ip-overlay.is-open .ip-hint {
  opacity: 1;
  transition-delay: 0.5s;
}
