/* ==========================================================================
   天罡平台 · 组件样式层
   职责：表格、查询区、表单、抽屉、弹窗、标签、分页、详情、时间轴、图表容器、
        大屏容器、AI 对话、登录页、业务页专用小组件。
   设计意图：只写「结构性组件」，颜色与间距全部复用 base.css 的设计令牌，
            避免业务页面各自造样式；所有组件在深浅色主题下都可读。
   ========================================================================== */

/* ---------- 1. 表格 ---------- */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-toolbar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table-toolbar .tt-title { font-size: calc(13px + var(--fs-bump)); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.table-toolbar .spacer { flex: 1; }
.table-wrap { position: relative; overflow: auto; max-height: calc(100vh - 360px); min-height: 180px; }
.table-wrap.no-max { max-height: none; }
/* 固定布局 + 100% 宽：列宽以 colgroup 配置为准，列总宽超出视口时由 .table-wrap 横向滚动，
   避免 width:max-content 被超长单元格内容撑开、进而放大固定列的遮挡范围 */
.tg-table { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0; font-size: calc(12.5px + var(--fs-bump)); color: var(--text-2); }
.tg-table thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface-3); color: var(--text-2);
  font-weight: 600; text-align: left; padding: 9px 10px; white-space: nowrap;
  border-bottom: 1px solid var(--border); font-size: calc(12px + var(--fs-bump)); user-select: none;
  overflow: hidden; text-overflow: ellipsis;
}
/* 表头文字：列宽不足时省略而不是溢出压到相邻列（完整名称见 th title 悬浮提示）。
   必须用 inline-block 而非 block——block 会把后面的排序标识挤到第二行；
   max-width 按列宽百分比自适应，字体放大后仅文字省略，排序标识始终留在同一行。 */
.tg-table thead th > span:first-child {
  display: inline-block; max-width: 100%; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 可排序列：为右侧排序标识预留约 1.7em（随字号自动缩放，兼容「▲1」多列排序标识），
   保证「文字 + 标识」单行不换行，列宽不足时只截断文字 */
.tg-table thead th.sortable > span:first-child { max-width: calc(100% - 1.7em); }
/* 排序标识为空时（自定义表格未排序）不预留空间，避免短字段名被无谓截断；
   浏览器不支持 :has 时该条自动忽略，仍保留上面的预留，不会破版 */
.tg-table thead th.sortable:has(> .sort-ind:empty) > span:first-child { max-width: 100%; }
.tg-table thead th.sortable { cursor: pointer; }
.tg-table thead th.sortable:hover { color: var(--brand); }
.tg-table thead th .sort-ind {
  display: inline-block; vertical-align: middle; white-space: nowrap;
  margin-left: 4px; color: var(--text-3); font-size: calc(9px + var(--fs-bump));
}
.tg-table thead th.sorted { color: var(--brand); }
.tg-table thead th .col-resize {
  position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: col-resize;
  z-index: 8; touch-action: none;
}
.tg-table thead th .col-resize::before {
  content: ""; position: absolute; left: 3px; top: 22%; bottom: 22%; width: 2px;
  border-radius: 2px; background: transparent; transition: background var(--speed);
}
.tg-table thead th .col-resize:hover::before { background: var(--brand); }
.tg-table tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-table tbody tr { transition: background var(--speed), box-shadow var(--speed); }
.tg-table tbody tr:nth-child(even) { background: var(--surface-2); }
/* 悬停：中性加深底色，不与选中态抢色 */
.tg-table tbody tr:hover { background: var(--surface-3); }
/* 选中资产高亮：品牌填充 + 左侧 3px 标记条 + 1px 品牌描边。
   底色与描边落在 td 上——td 自身底色会遮盖 tr 的 box-shadow，写在 tr 上会丢失左侧标记条 */
.tg-table tbody tr.selected { background-color: var(--select-bg); }
.tg-table tbody tr.selected > td {
  background-color: var(--select-bg);
  box-shadow: inset 0 1px 0 var(--brand), inset 0 -1px 0 var(--brand);
}
.tg-table tbody tr.selected > td:first-child {
  box-shadow: inset 3px 0 0 var(--brand), inset 0 1px 0 var(--brand), inset 0 -1px 0 var(--brand);
}
.tg-table tbody tr.selected > td:last-child {
  box-shadow: inset -1px 0 0 var(--brand), inset 0 1px 0 var(--brand), inset 0 -1px 0 var(--brand);
}
.tg-table tbody tr.selected:hover > td { background-color: var(--select-bg); }
.tg-table tbody tr.selected .cell-main { color: var(--text); font-weight: 600; }
.tg-table input[type="checkbox"] { accent-color: var(--brand); }
/* 从工单跳转台账时的定位高亮 */
.tg-table tbody tr.row-highlight { background: var(--select-bg); box-shadow: inset 3px 0 0 var(--brand); animation: row-highlight 1.2s ease-out; }
@keyframes row-highlight {
  from { background: var(--surface-3); }
  to { background: var(--select-bg); }
}
.tg-table tbody tr.clickable { cursor: pointer; }
.tg-table tbody tr:last-child td { border-bottom: 0; }
.tg-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tg-table .center { text-align: center; }
.tg-table .col-check { width: 38px; }
.tg-table .col-idx { width: 46px; color: var(--text-3); }
.tg-table .col-actions { width: auto; white-space: nowrap; }
/* 操作列统一规格：单元格与按钮均垂直居中，避免多按钮高低不一 */
.tg-table th.col-actions, .tg-table td.col-actions,
.tg-table th.col-actions-sticky, .tg-table td.col-actions-sticky,
.tg-table th.col-ops, .tg-table td.col-ops, .tg-table td.ops { vertical-align: middle; }
.tg-table td.col-actions > .btn, .tg-table td.col-actions-sticky > .btn,
.tg-table td.col-ops > .btn, .tg-table td.ops > .btn { vertical-align: middle; }
/* 操作列多个按钮之间的间距（字号放大后按钮更宽，需留出间隔避免粘连） */
.tg-table .col-actions .btn + .btn { margin-left: 6px; }
/* 「…」更多触发器：幽灵按钮，hover 变实体，aria-haspopup 标记语义 */
.tg-table .col-actions .more-trigger { padding: 2px 8px; min-width: 30px; font-weight: 700; letter-spacing: 0; font-size: 15px; line-height: 1; }
.tg-table .col-actions .more-trigger::before { content: ''; }
.tg-table .cell-main { color: var(--text); font-weight: 500; }
/* 长文本单元格（如「合规发现问题 · 问题描述」）：默认单行截断并显示省略号，
   点「展开 / 收起」在原地换行展示完整内容，不弹出、不遮挡其他字段 */
.tg-table .lt-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tg-table .lt-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-table .lt-toggle {
  flex: 0 0 auto; border: 0; background: none; padding: 0; margin: 0;
  color: var(--brand); font-size: inherit; font-weight: 400; line-height: inherit; cursor: pointer;
}
.tg-table .lt-toggle:hover { text-decoration: underline; }
.tg-table td.lt-open { white-space: normal; }
.tg-table .lt-cell.expanded { display: block; }
.tg-table .lt-cell.expanded .lt-text { white-space: pre-wrap; word-break: break-word; overflow: visible; }
.tg-table .lt-cell.expanded .lt-toggle { margin-top: 4px; }
.tg-table .cell-sub { font-size: calc(10.5px + var(--fs-bump)); color: var(--text-3); margin-top: 2px; }
.tg-table .mono { font-family: var(--mono); font-size: calc(11.5px + var(--fs-bump)); }
.tg-table .sensitive { letter-spacing: 1px; color: var(--text-3); }
.tg-table td.sticky-col, .tg-table th.sticky-col {
  position: sticky; z-index: 4; background: var(--surface);
}
.tg-table thead th.sticky-col { z-index: 7; background: var(--surface-3); }
.tg-table tbody tr:nth-child(even) td.sticky-col { background: var(--surface-2); }
.tg-table tbody tr:hover td.sticky-col { background: var(--surface-3); }
/* 固定列有独立底色，须在斑马纹/悬停之后再次覆盖，否则选中行左侧固定区会出现色差断层 */
.tg-table tbody tr.selected td.sticky-col { background: var(--select-bg); }
.tg-table td.sticky-col::after, .tg-table th.sticky-col::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
  background: var(--border); box-shadow: 4px 0 6px -4px rgba(16,38,68,.15);
}
.tg-table tr.row-danger td { background: var(--danger-weak) !important; }
.tg-table tr.row-warn td { background: var(--warning-weak) !important; }
.tg-table .tag { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.tg-table .btn-xs { opacity: .72; }
.tg-table tr:hover .btn-xs, .tg-table tr.selected .btn-xs { opacity: 1; }

/* 操作列右固定：长内容（如检查项多选项）触发横向滚动时，编辑/删除等按钮始终贴在可视区右侧 */
.tg-table th.col-actions-sticky, .tg-table td.col-actions-sticky {
  position: sticky; right: 0; z-index: 5; background: var(--surface);
  white-space: nowrap; box-shadow: -6px 0 8px -6px rgba(16, 38, 68, .18);
}
.tg-table thead th.col-actions-sticky { z-index: 8; background: var(--surface-3); }
.tg-table tbody tr:nth-child(even) td.col-actions-sticky { background: var(--surface-2); }
.tg-table tbody tr:hover td.col-actions-sticky { background: var(--surface-3); }
.tg-table tbody tr.selected td.col-actions-sticky { background: var(--select-bg); }

/* 操作列「更多」菜单（fixed 浮层，避免被表格滚动裁剪） */
.more-menu {
  position: fixed; z-index: 1200; min-width: 158px; max-width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 5px; max-height: 62vh; overflow: auto;
}
.more-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; color: var(--text); text-align: left;
  padding: 7px 10px; border-radius: 5px; font-size: calc(13px + var(--fs-bump)); cursor: pointer;
}
.more-menu-item:hover { background: var(--brand-weak); color: var(--brand); }
.more-menu-item.danger { color: var(--danger); }
.more-menu-item.danger:hover { background: var(--danger-weak); }
.more-menu-item .mm-icon { width: 16px; text-align: center; color: var(--text-3); }
.more-menu-item .mm-label { flex: 1; }

