.cs-support-pet {
    --cs-pet-frame-width: 96px;
    --cs-pet-frame-height: 104px;
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 108px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #172b4d;
    text-decoration: none;
    filter: drop-shadow(0 10px 18px #172b4d24);
    transition: transform .18s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}
.cs-support-pet[hidden] { display: none; }
.cs-support-pet:hover { color: #3563e9; text-decoration: none; transform: translateY(-3px); }
.cs-support-pet:focus-visible { border-radius: 14px; outline: 3px solid #9bb0f5; outline-offset: 4px; }
.cs-support-pet__bubble {
    position: relative;
    z-index: 1;
    margin-bottom: -2px;
    padding: 6px 12px;
    border: 1px solid #e5ebf3;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 7px 20px #172b4d1a;
    color: inherit;
    font: 600 12px/18px -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    white-space: nowrap;
}
.cs-support-pet__bubble::after {
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 1px solid #e5ebf3;
    border-bottom: 1px solid #e5ebf3;
    background: #fff;
    content: "";
    transform: translateX(-50%) rotate(45deg);
}
.cs-support-pet__sprite {
    display: block;
    flex-shrink: 0;
    width: var(--cs-pet-frame-width);
    height: var(--cs-pet-frame-height);
    background: url("./support-pet.webp") 0 0 / calc(var(--cs-pet-frame-width) * 8) calc(var(--cs-pet-frame-height) * 9) no-repeat;
    pointer-events: none;
    animation: cs-support-pet-idle 4.8s step-end infinite;
}
@keyframes cs-support-pet-idle {
    0%, 16.66% { background-position: 0 0; }
    16.67%, 33.32% { background-position: calc(var(--cs-pet-frame-width) * -1) 0; }
    33.33%, 49.99% { background-position: calc(var(--cs-pet-frame-width) * -2) 0; }
    50%, 66.65% { background-position: calc(var(--cs-pet-frame-width) * -3) 0; }
    66.66%, 83.32% { background-position: calc(var(--cs-pet-frame-width) * -4) 0; }
    83.33%, 100% { background-position: calc(var(--cs-pet-frame-width) * -5) 0; }
}
@media (max-width: 768px) {
    .cs-support-pet {
        --cs-pet-frame-width: 80px;
        --cs-pet-frame-height: 86.6667px;
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(72px + env(safe-area-inset-bottom));
        width: 92px;
    }
    .cs-support-pet[data-support-scope="home"],
    .cs-support-pet[data-support-scope="shop"] { bottom: calc(32px + env(safe-area-inset-bottom)); }
    .cs-support-pet__bubble { padding: 5px 10px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .cs-support-pet { transition: none; }
    .cs-support-pet:hover { transform: none; }
    .cs-support-pet__sprite { animation: none; }
}
