/* ===== 汇鑫 PPT 智能选模板助手 —— 样式 ===== */
#xhuiWrap{position:fixed;right:24px;bottom:24px;z-index:99990;
  font-family:'Microsoft YaHei','PingFang SC',Arial,sans-serif;
  -webkit-font-smoothing:antialiased;}

/* --- 悬浮小人（可拖拽） --- */
#xhuiBtn{width:66px;height:66px;border-radius:50%;
  background:linear-gradient(145deg,#6f9bff,#4a6fe3);
  box-shadow:0 6px 22px rgba(74,111,227,.45),0 2px 6px rgba(0,0,0,.15);
  display:flex;align-items:center;justify-content:center;position:relative;
  transition:box-shadow .2s;
  cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;}
#xhuiBtn:hover{box-shadow:0 9px 28px rgba(74,111,227,.55);}
#xhuiBtn:active{cursor:grabbing;}
#xhuiBtn svg{width:38px;height:38px;display:block;pointer-events:none;}
/* 拖拽中禁止 hover 变形，避免视觉抖动 */
#xhuiWrap.dragging #xhuiBtn{transition:none;}
#xhuiWrap.dragging #xhuiBtn::after{display:none;}
/* 呼吸圈 */
#xhuiBtn::after{content:'';position:absolute;inset:-4px;border-radius:50%;
  border:2px solid rgba(111,155,255,.55);animation:xhuiPulse 2.4s ease-out infinite;
  pointer-events:none;}
@keyframes xhuiPulse{0%{transform:scale(.9);opacity:.9;}
  70%{transform:scale(1.28);opacity:0;}100%{opacity:0;}}
/* 未读小红点 */
#xhuiDot{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;
  border-radius:10px;background:#ff4d4f;color:#fff;font-size:12px;line-height:20px;
  text-align:center;padding:0 5px;box-sizing:border-box;display:none;
  box-shadow:0 2px 6px rgba(255,77,79,.5);font-weight:700;}
/* 首次提示 */
#xhuiHint{position:absolute;right:78px;bottom:12px;white-space:nowrap;
  background:#fff;color:#333;font-size:13px;line-height:1.5;padding:10px 14px;
  border-radius:16px;box-shadow:0 4px 18px rgba(0,0,0,.16);opacity:0;
  transform:translateX(10px);transition:opacity .3s,transform .3s;pointer-events:none;
  text-align:left;}
#xhuiHint.on{opacity:1;transform:translateX(0);}
#xhuiHint::after{content:'';position:absolute;right:-6px;bottom:16px;
  width:0;height:0;border-left:7px solid #fff;
  border-top:6px solid transparent;border-bottom:6px solid transparent;}

/* --- 聊天面板（位置由 JS 动态计算） --- */
#xhuiPanel{position:fixed;width:396px;max-width:calc(100vw - 32px);
  height:568px;max-height:calc(100vh - 40px);background:#fff;border-radius:16px;
  box-shadow:0 14px 50px rgba(0,0,0,.24);z-index:99995;display:none;
  flex-direction:column;overflow:hidden;}
#xhuiPanel.on{display:flex;}

/* 头部（可拖动窗口） */
.xhuiHd{height:56px;flex:0 0 56px;background:linear-gradient(135deg,#5b83ee,#4a6fe3);
  color:#fff;display:flex;align-items:center;padding:0 96px 0 14px;position:relative;
  cursor:move;-webkit-user-select:none;user-select:none;touch-action:none;}
.xhuiHd .av{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.22);
  display:flex;align-items:center;justify-content:center;margin-right:10px;flex:0 0 34px;}
