.caca-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #0f0b15;
    color: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .24);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.caca-chat-launcher svg {
    width: 28px;
    height: 28px;
}

.caca-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 360px;
    height: 520px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
    z-index: 9998;
    display: none;
    overflow: hidden;
}

.caca-chat-panel.open {
    display: flex;
    flex-direction: column;
}

.caca-chat-header {
    height: 62px;
    padding: 0 18px;
    background: #0f0b15;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.caca-chat-title {
    font-size: 15px;
    font-weight: 800;
}

.caca-chat-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: rgba(255,255,255,.7);
}

.caca-chat-close {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.caca-chat-body {
    flex: 1;
    padding: 16px;
    background: #f8fafc;
    overflow-y: auto;
}

.caca-chat-empty {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.caca-chat-msg {
    display: flex;
    margin-bottom: 12px;
}

.caca-chat-msg.visitor {
    justify-content: flex-end;
}

.caca-chat-msg.staff,
.caca-chat-msg.system {
    justify-content: flex-start;
}

.caca-chat-bubble {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.caca-chat-msg.visitor .caca-chat-bubble {
    background: #0f0b15;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.caca-chat-msg.staff .caca-chat-bubble,
.caca-chat-msg.system .caca-chat-bubble {
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.caca-chat-time {
    margin-top: 5px;
    font-size: 11px;
    opacity: .62;
}

.caca-chat-footer {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.caca-chat-form {
    display: flex;
    gap: 8px;
}

.caca-chat-input {
    flex: 1;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
    font-size: 13px;
}

.caca-chat-input:focus {
    border-color: #0f0b15;
}

.caca-chat-send {
    width: 68px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: #0f0b15;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.caca-chat-send:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .caca-chat-launcher {
        right: 16px;
        bottom: 16px;
    }

    .caca-chat-panel {
        right: 12px;
        left: 12px;
        bottom: 86px;
        width: auto;
        height: 520px;
        max-height: calc(100vh - 110px);
    }
}

/* Chat launcher with text label */
.caca-chat-launcher {
    width: auto;
    min-width: 132px;
    height: 52px;
    border-radius: 999px;
    padding: 0 18px;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .1px;
}

.caca-chat-launcher svg {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
}

.caca-chat-label {
    display: inline-block;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .caca-chat-launcher {
        min-width: 118px;
        height: 48px;
        padding: 0 15px;
        right: 14px;
        bottom: 14px;
        font-size: 13px;
    }

    .caca-chat-launcher svg {
        width: 21px;
        height: 21px;
    }
}

/* Chat launcher waving hand */
.caca-chat-launcher {
    overflow: visible;
}

.caca-chat-wave {
    position: absolute;
    right: 18px;
    top: -36px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    line-height: 1;
    opacity: 0;
    transform: translateY(8px) scale(.82) rotate(0deg);
    transform-origin: 70% 70%;
    pointer-events: none;
    animation: cacaChatWaveCycle 11s infinite;
}

.caca-chat-panel.open ~ .caca-chat-launcher .caca-chat-wave,
body.caca-chat-open .caca-chat-wave {
    display: none;
}

@keyframes cacaChatWaveCycle {
    0%, 62%, 100% {
        opacity: 0;
        transform: translateY(8px) scale(.82) rotate(0deg);
    }

    66% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }

    70% {
        opacity: 1;
        transform: translateY(0) scale(1.04) rotate(18deg);
    }

    74% {
        opacity: 1;
        transform: translateY(0) scale(1.04) rotate(-14deg);
    }

    78% {
        opacity: 1;
        transform: translateY(0) scale(1.04) rotate(18deg);
    }

    82% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }

    88% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }

    94% {
        opacity: 0;
        transform: translateY(8px) scale(.86) rotate(0deg);
    }
}

@media (max-width: 560px) {
    .caca-chat-wave {
        right: 14px;
        top: -34px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

/* Animated chat pet */
.caca-chat-wave {
    display: none !important;
}

.caca-chat-pet {
    position: absolute;
    right: 14px;
    top: -72px;
    width: 58px;
    height: 72px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(18px) scale(.86);
    animation: cacaPetAppear 12s infinite;
}

body.caca-chat-open .caca-chat-pet {
    display: none;
}

.caca-pet-shadow {
    position: absolute;
    left: 13px;
    bottom: 1px;
    width: 34px;
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .18);
    filter: blur(1px);
    animation: cacaPetShadow 12s infinite;
}

.caca-pet-body {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 44px;
    height: 48px;
    border-radius: 18px 18px 16px 16px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .20);
    animation: cacaPetFloat 12s infinite;
}

.caca-pet-ear {
    position: absolute;
    top: -9px;
    width: 15px;
    height: 16px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-bottom: 0;
    border-radius: 12px 12px 3px 3px;
}

.caca-pet-ear-left {
    left: 6px;
    transform: rotate(-18deg);
}

.caca-pet-ear-right {
    right: 6px;
    transform: rotate(18deg);
}

.caca-pet-eye {
    position: absolute;
    top: 18px;
    width: 5px;
    height: 7px;
    border-radius: 50%;
    background: #0f0b15;
    animation: cacaPetBlink 3.8s infinite;
}

.caca-pet-eye-left {
    left: 13px;
}

.caca-pet-eye-right {
    right: 13px;
}

.caca-pet-mouth {
    position: absolute;
    left: 50%;
    top: 30px;
    width: 10px;
    height: 5px;
    border-bottom: 2px solid #0f0b15;
    border-radius: 0 0 12px 12px;
    transform: translateX(-50%);
}

.caca-pet-arm {
    position: absolute;
    right: -12px;
    top: 18px;
    width: 19px;
    height: 9px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-left: 0;
    border-radius: 0 999px 999px 0;
    transform-origin: 0 50%;
    animation: cacaPetArmWave 12s infinite;
}

.caca-pet-arm::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -5px;
    width: 8px;
    height: 15px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #0f0b15;
}

@keyframes cacaPetAppear {
    0%, 54%, 100% {
        opacity: 0;
        transform: translateY(18px) scale(.86);
    }

    58%, 88% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    94% {
        opacity: 0;
        transform: translateY(10px) scale(.9);
    }
}

@keyframes cacaPetFloat {
    0%, 54%, 100% {
        transform: translateY(10px) rotate(0deg);
    }

    58% {
        transform: translateY(0) rotate(0deg);
    }

    64% {
        transform: translateY(-4px) rotate(-2deg);
    }

    70% {
        transform: translateY(0) rotate(2deg);
    }

    76% {
        transform: translateY(-3px) rotate(-1deg);
    }

    82%, 88% {
        transform: translateY(0) rotate(0deg);
    }

    94% {
        transform: translateY(8px) rotate(0deg);
    }
}

@keyframes cacaPetArmWave {
    0%, 58%, 88%, 100% {
        transform: rotate(0deg);
    }

    61% {
        transform: rotate(-28deg);
    }

    64% {
        transform: rotate(24deg);
    }

    67% {
        transform: rotate(-30deg);
    }

    70% {
        transform: rotate(22deg);
    }

    73% {
        transform: rotate(-24deg);
    }

    76% {
        transform: rotate(10deg);
    }

    80% {
        transform: rotate(0deg);
    }
}

@keyframes cacaPetBlink {
    0%, 88%, 100% {
        transform: scaleY(1);
    }

    91%, 94% {
        transform: scaleY(.12);
    }
}

@keyframes cacaPetShadow {
    0%, 54%, 100% {
        opacity: 0;
        transform: scale(.8);
    }

    58%, 88% {
        opacity: 1;
        transform: scale(1);
    }

    94% {
        opacity: 0;
        transform: scale(.86);
    }
}

@media (max-width: 560px) {
    .caca-chat-pet {
        right: 10px;
        top: -68px;
        transform: translateY(16px) scale(.82);
    }
}

/* ================================
   Round white assistant override
   ================================ */

/* 不再使用旧的 emoji wave */
.caca-chat-wave {
    display: none !important;
}

/* 小助手一直在按钮上方 */
.caca-chat-pet {
    position: absolute;
    right: 18px;
    top: -74px;
    width: 64px;
    height: 78px;
    pointer-events: none;
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    animation: cacaHelperMove 7.5s ease-in-out infinite;
}

/* 聊天窗口打开后，为了避免干扰，先隐藏 */
body.caca-chat-open .caca-chat-pet {
    display: none;
}

/* 阴影跟着左右轻微移动 */
.caca-pet-shadow {
    position: absolute;
    left: 15px;
    bottom: 2px;
    width: 34px;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .16);
    filter: blur(1px);
    animation: cacaHelperShadow 7.5s ease-in-out infinite;
}

