/* AISR Page Styles */
.aisr-container {
    min-height: 100vh;
    background: var(--bg-secondary);
    padding: 6rem 0 2rem 0; /* 增加顶部间距以避免被导航栏遮挡 */
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    background: transparent; /* 确保背景透明 */
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-primary);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--text-secondary);
    transition: color var(--transition-normal);
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.api-info {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-btn {
    pointer-events: auto;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Upload Progress */
.upload-progress {
    margin-top: 2rem;
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.result-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
    border-color: rgba(37,99,235,.45);
}

.result-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.result-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-image {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-secondary);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.result-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    transition: opacity 0.3s ease;
}

.result-image img.loading {
    opacity: 0.5;
}

.result-image img.loaded {
    opacity: 1;
}

/* Progress Overlay */
.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.progress-overlay .progress-container {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    text-align: center;
}

.progress-overlay .progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-overlay .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-overlay .progress-text {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.dark .progress-overlay {
    background: rgba(0, 0, 0, 0.9);
}

/* 成功提示动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 下载按钮初始隐藏 */
.result-actions .btn {
    display: none;
}

.result-actions .btn.show {
    display: inline-flex;
}

.result-actions {
    padding: 1rem 1.5rem 1.5rem;
    text-align: center;
}

/* Limit Info */
.limit-info {
    margin-top: 3rem;
}

.limit-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.limit-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.limit-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.limit-content p {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.limit-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.limit-stats span {
    font-weight: 600;
}

/* Error States */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.9rem;
    animation: errorBlink 0.6s ease-in-out; /* 快速闪烁两次，总时长0.6秒 */
}

.dark .error-message {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fca5a5;
}

/* 错误提示闪烁动画 */
@keyframes errorBlink {
    0% { opacity: 1; }
    15% { opacity: 0.3; }
    30% { opacity: 1; }
    45% { opacity: 0.3; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

/* Success States */
.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.dark .success-message {
    background: #14532d;
    border-color: #16a34a;
    color: #86efac;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aisr-container {
        padding: 5rem 0 1rem 0; /* 移动端也增加顶部间距 */
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    
    .upload-title {
        font-size: 1.2rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .result-image img {
        max-height: 300px;
    }
    
    .limit-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-icon {
        width: 50px;
        height: 50px;
    }
    
    .upload-title {
        font-size: 1.1rem;
    }
    
    .result-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-image {
        padding: 1rem;
    }
    
    .result-actions {
        padding: 1rem;
    }
}
