/* WIBCK 官网吉祥物「小狼小威」组件样式 —— 橄榄绿体系，与官网一致。
 * 组件独立：只依赖自身类名（wm- 前缀）。生产接入时给 <html> 加 has-mascot 类，
 * 才会启用对原「智能客服」文字按钮与「回到顶部」位置的接管规则，删掉组件即全部恢复。 */

.wm-root {
  position: fixed;
  right: 14px;
  bottom: 78px; /* 提交需求胶囊在 bottom:18、高 50，吉祥物坐在它上方 */
  z-index: 9988;
  width: 148px;
  height: 148px;
  pointer-events: none;
  transition: width .45s cubic-bezier(.34,1.3,.5,1), height .45s cubic-bezier(.34,1.3,.5,1), bottom .45s cubic-bezier(.34,1.3,.5,1), right .45s cubic-bezier(.34,1.3,.5,1);
}
.wm-stage {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* 新版狼已面朝左，不再镜像翻转（2026-11-25 新版 7 帧）。 */
.wm-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .28s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.wm-img.wm-on { opacity: 1; }
/* 眨眼硬切：眨眼期间关掉淡入淡出直接换帧。两层交叉淡化时两张图半透明叠加，整只狼的轮廓和毛发都会闪（实测淡化中途 21.5 万像素在变，是正常眨眼变化的 12.7 倍）；硬切只变眼睛（两帧除眼外逐像素一致，实测只 1.7 万像素、全在眼带）。2026-11-26 闪烁修复 v2，替代 100ms wm-snap。 */
.wm-img.wm-cut { transition: none; }

/* 呼吸：整体轻微起伏，原点在底部，不做僵硬的整图缩放跳动 */
.wm-breathe { animation: wm-breathe 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes wm-breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.012, 1.022); }
}
/* 偶尔歪头 */
.wm-tilt { animation: wm-tilt 1.6s ease-in-out; transform-origin: 50% 92%; }
@keyframes wm-tilt {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-3.2deg); }
  65% { transform: rotate(-2.4deg); }
}
/* 兴奋小跳 */
.wm-bounce { animation: wm-bounce .62s cubic-bezier(.34,1.56,.64,1); }
@keyframes wm-bounce {
  0% { transform: translateY(0); }
  35% { transform: translateY(-11%); }
  70% { transform: translateY(1.5%); }
  100% { transform: translateY(0); }
}
/* 精神一抖：被点醒的激灵——压一下、弹起来、左右一晃 */
.wm-startle { animation: wm-startle .5s ease-out; transform-origin: 50% 100%; }
@keyframes wm-startle {
  0% { transform: scale(1, 1) translateX(0); }
  18% { transform: scale(1.07, 0.92) translateX(0); }
  42% { transform: scale(0.96, 1.06) translateX(0); }
  58% { transform: scale(1, 1) translateX(-1.6%); }
  74% { transform: scale(1, 1) translateX(1.6%); }
  100% { transform: scale(1, 1) translateX(0); }
}
/* 对话时点头 */
.wm-nod { animation: wm-nod 1.5s ease-in-out; transform-origin: 50% 88%; }
@keyframes wm-nod {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(1.6deg) translateY(1.6%); }
  55% { transform: rotate(0deg) translateY(0); }
  80% { transform: rotate(1.6deg) translateY(1.6%); }
}
/* 犯困时慢慢点头打盹 */
.wm-doze { animation: wm-doze 4.2s ease-in-out infinite; transform-origin: 50% 92%; }
@keyframes wm-doze {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  45% { transform: rotate(-1.4deg) translateY(1.2%); }
  60% { transform: rotate(-1.1deg) translateY(1%); }
}
/* 想法气泡（胡思乱想专用）：云朵形 + 两个小圆点尾巴，与说话气泡区分 */
.wm-bubble.wm-thought {
  border-style: dashed;
  border-radius: 46% 54% 52% 48% / 58% 62% 38% 42%;
  padding: 12px 16px;
  text-align: center;
}
.wm-bubble.wm-thought::before,
.wm-bubble.wm-thought::after {
  content: '';
  position: absolute;
  background: #fff;
  border: 1.5px dashed #668C0E;
  border-radius: 50%;
}
.wm-bubble.wm-thought::before { width: 11px; height: 11px; right: 16px; bottom: -13px; }
.wm-bubble.wm-thought::after { width: 6.5px; height: 6.5px; right: 9px; bottom: -21px; }
/* 地面软阴影 */
.wm-shadow {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 1.5%;
  height: 7%;
  border-radius: 50%;
  background: rgba(43, 54, 10, 0.20);
  filter: blur(3px);
  z-index: -1;
}

