/* ==================== 知识库·文档管理 ==================== */
.kbm-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    overflow: hidden;
}
/* 顶部 我的/全部（上方留白收紧：6px 上边距 + 外层pane 10px ≈ 16px） */
.kbm-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.kbm-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}
.kbm-tab {
    padding: 7px 24px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all .2s;
}
.kbm-tab.active {
    background: #fff;
    color: #3855d5;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
/* 中间：文档类型分类 */
.kbm-types {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.kbm-type {
    padding: 7px 18px;
    font-size: 13px;
    color: #555;
    background: #f6f7f9;
    border: 1px solid #eee;
    border-radius: 18px;
    cursor: pointer;
    transition: all .2s;
}
.kbm-type.active {
    color: #fff;
    background: #3855d5;
    border-color: #3855d5;
    font-weight: 600;
}
/* 下方列表 */
.kbm-list {
    flex: 1;
    min-height: 0;
    overflow: hidden; /*列表固定布局内部滚动，数据多时不再向下溢出*/
}
/* 文档名称单元格：左侧图标 + 名称（左对齐） */
.kbm-doc-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-align: left;
}
/* 勾选列收紧（表格 auto 布局会把未定宽的勾选列撑宽，导致名称列看似居中） */
.kbm-list .CU-list-checkbox-col {
    width: 40px;
}
/* 文档图标（在线富文本无封面，统一渲染文档字形） */
.kbm-doc-thumb {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 6px;
    color: #4a63d8;
    box-sizing: border-box;
}
.kbm-doc-thumb svg {
    width: 15px;
    height: 15px;
}
.kbm-doc-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 列表工具栏操作按钮：空心（描边）小按钮，颜色由 searchButtons 的 color 参数决定（CU-btn-{color}） */
.kbm-list .CU-search-btn-item {
    height: auto;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 20px;
    color: #909399;
    background: #fff;
    border: 1px solid #d3d4d6;
    border-radius: 4px;
    transition: all .2s;
}
.kbm-list .CU-search-btn-item:hover,
.kbm-list .CU-search-btn-item:focus {
    color: #3855d5;
    background: #fff;
    border-color: #3855d5;
}
/* primary 空心（新建文档）：蓝 */
.kbm-list .CU-search-btn-item.CU-btn-primary {
    color: #4a63d8;
    border-color: #aab4f1;
}
.kbm-list .CU-search-btn-item.CU-btn-primary:hover,
.kbm-list .CU-search-btn-item.CU-btn-primary:focus {
    color: #fff;
    background: #667eea;
    border-color: #667eea;
}
/* warning 空心（权限分配）：橙 */
.kbm-list .CU-search-btn-item.CU-btn-warning {
    color: #d48806;
    border-color: #f0c351;
}
.kbm-list .CU-search-btn-item.CU-btn-warning:hover,
.kbm-list .CU-search-btn-item.CU-btn-warning:focus {
    color: #fff;
    background: #faad14;
    border-color: #faad14;
}
/* purple 空心（移动分类）：紫 */
.kbm-list .CU-search-btn-item.CU-btn-purple {
    color: #722ed1;
    border-color: #c3a6ec;
}
.kbm-list .CU-search-btn-item.CU-btn-purple:hover,
.kbm-list .CU-search-btn-item.CU-btn-purple:focus {
    color: #fff;
    background: #722ed1;
    border-color: #722ed1;
}
/* success 空心（导入文档）：绿 */
.kbm-list .CU-search-btn-item.CU-btn-success {
    color: #2f7d6a;
    border-color: #8cc7b8;
}
.kbm-list .CU-search-btn-item.CU-btn-success:hover,
.kbm-list .CU-search-btn-item.CU-btn-success:focus {
    color: #fff;
    background: #3d9681;
    border-color: #3d9681;
}
/* danger 空心：红（备用） */
.kbm-list .CU-search-btn-item.CU-btn-danger {
    color: #e5484d;
    border-color: #f2a9ac;
}
.kbm-list .CU-search-btn-item.CU-btn-danger:hover,
.kbm-list .CU-search-btn-item.CU-btn-danger:focus {
    color: #fff;
    background: #F56C6C;
    border-color: #F56C6C;
}
/* info 空心（默认）：灰 */
.kbm-list .CU-search-btn-item.CU-btn-info {
    color: #909399;
    border-color: #d3d4d6;
}
.kbm-list .CU-search-btn-item.CU-btn-info:hover,
.kbm-list .CU-search-btn-item.CU-btn-info:focus {
    color: #fff;
    background: #909399;
    border-color: #909399;
}
/* 表单弹框 */
.kbm-form {
    padding: 18px 20px;
}
.kbm-f-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
}
.kbm-f-row > label {
    width: 80px;
    flex-shrink: 0;
    line-height: 32px;
    color: #333;
    text-align: right;
    margin-right: 12px;
}
.kbm-f-input,
.kbm-f-select {
    flex: 1;
    height: 32px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.kbm-f-input:focus, .kbm-f-select:focus {
    border-color: #3855d5;
}
.kbm-f-textarea {
    flex: 1;
    min-height: 120px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    outline: none;
}
.kbm-tip {
    font-size: 12px;
    color: #999;
    padding-left: 92px;
}
.kbm-file {
    flex: 1;
    line-height: 32px;
}
/* 权限分配 */
.kbm-perm {
    padding: 16px 20px;
}
/* 权限抽屉内分组标题（权限管理员列表 / 添加成员） */
.kbm-perm-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 4px 0 10px;
}
/* 管理员列表为空时的占位 */
.kbm-perm-empty {
    padding: 16px 14px;
    font-size: 12px;
    color: #999;
    text-align: center;
}
.kbm-perm-list {
    margin-bottom: 14px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}
