/* ========================================
   Session会话和历史记录样式
   易医扁鹊中医平台 v2.0
   创建时间：2025-11-30
   ======================================== */

/* ==========================================
   1. 历史记录卡片容器
   ========================================== */

.history-cards-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.history-cards-header {
    text-align: center;
    margin-bottom: 25px;
}

.history-cards-header h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: bold;
}

.history-cards-header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* ==========================================
   2. 历史记录卡片网格布局
   ========================================== */

.history-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* ==========================================
   3. 单个历史记录卡片
   ========================================== */

.history-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ecf0f1;
}

.card-icon {
    font-size: 28px;
    margin-right: 10px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.card-date {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 12px;
}

.record-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.card-fields {
    font-size: 14px;
}

.record-field {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.field-label {
    color: #7f8c8d;
    font-weight: 500;
}

.field-value {
    color: #2c3e50;
    font-weight: normal;
}

/* ==========================================
   4. 历史记录操作按钮
   ========================================== */

.history-cards-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-use-history,
.btn-select-other,
.btn-upload-new {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-use-history {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-use-history:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-select-other {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-select-other:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.btn-upload-new {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-upload-new:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

/* ==========================================
   5. 记录类型选择器弹窗
   ========================================== */

.record-type-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.record-type-selector-dialog {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dialog-header h3 {
    color: #2c3e50;
    font-size: 22px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-btn:hover {
    color: #e74c3c;
}

.record-type-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.type-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.type-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.type-icon {
    font-size: 36px;
}

.type-name {
    font-size: 16px;
    font-weight: bold;
}

/* ==========================================
   6. 历史记录列表弹窗
   ========================================== */

.history-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.history-dialog {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dialog-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.history-list-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: background 0.3s ease;
}

.history-list-item:hover {
    background: #e9ecef;
}

.item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.item-index {
    font-weight: bold;
    color: #667eea;
}

.item-date {
    font-size: 12px;
    color: #95a5a6;
}

.item-summary {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.6;
}

.item-actions {
    text-align: right;
}

.btn-select {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.btn-select:hover {
    transform: scale(1.05);
}

.no-records {
    text-align: center;
    color: #95a5a6;
    padding: 40px;
    font-size: 16px;
}

/* ==========================================
   7. 分页控件
   ========================================== */

.dialog-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #ecf0f1;
    flex-wrap: wrap;
}

.page-btn {
    background: #ecf0f1;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
}

.page-btn.active {
    background: #667eea;
    color: white;
}

.page-btn:hover:not(:disabled) {
    background: #bdc3c7;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   8. 智能问诊引导样式
   ========================================== */

.smart-question-guide {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.guide-progress {
    position: relative;
    background: #ecf0f1;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 12px;
    color: #7f8c8d;
}

.guide-question h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
}

.question-options {
    margin-bottom: 20px;
}

.option-checkbox,
.option-radio {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.option-checkbox:hover,
.option-radio:hover {
    background: #e9ecef;
}

.option-checkbox input,
.option-radio input {
    margin-right: 10px;
    cursor: pointer;
}

.question-input-area {
    margin-top: 15px;
}

.question-input-area textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.question-input-area textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.guide-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-prev,
.btn-next {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-prev:hover {
    background: #bdc3c7;
}

.btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-next:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   9. 引导总结样式
   ========================================== */

.guide-summary {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
}

.guide-summary h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
}

.summary-list {
    margin: 20px 0;
}

.summary-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.summary-question {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.summary-answer {
    color: #7f8c8d;
    line-height: 1.6;
}

.summary-actions {
    text-align: center;
    margin-top: 25px;
}

.btn-start-diagnosis {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-start-diagnosis:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   10. 历史对比表格样式
   ========================================== */

.history-comparison-table {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.history-comparison-table h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.table-description {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 25px;
}

.tcm-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.tcm-data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tcm-data-table th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
}

.tcm-data-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

.tcm-data-table tbody tr:hover {
    background: #f8f9fa;
}

.row-icon {
    font-weight: bold;
    color: #2c3e50;
}

.syndrome-cell {
    color: #667eea;
    font-weight: bold;
}

/* ==========================================
   11. 健康报告样式
   ========================================== */

.health-report {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.report-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.report-header h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

.report-meta {
    font-size: 12px;
    color: #95a5a6;
    line-height: 1.8;
}

.report-section {
    margin-bottom: 30px;
}

.report-section h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.diagnosis-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.diagnosis-box p {
    margin-bottom: 10px;
    line-height: 1.8;
    color: #2c3e50;
}

.diagnosis-box strong {
    color: #667eea;
}

/* ==========================================
   12. 健康变化网格
   ========================================== */

.health-changes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.change-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ecf0f1;
}

.change-item.improved {
    background: #d4edda;
    border-left-color: #28a745;
}

.change-item.worsened {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.change-item.new {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.change-item h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.change-item ul {
    margin-left: 20px;
}

.change-item li {
    margin-bottom: 5px;
    line-height: 1.6;
}

/* ==========================================
   13. 调理建议网格
   ========================================== */

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.suggestion-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.suggestion-item h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2c3e50;
}

.suggestion-item ul {
    margin-left: 20px;
}

.suggestion-item li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #2c3e50;
}

/* ==========================================
   14. 中药方剂样式
   ========================================== */

.herbal-formula-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.herbal-formula-box p {
    margin-bottom: 10px;
    line-height: 1.8;
}

.herbal-list {
    margin-left: 20px;
}

.herbal-list li {
    margin-bottom: 5px;
    line-height: 1.6;
}

/* ==========================================
   15. 注意事项列表
   ========================================== */

.precautions-list {
    margin-left: 20px;
}

.precautions-list li {
    margin-bottom: 10px;
    line-height: 1.8;
    color: #e74c3c;
}

/* ==========================================
   16. 报告页脚
   ========================================== */

.report-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.disclaimer {
    font-size: 12px;
    color: #95a5a6;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
}

.report-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-download,
.btn-share {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-share {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-download:hover,
.btn-share:hover {
    transform: scale(1.05);
}

/* ==========================================
   17. 响应式设计（移动端适配）
   ========================================== */

@media (max-width: 768px) {
    .history-cards-grid {
        grid-template-columns: 1fr;
    }

    .history-cards-actions {
        flex-direction: column;
    }

    .btn-use-history,
    .btn-select-other,
    .btn-upload-new {
        width: 100%;
    }

    .record-type-buttons {
        grid-template-columns: 1fr;
    }

    .health-changes-grid,
    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .history-dialog {
        width: 95%;
        max-height: 90vh;
    }

    .dialog-pagination {
        flex-wrap: wrap;
    }

    .tcm-data-table {
        font-size: 12px;
    }

    .tcm-data-table th,
    .tcm-data-table td {
        padding: 10px 5px;
    }
}

@media (max-width: 480px) {
    .history-cards-container {
        padding: 20px;
    }

    .smart-question-guide {
        padding: 20px;
    }

    .health-report {
        padding: 20px;
    }

    .report-header h2 {
        font-size: 22px;
    }

    .guide-question h3 {
        font-size: 18px;
    }
}

/* ==========================================
   18. 打印样式
   ========================================== */

@media print {
    .history-cards-actions,
    .guide-actions,
    .report-actions,
    .close-btn {
        display: none;
    }

    .health-report {
        box-shadow: none;
    }

    .history-card:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
}

/* ==========================================
   19. 辅助工具类
   ========================================== */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

/* ==========================================
   20. 动画效果
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-cards-container,
.smart-question-guide,
.health-report {
    animation: fadeIn 0.5s ease;
}

/* ==========================================
   结束
   ========================================== */
