/* ==================== 性能优化CSS - 减少GPU使用 ==================== */

/* 禁用所有不必要的动画和过渡效果 */
.performance-mode * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    backdrop-filter: none !important;
    filter: none !important;
}

/* 保留必要的基础过渡效果，但使用更高效的属性 */
.performance-mode .banned-word-modal {
    transition: opacity 0.15s ease !important;
}

.performance-mode .banned-word-dialog {
    backdrop-filter: blur(5px) !important;
    transition: opacity 0.15s ease !important;
}

.performance-mode .banned-word-btn {
    transition: background-color 0.1s ease !important;
}

/* 简化模态框动画 */
.performance-mode .banned-word-modal.show {
    opacity: 1;
    visibility: visible;
}

.performance-mode .banned-word-dialog {
    transform: none !important;
}

/* 移除所有keyframes动画 */
.performance-mode .status-message {
    animation: none !important;
}

.performance-mode .tooltip-avatar-ring {
    animation: none !important;
    opacity: 0 !important;
}

/* 简化用户提示框 */
.performance-mode .user-tooltip-card {
    backdrop-filter: blur(3px) !important;
    transition: opacity 0.1s ease !important;
    transform: none !important;
}

.performance-mode .user-tooltip-card.show {
    opacity: 1;
    transform: none !important;
}

/* 移除所有transform和复杂的视觉效果 */
.performance-mode .tooltip-avatar {
    transition: none !important;
}

/* 简化按钮悬停效果 */
.performance-mode .banned-word-btn:hover {
    transform: none !important;
}

/* 移除所有阴影效果以减少GPU负担 */
.performance-mode * {
    box-shadow: none !important;
    text-shadow: none !important;
}

/* 保留基本的边框和背景色 */
.performance-mode .banned-word-dialog {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.performance-mode .banned-word-btn.primary {
    background: #667eea;
    color: white;
}

.performance-mode .banned-word-btn.secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* 深色主题优化 */
body.dark-theme.performance-mode .banned-word-dialog {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(71, 85, 105, 0.5);
}

body.dark-theme.performance-mode .banned-word-btn.secondary {
    background: rgba(71, 85, 105, 0.9);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.5);
}

/* 消息相关优化 */
.performance-mode .message-item {
    animation: none !important;
    transition: none !important;
}

.performance-mode .chat-container {
    backdrop-filter: blur(3px) !important;
}

/* 图片查看器优化 */
.performance-mode .image-viewer {
    backdrop-filter: blur(3px) !important;
    transition: opacity 0.1s ease !important;
}

.performance-mode .image-viewer img {
    transition: none !important;
    transform: none !important;
}

/* 表情符号优化 */
.performance-mode .emoji-item {
    transition: none !important;
    transform: none !important;
}

.performance-mode .emoji-item:hover {
    transform: none !important;
}

/* 工作倒计时优化 */
.performance-mode .work-status {
    animation: none !important;
}

.performance-mode .progress-bar {
    transition: width 0.3s linear !important;
}

/* 通知优化 */
.performance-mode .notification {
    animation: none !important;
    transition: opacity 0.1s ease !important;
}

/* 模态框优化 */
.performance-mode .modal {
    backdrop-filter: blur(3px) !important;
    transition: opacity 0.1s ease !important;
}

.performance-mode .modal-content {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* 聊天消息优化 */
.performance-mode .message-bubble {
    backdrop-filter: none !important;
    transition: none !important;
}

.performance-mode .message-bubble:hover {
    transform: none !important;
}

/* 按钮和交互元素优化 */
.performance-mode button {
    transition: background-color 0.1s ease !important;
}

.performance-mode button:hover {
    transform: none !important;
}

/* 滚动条优化 */
.performance-mode ::-webkit-scrollbar-thumb {
    transition: background-color 0.1s ease !important;
}

/* 输入框优化 */
.performance-mode input,
.performance-mode textarea {
    transition: border-color 0.1s ease !important;
}

.performance-mode input:focus,
.performance-mode textarea:focus {
    transform: none !important;
}

/* 头像和用户相关优化 */
.performance-mode .user-avatar {
    transition: none !important;
}

.performance-mode .user-avatar:hover {
    transform: none !important;
}

/* 导航和菜单优化 */
.performance-mode .nav-item {
    transition: background-color 0.1s ease !important;
}

.performance-mode .nav-item:hover {
    transform: none !important;
}

/* 卡片和容器优化 */
.performance-mode .card {
    backdrop-filter: none !important;
    transition: none !important;
}

.performance-mode .card:hover {
    transform: none !important;
}

/* 加载动画优化 - 只保留必要的加载指示器 */
.performance-mode .loading-spinner {
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 媒体查询优化 */
@media (max-width: 768px) {
    .performance-mode * {
        animation: none !important;
        transition: none !important;
    }
    
    .performance-mode .banned-word-dialog {
        backdrop-filter: blur(2px) !important;
    }
}

/* 高对比度模式优化 */
@media (prefers-reduced-motion: reduce) {
    .performance-mode * {
        animation: none !important;
        transition: none !important;
    }
}

/* CPU使用优化 - 减少重绘和重排 */
.performance-mode .chat-messages {
    will-change: auto !important;
}

.performance-mode .message-item {
    will-change: auto !important;
}

/* GPU图层优化 */
.performance-mode * {
    will-change: auto !important;
    transform: none !important;
    transform3d: none !important;
}

/* 字体渲染优化 */
.performance-mode * {
    text-rendering: optimizeSpeed !important;
    font-smooth: never !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
}

/* 图片渲染优化 */
.performance-mode img {
    image-rendering: optimizeSpeed !important;
}

/* 滚动性能优化 */
.performance-mode .scrollable {
    scroll-behavior: auto !important;
}

/* 禁用硬件加速以减少GPU使用 */
.performance-mode * {
    -webkit-transform: none !important;
    -webkit-backface-visibility: visible !important;
    -webkit-perspective: none !important;
}