/* AI智能编辑悬浮按钮样式 */

.ai-smart-edit-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 0;
    width: 42px;
    height: 42px;
    cursor: pointer;
    box-shadow: 
        0 3px 12px rgba(102, 126, 234, 0.25),
        0 1px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    transform: translateY(12px) scale(0.85);
    pointer-events: none;
    backdrop-filter: blur(6px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.ai-smart-edit-button.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-smart-edit-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 
        0 6px 18px rgba(102, 126, 234, 0.35),
        0 3px 9px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ai-smart-edit-button:active {
    transform: translateY(-1px) scale(0.96);
    box-shadow: 
        0 3px 9px rgba(102, 126, 234, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.1s ease;
}

.ai-smart-edit-button .material-icons {
    font-size: 18px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    line-height: 1;
    font-weight: 400;
}

/* 确保结果区域有相对定位以便悬浮按钮定位 */
.result-section {
    position: relative;
}

/* 暗色主题适配 */
[data-theme="dark"] .ai-smart-edit-button {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
    box-shadow: 
        0 3px 12px rgba(76, 81, 191, 0.3),
        0 1px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .ai-smart-edit-button:hover {
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
    box-shadow: 
        0 6px 18px rgba(76, 81, 191, 0.4),
        0 3px 9px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .ai-smart-edit-button:active {
    box-shadow: 
        0 3px 9px rgba(76, 81, 191, 0.35),
        0 1px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ai-smart-edit-button {
        bottom: 16px;
        right: 16px;
        width: 38px;
        height: 38px;
    }

    .ai-smart-edit-button .material-icons {
        font-size: 16px;
    }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .ai-smart-edit-button {
        width: 36px;
        height: 36px;
        bottom: 14px;
        right: 14px;
    }

    .ai-smart-edit-button .material-icons {
        font-size: 14px;
    }
}

/* 焦点和可访问性 */
.ai-smart-edit-button:focus {
    outline: 2px solid var(--primary-color, #2563EB);
    outline-offset: 2px;
}

.ai-smart-edit-button:focus:not(:focus-visible) {
    outline: none;
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .ai-smart-edit-button {
        transition: none;
    }

    .ai-smart-edit-button.show {
        transform: none;
    }

    .ai-smart-edit-button:hover {
        transform: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .ai-smart-edit-button {
        background: #000;
        border: 2px solid #fff;
    }
    
    [data-theme="dark"] .ai-smart-edit-button {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}