/* 按钮容器 - 固定在右侧 */
#toTop,
#toBottom {
    position: fixed;
    right: 20px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: white;  /* 纯白色背景 */
    color: #000;  /* 黑色字体 */
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 各自垂直位置 */
#toTop {
    bottom: 140px;
}

#toBottom {
    bottom: 80px;
}

/* 悬浮效果 */
#toTop:hover,
#toBottom:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 25px rgba(33, 150, 243, 0.6);
    background: #1976D2;  /* 深蓝色悬浮 */
}

/* 点击效果 */
#toTop:active,
#toBottom:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* 适配暗色主题 - 如果页面有 .dark 类则自动适配 */
.dark #toTop,
.dark #toBottom {
    background: #1565C0;  /* 暗色模式下的蓝色 */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    color: #000;  /* 保持黑色字体 */
}

.dark #toTop:hover,
.dark #toBottom:hover {
    background: #0D47A1;  /* 暗色模式悬浮更深蓝色 */
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.7);
}

/* 移动端适配 */
@media (max-width: 768px) {
    #toTop,
    #toBottom {
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    #toTop {
        bottom: 115px;
    }

    #toBottom {
        bottom: 65px;
    }
}

/* 小屏手机进一步适配 */
@media (max-width: 480px) {
    #toTop,
    #toBottom {
        right: 8px;
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    #toTop {
        bottom: 100px;
    }

    #toBottom {
        bottom: 55px;
    }
}

/* 可选：鼠标移出时的平滑恢复 */
#toTop,
#toBottom {
    will-change: transform;
}