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

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

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

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

/* 主要内容区域 */
main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* 标签页样式 */
.tab-container {
    display: flex;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 输入组样式 */
.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 文件上传样式 */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #5a6fd8;
    background: #f0f2ff;
}

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

.upload-area p {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.upload-area small {
    color: #666;
}

/* 图片预览 */
.image-preview {
    margin-top: 20px;
    text-align: center;
}

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

/* 分析按钮 */
.analyze-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* 进度条 */
.progress-container {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.progress-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 结果区域 */
.result-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9ff;
    border-radius: 16px;
    border-left: 5px solid #667eea;
}

.result-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* 结果卡片 */
.result-cards {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.result-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid #e8ecff;
    overflow: hidden;
}

.result-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}



.result-card-icon {
    font-size: 24px;
    position: relative;
    z-index: 1;
}

.result-card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

.result-card-content {
    padding: 25px;
    line-height: 1.8;
    font-size: 16px;
}

.result-card-content p {
    margin-bottom: 15px;
    color: #555;
}

.result-card-content strong {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1em;
}

.result-card-content em {
    color: #666;
    font-style: italic;
}

/* 原有的结果内容样式保留作为备用 */
.result-content {
    line-height: 1.8;
    font-size: 16px;
}

/* 茶饮指南 */
.tea-guide {
    margin-top: 50px;
}

.tea-guide h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
}

.constitution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.constitution-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border: 2px solid #e8ecff;
    overflow: hidden;
}

.constitution-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}





.constitution-header h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

.constitution-tag {
    background: rgba(255,255,255,0.25);
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    z-index: 1;
}



.constitution-content {
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
}

.constitution-feature {
    color: #555;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border-radius: 12px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    position: relative;
}

.constitution-feature::before {
    content: '💡';
    position: absolute;
    top: -8px;
    left: 12px;
    background: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tea-info {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e8ecff;
}

.tea-info h5 {
    color: #333;
    font-size: 17px;
    margin-bottom: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tea-info h5::before {
    content: '🍵';
    font-size: 20px;
}

.tea-info h5 strong {
    color: #667eea;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(102, 126, 234, 0.2);
}

.tea-highlight {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e8ecff;
    position: relative;
    margin-top: 10px;
}

.tea-highlight::before {
    content: '✨';
    position: absolute;
    top: -6px;
    right: 12px;
    background: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 页脚 */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    main {
        padding: 25px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .constitution-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .constitution-card {
        margin-bottom: 20px;
    }
    
    .constitution-header {
        padding: 20px 15px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .constitution-header h4 {
        font-size: 1.3rem;
    }
    
    .constitution-content {
        padding: 20px 15px;
    }
    
    .constitution-feature {
        font-size: 14px;
        padding: 14px;
    }
    
    .tea-info {
        padding: 16px;
    }
    
    .tea-info h5 {
        font-size: 16px;
    }
    
    /* 进度条响应式 */
    .progress-container {
        margin-top: 15px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .progress-text {
        font-size: 13px;
    }
    
    /* 结果卡片响应式 */
    .result-cards {
        gap: 15px;
    }
    
    .result-card-header {
        padding: 15px;
    }
    
    .result-card-header h3 {
        font-size: 1.2rem;
    }
    
    .result-card-content {
        padding: 20px 15px;
    }
    
    .analyze-btn {
        padding: 14px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
}

/* 错误和成功消息样式 */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.message.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: #363;
    border: 1px solid #cfc;
} 