/* 镭目智能客服：纯前端、零第三方依赖 */
.ramon-chat {
    position: fixed;
    right: 1rem;
    bottom: 15%;
    z-index: 9999;
    width: 3.8rem;
    height: min(5.7rem, 76vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #263548;
    background: #fff;
    border: 1px solid rgba(0, 90, 160, .1);
    border-radius: .16rem;
    box-shadow: 0 .12rem .45rem rgba(19, 52, 82, .2);
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: .14rem;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(.18rem);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.ramon-chat.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.ramon-chat * {
    box-sizing: border-box;
}

.ramon-chat-header {
    flex: none;
    display: flex;
    align-items: center;
    min-height: .74rem;
    padding: .14rem .16rem;
    color: #fff;
    background: linear-gradient(135deg, #006db3, #004f91);
}

.ramon-chat-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: .42rem;
    height: .42rem;
    margin-right: .1rem;
    border-radius: 50%;
    color: #005a9f;
    background: #fff;
    font-size: .16rem;
    font-weight: bold;
}

.ramon-chat-heading {
    min-width: 0;
    flex: 1;
}

.ramon-chat-title {
    font-size: .17rem;
    font-weight: bold;
    line-height: 1.35;
}

.ramon-chat-status {
    margin-top: .02rem;
    font-size: .12rem;
    opacity: .8;
}

.ramon-chat-actions {
    display: flex;
    align-items: center;
    gap: .06rem;
}

.ramon-chat-lang,
.ramon-chat-close {
    min-width: .3rem;
    height: .3rem;
    padding: 0 .06rem;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: .04rem;
    cursor: pointer;
    font: inherit;
    line-height: .28rem;
}

.ramon-chat-close {
    border: 0;
    font-size: .22rem;
}

.ramon-chat-messages {
    flex: 1;
    min-height: 0;
    padding: .16rem;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f4f7fa;
    scroll-behavior: smooth;
}

.ramon-chat-message {
    display: flex;
    margin-bottom: .12rem;
}

.ramon-chat-message.is-user {
    justify-content: flex-end;
}

.ramon-chat-bubble {
    max-width: 86%;
    padding: .09rem .12rem;
    border-radius: .04rem .12rem .12rem .12rem;
    color: #314255;
    background: #fff;
    box-shadow: 0 .02rem .08rem rgba(23, 57, 87, .06);
    white-space: pre-line;
    word-break: break-word;
}

.ramon-chat-message.is-user .ramon-chat-bubble {
    color: #fff;
    background: #0067ad;
    border-radius: .12rem .04rem .12rem .12rem;
}

.ramon-chat-quick {
    flex: none;
    display: flex;
    gap: .07rem;
    padding: .1rem .14rem;
    overflow-x: auto;
    background: #f4f7fa;
    border-top: 1px solid #e5ebf0;
    scrollbar-width: thin;
}

.ramon-chat-quick button {
    flex: none;
    padding: .055rem .1rem;
    color: #005a9f;
    background: #fff;
    border: 1px solid #b9d2e5;
    border-radius: .14rem;
    cursor: pointer;
    font: inherit;
    font-size: .12rem;
    white-space: nowrap;
}

@media (hover: hover) {
    .ramon-chat-quick button:hover {
        color: #fff;
        background: #005a9f;
    }
}

.ramon-chat-quick button:active {
    color: #fff;
    background: #005a9f;
}

.ramon-chat-form {
    flex: none;
    display: flex;
    align-items: center;
    gap: .08rem;
    padding: .12rem .14rem;
    background: #fff;
    border-top: 1px solid #e5ebf0;
}

.ramon-chat-input {
    min-width: 0;
    flex: 1;
    height: .38rem;
    padding: 0 .12rem;
    color: #263548;
    background: #f6f8fa;
    border: 1px solid #dce4eb;
    border-radius: .19rem;
    outline: 0;
    font: inherit;
}

.ramon-chat-input:focus {
    border-color: #0067ad;
    box-shadow: 0 0 0 .02rem rgba(0, 103, 173, .1);
}

.ramon-chat-send {
    flex: none;
    width: .6rem;
    height: .36rem;
    padding: 0;
    color: #fff;
    background: #0067ad;
    border: 0;
    border-radius: .18rem;
    cursor: pointer;
    font: inherit;
}

@media (hover: hover) {
    .ramon-chat-send:hover {
        background: #004f91;
    }
}

.ramon-chat-send:active {
    background: #004f91;
}

.ramon-chat button:focus-visible,
.c-floating .b1:focus-visible {
    outline: .02rem solid #31a8ff;
    outline-offset: .02rem;
}

@media screen and (max-width: 768px) {
    .ramon-chat {
        top: var(--ramon-vvt, 0px);
        right: 0;
        bottom: auto;
        left: 0;
        z-index: 10000;
        width: 100%;
        max-width: none;
        height: 100%;
        height: 100dvh;
        height: var(--ramon-vvh, 100dvh);
        border: 0;
        border-radius: 0;
        box-shadow: none;
        font-size: .28rem;
        line-height: 1.55;
        transform: translateY(.8rem);
    }

    .ramon-chat.is-open {
        transform: none;
    }

    .ramon-chat-header {
        min-height: .96rem;
        padding: .2rem .28rem;
        padding-top: calc(.2rem + env(safe-area-inset-top, 0px));
    }

    .ramon-chat-avatar {
        width: .64rem;
        height: .64rem;
        margin-right: .16rem;
        font-size: .28rem;
    }

    .ramon-chat-title {
        font-size: .32rem;
    }

    .ramon-chat-status {
        margin-top: .04rem;
        font-size: .22rem;
    }

    .ramon-chat-actions {
        gap: .12rem;
    }

    .ramon-chat-lang,
    .ramon-chat-close {
        min-width: .64rem;
        height: .64rem;
        padding: 0 .12rem;
        border-radius: .08rem;
        line-height: .62rem;
        font-size: .26rem;
        touch-action: manipulation;
    }

    .ramon-chat-close {
        font-size: .44rem;
        line-height: .58rem;
    }

    .ramon-chat-messages {
        padding: .28rem;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .ramon-chat-message {
        margin-bottom: .2rem;
    }

    .ramon-chat-bubble {
        max-width: 88%;
        padding: .16rem .22rem;
        border-radius: .08rem .2rem .2rem .2rem;
        font-size: .28rem;
    }

    .ramon-chat-message.is-user .ramon-chat-bubble {
        border-radius: .2rem .08rem .2rem .2rem;
    }

    .ramon-chat-quick {
        gap: .12rem;
        padding: .16rem .28rem .08rem;
        -webkit-overflow-scrolling: touch;
    }

    .ramon-chat-quick button {
        padding: .12rem .22rem;
        border-radius: .32rem;
        font-size: .24rem;
        touch-action: manipulation;
    }

    .ramon-chat-form {
        gap: .16rem;
        padding: .2rem .28rem;
        padding-bottom: calc(.2rem + env(safe-area-inset-bottom, 0px));
    }

    .ramon-chat-input {
        height: .72rem;
        padding: 0 .24rem;
        border-radius: .36rem;
        font-size: 16px;
    }

    .ramon-chat-send {
        width: 1.2rem;
        height: .72rem;
        border-radius: .36rem;
        font-size: .28rem;
        touch-action: manipulation;
    }

    body.ramon-chat-open {
        overflow: hidden;
    }

    body.ramon-chat-open .c-floating {
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ramon-chat {
        transition: none;
    }

    .ramon-chat-messages {
        scroll-behavior: auto;
    }
}
