body {
    background: #f5f5f5;
}
main {
    max-width: var(--site-max-width);
    padding-bottom: var(--site-content-bottom-gap, 35px);
    box-sizing: border-box;
}

/* Header */
.kb-header {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 32px 24px 16px 24px;
    text-align: center;
    margin-top: 20px;
}
.kb-header h1 {
    font-size: 32px;
    color: #1d4ed8;
    margin-bottom: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

/* 搜索栏 */
.kb-search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.kb-search-bar input {
    width: 340px;
    height: 40px;
    border-radius: 20px 0 0 20px;
    border: 1px solid #eee;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    background: #fafafa;
}
.kb-search-bar button {
    width: 48px;
    height: 40px;
    border-radius: 0 20px 20px 0;
    background: #1d4ed8;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.kb-search-bar button:hover { background: #1e40af; }
@media (max-width: 1024px) {
    .kb-search-bar input { width: 100%; }
}

/* 分类 Tab */
.kb-categories {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 6px;
    padding: 12px 0 0 0;
}
.kb-categories .category {
    color: #666;
    font-size: 15px;
    padding: 2px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    background: transparent;
    user-select: none;
    line-height: 28px;
}
.kb-categories .category.active {
    color: #1d4ed8;
    background: #eff6ff;
    font-weight: bold;
}

/* 卡片网格 */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    margin: 32px 0 0;
    box-sizing: border-box;
}
.kb-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: #888;
    font-size: 15px;
    margin: 0;
}

.kb-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.kb-card:hover {
    box-shadow: 0 6px 24px rgba(29,78,216,0.10);
    transform: translateY(-2px);
}

.kb-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kb-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.kb-img-placeholder {
    font-size: 48px;
    color: #ccc;
}

.kb-cate-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(29,78,216,0.85);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.kb-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.kb-title {
    font-size: 16px;
    color: #222;
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
}
.kb-intro {
    font-size: 13px;
    color: #888;
    margin: 0 0 10px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.kb-meta {
    font-size: 12px;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}

/* 响应式 */
@media (max-width: 1024px) {
    main { padding-left: 15px; padding-right: 15px; }
    .kb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .kb-grid { grid-template-columns: 1fr; }
}
/* 面包屑 —— 和 demand/detail.html 完全一致 */
.d-crumb{font-size:13px;color:#999;margin:12px 0 16px}
.d-crumb a{color:#666;text-decoration:none}
.d-crumb a:hover{color:#2563eb}
.d-crumb span{color:#333}
.detail-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px 40px;
    margin-top: 20px;
}
.detail-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 24px;
}
.detail-header h1 {
    font-size: 24px;
    color: #222;
    margin: 0 0 12px;
    line-height: 1.5;
    font-weight: 600;
}
.detail-meta {
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.detail-meta .cate-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 500;
}
.detail-content {
    font-size: 15px;
    line-height: 1.9;
    color: #333;
    word-break: break-word;
}
.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
}
.detail-content h2, .detail-content h3 {
    color: #222;
    margin: 24px 0 12px;
}
.detail-content p {
    margin: 12px 0;
}
.detail-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 16px;
}
.detail-footer a {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #eee;
    border-radius: 10px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all .2s;
}
.detail-footer a:hover:not(.empty) {
    border-color: #1d4ed8;
    color: #1d4ed8;
    background: #f8faff;
}
.detail-footer .empty {
    color: #ccc;
    cursor: default;
}
.detail-footer .label {
    color: #aaa;
    margin-right: 6px;
}
@media (max-width: 540px) {
    .detail-wrap { padding: 20px 16px; }
    .detail-header h1 { font-size: 18px; }
    .detail-footer { flex-direction: column; }
}