/* 客服二维码悬浮组件 by deploy 2026-10-29 */
#kefu-widget {
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99990;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.kefu-card {
    position: relative;
    width: 132px;
    padding: 14px 10px 10px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .04);
    cursor: pointer;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease;
    animation: kefu-halo 2.6s ease-out infinite;
}

.kefu-card:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22), 0 0 0 1px rgba(255, 138, 0, .35);
}

.kefu-card .kefu-qr {
    display: block;
    width: 112px;
    height: 112px;
    margin: 0 auto 8px;
    border-radius: 6px;
    -webkit-touch-callout: default;
    user-select: auto;
}

.kefu-card .kefu-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.kefu-card .kefu-sub {
    margin: 2px 0 0;
    font-size: 11px;
    color: #999;
    line-height: 1.4;
    white-space: nowrap;
}

/* 闪烁的小红点 + 在线标签 */
.kefu-live {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #ff5a3c;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    border-radius: 9px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255, 90, 60, .35);
}

.kefu-live i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    animation: kefu-blink 1.1s ease-in-out infinite;
}

@keyframes kefu-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .15; }
}

@keyframes kefu-halo {
    0%   { box-shadow: 0 6px 20px rgba(0, 0, 0, .16), 0 0 0 0 rgba(255, 138, 0, .45); }
    70%  { box-shadow: 0 6px 20px rgba(0, 0, 0, .16), 0 0 0 10px rgba(255, 138, 0, 0); }
    100% { box-shadow: 0 6px 20px rgba(0, 0, 0, .16), 0 0 0 0 rgba(255, 138, 0, 0); }
}

/* 放大弹层 */
.kefu-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0, 0, 0, .72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kefu-mask.kefu-show {
    display: flex;
}

.kefu-dialog {
    position: relative;
    width: min(340px, 86vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 16px 16px 14px;
    background: #fff;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    animation: kefu-pop .22s ease-out;
}

@keyframes kefu-pop {
    from { transform: scale(.92); opacity: .4; }
    to   { transform: scale(1); opacity: 1; }
}

.kefu-dialog .kefu-big {
    display: block;
    width: 100%;
    border-radius: 10px;
    -webkit-touch-callout: default;
    user-select: auto;
}

.kefu-dialog .kefu-modal-title {
    margin: 12px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #ff5a3c;
}

.kefu-dialog .kefu-modal-sub {
    margin: 4px 0 12px;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

.kefu-dialog .kefu-save {
    display: block;
    padding: 10px 0;
    background: #07c160;
    color: #fff;
    font-size: 14px;
    border-radius: 10px;
    text-decoration: none;
}

.kefu-dialog .kefu-save:hover {
    background: #06ad56;
    color: #fff;
}

.kefu-dialog .kefu-close {
    position: absolute;
    top: 6px;
    right: 10px;
    width: 28px;
    height: 28px;
    line-height: 26px;
    font-size: 22px;
    color: #bbb;
    cursor: pointer;
}

/* “企业微信，放心添加” 提示 */
.kefu-dialog .kefu-safe {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0 0;
    padding: 4px 11px;
    font-size: 12px;
    line-height: 1.6;
    color: #07894a;
    background: #eefaf3;
    border: 1px solid #cdeedd;
    border-radius: 999px;
    white-space: nowrap;
}

.kefu-dialog .kefu-safe i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    font-size: 9px;
    font-style: normal;
    color: #fff;
    background: #07c160;
    border-radius: 50%;
}

@media (max-width: 768px) {
    #kefu-widget {
        right: 6px;
        top: auto;
        bottom: 104px;
        transform: none;
    }

    .kefu-card {
        width: 92px;
        padding: 11px 5px 6px;
        border-radius: 11px;
    }

    .kefu-card .kefu-qr {
        width: 78px;
        height: 78px;
        margin-bottom: 5px;
    }

    .kefu-card .kefu-title {
        font-size: 10.5px;
    }

    .kefu-card .kefu-sub {
        font-size: 9px;
        transform: scale(.95);
        transform-origin: center;
    }

    .kefu-live {
        font-size: 9px;
        padding: 1px 6px;
        top: -8px;
    }
}
