/* ===== 五页面统一 AI在线客服：替换旧AI运营管家 ===== */
.global-butler{display:none!important;}

.ai-service-widget{
    position:fixed;
    right:22px;
    bottom:24px;
    z-index:99998;
    font-family:Arial,"Microsoft YaHei",sans-serif;
}

.ai-service-mini{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:142px;
    height:48px;
    padding:0 15px;
    border:none;
    border-radius:999px;
    cursor:pointer;
    background:linear-gradient(135deg,#020617,#111827,#1e1b4b);
    color:#fff;
    box-shadow:0 18px 42px rgba(15,23,42,.28);
    font-weight:1000;
}

.ai-service-mini b{
    width:28px;
    height:28px;
    border-radius:11px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    font-size:13px;
}

.ai-service-mini i{
    width:8px;
    height:8px;
    border-radius:50%;
    background:#22c55e;
    box-shadow:0 0 12px rgba(34,197,94,.9);
    animation:aiServicePulse 1.8s ease-in-out infinite;
}

@keyframes aiServicePulse{
    0%,100%{opacity:.45;transform:scale(.9);}
    50%{opacity:1;transform:scale(1.13);}
}

.ai-service-panel{
    display:none;
    width:340px;
    height:560px;
    max-height:calc(100vh - 120px);
    border-radius:26px;
    overflow:hidden;
    background:#fff;
    border:1px solid rgba(226,232,240,.92);
    box-shadow:0 26px 72px rgba(15,23,42,.26);
    backdrop-filter:blur(12px);
}

.ai-service-widget.expanded .ai-service-mini{
    display:none;
}

.ai-service-widget.expanded .ai-service-panel{
    display:flex;
    flex-direction:column;
}

.ai-service-head{
    position:relative;
    overflow:hidden;
    background:linear-gradient(135deg,#020617,#111827,#1e1b4b);
    color:#fff;
    padding:17px;
}

.ai-service-head:before{
    content:"";
    position:absolute;
    inset:-80px;
    background:
        radial-gradient(circle at 20% 20%,rgba(59,130,246,.35),transparent 26%),
        radial-gradient(circle at 85% 30%,rgba(168,85,247,.30),transparent 30%);
    animation:aiServiceGlow 7s ease-in-out infinite alternate;
}

@keyframes aiServiceGlow{
    from{transform:translate(-12px,-8px);}
    to{transform:translate(18px,14px);}
}

.ai-service-head-inner{
    position:relative;
    z-index:2;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.ai-service-title{
    display:flex;
    align-items:center;
    gap:11px;
}

.ai-service-avatar{
    width:42px;
    height:42px;
    border-radius:16px;
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    display:grid;
    place-items:center;
    color:#fff;
    font-weight:1000;
    box-shadow:0 12px 28px rgba(37,99,235,.34);
}

.ai-service-title b{
    display:block;
    font-size:18px;
    line-height:1.2;
}

.ai-service-title span{
    display:block;
    margin-top:4px;
    color:#c7d2fe;
    font-size:12px;
    font-weight:800;
}

.ai-service-close{
    width:34px;
    height:34px;
    border:none;
    border-radius:12px;
    background:rgba(255,255,255,.12);
    color:#fff;
    cursor:pointer;
    font-size:19px;
    font-weight:1000;
}

.ai-service-body{
    flex:1;
    padding:14px;
    background:#f8fafc;
    overflow-y:auto;
}

.ai-service-msg{
    display:flex;
    margin-bottom:12px;
}

.ai-service-msg.user{
    justify-content:flex-end;
}

.ai-service-bubble{
    max-width:86%;
    padding:11px 13px;
    border-radius:17px;
    font-size:13px;
    line-height:1.65;
    font-weight:800;
    word-break:break-word;
}

.ai-service-msg.ai .ai-service-bubble,
.ai-service-msg.agent .ai-service-bubble,
.ai-service-msg.system .ai-service-bubble{
    background:#fff;
    color:#334155;
    border:1px solid #e5e7eb;
    box-shadow:0 10px 22px rgba(15,23,42,.06);
}

.ai-service-msg.user .ai-service-bubble{
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    color:#fff;
    border-bottom-right-radius:6px;
}

.ai-service-msg.agent .ai-service-bubble{
    border-color:#fde68a;
    background:#fffbeb;
    color:#78350f;
}

.ai-service-msg.system .ai-service-bubble{
    border-color:#c7d2fe;
    background:#eef2ff;
    color:#3730a3;
}

.ai-service-quick{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    padding:10px 12px 0;
    background:#fff;
    border-top:1px solid #e5e7eb;
}

.ai-service-quick button{
    border:none;
    border-radius:12px;
    padding:9px 8px;
    background:#eef2ff;
    color:#3730a3;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
}

.ai-service-input{
    display:flex;
    gap:9px;
    padding:12px;
    background:#fff;
}

.ai-service-input input{
    flex:1;
    height:42px;
    border:1px solid #dbe2ea;
    border-radius:14px;
    padding:0 13px;
    outline:none;
    font-size:13px;
    font-weight:800;
}

.ai-service-input input:focus{
    border-color:#6366f1;
    box-shadow:0 0 0 3px rgba(99,102,241,.12);
}

.ai-service-input button{
    width:64px;
    border:none;
    border-radius:14px;
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    color:#fff;
    font-weight:1000;
    cursor:pointer;
}

.ai-service-transfer{
    margin:0 12px 12px;
    padding:10px 12px;
    border-radius:14px;
    background:#fffbeb;
    border:1px solid #fde68a;
    color:#92400e;
    font-size:12px;
    font-weight:900;
    display:none;
}

.ai-service-widget.human .ai-service-transfer{
    display:block;
}

@media(max-width:720px){
    .ai-service-widget{right:14px;bottom:14px;}
    .ai-service-panel{width:calc(100vw - 28px);height:520px;}
}
