/* ═══════════════════════════════════════════════════
   蓝墩墩 · 网页内互动桌宠（全站 8 页通用）
   3D 渲染帧精灵动画（静态 + 挥手/跑步 GIF）
   ═══════════════════════════════════════════════════ */

#dundun-mascot{
  position:fixed; left:26px; bottom:26px; z-index:9999;
  width:186px; height:216px; cursor:grab; touch-action:none;
  user-select:none; -webkit-user-select:none;
  filter:drop-shadow(0 12px 14px rgba(29,62,94,.28));
  transition:filter .2s;
}
#dundun-mascot:active{cursor:grabbing}
#dundun-mascot.hidden{display:none}

/* 静态帧 / GIF 动画层 */
#dundun-body{position:absolute; inset:0; cursor:grab}
#dundun-body:active{cursor:grabbing}
#dundun-still, #dundun-anim{position:absolute; inset:0}
#dundun-still img, #dundun-anim img{
  width:100%; height:100%; object-fit:contain; display:block; pointer-events:none;
}
#dundun-anim{display:none}
#dundun-anim.show{display:block}
/* 动画帧统一 400x465：完整 contain 显示，保留源视频里从地面跳到空中的位移 */
#dundun-mascot.dd-jump #dundun-anim img{
  width:100%; height:100%; position:absolute; inset:0; object-fit:contain;
}
/* 待机浮动 + 呼吸 */
#dundun-body{
  transform-origin:50% 94%;
  animation:ddFloat 3.6s ease-in-out infinite;
}
@keyframes ddFloat{
  0%,100%{transform:translateY(0) scale(1,1)}
  50%{transform:translateY(-8px) scale(1.01,.99)}
}
#dundun-body.lifted{animation:none; transform:translateY(-10px) rotate(-5deg) scale(1.04)}
#dundun-body.jump{animation:ddJump .7s cubic-bezier(.28,.84,.42,1)}
@keyframes ddJump{
  0%,100%{transform:translateY(0) scale(1)}
  22%{transform:translateY(-34px) scale(.97,1.04)}
  50%{transform:translateY(-2px) scale(1.05,.95)}
  68%{transform:translateY(-12px) scale(.99,1.01)}
}
#dundun-body.eat{animation:ddEat .42s ease-in-out 2}
@keyframes ddEat{
  0%,100%{transform:rotate(0) scale(1)}
  25%{transform:rotate(-5deg) scale(1.02,.98)}
  75%{transform:rotate(5deg) scale(1.02,.98)}
}
#dundun-body.sleep{animation:ddSleep 3s ease-in-out infinite}
@keyframes ddSleep{
  0%,100%{transform:translateY(8px) rotate(-4deg) scale(1)}
  50%{transform:translateY(13px) rotate(-6deg) scale(1.03,.96)}
}

/* 影子 */
#dundun-shadow{
  position:absolute; left:50%; bottom:2px; width:126px; height:22px;
  transform:translateX(-50%); border-radius:50%;
  background:radial-gradient(ellipse,rgba(29,62,94,.24),transparent 72%);
  animation:ddShadow 3.6s ease-in-out infinite; pointer-events:none;
  transition:opacity .2s, transform .2s;
}
@keyframes ddShadow{
  0%,100%{transform:translateX(-50%) scale(1); opacity:.9}
  50%{transform:translateX(-50%) scale(.82); opacity:.6}
}
#dundun-mascot.dragging #dundun-shadow{transform:translateX(-50%) scale(.7); opacity:.45}

/* 对话气泡已暂时移除（完整样式见 mascot.css.bubble-backup） */

/* 飘出小表情 */
.dd-emoji{
  position:absolute; left:50%; top:28%; font-size:26px; pointer-events:none;
  animation:ddEmoji 1.15s ease-out forwards; text-shadow:0 2px 6px rgba(0,0,0,.15); z-index:2;
}
@keyframes ddEmoji{
  0%{transform:translate(-50%,0) scale(.5); opacity:0}
  20%{transform:translate(-50%,-14px) scale(1.1); opacity:1}
  100%{transform:translate(-50%,-82px) scale(1.25) rotate(12deg); opacity:0}
}

/* 操作按钮 */
#dundun-tools{
  position:absolute; left:50%; bottom:-44px; transform:translateX(-50%);
  display:flex; gap:6px; opacity:0; transition:opacity .25s;
  background:rgba(255,255,255,.95); padding:6px 8px; border-radius:22px;
  box-shadow:0 5px 16px rgba(29,62,94,.18); border:1px solid #e2ecf5;
  white-space:nowrap; z-index:3;
}
#dundun-mascot:hover #dundun-tools,
#dundun-mascot.dd-active #dundun-tools{opacity:1}
#dundun-tools button{
  width:32px; height:32px; border:none; border-radius:50%; cursor:pointer;
  background:var(--indigo-soft,#eaf1f8); color:var(--navy,#1d3e5e);
  font-size:15px; line-height:32px; text-align:center; padding:0;
  transition:background .18s, transform .18s;
}
#dundun-tools button:hover{background:var(--indigo,#2f6392); color:#fff; transform:translateY(-2px)}
#dundun-tools button:active{transform:translateY(0) scale(.92)}

#dundun-handle{
  position:absolute; left:50%; bottom:-13px; transform:translateX(-50%);
  background:var(--navy,#1d3e5e); color:#fff; font-size:11px; font-weight:700;
  letter-spacing:1px; padding:4px 12px; border-radius:10px; white-space:nowrap;
  box-shadow:0 3px 8px rgba(29,62,94,.2); transition:opacity .2s, background .2s;
  cursor:move; z-index:4;
}
#dundun-handle .dd-grip{margin-left:6px; opacity:.7; font-size:13px}
#dundun-handle:hover{background:var(--indigo,#2f6392)}
#dundun-mascot:hover #dundun-handle,
#dundun-mascot.dd-active #dundun-handle{opacity:.35}
#dundun-handle:hover{opacity:1 !important}

/* 唤出按钮 */
#dundun-restore{
  position:fixed; left:26px; bottom:26px; z-index:9999;
  display:none; align-items:center; gap:7px; cursor:pointer;
  background:var(--navy,#1d3e5e); color:#fff; border:none; border-radius:24px;
  padding:9px 16px; font-family:var(--sans,'PingFang SC',sans-serif);
  font-size:13px; font-weight:700; letter-spacing:.5px;
  box-shadow:0 6px 18px rgba(29,62,94,.3); transition:transform .2s, background .2s;
}
#dundun-restore:hover{background:var(--indigo,#2f6392); transform:translateY(-3px)}
#dundun-restore.show{display:flex}

/* 提示条已暂时移除 */

@media (max-width:640px){
  #dundun-mascot{width:134px; height:156px; left:14px; bottom:14px}
  #dundun-tools{bottom:-42px; padding:5px 6px; gap:4px}
  #dundun-tools button{width:28px; height:28px; line-height:28px; font-size:13px}
  #dundun-restore{left:14px; bottom:14px}
}
