.kb-page {
    width: 100%;
    max-width: 100%;
    margin: 24px 0 60px 0;
    padding: 0 24px;
    box-sizing: border-box;
}

.kb-title {
    margin: 0 0 18px 0;
    font-size: 22px;
    font-weight: 600;
}

/* 工具列：搜尋欄位（左）、新增按鈕（右） */
.kb-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.kb-search {
    flex: 1 1 280px;
    min-width: 220px;
    max-width: 420px;
}

.kb-add-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

/* 表格 */
.kb-table-wrap {
    border: 1px solid #e6eef5;
    border-radius: 12px;
    overflow: hidden;
}

.kb-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed;
}

.kb-table thead th {
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #5b6b7a;
    background: #f8fbff;
    padding: 12px 14px;
    border-bottom: 1px solid #e6eef5;
    white-space: nowrap;
}

.kb-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f4f8;
    vertical-align: top;
}

.kb-table tbody tr:last-child td {
    border-bottom: none;
}

.kb-table tbody tr:hover {
    background: #fafdff;
}

.kb-source {
    color: #46566b;
    word-break: break-all;
}

/* 知識內容欄：可捲動、保留換行 */
.kb-content-cell {
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    word-break: break-word;
    color: #2b3a4a;
}

.kb-actions-cell {
    text-align: right;
    vertical-align: middle;
}

.kb-row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    min-height: 32px;
}

.kb-row-actions fluent-button {
    display: inline-flex;
    align-items: center;
}

.kb-empty {
    padding: 40px 16px;
    text-align: center;
    color: #7a8a99;
    background: #fff;
}

/* 分頁列 */
.kb-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: #5b6b7a;
    font-size: 14px;
}

.kb-pager-btns {
    display: flex;
    gap: 8px;
}

.kb-note {
    text-align: center;
    margin: 16px 0 0 0;
    color: #f0a500;
    font-weight: 500;
}

/* 行動裝置：表格轉為卡片式 */
@media (max-width: 760px) {
    .kb-table thead {
        display: none;
    }

    .kb-table,
    .kb-table tbody,
    .kb-table tr,
    .kb-table td {
        display: block;
        width: 100%;
    }

    .kb-table tbody tr {
        border: 1px solid #e6eef5;
        border-radius: 10px;
        margin: 10px;
        padding: 6px 4px;
    }

    .kb-table tbody td {
        border-bottom: none;
        padding: 8px 14px;
    }

    .kb-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #7a8a99;
        margin-bottom: 4px;
    }

    .kb-row-actions {
        justify-content: flex-end;
    }
}
