/* QZ 小幽前端显示组件 v1
   定位：玩家端沉浸式小幽伙伴显示层。
   注意：这不是后台控件，也不会主动让小幽出现。只有 Enhanced Worker 返回 pending 命令时才显示。 */

.qz-xiaoyou-root{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:999998;
  pointer-events:none;
  display:none;
  align-items:flex-end;
  gap:10px;
  max-width:min(420px,calc(100vw - 24px));
  font-family:"Microsoft YaHei",system-ui,-apple-system,sans-serif;
}
.qz-xiaoyou-root.qz-xiaoyou-visible{display:flex;}
.qz-xiaoyou-ghost{
  width:74px;
  height:88px;
  flex:0 0 auto;
  position:relative;
  pointer-events:none;
  filter:drop-shadow(0 12px 24px rgba(72,55,155,.35));
  animation:qzXyFloat 2.4s ease-in-out infinite;
}
.qz-xiaoyou-body{
  position:absolute;
  left:8px;
  top:6px;
  width:58px;
  height:68px;
  border-radius:50% 50% 44% 44%;
  background:
    radial-gradient(circle at 50% 38%,rgba(255,255,255,.9) 0 4px,transparent 5px),
    radial-gradient(circle at 38% 32%,#ffffff 0 3px,transparent 4px),
    radial-gradient(circle at 61% 32%,#ffffff 0 3px,transparent 4px),
    linear-gradient(145deg,#8e8cff,#5b59d6 50%,#342d7d);
  box-shadow:0 0 18px rgba(132,122,255,.7), inset 0 0 14px rgba(255,255,255,.35);
}
.qz-xiaoyou-body:before{
  content:"";
  position:absolute;
  left:20px;
  top:26px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:radial-gradient(circle,#fff 0 2px,#a8f1ff 3px,#776dff 8px,transparent 10px);
  box-shadow:0 0 16px #b4f8ff;
}
.qz-xiaoyou-tail{
  position:absolute;
  right:6px;
  bottom:4px;
  width:38px;
  height:20px;
  border-radius:50%;
  background:linear-gradient(90deg,rgba(141,137,255,.8),rgba(180,246,255,0));
  transform:rotate(24deg);
  filter:blur(.2px);
}
.qz-xiaoyou-star{
  position:absolute;
  right:7px;
  top:1px;
  font-size:18px;
  animation:qzXyTwinkle 1.9s ease-in-out infinite;
}
.qz-xiaoyou-bubble{
  pointer-events:auto;
  min-width:210px;
  max-width:300px;
  padding:13px 14px;
  border-radius:18px 18px 5px 18px;
  color:#f8f7ff;
  background:linear-gradient(145deg,rgba(31,28,62,.96),rgba(76,58,146,.94));
  border:1px solid rgba(210,203,255,.42);
  box-shadow:0 14px 34px rgba(0,0,0,.32);
  line-height:1.6;
  transform-origin:right bottom;
  animation:qzXyBubble .24s ease both;
}
.qz-xiaoyou-name{
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
  color:#c9f7ff;
  margin-bottom:4px;
}
.qz-xiaoyou-text{
  font-size:15px;
  white-space:pre-wrap;
  word-break:break-word;
}
.qz-xiaoyou-action{
  margin-top:8px;
  font-size:12px;
  color:#d9d3ff;
  opacity:.9;
}
.qz-xiaoyou-reward .qz-xiaoyou-bubble{background:linear-gradient(145deg,#38265a,#7c54d8);}
.qz-xiaoyou-leave{animation:qzXyLeave .42s ease both;}
@keyframes qzXyFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
@keyframes qzXyTwinkle{0%,100%{transform:scale(.86);opacity:.65}50%{transform:scale(1.22);opacity:1}}
@keyframes qzXyBubble{from{opacity:0;transform:scale(.86) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}
@keyframes qzXyLeave{to{opacity:0;transform:translateY(18px) scale(.92)}}
@media(max-width:520px){
  .qz-xiaoyou-root{right:10px;bottom:12px;max-width:calc(100vw - 18px);}
  .qz-xiaoyou-ghost{width:62px;height:76px;}
  .qz-xiaoyou-body{width:50px;height:60px;}
  .qz-xiaoyou-bubble{min-width:180px;max-width:calc(100vw - 94px);font-size:14px;}
}
