/* ========== 悬浮按钮优化（参考 ChatGPT/Notion） ========== */

/* 主悬浮按钮 - 右下角 */
.fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

/* AI 悬浮按钮 - 避开主按钮，放在左侧或上方 */
.fab.secondary {
    right: 24px;
    bottom: 96px; /* 主按钮上方 */
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.fab.secondary:hover {
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.6);
    transform: scale(1.1) rotate(-10deg);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .fab {
        right: 16px;
        bottom: 80px; /* 避开移动端底部导航 */
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .fab.secondary {
        bottom: 145px;
        width: 50px;
        height: 50px;
    }
}

/* 在 AI 视图、编辑器、预览时隐藏 AI FAB */
.view.active#view-ai ~ .fab#aiFab,
body:has(#editorModal.active) .fab#aiFab,
body:has(#previewModalBg.active) .fab#aiFab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

/* 提示气泡 */
.fab::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.fab:hover::before {
    opacity: 1;
}

/* FAB 组合 - 多按钮展开效果 */
.fab-group {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 1000;
}

.fab-group .fab {
    position: relative;
    right: 0;
    bottom: 0;
}
