/* ===================================================================
   优嘉亚麻 · 网站 AI 在线客服聊天窗
   右下角悬浮气泡 + 展开面板；配色复用站点 --accent 亚麻绿。
   =================================================================== */

/* 悬浮启动按钮（收起态） */
.chat-launcher{
  position:fixed; right:22px; bottom:24px; z-index:70;
  width:58px; height:58px; border-radius:50%;
  background:var(--accent); color:#fff; border:0; cursor:pointer;
  box-shadow:0 8px 24px rgba(86,96,69,.42);
  display:flex; align-items:center; justify-content:center; font-size:26px;
  transition:transform .25s, background .25s;
}
.chat-launcher:hover{ transform:scale(1.07); background:var(--accent-deep); }
.chat-launcher .badge{
  position:absolute; top:-2px; right:-2px; min-width:18px; height:18px; padding:0 5px;
  border-radius:9px; background:#c0392b; color:#fff; font-size:11px; line-height:18px;
  text-align:center; box-shadow:0 2px 6px rgba(0,0,0,.2);
}

/* 聊天面板 */
.chat-panel{
  position:fixed; right:22px; bottom:24px; z-index:71;
  width:360px; max-width:calc(100vw - 28px); height:520px; max-height:calc(100vh - 48px);
  background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 20px 60px rgba(49,49,49,.28);
  display:flex; flex-direction:column;
  transform:translateY(20px) scale(.98); opacity:0; pointer-events:none;
  transition:opacity .25s, transform .25s;
}
.chat-panel.open{ transform:none; opacity:1; pointer-events:auto; }

/* 头部 */
.chat-head{
  background:var(--accent-deep); color:#fff; padding:14px 16px;
  display:flex; align-items:center; gap:10px; flex-shrink:0;
}
.chat-head .ava{
  width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.18);
  display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0;
}
.chat-head .t1{ font-family:var(--serif); font-size:15px; font-weight:500; line-height:1.2; }
.chat-head .t2{ font-size:11px; opacity:.82; margin-top:2px; }
.chat-head .close{
  margin-left:auto; background:none; border:0; color:#fff; font-size:22px; cursor:pointer;
  line-height:1; opacity:.85; transition:opacity .2s;
}
.chat-head .close:hover{ opacity:1; }

/* 消息区 */
.chat-body{
  flex:1; overflow-y:auto; padding:16px 14px; background:var(--bg);
  display:flex; flex-direction:column; gap:12px;
}
.chat-msg{ display:flex; gap:8px; align-items:flex-end; max-width:100%; }
.chat-msg .bubble{
  max-width:78%; padding:10px 13px; border-radius:12px; font-size:14px; line-height:1.6;
  word-break:break-word; white-space:pre-wrap;
}
.chat-msg.bot .bubble{ background:#fff; color:var(--ink); border:1px solid var(--line); border-bottom-left-radius:3px; }
.chat-msg.user{ flex-direction:row-reverse; }
.chat-msg.user .bubble{ background:var(--accent); color:#fff; border-bottom-right-radius:3px; }
.chat-msg .mini-ava{
  width:26px; height:26px; border-radius:50%; background:var(--accent); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0;
}
.chat-msg.user .mini-ava{ background:var(--taupe); }

/* 打字指示 */
.chat-typing{ display:flex; gap:4px; padding:12px 14px; background:#fff; border:1px solid var(--line); border-radius:12px; border-bottom-left-radius:3px; width:fit-content; }
.chat-typing i{ width:6px; height:6px; border-radius:50%; background:var(--taupe); animation:chatblink 1.2s infinite both; }
.chat-typing i:nth-child(2){ animation-delay:.2s } .chat-typing i:nth-child(3){ animation-delay:.4s }
@keyframes chatblink{ 0%,80%,100%{ opacity:.3; transform:translateY(0) } 40%{ opacity:1; transform:translateY(-3px) } }

/* 输入区 */
.chat-foot{ border-top:1px solid var(--line); background:#fff; padding:10px 12px 12px; flex-shrink:0; }
.chat-foot .row{ display:flex; gap:8px; align-items:flex-end; }
.chat-foot textarea{
  flex:1; resize:none; height:42px; max-height:96px; padding:10px 12px;
  border:1px solid var(--line); border-radius:10px; font-family:var(--sans); font-size:14px;
  color:var(--ink); background:var(--bg); line-height:1.4; transition:border .2s;
}
.chat-foot textarea:focus{ outline:none; border-color:var(--accent); }
.chat-foot .send{
  width:46px; height:42px; border:0; border-radius:10px; background:var(--accent); color:#fff;
  font-size:18px; cursor:pointer; flex-shrink:0; transition:background .2s;
}
.chat-foot .send:hover{ background:var(--accent-deep); }
.chat-foot .send:disabled{ opacity:.5; cursor:not-allowed; }
.chat-foot .transfer{
  margin-top:8px; width:100%; border:1px solid var(--line); background:transparent; color:var(--accent-deep);
  border-radius:10px; padding:8px; font-size:13px; cursor:pointer; transition:border-color .2s,color .2s;
}
.chat-foot .transfer:hover{ border-color:var(--accent); color:var(--accent); }

@media(max-width:520px){
  .chat-panel{ right:14px; bottom:16px; width:calc(100vw - 28px); height:74vh; max-height:74vh; }
  .chat-launcher{ right:14px; bottom:16px; }
}

/* 联系卡片（拨号 / 微信 / 复制号码） */
.chat-contact{ display:flex; gap:6px; margin-bottom:8px; }
.chat-contact .cc-btn{
  flex:1; min-width:0; text-align:center; text-decoration:none;
  padding:8px 4px; border:1px solid var(--line); border-radius:9px;
  background:var(--bg); color:var(--accent-deep); font-size:12.5px; cursor:pointer;
  font-family:var(--sans); transition:border-color .2s, color .2s, background .2s;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.chat-contact .cc-btn:hover{ border-color:var(--accent); color:var(--accent); }
.chat-contact .cc-btn:active{ background:var(--accent); color:#fff; }

/* 微信二维码灯箱 */
.chat-qr-mask{
  position:fixed; inset:0; z-index:90; background:rgba(40,40,36,.72);
  display:flex; align-items:center; justify-content:center; padding:24px;
  opacity:0; pointer-events:none; transition:opacity .25s;
}
.chat-qr-mask.show{ opacity:1; pointer-events:auto; }
.chat-qr-box{
  position:relative; background:#fff; border-radius:14px; padding:22px 22px 18px;
  text-align:center; max-width:88vw; box-shadow:0 20px 60px rgba(0,0,0,.32);
}
.chat-qr-box .close{
  position:absolute; top:6px; right:10px; background:none; border:0; color:#888;
  font-size:24px; cursor:pointer; line-height:1;
}
.chat-qr-box img{ width:220px; height:220px; max-width:none; display:block; margin:0 auto; border-radius:6px; }
.chat-qr-box .t{ margin:14px 0 2px; font-size:14px; color:var(--ink); font-weight:500; }
.chat-qr-box .hint{ margin:0; font-size:12px; color:var(--taupe); }
@media(max-width:520px){
  .chat-qr-box img{ width:180px; height:180px; }
}