.kbm-perm-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f5f5f5;
    background: #fff;
}
.kbm-perm-row:last-child {
    border-bottom: none;
}
.kbm-perm-owner {
    background: #f7f8fa;
}
.kbm-perm-name {
    flex: 1;
    font-size: 13px;
    color: #333;
}
.kbm-perm-role {
    font-size: 12px;
    color: #999;
    margin-right: 12px;
}
.kbm-perm-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 18px;
    color: #7048e8;
    background: #f1ecfe;
    border-radius: 4px;
    vertical-align: 1px;
}
.kbm-perm-remove {
    font-size: 12px;
    color: #e5484d;
    cursor: pointer;
}
.kbm-perm-remove:hover {
    text-decoration: underline;
}
.kbm-perm-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}
.kbm-btn {
    height: 32px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.kbm-btn-primary {
    background: #3855d5;
    color: #fff;
}
/* 导入文档 - 拖拽上传区 */
.kbm-import {
    padding: 24px 28px;
}
.kbm-dropzone {
    text-align: center;
    padding: 44px 24px;
    border: 2px dashed #dcdfe6;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
}
.kbm-dropzone.kbm-drop-over {
    border-color: #3855d5;
    background: #f0f3ff;
}
.kbm-drop-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 10px;
}
.kbm-drop-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 6px;
}
.kbm-drop-tip {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}
.kbm-drop-progress {
    margin-top: 14px;
    text-align: left;
}
.kbm-drop-progress-bar {
    height: 4px;
    background: #3855d5;
    border-radius: 2px;
    width: 0;
    transition: width .3s;
    margin-bottom: 6px;
}
.kbm-drop-status {
    font-size: 12px;
    color: #666;
}
.kbm-drop-error {
    margin-top: 10px;
    font-size: 12px;
    color: #e5484d;
    line-height: 1.5;
}
/* 导入弹框：拖放区下方的文档类型选择 */
.kbm-import-type {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 18px;
}
.kbm-import-type span {
    flex-shrink: 0;
    font-size: 13px;
    color: #555;
}
.kbm-import-type select {
    flex: 1;
    height: 34px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
    background: #fff;
}
.kbm-import-type select:focus {
    border-color: #3855d5;
}

