/* AI客服对话框样式 */
.chat-widget{position:fixed;bottom:24px;right:24px;z-index:9999;font-family:"Microsoft YaHei","PingFang SC","Helvetica Neue",Arial,sans-serif}
.chat-btn{width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,#1890ff,#096dd9);cursor:pointer;box-shadow:0 4px 14px rgba(24,144,255,0.45);display:flex;align-items:center;justify-content:center;transition:all .3s ease;position:relative;-webkit-tap-highlight-color:transparent}
.chat-btn:active{transform:scale(0.95)}
.chat-btn svg{width:30px;height:30px;fill:#fff}
.chat-panel{position:fixed;bottom:96px;right:24px;width:380px;height:520px;background:#fff;border-radius:14px;box-shadow:0 8px 40px rgba(0,0,0,0.18);display:none;flex-direction:column;overflow:hidden;animation:chatSlideUp .3s ease}
@keyframes chatSlideUp{from{opacity:0;transform:translateY(20px) scale(0.96)}to{opacity:1;transform:translateY(0) scale(1)}}
.chat-panel.active{display:flex}

/* 头部 */
.chat-header{background:linear-gradient(135deg,#1890ff,#096dd9);color:#fff;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.chat-header .info{display:flex;align-items:center;gap:10px}
.chat-header .avatar{width:38px;height:38px;background:rgba(255,255,255,0.2);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px}
.chat-header .text h3{font-size:15px;font-weight:600;margin:0}
.chat-header .text p{font-size:11px;opacity:0.85;margin:2px 0 0}
.chat-header .close-btn{cursor:pointer;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background .2s;-webkit-tap-highlight-color:transparent}
.chat-header .close-btn:active{background:rgba(255,255,255,0.25)}
.chat-header .close-btn svg{width:18px;height:18px;fill:#fff}

/* 消息区域 */
.chat-messages{flex:1;overflow-y:auto;padding:14px;background:#f0f2f5}
.chat-messages::-webkit-scrollbar{width:3px}
.chat-messages::-webkit-scrollbar-thumb{background:#ccc;border-radius:2px}
.msg-row{display:flex;margin-bottom:12px;gap:8px;align-items:flex-end}
.msg-row.bot{justify-content:flex-start}
.msg-row.user{justify-content:flex-end}
.msg-avatar{width:30px;height:30px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:14px}
.msg-row.bot .msg-avatar{background:#1890ff}
.msg-row.user .msg-avatar{background:#52c41a}
.msg-bubble{max-width:78%;padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.6;word-break:break-word}
.msg-row.bot .msg-bubble{background:#fff;color:#333;border-bottom-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,0.06)}
.msg-row.user .msg-bubble{background:#1890ff;color:#fff;border-bottom-right-radius:4px}
.msg-time{font-size:11px;color:#999;margin:4px 0 8px;text-align:center}

/* 打字动画 */
.typing-dots{display:flex;gap:5px;padding:4px 0}
.typing-dots span{width:7px;height:7px;background:#aaa;border-radius:50%;animation:typingBounce 1.4s infinite}
.typing-dots span:nth-child(2){animation-delay:.2s}
.typing-dots span:nth-child(3){animation-delay:.4s}
@keyframes typingBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}

/* 快捷问题 */
.quick-questions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.quick-questions .quick-btn{background:#fff;border:1px solid #1890ff;color:#1890ff;padding:6px 14px;border-radius:18px;font-size:12px;cursor:pointer;transition:all .15s;-webkit-tap-highlight-color:transparent}
.quick-questions .quick-btn:active{background:#1890ff;color:#fff}

/* 输入区域 */
.chat-input-area{padding:10px 14px;border-top:1px solid #eee;background:#fff;display:flex;gap:10px;align-items:center;flex-shrink:0}
.chat-input-area input{flex:1;border:1px solid #e0e0e0;border-radius:22px;padding:10px 16px;font-size:14px;outline:none;transition:border .2s;background:#f8f8f8;-webkit-appearance:none;appearance:none}
.chat-input-area input:focus{border-color:#1890ff;background:#fff}
.chat-input-area .send-btn{width:40px;height:40px;min-width:40px;border-radius:50%;background:linear-gradient(135deg,#1890ff,#096dd9);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;-webkit-tap-highlight-color:transparent;flex-shrink:0}
.chat-input-area .send-btn:active{transform:scale(0.9);background:#096dd9}
.chat-input-area .send-btn svg{width:20px;height:20px;fill:#fff}

/* ========== 平板+手机 (1000px以下，与底部菜单栏同断点) ========== */
@media(max-width:1000px){
  .chat-widget{
    right:1%;
    /* gotop底部10% + gotop高度51px + 间距6px */
    bottom:calc(10% + 51px + 6px);
  }
  .chat-btn{width:52px;height:52px}
  .chat-btn svg{width:25px;height:25px}
  .chat-panel{
    right:1%;
    bottom:calc(10% + 51px + 6px + 52px + 8px);
    width:340px;
    height:460px;
  }
}

/* ========== 手机 (480px以下) ========== */
@media(max-width:480px){
  .chat-widget{
    right:1%;
    bottom:calc(10% + 51px + 6px);
  }
  .chat-btn{width:50px;height:50px}
  .chat-btn svg{width:24px;height:24px}
  .chat-panel{
    position:fixed;
    top:0;left:0;right:0;bottom:0;
    width:100%;
    height:100%;
    border-radius:0;
    z-index:10000;
    animation:chatMobileIn .25s ease;
  }
  @keyframes chatMobileIn{from{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}
  .chat-header{padding:12px 14px}
  .chat-header .avatar{width:34px;height:34px;font-size:16px}
  .chat-header .text h3{font-size:14px}
  .chat-header .close-btn{width:36px;height:36px}
  .chat-messages{padding:12px}
  .msg-bubble{max-width:82%;font-size:13px;padding:9px 12px}
  .msg-avatar{width:28px;height:28px;font-size:13px}
  .quick-questions{gap:5px}
  .quick-questions .quick-btn{padding:7px 14px;font-size:13px}
  .chat-input-area{padding:10px 12px}
  .chat-input-area input{padding:10px 14px;font-size:15px;border-radius:24px}
  .chat-input-area .send-btn{width:44px;height:44px;min-width:44px}
  .chat-input-area .send-btn svg{width:22px;height:22px}
}
