/* =====================================================================
 * 白杨智慧官网 · 悬浮客服窗口样式
 * ===================================================================== */
.pw-chat-float{
    position:fixed;right:24px;bottom:96px;z-index:9998;
    width:56px;height:56px;border-radius:50%;
    background:linear-gradient(135deg,#0b3d91 0%,#2d6cdf 100%);
    box-shadow:0 12px 30px rgba(11,61,145,.45);
    display:flex;align-items:center;justify-content:center;
    color:#fff;cursor:pointer;user-select:none;
    transition:transform .25s ease, box-shadow .25s ease;
}
.pw-chat-float:hover{transform:translateY(-3px) scale(1.03);box-shadow:0 16px 36px rgba(11,61,145,.55)}
.pw-chat-float.hidden{display:none}
.pw-chat-bubble{width:26px;height:26px}
.pw-chat-unread{
    position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;
    padding:0 6px;border-radius:10px;background:#ff4d4f;color:#fff;
    font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;
    box-shadow:0 2px 6px rgba(255,77,79,.5);
}

.pw-chat-panel{
    position:fixed;right:24px;bottom:96px;z-index:9999;
    width:380px;height:560px;max-height:calc(100vh - 120px);
    background:#fff;border-radius:16px;
    box-shadow:0 24px 60px rgba(11,61,145,.22),0 0 0 1px rgba(0,0,0,.04);
    display:flex;flex-direction:column;overflow:hidden;
    opacity:0;transform:translateY(16px) scale(.97) translateX(12px);
    pointer-events:none;transition:opacity .28s ease,transform .28s ease;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
.pw-chat-panel.open{opacity:1;transform:none;pointer-events:auto}

/* 头部 */
.pw-chat-head{
    display:flex;align-items:center;justify-content:space-between;
    padding:14px 16px;background:linear-gradient(135deg,#0b3d91,#2d6cdf);
    color:#fff;flex-shrink:0;
}
.pw-chat-head-l{display:flex;align-items:center;gap:10px}
.pw-chat-avatar{
    width:36px;height:36px;border-radius:50%;
    background:rgba(255,255,255,.18);color:#fff;
    display:flex;align-items:center;justify-content:center;
    font-size:16px;flex-shrink:0;
}
.pw-chat-title{font-size:15px;font-weight:700;letter-spacing:.3px}
.pw-chat-sub{font-size:12px;opacity:.82;margin-top:2px}
.pw-chat-head-r{display:flex;gap:4px}
.pw-chat-head-r button{
    width:28px;height:28px;border:0;border-radius:6px;background:rgba(255,255,255,.15);
    color:#fff;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;
    transition:background .15s;
}
.pw-chat-head-r button:hover{background:rgba(255,255,255,.28)}

/* 消息区 */
.pw-chat-body{
    flex:1;overflow-y:auto;padding:16px 14px;background:#f6f8fc;
    display:flex;flex-direction:column;gap:14px;
}
.pw-chat-body::-webkit-scrollbar{width:6px}
.pw-chat-body::-webkit-scrollbar-thumb{background:#c9d5e8;border-radius:3px}

.pw-chat-welcome{
    text-align:center;padding:12px 8px;background:rgba(45,108,223,.06);
    border-radius:12px;border:1px dashed rgba(45,108,223,.25);
}
.pw-chat-welcome-title{font-size:14px;font-weight:600;color:#0b3d91;margin-bottom:4px}
.pw-chat-welcome-sub{font-size:12px;color:#6b7c97;line-height:1.5}

.pw-chat-msg{display:flex;gap:8px;align-items:flex-start;max-width:100%}
.pw-chat-msg.pw-chat-agent,
.pw-chat-msg.pw-chat-system{align-items:flex-start}
.pw-chat-msg.pw-chat-visitor{flex-direction:row-reverse}
.pw-chat-msg .pw-chat-avatar{
    width:30px;height:30px;background:#0b3d91;color:#fff;font-size:12px;
    border-radius:50%;flex-shrink:0;margin-top:1px;
}
.pw-chat-msg.pw-chat-visitor .pw-chat-avatar{background:#5a7eaf}
.pw-chat-bubble{flex:none;max-width:78%;min-width:36px;width:auto}
.pw-chat-content{
    padding:9px 13px;border-radius:14px;font-size:13.5px;line-height:1.55;
    word-break:break-word;white-space:pre-wrap;
    background:#fff;color:#1f2d3d;
    border-top-left-radius:4px;
    box-shadow:0 1px 2px rgba(11,61,145,.06);
}
.pw-chat-msg.pw-chat-visitor .pw-chat-content{
    background:linear-gradient(135deg,#0b3d91,#2d6cdf);color:#fff;
    border-top-left-radius:14px;border-top-right-radius:4px;
}
.pw-chat-time{font-size:10px;color:#a9b5c8;margin-top:3px}
.pw-chat-msg.pw-chat-visitor .pw-chat-time{text-align:right}
.pw-chat-system .pw-chat-content{background:#fffbe6;color:#a16207;border:1px dashed #ffe29f;font-size:12px}

/* meta 信息 */
.pw-chat-meta{display:flex;gap:8px;padding:10px 14px;background:#fff;flex-shrink:0;flex-wrap:wrap}
.pw-chat-meta-input{
    flex:1 1 45%;min-width:120px;padding:7px 10px;border:1px solid #e2ecf8;border-radius:8px;
    font-size:13px;background:#f7faff;
}
.pw-chat-meta-input:focus{outline:none;border-color:#2d6cdf;background:#fff}

/* 输入 */
.pw-chat-input{
    display:flex;gap:8px;padding:12px 14px;background:#fff;border-top:1px solid #eef2f9;flex-shrink:0;
}
#pwChatText{
    flex:1;border:1px solid #e2ecf8;border-radius:10px;padding:9px 12px;
    resize:none;font-size:13.5px;font-family:inherit;line-height:1.5;
    max-height:100px;background:#f7faff;
}
#pwChatText:focus{outline:none;border-color:#2d6cdf;background:#fff}
.pw-chat-send{
    padding:0 18px;border:0;border-radius:10px;
    background:linear-gradient(135deg,#0b3d91,#2d6cdf);color:#fff;
    font-size:13px;font-weight:600;cursor:pointer;transition:transform .15s;
}
.pw-chat-send:hover{transform:translateY(-1px)}
.pw-chat-send:disabled{opacity:.55;cursor:not-allowed;transform:none}

.pw-chat-foot{
    text-align:center;font-size:10px;color:#b3bdce;padding:6px 0;background:#fff;
    border-top:1px solid #eef2f9;flex-shrink:0;
}

/* 移动端 */
@media (max-width: 720px){
    .pw-chat-float{right:18px;bottom:72px;width:48px;height:48px}
    .pw-chat-panel{right:10px;left:10px;bottom:72px;width:auto;height:70vh}
}

/* 发送反馈小 toast（widget 内部） */
.pw-chat-toast{
    position:fixed;right:90px;bottom:96px;z-index:10000;
    padding:8px 14px;border-radius:8px;background:#333;color:#fff;
    font-size:12px;box-shadow:0 4px 12px rgba(0,0,0,.25);
    opacity:0;transform:translateY(10px);pointer-events:none;
    transition:opacity .25s,transform .25s;
}
.pw-chat-toast.show{opacity:1;transform:none}
.pw-chat-toast.error{background:#e53e3e}
.pw-chat-toast.success{background:#16a34a}