/* 白色圆圆身体 */
.caca-pet-body {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0f0b15;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .18);
    animation: cacaHelperFloat 7.5s ease-in-out infinite;
}

/* 去掉“动物耳朵” */
.caca-pet-ear {
    display: none !important;
}

/* 眼睛 */
.caca-pet-eye {
    position: absolute;
    top: 16px;
    width: 5px;
    height: 7px;
    border-radius: 50%;
    background: #0f0b15;
    animation: cacaHelperBlink 4s infinite;
}

.caca-pet-eye-left {
    left: 13px;
}

.caca-pet-eye-right {
    right: 13px;
}

/* 微笑 */
.caca-pet-mouth {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 12px;
    height: 6px;
    border-bottom: 2px solid #0f0b15;
    border-radius: 0 0 12px 12px;
    transform: translateX(-50%);
}

/* 小手 */
.caca-pet-arm {
    position: absolute;
    right: -11px;
    top: 17px;
    width: 18px;
    height: 9px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-left: 0;
    border-radius: 0 999px 999px 0;
    transform-origin: 0 50%;
    animation: cacaHelperWave 7.5s ease-in-out infinite;
}

.caca-pet-arm::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -5px;
    width: 8px;
    height: 15px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #0f0b15;
}

/* 主动作：几秒一个循环
   0-20% 静止轻浮动
   20-38% 往左跑一点
   38-56% 往右跑一点
   56-70% 回中间
   70-88% 招手
   88-100% 回到平静状态
*/
@keyframes cacaHelperMove {
    0%, 18% {
        transform: translateX(0) translateY(0) scale(1);
    }
    28% {
        transform: translateX(-10px) translateY(-2px) scale(1.02);
    }
    38% {
        transform: translateX(-14px) translateY(0) scale(1);
    }
    48% {
        transform: translateX(10px) translateY(-2px) scale(1.02);
    }
    58% {
        transform: translateX(14px) translateY(0) scale(1);
    }
    68% {
        transform: translateX(0) translateY(-1px) scale(1.01);
    }
    78% {
        transform: translateX(0) translateY(-2px) scale(1.02);
    }
    88% {
        transform: translateX(0) translateY(0) scale(1);
    }
    100% {
        transform: translateX(0) translateY(0) scale(1);
    }
}

/* 身体轻微上下浮动 */
@keyframes cacaHelperFloat {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-2px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-3px);
    }
}

/* 阴影轻微变化 */
@keyframes cacaHelperShadow {
    0%, 100% {
        transform: translateX(0) scale(1);
        opacity: .16;
    }
    28% {
        transform: translateX(-8px) scale(.96);
        opacity: .13;
    }
    58% {
        transform: translateX(8px) scale(.96);
        opacity: .13;
    }
    78% {
        transform: translateX(0) scale(.94);
        opacity: .12;
    }
}

