/* =========================================
   AI Chat — Compact Modern Design
   基础配色 = 蓝色（默认）
   通过 .theme-green/purple/orange/red/dark 切换主题
   ========================================= */

/* ========== 触发按钮（默认蓝色） ========== */
#ai-chat-trigger{
  position:fixed;z-index:99999;cursor:pointer;
  bottom:24px;right:24px;
  width:60px;height:60px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 24px rgba(24,144,255,.4),0 2px 8px rgba(9,109,217,.25);
  transition:transform .35s cubic-bezier(0.34,1.56,0.64,1),box-shadow .3s;
  background:linear-gradient(135deg,#1890ff 0%,#096dd9 100%)
}
#ai-chat-trigger:hover{transform:scale(1.1) rotate(-6deg);box-shadow:0 12px 32px rgba(24,144,255,.5)}
#ai-chat-trigger svg{width:28px;height:28px;fill:#fff;position:relative;z-index:1}
#ai-chat-trigger .ai-badge{
  position:absolute;top:-4px;right:-4px;
  background:#ef4444;color:#fff;font-size:11px;font-weight:600;
  min-width:20px;height:20px;border-radius:10px;
  display:none;align-items:center;justify-content:center;
  border:2px solid #fff;padding:0 5px;z-index:2;
  animation:badgePulse 2s infinite
}
@keyframes badgePulse{0%,100%{transform:scale(1)}50%{transform:scale(1.15)}}

#ai-chat-overlay{
  display:none;position:fixed;inset:0;z-index:99998;
  background:rgba(15,23,42,.55);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  animation:overlayIn .3s ease
}
#ai-chat-overlay.show{display:block}
@keyframes overlayIn{from{opacity:0}to{opacity:1}}

/* =========================================
   聊天窗口
   ========================================= */
#ai-chat-widget{
  position:fixed;z-index:100000;
  width:400px;height:580px;
  max-height:calc(100vh - 120px);
  right:24px;bottom:96px;
  border-radius:20px;overflow:hidden;
  box-shadow:
    0 24px 64px rgba(15,23,42,.18),
    0 8px 24px rgba(24,144,255,.08),
    0 0 0 1px rgba(15,23,42,.04);
  display:none;flex-direction:column;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
  background:#fff;
  animation:desktopSlideUp .4s cubic-bezier(0.16,1,0.3,1)
}
@keyframes desktopSlideUp{
  from{opacity:0;transform:translateY(20px) scale(.96)}
  to  {opacity:1;transform:translateY(0)   scale(1)}
}
/* 顶部彩条（默认蓝色） */
#ai-chat-widget::before{
  content:'';position:absolute;top:0;left:0;right:0;height:4px;
  background:linear-gradient(90deg,#1890ff 0%,#096dd9 100%);
  z-index:2
}

@media(max-width:768px) and (min-width:481px){
  #ai-chat-widget{
    width:calc(100vw - 32px);max-width:420px;
    height:calc(100vh - 110px);max-height:600px;
    right:16px;bottom:88px;border-radius:20px
  }
  #ai-chat-trigger{bottom:20px;right:16px}
}

/* 手机端 — 80vw 居中弹窗 */
@media(max-width:480px){
  #ai-chat-trigger{width:54px;height:54px;bottom:16px!important;right:16px!important}
  #ai-chat-trigger svg{width:24px;height:24px}

  #ai-chat-widget{
    width:80vw!important;max-width:80vw!important;
    height:85vh!important;height:85dvh!important;
    max-height:85vh!important;max-height:85dvh!important;
    left:50%!important;top:50%!important;
    right:auto!important;bottom:auto!important;
    transform:translate(-50%,-50%)!important;
    border-radius:20px!important;
    box-shadow:0 24px 60px rgba(15,23,42,.3)!important;
    animation:mobileCenterIn .4s cubic-bezier(0.16,1,0.3,1)!important
  }
  @keyframes mobileCenterIn{
    from{opacity:0;transform:translate(-50%,-50%) scale(.92)}
    to  {opacity:1;transform:translate(-50%,-50%) scale(1)}
  }

  .ai-m .ai-bb,.ai-m.img-msg .ai-bb{max-width:calc(80vw - 100px)}
  .ai-ftr{padding-bottom:12px}
  .ai-form .af-foot{padding-bottom:14px}
}

/* =========================================
   头部 — 白色简洁版
   ========================================= */
