/* =============================================================
 * 轻量全息卡片（可复用模块）
 * 用法：给卡片加 class="holo"，holo.js 会自动绑定「3D 倾斜 + 跟随指针微光」
 * 触摸设备 / 系统开启「减少动态效果」时自动降级，不做任何处理
 * ============================================================= */

.holo {
  position: relative;
  --hx: 50%;
  --hy: 50%;
}

/* 让倾斜动画不被 .post-card 原本的 transform 过渡拖慢 */
.post-card.holo {
  transition: box-shadow .18s ease;
}

.holo.is-active {
  will-change: transform;
}

/* 跟随指针的微光（盖在卡片上，不拦截点击） */
.holo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
  background: radial-gradient(
    260px circle at var(--hx) var(--hy),
    rgba(255, 255, 255, .32) 0%,
    rgba(125, 211, 252, .16) 30%,
    rgba(196, 181, 253, .08) 48%,
    transparent 62%
  );
}

.holo.is-active::after {
  opacity: 1;
}

/* 内部图片轻微放大，增强立体感 */
.holo .post-thumb img {
  transition: transform .35s ease;
}

.holo.is-active .post-thumb img {
  transform: scale(1.05);
}

/* 降级：触摸设备 / 减少动态效果 */
@media (hover: none), (prefers-reduced-motion: reduce) {
  .holo {
    transform: none !important;
  }
  .holo::after {
    display: none;
  }
}

/* ===== 点击波纹 ===== */
.holo__ripple {
  position: absolute;
  z-index: 4;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, .55) 0%,
    rgba(255, 255, 255, .18) 45%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: scale(0);
  opacity: .7;
  animation: holo-ripple .55s cubic-bezier(.22, .61, .36, 1) forwards;
}

@keyframes holo-ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .holo__ripple {
    display: none;
  }
}