/* 眨眼 */
@keyframes cacaHelperBlink {
    0%, 86%, 100% {
        transform: scaleY(1);
    }
    90%, 93% {
        transform: scaleY(.12);
    }
}

/* 招手动作：只在循环后段明显触发 */
@keyframes cacaHelperWave {
    0%, 69%, 100% {
        transform: rotate(0deg);
    }
    73% {
        transform: rotate(-28deg);
    }
    76% {
        transform: rotate(24deg);
    }
    79% {
        transform: rotate(-30deg);
    }
    82% {
        transform: rotate(22deg);
    }
    85% {
        transform: rotate(-18deg);
    }
    88% {
        transform: rotate(10deg);
    }
    91% {
        transform: rotate(0deg);
    }
}

@media (max-width: 560px) {
    .caca-chat-pet {
        right: 10px;
        top: -70px;
        width: 60px;
        height: 74px;
    }

    .caca-pet-body {
        width: 42px;
        height: 42px;
        left: 10px;
        bottom: 10px;
    }
}

/* =====================================
   Desktop pet v2 override
   ===================================== */

.caca-chat-launcher {
    overflow: visible;
}

.caca-chat-hint {
    position: absolute;
    right: 8px;
    top: -54px;
    max-width: 150px;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(8px) scale(.94);
    pointer-events: none;
    transition: all .28s ease;
}

.caca-chat-hint::after {
    content: "";
    position: absolute;
    right: 26px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transform: rotate(45deg);
}

.caca-chat-launcher.show-hint .caca-chat-hint {
    opacity: 1;
    transform: translateY(0) scale(1);
}

body.caca-chat-open .caca-chat-hint {
    display: none;
}

.caca-chat-pet {
    position: absolute;
    right: 18px;
    top: -76px;
    width: 66px;
    height: 80px;
    pointer-events: none;
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    animation: cacaPetRun 8s ease-in-out infinite;
}

.caca-pet-shadow {
    position: absolute;
    left: 16px;
    bottom: 3px;
    width: 34px;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .16);
    filter: blur(1px);
    animation: cacaPetRunShadow 8s ease-in-out infinite;
}

.caca-pet-body {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0f0b15;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .18);
    animation: cacaPetBodyMotion 8s ease-in-out infinite;
}

.caca-pet-ear {
    display: none !important;
}

.caca-pet-eye {
    position: absolute;
    top: 16px;
    width: 5px;
    height: 7px;
    border-radius: 50%;
    background: #0f0b15;
    transform: translateX(0) scaleY(1);
    animation: cacaPetBlinkV2 4.2s infinite;
    transition: transform .18s ease;
}

.caca-pet-eye-left {
    left: 13px;
}

.caca-pet-eye-right {
    right: 13px;
}

.caca-pet-mouth {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 12px;
    height: 6px;
    border-bottom: 2px solid #0f0b15;
    border-radius: 0 0 12px 12px;
    transform: translateX(-50%);
    transition: transform .18s ease;
}

.caca-pet-arm {
    position: absolute;
    right: -11px;
    top: 17px;
    width: 18px;
    height: 9px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-left: 0;
    border-radius: 0 999px 999px 0;
    transform-origin: 0 50%;
    animation: cacaPetWaveV2 8s ease-in-out infinite;
}

.caca-pet-arm::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -5px;
    width: 8px;
    height: 15px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #0f0b15;
}

