/* ===== 在线咨询组件 ===== */
.cs-fab {
    position: fixed; right: 18px; bottom: 220px; z-index: 120;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    width: 62px; height: 62px; border-radius: 50%;
    background: linear-gradient(140deg, #0B67C4, #0035A7); color: #fff;
    font-size: 12px; cursor: pointer; border: 0;
    box-shadow: 0 8px 24px rgba(0, 60, 130, .32);
    transition: transform .2s;
}
.cs-fab:hover { transform: translateY(-3px); }
.cs-fab svg { width: 24px; height: 24px; fill: #fff; }

.cs-mask {
    position: fixed; inset: 0; z-index: 200; display: none;
    background: rgba(8, 18, 32, .55); padding: 24px;
    align-items: center; justify-content: center;
}
.cs-mask.on { display: flex; }

.cs-panel {
    width: 460px; max-width: 100%; max-height: 88vh;
    background: #fff; border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 20, 45, .3);
}
.cs-hd {
    padding: 16px 20px; background: linear-gradient(120deg, #04305F, #0A63BE);
    color: #fff; display: flex; align-items: center; justify-content: space-between;
}
.cs-hd h3 { font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.cs-hd button {
    border: 0; background: none; color: rgba(255, 255, 255, .8);
    font-size: 24px; line-height: 1; cursor: pointer;
}

.cs-tabs { display: flex; border-bottom: 1px solid #EEF1F5; }
.cs-tabs button {
    flex: 1; border: 0; background: none; padding: 12px 0;
    font-size: 14px; color: #7A8699; cursor: pointer; position: relative;
}
.cs-tabs button.on { color: var(--blue); font-weight: 600; }
.cs-tabs button.on::after {
    content: ""; position: absolute; left: 24%; right: 24%; bottom: -1px;
    height: 2px; background: var(--blue);
}

.cs-body { flex: 1; overflow-y: auto; }
.cs-pane { display: none; padding: 18px 20px 22px; }
.cs-pane.on { display: block; }

.cs-note {
    font-size: 12px; color: #98A2B3; margin-bottom: 14px; line-height: 1.7;
}
.cs-field { margin-bottom: 12px; }
.cs-field label { display: block; font-size: 13px; color: #4A5568; margin-bottom: 6px; }
.cs-field label em { color: #ED1F1F; font-style: normal; }
.cs-field input, .cs-field textarea, .cs-field select {
    width: 100%; border: 1px solid #DCE3ED; border-radius: 6px;
    padding: 10px 12px; font-size: 14px; font-family: inherit; color: #333;
    outline: none; background: #fff;
}
.cs-field input:focus, .cs-field textarea:focus, .cs-field select:focus {
    border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 78, 159, .08);
}
.cs-field textarea { resize: vertical; min-height: 72px; }
.cs-submit {
    width: 100%; height: 44px; border: 0; border-radius: 6px;
    background: var(--blue); color: #fff; font-size: 15px; cursor: pointer;
}
.cs-submit:hover { background: var(--blue-dark); }
.cs-submit:disabled { opacity: .6; cursor: default; }
.cs-msg { font-size: 13px; margin: 10px 0 0; display: none; }
.cs-msg.on { display: block; }
.cs-msg.err { color: #C62828; }
.cs-msg.ok { color: #15803D; }

.cs-qr { text-align: center; padding: 6px 0; }
.cs-qr img {
    width: 200px; height: 200px; object-fit: contain; border: 1px solid #EEF1F5;
    border-radius: 8px; background: #fff;
}
.cs-qr .ph {
    width: 200px; height: 200px; margin: 0 auto; border-radius: 8px;
    border: 1px dashed #D8DFE9; background: #F8FAFD;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: #98A2B3; font-size: 12px; line-height: 1.8; padding: 16px;
}
.cs-qr p { font-size: 13px; color: #5A6678; margin-top: 10px; }

.cs-chat { display: flex; flex-direction: column; height: 380px; }
.cs-chat-log {
    flex: 1; overflow-y: auto; padding: 4px 2px 10px;
    display: flex; flex-direction: column; gap: 10px;
}
.cs-bubble {
    max-width: 78%; padding: 9px 13px; border-radius: 10px;
    font-size: 13px; line-height: 1.7; word-break: break-word;
}
.cs-bubble.admin, .cs-bubble.system { background: #F2F5F9; color: #2B3444; align-self: flex-start; }
.cs-bubble.visitor { background: var(--blue); color: #fff; align-self: flex-end; }
.cs-chat-input { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid #EEF1F5; }
.cs-chat-input input {
    flex: 1; border: 1px solid #DCE3ED; border-radius: 6px; padding: 9px 12px; font-size: 14px; outline: none;
}
.cs-chat-input input:focus { border-color: var(--blue); }
.cs-chat-input button {
    width: 70px; border: 0; border-radius: 6px; background: var(--blue); color: #fff;
    font-size: 14px; cursor: pointer;
}
.cs-chat-input button:disabled { opacity: .6; }

@media (max-width: 640px) {
    .cs-fab { right: 12px; bottom: 150px; width: 54px; height: 54px; font-size: 11px; }
    .cs-mask { padding: 0; align-items: flex-end; }
    .cs-panel { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
    .cs-chat { height: 46vh; }
}
