/* 智能客服悬浮窗：与 newgreen 主题配色一致，避开右下角 .floaters */
.pos-chat {
    --pc-brand: #4c9f38;
    --pc-brand-dark: #33761b;
    --pc-ink: #1e1b18;
    --pc-surface: #fffdf9;
    --pc-line: #dce8cf;
    --pc-muted: #6b7a5f;
    position: fixed;
    right: 22px;
    bottom: 214px;
    z-index: 320;
    font-size: 15px;
}

.pos-chat[hidden] { display: none; }

.pos-chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 14px 0 12px;
    border-radius: 23px;
    border: 1px solid var(--pc-line);
    background: var(--pc-surface);
    color: var(--pc-brand);
    box-shadow: 0 6px 18px rgba(20, 61, 11, .12);
    cursor: pointer;
    transition: .25s;
}
.pos-chat-launcher svg { width: 22px; height: 22px; }
.pos-chat-launcher-text { font-size: 14px; font-weight: 600; }
.pos-chat-launcher:hover {
    background: var(--pc-brand);
    border-color: var(--pc-brand);
    color: #fff;
    transform: translateY(-2px);
}

.pos-chat-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: var(--pc-surface);
    border: 1px solid var(--pc-line);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(12, 37, 6, .18);
    overflow: hidden;
}
.pos-chat-panel[hidden] { display: none; }

.pos-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--pc-brand), var(--pc-brand-dark));
    color: #fff;
}
.pos-chat-avatar {
    width: 32px; height: 32px; flex: 0 0 32px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .22);
    font-size: 13px; font-weight: 700; letter-spacing: .5px;
}
.pos-chat-head-main { flex: 1; min-width: 0; line-height: 1.35; }
.pos-chat-head-main strong { display: block; font-size: 15px; }
.pos-chat-head-main em { display: block; font-size: 12px; opacity: .85; font-style: normal; }
.pos-chat-close {
    width: 28px; height: 28px; border: 0; border-radius: 8px;
    background: rgba(255, 255, 255, .18); color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.pos-chat-close:hover { background: rgba(255, 255, 255, .34); }

.pos-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7faf3;
    scroll-behavior: smooth;
}
.pos-chat-msg { margin: 0 0 12px; display: flex; }
.pos-chat-msg.user { justify-content: flex-end; }
.pos-chat-bubble {
    max-width: 84%;
    padding: 10px 13px;
    border-radius: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
}
.pos-chat-msg.ai .pos-chat-bubble {
    background: #fff;
    border: 1px solid var(--pc-line);
    border-top-left-radius: 4px;
    color: var(--pc-ink);
}
.pos-chat-msg.user .pos-chat-bubble {
    background: var(--pc-brand);
    color: #fff;
    border-top-right-radius: 4px;
}
.pos-chat-msg.system .pos-chat-bubble {
    background: #fff6e5;
    border: 1px solid #f0dcae;
    color: #6b4a0c;
    font-size: 13px;
}
.pos-chat-typing { display: inline-flex; gap: 4px; align-items: center; }
.pos-chat-typing i {
    width: 6px; height: 6px; border-radius: 50%; background: var(--pc-brand);
    animation: pos-chat-blink 1.2s infinite ease-in-out;
}
.pos-chat-typing i:nth-child(2) { animation-delay: .2s; }
.pos-chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pos-chat-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.pos-chat-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pos-chat-quick button {
    border: 1px solid var(--pc-line);
    background: #fff;
    color: var(--pc-brand-dark);
    border-radius: 14px;
    padding: 6px 11px;
    font-size: 13px;
    cursor: pointer;
}
.pos-chat-quick button:hover { background: var(--pc-brand); border-color: var(--pc-brand); color: #fff; }

.pos-chat-lead {
    border-top: 1px solid var(--pc-line);
    background: #fff;
    padding: 10px 14px 12px;
}
.pos-chat-lead[hidden] { display: none; }
.pos-chat-lead p { margin: 0 0 8px; font-size: 13px; color: var(--pc-muted); }
.pos-chat-lead-row { display: flex; gap: 8px; }
.pos-chat-lead-row input {
    flex: 1; min-width: 0; height: 38px; padding: 0 12px;
    border: 1px solid var(--pc-line); border-radius: 10px; font-size: 14px;
    background: #fff; color: var(--pc-ink);
}
.pos-chat-lead-row input:focus { outline: none; border-color: var(--pc-brand); }
.pos-chat-lead-row button {
    height: 38px; padding: 0 16px; border: 0; border-radius: 10px;
    background: var(--pc-brand); color: #fff; font-size: 14px; cursor: pointer;
}
.pos-chat-lead-row button:disabled { opacity: .6; cursor: not-allowed; }
.pos-chat-lead-tip { display: block; margin-top: 6px; font-size: 12px; color: var(--pc-brand-dark); }
.pos-chat-lead-tip.error { color: #d92d20; }

.pos-chat-input {
    display: flex; gap: 8px; padding: 10px 12px 12px;
    border-top: 1px solid var(--pc-line); background: #fff;
}
.pos-chat-input input {
    flex: 1; min-width: 0; height: 40px; padding: 0 12px;
    border: 1px solid var(--pc-line); border-radius: 12px; font-size: 14px;
    background: #fff; color: var(--pc-ink);
}
.pos-chat-input input:focus { outline: none; border-color: var(--pc-brand); }
.pos-chat-input button {
    height: 40px; padding: 0 18px; border: 0; border-radius: 12px;
    background: var(--pc-brand); color: #fff; font-size: 14px; cursor: pointer;
}
.pos-chat-input button:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 768px) {
    .pos-chat { right: 14px; bottom: 178px; }
    .pos-chat-panel {
        position: fixed;
        right: 12px; left: 12px; bottom: 12px;
        width: auto; max-width: none;
        height: 66vh;
    }
    .pos-chat-launcher-text { display: none; }
    .pos-chat-launcher { padding: 0 12px; }
}
