/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 28px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 主内容区滚动条：加宽加深，让 BOSS 真能看见能拖。
   历史上 width:6px + #c1c9d2 太隐蔽，10 米外看不到，主区能滚但用户以为拖不动。 */
.main-content::-webkit-scrollbar { width: 10px; }
.main-content::-webkit-scrollbar-track { background: rgba(241, 245, 249, .6); border-radius: 5px; }
.main-content::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.main-content::-webkit-scrollbar-thumb:hover { background: #64748b; background-clip: padding-box; border: 2px solid transparent; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.page-title { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ==================== 卡片 ==================== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: none;
    margin-bottom: 20px;
}

.card-body { padding: 20px; }

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;            /* 同排卡片强制等高，不再随内容变高 */
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-info h3 { font-size: 28px; font-weight: 700; margin: 0; }
.stat-info p { font-size: 13px; color: var(--gray-500); margin: 0; }

.stat-card .card-body { display: flex; align-items: center; gap: 16px; width: 100%; flex: 1; }
.stat-card .card-body > div:last-child { min-width: 0; }   /* 让子元素能收缩，省略号才生效 */
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.stat-value small { white-space: nowrap; }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== 驾驶舱 widget 网格 ==================== */
/* 目标：解决 col-md-5/7/6 混排导致一行放不下、列表无限撑高把同行拉爆的问题 */
#widgetGrid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
#widgetGrid > [class*="col-md-"] {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;           /* 让 col 成为 flex 容器，.card height:100% 生效 */
}
/* 奇数个 widget 时，最后一个独占整行，避免右半边空白 */
#widgetGrid > [class*="col-md-"]:last-child:nth-child(odd) {
    flex: 0 0 100%;
    max-width: 100%;
}
/* 手机（≤576px）：单列铺满——与 .kb-grid 同口径。
   此前本块无媒体查询，窄屏也被硬性压成两列（每列 163px、图表 canvas 仅 101px）。 */
@media (max-width: 576px) {
    #widgetGrid > [class*="col-md-"] { flex: 0 0 100%; max-width: 100%; }
}
#widgetGrid .card {
    width: 100%;
    height: 100%;
    max-height: 420px;
    overflow: hidden;
    margin-bottom: 0;
}
#widgetGrid .card-body {
    max-height: 420px;
    overflow-y: auto;
}

/* ==================== 表格 ==================== */
.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    vertical-align: middle;
}

/* 项目列表：锁定行高与列宽，杜绝长内容（标签/联系人）把行/列挤变形、跳动 */
.proj-table { table-layout: fixed; }
.proj-table th, .proj-table td {
    height: 48px;
    padding: 8px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
}
/* 多值列（行业标签 / 联系人）允许换行但限高，避免关键信息被单行裁切 */
.proj-table td.col-wrap {
    white-space: normal;
    line-height: 1.32;
}

/* 表格斑马纹 + 悬停高亮（设计皮肤 P0：提升行高与可读性） */
tbody tr:nth-child(even) td { background: var(--gray-50); }
tr:hover td { background: var(--primary-light); }

/* ==================== 标签 ==================== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
}

.tag-primary { background: var(--primary-light); color: var(--primary-dark); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-info { background: var(--info-light); color: var(--info); }
.tag-gray { background: var(--gray-100); color: var(--gray-700); }
.tag-secondary { background: var(--gray-200); color: var(--gray-600); }
.tag-light { background: var(--gray-100); color: var(--gray-500); }

/* 项目管理工具栏：筛选框按字段名长度自动匹配宽度（JS 计算 inline width + flex-shrink:0） */
.kb-auto-w { flex-shrink: 0; }