/* 采集明细台账：按语义列宽分配，指标名称列固定宽度并允许换行，避免等分列宽造成列间空隙过大 */
.m4c-table { table-layout: fixed; }
.m4c-table col.c-check { width: 38px; }
.m4c-table col.c-code { width: 120px; }
.m4c-table col.c-name { width: 300px; }
.m4c-table col.c-period { width: 110px; }
.m4c-table col.c-status { width: 160px; }
.m4c-table col.c-value { width: 110px; }
.m4c-table col.c-level { width: 88px; }
.m4c-table col.c-user { width: 100px; }
.m4c-table col.c-ops { width: 80px; }
.m4c-table tbody td:nth-child(3) { white-space: normal; word-break: break-word; }

/* 密度 */
.density-compact .tg-table tbody td { padding: 5px 9px; }
.density-compact .tg-table thead th { padding: 6px 9px; }
.density-loose .tg-table tbody td { padding: 12px 12px; }
.density-loose .tg-table thead th { padding: 11px 12px; }

/* 表格底部与分页 */
.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: calc(12px + var(--fs-bump)); color: var(--text-3); flex-wrap: wrap;
}
.pager { display: flex; align-items: center; gap: 4px; }
.pager button {
  min-width: 28px; height: 25px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 5px; color: var(--text-2); font-size: calc(12px + var(--fs-bump)); padding: 0 6px;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .pager-ellipsis { color: var(--text-3); padding: 0 2px; }
.pager select, .pager input { height: 25px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); padding: 0 5px; font-size: calc(12px + var(--fs-bump)); }
.pager input { width: 44px; text-align: center; }
.table-selbar {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--select-bg); color: var(--text); font-weight: 600;
  font-size: calc(12px + var(--fs-bump)); border-bottom: 1px solid var(--border);
}

/* 列设置浮层 */
.colset-panel {
  position: absolute; top: 44px; right: 12px; width: 270px; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px 11px;
}
.colset-head { font-size: calc(12px + var(--fs-bump)); font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 7px; }
.colset-list { max-height: 300px; overflow: auto; }
.colset-item { display: flex; align-items: center; gap: 7px; padding: 5px 4px; border-radius: 4px; font-size: calc(12px + var(--fs-bump)); cursor: grab; }
.colset-item:hover { background: var(--surface-3); }
.colset-item.dragging { opacity: .45; border: 1px dashed var(--brand); }
.colset-item .ci-drag { color: var(--text-3); font-size: calc(10px + var(--fs-bump)); }
.colset-item .ci-label { flex: 1; }
.colset-item input { accent-color: var(--brand); }
.colset-foot { border-top: 1px solid var(--border); margin-top: 7px; padding-top: 7px; display: flex; gap: 6px; }

/* ---------- 2. 查询区 ---------- */
.query-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 11px 13px; box-shadow: var(--shadow-sm); }
/* 紧凑列表布局（如用户管理）：查询区并入「数据列表」工具行时去除卡片化样式 */
.table-toolbar .query-card { background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.table-toolbar .query-card .q-search input { width: 220px; }
.query-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-search { position: relative; display: flex; align-items: center; }
.q-search input {
  width: 280px; height: 31px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); padding: 0 30px 0 10px; outline: none; font-size: calc(12.5px + var(--fs-bump));
}
.q-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-weak); }
.q-search .qs-btn { position: absolute; right: 2px; border: 0; background: none; color: var(--text-3); width: 26px; height: 26px; border-radius: 4px; }
.q-advanced { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px 13px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--border); }
.q-advanced.hidden { display: none; }
/* P1-6：高频条件 + 更多条件 分层展示（v2 结构下 q-advanced 仅作容器） */
.q-advanced.q-v2 { display: block; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px 13px; }
.q-grid + .q-grid { margin-top: 9px; }
.q-more-toggle { margin-top: 9px; }
.q-active-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.q-actions-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 10px; padding: 9px 0 2px; border-top: 1px solid var(--border); background: var(--surface);
}
.q-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-item > label { font-size: calc(11.5px + var(--fs-bump)); color: var(--text-3); }
.q-item .q-range { display: flex; align-items: center; gap: 5px; }
.q-item .q-range input { width: 50%; }
.q-actions { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.q-tip { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); margin-left: auto; }

/* 通用输入控件 */
.inp, .sel, .txt {
  height: 30px; width: 100%; border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); color: var(--text); padding: 0 9px; outline: none;
  font-size: calc(12.5px + var(--fs-bump)); transition: border-color var(--speed), box-shadow var(--speed);
}
.inp:focus, .sel:focus, .txt:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-weak); }
.inp:disabled, .sel:disabled, .txt:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.inp.sm { height: 26px; font-size: calc(12px + var(--fs-bump)); }
.txt { height: auto; min-height: 70px; padding: 7px 9px; resize: vertical; line-height: 1.55; }
.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 13px) 13px, calc(100% - 8px) 13px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.inp::placeholder, .txt::placeholder { color: var(--text-3); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .inp { padding-right: 30px; }
.input-wrap .iw-btn { position: absolute; right: 4px; border: 0; background: none; color: var(--text-3); font-size: calc(12px + var(--fs-bump)); padding: 3px 5px; border-radius: 3px; }
.input-wrap .iw-btn:hover { background: var(--surface-3); color: var(--text); }

/* 多选下拉（查询区 in 模式） */
.ms { position: relative; }
.ms-trigger {
  min-height: 30px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
  padding: 3px 24px 3px 7px; display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
  cursor: pointer; font-size: calc(12px + var(--fs-bump)); color: var(--text-3); position: relative;
}
.ms-trigger::after { content: "▾"; position: absolute; right: 8px; top: 7px; color: var(--text-3); font-size: calc(9px + var(--fs-bump)); }
.ms-trigger .tag { height: 18px; font-size: calc(10.5px + var(--fs-bump)); }
.ms-panel {
  position: absolute; z-index: 50; top: calc(100% + 3px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: var(--shadow); max-height: 220px; overflow: auto; padding: 5px;
}
.ms-opt { display: flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 4px; font-size: calc(12px + var(--fs-bump)); cursor: pointer; }
.ms-opt:hover { background: var(--surface-3); }
.ms-opt input { accent-color: var(--brand); }
/* 关键字筛选框吸顶，滚动选项时始终可见 */
.ms-search { position: sticky; top: 0; z-index: 1; width: 100%; margin-bottom: 4px; background: var(--surface); }
.ms-empty { padding: 6px 8px; font-size: calc(12px + var(--fs-bump)); color: var(--text-3); }

/* ---------- 3. 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form-field-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.form-field-toolbar .inp { min-width: 260px; }
.form-field-toolbar .chk-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-item.full { grid-column: 1 / -1; }
.form-item > label { font-size: calc(12px + var(--fs-bump)); color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.form-item > label .req { color: var(--danger); font-weight: 700; }
.form-item > label .q-mark {
  display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-3); font-size: calc(9px + var(--fs-bump)); cursor: help;
}
.form-item .field-help { font-size: calc(10.5px + var(--fs-bump)); color: var(--text-3); }
.form-item .field-error { font-size: calc(10.5px + var(--fs-bump)); color: var(--danger); }
.form-item.invalid .inp, .form-item.invalid .sel, .form-item.invalid .txt { border-color: var(--danger); }

/* 修改密码弹窗 */
.pwd-form { display: flex; flex-direction: column; gap: 12px; }
.pwd-form .field-error { min-height: 14px; line-height: 1.4; }
.pwd-form .input-wrap .inp { padding-right: 44px; }
.pwd-rule-box { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.pwd-strength { display: flex; align-items: center; gap: 8px; }
.pwd-strength-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pwd-strength-bar > i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--text-3); transition: width .18s ease, background .18s ease; }
.pwd-strength-bar > i.weak { background: var(--danger); }
.pwd-strength-bar > i.medium { background: var(--warning); }
.pwd-strength-bar > i.strong { background: var(--success); }
.pwd-strength-text { font-size: calc(10.5px + var(--fs-bump)); color: var(--text-3); min-width: 54px; text-align: right; }
.pwd-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: calc(10.5px + var(--fs-bump)); color: var(--text-3); }
.pwd-rules li::before { content: "○ "; }
.pwd-rules li.ok { color: var(--success); }
.pwd-rules li.ok::before { content: "✓ "; }
.pwd-rules li.bad { color: var(--danger); }
.pwd-rules li.bad::before { content: "✕ "; }
.pwd-rules li.opt { color: var(--text-3); }
.pwd-rules li.opt.ok { color: var(--success); }
.pwd-optional { font-size: calc(10px + var(--fs-bump)); color: var(--text-3); font-weight: 400; }
.pwd-code-row { display: flex; gap: 8px; align-items: center; }
.pwd-code-row .inp { flex: 1; min-width: 0; }
.pwd-code-row .btn { flex: none; }
.pwd-form-err { min-height: 16px; font-size: calc(11.5px + var(--fs-bump)); color: var(--danger); }
.form-sec { border-bottom: 1px dashed var(--border); padding-bottom: 4px; margin-bottom: 4px; font-size: calc(13px + var(--fs-bump)); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; grid-column: 1 / -1; }
.form-sec::before { content: ""; width: 3px; height: 13px; background: var(--brand); border-radius: 2px; }
.form-sec .fs-fold { margin-left: auto; font-size: calc(11px + var(--fs-bump)); color: var(--text-3); cursor: pointer; font-weight: 400; }
.form-sec-collapsed { display: none; }
.radio-row, .check-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; min-height: 30px; font-size: calc(12.5px + var(--fs-bump)); }
.radio-row label, .check-row label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.radio-row input, .check-row input { accent-color: var(--brand); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sw-slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 10px; transition: var(--speed); cursor: pointer; }
.switch .sw-slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: var(--speed); }
.switch input:checked + .sw-slider { background: var(--brand); }
.switch input:checked + .sw-slider::before { transform: translateX(16px); }
.upload-box {
  border: 1px dashed var(--border-strong); border-radius: 6px; padding: 9px;
  background: var(--surface-2); font-size: calc(12px + var(--fs-bump)); color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.upload-box:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); }
.upload-box .up-file { color: var(--text); }
/* 佐证材料清单 */
.material-list { margin-bottom: 6px; }
.material-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.material-name { flex: 1; min-width: 0; font-size: calc(12px + var(--fs-bump)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-del { flex: none; cursor: pointer; color: var(--danger); font-weight: 600; padding: 0 2px; }
.json-status { font-size: calc(10.5px + var(--fs-bump)); }
.json-status.ok { color: var(--success); }
.json-status.bad { color: var(--danger); }
.form-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface);
}