/* 睡觉符号：犯困期间常驻在脑袋上方，缓缓漂浮 */
.wm-zzz {
  position: absolute;
  top: -2%;
  right: 2%;
  font-weight: 700;
  font-style: italic;
  color: #7d8f5f;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
  font-size: 23px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.wm-zzz i { font-style: italic; display: inline-block; opacity: 0; }
.wm-zzz i:nth-of-type(1) { font-size: 23px; }
.wm-zzz i:nth-of-type(2) { font-size: 16px; margin-left: 1px; }
.wm-zzz i:nth-of-type(3) { font-size: 11.5px; margin-left: 1px; }
/* 睡觉符号：三个 Z 轮流升起来再淡掉，像呼呼大睡一样（2026-11-25） */
.wm-zzz.wm-show { opacity: 1; transform: translateY(0); }
.wm-zzz.wm-show i { animation: wm-zzz-rise 2.4s ease-in-out infinite; }
.wm-zzz.wm-show i:nth-of-type(2) { animation-delay: .45s; }
.wm-zzz.wm-show i:nth-of-type(3) { animation-delay: .9s; }
@keyframes wm-zzz-rise {
  0% { opacity: 0; transform: translateY(6px) rotate(-4deg) scale(.8); }
  25% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  60% { opacity: 1; transform: translateY(-5px) rotate(3deg) scale(1.05); }
  100% { opacity: 0; transform: translateY(-10px) rotate(6deg) scale(1.1); }
}
/* 对话气泡：官网配色（白底、橄榄边、深绿字），带小尾巴 */
.wm-bubble {
  position: absolute;
  bottom: calc(100% - 6px);
  right: 58%;
  min-width: 120px;
  max-width: 210px;
  padding: 9px 12px;
  background: #fff;
  border: 1.5px solid #668C0E;
  border-radius: 13px;
  border-bottom-right-radius: 4px;
  color: #39500c;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(40, 54, 8, 0.16);
  opacity: 0;
  transform: translateY(5px) scale(.96);
  transform-origin: 100% 100%;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  white-space: normal;
}
.wm-bubble.wm-show { opacity: 1; transform: translateY(0) scale(1); }
/* 思考省略号 */
.wm-dots i {
  display: inline-block;
  width: 5px; height: 5px;
  margin: 0 1.5px;
  border-radius: 50%;
  background: #668C0E;
  animation: wm-dot 1.2s ease-in-out infinite;
}
.wm-dots i:nth-child(2) { animation-delay: .18s; }
.wm-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes wm-dot {
  0%, 100% { transform: translateY(0); opacity: .45; }
  50% { transform: translateY(-3.5px); opacity: 1; }
}

/* 对话窗打开时：吉祥物缩小，坐到窗口上沿 */
.wm-root.wm-docked { width: 92px; height: 92px; }

/* 生产接管：隐藏原文字按钮（吉祥物就是入口）；回到顶部抬到吉祥物上方 */
html.has-mascot .wa-fab { display: none !important; }
html.has-mascot .to-top { bottom: 244px; }

@media (max-width: 560px) {
  .wm-root { width: 98px; height: 98px; right: 10px; bottom: 76px; }
  .wm-root.wm-docked { width: 74px; height: 74px; }
  .wm-bubble { font-size: 12.5px; min-width: 104px; max-width: 168px; }
  html.has-mascot .to-top { bottom: 190px; }
}

/* 减少动态效果：关掉一切动画，只保留姿态切换 */
@media (prefers-reduced-motion: reduce) {
  .wm-breathe, .wm-tilt, .wm-bounce, .wm-nod, .wm-doze, .wm-startle, .wm-dots i, .wm-zzz.wm-show, .wm-zzz.wm-show i { animation: none !important; }
  .wm-zzz.wm-show i { opacity: 1 !important; }
  .wm-img, .wm-bubble, .wm-root { transition: none !important; }
}
