/* 智能医疗诊断系统 - 样式表 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 40px;
    color: #fff;
}

.logo h1 {
    font-size: 32px;
    font-weight: 600;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* 步骤导航 */
.step-nav {
    display: flex;
    justify-content: space-between;
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    opacity: 0.5;
    transition: all 0.3s;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.step-item.completed::after {
    background: #4CAF50;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 1;
    transition: all 0.3s;
}

.step-item.active {
    opacity: 1;
}

.step-item.active .step-number {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.step-item.completed .step-number {
    background: #4CAF50;
    color: white;
}

.step-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.step-item.active .step-text {
    color: #667eea;
}

/* 主要内容区 */
.main-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    min-height: 500px;
}

.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    color: #333;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: #667eea;
}

/* 免责声明 */
.disclaimer-box {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.warning-box {
    margin-bottom: 20px;
}

.warning-box h3 {
    color: #f57c00;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box ul {
    margin-left: 20px;
    color: #666;
    line-height: 2;
}

.agreement {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

/* 表单样式 */
.form-section {
    margin-bottom: 30px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin: 25px 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 标签选择器 */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.tag {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    user-select: none;
}

.tag:hover {
    border-color: #667eea;
    color: #667eea;
}

.tag.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 身体部位选择 */
.body-part-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.body-part-btn {
    padding: 15px 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.body-part-btn i {
    font-size: 20px;
    color: #667eea;
}

.body-part-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.body-part-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.body-part-btn.selected i {
    color: white;
}

/* 症状选择 */
.symptom-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

.symptom-tag {
    padding: 8px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.symptom-tag:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

.symptom-tag.selected {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* 按钮样式 */
.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

/* 聊天界面 */
.chat-container {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.chat-status {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-info {
    font-size: 14px;
    color: #666;
}

.status-label {
    font-weight: 600;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #4CAF50;
}

.message-content {
    max-width: 70%;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.message.user .message-content {
    background: #e3f2fd;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
}

.message-name {
    font-weight: 600;
    color: #667eea;
}

.message.user .message-name {
    color: #4CAF50;
}

.message-time {
    color: #999;
    margin-left: 10px;
}

.message-text {
    line-height: 1.6;
    color: #333;
}

.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 2px solid #e0e0e0;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* 诊断报告样式 */
.report-container {
    max-width: 800px;
    margin: 0 auto;
}

.report-header {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
}

.diagnosis-main h3 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.diagnosis-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
}

.diagnosis-tags {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.severity-tag,
.confidence-tag {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.severity-tag.mild {
    background: #4CAF50;
}

.severity-tag.moderate {
    background: #ff9800;
}

.severity-tag.severe {
    background: #f44336;
}

.confidence-tag {
    background: rgba(255,255,255,0.2);
}

.confidence-tag.high {
    background: #4CAF50;
}

.confidence-tag.medium {
    background: #ff9800;
}

.confidence-tag.low {
    background: #f44336;
}

.confidence-reason {
    font-size: 14px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.report-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
}

.report-section h4 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-section h4 i {
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.differential-list {
    margin-left: 20px;
    color: #555;
    line-height: 2;
}

.differential-list li {
    margin-bottom: 8px;
}

.mechanism {
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.evidence-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.evidence-box h5 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

.evidence-support h5 {
    color: #4CAF50;
}

.evidence-against h5 {
    color: #f44336;
}

.evidence-box ul {
    margin-left: 18px;
    color: #666;
    line-height: 1.8;
    font-size: 14px;
}

.medication-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.medication-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

.medication-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.med-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.med-header strong {
    font-size: 16px;
    color: #333;
}

.insurance-tag {
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.med-usage {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.6;
}

.med-warning {
    color: #f44336;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.treatment-subsection {
    margin-bottom: 20px;
}

.treatment-subsection:last-child {
    margin-bottom: 0;
}

.treatment-subsection h5 {
    font-size: 15px;
    color: #555;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid #667eea;
}

.treatment-subsection ul {
    margin-left: 20px;
    color: #666;
    line-height: 2;
}

.warning-section {
    border-left-color: #f44336;
    background: #ffebee;
}

.warning-section h4 {
    color: #f44336;
}

.warning-section h4 i {
    background: #ffcdd2;
    color: #f44336;
}

.warning-list {
    margin-left: 20px;
    color: #d32f2f;
    line-height: 2;
}

.warning-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.warning-list li::before {
    content: '⚠️';
}

.report-disclaimer {
    background: #fff8e1;
    border: 2px dashed #ffc107;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-top: 30px;
}

.report-disclaimer i {
    font-size: 24px;
    color: #f57c00;
    flex-shrink: 0;
}

.report-disclaimer p {
    color: #666;
    line-height: 1.8;
    font-size: 14px;
}

/* 导出页面 */
.export-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.export-option {
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.export-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.export-option i {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.export-option span {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.export-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.export-preview pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 50px;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #666;
    font-size: 16px;
}





/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .step-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .step-item {
        flex: none;
        width: calc(33.33% - 10px);
    }

    .step-item::after {
        display: none;
    }

    .main-content {
        padding: 20px;
    }

    .body-part-selector {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-row.two-col {
        grid-template-columns: 1fr;
    }

    .evidence-box {
        grid-template-columns: 1fr;
    }

    .export-container {
        grid-template-columns: 1fr;
    }

    .diagnosis-tags {
        flex-direction: column;
        align-items: center;
    }
}

/* 【新增】症状多选相关样式 */

.symptom-placeholder {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
    width: 100%;
}

/* 症状分组 */
.symptom-group {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    width: 100%;
}

.symptom-group:last-child {
    margin-bottom: 0;
}

.symptom-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.symptom-group-title i {
    color: #4CAF50;
}

.symptom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 症状标签样式优化 */
.symptom-tag {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    user-select: none;
}

.symptom-tag:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.symptom-tag.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 身体部位按钮多选样式优化 */
.body-part-btn {
    position: relative;
    padding: 15px 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.body-part-btn i {
    font-size: 24px;
    color: #667eea;
    transition: all 0.3s;
}

.body-part-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

/* 选中状态 */
.body-part-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.body-part-btn.selected i {
    color: white;
}

/* 选中标记（对勾） */
.body-part-btn.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

/* 已选症状汇总框 */
#symptomsSummary {
    margin-top: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
    border-left: 4px solid #2196F3;
}

.summary-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.summary-box strong {
    color: #1976d2;
    margin-right: 10px;
}

.summary-tag {
    padding: 4px 12px;
    background: white;
    border-radius: 15px;
    font-size: 13px;
    color: #333;
    border: 1px solid #bbdefb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 症状选择区域优化 */
.symptom-selector {
    min-height: 200px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
    display: flex;
    flex-direction: column;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .symptom-group {
        padding: 12px;
    }

    .symptom-tags {
        gap: 8px;
    }

    .symptom-tag {
        padding: 6px 12px;
        font-size: 13px;
    }

    .body-part-btn.selected::after {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }
}