/* ============================================================
   蓝色球体挂件 · 呼吸动画 + 百分比居中
   ============================================================ */

/* 隐藏原生滚动条 */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar {
    display: none;
}

/* 挂件容器 - 右移 */
.scroll-widget {
    position: fixed;
    right: 20px;
    top: 1rem;
    bottom: 8rem;
    width: 80px;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 球体容器 */
.scroll-ball {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    cursor: grab;
    pointer-events: auto;
    z-index: 10;
    touch-action: none;
    transition: top 0.08s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 呼吸光晕 */
.scroll-ball-glow {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    /* background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%); */
    background: radial-gradient(circle, rgba(6, 150, 222, 0.15), transparent 70%);
    animation: breatheGlow 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes breatheGlow {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.3; 
    }
    50% { 
        transform: scale(1.25); 
        opacity: 0.8; 
    }
}

/* 球体主体 */
.scroll-ball-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: radial-gradient(circle at 32% 28%, #60a5fa, #3b82f6 45%, #2563eb 75%, #1d4ed8 100%); */
    background: radial-gradient(circle at 32% 28%, #bad7f1, #54bdea 45%, #194ef0 75%, #0066f5 100%);
    box-shadow: 
        0 4px 30px rgba(59, 130, 246, 0.4),
        0 8px 50px rgba(59, 130, 246, 0.15),
        inset -10px -10px 25px rgba(0, 0, 0, 0.15),
        inset 6px 6px 25px rgba(255, 255, 255, 0.2);
    animation: breatheBall 2.5s ease-in-out infinite;
    transition: all 0.3s ease;
    cursor: grab;
}

/* 球体呼吸动画 */
@keyframes breatheBall {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 
            0 4px 30px rgba(59, 130, 246, 0.4),
            0 8px 50px rgba(59, 130, 246, 0.15),
            inset -10px -10px 25px rgba(0, 0, 0, 0.15),
            inset 6px 6px 25px rgba(255, 255, 255, 0.2);
    }
    50% { 
        transform: scale(1.2); 
        box-shadow: 
            0 6px 40px rgba(59, 130, 246, 0.5),
            0 12px 60px rgba(59, 130, 246, 0.2),
            inset -10px -10px 25px rgba(0, 0, 0, 0.15),
            inset 6px 6px 25px rgba(255, 255, 255, 0.25);
    }
}

/* 球体高光 */
.scroll-ball-inner::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 15%;
    width: 38%;
    height: 26%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.5), transparent 70%);
    border-radius: 50%;
    transform: rotate(-25deg);
    pointer-events: none;
}

/* 球体次高光 */
.scroll-ball-inner::after {
    content: '';
    position: absolute;
    bottom: 18%;
    right: 15%;
    width: 14%;
    height: 12%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.15), transparent 70%);
    border-radius: 50%;
    transform: rotate(15deg);
    pointer-events: none;
}

/* 悬停效果 */
.scroll-ball:hover .scroll-ball-inner {
    animation-play-state: paused;
    transform: scale(1.08);
    box-shadow: 
        0 6px 40px rgba(59, 130, 246, 0.5),
        0 12px 60px rgba(59, 130, 246, 0.25),
        inset -10px -10px 25px rgba(0, 0, 0, 0.15),
        inset 6px 6px 25px rgba(255, 255, 255, 0.25);
}

/* 拖拽中 */
.scroll-ball:active .scroll-ball-inner {
    animation-play-state: paused;
    transform: scale(0.93);
    box-shadow: 
        0 2px 20px rgba(59, 130, 246, 0.5),
        0 6px 30px rgba(59, 130, 246, 0.2),
        inset -8px -8px 20px rgba(0, 0, 0, 0.2),
        inset 4px 4px 20px rgba(255, 255, 255, 0.1);
}
.scroll-ball:active {
    cursor: grabbing;
}

/* 百分比文字 - 居中显示在球体上 */
.scroll-progress {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .scroll-widget {
        right: 10px;
        width: 50px;
    }
    .scroll-ball {
        width: 48px;
        height: 48px;
    }
    .scroll-progress {
        font-size: 13px;
    }
    .scroll-ball-glow {
        inset: -10px;
    }
}