/* ========================================================
 *  在线客服弹窗（右上角客服中心按钮触发）
 * ====================================================== */

.gp-chat-widget {
    position: fixed;
    right: 24px; bottom: 0;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}
.gp-chat-widget.open { display: flex; }

.gp-chat-widget__head {
    background: linear-gradient(135deg, #3a4ec4, #5561d8);
    color: #fff;
    padding: 14px 16px;
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.gp-chat-widget__avatar {
    width: 40px; height: 40px;
    background: #fff; color: #3a4ec4;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.gp-chat-widget__info { flex: 1; }
.gp-chat-widget__name { font-weight: 700; font-size: 15px; }
.gp-chat-widget__status { font-size: 12px; opacity: .85; }
.gp-chat-widget__close {
    background: none; border: 0; color: #fff;
    font-size: 22px; cursor: pointer; line-height: 1;
    padding: 4px;
}

.gp-chat-widget__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f6f8;
}
.gp-chat-widget__body .msg { display: flex; margin-bottom: 14px; }
.gp-chat-widget__body .msg.user { justify-content: flex-end; }
.gp-chat-widget__body .msg.service { justify-content: flex-start; }
.gp-chat-widget__body .bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.gp-chat-widget__body .msg.user .bubble {
    background: #4a7bd6; color: #fff;
    border-bottom-right-radius: 2px;
}
.gp-chat-widget__body .msg.service .bubble {
    background: #fff; color: #333;
    border: 1px solid #e5e5e5;
    border-bottom-left-radius: 2px;
}
.gp-chat-widget__body .msg.system {
    justify-content: center;
}
.gp-chat-widget__body .msg.system .bubble {
    background: transparent; color: #999; font-size: 12px;
    max-width: 90%; text-align: center;
}

.gp-chat-widget__foot {
    border-top: 1px solid #eee;
    padding: 10px;
    display: flex; gap: 8px;
    flex-shrink: 0;
    background: #fff;
}
.gp-chat-widget__input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    height: 42px;
    outline: none;
}
.gp-chat-widget__input:focus { border-color: #4a7bd6; }
.gp-chat-widget__img {
    width: 42px; height: 42px;
    border: 0; background: #f0f3f8;
    border-radius: 6px; font-size: 20px;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.gp-chat-widget__img:hover { background: #e3e9f4; }
.gp-chat-widget__send {
    border: 0;
    background: #4a7bd6;
    color: #fff;
    border-radius: 6px;
    padding: 0 18px;
    font-size: 14px;
    cursor: pointer;
}
.gp-chat-widget__send:hover { background: #3d6dc6; }
.gp-chat-widget__send:disabled { background: #b8c8e8; cursor: not-allowed; }

/* 图片消息 + 撤回消息 */
.gp-chat-widget__body .bubble.gp-img { padding: 4px; background: transparent; border: 0; }
.gp-chat-widget__body .bubble.gp-img img {
    max-width: 200px; max-height: 200px;
    border-radius: 8px; display: block;
}
.gp-chat-widget__body .bubble.gp-recalled {
    background: #eef0f5; color: #999; font-style: italic;
    border: 1px dashed #d0d4dd;
}
