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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    padding: 16px;
    min-height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 24px 20px 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
}
.lang-btn {
    padding: 4px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    color: #718096;
    transition: all 0.2s;
}
.lang-btn.active {
    background: #4a6cf7;
    color: white;
    border-color: #4a6cf7;
}
.lang-btn:hover {
    border-color: #4a6cf7;
}

.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}
.step.active .step-num {
    background: #4a6cf7;
    color: white;
}
.step.completed .step-num {
    background: #48bb78;
    color: white;
}
.step-label {
    font-size: 10px;
    color: #a0aec0;
    margin-top: 4px;
}
.step.active .step-label {
    color: #4a6cf7;
    font-weight: 600;
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-box {
    border: 2px dashed #cbd5e0;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    background: #f7fafc;
}
.upload-box:hover {
    border-color: #4a6cf7;
}
.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.upload-box p {
    font-size: 16px;
    color: #4a5568;
}
.upload-hint {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 8px;
}
#fileInput {
    display: none;
}

.preview-box {
    text-align: center;
    margin: 12px 0;
}
.preview-box img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: contain;
}

.form-row {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}
.form-group {
    flex: 1;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 4px;
}
.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}
.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #4a6cf7;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4a6cf7, #6a4cf7);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 24px;
    background: #edf2f7;
    color: #4a5568;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: #e2e8f0;
}

.loading {
    text-align: center;
    padding: 40px 0;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #4a6cf7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}
.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 8px;
}
.result-icon {
    font-size: 20px;
}
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.result-item {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.result-item .label {
    color: #a0aec0;
    font-size: 11px;
}
.result-item .value {
    font-weight: 600;
}

.question-progress {
    margin-bottom: 16px;
}
.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}
#progressFill {
    height: 100%;
    background: linear-gradient(90deg, #4a6cf7, #6a4cf7);
    transition: width 0.3s;
}

.question-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}
.question-card .q-title {
    font-weight: 600;
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 8px;
}
.question-card .q-content {
    font-size: 15px;
    color: #4a5568;
}
.options {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.options label {
    flex: 1;
    min-width: 50px;
    text-align: center;
    padding: 8px 4px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}
.options input {
    display: none;
}
.options input:checked + span {
    color: #4a6cf7;
}
.options label:has(input:checked) {
    border-color: #4a6cf7;
    background: #ebf0ff;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.nav-buttons .btn-primary {
    flex: 1;
}
.nav-buttons .btn-secondary {
    flex: 0 0 auto;
}

.success-icon {
    font-size: 56px;
    text-align: center;
}
.result-summary {
    text-align: center;
    margin-bottom: 20px;
}
.result-summary h2 {
    font-size: 22px;
    color: #2d3748;
    margin: 8px 0 4px;
}
.result-summary p {
    color: #718096;
}

.diagnosis-item {
    background: #f7fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    border-left: 4px solid #4a6cf7;
}
.diagnosis-item .dimension-name {
    font-weight: 700;
    font-size: 16px;
}
.diagnosis-item .severity {
    font-size: 13px;
    padding: 2px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-left: 8px;
}
.severity-mild { background: #fefcbf; color: #975a16; }
.severity-moderate { background: #fbd38d; color: #9c4221; }
.severity-severe { background: #feb2b2; color: #9b2c2c; }

.tea-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 10px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.tea-card .tea-icon {
    font-size: 28px;
}
.tea-card .tea-info {
    flex: 1;
}
.tea-card .tea-name {
    font-weight: 600;
}
.tea-card .tea-desc {
    font-size: 12px;
    color: #718096;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.action-buttons .btn-secondary {
    flex: 0 0 auto;
}
.action-buttons .btn-primary {
    flex: 1;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

@media (max-width: 480px) {
    .app-container {
        padding: 16px 14px 24px;
        border-radius: 12px;
    }
    .header h1 {
        font-size: 17px;
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .options label {
        font-size: 11px;
        padding: 6px 2px;
        min-width: 40px;
    }
}

/* 新增拍照/选择按钮样式 */
.upload-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: center;
}
.btn-camera, .btn-upload {
    flex: 1;
    padding: 14px 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.btn-camera {
    background: #4a6cf7;
    color: white;
}
.btn-upload {
    background: #48bb78;
    color: white;
}
.btn-camera:active, .btn-upload:active {
    transform: scale(0.97);
}
@media (max-width: 480px) {
    .upload-options {
        flex-direction: column;
    }
}