.ai-hdr{
  padding:16px 18px 14px;
  display:flex;align-items:center;justify-content:space-between;
  background:#fff;flex-shrink:0;position:relative;
  user-select:none;border-bottom:1px solid #f1f5f9
}
.ai-hdr .ai-hdr-l{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.ai-hdr .ai-hdr-l .ai-av{
  width:38px;height:38px;border-radius:50%;
  background:linear-gradient(135deg,#1890ff 0%,#096dd9 100%);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;flex-shrink:0;position:relative;
  box-shadow:0 4px 12px rgba(24,144,255,.3);
  color:#fff;font-size:14px;font-weight:600
}
.ai-hdr .ai-hdr-l .ai-av::after{
  content:'';position:absolute;bottom:-1px;right:-1px;
  width:11px;height:11px;border-radius:50%;
  background:#10b981;border:2.5px solid #fff
}
.ai-hdr .ai-hdr-l .ai-av svg{width:22px;height:22px;fill:#fff}
.ai-hdr .ai-hdr-l .ai-av img{width:100%;height:100%;object-fit:cover}
.ai-hdr .ai-hdr-l .ai-info{min-width:0;flex:1}
.ai-hdr .ai-hdr-l .ai-info h4{
  margin:0;font-size:14.5px;font-weight:600;color:#0f172a;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  letter-spacing:-.1px;line-height:1.25
}
.ai-hdr .ai-hdr-l .ai-info span{
  font-size:11px;color:#64748b;margin-top:1px;
  display:block;font-weight:500
}
.ai-hdr .ai-hdr-r{display:flex;gap:2px;flex-shrink:0}
.ai-hdr .ai-hdr-r button{
  background:none;border:none;color:#94a3b8;cursor:pointer;
  width:28px;height:28px;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  font-size:16px;line-height:1;transition:all .2s
}
.ai-hdr .ai-hdr-r button:hover{background:#f1f5f9;color:#475569}

/* =========================================
   消息区
   ========================================= */
.ai-body{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative;min-height:0}
.ai-msgs{
  flex:1;overflow-y:auto;padding:18px 16px;
  background:linear-gradient(180deg,#fafbff 0%,#f0f7ff 100%);
  -webkit-overflow-scrolling:touch
}
.ai-msgs::-webkit-scrollbar{width:4px}
.ai-msgs::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:2px}
.ai-msgs::-webkit-scrollbar-thumb:hover{background:#94a3b8}

.ai-m{margin-bottom:14px;display:flex;gap:8px;animation:aiIn .35s cubic-bezier(0.16,1,0.3,1)}
@keyframes aiIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.ai-m.user{flex-direction:row-reverse}
.ai-m .ai-mav{
  width:32px;height:32px;border-radius:50%;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:600;overflow:hidden;color:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.08)
}
.ai-m .ai-mav img{width:100%;height:100%;object-fit:cover}
.ai-m.user .ai-mav{background:linear-gradient(135deg,#1890ff,#096dd9)}
.ai-m.ai .ai-mav,.ai-m.staff .ai-mav{background:linear-gradient(135deg,#1890ff,#096dd9)}
.ai-m.system .ai-mav{display:none}
.ai-m .ai-bb{
  max-width:260px;padding:10px 14px;border-radius:16px;
  font-size:13.5px;line-height:1.6;word-break:break-word
}
.ai-m.user .ai-bb{
  color:#fff;border-bottom-right-radius:4px;
  background:linear-gradient(135deg,#1890ff 0%,#096dd9 100%);
  box-shadow:0 4px 12px rgba(24,144,255,.25)
}
.ai-m.ai .ai-bb,.ai-m.staff .ai-bb{
  background:#fff;color:#1e293b;border-bottom-left-radius:4px;
  box-shadow:0 2px 8px rgba(15,23,42,.06);
  border:1px solid #f1f5f9
}
.ai-m.system .ai-bb{
  background:#fef3c7;color:#92400e;border-radius:10px;
  font-size:12px;max-width:100%;text-align:center;
  margin:0 auto;padding:8px 14px;font-weight:500
}
.ai-m.system{justify-content:center}
.ai-m .ai-bb .ai-tm{font-size:10.5px;margin-top:6px;display:block;font-weight:500}
.ai-m.user .ai-bb .ai-tm{color:rgba(255,255,255,.7)}
.ai-m.ai .ai-bb .ai-tm,.ai-m.staff .ai-bb .ai-tm{color:#94a3b8}

.ai-m .ai-bb .ai-text{white-space:pre-wrap;word-break:break-word}
.ai-m .ai-bb .ai-text b,.ai-m .ai-bb .ai-text strong{font-weight:600}
.ai-m .ai-bb .ai-text a{color:#1890ff;text-decoration:underline;word-break:break-all}
.ai-m.user .ai-bb .ai-text a{color:#fff}
.ai-m .ai-bb .ai-text .ai-num{display:inline-block;margin-right:4px;font-weight:600;color:#1890ff}
.ai-m.user .ai-bb .ai-text .ai-num{color:#fff}
.ai-m .ai-bb .ai-text .ai-code{
  background:rgba(0,0,0,.06);padding:1px 6px;border-radius:4px;
  font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em
}
.ai-m.user .ai-bb .ai-text .ai-code{background:rgba(255,255,255,.2)}

.ai-m.img-msg .ai-bb{padding:6px;max-width:220px;background:#fff;border:1px solid #f1f5f9}
.ai-m.img-msg.user .ai-bb{background:linear-gradient(135deg,#1890ff,#096dd9);border:none}
.ai-m.img-msg .ai-img{display:block;max-width:100%;max-height:220px;border-radius:12px;cursor:pointer;transition:transform .2s}
.ai-m.img-msg .ai-img:hover{transform:scale(1.02)}
.ai-m.img-msg .ai-img-caption{margin-top:6px;padding:0 6px 2px;font-size:13px;line-height:1.5;word-break:break-word}
.ai-m.img-msg.user .ai-img-caption{color:#fff}
.ai-m.img-msg .ai-tm{margin-top:4px;padding:0 6px 2px}

.ai-img-viewer{
  position:fixed;top:0;left:0;width:100%;height:100%;
  background:rgba(15,23,42,.95);z-index:999999;
  display:none;align-items:center;justify-content:center;cursor:zoom-out;
  backdrop-filter:blur(8px)
}
.ai-img-viewer.show{display:flex}
.ai-img-viewer img{max-width:92%;max-height:92%;object-fit:contain;border-radius:8px}
.ai-img-viewer .ai-iv-close{
  position:absolute;top:20px;right:20px;
  width:44px;height:44px;border-radius:50%;
  background:rgba(255,255,255,.15);color:#fff;font-size:24px;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  transition:background .2s;backdrop-filter:blur(8px)
}
.ai-img-viewer .ai-iv-close:hover{background:rgba(255,255,255,.25)}

.ai-typing{display:flex;gap:4px;padding:8px 14px;align-items:center}
.ai-typing span{width:6px;height:6px;border-radius:50%;background:#1890ff;animation:tdot 1.4s infinite}
.ai-typing span:nth-child(2){animation-delay:.2s}
.ai-typing span:nth-child(3){animation-delay:.4s}
@keyframes tdot{0%,80%,100%{transform:scale(1);opacity:.4}40%{transform:scale(1.3);opacity:1}}

/* =========================================
   底部输入区
   ========================================= */
.ai-ftr{
  padding:12px 16px;background:#fff;
  border-top:1px solid #f1f5f9;flex-shrink:0
}
.ai-ftr .ai-irow{display:flex;gap:8px;align-items:flex-end}
.ai-ftr textarea{
  flex:1;border:1px solid #e2e8f0;border-radius:20px;
  padding:9px 14px;font-size:13.5px;resize:none;outline:none;
  font-family:inherit;max-height:80px;min-height:38px;
  line-height:1.4;transition:all .2s;
  color:#0f172a;background:#f8fafc;-webkit-appearance:none
}
.ai-ftr textarea:focus{border-color:#1890ff;background:#fff;box-shadow:0 0 0 3px rgba(24,144,255,.1)}
.ai-ftr textarea::placeholder{color:#94a3b8}

.ai-ftr .ai-img-btn,.ai-ftr .ai-sbtn{
  width:38px;height:38px;border-radius:50%;border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:all .25s;padding:0
}
.ai-ftr .ai-img-btn{background:#f1f5f9;color:#64748b}
.ai-ftr .ai-img-btn:hover{background:#e6f7ff;color:#1890ff}
.ai-ftr .ai-img-btn:active{transform:scale(.93)}
.ai-ftr .ai-img-btn svg{width:18px;height:18px;fill:currentColor}
.ai-ftr .ai-sbtn{
  background:linear-gradient(135deg,#1890ff 0%,#096dd9 100%);
  box-shadow:0 4px 12px rgba(24,144,255,.35)
}
.ai-ftr .ai-sbtn:hover{box-shadow:0 6px 16px rgba(24,144,255,.45);transform:translateY(-1px)}
.ai-ftr .ai-sbtn:active{transform:scale(.93)}
.ai-ftr .ai-sbtn:disabled{opacity:.4;cursor:not-allowed;box-shadow:none;transform:none}
.ai-ftr .ai-sbtn svg{width:18px;height:18px;fill:#fff}

.ai-ftr .ai-tools{display:flex;gap:10px;margin-top:8px;justify-content:center}
.ai-ftr .ai-tools button{
  background:none;border:none;color:#94a3b8;font-size:11px;font-weight:500;
  cursor:pointer;transition:all .2s;padding:4px 10px;border-radius:6px
}
.ai-ftr .ai-tools button:hover{color:#1890ff;background:#e6f7ff}

.ai-img-preview{
  margin-bottom:10px;padding:10px;background:#f8fafc;
  border:1.5px dashed #91d5ff;border-radius:12px;
  display:none;position:relative
}
.ai-img-preview.show{display:block}
.ai-img-preview img{max-width:100%;max-height:120px;border-radius:8px;display:block}
.ai-img-preview .ai-img-remove{
  position:absolute;top:4px;right:4px;
  width:24px;height:24px;border-radius:50%;
  background:rgba(15,23,42,.6);color:#fff;border:none;
  cursor:pointer;font-size:14px;line-height:24px;text-align:center;padding:0;
  backdrop-filter:blur(4px)
}
.ai-img-preview .ai-img-remove:hover{background:rgba(15,23,42,.85)}
.ai-img-preview .ai-upload-progress{
  position:absolute;bottom:0;left:0;right:0;
  height:3px;background:#e6f7ff;border-radius:0 0 12px 12px;overflow:hidden
}
.ai-img-preview .ai-upload-progress-bar{
  height:100%;width:0;transition:width .3s;
  background:linear-gradient(90deg,#1890ff,#096dd9)
}

/* =========================================
   联系表单 — 紧凑设计（无 label，图标内嵌）
   ========================================= */
.ai-form{
  position:absolute;top:0;left:0;right:0;bottom:0;
  background:#fff;z-index:10;display:none;
  flex-direction:column;overflow-y:auto;-webkit-overflow-scrolling:touch
}
.ai-form::-webkit-scrollbar{width:4px}
.ai-form::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:2px}

/* 表单顶部问候 */
.ai-form .af-head{
  padding:18px 22px 14px;text-align:left;
  flex-shrink:0;background:#fff
}
.ai-form .af-head h3{
  font-size:18px;font-weight:700;color:#0f172a;
  margin:0 0 4px;letter-spacing:-.3px;line-height:1.3
}
.ai-form .af-head h3::after{
  content:' 👋';display:inline-block
}
.ai-form .af-head p{
  font-size:13px;color:#64748b;margin:0;line-height:1.5
}

.ai-form .af-body{
  padding:6px 22px 4px;flex:1
}

.ai-form .af-g{
  margin-bottom:10px;position:relative
}
.ai-form .af-g:last-child{margin-bottom:0}

/* 隐藏原 label（紧凑设计） */
.ai-form .af-g label{display:none}

/* 输入框包装 */
.ai-form .af-input-wrap{
  position:relative;
  display:flex;align-items:center;
  background:#f8fafc;
  border:1.5px solid #f1f5f9;
  border-radius:12px;
  padding:0 14px 0 40px;
  transition:all .25s
}
.ai-form .af-input-wrap:hover{background:#fff;border-color:#e2e8f0}
.ai-form .af-input-wrap.af-focused{
  border-color:#1890ff;background:#fff;
  box-shadow:0 0 0 4px rgba(24,144,255,.1)
}
.ai-form .af-input-wrap.af-error{
  border-color:#ef4444;background:#fef2f2
}

/* 字段图标 */
.ai-form .af-input-wrap::before{
  content:'';
  position:absolute;left:14px;top:50%;transform:translateY(-50%);
  width:18px;height:18px;
  background-repeat:no-repeat;background-position:center;background-size:18px;
  opacity:.45;transition:opacity .25s,filter .25s
}
.ai-form .af-input-wrap.af-focused::before{
  opacity:1;
  filter:invert(48%) sepia(94%) saturate(2476%) hue-rotate(190deg) brightness(100%) contrast(101%)
}
.ai-form .af-input-wrap.af-error::before{
  filter:invert(41%) sepia(91%) saturate(1234%) hue-rotate(331deg) brightness(98%) contrast(95%);
  opacity:1
}

/* 字段图标 SVG */
.ai-form .af-g[data-icon="user"] .af-input-wrap::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E")
}
.ai-form .af-g[data-icon="mail"] .af-input-wrap::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E")
}
.ai-form .af-g[data-icon="phone"] .af-input-wrap::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E")
}
.ai-form .af-g[data-icon="message"] .af-input-wrap{
  align-items:flex-start;padding-top:11px;padding-bottom:11px
}
.ai-form .af-g[data-icon="message"] .af-input-wrap::before{
  top:13px;transform:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E")
}

/* Input / Textarea */
.ai-form .af-g input,
.ai-form .af-g textarea{
  width:100%;padding:11px 0;border:none;background:transparent;outline:none;
  font-family:inherit;font-size:13.5px;color:#0f172a;
  -webkit-appearance:none;box-sizing:border-box
}
.ai-form .af-g input::placeholder,
.ai-form .af-g textarea::placeholder{color:#94a3b8;font-size:13.5px}
.ai-form .af-g textarea{height:20px;resize:none;line-height:1.4;padding:0}

/* 错误提示 */
.ai-form .af-g .af-err{
  color:#ef4444;font-size:11.5px;margin-top:4px;display:none;
  padding-left:4px;font-weight:500
}

/* 提交按钮 */
.ai-form .af-foot{
  padding:14px 22px 14px;flex-shrink:0;background:#fff
}
.ai-form .af-submit{
  width:100%;padding:12px;border:none;border-radius:12px;
  font-size:14.5px;font-weight:600;color:#fff;cursor:pointer;
  transition:all .3s;letter-spacing:.2px;
  background:linear-gradient(135deg,#1890ff 0%,#096dd9 100%);
  box-shadow:0 6px 16px rgba(24,144,255,.35);
  display:flex;align-items:center;justify-content:center;gap:6px
}
.ai-form .af-submit::after{
  content:'→';font-size:16px;transition:transform .25s
}
.ai-form .af-submit:hover{
  box-shadow:0 8px 20px rgba(24,144,255,.45);
  transform:translateY(-1px)
}
.ai-form .af-submit:hover::after{transform:translateX(3px)}
.ai-form .af-submit:active{transform:translateY(0)}
.ai-form .af-submit:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}

/* 信任提示 */
.ai-form .af-trust{
  display:flex;align-items:center;justify-content:center;gap:5px;
  margin-top:10px;font-size:11.5px;color:#94a3b8;font-weight:500
}
.ai-form .af-trust svg{width:12px;height:12px;fill:#94a3b8}

/* 手机端表单 */
@media(max-width:480px){
  .ai-form .af-head{padding:14px 18px 10px}
  .ai-form .af-head h3{font-size:16px}
  .ai-form .af-head p{font-size:12px}
  .ai-form .af-body{padding:4px 18px 4px}
  .ai-form .af-foot{padding:12px 18px 14px}
  .ai-form .af-g{margin-bottom:8px}
  .ai-form .af-input-wrap{padding:0 12px 0 36px}
  .ai-form .af-input-wrap::before{left:12px;width:16px;height:16px;background-size:16px}
  .ai-form .af-g input,.ai-form .af-g textarea{padding:9px 0;font-size:13px}
  .ai-form .af-submit{padding:11px;font-size:13.5px}
}

/* 拖拽提示 */
.ai-drop-hint{
  position:absolute;top:0;left:0;right:0;bottom:0;
  background:rgba(24,144,255,.08);border:2px dashed #1890ff;z-index:20;
  display:none;align-items:center;justify-content:center;
  color:#1890ff;font-size:16px;font-weight:600;pointer-events:none;
  backdrop-filter:blur(2px)
}
.ai-drop-hint.show{display:flex}

body.ai-chat-open{overflow:hidden;position:fixed;width:100%}
@media(min-width:481px){body.ai-chat-open{position:static;overflow:auto}}

/* =========================================
   主题切换 — 后台 applyTheme() 控制
   ========================================= */

/* ========== 绿色主题 ========== */
.theme-green#ai-chat-trigger{background:linear-gradient(135deg,#52c41a 0%,#389e0d 100%);box-shadow:0 8px 24px rgba(82,196,26,.4),0 2px 8px rgba(56,158,13,.25)}
.theme-green#ai-chat-trigger:hover{box-shadow:0 12px 32px rgba(82,196,26,.5)}
.theme-green#ai-chat-widget::before{background:linear-gradient(90deg,#52c41a 0%,#389e0d 100%)}
.theme-green .ai-hdr .ai-av{background:linear-gradient(135deg,#52c41a,#389e0d);box-shadow:0 4px 12px rgba(82,196,26,.3)}
.theme-green .ai-msgs{background:linear-gradient(180deg,#fafbff 0%,#f6ffed 100%)}
.theme-green .ai-m.user .ai-mav,.theme-green .ai-m.ai .ai-mav,.theme-green .ai-m.staff .ai-mav{background:linear-gradient(135deg,#52c41a,#389e0d)}
.theme-green .ai-m.user .ai-bb{background:linear-gradient(135deg,#52c41a 0%,#389e0d 100%);box-shadow:0 4px 12px rgba(82,196,26,.25)}
.theme-green .ai-m.img-msg.user .ai-bb{background:linear-gradient(135deg,#52c41a,#389e0d)}
.theme-green .ai-m .ai-bb .ai-text a,.theme-green .ai-m .ai-bb .ai-text .ai-num{color:#52c41a}
.theme-green .ai-typing span{background:#52c41a}
.theme-green .ai-ftr textarea:focus{border-color:#52c41a;box-shadow:0 0 0 3px rgba(82,196,26,.1)}
.theme-green .ai-ftr .ai-img-btn:hover{background:#f6ffed;color:#52c41a}
.theme-green .ai-ftr .ai-sbtn{background:linear-gradient(135deg,#52c41a 0%,#389e0d 100%);box-shadow:0 4px 12px rgba(82,196,26,.35)}
.theme-green .ai-ftr .ai-sbtn:hover{box-shadow:0 6px 16px rgba(82,196,26,.45)}
.theme-green .ai-ftr .ai-tools button:hover{color:#52c41a;background:#f6ffed}
.theme-green .ai-img-preview{border-color:#b7eb8f}
.theme-green .ai-img-preview .ai-upload-progress{background:#f6ffed}
.theme-green .ai-img-preview .ai-upload-progress-bar{background:linear-gradient(90deg,#52c41a,#389e0d)}
.theme-green .ai-form .af-input-wrap.af-focused{border-color:#52c41a;box-shadow:0 0 0 4px rgba(82,196,26,.1)}
.theme-green .ai-form .af-input-wrap.af-focused::before{filter:invert(57%) sepia(67%) saturate(1247%) hue-rotate(60deg) brightness(96%) contrast(85%)}
.theme-green .ai-form .af-submit{background:linear-gradient(135deg,#52c41a 0%,#389e0d 100%);box-shadow:0 6px 16px rgba(82,196,26,.35)}
.theme-green .ai-form .af-submit:hover{box-shadow:0 8px 20px rgba(82,196,26,.45)}
.theme-green .ai-drop-hint{background:rgba(82,196,26,.08);border-color:#52c41a;color:#52c41a}

/* ========== 紫色主题 ========== */
.theme-purple#ai-chat-trigger{background:linear-gradient(135deg,#722ed1 0%,#531dab 100%);box-shadow:0 8px 24px rgba(114,46,209,.4),0 2px 8px rgba(83,29,171,.25)}
.theme-purple#ai-chat-trigger:hover{box-shadow:0 12px 32px rgba(114,46,209,.5)}
.theme-purple#ai-chat-widget::before{background:linear-gradient(90deg,#722ed1 0%,#531dab 100%)}
.theme-purple .ai-hdr .ai-av{background:linear-gradient(135deg,#722ed1,#531dab);box-shadow:0 4px 12px rgba(114,46,209,.3)}
.theme-purple .ai-msgs{background:linear-gradient(180deg,#fafbff 0%,#f9f0ff 100%)}
.theme-purple .ai-m.user .ai-mav,.theme-purple .ai-m.ai .ai-mav,.theme-purple .ai-m.staff .ai-mav{background:linear-gradient(135deg,#722ed1,#531dab)}
.theme-purple .ai-m.user .ai-bb{background:linear-gradient(135deg,#722ed1 0%,#531dab 100%);box-shadow:0 4px 12px rgba(114,46,209,.25)}
.theme-purple .ai-m.img-msg.user .ai-bb{background:linear-gradient(135deg,#722ed1,#531dab)}
.theme-purple .ai-m .ai-bb .ai-text a,.theme-purple .ai-m .ai-bb .ai-text .ai-num{color:#722ed1}
.theme-purple .ai-typing span{background:#722ed1}
.theme-purple .ai-ftr textarea:focus{border-color:#722ed1;box-shadow:0 0 0 3px rgba(114,46,209,.1)}
.theme-purple .ai-ftr .ai-img-btn:hover{background:#f9f0ff;color:#722ed1}
.theme-purple .ai-ftr .ai-sbtn{background:linear-gradient(135deg,#722ed1 0%,#531dab 100%);box-shadow:0 4px 12px rgba(114,46,209,.35)}
.theme-purple .ai-ftr .ai-sbtn:hover{box-shadow:0 6px 16px rgba(114,46,209,.45)}
.theme-purple .ai-ftr .ai-tools button:hover{color:#722ed1;background:#f9f0ff}
.theme-purple .ai-img-preview{border-color:#d3adf7}
.theme-purple .ai-img-preview .ai-upload-progress{background:#f9f0ff}
.theme-purple .ai-img-preview .ai-upload-progress-bar{background:linear-gradient(90deg,#722ed1,#531dab)}
.theme-purple .ai-form .af-input-wrap.af-focused{border-color:#722ed1;box-shadow:0 0 0 4px rgba(114,46,209,.1)}
.theme-purple .ai-form .af-input-wrap.af-focused::before{filter:invert(20%) sepia(89%) saturate(2657%) hue-rotate(266deg) brightness(89%) contrast(102%)}
.theme-purple .ai-form .af-submit{background:linear-gradient(135deg,#722ed1 0%,#531dab 100%);box-shadow:0 6px 16px rgba(114,46,209,.35)}
.theme-purple .ai-form .af-submit:hover{box-shadow:0 8px 20px rgba(114,46,209,.45)}
.theme-purple .ai-drop-hint{background:rgba(114,46,209,.08);border-color:#722ed1;color:#722ed1}

/* ========== 橙色主题 ========== */
.theme-orange#ai-chat-trigger{background:linear-gradient(135deg,#fa8c16 0%,#d46b08 100%);box-shadow:0 8px 24px rgba(250,140,22,.4),0 2px 8px rgba(212,107,8,.25)}
.theme-orange#ai-chat-trigger:hover{box-shadow:0 12px 32px rgba(250,140,22,.5)}
.theme-orange#ai-chat-widget::before{background:linear-gradient(90deg,#fa8c16 0%,#d46b08 100%)}
.theme-orange .ai-hdr .ai-av{background:linear-gradient(135deg,#fa8c16,#d46b08);box-shadow:0 4px 12px rgba(250,140,22,.3)}
.theme-orange .ai-msgs{background:linear-gradient(180deg,#fafbff 0%,#fff7e6 100%)}
.theme-orange .ai-m.user .ai-mav,.theme-orange .ai-m.ai .ai-mav,.theme-orange .ai-m.staff .ai-mav{background:linear-gradient(135deg,#fa8c16,#d46b08)}
.theme-orange .ai-m.user .ai-bb{background:linear-gradient(135deg,#fa8c16 0%,#d46b08 100%);box-shadow:0 4px 12px rgba(250,140,22,.25)}
.theme-orange .ai-m.img-msg.user .ai-bb{background:linear-gradient(135deg,#fa8c16,#d46b08)}
.theme-orange .ai-m .ai-bb .ai-text a,.theme-orange .ai-m .ai-bb .ai-text .ai-num{color:#fa8c16}
.theme-orange .ai-typing span{background:#fa8c16}
.theme-orange .ai-ftr textarea:focus{border-color:#fa8c16;box-shadow:0 0 0 3px rgba(250,140,22,.1)}
.theme-orange .ai-ftr .ai-img-btn:hover{background:#fff7e6;color:#fa8c16}
.theme-orange .ai-ftr .ai-sbtn{background:linear-gradient(135deg,#fa8c16 0%,#d46b08 100%);box-shadow:0 4px 12px rgba(250,140,22,.35)}
.theme-orange .ai-ftr .ai-sbtn:hover{box-shadow:0 6px 16px rgba(250,140,22,.45)}
.theme-orange .ai-ftr .ai-tools button:hover{color:#fa8c16;background:#fff7e6}
.theme-orange .ai-img-preview{border-color:#ffd591}
.theme-orange .ai-img-preview .ai-upload-progress{background:#fff7e6}
.theme-orange .ai-img-preview .ai-upload-progress-bar{background:linear-gradient(90deg,#fa8c16,#d46b08)}
.theme-orange .ai-form .af-input-wrap.af-focused{border-color:#fa8c16;box-shadow:0 0 0 4px rgba(250,140,22,.1)}
.theme-orange .ai-form .af-input-wrap.af-focused::before{filter:invert(63%) sepia(94%) saturate(1849%) hue-rotate(2deg) brightness(101%) contrast(98%)}
.theme-orange .ai-form .af-submit{background:linear-gradient(135deg,#fa8c16 0%,#d46b08 100%);box-shadow:0 6px 16px rgba(250,140,22,.35)}
.theme-orange .ai-form .af-submit:hover{box-shadow:0 8px 20px rgba(250,140,22,.45)}
.theme-orange .ai-drop-hint{background:rgba(250,140,22,.08);border-color:#fa8c16;color:#fa8c16}

/* ========== 红色主题 ========== */
.theme-red#ai-chat-trigger{background:linear-gradient(135deg,#f5222d 0%,#cf1322 100%);box-shadow:0 8px 24px rgba(245,34,45,.4),0 2px 8px rgba(207,19,34,.25)}
.theme-red#ai-chat-trigger:hover{box-shadow:0 12px 32px rgba(245,34,45,.5)}
.theme-red#ai-chat-widget::before{background:linear-gradient(90deg,#f5222d 0%,#cf1322 100%)}
.theme-red .ai-hdr .ai-av{background:linear-gradient(135deg,#f5222d,#cf1322);box-shadow:0 4px 12px rgba(245,34,45,.3)}
.theme-red .ai-msgs{background:linear-gradient(180deg,#fafbff 0%,#fff1f0 100%)}
.theme-red .ai-m.user .ai-mav,.theme-red .ai-m.ai .ai-mav,.theme-red .ai-m.staff .ai-mav{background:linear-gradient(135deg,#f5222d,#cf1322)}
.theme-red .ai-m.user .ai-bb{background:linear-gradient(135deg,#f5222d 0%,#cf1322 100%);box-shadow:0 4px 12px rgba(245,34,45,.25)}
.theme-red .ai-m.img-msg.user .ai-bb{background:linear-gradient(135deg,#f5222d,#cf1322)}
.theme-red .ai-m .ai-bb .ai-text a,.theme-red .ai-m .ai-bb .ai-text .ai-num{color:#f5222d}
.theme-red .ai-typing span{background:#f5222d}
.theme-red .ai-ftr textarea:focus{border-color:#f5222d;box-shadow:0 0 0 3px rgba(245,34,45,.1)}
.theme-red .ai-ftr .ai-img-btn:hover{background:#fff1f0;color:#f5222d}
.theme-red .ai-ftr .ai-sbtn{background:linear-gradient(135deg,#f5222d 0%,#cf1322 100%);box-shadow:0 4px 12px rgba(245,34,45,.35)}
.theme-red .ai-ftr .ai-sbtn:hover{box-shadow:0 6px 16px rgba(245,34,45,.45)}
.theme-red .ai-ftr .ai-tools button:hover{color:#f5222d;background:#fff1f0}
.theme-red .ai-img-preview{border-color:#ffa39e}
.theme-red .ai-img-preview .ai-upload-progress{background:#fff1f0}
.theme-red .ai-img-preview .ai-upload-progress-bar{background:linear-gradient(90deg,#f5222d,#cf1322)}
.theme-red .ai-form .af-input-wrap.af-focused{border-color:#f5222d;box-shadow:0 0 0 4px rgba(245,34,45,.1)}
.theme-red .ai-form .af-input-wrap.af-focused::before{filter:invert(28%) sepia(96%) saturate(7480%) hue-rotate(354deg) brightness(89%) contrast(102%)}
.theme-red .ai-form .af-submit{background:linear-gradient(135deg,#f5222d 0%,#cf1322 100%);box-shadow:0 6px 16px rgba(245,34,45,.35)}
.theme-red .ai-form .af-submit:hover{box-shadow:0 8px 20px rgba(245,34,45,.45)}
.theme-red .ai-drop-hint{background:rgba(245,34,45,.08);border-color:#f5222d;color:#f5222d}

/* ========== 深色主题 ========== */
.theme-dark#ai-chat-trigger{background:linear-gradient(135deg,#2c3e50 0%,#1a1a2e 100%);box-shadow:0 8px 24px rgba(44,62,80,.4),0 2px 8px rgba(26,26,46,.25)}
.theme-dark#ai-chat-trigger:hover{box-shadow:0 12px 32px rgba(44,62,80,.5)}
.theme-dark#ai-chat-widget::before{background:linear-gradient(90deg,#2c3e50 0%,#1a1a2e 100%)}
.theme-dark .ai-hdr .ai-av{background:linear-gradient(135deg,#2c3e50,#1a1a2e);box-shadow:0 4px 12px rgba(44,62,80,.3)}
.theme-dark .ai-msgs{background:linear-gradient(180deg,#fafbff 0%,#f0f2f5 100%)}
.theme-dark .ai-m.user .ai-mav,.theme-dark .ai-m.ai .ai-mav,.theme-dark .ai-m.staff .ai-mav{background:linear-gradient(135deg,#2c3e50,#1a1a2e)}
.theme-dark .ai-m.user .ai-bb{background:linear-gradient(135deg,#2c3e50 0%,#1a1a2e 100%);box-shadow:0 4px 12px rgba(44,62,80,.25)}
.theme-dark .ai-m.img-msg.user .ai-bb{background:linear-gradient(135deg,#2c3e50,#1a1a2e)}
.theme-dark .ai-m .ai-bb .ai-text a,.theme-dark .ai-m .ai-bb .ai-text .ai-num{color:#2c3e50}
.theme-dark .ai-typing span{background:#2c3e50}
.theme-dark .ai-ftr textarea:focus{border-color:#2c3e50;box-shadow:0 0 0 3px rgba(44,62,80,.1)}
.theme-dark .ai-ftr .ai-img-btn:hover{background:#f0f2f5;color:#2c3e50}
.theme-dark .ai-ftr .ai-sbtn{background:linear-gradient(135deg,#2c3e50 0%,#1a1a2e 100%);box-shadow:0 4px 12px rgba(44,62,80,.35)}
.theme-dark .ai-ftr .ai-sbtn:hover{box-shadow:0 6px 16px rgba(44,62,80,.45)}
.theme-dark .ai-ftr .ai-tools button:hover{color:#2c3e50;background:#f0f2f5}
.theme-dark .ai-img-preview{border-color:#a8b4c0}
.theme-dark .ai-img-preview .ai-upload-progress{background:#f0f2f5}
.theme-dark .ai-img-preview .ai-upload-progress-bar{background:linear-gradient(90deg,#2c3e50,#1a1a2e)}
.theme-dark .ai-form .af-input-wrap.af-focused{border-color:#2c3e50;box-shadow:0 0 0 4px rgba(44,62,80,.1)}
.theme-dark .ai-form .af-input-wrap.af-focused::before{filter:invert(22%) sepia(13%) saturate(1488%) hue-rotate(176deg) brightness(95%) contrast(89%)}
.theme-dark .ai-form .af-submit{background:linear-gradient(135deg,#2c3e50 0%,#1a1a2e 100%);box-shadow:0 6px 16px rgba(44,62,80,.35)}
.theme-dark .ai-form .af-submit:hover{box-shadow:0 8px 20px rgba(44,62,80,.45)}
.theme-dark .ai-drop-hint{background:rgba(44,62,80,.08);border-color:#2c3e50;color:#2c3e50}
