/* 基础样式重置 */
* {
    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;
}

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

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.header-left {
    flex: 1;
}

.site-title {
    font-size: 1.5rem;
    color: #333;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
}

.nav-tab {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.nav-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Small User Info */
.user-info-small {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #667eea;
}

.user-name-small {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.logout-btn-small {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(238, 90, 90, 0.4);
}

/* Header 样式 */
header {
    text-align: center;
    padding: 30px 20px;
    color: white;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 30px;
}

.upload-box {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    border: 3px dashed #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-box.disabled {
    pointer-events: none;
}

.upload-box.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-box h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-box p {
    color: #666;
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 预览区域样式 */
.preview-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.preview-box {
    text-align: center;
}

.preview-box h4 {
    margin-bottom: 15px;
    color: #333;
}

.preview-box img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.result-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#fff 0 90deg, #eee 0 180deg) 0 0/20px 20px;
    border-radius: 8px;
}

/* Loading 样式 */
.loading {
    text-align: center;
}

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

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

/* 按钮样式 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

/* 使用场景样式 */
.use-cases {
    margin-top: 40px;
    padding: 40px 20px;
}

.section-title {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.use-case-card {
    background: white;
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.use-case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.use-case-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.use-case-card h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.use-case-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== Profile Page Styles ========== */

.profile-container {
    max-width: 900px;
    margin: 0 auto;
}

.profile-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #667eea;
}

.profile-info h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 8px;
}

.profile-info p {
    color: #666;
    margin-bottom: 5px;
}

.join-date {
    color: #999;
    font-size: 0.9rem;
}

/* Stats Card */
.stats-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stats-card h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 12px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
}

/* History Card */
.history-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.history-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-filename {
    font-weight: 500;
    color: #333;
}

.history-date {
    color: #999;
    font-size: 0.9rem;
}

.history-status.success {
    color: #34A853;
    font-weight: 500;
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Settings Card */
.settings-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.settings-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.settings-actions {
    display: flex;
    gap: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-container {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
}