.xhuiHd .av svg{width:22px;height:22px;}
.xhuiHd .tt{font-size:15px;font-weight:700;line-height:1.25;}
.xhuiHd .st{font-size:11px;opacity:.85;line-height:1.3;}
/* 拖拽手柄 */
.xhuiGrip{position:absolute;right:48px;top:0;width:34px;height:56px;
  display:flex;align-items:center;justify-content:center;opacity:.7;
  cursor:move;color:#fff;}
.xhuiGrip:hover{opacity:1;background:rgba(0,0,0,.1);}
.xhuiHd .x{position:absolute;right:0;top:0;width:48px;height:56px;line-height:54px;
  text-align:center;font-size:22px;cursor:pointer;opacity:.9;}
.xhuiHd .x:hover{opacity:1;background:rgba(0,0,0,.1);}

/* 消息区 */
.xhuiBody{flex:1 1 auto;overflow-y:auto;padding:16px 14px;background:#f5f7fb;}
.xhuiBody::-webkit-scrollbar{width:6px;}
.xhuiBody::-webkit-scrollbar-thumb{background:#c8d0e0;border-radius:3px;}
.msg{display:flex;margin-bottom:14px;align-items:flex-start;}
.msg.me{flex-direction:row-reverse;}
.msg .bub{max-width:78%;padding:10px 13px;border-radius:12px;font-size:13.5px;
  line-height:1.62;color:#333;word-break:break-word;white-space:pre-wrap;}
.msg.ai .bub{background:#fff;border-top-left-radius:4px;
  box-shadow:0 1px 4px rgba(0,0,0,.07);}
.msg.me .bub{background:#5b83ee;color:#fff;border-top-right-radius:4px;}
.msg .ic{width:30px;height:30px;border-radius:50%;flex:0 0 30px;margin:0 8px;
  display:flex;align-items:center;justify-content:center;font-size:14px;}
.msg.ai .ic{background:linear-gradient(145deg,#6f9bff,#4a6fe3);}
.msg.me .ic{background:#dfe4ee;color:#666;}
.msg.ai .ic svg{width:18px;height:18px;}

/* 打字动画 */
.dots span{display:inline-block;width:6px;height:6px;margin:0 2px;border-radius:50%;
  background:#9aa7c0;animation:xhuiBounce 1.3s infinite;}
.dots span:nth-child(2){animation-delay:.18s;}
.dots span:nth-child(3){animation-delay:.36s;}
@keyframes xhuiBounce{0%,60%,100%{transform:translateY(0);opacity:.5;}
  30%{transform:translateY(-5px);opacity:1;}}

/* 模板卡片 */
.xhuiCards{margin:-4px 0 14px 46px;}
.xcard{display:flex;background:#fff;border-radius:10px;padding:8px;margin-bottom:8px;
  box-shadow:0 1px 5px rgba(0,0,0,.08);cursor:pointer;transition:all .18s;
  border:1px solid transparent;text-decoration:none;}
.xcard:hover{box-shadow:0 4px 14px rgba(74,111,227,.22);transform:translateY(-1px);
  border-color:#c3d2f7;}
.xcard img{width:76px;height:48px;object-fit:cover;border-radius:6px;flex:0 0 76px;
  background:#eef1f6;}
.xcard .info{flex:1 1 auto;padding-left:9px;min-width:0;display:flex;
  flex-direction:column;justify-content:center;}
.xcard .t{font-size:12.5px;color:#333;line-height:1.4;font-weight:600;
  overflow:hidden;text-overflow:ellipsis;display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;}
.xcard .m{font-size:11px;color:#95a0b5;margin-top:4px;display:flex;gap:7px;flex-wrap:wrap;}
.xcard .m i{font-style:normal;background:#f0f3fa;border-radius:3px;padding:1px 5px;}
.xcard .m i.c{background:#e8f0ff;color:#4a6fe3;}

/* 快捷问题 */
.xhuiQuick{padding:0 14px 8px;background:#f5f7fb;display:flex;gap:7px;flex-wrap:wrap;}
.xhuiQuick b{font-size:11.5px;color:#7a879e;font-weight:400;cursor:pointer;
  background:#fff;border:1px solid #e2e8f4;border-radius:14px;padding:5px 11px;
  transition:all .16s;white-space:nowrap;}
.xhuiQuick b:hover{background:#5b83ee;color:#fff;border-color:#5b83ee;}

/* 输入区 */
.xhuiFt{flex:0 0 auto;border-top:1px solid #edf0f6;padding:10px 12px;background:#fff;}
.xhuiFt .row{display:flex;align-items:flex-end;gap:8px;}
#xhuiInput{flex:1 1 auto;min-height:40px;max-height:96px;resize:none;border:1px solid #dfe5f0;
  border-radius:10px;padding:10px 12px;font-size:13.5px;line-height:1.5;outline:none;
  font-family:inherit;box-sizing:border-box;transition:border-color .18s;color:#333;}
#xhuiInput:focus{border-color:#5b83ee;box-shadow:0 0 0 3px rgba(91,131,238,.1);}
#xhuiSend{flex:0 0 40px;width:40px;height:40px;border:0;border-radius:10px;
  background:#5b83ee;color:#fff;cursor:pointer;display:flex;align-items:center;
  justify-content:center;transition:background .18s;}
#xhuiSend:hover{background:#4a6fe3;}
#xhuiSend:disabled{background:#c3cde0;cursor:not-allowed;}
#xhuiSend svg{width:19px;height:19px;}
.xhuiNote{font-size:10.5px;color:#a9b3c6;text-align:center;margin-top:7px;}

/* 小屏适配：面板占满，小人自动贴边 */
@media (max-width:520px){
  #xhuiPanel{left:8px !important;right:8px !important;top:8px !important;
    bottom:8px !important;width:auto;height:auto;max-height:none;max-width:none;}
  .xhuiHd{cursor:default;}
  .xhuiGrip{display:none;}
  #xhuiHint{display:none;}
}
