/* =================================================== */
/* 历史诊断弹窗专用样式文件 - lishi_tanchuang.css       */
/* 创建时间：2024年1月                              */
/* 功能：历史诊断记录弹窗的所有样式                    */
/* =================================================== */

/* ==================== 核心弹窗样式 ==================== */

.lishi-tanchuang {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    animation: lishi-fade-in 0.3s ease;
}

.lishi-tanchuang-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
}

/* ==================== 标题样式 ==================== */

.lishi-tanchuang-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    pointer-events: none;
}

.lishi-tanchuang-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    letter-spacing: 0.5px;
    color: white;
    background: linear-gradient(135deg, #6366f1, #4f46e5); /* 靛蓝色渐变 */
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.lishi-tanchuang-title:hover {
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.lishi-tanchuang-close-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 1002;
    pointer-events: auto;
}

.lishi-tanchuang-close-btn:hover {
    background: white;
    color: #475569;
    transform: scale(1.05);
    border-color: #cbd5e1;
}

.lishi-tanchuang-close-btn:active {
    transform: scale(0.95);
}

/* ==================== 内容区域样式 ==================== */

.lishi-tanchuang-body {
    flex: 1;
    padding: 40px 20px 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* 统计卡片样式 */
.lishi-tongji-container {
    margin-bottom: 20px;
}

.lishi-tongji-card {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.tongji-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.tongji-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tongji-item {
    text-align: center;
}

.tongji-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.tongji-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4f46e5;
}

/* 快速筛选样式 */
.lishi-kuaisu-filter {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.filter-btn.active {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* 列表容器样式 */
.lishi-liebiao-container {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lishi-liebiao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.lishi-liebiao-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.lishi-liebiao-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.lishi-sousuo-input {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 180px;
}

.lishi-sousuo-input:focus {
    outline: none;
    border-color: #4f46e5;
}

.lishi-daochu-btn,
.lishi-qingkong-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.lishi-daochu-btn {
    background-color: #10b981;
    color: white;
}

.lishi-daochu-btn:hover {
    background-color: #059669;
}

.lishi-qingkong-btn {
    background-color: #ef4444;
    color: white;
}

.lishi-qingkong-btn:hover {
    background-color: #dc2626;
}

/* 列表项样式 */
.lishi-liebiao-body {
    max-height: 400px;
    overflow-y: auto;
}

.lishi-item {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.lishi-item:hover {
    background-color: #f3f4f6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.lishi-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lishi-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lishi-leixing-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* 类型颜色 */
.lishi-leixing-badge.zhongyi { background-color: #10b981; }
.lishi-leixing-badge.xiyi { background-color: #3b82f6; }
.lishi-leixing-badge.mengyi { background-color: #f59e0b; }
.lishi-leixing-badge.zangyi { background-color: #8b5cf6; }
.lishi-leixing-badge.medicine { background-color: #ef4444; }
.lishi-leixing-badge.zhongxiyi { background-color: #06b6d4; }

.lishi-shijian {
    font-size: 0.85rem;
    color: #6b7280;
}

.lishi-index {
    font-size: 0.75rem;
    color: #9ca3af;
    background-color: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
}

.lishi-item-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lishi-item-delete:hover {
    background-color: #fee2e2;
    transform: scale(1.1);
}

.lishi-item-content {
    margin-top: 8px;
}

.lishi-item-miaoshu {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-word;
}

.lishi-item-info {
    margin-bottom: 12px;
}

.lishi-symptoms {
    font-size: 0.8rem;
    color: #6b7280;
    background-color: #f0f9ff;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    border-left: 3px solid #0ea5e9;
}

.lishi-item-actions {
    display: flex;
    gap: 8px;
}

.lishi-chakan-btn,
.lishi-fuzhi-btn,
.lishi-dakai-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.lishi-chakan-btn {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.lishi-chakan-btn:hover {
    background-color: #c7d2fe;
}

.lishi-fuzhi-btn {
    background-color: #d1fae5;
    color: #059669;
}

.lishi-fuzhi-btn:hover {
    background-color: #a7f3d0;
}

.lishi-dakai-btn {
    background-color: #fef3c7;
    color: #d97706;
}

.lishi-dakai-btn:hover {
    background-color: #fde68a;
}

/* 空状态样式 */
.lishi-kong-state,
.lishi-kong {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 0.95rem;
}

.lishi-kong-state small {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #d1d5db;
}

/* ==================== 底部样式 ==================== */

.lishi-tanchuang-footer {
    padding: 20px;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.lishi-footer-tips {
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
    padding: 8px;
    background-color: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #0ea5e9;
}

.lishi-btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.lishi-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.lishi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.refresh-btn {
    background-color: #6366f1;
    color: white;
}

.refresh-btn:hover {
    background-color: #4f46e5;
}

.close-btn {
    background-color: #6b7280;
    color: white;
}

.close-btn:hover {
    background-color: #4b5563;
}

/* ==================== 动画效果 ==================== */

@keyframes lishi-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .lishi-tanchuang-header {
        padding: 14px 16px;
    }
    
    .lishi-tanchuang-title {
        font-size: 1.1rem;
        padding: 7px 18px;
        border-radius: 18px;
        top: 14px;
    }
    
    .lishi-tanchuang-close-btn {
        top: 14px;
        right: 16px;
    }
    
    .lishi-tanchuang-body {
        padding: 35px 16px 16px;
    }
    
    .tongji-content {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .lishi-liebiao-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .lishi-liebiao-controls {
        width: 100%;
    }
    
    .lishi-sousuo-input {
        width: 100%;
    }
    
    .lishi-btn-group {
        flex-direction: column;
    }
    
    .lishi-btn {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .lishi-tanchuang-title {
        font-size: 1rem;
        padding: 6px 16px;
        border-radius: 16px;
        top: 12px;
    }
    
    .lishi-tanchuang-close-btn {
        width: 32px;
        height: 32px;
        font-size: 1.5rem;
        top: 12px;
        right: 14px;
    }
    
    .lishi-tanchuang-body {
        padding: 30px 12px 12px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .lishi-item-actions {
        flex-direction: column;
    }
}

/* ==================== 深色模式支持 ==================== */

@media (prefers-color-scheme: dark) {
    .lishi-tanchuang-content {
        background-color: #1f2937;
    }
    
    .lishi-tongji-card,
    .lishi-kuaisu-filter,
    .lishi-liebiao-container,
    .lishi-item {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .tongji-title,
    .filter-title,
    .lishi-liebiao-title {
        color: #e5e7eb;
    }
    
    .tongji-value {
        color: #818cf8;
    }
    
    .filter-btn {
        background-color: #4b5563;
        border-color: #6b7280;
        color: #d1d5db;
    }
    
    .filter-btn.active {
        background-color: #6366f1;
        color: white;
    }
    
    .lishi-sousuo-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .lishi-item-miaoshu {
        color: #d1d5db;
    }
    
    .lishi-footer-tips {
        background-color: #1e3a8a;
        color: #dbeafe;
    }
    
    .lishi-tanchuang-footer {
        background-color: #374151;
        border-color: #4b5563;
    }
}

/* 滚动条美化 */
.lishi-tanchuang-body::-webkit-scrollbar,
.lishi-liebiao-body::-webkit-scrollbar {
    width: 6px;
}

.lishi-tanchuang-body::-webkit-scrollbar-track,
.lishi-liebiao-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.lishi-tanchuang-body::-webkit-scrollbar-thumb,
.lishi-liebiao-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.lishi-tanchuang-body::-webkit-scrollbar-thumb:hover,
.lishi-liebiao-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}