/* =========================================================
   MOJI 微信客服助手 · 前端样式
   来源：MOJI 全站微信咨询组件
   ========================================================= */

.mjc,
.mjc * {
    box-sizing: border-box;
}

.mjc {
    --g: #22DD7F;
    --n: #0E0F10;
    --n2: #15171A;
    --nl: #24282C;
    --t: #F2F0EA;
    --m: #9AA0A6;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.mjc button {
    font-family: inherit;
    cursor: pointer;
}

/* ---------- 桌面端右侧悬浮栏 ---------- */
.mjc-rail {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9990;
    width: 60px;
    padding: 6px 0;
    background: var(--n);
    border: 1px solid var(--nl);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

.mjc-rail > button,
.mjc-rail > a {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #B9BDC2;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.mjc-rail > button:hover,
.mjc-rail > a:hover {
    color: var(--g);
}

.mjc-rail .mjc-main {
    background: var(--g);
    color: var(--n);
}

.mjc-rail .mjc-main:hover {
    color: var(--n);
    filter: brightness(1.08);
}

.mjc-lbl {
    font-size: 10px;
    color: var(--g);
    margin: -2px 0 2px;
}

.mjc-sep {
    width: 28px;
    height: 1px;
    background: var(--nl);
    margin: 2px 0;
}

/* ---------- 悬浮栏弹出气泡 ---------- */
.mjc-pop {
    position: absolute;
    right: 72px;
    top: 0;
    width: 272px;
    background: var(--n2);
    color: var(--t);
    border: 1px solid var(--g);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: .18s;
}

.mjc-rail.open .mjc-pop {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mjc-pop h4 {
    margin: 0;
    font-size: 16px;
    color: var(--t);
}

.mjc-pop .mjc-subt {
    font-size: 12px;
    color: var(--m);
    margin: 2px 0 12px;
}

/* ---------- 二维码 ---------- */
.mjc-qr {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.mjc-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.mjc-qr .mjc-ph {
    font-size: 11px;
    color: #8A8E92;
    text-align: center;
    padding: 8px;
}

.mjc-pop .mjc-qr {
    width: 180px;
    height: 180px;
    margin: 0 auto 12px;
}

/* ---------- 步骤 ---------- */
.mjc-steps {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: #B9BDC2;
    margin-bottom: 12px;
}

.mjc-steps b {
    font-family: ui-monospace, monospace;
    color: var(--g);
    font-weight: 500;
    margin-right: 6px;
}

/* ---------- 微信号行 ---------- */
.mjc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--nl);
    padding-top: 10px;
    gap: 8px;
}

.mjc-row small {
    display: block;
    font-size: 10px;
    color: #6B7075;
}

.mjc-row code {
    font-family: ui-monospace, monospace;
    font-size: 13px;
    color: var(--t);
    background: none;
    padding: 0;
}

/* ---------- 按钮 ---------- */
.mjc-btn {
    border: 1px solid #2A2E32;
    background: transparent;
    color: var(--t);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mjc-btn:hover {
    border-color: var(--g);
}

.mjc-part {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
    background: var(--n);
}

.mjc-hours {
    font-size: 11px;
    color: #6B7075;
    margin-top: 10px;
}

/* ---------- 移动端底部栏 ---------- */
.mjc-bar {
    display: none;
}

/* ---------- 遮罩 ---------- */
.mjc-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 9994;
    display: none;
}

/* ---------- 移动端底部弹层 ---------- */
.mjc-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9995;
    background: var(--n2);
    color: var(--t);
    border-top: 1px solid var(--g);
    border-radius: 16px 16px 0 0;
    padding: 12px 16px calc(22px + env(safe-area-inset-bottom));
    transform: translateY(105%);
    transition: transform .25s;
}

.mjc-sheet.open {
    transform: none;
}

.mjc-grab {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #3A3F44;
    margin: 0 auto 10px;
}

.mjc-sh-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mjc-sh-top h4 {
    margin: 0;
    font-size: 17px;
    color: var(--t);
}

.mjc-sh-top small {
    font-size: 12px;
    color: var(--m);
}

.mjc-x {
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--m);
}

.mjc-big {
    background: var(--n);
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
    text-align: center;
}

.mjc-big .mjc-qr {
    width: 190px;
    height: 190px;
    margin: 0 auto 10px;
}

.mjc-hint {
    font-size: 14px;
    color: var(--g);
    font-weight: 500;
}

.mjc-hint2 {
    font-size: 12px;
    color: var(--m);
    margin-top: 4px;
}

/* ---------- 底部弹层操作按钮 ---------- */
.mjc-acts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mjc-acts button,
.mjc-acts a {
    height: 54px;
    border-radius: 8px;
    border: 1px solid #2A2E32;
    background: transparent;
    color: var(--t);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
}

.mjc-acts .mjc-g {
    background: var(--g);
    color: var(--n);
    border: 0;
    font-weight: 700;
}

/* ---------- Toast 提示 ---------- */
.mjc-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    background: var(--n);
    color: var(--t);
    border: 1px solid var(--nl);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    white-space: nowrap;
}

.mjc-toast.on {
    opacity: 1;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 760px) {
    .mjc-rail {
        display: none;
    }

    .mjc-bar {
        display: grid;
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 8px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9990;
        background: var(--n);
        border-top: 1px solid var(--nl);
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    }

    .mjc-bar.mjc-prod {
        grid-template-columns: 1fr 1.4fr;
    }

    .mjc-bar button,
    .mjc-bar a {
        height: 50px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-decoration: none;
        border: 1px solid #2A2E32;
        background: transparent;
        color: var(--t);
    }

    .mjc-bar .mjc-wxb {
        background: var(--g);
        border: 0;
        color: var(--n);
    }

    .mjc-bar.mjc-prod .mjc-wxb {
        background: transparent;
        border: 1.5px solid var(--g);
        color: var(--g);
    }

    .mjc-bar .mjc-cart {
        background: var(--g);
        border: 0;
        color: var(--n);
    }

    body.mjc-pad {
        padding-bottom: 78px !important;
    }
}
