/* 站内智能客服浮窗 */
.support-chat-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.support-chat-fab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c9a227, #a88418);
    color: #0b0f1a;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(201, 162, 39, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.support-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(201, 162, 39, 0.55);
}

.support-chat-fab .fa {
    font-size: 18px;
}

.support-chat-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 56px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: min(520px, calc(100vh - 100px));
    flex-direction: column;
    background: #12182a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.support-chat-panel.is-open {
    display: flex;
}

.support-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(64, 120, 255, 0.12));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.support-chat-head-main strong {
    display: block;
    font-size: 15px;
    color: #fff;
}

.support-chat-head-sub {
    font-size: 11px;
    color: #8a97b0;
}

.support-chat-close {
    border: none;
    background: transparent;
    color: #9aa8c7;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.support-chat-close:hover {
    color: #fff;
}

.support-chat-messages {
    flex: 1;
    min-height: 200px;
    max-height: 280px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-chat-msg {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}

.support-chat-msg a {
    color: #e8c547;
    text-decoration: underline;
}

.support-chat-msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    color: #d8e0f0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.support-chat-msg-user {
    align-self: flex-end;
    background: rgba(201, 162, 39, 0.22);
    color: #f5f0e0;
    border: 1px solid rgba(201, 162, 39, 0.35);
}

.support-chat-msg-typing {
    opacity: 0.7;
    font-style: italic;
}

.support-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    max-height: 72px;
    overflow-y: auto;
}

.support-chat-quick button {
    padding: 5px 10px;
    font-size: 12px;
    color: #c9a227;
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 999px;
    cursor: pointer;
}

.support-chat-quick button:hover {
    background: rgba(201, 162, 39, 0.2);
}

.support-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.support-chat-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
    color: #fff;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}

.support-chat-input:focus {
    outline: none;
    border-color: rgba(201, 162, 39, 0.5);
}

.support-chat-send {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #0b0f1a;
    background: #c9a227;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.support-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.support-chat-foot {
    padding: 8px 12px 12px;
    font-size: 12px;
    text-align: center;
}

.support-chat-foot a {
    display: inline-block;
    padding: 6px 14px;
    color: #0b0f1a;
    background: #5cb87a;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

.support-chat-foot a:hover {
    background: #6fd08f;
}

/* 会员中心手机版：右下角已有菜单 FAB，客服上移并换色避免重叠 */
@media (max-width: 991px) {
    body.member-page .support-chat-root {
        right: 16px;
        bottom: calc(20px + 52px + 12px + env(safe-area-inset-bottom, 0px));
        z-index: 1190;
    }

    body.member-page .support-chat-fab {
        background: linear-gradient(135deg, #2a5bd7, #4078ff);
        color: #fff;
        box-shadow: 0 8px 24px rgba(64, 120, 255, 0.42);
    }

    body.member-page .support-chat-fab:hover {
        box-shadow: 0 12px 28px rgba(64, 120, 255, 0.52);
    }
}

@media (max-width: 480px) {
    .support-chat-root {
        right: 12px;
        bottom: 12px;
    }

    body.member-page .support-chat-root {
        right: 16px;
        bottom: calc(20px + 52px + 12px + env(safe-area-inset-bottom, 0px));
    }

    .support-chat-panel {
        width: calc(100vw - 24px);
        bottom: 52px;
    }

    .support-chat-fab-text {
        display: none;
    }

    .support-chat-fab {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    body.member-page .support-chat-fab {
        width: 48px;
        height: 48px;
    }
}
