/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
}

.header-content h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header-content h1 i {
    color: #ff6b9d;
    margin-right: 10px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

/* 卡片通用样式 */
.intro-card,
.upload-card,
.analysis-card,
.result-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.intro-card:hover,
.upload-card:hover,
.analysis-card:hover,
.result-card:hover {
    transform: translateY(-5px);
}

/* 介绍区域 */
.intro-card h2 {
    text-align: center;
    color: #4a5568;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.intro-card h2 i {
    color: #ff6b9d;
    margin-right: 10px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.step {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 15px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
}

.step-content h3 {
    color: #4a5568;
    margin-bottom: 5px;
}

.step-content p {
    color: #718096;
    font-size: 0.9rem;
}

.start-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8a9b 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* 上传区域 */
.upload-card h2 {
    text-align: center;
    color: #4a5568;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.upload-card h2 i {
    color: #667eea;
    margin-right: 10px;
}

.upload-tip {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #ff6b9d;
    background: #fff5f8;
}

.upload-placeholder i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.upload-placeholder p {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.file-info {
    color: #a0aec0;
    font-size: 0.9rem;
}

/* 图片预览 */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.preview-item:hover {
    transform: scale(1.05);
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 107, 157, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: #ff6b9d;
}

/* 上传控制 */
.upload-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.upload-status {
    color: #718096;
}

#uploadCount {
    font-weight: 600;
    color: #4a5568;
}

.min-requirement {
    font-size: 0.9rem;
    color: #a0aec0;
}

.analyze-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.analyze-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.analyze-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 分析中区域 */
.analysis-card {
    text-align: center;
}

.analysis-card h2 {
    color: #4a5568;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.analysis-card h2 i {
    color: #667eea;
    margin-right: 10px;
}

.loading-animation {
    margin-bottom: 30px;
}

.heart-loading {
    font-size: 4rem;
    color: #ff6b9d;
    animation: heartbeat 1.5s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.loading-text {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.analysis-tip {
    color: #a0aec0;
    font-style: italic;
}

/* 结果区域 */
.result-card h2 {
    text-align: center;
    color: #4a5568;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.result-card h2 i {
    color: #48bb78;
    margin-right: 10px;
}

.result-content {
    margin-bottom: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.result-section-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    line-height: 1.7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}



.result-section-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.result-section-item h3 {
    color: #1a202c;
    margin-bottom: 16px;
    text-align: left;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    position: relative;
    padding-left: 0;
}



.result-section-item h4 {
    color: #4c51bf;
    margin-bottom: 12px;
    margin-top: 20px;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    padding-left: 0;
    position: relative;
}



.result-section-item p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 14px;
    padding-left: 0;
    font-size: 0.95rem;
}

.result-section-item ul {
    color: #4a5568;
    padding-left: 32px;
    margin-bottom: 12px;
}

.result-section-item li {
    margin-bottom: 8px;
    line-height: 1.7;
    position: relative;
    font-size: 0.95rem;
}

.result-section-item li::marker {
    color: #667eea;
    font-weight: bold;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.restart-btn,
.share-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(160, 174, 192, 0.3);
}

.share-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.restart-btn:hover,
.share-btn:hover {
    transform: translateY(-2px);
}

/* 底部 */
.footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    padding: 20px 0;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 5px;
}

.disclaimer {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
}

.modal-content h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.modal-content h3 i {
    color: #f56565;
    margin-right: 10px;
}

.modal-content p {
    color: #718096;
    margin-bottom: 20px;
}

.modal-content button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .intro-card,
    .upload-card,
    .analysis-card,
    .result-card {
        padding: 25px;
    }
    
    .steps {
        gap: 15px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .upload-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analyze-btn {
        width: 100%;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .restart-btn,
    .share-btn {
        width: 100%;
    }
    
    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .preview-item img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .intro-card,
    .upload-card,
    .analysis-card,
    .result-card {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-placeholder i {
        font-size: 2.5rem;
    }
    
    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .preview-item img {
        height: 100px;
    }
}