/* ==========================================================
   photos.css —— 照片卡片（沿飞行路径排布） + 详情放大层
   ========================================================== */

/* ===== 照片舞台 ===== */
#photo-stage {
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
  will-change: transform;
}

.photo-card {
  position: absolute;
  width: 22vmin; max-width: 130px; min-width: 80px;
  background: #fff;
  padding: 6px 6px 22px 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08);
  opacity: 0;
  /* left/top 由 js/photos.js 沿贝塞尔路径动态设置 */
  transform: translate(-50%, -50%) scale(0.6) rotate(var(--rot, -6deg));
  transition: opacity 0.8s ease,
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform, opacity;
}
.photo-card img {
  width: 100%; aspect-ratio: 4/5;
  object-fit: cover; display: block;
  background: #ddd;
}
.photo-card.revealed {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(var(--rot, -6deg));
  /* 呼吸+轻微晃动：等浮现完成后开始 */
  animation: photoBreath 4.5s ease-in-out infinite;
  animation-delay: 1.1s;
}

/* 呼吸晃动：缓慢缩放 + 微角度摇摆 */
@keyframes photoBreath {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(var(--rot)); }
  25%      { transform: translate(-50%, -50%) scale(1.035) rotate(calc(var(--rot) + 1.5deg)); }
  50%      { transform: translate(-50%, -50%) scale(1.05) rotate(var(--rot)); }
  75%      { transform: translate(-50%, -50%) scale(1.035) rotate(calc(var(--rot) - 1.5deg)); }
}

/* 每张照片呼吸节奏错开，更自然 */
.photo-card:nth-child(1) { animation-duration: 4.2s; --rot: -7deg; }
.photo-card:nth-child(2) { animation-duration: 4.8s; --rot:  5deg; }
.photo-card:nth-child(3) { animation-duration: 4.5s; --rot: -4deg; }
.photo-card:nth-child(4) { animation-duration: 5.0s; --rot:  6deg; }
.photo-card:nth-child(5) { animation-duration: 4.3s; --rot: -5deg; }
.photo-card:nth-child(6) { animation-duration: 4.7s; --rot:  4deg; }
.photo-card:hover {
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.45), 0 0 0 1px rgba(196, 181, 253, 0.3);
  z-index: 10;
}

/* ===== 详情放大层 ===== */
#detail-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 4, 10, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 24px;
}
#detail-overlay.active {
  opacity: 1; pointer-events: auto;
}

.detail-photo-frame {
  background: #fff;
  padding: 14px 14px 44px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(139, 92, 246, 0.25);
  transform: scale(0.7) rotate(-3deg);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 70vmin; width: 100%;
}
#detail-overlay.active .detail-photo-frame {
  transform: scale(1) rotate(0deg);
}
.detail-photo-frame img {
  width: 100%; aspect-ratio: 4/5;
  object-fit: cover; display: block;
}

.detail-text {
  margin-top: 32px;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(18px, 5vmin, 28px);
  font-weight: 600;
  text-align: center;
  line-height: 1.6;
  color: #f0e9ff;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
  text-shadow: 0 0 20px rgba(196, 181, 253, 0.5);
  max-width: 80vw;
}
#detail-overlay.active .detail-text {
  opacity: 1;
  transform: translateY(0);
}

.detail-date {
  margin-top: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  color: rgba(196, 181, 253, 0.6);
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.6s ease 0.5s;
}
#detail-overlay.active .detail-date { opacity: 1; }

.detail-close {
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.detail-close:hover { background: rgba(255,255,255,0.15); transform: scale(1.08); }
.detail-close:active { transform: scale(0.95); }

/* 移动端微调 */
@media (max-width: 480px) {
  .photo-card { width: 22vmin; padding: 5px 5px 18px 5px; }
}
