#social-floating-btn {
    position: fixed !important;
    bottom: 6% !important;
    right: 6% !important;
    z-index: 9999 !important;
    /* 防止 CLS：確保固定位置元素有明確尺寸 */
    width: 60px;
    height: 60px;
    /* 防止初始渲染時的位移 */
    visibility: visible;
    opacity: 1;
    /* 確保不受父元素影響 */
    transform: none !important;
}
#social-floating-btn .social-links {
    display: flex;
    flex-direction: column;
    align-items:center;
    gap: 10px;
    margin-bottom: 10px;
    /* 優化動態元素：使用 transform 和 opacity，避免觸發重排 */
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    /* 防止 CLS：預留空間 */
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 50px;
    min-height: 0;
    /* 使用 will-change 提示瀏覽器優化 */
    will-change: opacity, transform;
}
#social-floating-btn .social-links.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#social-floating-btn .social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s;
}
#social-floating-btn .social-links a img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

#social-floating-btn .main-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    padding: 7px;
    box-shadow: 0 2px 4px rgba(36, 24, 24, 0.2);
    background-color: #f7ebeb;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 優化動態元素：使用固定尺寸，避免觸發重排 */
    flex-shrink: 0;
    /* 優化動態元素：使用 transform 進行動畫，避免觸發重排 */
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

#social-floating-btn .main-btn:active {
    transform: scale(0.95);
}
#social-floating-btn .main-btn img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    opacity: 0.9;
}
@media (max-width: 576px) {
  #social-floating-btn {
    right: 30px;
    bottom: 30px;
  }
}