.ww-kefu-actions {
    --ww-kefu-accent: #b63b52;
    --ww-kefu-accent-contrast: #fff;
    position: fixed;
    right: 12px;
    bottom: 88px;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.ww-kefu-launch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 22px;
    background: var(--ww-kefu-accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    color: var(--ww-kefu-accent-contrast);
    font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    cursor: pointer;
}

.ww-kefu-launch--wechat {
    color: #fff;
    background: #159447;
}

.ww-kefu-launch--recent-order {
    color: #fff;
    background: #d96815;
    text-decoration: none;
}

.f-mobile-dock .ww-mobile-account__order-badge {
    display: none;
}

.ww-kefu-launch.is-pending {
    cursor: progress;
}

.ww-kefu-launch.is-pending .ww-kefu-launch__icon {
    animation: ww-kefu-pulse .9s ease-in-out infinite alternate;
}

.ww-kefu-launch.has-timeout {
    animation: ww-kefu-shake .28s ease-in-out 2;
}

.ww-kefu-launch__icon {
    position: relative;
    flex: 0 0 20px;
    width: 20px;
    height: 18px;
}

.ww-kefu-launch__icon--chat::before {
    position: absolute;
    inset: 1px 1px 3px;
    border: 2px solid currentColor;
    border-radius: 8px;
    clip-path: polygon(0 0, 100% 0, 100% 78%, 61% 78%, 45% 100%, 43% 78%, 0 78%);
    content: "";
}

.ww-kefu-launch__icon--wechat::before,
.ww-kefu-launch__icon--wechat::after {
    position: absolute;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    content: "";
}

.ww-kefu-launch__icon--recent-order::before {
    position: absolute;
    inset: 0 2px;
    border: 2px solid currentColor;
    border-radius: 3px;
    box-sizing: border-box;
    content: "";
}

.ww-kefu-launch__icon--recent-order {
    font-size: 0;
}

.ww-kefu-launch__icon--recent-order::after {
    position: absolute;
    top: 5px;
    right: 5px;
    left: 5px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 5px 0 currentColor;
    content: "";
}

.ww-kefu-launch__icon--wechat::before {
    top: 0;
    left: 0;
    width: 14px;
    height: 12px;
}

.ww-kefu-launch__icon--wechat::after {
    right: 0;
    bottom: 0;
    width: 12px;
    height: 10px;
}

.ww-kefu-launch:focus-visible,
.ww-kefu-launch--recent-order:focus-visible,
.ww-kefu-close:focus-visible,
.ww-kefu-wechat-copy:focus-visible,
.ww-kefu-wechat-chat:focus-visible {
    outline: 3px solid rgba(215, 25, 32, .35);
    outline-offset: 3px;
}

.ww-kefu-layer[hidden],
.ww-kefu-wechat-layer[hidden] {
    display: none !important;
}

.ww-kefu-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: rgba(0, 0, 0, .34);
}

.ww-kefu-panel {
    position: relative;
    width: 100%;
    height: 72%;
    height: 72dvh;
    max-height: calc(100% - 96px);
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .24);
}

.ww-kefu-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

@keyframes ww-kefu-pulse {
    to { opacity: .45; transform: scale(.86); }
}

@keyframes ww-kefu-shake {
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.ww-kefu-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #333;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
    font: 28px/36px Arial, sans-serif;
    cursor: pointer;
}

.ww-kefu-wechat-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .34);
}

.ww-kefu-wechat-card {
    position: relative;
    width: min(100%, 360px);
    padding: 30px 24px 24px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
    color: #333;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.ww-kefu-wechat-card h2 {
    margin: 0 0 10px;
    color: #159447;
    font-size: 21px;
}

.ww-kefu-wechat-card p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.ww-kefu-wechat-account {
    display: block;
    margin: 14px 0;
    color: #d71920;
    font-size: 23px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ww-kefu-wechat-copy,
.ww-kefu-wechat-chat {
    width: 100%;
    min-height: 42px;
    margin-top: 8px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    font: 600 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    cursor: pointer;
}

.ww-kefu-wechat-copy {
    background: #159447;
}

.ww-kefu-wechat-copy:disabled {
    opacity: .55;
    cursor: wait;
}

.ww-kefu-wechat-chat {
    color: #d71920;
    background: transparent;
}

.ww-kefu-wechat-status {
    min-height: 23px;
    color: #159447 !important;
}

@media (max-width: 767px) {
    header a[aria-label="购物车"],
    nav[aria-label="首页快捷操作"] a[aria-label="购物车"] {
        display: none !important;
    }

    nav[aria-label="手机快捷导航"] a[href="/cart.php"],
    nav[aria-label="商品购买操作"] a[href="/cart.php"],
    .mobile-bottom-bar a[href="/cart.php"] {
        position: relative;
        overflow: visible;
    }

    .ww-cart-count-badge {
        position: absolute;
        top: 2px;
        left: 50%;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border: 2px solid #fff;
        border-radius: 9px;
        color: #fff;
        background: #e53935;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
        font: 700 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
        box-sizing: border-box;
        pointer-events: none;
        transform: translateX(10px);
    }

    .ww-cart-count-badge[hidden] {
        display: none !important;
    }

    .ww-kefu-actions {
        right: 10px;
        bottom: calc(70px + env(safe-area-inset-bottom));
        gap: 6px;
    }

    .ww-kefu-launch {
        position: relative;
        width: 40px;
        min-height: 40px;
        justify-content: center;
        gap: 0;
        padding: 0;
        box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    }

    .ww-kefu-actions[data-site-kind="regional"] .ww-kefu-launch {
        border: 1px solid rgba(255, 255, 255, .5);
        border-radius: 12px;
    }

    .ww-kefu-actions[data-site-kind="independent"] .ww-kefu-launch {
        border-radius: 50%;
    }

    .ww-kefu-launch__icon {
        flex-basis: 18px;
        width: 18px;
        height: 17px;
    }

    .ww-kefu-launch__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (max-width: 900px) {
    .f-mobile-dock a.ww-mobile-account--recent-order {
        position: relative;
        overflow: visible;
    }

    .f-mobile-dock .ww-mobile-account__order-badge {
        position: absolute;
        top: 2px;
        left: 50%;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 30px;
        height: 17px;
        padding: 0 5px;
        border: 2px solid #fff;
        border-radius: 10px;
        color: #fff;
        background: #e53935;
        box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
        font: 700 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
        letter-spacing: 0;
        pointer-events: none;
        transform: translateX(7px);
    }
}

@media (min-width: 768px) {
    .ww-kefu-actions {
        right: 20px;
        bottom: 120px;
    }

    .ww-kefu-layer {
        align-items: center;
    }

    .ww-kefu-panel {
        width: min(100%, 500px);
        height: 90%;
        max-height: none;
        margin: auto 20px auto 0;
        border-radius: 12px;
        box-shadow: -6px 0 24px rgba(0, 0, 0, .24);
    }
}

@media print {
    .ww-kefu-actions,
    .ww-kefu-layer,
    .ww-kefu-wechat-layer,
    .ww-mobile-account__order-badge {
        display: none !important;
    }
}
