/* Floating Toolbar Styles */
.floating-toolbar {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* 移除 overflow: hidden 以允许二维码弹出层显示 */
}

.toolbar-item {
    width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
    border-top: 1px solid #f1f5f9; /* 改用上边框 */
    position: relative;
    background: white;
}

.toolbar-item:first-child {
    border-top: none; /* 第一个元素不需要上边框 */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.toolbar-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.toolbar-item:hover {
    background-color: #f8fafc;
    color: #4f46e5;
}

.toolbar-item i {
    font-size: 20px;
}

.toolbar-item .label {
    font-size: 10px;
    margin-top: 2px;
    font-weight: bold;
}

/* WeChat QR Code Popup */
.wechat-qr {
    position: absolute;
    right: 65px;
    bottom: 0;
    width: 160px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10000;
    animation: fadeInRight 0.3s ease-out;
}

.wechat-qr::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(-45deg);
}

.toolbar-item.wechat:hover .wechat-qr {
    display: block;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Back to Top Button Visibility with Smooth Shrink Effect */
#back-to-top {
    height: 52px; /* 始终显示高度 */
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc; /* 默认浅色背景 */
    color: #94a3b8; /* 默认灰色图标 */
    border-top: 1px solid #f1f5f9;
}

#back-to-top.active {
    background: #f0f7ff;
    color: #2563eb;
}

#back-to-top.active:hover {
    background: #2563eb;
    color: white;
}

#back-to-top i {
    border-top: 2px solid currentColor;
    padding-top: 2px;
}

/* Toast Notification (Matching Space Weather Tool Style) */
.toolbar-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

.toolbar-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toolbar-toast i {
    color: #4ade80;
    font-size: 16px;
}
@media (max-width: 640px) {
    .floating-toolbar {
        right: 10px;
        bottom: 60px;
    }
    .toolbar-item {
        width: 44px;
        height: 44px;
    }
    .toolbar-item i {
        font-size: 18px;
    }
    .wechat-qr {
        right: 55px;
        width: 140px;
    }
    #back-to-top.visible {
        height: 44px;
    }
}
