/* CSS */
.top-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgb(20, 20, 20);
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 0px 0px 4px rgba(180, 160, 255, 0.253);
    cursor: pointer;
    transition-duration: 0.3s;
    overflow: hidden;
    position: fixed;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    pointer-events: none;
}

.svgIcon {
    width: 12px;
    transition: all 0.3s ease;
    /* 平滑过渡 */
}

.svgIcon path {
    fill: white;
}

.top-button:hover {
    width: 140px;
    border-radius: 50px;
    transition-duration: 0.3s;
    background-color: transparent;
}

/* 优化箭头动画 */
.top-button:hover .svgIcon {
    opacity: 0;
    /* 淡出 */
    transform: translateY(-100%) scale(0.8);
    /* 平滑向上移并缩小 */
}

/* 文字样式 */
.top-button::before {
    position: absolute;
    content: "回到星空";
    color: black;
    font-size: 0px;
    opacity: 0;
    transition: all 0.3s ease;
    /* 平滑过渡 */
}

/* 悬停时文字动画 */
.top-button:hover::before {
    font-size: 20px;
    opacity: 1;
    transition-delay: 0.1s;
    /* 稍微延迟文字出现 */
}

/* 点击动画 */
.top-button:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

/* 显示状态 */
.top-button.visible {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* 可选：悬浮动画 */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.top-button.visible:not(:hover) {
    animation: float 2s ease-in-out infinite;
}