/* ==================== 云盘Tab（KnowledgeDiskManager） ==================== */
.kdm-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
/* 顶部工具栏：面包屑 + 按钮 */
.kdm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.kdm-crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
    color: #333;
    flex: 1;
    min-width: 200px;
}
.kdm-crumb-item {
    color: #3855d5;
    cursor: pointer;
}
.kdm-crumb-item:hover {
    text-decoration: underline;
}
.kdm-crumb-root {
    font-weight: 600;
}
.kdm-crumb-sep {
    color: #bbb;
    padding: 0 2px;
}
/* 搜索栏：最后一个按钮（上传文件夹）推到右侧 */
.kdm-searchbar .kdm-action-upload {
    margin-left: auto;
}
.kdm-file-input {
    display: none;
}
/* 搜索栏 */
.kdm-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}
.kdm-search-input {
    flex: 0 0 280px;
    height: 32px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
}
.kdm-search-input:focus {
    border-color: #3855d5;
}
/* 上传进度（上传modal内使用） */
.kdm-upload-progress-wrap {
    margin-top: 14px;
}
.kdm-upload-progress {
    height: 6px;
    border-radius: 3px;
    background: #eef0f6;
    overflow: hidden;
}
.kdm-upload-bar {
    height: 100%;
    width: 0;
    background: #3855d5;
    border-radius: 3px;
    transition: width .2s;
}
.kdm-upload-status {
    flex-shrink: 0;
    font-size: 12px;
    color: #666;
}
/* 列表体（兼作拖拽上传区）：仅让出空间，滚动由 CustomList 内部 fixed_layout 处理 */
.kdm-body {
    flex: 1;
    min-height: 0;   /* 关键：flex 子元素可收缩，否则会把内部超出的分页撑开/遮住 */
    position: relative;
    overflow: hidden;
}
.kdm-body.kdm-drop-over {
    outline: 2px dashed #3855d5;
    outline-offset: -2px;
    background: #f7f9ff;
}
.kdm-table-head,
.kdm-row {
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}
.kdm-table-head {
    height: 38px;
    background: #fafbfc;
    color: #888;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.kdm-row {
    min-height: 46px;
    border-bottom: 1px solid #f5f6f7;
    cursor: pointer;
    transition: background .15s;
}
.kdm-row:hover {
    background: #f7f9ff;
}
.kdm-col-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}
.kdm-col-size,
.kdm-col-time {
    width: 120px;
    flex-shrink: 0;
    color: #888;
    font-size: 12px;
    box-sizing: border-box;
    padding-right: 12px;
}
.kdm-col-op {
    width: 200px;
    flex-shrink: 0;
    text-align: right;
    box-sizing: border-box;
}
.kdm-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}
.kdm-name {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 云盘名称单元格：左侧缩略图/图标 + 名称（左对齐，CustomList 表格内使用） */
.kdm-file-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-align: left;
}
/* 图片真实缩略图（OSS style/small） */
.kdm-thumb-img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    background: #f7f8fa;
    display: block;
}
/* 文件夹/兜底 emoji 图标 */
.kdm-thumb-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    background: #f6f7f9;
    border-radius: 6px;
    box-sizing: border-box;
}
/* 扩展名角标（ZIP/DOCX/PDF 等） */
.kdm-thumb-ext {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #4a63d8;
    background: #eef2ff;
    border-radius: 6px;
    box-sizing: border-box;
    overflow: hidden;
}
.kdm-file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kdm-op {
    font-size: 12px;
    color: #3855d5;
    margin-left: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.kdm-op:hover {
    text-decoration: underline;
}
.kdm-op-danger {
    color: #e5484d;
}
/* 列表底部：空态 / 加载更多 */
.kdm-foot {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #999;
}
.kdm-loading {
    color: #999;
}
.kdm-loadmore {
    color: #3855d5;
    cursor: pointer;
}
.kdm-loadmore:hover {
    text-decoration: underline;
}
.kdm-empty {
    color: #999;
}
/* 新建文件夹表单 */
.kdm-form {
    padding: 20px 24px;
}
.kdm-f-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.kdm-f-row > label {
    flex-shrink: 0;
    font-size: 13px;
    color: #333;
}
.kdm-f-input {
    flex: 1;
    height: 34px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.kdm-f-input:focus {
    border-color: #3855d5;
}
/* 通用按钮 */
.kdm-btn {
    height: 32px;
    padding: 0 14px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all .2s;
}
.kdm-btn:hover {
    border-color: #3855d5;
    color: #3855d5;
}
.kdm-btn-primary {
    background: #3855d5;
    border-color: #3855d5;
    color: #fff;
}
.kdm-btn-primary:hover {
    background: #4D6BFE;
    border-color: #4D6BFE;
    color: #fff;
}
.kdm-btn-link {
    border-color: transparent;
    color: #3855d5;
    background: transparent;
}
.kdm-btn-link:hover {
    background: #f0f3ff;
    color: #3855d5;
}
/* 上传文件：带颜色的空心小按钮（与文档模块空心按钮风格一致；双类名保证覆盖 .kdm-btn:hover） */
.kdm-btn.kdm-btn-plain-primary {
    background: #fff;
    color: #4a63d8;
    border: 1px solid #aab4f1;
}
.kdm-btn.kdm-btn-plain-primary:hover,
.kdm-btn.kdm-btn-plain-primary:focus {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ==================== 知识库左侧竖向Tab（文档/云盘/API）防破板 ==================== */
/* Tab标签超出不换行：加数量徽标后防止换行撑破（垂直tabs默认white-space:normal会换行） */
#expert-tab-content-3 .CU-tab-item {
    white-space: nowrap;
    height: 40px;
    line-height: 40px;
    overflow: hidden;
}
/* 右侧内容区高度撑满，防止内容区高度不够破板（数值可按头部实际高度微调） */
#expert-tab-content-3 .CU-tabs {
    height: calc(100vh - 160px);
    min-height: 420px;
}
#expert-tab-content-3 .CU-tabs-content {
    height: 100%;
    overflow: hidden;
}
#expert-tab-content-3 .CU-tab-pane {
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

