/* Internal Medicine Handbook Styles */

/* Sidebar Item */
.handbook-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    color: #444;
}

.handbook-item:hover {
    background-color: #e9ecef;
    padding-left: 18px;
    /* Slight slide effect */
}

.handbook-item.active {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
    font-weight: 600;
}

/* Content Area */
.im-handbook-detail {
    max-width: 800px;
    margin: 0 auto;
}

.disease-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-family: 'KaiTi', serif;
    /* Traditional feel */
}

/* Pattern Card */
.pattern-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    padding: 20px;
    transition: transform 0.2s;
}

.pattern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pattern-name {
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
    /* Distinct red */
}

.treatment-tag {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.detail-section {
    margin-bottom: 12px;
}

.detail-section label {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.detail-section p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

.text-secondary {
    color: #666 !important;
    font-size: 0.95em;
}

/* Formula Box */
.formula-section {
    background-color: #fafafa;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    border-left: 3px solid #ff9800;
}

.formula-header {
    color: #ef6c00;
    margin-bottom: 5px;
}

.composition-box {
    font-size: 14px;
    color: #555;
    font-family: 'FangSong', monospace;
    /* Herb list feel */
}

/* Animation */
.slide-in {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== 夜间模式适配 ========== */

[data-theme="dark"] .handbook-item {
    color: #ccc;
    border-bottom-color: #333;
}

[data-theme="dark"] .handbook-item:hover {
    background-color: #333;
}

[data-theme="dark"] .handbook-item.active {
    background-color: #1e3a5f;
    color: #64b5f6;
    border-left-color: #64b5f6;
}

[data-theme="dark"] .disease-title {
    color: #e0e0e0;
    border-bottom-color: #444;
}

[data-theme="dark"] .pattern-card {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pattern-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pattern-name {
    color: #ff8a80;
}

[data-theme="dark"] .treatment-tag {
    background-color: #1b3d1b;
    color: #81c784;
}

[data-theme="dark"] .detail-section label {
    color: #aaa;
}

[data-theme="dark"] .detail-section p {
    color: #ddd;
}

[data-theme="dark"] .text-secondary {
    color: #aaa !important;
}

[data-theme="dark"] .formula-section {
    background-color: #333;
    border-left-color: #ff9800;
}

[data-theme="dark"] .formula-header {
    color: #ffb74d;
}

[data-theme="dark"] .composition-box {
    color: #ccc;
}

/* 速查手册侧边栏和内容区 */
[data-theme="dark"] .handbook-sidebar {
    background: #1e1e1e !important;
    border-right-color: #333 !important;
}

[data-theme="dark"] .handbook-content {
    background: #252525 !important;
}

[data-theme="dark"] .search-box {
    border-bottom-color: #333 !important;
}

[data-theme="dark"] .search-box input {
    background: #333;
    border-color: #444;
    color: #ddd;
}

/* 鉴别诊断和歌诀区块 */
[data-theme="dark"] .diff-section {
    background: #333 !important;
}

[data-theme="dark"] .diff-section h4 {
    color: #ddd !important;
}

[data-theme="dark"] .diff-section div {
    color: #bbb !important;
}

[data-theme="dark"] .gejue-section {
    background: #1e3a5f !important;
}

[data-theme="dark"] .gejue-section h4 {
    color: #64b5f6 !important;
}

[data-theme="dark"] .gejue-section div {
    color: #ddd !important;
}

/* 病型标题 */
[data-theme="dark"] .type-title {
    color: #64b5f6 !important;
    border-bottom-color: #64b5f6 !important;
}

[data-theme="dark"] .type-hint {
    color: #ffb74d !important;
}

[data-theme="dark"] .disease-hint {
    color: #ff8a80 !important;
}