/* Waimao 悬浮询盘组件：右下角留言 + 右侧联系栏（依据 tanchu/cebian 设计稿） */

:root {
    --waimao-float-orange: #f47b20;
    --waimao-float-dark: #d9690f;
}

/* ============ 右下角 LEAVE A MESSAGE ============ */

.wm-float-msg {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 99990;
    width: 300px;
    max-width: 92vw;
    font-family: inherit;
}

.wm-float-msg__tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--waimao-float-orange);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 11px 16px;
    cursor: pointer;
    user-select: none;
}

.wm-float-msg__tab:hover {
    background: var(--waimao-float-dark);
}

.wm-float-msg__tab-icon {
    flex: 0 0 auto;
}

.wm-float-msg__panel[hidden],
.wm-side-rail__panel[hidden] {
    display: none;
}

.wm-float-msg__panel {
    background: #fff;
    border-top: 4px solid var(--waimao-float-orange);
    box-shadow: 0 -6px 30px rgba(10, 20, 40, 0.18);
    max-height: min(560px, 82vh);
    display: flex;
    flex-direction: column;
}

.wm-float-msg__header {
    background: var(--waimao-float-orange);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wm-float-msg__min {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    width: 30px;
    height: 26px;
    cursor: pointer;
}

.wm-float-msg__body {
    padding: 12px 14px 16px;
    overflow-y: auto;
}

.wm-float-msg__intro {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.wm-float-msg__input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 9px 12px;
    font: inherit;
    font-size: 13.5px;
    color: #333;
    background: #fff;
    border: 1.5px solid #d4d9e0;
    border-radius: 4px;
}

.wm-float-msg__input:focus {
    outline: none;
    border-color: var(--waimao-float-orange);
    box-shadow: 0 0 0 3px rgba(244, 123, 32, 0.15);
}

.wm-float-msg__textarea {
    min-height: 90px;
    resize: vertical;
}

.wm-float-msg__status {
    font-size: 13px;
    margin-bottom: 10px;
}

.wm-float-msg__status.is-error {
    color: #d63638;
}

.wm-float-msg__submit {
    display: block;
    margin: 4px auto 0;
    padding: 9px 42px;
    background: var(--waimao-float-orange);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.wm-float-msg__submit:hover {
    background: var(--waimao-float-dark);
}

.wm-float-msg__submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.wm-float-msg__success p {
    font-size: 13.5px;
    line-height: 1.6;
    color: #1e7e34;
    margin: 6px 0;
}

/* ============ 右侧中间联系栏 ============ */

.wm-side-rail {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99990;
    font-family: inherit;
}

.wm-side-rail__strip {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    user-select: none;
}

.wm-side-rail__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--waimao-float-orange);
    color: #fff;
}

.wm-side-rail__icon + .wm-side-rail__icon {
    border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.wm-side-rail__strip:hover .wm-side-rail__icon {
    background: var(--waimao-float-dark);
}

.wm-side-rail__panel {
    position: relative;
    width: 250px;
    max-width: 78vw;
    background: var(--waimao-float-orange);
    color: #fff;
    padding: 10px 0 14px;
}

.wm-side-rail__close {
    position: absolute;
    left: -24px;
    top: 0;
    width: 24px;
    height: 40px;
    background: var(--waimao-float-orange);
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.wm-side-rail__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    word-break: break-all;
}

a.wm-side-rail__row {
    text-decoration: none;
}

a.wm-side-rail__row:hover {
    background: rgba(255, 255, 255, 0.12);
}

.wm-side-rail__row + .wm-side-rail__row,
.wm-side-rail__row + .wm-side-rail__qr,
.wm-side-rail__qr + .wm-side-rail__row {
    border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.wm-side-rail__row-icon {
    flex: 0 0 auto;
    display: inline-flex;
}

.wm-side-rail__qr {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.wm-side-rail__qr img {
    display: block;
    width: 130px;
    height: auto;
    background: #fff;
    padding: 6px;
}

/* ============ 展开时不遮挡主题的返回顶部按钮 ============ */

body.waimao-float-open .back-to-top,
body.waimao-float-open #back-to-top,
body.waimao-float-open .to-top,
body.waimao-float-open #to-top,
body.waimao-float-open .scroll-top,
body.waimao-float-open #scroll-top,
body.waimao-float-open .topbutton,
body.waimao-float-open #topbutton,
body.waimao-float-open .go-to-top,
body.waimao-float-open #go-to-top {
    z-index: 100001 !important;
}

/* ============ 小屏适配 ============ */

@media screen and (max-width: 480px) {
    .wm-float-msg {
        width: 270px;
    }

    .wm-side-rail__icon {
        width: 40px;
        height: 40px;
    }

    .wm-side-rail__panel {
        width: 220px;
    }
}
