/* 错误处理相关样式 */

/* 图片加载失败样式 */
.image-fallback {
    filter: sepia(20%) contrast(0.8);
    position: relative;
}

.image-fallback::after {
    content: "⚠️ 图片加载失败";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1;
}

/* 加载状态指示器 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

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

/* 错误消息样式 */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: "⚠️";
    font-size: 16px;
}

.warning-message {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #d97706;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-message::before {
    content: "⚠️";
    font-size: 16px;
}

.success-message {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #059669;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: "✅";
    font-size: 16px;
}

/* 网络离线状态提示 */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* 重试按钮样式 */
.retry-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background: #2563eb;
}

.retry-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* 数据加载失败时的占位符 */
.data-loading-error {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.data-loading-error .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.data-loading-error .message {
    font-size: 18px;
    margin-bottom: 16px;
}

.data-loading-error .details {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 20px;
}

/* 浏览器不兼容提示 */
.browser-compatibility-warning {
    background: #fef3c7;
    border: 2px solid #fde68a;
    color: #92400e;
    padding: 16px;
    margin: 16px;
    border-radius: 8px;
    text-align: center;
}

.browser-compatibility-warning h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: bold;
}

.browser-compatibility-warning p {
    margin: 8px 0;
    line-height: 1.5;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Toast通知样式 */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 350px;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.error {
    border-left: 4px solid #ef4444;
}

.toast-notification.warning {
    border-left: 4px solid #f59e0b;
}

.toast-notification.success {
    border-left: 4px solid #10b981;
}

.toast-notification .toast-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.toast-notification .toast-message {
    font-size: 14px;
    color: #6b7280;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .toast-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .error-message,
    .warning-message,
    .success-message {
        padding: 10px 12px;
        font-size: 14px;
    }
}