* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页样式 */
.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-top: 60px;
    margin-bottom: 20px;
}

.app-desc {
    font-size: 1.1rem;
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

.primary-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.info-box {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

/* 页面头部样式 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.back-btn {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background-color: #f0f0f0;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* 图片上传区域 */
.upload-area {
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

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

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

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

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

.upload-tip {
    font-size: 0.9rem;
    color: #999;
    margin: 0;
}

#fileInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 图片预览区域 */
.preview-area {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    min-height: 100px;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

/* 上传统计 */
.upload-stats {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.upload-stats span {
    font-weight: 600;
    color: #ff6b6b;
}

/* 分析进度页 */
.loading-area {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 1rem;
    color: #666;
}

/* 分析结果页 */
.result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.result-content {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.result-section {
    margin-bottom: 25px;
}

.result-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-content {
    line-height: 1.7;
    color: #555;
}

/* 性格标签 */
.personality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tag {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 兴趣爱好 */
.interests-list {
    list-style: none;
    padding: 0;
}

.interests-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.interests-list li:last-child {
    border-bottom: none;
}

.interests-list li::before {
    content: "✨";
    font-size: 1.2rem;
}

/* 建议列表 */
.suggestions-list {
    list-style: decimal;
    padding-left: 20px;
}

.suggestions-list li {
    margin-bottom: 12px;
    line-height: 1.7;
}

/* 聊天话题 */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.topic-card {
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.topic-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.topic-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .app-title {
        font-size: 2rem;
        margin-top: 40px;
    }
    
    .app-desc {
        font-size: 1rem;
    }
    
    .preview-area {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .primary-btn {
        padding: 14px;
        font-size: 1.1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.3s ease-out;
}

/* 拖拽样式 */
.upload-area.dragover {
    border-color: #667eea;
    background: #e8f0fe;
    transform: scale(1.02);
}

/* 错误提示 */
.error-message {
    color: #dc3545;
    background: #f8d7da;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    text-align: center;
}

/* 成功提示 */
.success-message {
    color: #28a745;
    background: #d4edda;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    text-align: center;
}