/* 悬停按钮时，小助手看向按钮 */
.caca-chat-launcher:hover .caca-pet-eye-left {
    transform: translateX(2px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-eye-right {
    transform: translateX(2px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-mouth {
    transform: translateX(-50%) translateY(1px);
}

.caca-chat-launcher:hover .caca-pet-body {
    transform: translateY(-2px) rotate(3deg);
}

/* 主动作：
   0-18% 平静
   18-34% 向左跑 + 小弹跳
   34-50% 向右跑 + 小弹跳
   50-62% 回中间
   62-72% 先探头看看
   72-90% 招手
   90-100% 平静
*/
@keyframes cacaPetRun {
    0%, 16%, 100% {
        transform: translateX(0) translateY(0) scale(1);
    }
    22% {
        transform: translateX(-8px) translateY(-4px) scale(1.02);
    }
    28% {
        transform: translateX(-14px) translateY(0) scale(1);
    }
    34% {
        transform: translateX(-10px) translateY(-5px) scale(1.02);
    }
    40% {
        transform: translateX(8px) translateY(0) scale(1);
    }
    46% {
        transform: translateX(14px) translateY(-5px) scale(1.02);
    }
    52% {
        transform: translateX(8px) translateY(0) scale(1);
    }
    58% {
        transform: translateX(0) translateY(-2px) scale(1.01);
    }
    66% {
        transform: translateX(2px) translateY(-1px) scale(1.02);
    }
    72% {
        transform: translateX(0) translateY(0) scale(1);
    }
    90% {
        transform: translateX(0) translateY(-2px) scale(1.02);
    }
}

@keyframes cacaPetRunShadow {
    0%, 16%, 100% {
        transform: translateX(0) scale(1);
        opacity: .16;
    }
    28% {
        transform: translateX(-8px) scale(.95);
        opacity: .12;
    }
    46% {
        transform: translateX(8px) scale(.95);
        opacity: .12;
    }
    66% {
        transform: translateX(1px) scale(.97);
        opacity: .13;
    }
    90% {
        transform: translateX(0) scale(.94);
        opacity: .12;
    }
}

@keyframes cacaPetBodyMotion {
    0%, 16%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    22% {
        transform: translateY(-2px) rotate(-4deg);
    }
    28% {
        transform: translateY(0) rotate(-2deg);
    }
    34% {
        transform: translateY(-2px) rotate(-4deg);
    }
    40% {
        transform: translateY(0) rotate(2deg);
    }
    46% {
        transform: translateY(-2px) rotate(4deg);
    }
    52% {
        transform: translateY(0) rotate(2deg);
    }
    62% {
        transform: translateY(-1px) rotate(0deg);
    }
    68% {
        transform: translateX(2px) rotate(6deg);
    }
    72% {
        transform: translateX(0) rotate(0deg);
    }
    90% {
        transform: translateY(-2px) rotate(-1deg);
    }
}

/* 探头感：眼睛和嘴微偏 */
@keyframes cacaPetBlinkV2 {
    0%, 86%, 100% {
        scale: 1 1;
    }
    90%, 93% {
        scale: 1 .12;
    }
}

@keyframes cacaPetWaveV2 {
    0%, 71%, 100% {
        transform: rotate(0deg);
    }
    74% {
        transform: rotate(-30deg);
    }
    77% {
        transform: rotate(24deg);
    }
    80% {
        transform: rotate(-32deg);
    }
    83% {
        transform: rotate(24deg);
    }
    86% {
        transform: rotate(-20deg);
    }
    89% {
        transform: rotate(10deg);
    }
    92% {
        transform: rotate(0deg);
    }
}

/* 在探头阶段，给头部一个微倾斜的视觉 */
.caca-chat-pet .caca-pet-body::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

/* 移动端适配 */
@media (max-width: 560px) {
    .caca-chat-pet {
        right: 10px;
        top: -72px;
        width: 62px;
        height: 76px;
    }

    .caca-pet-body {
        width: 42px;
        height: 42px;
        left: 10px;
        bottom: 10px;
    }

    .caca-chat-hint {
        right: 2px;
        top: -50px;
        font-size: 11px;
        max-width: 132px;
        padding: 7px 10px;
    }
}

/* =====================================
   Desktop pet v3: bigger hand + look down
   ===================================== */

/* 手臂加粗、加长，让它更像伸出来的大手 */
.caca-pet-arm {
    right: -20px;
    top: 15px;
    width: 28px;
    height: 13px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-left: 0;
    border-radius: 0 999px 999px 0;
    transform-origin: 0 55%;
    animation: cacaPetBigHandWave 8s ease-in-out infinite;
}

/* 大手掌 */
.caca-pet-arm::after {
    content: "";
    position: absolute;
    right: -12px;
    top: -10px;
    width: 20px;
    height: 26px;
    border-radius: 14px 14px 13px 13px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    transform: rotate(7deg);
}

/* 手指线条，让它更像人类的手 */
.caca-pet-arm::before {
    content: "";
    position: absolute;
    right: -8px;
    top: -7px;
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: #0f0b15;
    box-shadow:
        5px 0 0 #0f0b15,
        10px 2px 0 #0f0b15;
    opacity: .92;
    z-index: 2;
    transform: rotate(7deg);
}

/* 更大幅度招手 */
@keyframes cacaPetBigHandWave {
    0%, 68%, 100% {
        transform: rotate(0deg);
    }

    72% {
        transform: rotate(-52deg);
    }

    75% {
        transform: rotate(42deg);
    }

    78% {
        transform: rotate(-56deg);
    }

    81% {
        transform: rotate(44deg);
    }

    84% {
        transform: rotate(-42deg);
    }

    87% {
        transform: rotate(30deg);
    }

    90% {
        transform: rotate(-18deg);
    }

    93% {
        transform: rotate(0deg);
    }
}

/* 鼠标悬停时：眼睛往下看 */
.caca-chat-launcher:hover .caca-pet-eye-left {
    transform: translate(1px, 6px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-eye-right {
    transform: translate(1px, 6px) scaleY(1);
}

/* 鼠标悬停时：嘴巴也往下移动 */
.caca-chat-launcher:hover .caca-pet-mouth {
    transform: translateX(-50%) translateY(6px);
}

/* 鼠标悬停时：身体轻微低头，看起来更像向下看按钮 */
.caca-chat-launcher:hover .caca-pet-body {
    transform: translateY(2px) rotate(5deg);
}

/* 鼠标悬停时：手稍微收一点，避免视觉太乱 */
.caca-chat-launcher:hover .caca-pet-arm {
    animation-play-state: paused;
    transform: rotate(-18deg);
}

/* 悬停时眼睛更灵动一点 */
.caca-chat-launcher:hover .caca-pet-eye {
    height: 6px;
}

/* 移动端手稍微收一点，避免超出屏幕 */
@media (max-width: 560px) {
    .caca-pet-arm {
        right: -17px;
        width: 24px;
        height: 12px;
    }

    .caca-pet-arm::after {
        right: -10px;
        top: -9px;
        width: 18px;
        height: 23px;
    }

    .caca-pet-arm::before {
        right: -7px;
        top: -6px;
        height: 16px;
        box-shadow:
            4px 0 0 #0f0b15,
            8px 2px 0 #0f0b15;
    }
}

/* =====================================
   Hand shape fix: make it look like a real hand
   ===================================== */

/* 前臂 */
.caca-pet-arm {
    right: -17px;
    top: 17px;
    width: 22px;
    height: 12px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-left: 0;
    border-radius: 0 999px 999px 0;
    transform-origin: 0 55%;
    animation: cacaPetBigHandWave 8s ease-in-out infinite;
    overflow: visible;
}

/* 手掌主体：圆润一点，像掌心 */
.caca-pet-arm::after {
    content: "";
    position: absolute;
    right: -11px;
    top: -6px;
    width: 20px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-radius: 12px 13px 12px 12px;
    transform: rotate(6deg);
    box-sizing: border-box;
}

/* 拇指：单独做一个鼓包，避免像杯口 */
.caca-pet-arm::before {
    content: "";
    position: absolute;
    right: 1px;
    top: 8px;
    width: 9px;
    height: 13px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-radius: 10px 10px 10px 10px;
    transform: rotate(36deg);
    box-sizing: border-box;
    z-index: 2;
}

/* 悬停时手稍微收一点，避免挡住脸 */
.caca-chat-launcher:hover .caca-pet-arm {
    animation-play-state: paused;
    transform: rotate(-16deg);
}

/* 移动端稍微缩一点 */
@media (max-width: 560px) {
    .caca-pet-arm {
        right: -15px;
        top: 17px;
        width: 20px;
        height: 11px;
    }

    .caca-pet-arm::after {
        right: -10px;
        top: -5px;
        width: 18px;
        height: 22px;
    }

    .caca-pet-arm::before {
        right: 1px;
        top: 8px;
        width: 8px;
        height: 12px;
    }
}

/* =====================================
   Final SVG hand shape
   ===================================== */

/* 不再用旧的 CSS 伪元素画手 */
.caca-pet-arm::before,
.caca-pet-arm::after {
    display: none !important;
    content: none !important;
}

/* 手的位置和挥手动画 */
.caca-pet-arm {
    position: absolute;
    right: -30px;
    top: 5px;
    width: 44px;
    height: 48px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible;
    transform-origin: 5px 36px;
    animation: cacaSvgHandWave 8s ease-in-out infinite;
}

/* SVG 手掌 */
.caca-hand-svg {
    position: absolute;
    right: -6px;
    top: -4px;
    width: 48px;
    height: 48px;
    overflow: visible;
}

/* 手掌白底黑边 */
.caca-hand-fill {
    fill: #ffffff;
    stroke: #0f0b15;
    stroke-width: 3.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* 手指分割线 */
.caca-hand-line {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 2.4;
    stroke-linecap: round;
    opacity: .95;
}

/* 挥手幅度更明显，但不会变形 */
@keyframes cacaSvgHandWave {
    0%, 68%, 100% {
        transform: rotate(0deg);
    }

    72% {
        transform: rotate(-58deg);
    }

    75% {
        transform: rotate(46deg);
    }

    78% {
        transform: rotate(-62deg);
    }

    81% {
        transform: rotate(48deg);
    }

    84% {
        transform: rotate(-46deg);
    }

    87% {
        transform: rotate(32deg);
    }

    91% {
        transform: rotate(-12deg);
    }

    94% {
        transform: rotate(0deg);
    }
}

/* 鼠标悬停时暂停在一个自然招呼姿势 */
.caca-chat-launcher:hover .caca-pet-arm {
    animation-play-state: paused;
    transform: rotate(-20deg);
}

/* 移动端略小一点 */
@media (max-width: 560px) {
    .caca-pet-arm {
        right: -26px;
        top: 6px;
        width: 40px;
        height: 44px;
    }

    .caca-hand-svg {
        width: 44px;
        height: 44px;
    }
}

/* =====================================
   Arm + hand direction fix
   ===================================== */

/* 整个手臂容器：从脸右侧伸出去 */
.caca-pet-arm {
    position: absolute;
    right: -34px;
    top: 8px;
    width: 74px;
    height: 42px;
    background: transparent !important;
    border: 0 !important;
    overflow: visible;
    z-index: 1;
    transform-origin: 10px 24px;
    animation: cacaSvgHandWaveArm 8s ease-in-out infinite;
}

/* 手臂：一条白色圆角“前臂” */
.caca-pet-arm::before {
    content: "";
    display: block !important;
    position: absolute;
    left: 2px;
    top: 17px;
    width: 42px;
    height: 14px;
    background: #ffffff;
    border: 2px solid #0f0b15;
    border-radius: 999px;
    transform: rotate(-18deg);
    box-sizing: border-box;
    z-index: 1;
}

/* 不使用 after */
.caca-pet-arm::after {
    display: none !important;
    content: none !important;
}

/* 手掌 SVG 放在手臂末端 */
.caca-hand-svg {
    position: absolute;
    right: 0;
    top: -2px;
    width: 42px;
    height: 42px;
    overflow: visible;
    z-index: 2;
    transform: rotate(-8deg);
}

/* 手掌样式沿用 */
.caca-hand-fill {
    fill: #ffffff;
    stroke: #0f0b15;
    stroke-width: 3.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.caca-hand-line {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 2.4;
    stroke-linecap: round;
    opacity: .95;
}

/* 新的挥手动画：整条手臂带着手一起摆动 */
@keyframes cacaSvgHandWaveArm {
    0%, 68%, 100% {
        transform: rotate(0deg);
    }

    72% {
        transform: rotate(-16deg);
    }

    76% {
        transform: rotate(12deg);
    }

    80% {
        transform: rotate(-18deg);
    }

    84% {
        transform: rotate(13deg);
    }

    88% {
        transform: rotate(-10deg);
    }

    92% {
        transform: rotate(0deg);
    }
}

/* 鼠标放上去时，停在一个自然的招呼姿势 */
.caca-chat-launcher:hover .caca-pet-arm {
    animation-play-state: paused;
    transform: rotate(-10deg);
}

/* 移动端稍微缩一点 */
@media (max-width: 560px) {
    .caca-pet-arm {
        right: -30px;
        top: 9px;
        width: 66px;
        height: 38px;
    }

    .caca-pet-arm::before {
        width: 37px;
        height: 13px;
        top: 16px;
    }

    .caca-hand-svg {
        width: 38px;
        height: 38px;
        top: -1px;
    }
}

/* =====================================
   Final arm + hand integrated SVG
   ===================================== */

/* 禁掉旧的 CSS 手型，避免叠加 */
.caca-pet-arm::before,
.caca-pet-arm::after {
    display: none !important;
    content: none !important;
}

/* 让脸在前，手臂从脸后面伸出来 */
.caca-pet-body {
    z-index: 3;
}

/* 整条手臂容器 */
.caca-pet-arm {
    position: absolute;
    right: -78px;
    top: -2px;
    width: 108px;
    height: 82px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible;
    z-index: 2;
    transform-origin: 12px 60px;
    animation: cacaFinalArmWave 8s ease-in-out infinite;
}

/* SVG 占满容器 */
.caca-hand-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 108px;
    height: 82px;
    overflow: visible;
    transform: none !important;
}

/* 手臂黑色外轮廓 */
.caca-arm-outline {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 18;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 手臂白色内芯 */
.caca-arm-fill {
    fill: none;
    stroke: #ffffff;
    stroke-width: 13;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 手掌 */
.caca-hand-fill {
    fill: #ffffff;
    stroke: #0f0b15;
    stroke-width: 3.6;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* 手指线 */
.caca-hand-line {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 终版招手：整条手臂一起摆，幅度自然一点 */
@keyframes cacaFinalArmWave {
    0%, 67%, 100% {
        transform: rotate(0deg);
    }

    71% {
        transform: rotate(-12deg);
    }

    75% {
        transform: rotate(10deg);
    }

    79% {
        transform: rotate(-15deg);
    }

    83% {
        transform: rotate(12deg);
    }

    87% {
        transform: rotate(-8deg);
    }

    91% {
        transform: rotate(4deg);
    }

    94% {
        transform: rotate(0deg);
    }
}

/* 鼠标悬停时，手臂停在自然招呼姿势 */
.caca-chat-launcher:hover .caca-pet-arm {
    animation-play-state: paused;
    transform: rotate(-8deg);
}

/* 移动端稍微缩小 */
@media (max-width: 560px) {
    .caca-pet-arm {
        right: -68px;
        top: 0;
        width: 96px;
        height: 74px;
        transform-origin: 10px 54px;
    }

    .caca-hand-svg {
        width: 96px;
        height: 74px;
    }

    .caca-arm-outline {
        stroke-width: 16;
    }

    .caca-arm-fill {
        stroke-width: 11;
    }
}

/* =====================================
   Final fix: arm is sibling of face
   ===================================== */

/* 外层允许手臂露出 */
.caca-chat-pet {
    overflow: visible !important;
}

/* 禁掉所有旧的 CSS 伪元素手型，避免叠加 */
.caca-pet-arm::before,
.caca-pet-arm::after {
    display: none !important;
    content: none !important;
}

/* 阴影在最下面 */
.caca-pet-shadow {
    z-index: 1;
}

/* 手臂作为 body 的兄弟节点，放在脸后面 */
.caca-pet-arm {
    position: absolute;

    /* 关键：肩膀落在圆脸右侧 */
    left: 34px;
    top: -12px;

    width: 112px;
    height: 82px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible;

    /* 现在它和 body 是兄弟节点，z-index 才能真正躲到脸后面 */
    z-index: 4;

    transform-origin: 18px 58px;
    transform: rotate(0deg);

    animation: cacaArmIdleWave 8s ease-in-out infinite;
}

/* 圆脸压在手臂上方 */
.caca-pet-body {
    z-index: 5 !important;
    overflow: visible;
}

/* 眼睛嘴巴在脸的最上层 */
.caca-pet-eye,
.caca-pet-mouth {
    z-index: 6;
}

/* SVG 手臂整体 */
.caca-hand-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 112px;
    height: 82px;
    overflow: visible;
    transform: none !important;
}

/* 手臂黑色外轮廓 */
.caca-arm-outline {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 18;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 手臂白色内芯 */
.caca-arm-fill {
    fill: none;
    stroke: #ffffff;
    stroke-width: 13;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 手掌 */
.caca-hand-fill {
    fill: #ffffff;
    stroke: #0f0b15;
    stroke-width: 3.6;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* 手指线 */
.caca-hand-line {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 默认每隔一段时间主动招手 */
@keyframes cacaArmIdleWave {
    0%, 67%, 100% {
        transform: rotate(0deg);
    }

    71% {
        transform: rotate(13deg);
    }

    75% {
        transform: rotate(-8deg);
    }

    79% {
        transform: rotate(15deg);
    }

    83% {
        transform: rotate(-10deg);
    }

    87% {
        transform: rotate(10deg);
    }

    91% {
        transform: rotate(0deg);
    }
}

/* 鼠标悬停时更积极地招手 */
@keyframes cacaArmHoverWave {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(16deg);
    }

    50% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(14deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.caca-chat-launcher:hover .caca-pet-arm {
    animation: cacaArmHoverWave 1.2s ease-in-out infinite;
}

/* 悬停时眼睛和嘴向下看 */
.caca-chat-launcher:hover .caca-pet-eye-left {
    transform: translate(1px, 6px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-eye-right {
    transform: translate(1px, 6px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-mouth {
    transform: translateX(-50%) translateY(6px);
}

/* 悬停时身体轻微低头，但不能创建混乱层级 */
.caca-chat-launcher:hover .caca-pet-body {
    transform: translateY(2px) rotate(5deg);
}

/* 移动端适配 */
@media (max-width: 560px) {
    .caca-pet-arm {
        left: 30px;
        top: -10px;
        width: 98px;
        height: 72px;
        transform-origin: 16px 52px;
    }

    .caca-hand-svg {
        width: 98px;
        height: 72px;
    }

    .caca-arm-outline {
        stroke-width: 16;
    }

    .caca-arm-fill {
        stroke-width: 11;
    }
}

/* =====================================
   Final arm position fix
   手臂移出 body 后，重新校准位置
   ===================================== */

/* 外层小助手 */
.caca-chat-pet {
    overflow: visible !important;
}

/* 圆脸在前 */
.caca-pet-body {
    z-index: 5 !important;
}

/* 手臂在脸后，从右侧中上部伸出 */
.caca-pet-arm {
    left: 32px !important;
    top: 12px !important;

    width: 104px !important;
    height: 76px !important;

    z-index: 4 !important;
    overflow: visible !important;

    transform-origin: 16px 46px !important;
    animation: cacaArmIdleWaveFixed 8s ease-in-out infinite !important;
}

/* SVG 跟随手臂容器 */
.caca-hand-svg {
    left: 0 !important;
    top: 0 !important;
    width: 104px !important;
    height: 76px !important;
    overflow: visible !important;
    transform: none !important;
}

/* 手臂轮廓稍微收一点，避免盖住脸 */
.caca-arm-outline {
    stroke-width: 15 !important;
}

.caca-arm-fill {
    stroke-width: 10.5 !important;
}

/* 手掌保持清晰 */
.caca-hand-fill {
    stroke-width: 3.4 !important;
}

.caca-hand-line {
    stroke-width: 2.3 !important;
}

/* 重新定义招手动画，避免继承前面旧动画角度 */
@keyframes cacaArmIdleWaveFixed {
    0%, 67%, 100% {
        transform: rotate(0deg);
    }

    71% {
        transform: rotate(12deg);
    }

    75% {
        transform: rotate(-7deg);
    }

    79% {
        transform: rotate(14deg);
    }

    83% {
        transform: rotate(-9deg);
    }

    87% {
        transform: rotate(8deg);
    }

    91% {
        transform: rotate(0deg);
    }
}

/* 鼠标悬停时更明显地招手 */
@keyframes cacaArmHoverWaveFixed {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(15deg);
    }

    50% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(13deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.caca-chat-launcher:hover .caca-pet-arm {
    animation: cacaArmHoverWaveFixed 1.2s ease-in-out infinite !important;
}

/* 移动端稍微再收一点 */
@media (max-width: 560px) {
    .caca-pet-arm {
        left: 29px !important;
        top: 13px !important;
        width: 94px !important;
        height: 70px !important;
        transform-origin: 14px 43px !important;
    }

    .caca-hand-svg {
        width: 94px !important;
        height: 70px !important;
    }

    .caca-arm-outline {
        stroke-width: 14 !important;
    }

    .caca-arm-fill {
        stroke-width: 10 !important;
    }
}

/* =====================================
   Hand move to LEFT + raise a little
   ===================================== */

/* 手臂容器：从脸左侧伸出，并整体上提一点 */
.caca-pet-arm {
    left: -66px !important;
    right: auto !important;
    top: 2px !important;

    width: 104px !important;
    height: 76px !important;

    z-index: 4 !important;
    overflow: visible !important;

    /* 左侧招手，关节原点放到靠右位置 */
    transform-origin: 88px 46px !important;
    animation: cacaArmIdleWaveLeft 8s ease-in-out infinite !important;
}

/* SVG 翻转到左边 */
.caca-hand-svg {
    left: 0 !important;
    top: 0 !important;
    width: 104px !important;
    height: 76px !important;
    overflow: visible !important;
    transform: scaleX(-1) !important;
    transform-origin: center center !important;
}

/* 默认待机招手：左边方向，角度反过来 */
@keyframes cacaArmIdleWaveLeft {
    0%, 67%, 100% {
        transform: rotate(0deg);
    }

    71% {
        transform: rotate(-12deg);
    }

    75% {
        transform: rotate(7deg);
    }

    79% {
        transform: rotate(-14deg);
    }

    83% {
        transform: rotate(9deg);
    }

    87% {
        transform: rotate(-8deg);
    }

    91% {
        transform: rotate(0deg);
    }
}

/* 鼠标悬停时更明显地招手，方向同样反过来 */
@keyframes cacaArmHoverWaveLeft {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg);
    }

    50% {
        transform: rotate(8deg);
    }

    75% {
        transform: rotate(-13deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.caca-chat-launcher:hover .caca-pet-arm {
    animation: cacaArmHoverWaveLeft 1.2s ease-in-out infinite !important;
}

/* 移动端也同步改到左边，并略微上提 */
@media (max-width: 560px) {
    .caca-pet-arm {
        left: -60px !important;
        right: auto !important;
        top: 3px !important;
        width: 94px !important;
        height: 70px !important;
        transform-origin: 80px 43px !important;
    }

    .caca-hand-svg {
        width: 94px !important;
        height: 70px !important;
    }
}

/* =====================================
   Final glove style based on reference
   ===================================== */

/* 手臂在左边，位置沿用你现在基本正确的布局，再略提一点 */
.caca-pet-arm {
    left: -78px !important;
    right: auto !important;
    top: -6px !important;

    width: 132px !important;
    height: 98px !important;

    z-index: 4 !important;
    overflow: visible !important;

    /* 左侧挥手，关节原点放到靠右下 */
    transform-origin: 108px 72px !important;
    animation: cacaGloveWaveIdle 8s ease-in-out infinite !important;
}

/* SVG 镜像到左边 */
.caca-hand-svg {
    position: absolute;
    left: 0 !important;
    top: 0 !important;
    width: 132px !important;
    height: 98px !important;
    overflow: visible !important;
    transform: scaleX(-1) !important;
    transform-origin: center center !important;

    /* 轻微阴影，让它更像你图里的柔和立体感 */
    filter: drop-shadow(0 2px 2px rgba(15, 11, 21, 0.10));
}

/* 粗黑描边的手臂外轮廓 */
.caca-arm-outline {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 22 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 白色手臂内芯 */
.caca-arm-fill {
    fill: none;
    stroke: #ffffff;
    stroke-width: 16 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 手掌：圆润手套风格 */
.caca-hand-fill {
    fill: #ffffff;
    stroke: #0f0b15;
    stroke-width: 4.6 !important;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* 手掌褶线，保持极简 */
.caca-hand-crease {
    fill: none;
    stroke: #0f0b15;
    stroke-width: 3.4 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .95;
}

/* 去掉旧的手指线影响 */
.caca-hand-line {
    display: none !important;
}

/* 待机挥手：幅度自然，不要太机械 */
@keyframes cacaGloveWaveIdle {
    0%, 67%, 100% {
        transform: rotate(0deg);
    }

    71% {
        transform: rotate(-11deg);
    }

    75% {
        transform: rotate(7deg);
    }

    79% {
        transform: rotate(-13deg);
    }

    83% {
        transform: rotate(8deg);
    }

    87% {
        transform: rotate(-7deg);
    }

    91% {
        transform: rotate(0deg);
    }
}

/* 悬停时招手更明显 */
@keyframes cacaGloveWaveHover {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg);
    }

    50% {
        transform: rotate(10deg);
    }

    75% {
        transform: rotate(-13deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.caca-chat-launcher:hover .caca-pet-arm {
    animation: cacaGloveWaveHover 1.15s ease-in-out infinite !important;
}

/* 悬停时脸往下看，保留你现在满意的交互 */
.caca-chat-launcher:hover .caca-pet-eye-left {
    transform: translate(1px, 6px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-eye-right {
    transform: translate(1px, 6px) scaleY(1);
}

.caca-chat-launcher:hover .caca-pet-mouth {
    transform: translateX(-50%) translateY(6px);
}

.caca-chat-launcher:hover .caca-pet-body {
    transform: translateY(2px) rotate(5deg);
}

/* 移动端稍微缩小 */
@media (max-width: 560px) {
    .caca-pet-arm {
        left: -70px !important;
        top: -4px !important;
        width: 118px !important;
        height: 88px !important;
        transform-origin: 96px 64px !important;
    }

    .caca-hand-svg {
        width: 118px !important;
        height: 88px !important;
    }

    .caca-arm-outline {
        stroke-width: 20 !important;
    }

    .caca-arm-fill {
        stroke-width: 14 !important;
    }

    .caca-hand-fill {
        stroke-width: 4.2 !important;
    }

    .caca-hand-crease {
        stroke-width: 3 !important;
    }
}

/* =====================================
   Temporary hide arm + hand
   ===================================== */
.caca-pet-arm,
.caca-hand-svg,
.caca-arm-outline,
.caca-arm-fill,
.caca-hand-fill,
.caca-hand-line,
.caca-hand-crease {
    display: none !important;
}


/* =========================================================
   Chat unread badge and notification
   ========================================================= */

.caca-chat-launcher {
    position: fixed;
}

.caca-chat-unread-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 6;
    min-width: 21px;
    height: 21px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 12px;
    color: #fff;
    background: #fa5151;
    box-shadow:
        0 4px 12px
        rgba(250, 81, 81, .36);
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    pointer-events: none;
}

.caca-chat-unread-badge.show {
    display: flex;
    animation:
        cacaUnreadBadgePop
        .28s ease-out;
}

.caca-chat-launcher.has-unread {
    animation:
        cacaUnreadLauncherPulse
        2.6s ease-in-out infinite;
}

.caca-chat-unread-notice {
    position: absolute;
    top: 50%;
    right: calc(100% + 14px);
    z-index: 7;
    width: max-content;
    max-width: 220px;
    padding: 10px 13px;
    border: 1px solid #eceef1;
    border-radius: 10px;
    color: #24282d;
    background: #fff;
    box-shadow:
        0 12px 32px
        rgba(15, 23, 42, .18);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    transform:
        translateY(-50%)
        translateX(10px)
        scale(.96);
    transform-origin: right center;
    pointer-events: none;
    transition:
        opacity .22s ease,
        transform .22s ease;
}

.caca-chat-unread-notice::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -7px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-top: 1px solid #eceef1;
    border-right: 1px solid #eceef1;
    transform:
        translateY(-50%)
        rotate(45deg);
}

.caca-chat-unread-notice.show {
    opacity: 1;
    transform:
        translateY(-50%)
        translateX(0)
        scale(1);
}

@keyframes cacaUnreadBadgePop {
    0% {
        transform: scale(.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes cacaUnreadLauncherPulse {
    0%,
    70%,
    100% {
        box-shadow:
            0 16px 38px
            rgba(15, 23, 42, .24);
    }

    82% {
        box-shadow:
            0 16px 38px
            rgba(15, 23, 42, .24),
            0 0 0 8px
            rgba(250, 81, 81, .10);
    }
}

body.caca-chat-open
.caca-chat-unread-notice {
    display: none;
}

@media (max-width: 560px) {
    .caca-chat-unread-badge {
        top: -6px;
        right: -6px;
    }

    .caca-chat-unread-notice {
        right: calc(100% + 11px);
        max-width: 180px;
        padding: 9px 11px;
        font-size: 12px;
    }
}
