/* =========================================================
   拾光书阁 · 悬浮木鱼（muyu.css，.my-* 前缀 scoped，v1.15.4 真实素材版 · v1.16.0 惯性滑行）
   用户选定木鱼图 + 开源木槌（MIT）+ 呼吸光晕；点击弹动/挥槌/飘字。
   动画纯 transform/opacity GPU 合成；reduced-motion 下动画全关（静态光晕保留）。
   ========================================================= */

.my-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;        /* 旧版 iOS Safari 前缀 */
  -webkit-touch-callout: none;      /* iOS 长按呼叫框（选择/存储图像）一并禁用 */
  -webkit-tap-highlight-color: transparent;
  will-change: transform; /* 拖拽/惯性滑行走 GPU 合成，独立图层，60fps 零布局重排 */
}

/* 整体按钮（可点可拖；touch-action:none 阻止浏览器把拖拽认领为页面滚动） */
.my-knock-btn {
  position: relative;
  display: block;
  width: 148px;
  height: 148px;
  border: 0;
  padding: 0;
  background: none;
  cursor: grab;
  touch-action: none;
}
.my-knock-btn:active { cursor: grabbing; }

/* 木鱼图（用户选定素材，透明底） */
.my-muyu-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(255, 224, 130, .55))
    drop-shadow(0 10px 22px rgba(0, 0, 0, .5));
  transition: transform .15s ease;
  will-change: transform;
  pointer-events: none;
}
.my-knock-btn:hover .my-muyu-img { filter: drop-shadow(0 0 14px rgba(255, 224, 130, .7)) drop-shadow(0 10px 24px rgba(0, 0, 0, .55)); }
.my-knock-btn:active .my-muyu-img { transform: scale(.95); }
.my-wrap.my-knock .my-muyu-img { animation: myKnock .16s ease; }

/* 木槌（开源素材 gu.png，悬于右上，敲击挥下） */
.my-mallet-img {
  position: absolute;
  right: -4px;
  top: -10px;
  width: 72px;
  height: auto;
  transform-origin: 85% 90%;
  transform: rotate(28deg);
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45));
  transition: transform .15s ease;
}
.my-wrap.my-knock .my-mallet-img { animation: myStrike .16s cubic-bezier(.4, 0, .6, 1); }

/* 呼吸光晕 */
.my-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 210, 138, .42) 0%, rgba(236, 210, 138, .14) 48%, transparent 72%);
  animation: myHalo 3.4s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

/* 功德徽章 */
.my-badge {
  display: none;
  font-size: 12px;
  font-family: var(--font-mono, Consolas, monospace);
  color: #ffd9a8;
  background: rgba(10, 5, 2, .72);
  border: 1px solid rgba(245, 159, 0, .35);
  border-radius: 99px;
  padding: 2px 10px;
  text-shadow: 0 0 8px rgba(245, 159, 0, .45);
}
.my-badge.on { display: block; }

/* 未登录提示气泡 */
.my-hint {
  position: fixed;
  right: 176px;
  bottom: 44px;
  z-index: 81;
  font-size: 12px;
  color: #ffd9a8;
  background: rgba(10, 5, 2, .9);
  border: 1px solid rgba(245, 159, 0, .4);
  border-radius: 8px;
  padding: 6px 12px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  transform: translateX(6px);
}
.my-hint.on { opacity: 1; transform: translateX(0); }

/* 「+1」飘字 */
.my-float {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 700;
  color: #ffd9a8;
  text-shadow: 0 0 10px rgba(245, 159, 0, .7);
  pointer-events: none;
  animation: myFloat .8s ease-out both;
}

@keyframes myKnock {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.06, .93); }
  100% { transform: scale(1); }
}
@keyframes myHalo {
  0%, 100% { opacity: .72; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1; transform: translate(-50%, -50%) scale(1.07); }
}
@keyframes myStrike {
  0%   { transform: rotate(28deg); }
  45%  { transform: rotate(-32deg); }
  75%  { transform: rotate(-16deg); }
  100% { transform: rotate(28deg); }
}
@keyframes myFloat {
  0%   { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -34px); }
}

/* 动效偏好：动画全关，光晕静态保留，仍可点（敲击声仍播放） */
@media (prefers-reduced-motion: reduce) {
  .my-wrap.my-knock .my-muyu-img,
  .my-wrap.my-knock .my-mallet-img,
  .my-float { animation: none; }
  .my-halo { animation: none; opacity: .8; }
  .my-float { display: none; }
}
