/**
 * 性能模式样式
 * 
 * 三种模式的CSS规则：
 * - normal: 默认，所有效果开启
 * - smooth: 减少动画和特效
 * - turbo: 禁用所有非必要动画
 */

/* ==================== CSS变量默认值 ==================== */
:root {
    --animation-duration: 0.3s;
    --transition-duration: 0.3s;
}

/* ==================== 常规模式（默认） ==================== */
body.performance-normal {
    /* 保持所有默认效果 */
}

/* ==================== 流畅模式 ==================== */
body.performance-smooth {
    --animation-duration: 0.15s;
    --transition-duration: 0.1s;
}

/* 禁用毛玻璃效果 */
body.performance-smooth .glass-card,
body.performance-smooth .card,
body.performance-smooth .modal-content,
body.performance-smooth [style*="backdrop-filter"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 简化阴影 */
body.performance-smooth .card,
body.performance-smooth .btn,
body.performance-smooth .stat-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 减少过渡动画 */
body.performance-smooth * {
    transition-duration: 0.1s !important;
}

/* 禁用悬停缩放 */
body.performance-smooth .card:hover,
body.performance-smooth .btn:hover,
body.performance-smooth .stat-card:hover {
    transform: none !important;
}

/* ==================== 极速模式 ==================== */
body.performance-turbo {
    --animation-duration: 0s;
    --transition-duration: 0s;
}

/* 禁用所有动画 */
body.performance-turbo *,
body.performance-turbo *::before,
body.performance-turbo *::after {
    animation: none !important;
    animation-duration: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
}

/* 禁用毛玻璃 */
body.performance-turbo .glass-card,
body.performance-turbo .card,
body.performance-turbo .modal-content,
body.performance-turbo [style*="backdrop-filter"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 禁用复杂阴影 */
body.performance-turbo .card,
body.performance-turbo .btn,
body.performance-turbo .stat-card,
body.performance-turbo .modal-content {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* 禁用渐变背景（可选，保留基本美观） */
/*
body.performance-turbo [style*="linear-gradient"] {
    background: #667eea !important;
}
*/

/* 隐藏粒子画布 */
body.performance-turbo #particleCanvas {
    display: none !important;
}

/* 禁用所有hover效果 */
body.performance-turbo *:hover {
    transform: none !important;
    box-shadow: inherit !important;
}

/* 简化按钮效果 */
body.performance-turbo .btn::before,
body.performance-turbo .btn::after {
    display: none !important;
}

/* 禁用卡片装饰效果 */
body.performance-turbo .card::before,
body.performance-turbo .card::after {
    display: none !important;
}

/* ==================== 极速模式例外：保留必要动画 ==================== */
/* 保留加载指示器动画 */
body.performance-turbo .loading-spinner,
body.performance-turbo .solve-loading-indicator,
body.performance-turbo .loading-ring,
body.performance-turbo .loading-ring-outer,
body.performance-turbo [class*="loading"] .fa-spinner,
body.performance-turbo [class*="loading"] .fa-circle-notch {
    animation: spin 1s linear infinite !important;
}

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

/* ==================== 手机端强制极速模式的粒子禁用 ==================== */
body.mobile-ui-mode #particleCanvas {
    display: none !important;
}

/* 手机端减少复杂阴影 */
body.mobile-ui-mode .card,
body.mobile-ui-mode .stat-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

/* 手机端禁用毛玻璃（性能考虑） */
body.mobile-ui-mode.performance-smooth .glass-card,
body.mobile-ui-mode.performance-smooth .card,
body.mobile-ui-mode.performance-turbo .glass-card,
body.mobile-ui-mode.performance-turbo .card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ==================== 个人中心-性能模式面板样式 ==================== */

/* 性能模式面板容器 */
.performance-panel {
    padding: 20px 15px;
}

.performance-desc {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

/* 性能模式选项容器 */
.performance-mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* 性能模式卡片 */
.performance-mode-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.performance-mode-card:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transform: translateX(4px);
}

.performance-mode-card.selected {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

/* 模式图标 */
.mode-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-right: 14px;
}

/* 模式信息 */
.mode-info {
    flex: 1;
}

.mode-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.mode-info p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* 选中标记 */
.mode-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-check i {
    font-size: 20px;
    color: #667eea;
}

.performance-mode-card.selected .mode-check {
    opacity: 1;
}

/* 使用建议区域 */
.performance-tips {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 16px;
}

.performance-tips h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.performance-tips h5 i {
    color: #f59e0b;
}

.performance-tips ul {
    margin: 0;
    padding-left: 16px;
}

.performance-tips li {
    font-size: 12px;
    color: #78350f;
    margin-bottom: 6px;
    line-height: 1.5;
}

.performance-tips li:last-child {
    margin-bottom: 0;
}

.performance-tips li strong {
    color: #92400e;
}

/* 菜单中的模式标签 */
.menu-badge-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: auto;
    margin-right: 10px;
}

/* ==================== 移动端陪伴学习-性能优化 ==================== */

/* 流畅模式：保留轻量动态，降级重型特效与模糊 */
body.companion-page.performance-smooth .bg-animation::before,
body.companion-page.performance-smooth .bg-animation::after {
    opacity: 0.35 !important;
    animation-duration: 45s !important;
}

body.companion-page.performance-smooth .bg-animation {
    background-attachment: scroll !important;
}

body.companion-page.performance-smooth .header,
body.companion-page.performance-smooth .stat-card,
body.companion-page.performance-smooth .feature-card,
body.companion-page.performance-smooth .feature-card-compact,
body.companion-page.performance-smooth .suggestions-card,
body.companion-page.performance-smooth .activity-card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    transition-duration: 0.12s !important;
}

/* 极速模式：彻底关闭动画、毛玻璃和重阴影，平面化渲染 */
body.companion-page.performance-turbo .bg-animation {
    display: none !important;
}

body.companion-page.performance-turbo .header,
body.companion-page.performance-turbo .stat-card,
body.companion-page.performance-turbo .feature-card,
body.companion-page.performance-turbo .feature-card-compact,
body.companion-page.performance-turbo .suggestions-card,
body.companion-page.performance-turbo .activity-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08) !important;
    background: #f8fafc !important;
    transform: none !important;
}

body.companion-page.performance-turbo .feature-card::before,
body.companion-page.performance-turbo .feature-card::after {
    display: none !important;
}

body.companion-page.performance-turbo .logo i,
body.companion-page.performance-turbo .feature-icon i,
body.companion-page.performance-turbo .feature-icon-compact i,
body.companion-page.performance-turbo .hero-title-compact i {
    filter: none !important;
    text-shadow: none !important;
}
