/**
 * 右米 · 微信客服 —— 兜底弹窗样式
 * 全部选择器限定在 .ym-wxkf 命名空间内，不触碰站点任何既有样式。
 */

html.ym-wxkf-lock,
html.ym-wxkf-lock body {
    overflow: hidden !important;
}

.ym-wxkf {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

.ym-wxkf[hidden] {
    display: none !important;
}

.ym-wxkf *,
.ym-wxkf *::before,
.ym-wxkf *::after {
    box-sizing: border-box;
}

.ym-wxkf__mask {
    position: absolute;
    inset: 0;
    background: rgba(10, 32, 27, 0.58);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: ym-wxkf-fade 0.22s ease both;
}

.ym-wxkf__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 392px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px 26px 22px;
    text-align: center;
    box-shadow: 0 26px 64px rgba(10, 32, 27, 0.28), 0 2px 8px rgba(10, 32, 27, 0.08);
    animation: ym-wxkf-pop 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ym-wxkf-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ym-wxkf-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 关闭按钮 */
.ym-wxkf__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f4f2ec;
    color: #6b7a72;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ym-wxkf__close:hover,
.ym-wxkf__close:focus-visible {
    background: #e9e4d8;
    color: #1c2b26;
    outline: none;
}

.ym-wxkf__close span {
    display: block;
    margin-top: -2px;
}

/* 头部 */
.ym-wxkf__head {
    padding: 0 8px;
}

.ym-wxkf__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: #e9f4f0;
    color: #0e6e5a;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.ym-wxkf__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1aad6a;
    box-shadow: 0 0 0 0 rgba(26, 173, 106, 0.5);
    animation: ym-wxkf-pulse 2s infinite;
    display: inline-block;
}

@keyframes ym-wxkf-pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 173, 106, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(26, 173, 106, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 173, 106, 0); }
}

.ym-wxkf__title {
    margin: 13px 0 7px;
    padding: 0;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    color: #1c2b26;
    letter-spacing: 0.01em;
}

.ym-wxkf__desc {
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.65;
    color: #7c8a84;
}

/* 二维码 */
.ym-wxkf__qrbox {
    margin: 18px 0 0;
}

.ym-wxkf__qr {
    display: block;
    width: 196px;
    height: 196px;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #ece6d8;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(10, 32, 27, 0.06);
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

.ym-wxkf__hint {
    margin: 10px 0 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #93a09a;
}

/* 电话 */
.ym-wxkf__phone {
    margin: 18px 0 0;
    padding-top: 15px;
    border-top: 1px dashed #e6e1d4;
}

.ym-wxkf__phone-label {
    display: block;
    font-size: 12px;
    color: #93a09a;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.ym-wxkf__phone-num {
    display: inline-block;
    font-size: 21px;
    font-weight: 700;
    color: #0e6e5a;
    text-decoration: none !important;
    letter-spacing: 0.03em;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.ym-wxkf__phone-num:hover,
.ym-wxkf__phone-num:focus {
    color: #0a4f41;
    text-decoration: none !important;
}

.ym-wxkf__more {
    display: inline-block;
    margin-top: 14px;
    font-size: 12px;
    color: #a8b1ac;
    text-decoration: none !important;
    border-bottom: 1px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.ym-wxkf__more:hover,
.ym-wxkf__more:focus {
    color: #0e6e5a;
    border-bottom-color: rgba(14, 110, 90, 0.4);
    text-decoration: none !important;
}

/* 移动端 */
@media (max-width: 480px) {
    .ym-wxkf {
        padding: 16px;
        align-items: center;
    }

    .ym-wxkf__dialog {
        padding: 26px 20px 18px;
        border-radius: 18px;
        max-width: 340px;
    }

    .ym-wxkf__title {
        font-size: 18px;
    }

    .ym-wxkf__qr {
        width: 172px;
        height: 172px;
    }

    .ym-wxkf__phone-num {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ym-wxkf__mask,
    .ym-wxkf__dialog,
    .ym-wxkf__dot {
        animation: none !important;
    }
}

/* -------------------------------------------------------------------------
 * 保险层：主题（Astra）对 button / a / h3 有全局 !important 规则，
 * 这里用更高特异性 + !important 兜住弹窗内部的视觉，避免被主题染色。
 * 仅作用于 .ym-wxkf 内部，不影响站点其它元素。
 * ---------------------------------------------------------------------- */

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close:hover,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close:active,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close:focus {
    background: #f4f2ec !important;
    background-color: #f4f2ec !important;
    background-image: none !important;
    color: #6b7a72 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none;
    padding: 0 !important;
    min-height: 0 !important;
    line-height: 1 !important;
    border-radius: 50% !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close:hover {
    background: #e9e4d8 !important;
    background-color: #e9e4d8 !important;
    color: #1c2b26 !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close:focus-visible {
    outline: 2px solid #0e6e5a;
    outline-offset: 2px;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__close span {
    color: inherit !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__title {
    color: #1c2b26 !important;
    font-size: 20px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    margin: 13px 0 7px !important;
    padding: 0 !important;
    text-align: center !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__desc,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__hint,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__phone-label {
    color: #7c8a84 !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__hint,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__phone-label {
    color: #93a09a !important;
    font-size: 12px !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__phone-num,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__phone-num:hover,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__phone-num:focus {
    color: #0e6e5a !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
    font-size: 21px !important;
    font-weight: 700 !important;
    background: none !important;
    box-shadow: none !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__more,
.ym-wxkf .ym-wxkf__dialog .ym-wxkf__more:hover {
    color: #a8b1ac !important;
    text-decoration: none !important;
    font-size: 12px !important;
    background: none !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__more:hover {
    color: #0e6e5a !important;
}

.ym-wxkf .ym-wxkf__dialog .ym-wxkf__qr {
    display: block !important;
    width: 196px !important;
    height: 196px !important;
    max-width: 100% !important;
    padding: 8px !important;
    background: #fff !important;
    border: 1px solid #ece6d8 !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(10, 32, 27, 0.06) !important;
    object-fit: contain !important;
}

@media (max-width: 480px) {
    .ym-wxkf .ym-wxkf__dialog .ym-wxkf__qr {
        width: 172px !important;
        height: 172px !important;
    }

    .ym-wxkf .ym-wxkf__dialog .ym-wxkf__title {
        font-size: 18px !important;
    }
}

