/* ============================================================
 * XW Mobile Motion 7 · 第七批 12 项社交/聊天动画
 * 门控：body.xw-motion7-on（与前六批完全解耦）
 * 原则：只动 opacity/transform/box-shadow，GPU 友好
 * 降级：prefers-reduced-motion / 移动端断点 / 无 IntersectionObserver
 * 零侵入：独立文件，不改任何业务样式
 * ============================================================ */
body.xw-motion7-on { --m7-pri:#4f7cff; --m7-pink:#ff5c8a; --m7-green:#2fbf71; }

/* ① 访客头像叠入：访客卡片错峰滑入 */
body.xw-motion7-on .xw-visitor-card.m7-visitor-in {
  animation: m7VisitorIn .55s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes m7VisitorIn {
  0% { opacity:0; transform:translateX(34px) scale(.92); }
  100% { opacity:1; transform:translateX(0) scale(1); }
}
body.xw-motion7-on .xw-visitor-avatar.m7-visitor-in {
  animation: m7AvatarPop .6s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes m7AvatarPop {
  0% { opacity:0; transform:scale(.4) rotate(-12deg); }
  100% { opacity:1; transform:scale(1) rotate(0); }
}

/* ② 卡片瀑布展开：社交中心/访客卡片错峰展开 */
body.xw-motion7-on .m7-water-in {
  transform-origin:top center;
  animation: m7WaterIn .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes m7WaterIn {
  0% { opacity:0; transform:scaleY(.7) translateY(-8px); }
  100% { opacity:1; transform:scaleY(1) translateY(0); }
}

/* ③ 角标弹跳：未读/访客角标数字弹跳 */
body.xw-motion7-on .m7-badge-bounce { animation: m7BadgeBounce 1.6s ease-in-out infinite; }
@keyframes m7BadgeBounce {
  0%,100% { transform:scale(1); }
  20% { transform:scale(1.28) translateY(-2px); }
  40% { transform:scale(.92); }
  60% { transform:scale(1.1); }
}

/* ④ 卡片悬浮抬升：hover 抬升 + 投影 */
body.xw-motion7-on .xw-hub-card.m7-hover-lift,
body.xw-motion7-on .xw-visitor-card.m7-hover-lift {
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease;
  will-change: transform;
}
body.xw-motion7-on .xw-hub-card.m7-hover-lift:hover,
body.xw-motion7-on .xw-visitor-card.m7-hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
}

/* ⑤ 输入中气泡：聊天"对方正在输入"三点跳 */
body.xw-motion7-on .m7-typing i {
  animation: m7Typing 1.1s ease-in-out infinite;
}
body.xw-motion7-on .m7-typing i:nth-child(2) { animation-delay:.18s; }
body.xw-motion7-on .m7-typing i:nth-child(3) { animation-delay:.36s; }
@keyframes m7Typing {
  0%,60%,100% { transform:translateY(0); opacity:.45; }
  30% { transform:translateY(-6px); opacity:1; }
}

/* ⑥ 消息抛物线：发送消息弧线飞入 */
body.xw-motion7-on .m7-arc-fly { animation: m7ArcFly .6s cubic-bezier(.3,.6,.4,1) both; }
@keyframes m7ArcFly {
  0% { opacity:0; transform:translate(0,0) scale(.8); }
  15% { opacity:1; }
  55% { transform:translate(var(--m7-ax,60px),-38px) scale(1.05); }
  100% { opacity:0; transform:translate(var(--m7-ax,120px),0) scale(.9); }
}

/* ⑦ 已读波纹：已读回执扩散确认 */
body.xw-motion7-on .m7-read-ripple { position:relative; }
body.xw-motion7-on .m7-read-ripple::after {
  content:''; position:absolute; inset:0; border-radius:inherit;
  border:2px solid var(--m7-green);
  animation: m7ReadRipple 1.4s ease-out 2;
  pointer-events:none;
}
@keyframes m7ReadRipple {
  0% { transform:scale(.7); opacity:.85; }
  100% { transform:scale(1.9); opacity:0; }
}

/* ⑧ 在线呼吸：在线状态点呼吸 */
body.xw-motion7-on .chat-tab-status.active.m7-online-breath,
body.xw-motion7-on .m7-online-breath { animation: m7OnlineBreath 2s ease-in-out infinite; }
@keyframes m7OnlineBreath {
  0%,100% { box-shadow:0 0 0 0 rgba(47,191,113,.5); }
  50% { box-shadow:0 0 0 7px rgba(47,191,113,0); }
}

/* ⑨ 关注成功打勾：关注按钮变绿打勾 */
body.xw-motion7-on .m7-follow-done {
  animation: m7FollowDone .7s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes m7FollowDone {
  0% { transform:scale(1); }
  45% { transform:scale(1.12); }
  100% { transform:scale(1); }
}

/* ⑩ 好友申请飘入：顶部轻提示滑入 */
body.xw-motion7-on .m7-req-in { animation: m7ReqIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes m7ReqIn {
  0% { opacity:0; transform:translateY(-22px); }
  100% { opacity:1; transform:translateY(0); }
}

/* ⑪ 资料卡展开：点击展开个人资料 */
body.xw-motion7-on .m7-profile-open {
  transform-origin:top center;
  animation: m7ProfileOpen .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes m7ProfileOpen {
  0% { opacity:.4; transform:scaleY(.6) translateY(-6px); }
  100% { opacity:1; transform:scaleY(1) translateY(0); }
}

/* ⑫ 送心动效：爱心飘升 */
body.xw-motion7-on .m7-heart-fly {
  position:absolute; z-index:20; pointer-events:none;
  color:var(--m7-pink); font-size:18px; line-height:1;
  animation: m7HeartFly 1.5s ease-out forwards;
}
@keyframes m7HeartFly {
  0% { opacity:0; transform:translateY(0) scale(.6); }
  15% { opacity:1; }
  100% { opacity:0; transform:translateY(-64px) scale(1.25) rotate(14deg); }
}

/* ---------- 降级：减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  body.xw-motion7-on * { animation:none !important; transition:none !important; }
}
