.knowledge-container { max-width: 900px; margin: 20px auto; background: #fff; padding: 30px; border-radius: 8px; }
.knowledge-container h1 { text-align: center; color: #8B0000; }
.filter-nav { text-align: center; margin: 15px 0; }
.filter-nav a { display: inline-block; margin: 3px 6px; padding: 5px 14px; border: 1px solid #8B0000; border-radius: 15px; text-decoration: none; font-size: 14px; }
.filter-nav a.active { background: #8B0000; color: #fff; }
.filter-nav a:not(.active) { color: #8B0000; background: #fff; }
.article-list-item { padding: 15px; border-bottom: 1px solid #eee; }
.article-list-item h3 { margin-bottom: 5px; }
.article-list-item h3 a { color: #333; text-decoration: none; }
.article-list-item h3 a:hover { color: #8B0000; }
.article-list-item .meta { color: #999; font-size: 13px; margin-top: 5px; }
.article-list-item .meta span { margin-right: 12px; }
.empty-state { text-align: center; padding: 40px; color: #999; }
.article-detail { max-width: 800px; margin: 20px auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.article-detail .article-header { text-align: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid #8B0000; }
.article-detail .article-header h1 { color: #8B0000; font-size: 24px; }
.article-detail .article-header .meta { color: #999; margin: 10px 0; font-size: 14px; }
.article-detail .article-header .meta span { margin-right: 10px; }
.article-detail .article-body { line-height: 1.8; color: #444; font-size: 15px; }
.article-detail .article-back { text-align: center; margin-top: 20px; }
.article-detail .article-back a { color: #8B0000; text-decoration: none; }
.knowledge-footer { text-align: center; margin-top: 20px; }
.knowledge-footer a { color: #8B0000; text-decoration: none; font-size: 15px; }
/* ========== 文章发布表单 ========== */
.article-form { max-width: 700px; margin: 20px auto; background: #fff; padding: 30px; border-radius: 8px; }
.article-form h2 { text-align: center; color: #8B0000; margin-bottom: 20px; }
.article-form .form-group { margin-bottom: 15px; }
.article-form .form-group label { display: block; font-weight: bold; margin-bottom: 5px; }
.article-form .form-input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.article-form .form-textarea { width: 100%; height: 250px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; resize: vertical; }
.article-form .btn-submit { width: 100%; padding: 12px; background: #8B0000; color: #fff; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; }
.article-form .btn-submit:hover { background: #a00000; }
.article-form .form-back { text-align: center; margin-top: 15px; }
.article-form .form-back a { color: #8B0000; text-decoration: none; }
.msg-success { background: #e8f5e9; color: #2e7d32; }
.msg-error { background: #ffebee; color: #b71c1c; }
.msg-box { text-align: center; padding: 10px; margin-bottom: 15px; border-radius: 4px; }
/* 文章详情页图片自适应 */
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 6px;
}
/* ========== 知识库列表布局 ========== */
.knowledge-layout { display: flex; gap: 20px; margin-top: 20px; }
.cat-sidebar { width: 180px; min-width: 180px; background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); height: fit-content; }
.cat-sidebar h3 { color: #8B0000; font-size: 16px; margin-bottom: 12px; }
.cat-sidebar .cat-group { margin-bottom: 15px; }
.cat-sidebar .cat-group .cat-title { font-weight: bold; font-size: 14px; color: #555; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid #f0ebe0; }
.cat-sidebar .cat-group a { display: block; padding: 4px 8px; font-size: 13px; color: #666; text-decoration: none; border-radius: 4px; }
.cat-sidebar .cat-group a:hover, .cat-sidebar .cat-group a.active { background: #fdf5e6; color: #8B0000; }
.cat-main { flex: 1; min-width: 0; }

.pagination { text-align: center; margin: 25px 0 10px; display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; font-size: 14px; color: #666; background: #fff; }
.pagination a:hover { background: #fdf5e6; border-color: #8B0000; color: #8B0000; }
.pagination .current { background: #8B0000; color: #fff; border-color: #8B0000; font-weight: bold; }
.pagination .disabled { color: #ccc; cursor: not-allowed; }
.page-info { text-align: center; color: #999; font-size: 13px; margin-bottom: 5px; }

.search-box { max-width: 900px; margin: 0 auto 15px; }

/* ========== 手机端：搜索结果紧贴搜索框 ========== */
@media (max-width: 768px) {
    .knowledge-layout { flex-direction: column; }
    .cat-sidebar { width: 100%; min-width: 100%; order: -1; }
    .cat-sidebar .cat-group { display: inline-block; margin-right: 15px; }
    .cat-sidebar .cat-group a { display: inline-block; margin: 2px 4px; }
    .cat-main { order: 0; }
    .pagination a, .pagination span { padding: 6px 10px; font-size: 12px; }
    
    .knowledge-container {
        display: flex;
        flex-direction: column;
    }
    .search-box {
        order: 1;
        margin-top: 10px;
    }
    .knowledge-layout {
        order: 2;
    }
}
