/* 错误提示弹窗样式 */

.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.error-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: errorModalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes errorModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.error-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.error-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.error-modal-error .error-icon {
    background-color: #fee2e2;
    color: #dc2626;
}

.error-modal-warning .error-icon {
    background-color: #fef3c7;
    color: #d97706;
}

.error-modal-info .error-icon {
    background-color: #dbeafe;
    color: #2563eb;
}

.error-modal-success .error-icon {
    background-color: #dcfce7;
    color: #16a34a;
}

.error-title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    padding-top: 8px;
}

.error-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.error-modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.error-modal-body {
    padding: 0 24px 24px;
}

.error-message {
    margin-bottom: 20px;
}

.error-message p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
}

.error-suggestions {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.error-suggestions h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-suggestions h4 i {
    color: #f59e0b;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.error-suggestions li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
}

.error-suggestions li:last-child {
    margin-bottom: 0;
}

.error-modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
}

.error-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.error-modal-actions .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.error-modal-actions .btn-primary {
    background-color: #2563eb;
    color: white;
}

.error-modal-actions .btn-primary:hover {
    background-color: #1d4ed8;
}

.error-modal-actions .btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.error-modal-actions .btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.error-modal-actions .btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.error-modal-actions .btn-retry {
    background-color: #059669;
    color: white;
}

.error-modal-actions .btn-retry:hover {
    background-color: #047857;
}

/* 深色主题适配 */
[data-theme="dark"] .error-modal {
    background: #1f2937;
    color: #f9fafb;
}

[data-theme="dark"] .error-modal-header {
    border-bottom-color: #374151;
}

[data-theme="dark"] .error-title {
    color: #f9fafb;
}

[data-theme="dark"] .error-modal-close {
    color: #9ca3af;
}

[data-theme="dark"] .error-modal-close:hover {
    background-color: #374151;
    color: #d1d5db;
}

[data-theme="dark"] .error-message p {
    color: #d1d5db;
}

[data-theme="dark"] .error-suggestions {
    background-color: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .error-suggestions h4 {
    color: #e5e7eb;
}

[data-theme="dark"] .error-suggestions li {
    color: #9ca3af;
}

[data-theme="dark"] .error-modal-footer {
    border-top-color: #374151;
}

[data-theme="dark"] .error-modal-actions .btn-secondary {
    background-color: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

[data-theme="dark"] .error-modal-actions .btn-secondary:hover {
    background-color: #4b5563;
    border-color: #6b7280;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .error-modal {
        width: 95%;
        margin: 20px;
    }
    
    .error-modal-header {
        padding: 20px 20px 12px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .error-modal-close {
        top: 12px;
        right: 12px;
    }
    
    .error-title {
        padding-top: 0;
        font-size: 18px;
    }
    
    .error-modal-body {
        padding: 0 20px 20px;
    }
    
    .error-modal-footer {
        padding: 12px 20px 20px;
    }
    
    .error-modal-actions {
        flex-direction: column;
    }
    
    .error-modal-actions .btn {
        width: 100%;
    }
}

/* 动画效果 */
.error-modal-overlay.fade-out {
    animation: errorModalFadeOut 0.3s ease-in forwards;
}

@keyframes errorModalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.error-modal.slide-out {
    animation: errorModalSlideOut 0.3s ease-in forwards;
}

@keyframes errorModalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
}

/* 焦点样式 */
.error-modal-actions .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 加载状态 */
.error-modal-actions .btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.error-modal-actions .btn.loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

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