/* 知识库标签 chip 输入 */
.kb-tag-box { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.kb-tag-chip { display: inline-flex; align-items: center; gap: 4px; cursor: default; }
.kb-tag-chip .bi-x { font-size: 10px; opacity: .7; }
.kb-tag-chip .bi-x:hover { opacity: 1; }

/* 知识库标签筛选条 */
.kb-tag-filter { cursor: pointer; user-select: none; transition: all .12s; }
.kb-tag-filter:hover { filter: brightness(.97); }
.kb-tag-filter.active { background: var(--primary); color: #fff; }
.kb-tags-wrap { padding: 12px 4px; }
.kb-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.kb-tag-count { opacity: .7; font-size: 11px; margin-left: 3px; }

/* 领域地图（MOC）：接 /api/kb/moc */
.kb-moc-bar { padding: 10px 14px; }
.kb-moc-head { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text, #1e293b); }
.kb-moc-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-moc-node { cursor: pointer; background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 999px; padding: 4px 12px; font-size: 13px; transition: all .15s; }
.kb-moc-node:hover { border-color: var(--primary); color: var(--primary); }
.kb-moc-node b { color: var(--primary); margin-left: 4px; }
.kb-moc-node.active { background: var(--primary, #378ADD); border-color: var(--primary, #378ADD); color: #fff; }
.kb-moc-node.active b { color: #fff; }

/* 相关文档（接 /api/kb/docs/<id>/related） */
.kb-related-box { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border, #e2e8f0); }
.kb-related-head { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text, #1e293b); }
.kb-related-item { cursor: pointer; padding: 7px 10px; border-radius: 8px; font-size: 13px; transition: background .15s; }
.kb-related-item:hover { background: var(--gray-50, #f8fafc); }
.kb-related-reason { color: var(--muted, #94a3b8); font-size: 11px; margin-left: 6px; }

/* 标签层级树（接 /api/kb/tags/tree） */
.kb-tag-tree-head { font-weight: 600; font-size: 13px; margin: 14px 0 6px; color: var(--text, #1e293b); }
.kb-tag-tree { font-size: 13px; }
.kb-tag-tree-ul { list-style: none; margin: 0; padding-left: 16px; }
.kb-tag-tree-ul .kb-tag-tree-ul { border-left: 1px solid var(--border, #e2e8f0); }
.kb-tag-tree-node { display: inline-block; padding: 3px 6px; cursor: default; }
.kb-tag-tree-node:hover { background: var(--gray-50, #f8fafc); border-radius: 6px; }

/* 项目管理：标签筛选折叠面板（点击"标签筛选"按钮才展开，平时不占空间） */
.proj-tag-filter-panel {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-top: 8px; padding: 10px 12px;
    background: var(--bg-soft, #f6f8fa); border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}
.proj-tag-filter-panel .text-muted-2 { align-self: center; }
#btnTagFilter.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 科纪广场成员卡片统计方块（统一设计 token，与主系统配色一致） */
.plaza-stat {
    flex: 1;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}
.plaza-stat .bs-num { font-weight: 700; font-size: 18px; line-height: 1.2; }
.plaza-stat .bs-lbl { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.soft-primary { background: var(--primary-light); color: var(--primary); }
.soft-success { background: var(--success-light); color: var(--success); }
.soft-warning { background: var(--warning-light); color: var(--warning); }

/* ==================== 下拉勾选组件 ==================== */
.dropdown-check { position: relative; }
.dropdown-check-btn {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-900);
    min-height: 42px;
    transition: border-color 0.2s;
}
.dropdown-check-btn:hover { border-color: var(--primary); }
.dropdown-check-btn .dc-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}
.dropdown-check-btn .dc-text.placeholder { color: var(--gray-500); }
.dropdown-check-btn .dc-chip {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75rem;
    white-space: nowrap;
}
.dropdown-check-btn .bi-chevron-down {
    margin-left: 8px;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--gray-500);
    transition: transform 0.2s;
}
.dropdown-check.open .bi-chevron-down { transform: rotate(180deg); }
.dropdown-check-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1080;
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 260px;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.dropdown-check.open .dropdown-check-panel { display: block; }
.dc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
}
.dc-item:hover { background: var(--gray-100); }
.dc-item input[type="checkbox"] { margin: 0; cursor: pointer; }
.dc-group-label {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dc-empty {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--gray-500);
}
.dc-search {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    z-index: 1;
}
.dc-search i { color: var(--gray-500); font-size: 0.8125rem; }
.dc-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.875rem;
    background: transparent;
}
.dc-collab-list .dc-group-label {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

/* ==================== 按钮 ==================== */
.btn { font-size: 13px; padding: 8px 16px; border-radius: 8px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-sm { font-size: 12px; padding: 4px 10px; }

/* 统一按钮系统：次要 / 幽灵 / 危险幽灵（设计皮肤 P0） */
.btn-secondary { background: #fff; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-900); }
.btn-ghost { background: transparent; border: none; color: var(--primary); padding: 6px 10px; border-radius: 8px; }
.btn-ghost:hover { background: var(--primary-light); }
.btn-ghost-danger { background: transparent; border: none; color: var(--gray-500); padding: 6px 10px; border-radius: 8px; transition: all .15s; }
.btn-ghost-danger:hover { background: var(--danger-light); color: var(--danger); }

/* ==================== 匹配结果 ==================== */
.match-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
    transition: box-shadow .2s;
}

.match-card:hover { box-shadow: var(--shadow-md); }

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.match-name { font-size: 15px; font-weight: 700; }
.match-name .policy-link { color: inherit; text-decoration: none; transition: color 0.15s; }
.match-name .policy-link:hover { color: var(--primary, #2563eb); text-decoration: underline; }

.elig-result-panel { margin-top: 0; }
.elig-result-panel .elig-row:last-child { border-bottom: none !important; }
.elig-summary.text-success { background: #ecfdf5 !important; }
.elig-summary.text-warning { background: #fffbeb !important; }
.elig-summary.text-danger { background: #fef2f2 !important; }

.match-score {
    font-size: 20px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 8px;
}

.match-score-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.score-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500, #6b7280);
    font-size: 16px;
    cursor: help;
    position: relative;
    transition: color 0.15s;
}
.score-info:hover, .score-info:focus { color: var(--primary, #2563eb); outline: none; }

.score-tip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 150%;
    right: -6px;
    width: 248px;
    background: #1f2937;
    color: #fff;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 400;
    font-style: normal;
    text-align: left;
    padding: 9px 11px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    transition: opacity 0.15s ease;
    z-index: 60;
    pointer-events: none;
}
.score-tip b { color: #93c5fd; font-weight: 700; }
.score-tip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: #1f2937;
}
.score-info:hover .score-tip,
.score-info:focus .score-tip { visibility: visible; opacity: 1; }

.score-high { background: var(--success-light); color: var(--success); }
.score-mid { background: var(--warning-light); color: var(--warning); }
.score-low { background: var(--gray-100); color: var(--gray-500); }

.match-reasons { list-style: none; padding: 0; }
.match-reasons li {
    font-size: 12px;
    color: var(--gray-700);
    padding: 3px 0;
    padding-left: 18px;
    position: relative;
}
.match-reasons li::before {
    content: "\F26E";
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    color: var(--success);
    font-size: 12px;
}

/* ==================== 跟踪时间线 ==================== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 0; bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-content {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.timeline-date { font-size: 12px; color: var(--gray-500); }

/* ==================== 工作台编辑模式 ==================== */
.widget-editing {
    border: 2px dashed var(--primary) !important;
    position: relative;
}
.stat-card.widget-editing { border-radius: 10px; }

.widget-dragging {
    opacity: 0.4;
}

.widget-edit-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--gray-200);
}

.widget-drag-handle {
    color: var(--gray-400);
    font-size: 16px;
    cursor: grab;
}
.widget-drag-handle:active { cursor: grabbing; }

.widget-edit-label {
    flex-grow: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}

.widget-edit-actions {
    display: flex;
    gap: 4px;
}

.widget-edit-btn {
    padding: 2px 8px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}

/* 添加组件弹窗 */
.add-widget-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.add-widget-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.add-widget-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.add-widget-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.add-widget-info { flex-grow: 1; }
.add-widget-info > div { font-weight: 600; font-size: 15px; color: var(--gray-800); }
.add-widget-type {
    display: inline-block;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ==================== 表单 ==================== */
.form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.form-control, .form-select {
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
}
.form-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==================== 搜索栏 ==================== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-bar .form-control { max-width: 300px; }

/* ==================== 状态筛选下拉 ==================== */
.status-filter-dropdown { position: relative; }
.status-filter-dropdown .btn-outline-secondary {
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; height: 38px; padding: 0 14px;
    font-size: 0.8125rem; font-weight: 500;
}
.status-filter-dropdown .btn-outline-secondary:hover {
    background: var(--gray-50);
}
.status-filter-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    list-style: none;
    padding: 6px 0;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
}
.status-filter-menu.show { display: block; }
.status-filter-menu li a {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    font-size: 0.8125rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.15s;
}
.status-filter-menu li a:hover {
    background: var(--gray-50);
    color: var(--primary);
}
.status-filter-menu li a .tag { font-size: 11px; }

/* 页头按钮统一样式 */
.page-header .btn-primary {
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; height: 38px; padding: 0 16px;
    font-size: 0.8125rem; font-weight: 500;
}
.page-header .active-tab-btn {
    background: #1e40af;
    border-color: #1e40af;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    cursor: default;
    opacity: 1;
}

/* ==================== 页头 tab 栏宽度自适应（项目库 / 跟进库） ====================
   要解决的问题：顶部那一排 tab（项目列表 / 我负责的 / 我关注的 / 标签 / 招商看板 /
   跟踪管理 / 回收站 / 批量管理）+ 右侧操作按钮，在宽屏（Mac）一行放得下，在窄一点的屏
   （Surface）就放不下，被 flex-wrap 挤到第二行，页头忽高忽低、排版来回跳。
   做法：JS（projects.js: fitProjectHeader）量容器可用宽度，放不下就逐级加档位 class，
   档位越深按钮越紧凑；4 档仍放不下才允许按钮等分压缩 + 文字省略——宁可挤一点也不换行。
   ⚠️ gap 一律加 !important：Bootstrap 的 .gap-2 自带 !important，不加压不住。
   ⚠️ 档位名与 projects.js 的 KJ_HD_LEVELS 一一对应，改名字两边要同步。 */
.page-header.kj-hd-fit { flex-wrap: nowrap; }
.page-header.kj-hd-fit > .kj-hd-group { flex-wrap: nowrap; min-width: 0; flex: 0 1 auto; }
.page-header.kj-hd-fit .btn { flex: 0 0 auto; min-width: 0; overflow: hidden; }
.page-header.kj-hd-fit .btn > .kj-hd-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 同理：操作组内的输入框 / 下拉框也必须允许收缩。
   flex item 默认 min-width:auto 会以控件固有宽度（input 的 size 属性 ≈200px）为下限拒绝收缩，
   即使 flex-shrink:1 也压不下去 —— 联系人页搜索框内联 width:200px + 2 个按钮在 375px 屏
   必然把 nowrap 的组撑出视口（实测按钮 right:403 > 视口 375，被 .main-content overflow:hidden 裁掉）。
   加 min-width:0 解除阻碍，收缩量按 flex-basis 比例在各子项间分配。（2026-09-13 实测修复） */
.page-header.kj-hd-fit .kj-hd-group > input,
.page-header.kj-hd-fit .kj-hd-group > select,
.page-header.kj-hd-fit .kj-hd-group > textarea { min-width: 0; }

/* L1 轻收：左右内边距 16 → 12 */
.page-header.kj-hd-l1 .btn { padding-left: 12px; padding-right: 12px; }

/* L2 中收：内边距 → 9，字号 13 → 12.5，图标与文字间距收窄，组间距 8 → 6 */
.page-header.kj-hd-l2 .btn { padding-left: 9px; padding-right: 9px; font-size: 12.5px; gap: 4px; }
.page-header.kj-hd-l2 > .kj-hd-group { gap: 6px !important; }

/* L3 紧收：隐去图标只留文字（title 悬浮提示还在，认得出是哪个按钮） */
.page-header.kj-hd-l3 .btn { padding-left: 8px; padding-right: 8px; font-size: 12px; }
.page-header.kj-hd-l3 .btn > .bi { display: none; }
.page-header.kj-hd-l3 > .kj-hd-group { gap: 5px !important; }
.page-header.kj-hd-l3 { gap: 8px; }

/* L4 兜底：按钮允许等分压缩、文字超出省略 —— 保证任何宽度都不会掉到第二行 */
.page-header.kj-hd-l4 .btn { flex: 1 1 auto; padding-left: 5px; padding-right: 5px; font-size: 11.5px; }
.page-header.kj-hd-l4 > .kj-hd-group { gap: 4px !important; }
.page-header.kj-hd-l4 { gap: 6px; }

