/* 全局重置 - 中医古典风格基底 */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: "微软雅黑", "宋体", SimHei, Arial, sans-serif; }
body { 
    background: #f5f0e8; /* 宣纸底色 */
    color: #3a2e1f; /* 墨色文字 */
    font-size: 14px;
    line-height: 1.5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d4b886' fill-opacity='0.08' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* 标题栏（中医朱红主色调） */
.title-bar {
    background: #9a2e20;
    color: #fff;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #7a2318;
}
.title-bar h1 {
    font-size: 18px;
    font-weight: normal;
    letter-spacing: 2px;
}

/* 全局搜索框样式 */
.search-box {
    background: #fffbf5;
    padding: 10px 15px;
    border: 1px solid #d4b886;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(154, 126, 88, 0.1);
}
.search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d4b886;
    border-radius: 3px;
    outline: none;
    font-size: 14px;
    background: #faf6ef;
    color: #3a2e1f;
}
.search-input:focus {
    border-color: #9a7e58;
    background: #fff;
}

/* 移动端布局核心（768px以下） */
.mobile-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* 移动端分类Tab栏 */
.category-tabs {
    background: #fffbf5;
    border: 1px solid #d4b886;
    border-radius: 4px;
    padding: 10px;
}
.main-tab {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 5px;
}
.main-tab::-webkit-scrollbar { display: none; }
.main-tab-item {
    flex: 0 0 auto;
    padding: 6px 12px;
    background: #faf6ef;
    border: 1px solid #d4b886;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.main-tab-item.active {
    background: #9a7e58;
    color: #fff;
    border-color: #9a7e58;
}
.sub-tab {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 5px;
}
.sub-tab::-webkit-scrollbar { display: none; }
.sub-tab-item {
    flex: 0 0 auto;
    padding: 6px 12px;
    background: #f5f0e8;
    border: 1px solid #d4b886;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sub-tab-item .count-tag {
    background: #9a2e20;
    color: #fff;
    font-size: 12px;
    padding: 0 5px;
    border-radius: 8px;
}
.sub-tab-item.active {
    background: #e8d9c2;
    border-color: #9a7e58;
}

/* 内容区通用样式（移动端+桌面端） */
.content-area, .desktop-content {
    background: #fffbf5;
    border: 1px solid #d4b886;
    border-radius: 4px;
    padding: 15px;
    min-height: 400px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}
/* 返回按钮 */
.back-btn {
    padding: 6px 12px;
    background: #f5f0e8;
    border: 1px solid #d4b886;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 14px;
    color: #3a2e1f;
}
.back-btn:hover {
    background: #e8d9c2;
    border-color: #9a7e58;
}
/* 分类信息（名称+计数+简介） */
.category-info {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8d9c2;
}
.category-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}
.count-info {
    color: #9a2e20;
    font-size: 14px;
    font-weight: normal;
}
.category-desc {
    color: #6a563d;
    font-size: 14px;
    line-height: 1.6;
}
/* 条目列表+卡片 */
.item-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.item-card {
    padding: 12px 15px;
    border: 1px solid #e8d9c2;
    border-radius: 3px;
    cursor: pointer;
    background: #faf6ef;
    transition: all 0.2s ease;
}
.item-card:hover {
    background: #e8d9c2;
    border-color: #9a7e58;
    transform: translateY(-1px);
}
.item-name {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #3a2e1f;
}
.item-desc {
    color: #6a563d;
    font-size: 13px;
    line-height: 1.5;
}
/* 详情页样式 */
.detail-card {
    padding: 15px;
    border: 1px solid #e8d9c2;
    border-radius: 3px;
    background: #faf6ef;
}
.detail-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8d9c2;
    text-align: center;
    color: #9a2e20;
    letter-spacing: 1px;
}
.detail-content {
    color: #3a2e1f;
    line-height: 1.8;
    font-size: 14px;
    text-indent: 2em;
    white-space: pre-line;
    word-wrap: break-word;
}
.detail-content span {
    color: #9a7e58;
    font-weight: bold;
}
/* 加载中/空提示 */
.loading, .empty-tip {
    text-align: center;
    padding: 50px 0;
    color: #9a7e58;
    font-size: 14px;
}
/* 加载更多按钮 */
.load-more {
    text-align: center;
    padding: 15px 0;
}
.load-more-btn {
    padding: 6px 15px;
    background: #f5f0e8;
    border: 1px solid #d4b886;
    border-radius: 3px;
    cursor: pointer;
    color: #3a2e1f;
}
.load-more-btn:hover {
    background: #e8d9c2;
}

/* 桌面端布局核心（768px以上） */
.desktop-layout {
    display: none;
    flex-direction: row;
    gap: 15px;
    margin-top: 10px;
}
/* 左侧分类目录 */
.desktop-catalog {
    width: 280px;
    background: #fffbf5;
    border: 1px solid #d4b886;
    border-radius: 4px;
    padding: 10px;
    max-height: 600px;
    overflow-y: auto;
}
.main-catalog-item {
    margin-bottom: 8px;
    border: 1px solid #d4b886;
    border-radius: 3px;
    background: #faf6ef;
}
.main-catalog-header {
    padding: 8px 10px;
    background: #e8d9c2;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sub-catalog-list {
    list-style: none;
    padding: 5px 0;
    display: none;
}
.sub-catalog-list.show {
    display: block;
}
.sub-catalog-item {
    padding: 5px 0;
}
.sub-catalog-btn {
    width: 100%;
    padding: 6px 10px;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sub-catalog-btn:hover {
    background: #e8d9c2;
}
.sub-catalog-btn.active {
    background: #9a7e58;
    color: #fff;
}
.sub-catalog-btn .count-tag {
    background: #9a2e20;
    color: #fff;
    font-size: 12px;
    padding: 0 5px;
    border-radius: 8px;
}
/* 桌面端右侧内容区 */
.desktop-content {
    flex: 1;
    max-height: 600px;
}

/* 响应式断点（768px为界，切换移动端/桌面端） */
@media screen and (min-width: 768px) {
    .mobile-layout {
        display: none;
    }
    .desktop-layout {
        display: flex;
    }
    .item-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}