/* ref_select 下拉 */
.ref-select { position: relative; }
.ref-panel {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: var(--shadow); max-height: 220px; overflow: auto;
}
.ref-opt { padding: 7px 9px; font-size: calc(12px + var(--fs-bump)); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.ref-opt:hover { background: var(--brand-weak); }
.ref-opt small { color: var(--text-3); font-family: var(--mono); }
.ref-empty { padding: 10px; text-align: center; color: var(--text-3); font-size: calc(11.5px + var(--fs-bump)); }

/* ---------- 4. 弹窗 / 抽屉 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 18, 33, .46); z-index: 8000;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 18px 24px;
  overflow: auto; animation: mask-in .16s ease-out;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 880px; max-width: 100%; display: flex; flex-direction: column; max-height: calc(100vh - 100px);
  animation: modal-in .2s ease-out; border: 1px solid var(--border); position: relative;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal.sm { width: 460px; }
.modal.md { width: 640px; }
.modal.lg { width: 1040px; }
.modal.xl { width: 1240px; }
/* 检查项目编辑：加宽以完整展示检查项长文本与逐选项评分；表格单元格允许换行 */
.modal.ct-project-modal { width: 1500px; max-width: 96vw; }
.modal.ct-project-modal .tg-table.ct-items-table tbody td {
  white-space: normal; overflow: visible; text-overflow: clip; vertical-align: top;
}
/* 新建采集任务（任务定制）弹窗：加宽加高，双列表单与指标定制表有充足空间 */
.modal.plan-wizard { width: 1440px; }
.modal.plan-wizard .modal-body { min-height: 64vh; padding: 18px 24px; }
/* 采集任务定制表单：统一标签高度、控件宽度、间距与行高，保证各类别指标表单对齐一致 */
.modal.plan-wizard .form-grid.two { gap: 14px 22px; }
.modal.plan-wizard .form-item { gap: 6px; }
.modal.plan-wizard .form-item > label { min-height: 18px; }
.modal.plan-wizard .form-item > .inp,
.modal.plan-wizard .form-item > .sel { width: 100%; height: 34px; box-sizing: border-box; }
.modal.plan-wizard .form-item > textarea.inp { height: 56px; }
.modal.plan-wizard .form-item > .flex { width: 100%; min-height: 34px; box-sizing: border-box; }
.modal.plan-wizard .form-item > .muted { min-height: 16px; line-height: 16px; }
.modal.plan-wizard .form-item .tg-combo { width: 100%; display: block; }
.modal.plan-wizard .form-item .tg-combo-input { width: 100%; height: 34px; box-sizing: border-box; }
.modal.plan-wizard .tg-table { width: 100%; }
.modal.plan-wizard .tg-table .tg-combo { width: 100%; display: block; }
.modal.plan-wizard .tg-table .tg-combo-input { width: 100%; height: 32px; box-sizing: border-box; }
.modal.plan-wizard .tg-table thead th { height: 40px; }
.modal.plan-wizard .tg-table tbody td { height: 42px; }
.modal.plan-wizard .tg-table .sel { width: 100%; height: 32px; box-sizing: border-box; }
/* 发起工单弹窗：宽度较 lg 收窄、高度加高，人员选择器有充足纵向空间 */
.modal.wo { width: 700px; }
.modal.wo .modal-body { min-height: 45vh; }
/* 流程发起弹窗：纵向拉长，人员/资产选择下拉与多字段表单有充足空间 */
.modal.bpm-launch { width: 720px; }
.modal.bpm-launch .modal-body { min-height: 58vh; }
.modal-head { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex: none; }
.modal-head .mh-title { font-size: calc(14.5px + var(--fs-bump)); font-weight: 700; flex: 1; }
.modal-head .mh-close { border: 0; background: none; font-size: calc(17px + var(--fs-bump)); color: var(--text-3); width: 26px; height: 26px; border-radius: 5px; }
.modal-head .mh-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 16px; overflow: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); flex: none; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-foot .mf-left { margin-right: auto; font-size: calc(11.5px + var(--fs-bump)); color: var(--text-3); }
.modal-msg { font-size: calc(13px + var(--fs-bump)); color: var(--text-2); line-height: 1.65; white-space: pre-wrap; }

/* 导出字段选择 */
.export-fields { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-top: 12px; background: var(--surface-2); }
.export-fields-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.export-fields-head .ef-title { flex: 1; font-size: calc(12.5px + var(--fs-bump)); font-weight: 700; }
.export-fields-head .export-count { font-size: calc(11.5px + var(--fs-bump)); color: var(--text-3); }
.export-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; max-height: 240px; overflow: auto; }
.ef-item { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 4px; font-size: calc(12.5px + var(--fs-bump)); cursor: pointer; min-width: 0; }
.ef-item:hover { background: var(--surface-3); }
.ef-item input { accent-color: var(--brand); flex: none; }
.ef-item .ef-label { flex: 0 0 auto; }
.ef-item small { color: var(--text-3); font-size: calc(10.5px + var(--fs-bump)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 字段管理（自定义字段） */
.cf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cf-head .cf-tip { font-size: calc(12.5px + var(--fs-bump)); color: var(--text-3); flex: 1; }
.cf-form-title { font-size: calc(13.5px + var(--fs-bump)); font-weight: 700; margin: 12px 0 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.cf-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* 字段管理：页签分层 */
.cf-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-top: 6px; }
.cf-tab {
  display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer;
  padding: 8px 12px; font-size: calc(12.5px + var(--fs-bump)); color: var(--text-3);
  border-bottom: 2px solid transparent; transition: color var(--speed);
}
.cf-tab em { font-style: normal; font-size: calc(11px + var(--fs-bump)); color: var(--text-3); }
.cf-tab:hover { color: var(--text); }
.cf-tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.cf-tab.on em { color: var(--brand); }

/* 字段管理：模糊搜索与显隐筛选 */
.cf-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.cf-filter-bar .inp { flex: 0 1 260px; }
.cf-filter-bar .sel { flex: 0 0 auto; width: auto; min-width: 112px; }
.cf-filter-count { margin-left: auto; color: var(--text-3); font-size: calc(11.5px + var(--fs-bump)); }

/* 字段管理：表格列宽与勾选框 */
.cf-table { width: 100%; min-width: 0; }
.cf-table th:nth-child(1) { width: 17%; }
.cf-table th:nth-child(2) { width: 17%; }
.cf-table th:nth-child(3) { width: 9%; }
.cf-table th:nth-child(4) { width: 24%; }
.cf-table th:nth-child(5), .cf-table th:nth-child(6), .cf-table th:nth-child(7) { width: 8%; text-align: center; }
.cf-table th:nth-child(8) { width: 9%; }
.cf-check-cell { text-align: center; }
.cf-check { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cf-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.cf-code { font-family: var(--mono); font-size: calc(11.5px + var(--fs-bump)); color: var(--text-3); }
.cf-scope { font-size: calc(12px + var(--fs-bump)); color: var(--text-2); }
.cf-scope-main { color: var(--text-1); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-scope-sub { color: var(--text-3); font-size: calc(11px + var(--fs-bump)); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 生效范围多选芯片 */
.scope-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scope-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: calc(12px + var(--fs-bump));
  cursor: pointer;
  transition: all .15s ease;
}
.scope-chip:hover { border-color: var(--brand); color: var(--brand); }
.scope-chip.on {
  background: var(--select-bg, var(--brand-weak));
  border-color: var(--brand);
  color: var(--brand);
}
.scope-ro-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: calc(11px + var(--fs-bump));
  color: var(--text-3);
  background: var(--surface-2, rgba(0,0,0,.04));
  font-weight: 400;
}
.field-readonly .inp,
.field-readonly .sel,
.field-readonly .txt,
.field-readonly .switch,
.field-readonly .btn { opacity: .75; }

/* 字段管理：内联编辑面板（保存 / 撤销 / 取消） */
.cf-editor { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 12px 14px; margin-bottom: 10px; }
.cf-editor-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cf-editor-title { font-size: calc(13.5px + var(--fs-bump)); font-weight: 700; }
.cf-editor-badge { font-size: calc(11px + var(--fs-bump)); padding: 2px 8px; border-radius: 10px; color: var(--brand); background: var(--brand-weak); }
.cf-editor-badge.builtin { color: var(--text-2); background: var(--surface-3); }
.cf-editor .form-grid { gap: 10px 14px; }
.cf-hint { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); }

@media (max-width: 900px) {
  .cf-editor .form-grid { grid-template-columns: 1fr; }
  .cf-filter-bar .inp { flex: 1 1 100%; }
  .cf-filter-count { margin-left: 0; }
  /* 窄屏隐藏「生效范围」，优先保证名称/编码/类型与三个开关可用 */
  .cf-table th:nth-child(4), .cf-table td:nth-child(4) { display: none; }
  .cf-table th:nth-child(1) { width: 25%; }
  .cf-table th:nth-child(2) { width: 23%; }
  .cf-table th:nth-child(3) { width: 13%; }
  .cf-table th:nth-child(5), .cf-table th:nth-child(6), .cf-table th:nth-child(7) { width: 8.5%; }
  .cf-table th:nth-child(8) { width: 13%; }
}

@media (max-width: 640px) {
  .cf-head { flex-wrap: wrap; }
  /* 手机端保留全部列，允许表格横向滚动 */
  .cf-table { min-width: 620px; }
}

.drawer-mask { position: fixed; inset: 0; background: rgba(8, 18, 33, .36); z-index: 7900; display: flex; justify-content: flex-end; animation: mask-in .16s ease-out; }
.drawer {
  width: 640px; max-width: 94vw; height: 100%; background: var(--surface);
  box-shadow: -8px 0 30px rgba(8,18,33,.18); display: flex; flex-direction: column;
  animation: drawer-in .22s ease-out; border-left: 1px solid var(--border);
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex: none; }
.drawer-head .dh-title { font-size: calc(14.5px + var(--fs-bump)); font-weight: 700; flex: 1; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 16px; }
.drawer-foot { flex: none; border-top: 1px solid var(--border); padding: 10px 16px; display: flex; justify-content: flex-end; gap: 8px; }
.drawer.sm { width: 480px; }
.drawer.md { width: 640px; }
.drawer.lg { width: 780px; }
.drawer.xl { width: 1020px; }

/* 加载遮罩内的旋转器（ui.loading 使用） */
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 22px; box-shadow: var(--shadow); }
.loading-spinner { width: 22px; height: 22px; border: 2.5px solid var(--brand-weak); border-top-color: var(--brand); border-radius: 50%; animation: tg-spin .8s linear infinite; }
@keyframes tg-spin { to { transform: rotate(360deg); } }
.loading-text { font-size: calc(12px + var(--fs-bump)); color: var(--text-2); }
.sk-wrap { padding: 8px 2px; }
.es-action { margin-top: 12px; }

/* ---------- 5. 页签 / 分段 ---------- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn {
  border: 0; background: none; padding: 8px 13px; font-size: calc(12.5px + var(--fs-bump)); color: var(--text-3);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-btn .tb-count { font-size: calc(10px + var(--fs-bump)); background: var(--surface-3); color: var(--text-3); padding: 0 5px; border-radius: 8px; margin-left: 3px; }
.tab-pane { padding-top: 12px; }
.tab-pane.hidden { display: none; }

/* ---------- 6. 详情 ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.detail-title { font-size: calc(19px + var(--fs-bump)); font-weight: 700; color: var(--text); }
.detail-sub { font-size: calc(12px + var(--fs-bump)); color: var(--text-3); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.detail-item { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: calc(12.5px + var(--fs-bump)); min-width: 0; }
.detail-item .di-label { width: 108px; flex: none; color: var(--text-3); }
.detail-item .di-value { flex: 1; color: var(--text); word-break: break-word; min-width: 0; }
.detail-item.full { grid-column: 1 / -1; }
.detail-section { margin-bottom: 16px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-head { display: flex; align-items: center; gap: 8px; font-size: calc(13px + var(--fs-bump)); font-weight: 700; margin-bottom: 6px; }
.detail-section-head::before { content: ""; width: 3px; height: 13px; background: var(--brand); border-radius: 2px; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border-strong); }
.tl-item { position: relative; padding: 0 0 13px; font-size: calc(12px + var(--fs-bump)); }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.tl-item.danger::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.tl-item.success::before { background: var(--success); box-shadow: 0 0 0 3px var(--success-weak); }
.tl-time { color: var(--text-3); font-size: calc(10.5px + var(--fs-bump)); }
.tl-title { color: var(--text); font-weight: 600; margin-top: 2px; }
.tl-desc { color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.diff-add { color: var(--success); background: var(--success-weak); padding: 0 3px; }
.diff-del { color: var(--danger); background: var(--danger-weak); text-decoration: line-through; padding: 0 3px; }

/* ---------- 6.x 安全运营：系统配置 / 资产测绘 / 工单流转 ---------- */
.syscfg-row { display: flex; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.syscfg-row:last-child { border-bottom: 0; }
.syscfg-meta { flex: 1; min-width: 0; }
.syscfg-label { font-size: calc(13px + var(--fs-bump)); font-weight: 600; color: var(--text); }
.syscfg-row .sel { width: 220px; flex: none; }

.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 999px; transition: width .12s ease; }

.survey-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed var(--border); }
.survey-item:last-child { border-bottom: 0; }
.survey-item-meta { flex: 1; min-width: 0; }
.survey-item-title { font-size: calc(13px + var(--fs-bump)); font-weight: 600; color: var(--text); }
.survey-item-ops { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }

.wo-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); }
.wo-step.done { border-color: var(--success); background: var(--success-weak); }
/* 工单处理进度条：单行横向排列，节点数越多自动收窄，整体铺满一行 */
.wo-prog { display: flex; align-items: center; padding: 6px 2px; }
.wo-prog-item { flex: 1 1 0; min-width: 128px; display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.wo-prog-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: calc(11px + var(--fs-bump)); font-weight: 600; color: var(--text-3); background: var(--surface); border: 1px solid var(--border-strong); }
.wo-prog-item.done .wo-prog-dot { color: #fff; background: var(--success); border-color: var(--success); }
.wo-prog-item.active .wo-prog-dot { color: var(--brand); border-color: var(--brand); background: var(--brand-weak); box-shadow: 0 0 0 3px var(--brand-weak); }
.wo-prog-name { font-size: calc(12px + var(--fs-bump)); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.wo-prog-st { flex: none; font-size: calc(11px + var(--fs-bump)); color: var(--text-3); }
.wo-prog-item.active .wo-prog-st { color: var(--brand); font-weight: 600; }
.wo-prog-item.done .wo-prog-st { color: var(--success); }
.wo-prog-line { flex: 0 0 24px; height: 2px; margin: 0 2px; background: var(--border-strong); }
.wo-prog-line.done { background: var(--success); }
@media (max-width: 900px) { .wo-prog { overflow-x: auto; } .wo-prog-item { flex: none; } }
.wo-step-title { font-size: calc(12.5px + var(--fs-bump)); font-weight: 600; color: var(--text); }

/* 用户搜索选择组件 */
.user-search-select { position: relative; }
.user-search-select .inp { width: 100%; }
.user-search-select .sel {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 3px;
  z-index: 50; max-height: 240px; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.15); appearance: auto;
  padding: 4px 0; font-size: calc(12.5px + var(--fs-bump));
}
.user-search-select .sel option {
  padding: 6px 10px; color: var(--text); background: var(--surface);
}
.user-search-select .sel option:hover,
.user-search-select .sel option:focus {
  background: var(--brand-weak); color: var(--brand);
}
.wo-step-ops { margin-left: auto; display: flex; gap: 6px; flex: none; flex-wrap: wrap; }

/* ---------- 7. 图表容器 ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.chart-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chart-head .ch-title { font-size: calc(13px + var(--fs-bump)); font-weight: 700; color: var(--text); }
.chart-head .ch-sub { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); }
.chart-head .ch-extra { margin-left: auto; font-size: calc(11px + var(--fs-bump)); color: var(--text-3); }
.chart-box { position: relative; width: 100%; min-height: 120px; }
.chart-box svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: calc(11px + var(--fs-bump)); color: var(--text-2); margin-top: 4px; }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend .lg-dot { width: 8px; height: 8px; border-radius: 2px; }
.chart-empty { display: grid; place-items: center; height: 160px; color: var(--text-3); font-size: calc(12px + var(--fs-bump)); }
.chart-tip { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); }
.axis text { font-size: calc(10px + var(--fs-bump)); fill: var(--text-3); }
.axis line { stroke: var(--border); }
.grid-line { stroke: var(--border); stroke-dasharray: 3 3; }
.chart-svg text { font-family: var(--font); }
.topology-node { cursor: pointer; }
.topology-node:hover circle { filter: brightness(1.1); }
.heat-cell { cursor: pointer; }
.heat-cell:hover { opacity: .8; stroke: var(--text); }
.sankey-link:hover { opacity: .55; }

/* ---------- 8. 大屏容器（大屏为独立深色展示场景，不随浅色/深色主题切换） ---------- */
.screen-host { height: 100%; display: flex; flex-direction: column; margin: -16px -18px -28px; background: #081322; }
.screen-bar {
  flex: none; height: calc(46px * 5 / 4); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: linear-gradient(90deg, #0a1b30, #0c2745 55%, #0a1b30); color: #d7e9ff;
  border-bottom: 1px solid rgba(90, 170, 255, .25); position: relative; z-index: 3;
}
.screen-bar .sb-title { font-size: calc(15px + var(--fs-bump)); font-weight: 700; letter-spacing: 1px; color: #eaf5ff; display: flex; align-items: center; gap: 8px; }
.screen-bar .sb-title::before { content: ""; width: 4px; height: 16px; background: #4fc3f7; border-radius: 2px; box-shadow: 0 0 8px #4fc3f7; }
.screen-bar .sb-live { font-size: calc(10.5px + var(--fs-bump)); color: #7fe0a8; border: 1px solid rgba(80, 220, 140, .35); padding: 1px 6px; border-radius: 9px; }
.screen-bar .sb-sub { font-size: calc(11px + var(--fs-bump)); color: #7fa5ca; }
.screen-bar .spacer { flex: 1; }
.screen-bar .sb-btn {
  height: 27px; padding: 0 9px; border-radius: 5px; border: 1px solid rgba(100, 170, 240, .32);
  background: rgba(40, 100, 170, .16); color: #cfe6ff; font-size: calc(11.5px + var(--fs-bump));
}
.screen-bar .sb-btn:hover { background: rgba(60, 140, 230, .3); }
.screen-bar select.sb-btn { padding-right: 18px; }
.screen-stage { flex: 1; overflow: auto; position: relative; }
.screen-stage.fullscreen { background: #081322; }
.screen-missing { height: 100%; display: grid; place-items: center; color: #86a8c9; text-align: center; padding: 40px; }
.screen-missing .sm-icon { font-size: calc(44px + var(--fs-bump)); opacity: .4; margin-bottom: 12px; }
.screen-missing .sm-title { font-size: calc(18px + var(--fs-bump)); color: #dcecff; margin-bottom: 8px; }
.screen-missing .sm-desc { font-size: calc(12px + var(--fs-bump)); line-height: 1.8; max-width: 520px; }
.screen-missing code { background: rgba(90, 150, 220, .18); padding: 1px 5px; border-radius: 3px; color: #9fd0ff; font-family: var(--mono); }

/* ---------- 9. AI 对话 ---------- */
.ai-layout { display: grid; grid-template-columns: 1fr 300px; gap: 14px; height: calc(100vh - 190px); min-height: 460px; }
.ai-chat-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ai-chat-head { flex: none; padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: calc(13px + var(--fs-bump)); font-weight: 700; }
.ai-chat-head .ai-model { font-size: calc(10.5px + var(--fs-bump)); color: var(--success); border: 1px solid var(--success); border-radius: 9px; padding: 1px 6px; font-weight: 400; }
.ai-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.ai-msg { display: flex; gap: 9px; max-width: 88%; }
.ai-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.ai-msg .am-avatar { width: 28px; height: 28px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: calc(12px + var(--fs-bump)); background: var(--brand); color: #fff; }
.ai-msg.user .am-avatar { background: var(--brand-2); }
.ai-msg .am-body { background: var(--surface); border: 1px solid var(--border); border-radius: 3px 10px 10px 10px; padding: 9px 12px; font-size: calc(12.5px + var(--fs-bump)); color: var(--text); line-height: 1.7; min-width: 0; }
.ai-msg.user .am-body { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 10px 3px 10px 10px; }
.ai-msg .am-body p { margin: 0 0 5px; }
.ai-msg .am-body p:last-child { margin-bottom: 0; }
.ai-msg .am-body ul { margin: 3px 0 6px; padding-left: 18px; list-style: disc; }
.ai-msg .am-body li { margin: 2px 0; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-source { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: calc(10.5px + var(--fs-bump)); cursor: pointer; border: 1px solid var(--border); }
.ai-source:hover { border-color: var(--brand); color: var(--brand); }
.ai-inputbar { flex: none; border-top: 1px solid var(--border); padding: 9px 12px; background: var(--surface); }
.ai-inputrow { display: flex; gap: 8px; align-items: flex-end; }
.ai-inputrow textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.ai-quick button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: calc(11px + var(--fs-bump)); border-radius: 10px; padding: 3px 9px; }
.ai-quick button:hover { border-color: var(--brand); color: var(--brand); }
.ai-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ai-side .card { overflow: auto; }
.ai-typing { display: inline-block; width: 7px; height: 13px; background: var(--brand); animation: blink .8s steps(1) infinite; vertical-align: -1px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 10. 登录 ---------- */
.login-page {
  position: fixed; inset: 0; display: grid; grid-template-columns: 1.15fr .85fr;
  background: radial-gradient(1200px 600px at 15% 10%, #12305a 0%, #081525 45%, #050d18 100%);
  z-index: 100; color: #eaf4ff; overflow: auto;
}
.login-visual { display: flex; flex-direction: column; justify-content: center; padding: 8vw 6vw; position: relative; overflow: hidden; }
.login-visual .lv-title { font-size: calc(38px + var(--fs-bump)); font-weight: 800; letter-spacing: 4px; background: linear-gradient(90deg, #8fd3ff, #fff 55%, #6cc6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-visual .lv-sub { font-size: calc(15px + var(--fs-bump)); color: #9fc2ef; margin-top: 12px; letter-spacing: 2px; }
.login-visual .lv-desc { font-size: calc(12.5px + var(--fs-bump)); color: #7396be; margin-top: 20px; line-height: 1.9; max-width: 560px; }
.login-visual .lv-kpis { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.login-visual .lv-kpi b { display: block; font-size: calc(26px + var(--fs-bump)); color: #9fd6ff; font-weight: 700; }
.login-visual .lv-kpi span { font-size: calc(11px + var(--fs-bump)); color: #7093b8; }
.login-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(80,160,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(80,160,255,.06) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at 30% 50%, #000 30%, transparent 75%); pointer-events: none; }
/* 登录页整页背景层（由「登录页配置」驱动）：背景图/蒙版铺满左右两栏，内容层叠于其上 */
.login-page > .lv-bg { position: absolute; inset: 0; background-position: center center; background-repeat: no-repeat; pointer-events: none; z-index: 0; }
.login-page > .lv-mask { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.login-visual { z-index: 2; }
.login-form-wrap { position: relative; z-index: 2; }
.login-visual .lv-logo { display: block; margin-bottom: 18px; max-width: 100%; object-fit: contain; }
.login-visual > .lv-title, .login-visual > .lv-sub, .login-visual > .lv-desc, .login-visual > .lv-kpis, .login-visual > .lv-logo { position: relative; z-index: 2; }
.login-visual > .login-grid { z-index: 1; }
/* 登录页配置页：缩略实时预览 */
.lc-prev { position: relative; width: 100%; height: 430px; overflow: hidden; border-radius: 12px; border: 1px solid rgba(100, 170, 240, .22); background: #05101d; }
.lc-prev-frame { position: absolute; top: 0; left: 0; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: top left; }
.lc-thumb { min-height: 36px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 右侧表单区不再叠加独立底色/分隔线：整页统一一张背景图（见 .login-page > .lv-bg）；
   登录卡片整体位置偏左（右留白大于左留白） */
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 24px 8vw 24px 24px; }
.login-card { width: 360px; max-width: 100%; background: rgba(14, 30, 50, .86); border: 1px solid rgba(100, 170, 240, .22); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 24px 70px rgba(0,0,0,.5); backdrop-filter: blur(10px); }
.login-card h2 { font-size: calc(20px + var(--fs-bump)); color: #eaf4ff; margin-bottom: 4px; }
.login-card .lc-sub { font-size: calc(11.5px + var(--fs-bump)); color: #82a6cc; margin-bottom: 18px; }
.login-card .lf-item { margin-bottom: 13px; }
.login-card .lf-item label { display: block; font-size: calc(11.5px + var(--fs-bump)); color: #9fc2ef; margin-bottom: 5px; }
.login-card .lf-item input { width: 100%; height: 36px; border-radius: 7px; border: 1px solid rgba(100, 170, 240, .28); background: rgba(7, 18, 32, .7); color: #eaf4ff; padding: 0 11px; outline: none; }
.login-card .lf-item input:focus { border-color: #4f9ef0; box-shadow: 0 0 0 2px rgba(79,158,240,.18); }
.login-card .btn-login { width: 100%; height: 38px; border: 0; border-radius: 7px; background: linear-gradient(135deg, #2f80e8, #1d5fc0); color: #fff; font-size: calc(14px + var(--fs-bump)); font-weight: 600; letter-spacing: 2px; }
.login-card .btn-login:hover { filter: brightness(1.08); }
.login-card .lf-tip { font-size: calc(10.5px + var(--fs-bump)); color: #6f92b8; margin-top: 14px; line-height: 1.7; text-align: center; }
.login-card .lf-err { font-size: calc(11.5px + var(--fs-bump)); color: #ff8a80; min-height: 17px; margin-top: 5px; }

/* ---------- 11. 业务小组件 ---------- */
/* 步骤向导 */
.wizard-steps { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.wz-step { display: flex; align-items: center; gap: 7px; font-size: calc(12px + var(--fs-bump)); color: var(--text-3); }
.wz-step .wz-no { width: 23px; height: 23px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: calc(11px + var(--fs-bump)); background: var(--surface); }
.wz-step.active { color: var(--brand); font-weight: 600; }
.wz-step.active .wz-no { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-step.done { color: var(--success); }
.wz-step.done .wz-no { background: var(--success); border-color: var(--success); color: #fff; }
.wz-line { width: 44px; height: 1px; background: var(--border); }

/* 矩阵 */
.matrix-table { border-collapse: separate; border-spacing: 0; font-size: calc(11.5px + var(--fs-bump)); width: 100%; }
.matrix-table th { background: var(--surface-3); padding: 7px 5px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; text-align: center; }
.matrix-table th.rowhead { text-align: left; padding-left: 9px; position: sticky; left: 0; z-index: 2; background: var(--surface-3); }
.matrix-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; text-align: center; }
.matrix-table td.rowhead { text-align: left; padding: 6px 9px; position: sticky; left: 0; background: var(--surface); font-weight: 500; color: var(--text); white-space: nowrap; }
.matrix-cell { display: grid; place-items: center; min-height: 30px; font-size: calc(11px + var(--fs-bump)); color: #fff; cursor: pointer; transition: transform var(--speed); }
.matrix-cell:hover { transform: scale(1.04); box-shadow: var(--shadow); }
.matrix-cell.lv0 { background: var(--surface-3); color: var(--text-3); }
.matrix-cell.lv1 { background: #a8d5a2; color: #17451a; }
.matrix-cell.lv2 { background: #f5d26b; color: #5a4300; }
.matrix-cell.lv3 { background: #f09b5a; color: #542600; }
.matrix-cell.lv4 { background: #e05a52; color: #fff; }

/* 拓扑画布 */
.topo-canvas { position: relative; background: radial-gradient(ellipse at 50% 40%, var(--surface) 0%, var(--surface-2) 70%); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.topo-canvas svg { display: block; width: 100%; }
.topo-node-circle { cursor: pointer; }

/* 日志查看器 */
.log-viewer { font-family: var(--mono); font-size: calc(11.5px + var(--fs-bump)); background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); border-radius: var(--radius); padding: 10px 12px; overflow: auto; max-height: 430px; line-height: 1.7; }
.log-line { display: flex; gap: 9px; padding: 1px 0; border-bottom: 1px solid var(--border); }
.log-line:hover { background: var(--surface-3); }
.log-line .lg-time { color: var(--text-3); flex: none; }
.log-line .lg-lv { width: 42px; flex: none; font-weight: 700; }
.log-line .lg-lv.error { color: var(--danger); } .log-line .lg-lv.warn { color: var(--warning); } .log-line .lg-lv.info { color: var(--info); }
.log-line .lg-src { width: 78px; flex: none; color: var(--text-3); }
.log-line .lg-msg { flex: 1; word-break: break-all; }

/* 组件树 */
.tree-view { font-size: calc(12.5px + var(--fs-bump)); }
.tree-node { border-left: 1px dashed var(--border); margin-left: 10px; padding-left: 8px; }
.tree-row { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 4px; cursor: pointer; }
.tree-row:hover { background: var(--surface-3); }
.tree-row.active { background: var(--select-bg); color: var(--text); font-weight: 600; }
.tree-row.dragging { opacity: .45; }
.tree-toggle { width: 12px; color: var(--text-3); font-size: calc(9px + var(--fs-bump)); }
.tree-badge { font-size: calc(10px + var(--fs-bump)); padding: 0 5px; border-radius: 8px; background: var(--danger-weak); color: var(--danger); }

/* 卡片列表（供应商、漏洞知识） */
.mini-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px; background: var(--surface); transition: var(--speed); cursor: pointer; }
.mini-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.mini-card .mc-title { font-size: calc(13px + var(--fs-bump)); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.mini-card .mc-sub { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.mini-card .mc-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: calc(11px + var(--fs-bump)); color: var(--text-2); margin-top: 8px; }

/* 全景/九宫格视图 */
.view-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.view-tile {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 14px; cursor: pointer; position: relative; overflow: hidden; min-height: 110px;
  transition: var(--speed);
}
.view-tile:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow); }
.view-tile.active { border-color: var(--brand); background: var(--select-bg); box-shadow: inset 0 0 0 1px var(--brand); }
.view-tile .vt-no { font-size: calc(10px + var(--fs-bump)); color: var(--text-3); }
.view-tile .vt-title { font-size: calc(13px + var(--fs-bump)); font-weight: 700; margin-top: 3px; }
.view-tile .vt-desc { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); margin-top: 5px; line-height: 1.5; }

/* 下钻提示条 */
.drill-bar { display: flex; align-items: center; gap: 8px; padding: 7px 11px; background: var(--warning-weak); border: 1px solid rgba(217,119,6,.25); color: var(--warning); border-radius: 6px; font-size: calc(11.5px + var(--fs-bump)); }
.drill-bar .db-x { margin-left: auto; cursor: pointer; color: var(--warning); }

/* 结果切换条 */
.result-toolbar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; font-size: calc(11.5px + var(--fs-bump)); color: var(--text-3); flex-wrap: wrap; }
.result-toolbar .spacer { flex: 1; }

/* 连通性测试 */
.ping-row { display: flex; align-items: center; gap: 8px; font-size: calc(12px + var(--fs-bump)); padding: 6px 0; border-bottom: 1px dashed var(--border); }
.ping-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }

/* 资产拓扑页：所有文字在原有基础上调大 2 号（+2px）。
   「资产风险等级 / 关联漏洞严重级分布 / 暴露面分布」三个分布图表已单独 scale(1.25)，
   其标题用 inline font-size，SVG 文字用 presentation attribute，均不在此重复调整。 */
.topo-big { font-size: calc(16px + var(--fs-bump)); }
.topo-big .small { font-size: calc(14px + var(--fs-bump)); }
.topo-big .xs { font-size: calc(13px + var(--fs-bump)); }
.topo-big .section-title { font-size: calc(16px + var(--fs-bump)); }
.topo-big .st-label { font-size: calc(14px + var(--fs-bump)); }
.topo-big .st-value { font-size: calc(28px + var(--fs-bump)); }
.topo-big .st-value small { font-size: calc(14px + var(--fs-bump)); }
.topo-big .st-foot { font-size: calc(13px + var(--fs-bump)); }
.topo-big .ch-title { font-size: calc(15px + var(--fs-bump)); }
.topo-big .ch-sub { font-size: calc(13px + var(--fs-bump)); }
.topo-big .ch-extra { font-size: calc(13px + var(--fs-bump)); }
.topo-big .tt-title { font-size: calc(15px + var(--fs-bump)); }
.topo-big .tg-table { font-size: calc(14.5px + var(--fs-bump)); }
.topo-big .tg-table thead th { font-size: calc(14px + var(--fs-bump)); }
.topo-big .tg-table .cell-sub { font-size: calc(12.5px + var(--fs-bump)); }
.topo-big .tg-table .mono { font-size: calc(13.5px + var(--fs-bump)); }
.topo-big .tg-table thead th .sort-ind { font-size: calc(11px + var(--fs-bump)); }
.topo-big .sel, .topo-big .inp, .topo-big .txt { font-size: calc(14.5px + var(--fs-bump)); }
.topo-big .btn { font-size: calc(14.5px + var(--fs-bump)); }
.topo-big .btn-sm { font-size: calc(14px + var(--fs-bump)); }
.topo-big .btn-xs { font-size: calc(13px + var(--fs-bump)); }
.topo-big .btn-lg { font-size: calc(16px + var(--fs-bump)); }
.topo-big .pill { font-size: calc(13.5px + var(--fs-bump)); }
.topo-big .tag { font-size: calc(13px + var(--fs-bump)); }
.topo-big .tag-lg { font-size: calc(14px + var(--fs-bump)); }
.topo-big .empty-state .es-text { font-size: calc(15px + var(--fs-bump)); }
.topo-big .empty-state .es-hint { font-size: calc(13.5px + var(--fs-bump)); }
.topo-big .modal-head .mh-title { font-size: calc(16.5px + var(--fs-bump)); }
.topo-big .modal-foot { font-size: calc(13.5px + var(--fs-bump)); }
/* 行内 style 的 font-size：选择器匹配原始写法（DOM 属性里就是 font-size:12px），
   声明值 = 该页原本的目标字号再叠加 --fs-bump。全局规则见文件末尾；
   拓扑页原本已将行内字号 +2（如 12px→14px），故此处基数为 14px，叠加后 16px，
   比常规页（14px）仍大 2px。 */
.topo-big [style*="font-size:10px"], .topo-big [style*="font-size: 10px"] { font-size: calc(12px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:11px"], .topo-big [style*="font-size: 11px"] { font-size: calc(13px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:11.5px"], .topo-big [style*="font-size: 11.5px"] { font-size: calc(13.5px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:12px"], .topo-big [style*="font-size: 12px"] { font-size: calc(14px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:12.5px"], .topo-big [style*="font-size: 12.5px"] { font-size: calc(14.5px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:13px"], .topo-big [style*="font-size: 13px"] { font-size: calc(15px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:13.5px"], .topo-big [style*="font-size: 13.5px"] { font-size: calc(15.5px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:14px"], .topo-big [style*="font-size: 14px"] { font-size: calc(16px + var(--fs-bump)) !important; }
.topo-big [style*="font-size:15px"], .topo-big [style*="font-size: 15px"] { font-size: calc(17px + var(--fs-bump)) !important; }
.ping-dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-weak); }
.ping-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.ping-dot.testing { background: var(--warning); animation: blink 1s infinite; }

/* 轻量描述列表 */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: calc(12px + var(--fs-bump)); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); }

/* 紧凑信息表：短字段每行多组横向排列，长文本独占整行 */
.tg-table.kv-table { width: 100%; font-size: calc(12px + var(--fs-bump)); }
.tg-table.kv-table tbody td { padding: 5px 10px; vertical-align: top; white-space: normal; overflow: visible; text-overflow: clip; }
.kv-table .kv-k { display: block; color: var(--text-2); font-size: calc(12px + var(--fs-bump)); line-height: 1.6; }
.kv-table .kv-v { display: block; color: var(--text); font-size: calc(12px + var(--fs-bump)); line-height: 1.6; word-break: break-word; }
.kv-table .kv-long .kv-v { white-space: pre-wrap; }
.tg-table.kv-table tbody tr:last-child td { border-bottom: none; }

/* 进度环 */
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap .ring-text { position: absolute; text-align: center; }
.ring-wrap .ring-text b { display: block; font-size: calc(18px + var(--fs-bump)); color: var(--text); }
.ring-wrap .ring-text span { font-size: calc(10px + var(--fs-bump)); color: var(--text-3); }

/* 代码/JSON 展示 */
.code-block { background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); border-radius: 6px; padding: 10px 12px; font-family: var(--mono); font-size: calc(11.5px + var(--fs-bump)); line-height: 1.6; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.code-block.light { background: var(--surface-3); color: var(--text-2); }

/* 拖拽上传区 */
.drop-zone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--text-3); font-size: calc(12.5px + var(--fs-bump)); background: var(--surface-2); cursor: pointer; }
.drop-zone:hover, .drop-zone.over { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }

/* 窄屏适配 */
@media (max-width: 1100px) {
  .ai-layout { grid-template-columns: 1fr; height: auto; }
  .ai-side { display: grid; grid-template-columns: 1fr 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { width: 92vw; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .view-grid { grid-template-columns: 1fr; }
  .q-search input { width: 100%; }
  .q-search { flex: 1; }
  .table-foot { flex-direction: column; align-items: flex-start; }
  .toast-root { width: calc(100vw - 24px); right: 12px; }
}

/* ==========================================================================
   全局字号：在原有基础上统一 +2px（--fs-bump 控制，见 base.css :root）
   1. 样式表内的 font-size 已全部改写为 calc(Npx + var(--fs-bump))；
   2. 页面/JS 里写死的行内 style 无法逐一改写，这里用属性选择器统一叠加；
   3. 拓扑页 .topo-big 在其自身规则里已多 +2，故本段不含 .topo-big 限定，
      由其更高优先级的规则覆盖，不冲突。
   ========================================================================== */
[style*="font-size:10px"], [style*="font-size: 10px"] { font-size: calc(10px + var(--fs-bump)) !important; }
[style*="font-size:10.5px"], [style*="font-size: 10.5px"] { font-size: calc(10.5px + var(--fs-bump)) !important; }
[style*="font-size:11px"], [style*="font-size: 11px"] { font-size: calc(11px + var(--fs-bump)) !important; }
[style*="font-size:11.5px"], [style*="font-size: 11.5px"] { font-size: calc(11.5px + var(--fs-bump)) !important; }
[style*="font-size:12px"], [style*="font-size: 12px"] { font-size: calc(12px + var(--fs-bump)) !important; }
[style*="font-size:12.5px"], [style*="font-size: 12.5px"] { font-size: calc(12.5px + var(--fs-bump)) !important; }
[style*="font-size:13px"], [style*="font-size: 13px"] { font-size: calc(13px + var(--fs-bump)) !important; }
[style*="font-size:13.5px"], [style*="font-size: 13.5px"] { font-size: calc(13.5px + var(--fs-bump)) !important; }
[style*="font-size:14px"], [style*="font-size: 14px"] { font-size: calc(14px + var(--fs-bump)) !important; }
[style*="font-size:15px"], [style*="font-size: 15px"] { font-size: calc(15px + var(--fs-bump)) !important; }
[style*="font-size:16px"], [style*="font-size: 16px"] { font-size: calc(16px + var(--fs-bump)) !important; }
[style*="font-size:17.5px"], [style*="font-size: 17.5px"] { font-size: calc(17.5px + var(--fs-bump)) !important; }
[style*="font-size:18px"], [style*="font-size: 18px"] { font-size: calc(18px + var(--fs-bump)) !important; }
[style*="font-size:20px"], [style*="font-size: 20px"] { font-size: calc(20px + var(--fs-bump)) !important; }
[style*="font-size:22px"], [style*="font-size: 22px"] { font-size: calc(22px + var(--fs-bump)) !important; }
[style*="font-size:60px"], [style*="font-size: 60px"] { font-size: calc(60px + var(--fs-bump)) !important; }

/* ---------- 品牌标识：LOGO 布局选项 + 实时预览 ---------- */
.brand-layout-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.brand-layout-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  color: var(--text-2); font-size: calc(11.5px + var(--fs-bump)); cursor: pointer;
  transition: border-color var(--speed), background var(--speed), color var(--speed);
}
.brand-layout-opt:hover { border-color: var(--brand); color: var(--brand); }
.brand-layout-opt.on { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.brand-layout-opt > i {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 3px;
  width: 100%; height: 30px; border-radius: 5px; background: var(--topbar-bg); overflow: hidden;
}
.bo-logo { width: 12px; height: 12px; border-radius: 3px; background: #6cc6ff; flex: none; }
.bo-txt { width: 26px; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, .78); flex: none; }
.brand-layout-opt[data-layout="right"] > i { flex-direction: row-reverse; }
.brand-layout-opt[data-layout="top"] > i { flex-direction: column; gap: 2px; }
.brand-layout-opt[data-layout="top"] .bo-txt { width: 30px; }
.brand-layout-opt[data-layout="cover"] .bo-logo { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 5px; opacity: .45; }
.brand-layout-opt[data-layout="cover"] .bo-txt { position: relative; z-index: 1; }

/* 预览区：底色取顶栏颜色，内部 1:1 复用 .brand 布局样式（含 LOGO 尺寸/字号/间距/布局） */
.brand-preview {
  margin-top: 10px; padding: 8px 14px; min-height: 62px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--topbar-bg); display: flex; align-items: center; overflow: hidden;
}
/* 预览区里的品牌块取消顶栏的 172px 预留；覆盖布局除外，否则容器塌陷后 LOGO 不可见 */
.brand-preview .brand:not(.brand-layout-cover) { min-width: 0; }

/* ---------- 业务系统风险总览弹窗 ---------- */
.risk-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 14px;
}
.risk-kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.risk-kpi > span { color: var(--text-2); font-size: calc(11.5px + var(--fs-bump)); }
.risk-kpi > b { color: var(--text); font-size: calc(15px + var(--fs-bump)); font-weight: 600; }
.risk-tabs {
  display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
}
.risk-tab {
  padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; font-size: calc(13px + var(--fs-bump));
  transition: color var(--speed), border-color var(--speed);
}
.risk-tab:hover { color: var(--brand); }
.risk-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.risk-content { max-height: 50vh; overflow: auto; }
/* ===== 资产类型分步选择（新增资产） ===== */
.asset-type-card {
  margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2);
}
.atc-head { font-size: calc(13px + var(--fs-bump)); font-weight: 600; color: var(--text); margin-bottom: 4px; }
.atc-head::before { content: '①'; color: var(--brand); margin-right: 6px; font-weight: 700; }
.atc-tip { font-size: calc(11.5px + var(--fs-bump)); color: var(--text-3); margin-bottom: 10px; line-height: 1.6; }
.atc-tip.ok { color: var(--text); }
.atc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.atc-chip {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--card-bg, transparent); color: var(--text-2); cursor: pointer;
  font-size: calc(12px + var(--fs-bump)); transition: all .18s ease;
}
.atc-chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.atc-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* 选中态：品牌高亮填充 + 品牌描边 + 对勾标记，文字用正文色保证 AA 4.5:1 */
.atc-chip.active {
  border-color: var(--brand); background: var(--select-bg); color: var(--text);
  font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand);
}
/* 对勾图标用品牌色（图形对比 ≥3:1） */
.atc-chip.active::before { content: '✓'; margin-right: 5px; font-weight: 700; color: var(--brand); }
.atc-chip.active:hover { color: var(--text); }
/* 专属字段区域显隐过渡 */
.form-sec.cat-enter, .form-item.cat-enter { animation: tgCatFieldIn .28s ease both; }
@keyframes tgCatFieldIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------------
   报告审批列表：整行铺满容器，列宽按比例分配，说明列吸收剩余空间
   --------------------------------------------------------------------------- */
.tbl-wrap { width: 100%; overflow-x: auto; }
.tbl.tbl-approval {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.tbl.tbl-approval th,
.tbl.tbl-approval td {
  padding: 11px 16px;
  text-align: left;
  vertical-align: middle;
  font-size: calc(12.5px + var(--fs-bump));
  border-bottom: 1px solid var(--border);
}
.tbl.tbl-approval th {
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 600;
  font-size: calc(12px + var(--fs-bump));
  white-space: nowrap;
}
.tbl.tbl-approval tbody tr:last-child td { border-bottom: 0; }
.tbl.tbl-approval tbody tr:hover td { background: var(--surface-2); }
/* 固定列给明确比例，报告/说明两列按比例吃满剩余宽度，右侧不再留空 */
.tbl.tbl-approval .col-time { width: 15%; }
.tbl.tbl-approval .col-type { width: 6%; }
.tbl.tbl-approval .col-report { width: 22%; }
.tbl.tbl-approval .col-applicant { width: 9%; }
.tbl.tbl-approval .col-desc { width: 18%; }
.tbl.tbl-approval .col-status { width: 10%; }
.tbl.tbl-approval .col-ops { width: 20%; }
.tbl.tbl-approval td.col-report,
.tbl.tbl-approval td.col-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl.tbl-approval td.col-time { white-space: normal; overflow-wrap: anywhere; color: var(--text-2); }
.tbl.tbl-approval .apv-ops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tbl.tbl-approval .apv-ops .btn { min-height: 28px; padding: 4px 10px; white-space: nowrap; }
@media (max-width: 720px) {
  .tbl.tbl-approval { min-width: 760px; }
  .tbl.tbl-approval th, .tbl.tbl-approval td { padding: 10px 12px; }
}

/* 组织架构树：选中态 / 定位高亮 / 悬停操作 / 人数徽标 / 检索结果项 */
.org-tree-row { color: var(--text-1); }
.org-tree-row:hover { background: var(--surface-2); }
.org-tree-row.active { background: var(--surface-2); color: var(--brand); font-weight: 600; }
.org-tree-row.org-highlight {
  outline: 1px solid var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
  background: var(--surface-2);
}
.org-tree-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
}
.org-search-item { background: var(--surface-1); transition: border-color 0.15s, background 0.15s; }
.org-search-item:hover { border-color: var(--brand); background: var(--surface-2); }

/* ==========================================================================
   组织架构可视化（org-chart）
   布局：页头（搜索/操作）+ 三栏（大纲树 / SVG 画布 / 详情抽屉）
   响应式：<=1279px 详情改为覆盖抽屉；<=767px 单列 + 大纲浮层
   ========================================================================== */
.oc-page { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 190px); min-height: 560px; }
.oc-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.oc-title { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.oc-title-main { display: flex; align-items: baseline; gap: 10px; }
.oc-title-main b { font-size: calc(17px + var(--fs-bump)); color: var(--text); letter-spacing: .5px; }
.oc-scope { font-size: 11px; color: var(--text-3); }
.oc-stats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.oc-stat {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-2);
}
.oc-stat b { font-size: calc(13px + var(--fs-bump)); color: var(--text); }
.oc-stat small { font-size: 10px; color: var(--text-3); }
.oc-stat-warn { background: var(--danger-weak); border-color: transparent; color: var(--danger); }

.oc-search { position: relative; flex: 1; min-width: 220px; max-width: 560px; }
.oc-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; pointer-events: none; }
.oc-search-input { width: 100%; height: 32px; padding: 0 30px 0 30px; border-radius: 8px; }
.oc-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-3); cursor: pointer; font-size: 11px; display: none;
}
.oc-search-input:not(:placeholder-shown) + .oc-search-clear { display: block; }
.oc-search-clear:hover { background: var(--surface-3); color: var(--text); }
.oc-search-panel {
  position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + 6px);
  max-height: min(62vh, 460px); overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.oc-sr-group { padding: 6px 8px 2px; font-size: 10px; letter-spacing: .08em; color: var(--text-3); }
.oc-sr-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.oc-sr-item:hover, .oc-sr-item:focus { background: var(--brand-weak); }
.oc-sr-kind {
  flex-shrink: 0; min-width: 34px; height: 18px; padding: 0 5px; border-radius: 4px;
  font-size: 10px; line-height: 18px; text-align: center;
  background: var(--surface-3); color: var(--text-2);
}
.oc-sr-org { background: rgba(10, 162, 162, .12); color: #0a7f7f; }
.oc-sr-post { background: rgba(30, 99, 208, .12); color: #1e63d0; }
.oc-sr-user { background: rgba(109, 79, 208, .12); color: #6d4fd0; }
.oc-sr-main { min-width: 0; flex: 1; }
.oc-sr-title { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-sr-sub { font-size: 10px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-sr-go { color: var(--text-3); font-size: 11px; }
.oc-sr-empty { padding: 16px 10px; text-align: center; color: var(--text-3); font-size: 12px; }
mark.oc-mark { background: #ffe58f; color: #7a4b00; padding: 0 1px; border-radius: 2px; }

.oc-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.oc-only-mobile { display: none; }
.oc-export { position: relative; }
.oc-menu {
  position: absolute; right: 0; top: calc(100% + 5px); z-index: 80; min-width: 116px;
  padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
}
.oc-menu-item {
  display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font-size: 12px; text-align: left; cursor: pointer;
}
.oc-menu-item:hover { background: var(--brand-weak); color: var(--brand); }

.oc-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr) 348px; gap: 10px; }
.oc-outline, .oc-canvas-card, .oc-detail {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.oc-panel-head {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 9px 11px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.oc-panel-title { font-size: 12px; font-weight: 600; color: var(--text); }
.oc-panel-sub { font-size: 10px; color: var(--text-3); }
.oc-hint { margin-right: auto; }

.oc-outline-body { flex: 1; min-height: 0; overflow: auto; padding: 6px; }
.oc-out-row {
  display: flex; align-items: center; gap: 5px; height: 30px; padding-right: 6px;
  border-radius: 6px; cursor: pointer; position: relative; color: var(--text-2);
}
.oc-out-row:hover { background: var(--surface-2); color: var(--text); }
.oc-out-row.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.oc-out-row.oc-hit { animation: ocPulse 1.5s ease-out 2; }
.oc-arrow {
  width: 16px; height: 16px; flex-shrink: 0; padding: 0; border: 0; background: transparent;
  color: var(--text-3); font-size: 10px; cursor: pointer;
}
.oc-arrow:disabled { cursor: default; }
.oc-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.oc-out-name { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-out-count {
  min-width: 20px; height: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--surface-3); color: var(--text-3); font-size: 10px; line-height: 16px; text-align: center;
}
.oc-out-actions { display: none; align-items: center; gap: 1px; margin-left: 2px; }
.oc-out-row:hover .oc-out-actions { display: inline-flex; }
.oc-mini {
  width: 17px; height: 17px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--text-3); font-size: 10px; line-height: 17px; cursor: pointer;
}
.oc-mini:hover { background: var(--surface-3); color: var(--brand); }
.oc-mini-danger:hover { background: var(--danger-weak); color: var(--danger); }

.oc-canvas-head { display: flex; align-items: center; gap: 8px; }
.oc-zoom { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.oc-zoom-btn {
  height: 22px; min-width: 22px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); color: var(--text-2); font-size: 12px; cursor: pointer;
}
.oc-zoom-btn:hover { border-color: var(--brand); color: var(--brand); }
.oc-zoom-text { font-size: 10px; }
.oc-zoom-val { min-width: 42px; text-align: center; font-size: 10px; color: var(--text-3); }
.oc-canvas-host { position: relative; flex: 1; min-height: 320px; overflow: hidden; background: var(--surface-2); }
.oc-canvas-host svg.oc-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.oc-canvas-host svg.oc-svg:active { cursor: grabbing; }
.oc-node { cursor: pointer; }
.oc-canvas-bg { fill: var(--surface-2); }
.oc-edge { stroke: var(--border-strong); }
.oc-node rect.oc-node-bg { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.oc-node.oc-selected rect.oc-node-bg { stroke: var(--oc-accent, var(--brand)); stroke-width: 2; }
.oc-node-name { fill: var(--text); }
.oc-node-meta { fill: var(--text-3); }
.oc-node-count { fill: var(--text-2); }
.oc-node-leader { fill: var(--brand); }
.oc-node-leader.empty { fill: var(--text-3); }
.oc-node .oc-toggle circle { fill: var(--surface); stroke: var(--border-strong); }
.oc-node .oc-toggle-mark { fill: var(--text-2); }
.oc-node rect:first-of-type { transition: stroke .12s, filter .12s; }
.oc-node:hover rect:first-of-type { stroke: var(--brand); filter: drop-shadow(0 4px 10px rgba(20, 48, 90, .12)); }
.oc-node.oc-selected rect:first-of-type { filter: drop-shadow(0 4px 12px rgba(30, 99, 208, .22)); }
.oc-node.oc-hit rect:first-of-type { stroke: #f59e0b; stroke-width: 3; }
.oc-node.oc-drop-ok rect:first-of-type { stroke: #15803d; stroke-width: 3; }
.oc-node.oc-drop-bad rect:first-of-type { stroke: #c62828; stroke-width: 3; }
.oc-toggle { cursor: pointer; }
.oc-legend { display: flex; align-items: center; gap: 14px; padding: 6px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.oc-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-3); }
.oc-legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.oc-empty-inline { padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 12px; }

.oc-detail-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.oc-detail-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-close {
  margin-left: auto; width: 22px; height: 22px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-3); cursor: pointer; font-size: 12px;
}
.oc-close:hover { background: var(--surface-3); color: var(--text); }
.oc-empty { padding: 40px 12px; text-align: center; color: var(--text-3); }
.oc-empty-title { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.oc-empty-desc { font-size: 11px; line-height: 1.7; }
.oc-detail-hero { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.oc-org-avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; color: #fff;
  font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.oc-user-avatar {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
  background: var(--brand-weak); color: var(--brand);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.oc-avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.oc-detail-hero-main { min-width: 0; }
.oc-detail-name { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-detail-sub { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.oc-detail-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.oc-detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.oc-stat-card {
  padding: 7px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1px;
}
.oc-stat-card b { font-size: calc(15px + var(--fs-bump)); color: var(--text); }
.oc-stat-card small { font-size: 10px; color: var(--text-3); }
.oc-kv-list { border-top: 1px dashed var(--border); padding-top: 4px; margin-bottom: 10px; }
.oc-kv { display: flex; gap: 8px; padding: 4px 0; font-size: 11px; }
.oc-kv-k { width: 62px; flex-shrink: 0; color: var(--text-3); }
.oc-kv-v { flex: 1; min-width: 0; color: var(--text-2); word-break: break-all; }
.oc-detail-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.oc-section { margin-bottom: 12px; }
.oc-section-title {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: 11px; font-weight: 600; color: var(--text);
}
.oc-section-count {
  min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--surface-3); color: var(--text-3); font-size: 10px; line-height: 16px; text-align: center;
}
.oc-section-empty { padding: 10px; text-align: center; color: var(--text-3); font-size: 11px; border: 1px dashed var(--border); border-radius: 8px; }
.oc-post-list { display: flex; flex-direction: column; gap: 4px; }
.oc-post-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer; background: var(--surface);
}
.oc-post-row:hover { border-color: var(--brand); background: var(--surface-2); }
.oc-post-name { flex: 1; min-width: 0; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-post-meta { font-size: 10px; color: var(--text-3); }
.oc-post-count { font-size: 10px; color: var(--brand); }
.oc-user-list { display: flex; flex-direction: column; gap: 4px; }
.oc-user-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.oc-user-row:hover { border-color: var(--border); background: var(--surface-2); }
.oc-user-main { min-width: 0; flex: 1; }
.oc-user-name { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text); flex-wrap: wrap; }
.oc-user-meta { font-size: 10px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-user-post { font-size: 10px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-tag {
  display: inline-block; height: 16px; padding: 0 5px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-3); font-size: 9px; line-height: 16px; font-weight: 400;
}
.oc-tag-brand { background: var(--brand-weak); color: var(--brand); }
.oc-tag-ok { background: var(--success-weak); color: var(--success); }
.oc-tag-warn { background: var(--danger-weak); color: var(--danger); }
.oc-masked-note {
  margin-top: 8px; padding: 7px 9px; border-radius: 7px;
  background: var(--surface-2); color: var(--text-3); font-size: 10px; line-height: 1.6;
}
.oc-back {
  border: 0; background: transparent; color: var(--text-3); font-size: 11px;
  padding: 0 0 8px; cursor: pointer;
}
.oc-back:hover { color: var(--brand); }

@keyframes ocPulse {
  0% { background: rgba(245, 158, 11, .28); }
  100% { background: transparent; }
}

/* 平板：详情变覆盖抽屉 */
.oc-import { display: flex; flex-direction: column; gap: 12px; }
.oc-import-tip {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; line-height: 1.8;
}
.oc-import-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oc-import-file { color: var(--text-3); font-size: 12px; }
.oc-import-sum { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.oc-import-sum b { font-size: 15px; }
.oc-import-errors { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.oc-import-errors table { width: 100%; border-collapse: collapse; font-size: 12px; }
.oc-import-errors th, .oc-import-errors td {
  padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left;
  color: var(--text-2); white-space: nowrap;
}
.oc-import-errors td:last-child { white-space: normal; }

@media (max-width: 1279px) {
  .oc-body { grid-template-columns: 240px minmax(0, 1fr); }
  .oc-detail {
    position: absolute; z-index: 30; right: 0; top: 0; bottom: 0; width: min(360px, 92vw);
    transform: translateX(101%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .oc-detail.open { transform: translateX(0); }
}
/* 手机：单列 + 大纲浮层 */
@media (max-width: 767px) {
  .oc-page { height: auto; min-height: 0; }
  .oc-toolbar { gap: 8px; padding: 9px; }
  .oc-title { min-width: 0; width: 100%; }
  .oc-search { max-width: none; order: 3; width: 100%; flex-basis: 100%; }
  .oc-actions { width: 100%; flex-wrap: wrap; margin-left: 0; }
  .oc-only-mobile { display: inline-flex; }
  .oc-body { display: flex; flex-direction: column; min-height: 0; }
  .oc-outline {
    position: absolute; z-index: 40; left: 0; right: 0; top: 0; bottom: 0;
    display: none; box-shadow: var(--shadow-lg);
  }
  .oc-outline.mobile-open { display: flex; }
  .oc-canvas-card { min-height: 62vh; }
  .oc-canvas-host { min-height: 52vh; }
  .oc-hint { display: none; }
  .oc-legend { gap: 10px; padding: 5px 10px; }
  .oc-detail { width: 100%; max-height: 72vh; top: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .oc-detail.open { transform: translateY(0); }
  .oc-detail:not(.open) { transform: translateY(101%); }
}

/* ==========================================================================
   集成中心：图标化功能入口（图标网格 + 配置/查看弹窗）
   ========================================================================== */
.int-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.int-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-height: 126px;
  padding: 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--speed);
}
.int-tile:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.int-tile:active { transform: none; }
.int-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.int-ic {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--brand);
  flex: none;
}
.int-ic svg { width: 21px; height: 21px; }
.int-ic.tone-blue { color: var(--brand); background: var(--surface-3); }
.int-ic.tone-green { color: var(--success); background: rgba(21, 128, 61, .10); }
.int-ic.tone-amber { color: var(--warning); background: rgba(161, 92, 0, .12); }
.int-ic.tone-cyan { color: var(--info); background: rgba(29, 111, 196, .10); }
.int-ic.tone-purple { color: #6b4bc4; background: rgba(107, 75, 196, .10); }
.int-ic.tone-teal { color: #0e7c86; background: rgba(14, 124, 134, .10); }
.int-tile .int-name {
  font-size: calc(13px + var(--fs-bump));
  font-weight: 700;
  line-height: 1.35;
  padding-right: 46px;
}
.int-tile .int-desc { font-size: calc(11px + var(--fs-bump)); color: var(--text-3); line-height: 1.45; }
.int-tile .int-status { position: absolute; top: 12px; right: 10px; font-size: calc(10px + var(--fs-bump)); }

.int-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.int-tab {
  padding: 7px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: calc(13px + var(--fs-bump));
  color: var(--text-2);
  cursor: pointer;
}
.int-tab:hover { color: var(--brand); }
.int-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.int-view { border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 12px; background: var(--surface-2); }
.int-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: calc(12.5px + var(--fs-bump));
}
.int-row:last-child { border-bottom: none; }
.int-row .int-k { width: 150px; flex: none; color: var(--text-3); }
.int-row .int-v { flex: 1; min-width: 0; color: var(--text); word-break: break-all; }

@media (max-width: 640px) {
  .int-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .int-tile { min-height: 112px; padding: 12px; }
  .int-row { flex-direction: column; gap: 2px; }
  .int-row .int-k { width: auto; }
}
