/* 极微工厂ERP 全局样式 */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  color: #303133;
}
[v-cloak] { display: none; }

/* 启动时校验登录凭证 */
.boot-mask {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #909399;
  font-size: 14px;
}

/* 登录页 */
.login-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f3a93 0%, #2c5cc5 100%);
}
.login-card {
  width: 380px;
  padding: 36px 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  color: #1f3a93;
  text-align: center;
}
.login-card .sub { text-align: center; color: #909399; font-size: 13px; margin-bottom: 24px; }
/* 登录页演示账号面板（点一下自动填入；上线前可在「系统设置」关闭） */
.demo-accounts { margin-top: 20px; padding-top: 14px; border-top: 1px dashed #dcdfe6; max-height: 280px; overflow-y: auto; }
.demo-accounts .demo-title { font-size: 12px; color: #909399; margin-bottom: 8px; }
.demo-accounts .demo-row { display: flex; align-items: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.demo-accounts .demo-row:hover { background: #ecf5ff; }
.demo-accounts .demo-role { flex: 1; color: #303133; }
.demo-accounts .demo-user { color: #1f3a93; font-weight: 600; margin: 0 10px; }
.demo-accounts .demo-pwd { color: #909399; font-family: monospace; }

/* 主布局 */
.layout { display: flex; height: 100%; }
.sidebar {
  width: 200px;
  background: #001529;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar .logo {
  height: 56px;
  line-height: 56px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex: 0 0 56px;
}
/* 菜单区独立滚动：分组全展开时超出一屏也能滚到底，logo 固定不动 */
.menu-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.menu-list::-webkit-scrollbar { width: 8px; }
.menu-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.menu-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  transition: background 0.2s;
}
.menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.menu-item.active { background: #2c5cc5; color: #fff; }

/* 侧栏可折叠分组：组标题（带展开箭头）+ 缩进的子项 */
.menu-group-title { position: relative; }
/* 组里含当前页时：只把标题文字提亮加粗做提示，不占蓝色高亮块——蓝色块只留给当前页面本身，
   否则父子同时高亮会分不清当前是哪个页面 */
.menu-group-title.active { background: transparent; color: #fff; font-weight: 600; }
.menu-group-title.active:hover { background: rgba(255,255,255,0.08); }
.menu-group-title .menu-caret {
  margin-left: auto;
  font-size: 13px;
  transition: transform 0.2s;
}
.menu-group-title .menu-caret.open { transform: rotate(90deg); }
.menu-children { background: rgba(0,0,0,0.18); }
.menu-child { padding-left: 46px; font-size: 13px; }
.menu-child.active { background: #2c5cc5; }
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 12px; color: #606266; }
.content { flex: 1; padding: 20px; overflow: auto; }
.stocktake-banner { margin-bottom: 14px; }
.stocktake-banner .el-alert__title { font-weight: 600; }

/* 页面通用 */
.page-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
/* 日期时间列不换行：表格里 2026-11-16 15:07:55 必须一行显示，避免行高被撑高 */
.nowrap-cell { white-space: nowrap; }
/* 页面多标签统一：选中项加浅蓝底 + 蓝色加粗文字，比默认下划线更容易分辨。
   Element Plus 把蓝色指示条也放在 .el-tabs__nav 里，所以第一个标签是「指示条后面的那个」，
   不能只用 :first-child；首尾都补 16px 内边距，文字才会在底色里居中。 */
.page-card .el-tabs .el-tabs__nav > .el-tabs__item {
  height: 38px;
  line-height: 38px;
  padding: 0 16px;
  border-radius: 6px 6px 0 0;
  color: #606266;
  transition: background-color .2s, color .2s;
}
.page-card .el-tabs .el-tabs__nav > .el-tabs__item:first-child,
.page-card .el-tabs .el-tabs__nav > .el-tabs__active-bar + .el-tabs__item { padding-left: 16px; }
.page-card .el-tabs .el-tabs__nav > .el-tabs__item:last-child { padding-right: 16px; }
.page-card .el-tabs .el-tabs__nav > .el-tabs__item:hover { background: #f4f8ff; color: #2f54eb; }
.page-card .el-tabs .el-tabs__nav > .el-tabs__item.is-active {
  background: #e8f1ff;
  color: #2f54eb;
  font-weight: 600;
}
.page-card .el-tabs .el-tabs__active-bar { height: 3px; border-radius: 3px; }
.toolbar .spacer { flex: 1; }
/* 工具栏右侧动作按钮：整体换行，不把按钮拆成两行（物料页新增筛选后可能出现） */
.toolbar-actions { display: flex; gap: 12px; flex-wrap: nowrap; align-items: center; }
/* 弹窗底部统一（T12-1.1，2026-11-24 用户二次确认）：危险操作最左（红）→ 常规操作 → 关键操作（蓝）→ 关闭/取消最右（白） */
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}
.dialog-footer > .el-button + .el-button { margin-left: 0; }
.dialog-footer .df-left { margin-right: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.dialog-footer .df-group { display: flex; align-items: center; gap: 12px; }
.dialog-footer .df-left .el-button + .el-button,
.dialog-footer .df-group .el-button + .el-button { margin-left: 0; }
/* 关闭/取消永远最右；关键操作放在它左侧（2026-11-24 用户二次确认） */
.el-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}
.el-dialog__footer > .dialog-footer { flex: 1; min-width: 0; }
.el-dialog__footer > .el-button + .el-button { margin-left: 0; }
.el-dialog__footer .df-close { order: 99; }
.el-message-box__btns {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 12px;
}
.el-message-box__btns .el-button + .el-button { margin-left: 0; }

/* 物料批量修改：字段较多，短屏时表单区内部滚动，保证底部按钮始终可见 */
.batch-dialog .el-dialog__body { max-height: 66vh; overflow-y: auto; }
/* 采购单快捷新建物料：字段较多，短屏时表单区内部滚动 */
.quick-mat-dialog .el-dialog__body { max-height: 72vh; overflow-y: auto; }
/* 导入弹窗：中文标签较长（如「供应单编号」+必填星号），禁止换行避免折成两行 */
.import-form .el-form-item__label { white-space: nowrap; }

/* 列表分页行（中文文案自建，不依赖 Element Plus 语言包） */
.table-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.table-pager .pager-total { color: #606266; font-size: 13px; }

/* 待采购池：按供应商分组的组头（横跨整行） */
.el-table .pool-group-row > td { background: #f5f7fa !important; }
.pool-group-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.pool-group-cell .spacer { flex: 1; }
.pool-group-caret { display: inline-flex; align-items: center; color: #606266; cursor: pointer; }
.pool-group-caret:hover { color: #409eff; }
.pool-group-title { font-weight: 600; color: #303133; }
.pool-group-meta { color: #909399; font-size: 12px; }
.pool-group-cell .el-button + .el-button { margin-left: 0; }

/* 库存看板：当前筛选合计货值（落在「货值」列下方、分页按钮上方；红色加粗） */
.value-total-row {
  text-align: right; padding-right: 10px; margin-top: 12px;
  color: #f5222d; font-size: 14px; font-weight: 700;
}
.value-total-row .value-total-num { font-size: 16px; }

/* 库存看板：口径说明（放表格下方，不占上部空间；字号收小、限宽避免一行过长） */
.board-hint { margin-top: 14px; }
.board-hint .el-alert__title { font-size: 12px; line-height: 19px; color: #909399; }

/* 可自由调整大小的对话框（批次材料清单、批量建立关系等）。
   手柄只是隐藏标记，供 JS 用 data-dlg-key 找到弹窗对应的 key；
   实际缩放靠弹窗右边框／下边框／右下角 10px 热区拖拽（见 app.js ResizableDialog），避免可见手柄挡住右下角数据 */
.resizable-dialog .el-dialog__body { position: relative; }
/* 采购单详情：明细表在上、调差/审批在下，内容超高时在弹窗内滚动，底部按钮保持可见 */
.po-detail-dialog .el-dialog__body { max-height: calc(88vh - 150px); overflow-y: auto; }
.dlg-resize-handle { display: none; }

/* 物料-供应商关系：穿梭框铺满对话框，物料名完整显示（高度由 --transfer-list-h 控制）
   用 flex 让两栏自适应平分剩余宽度，避免百分比硬算被中间按钮挤到换行 */
.relation-transfer {
  --el-transfer-panel-body-height: var(--transfer-list-h, 278px);
  --el-transfer-item-height: 34px;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}
.relation-transfer .el-transfer-panel {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}
.relation-transfer .el-transfer__buttons { flex: 0 0 auto; padding: 0 16px; }
.relation-transfer .el-transfer-panel__item {
  height: auto;
  min-height: var(--el-transfer-item-height);
  line-height: 1.45;
  padding: 5px 8px 5px 15px;
}
.relation-transfer .el-transfer-panel__item.el-checkbox .el-checkbox__label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
  padding-right: 6px;
}
.relation-transfer .el-transfer-panel__item .el-checkbox__input { top: 8px; }

/* 入库登记：本次入库超出「剩余入库」时高亮红框 */
.inv-invalid .el-input__wrapper { box-shadow: 0 0 0 1px #f56c6c inset !important; }
.inv-invalid .el-input__inner { color: #f56c6c; font-weight: 600; }

/* 采购单明细：「差异补发」行淡橙底 + 左侧色条，便于与正常行区分 */
.el-table .po-diff-row > td { background-color: #fdf6ec !important; }
.el-table .po-diff-row > td:first-child { box-shadow: inset 3px 0 0 #e6a23c; }

/* 手动新建采购单：物料不在该供应商供应范围时整行淡红底提醒 */
.el-table .po-bad-row > td { background-color: #fef0f0 !important; }

/* 发票导入预览：重复票行淡橙底（错误行用 po-bad-row 淡红底） */
.el-table .dup-row > td { background-color: #fdf6ec !important; }

/* 工作台：待办统计卡片（T12-1 W-1：2026-12-01 用户确认压缩高度、0 值卡隐藏） */
.todo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 12px; }
.todo-card {
  min-width: 0;
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 4px solid #2c5cc5;
}
.todo-card .num { font-size: 24px; font-weight: 600; line-height: 1.2; color: #303133; }
.todo-card .lbl { margin-top: 2px; color: #909399; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-card.todo-total { border-left-color: #1f3a93; background: linear-gradient(135deg, #f5f7ff, #fff); }
.todo-card.wb-card-link { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.todo-card.wb-card-link:hover { box-shadow: 0 4px 14px rgba(44, 92, 197, .16); transform: translateY(-1px); }

/* 利润看板（T14-4）：核心卡片与辅助卡片 */
.profit-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.profit-card {
  flex: 1 1 240px;
  min-width: 230px;
  background: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  border-left: 4px solid #2c5cc5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
  transition: box-shadow .15s, transform .15s;
}
.profit-card:hover { box-shadow: 0 4px 14px rgba(44, 92, 197, .16); transform: translateY(-1px); }
.profit-card .lbl { color: #909399; font-size: 13px; }
.profit-card .num { font-size: 24px; font-weight: 600; line-height: 1.3; color: #303133; margin: 6px 0 2px; }
.profit-card .num.profit-neg { color: #f56c6c; }
.profit-card .sub { color: #606266; font-size: 12px; line-height: 1.8; }
.profit-card .link { color: #2c5cc5; font-size: 12px; margin-top: 6px; cursor: pointer; }
.profit-card.profit-income { border-left-color: #2c5cc5; }
.profit-card.profit-cost { border-left-color: #e6a23c; }
.profit-card.profit-expense { border-left-color: #909399; }
.profit-card.profit-main { border-left-color: #67c23a; background: linear-gradient(135deg, #f6fff2, #fff); }
.profit-card.profit-aux { border-left-color: #c0c4cc; background: #fafafa; }

/* 利润看板（2026-12-03 主次分明改版）：4 张主卡 + 细项对齐小行 + 辅助信息条 */
.profit-main-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1280px) { .profit-main-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.profit-main-row .profit-card { display: flex; flex-direction: column; padding: 18px 20px 14px; min-width: 0; }
.profit-main-row .profit-card .p-head { display: flex; align-items: center; justify-content: space-between; }
.profit-main-row .profit-card .lbl { color: #303133; font-size: 15px; font-weight: 600; }
.profit-main-row .profit-card .p-tag { color: #909399; font-size: 12px; background: #f4f5f7; border-radius: 4px; padding: 1px 8px; }
.profit-main-row .profit-card .num { font-size: 30px; line-height: 1.25; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.profit-main-row .profit-card .p-note { color: #909399; font-size: 12px; line-height: 1.7; }
.profit-main-row .profit-card .p-rows { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #ebeef5; display: flex; flex-direction: column; gap: 5px; }
.profit-main-row .profit-card .p-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #606266; border-radius: 4px; }
.profit-main-row .profit-card .p-row.clickable { cursor: pointer; margin: 0 -6px; padding: 2px 6px; }
.profit-main-row .profit-card .p-row.clickable:hover { background: #f5f7fa; color: #2c5cc5; }
.profit-main-row .profit-card .p-label { flex: 1; min-width: 0; }
.profit-main-row .profit-card .p-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.profit-main-row .profit-card .p-val.muted { color: #909399; }
.profit-main-row .profit-card .p-arrow { color: #c0c4cc; }
.profit-main-row .profit-card .p-row.clickable:hover .p-arrow { color: #2c5cc5; }
.profit-main-row .profit-card .link { margin-top: auto; padding-top: 12px; }
.profit-aux-strip { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 14px; padding: 10px 16px; background: #fafafa; border: 1px solid #f0f2f5; border-radius: 8px; }
.profit-aux-strip .aux-item { display: inline-flex; align-items: baseline; gap: 8px; font-size: 12px; color: #606266; }
.profit-aux-strip .aux-item.linkable { cursor: pointer; }
.profit-aux-strip .aux-item.linkable:hover .aux-go { text-decoration: underline; }
.profit-aux-strip .aux-lbl { color: #909399; }
.profit-aux-strip .aux-val { font-size: 14px; color: #303133; font-variant-numeric: tabular-nums; }
.profit-aux-strip .aux-hint { color: #c0c4cc; }
.profit-aux-strip .aux-go { color: #2c5cc5; }

/* 库存货值看板（T18-2）：公式核对条 + 负值颜色 */
.sv-formula {
  background: #f5f7ff;
  border: 1px solid #d9e1f7;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  color: #303133;
  font-size: 13px;
  line-height: 1.9;
}
.sv-neg { color: #f56c6c; }

/* 工作台：系统管理员按岗位分组时的岗位小标题 */
.wb-role-title {
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1f3a93;
  padding-left: 8px;
  border-left: 3px solid #2c5cc5;
}

/* 手机端适配 */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar .logo { font-size: 13px; }
  .menu-item span.menu-text { display: none; }
  .content { padding: 12px; }
}

/* 已下架 / 已终止合作：整行灰显（仍可查看、仍可操作） */
.el-table__row.row-off > td.el-table__cell { color: #b1b3b8; background-color: #fafafa; }

/* 批量导入预览：有冲突/解析失败的行整行标红 */
.el-table__row.row-invalid > td.el-table__cell { background-color: #fef0f0; }

/* 批量导入第一步：已选文件清单（el-upload 只当选择器，清单自带） */
.import-picked { width: 100%; margin-top: 8px; }
.import-picked-hd { font-size: 12px; color: #909399; margin-bottom: 4px; }
.import-picked-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 8px; border: 1px solid #ebeef5; border-radius: 4px;
  margin-bottom: 4px; background: #fafafa;
}
.import-picked-name { font-size: 13px; color: #303133; word-break: break-all; }

/* 图片上传区（接单截图）：el-upload 默认上下各 40px 内边距太高，压到约 2/3 */
.upload-compact .el-upload-dragger { padding: 13px 0; }
.upload-compact .el-upload-dragger .el-icon { display: block; margin: 0 auto 2px; }

/* 整行可点开详情的列表（class="clickable-rows"）：悬浮变手型 + 淡淡底色，提示"这行能点" */
.clickable-rows .el-table__body tr { cursor: pointer; }
.clickable-rows .el-table__body tr:hover > td.el-table__cell { background-color: #eef3fd; }

/* 列表行内的「主操作」实心小按钮：只在行操作列里生效，压扁到 20px，
   避免把行高从 40 撑到 41~42（行高参差看着乱） */
.el-table .row-ops .el-button--small { height: 20px; padding: 0 8px; font-size: 13px; }

/* 看板数字：统一字号与字重。蓝色=可点击（悬浮才加浅蓝底+下划线），深色加粗=关键数值，浅灰=零值/无 */
.num-cell {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #303133;
  transition: background-color .15s ease, color .15s ease;
}
.num-cell.num-key { font-weight: 700; }
.num-cell.num-zero { color: #c0c4cc; font-weight: 400; }
.num-cell.num-link { color: #2f54eb; cursor: pointer; }
.num-cell.num-link:hover { color: #1d39c4; background: #ecf2ff; text-decoration: underline; text-underline-offset: 3px; }

/* 发起采购弹窗：可选明细工具条（标题 + 右侧已录入统计；行是否入选由「本次采购数量」决定，无勾选框） */
.pk-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.pk-bar-title { font-weight: 600; font-size: 14px; }
.pk-bar-stat { margin-left: auto; color: #909399; font-size: 12px; }

/* 新建简化入库 → 该供应商可供给的待补货提醒（单行带入，避免滚动列表占满弹窗） */
.rs-hint { border: 1px solid #faecd8; background: #fdf6ec; border-radius: 4px; padding: 6px 10px; margin-bottom: 10px; max-height: 132px; overflow-y: auto; }
.rs-hint-head { display: flex; align-items: center; justify-content: space-between; color: #b88230; font-size: 13px; }
.rs-hint-item { display: flex; align-items: center; gap: 10px; padding: 2px 0; font-size: 13px; color: #606266; }
.rs-hint-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-hint-spec { color: #909399; margin-left: 4px; }
.rs-hint-num { color: #909399; white-space: nowrap; }

/* 跨引列表里的采购单号：点开该采购单的只读详情（差异清单/待采购清单） */
.po-link { color: #2f54eb; cursor: pointer; }
.po-link:hover { color: #1d39c4; text-decoration: underline; text-underline-offset: 3px; }

/* 弹窗/明细里不可点击的强调数值（合计、剩余数量、出库数量等）：统一深色加粗。
   蓝色专属「可点击数字」，强调值一律不用蓝；danger 修饰类保留红色（不足/异常）语义。 */
.num-strong { color: #303133; font-weight: 700; }
.num-strong.is-danger { color: #f56c6c; }

/* 库存汇总左侧分类树面板 */
.cat-tree-panel {
  width: 180px;
  flex-shrink: 0;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 8px;
  background: #fff;
  overflow-y: auto;
}
.cat-tree-panel .el-tree-node__content { height: 30px; }

/* 物料页分类树：右边缘可拖动调宽（宽度由组件记住） */
.cat-tree-wrap { position: relative; flex-shrink: 0; }
.cat-tree-wrap .cat-tree-panel { width: 100%; }
.cat-tree-resizer {
  position: absolute; top: 0; bottom: 0; right: -5px; width: 10px;
  cursor: col-resize; z-index: 2; touch-action: none;
}
.cat-tree-resizer::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px;
  border-radius: 1px; background: transparent;
}
.cat-tree-resizer:hover::after { background: #409eff; }

/* 基础字典（会计科目 / 物料分类）树与右侧详情 */
.dict-node { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; padding-right: 4px; }
.dict-node-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-node-code { color: #909399; font-size: 12px; flex-shrink: 0; }
.dict-node .el-tag { flex-shrink: 0; }
.dict-count { color: #909399; font-size: 12px; min-width: 18px; text-align: right; flex-shrink: 0; }
.dict-panel { flex: 1; min-width: 0; overflow: auto; padding: 16px; border: 1px solid #ebeef5; border-radius: 4px; background: #fff; }
.dict-header { border-bottom: 1px solid #ebeef5; padding-bottom: 10px; margin-bottom: 16px; }
.dict-title { font-size: 17px; font-weight: 600; color: #303133; line-height: 24px; word-break: break-all; }
.dict-sub { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.dict-tip { color: #909399; font-size: 12px; margin-left: 8px; line-height: 18px; }

/* 窄屏（如分屏/小笔记本）：树放上面、详情放下面，避免整页横向滚动 */
.dict-layout { display: flex; gap: 12px; align-items: flex-start; }

/* 基础字典两页（会计科目 / 物料分类）：卡片撑满内容区，树与详情随窗口高度伸缩，底部不留大片灰 */
.page-card.dict-page { height: 100%; display: flex; flex-direction: column; }
.dict-page .dict-layout { flex: 1; min-height: 0; align-items: stretch; }
.dict-page .cat-tree-wrap { display: flex; flex-direction: column; }
.dict-page .cat-tree-panel { flex: 1; min-height: 0; }
.dict-page .dict-panel { min-height: 0; }

@media (max-width: 1100px) {
  .page-card.dict-page { height: auto; }
  .dict-page .dict-layout { flex: none; }
  .dict-page .cat-tree-panel { flex: none; }
  .dict-layout { flex-direction: column; }
  .dict-layout .cat-tree-wrap { width: 100% !important; }
  .dict-layout .cat-tree-panel { height: 260px !important; }
  .dict-layout .dict-panel { height: auto !important; min-height: 360px; }
  .dict-layout .cat-tree-resizer { display: none; }
}

/* 企微卡片深链定位行：浅蓝底高亮，点开直达后一眼找到（T10-2） */
.el-table .deeplink-focus-row td { background: #ecf5ff !important; }

/* 审批流转图（T9-4 体验优化）：横向卡片 + 箭头，不换行，窄窗口横向滚动 */
.approval-flow { display: flex; align-items: stretch; overflow-x: auto; padding: 2px 0 6px; }
.approval-flow-item { display: flex; align-items: center; flex: 1 0 210px; min-width: 210px; }
.approval-card { flex: 1; min-height: 78px; border: 1px solid #e4e7ed; border-radius: 8px; padding: 9px 12px; background: #fff; }
.approval-card.is-pass { border-color: #b3e19d; background: #f0f9eb; }
.approval-card.is-current { border-color: #409eff; background: #ecf5ff; box-shadow: 0 0 0 1px #409eff inset; }
.approval-card.is-reject { border-color: #fab6b6; background: #fef0f0; }
.approval-card.is-wait { border-color: #e4e7ed; background: #fafafa; }
.approval-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.approval-role { font-weight: 600; font-size: 13px; color: #303133; }
.approval-state { font-size: 12px; color: #909399; white-space: nowrap; }
.approval-state.is-pass { color: #67c23a; }
.approval-state.is-current { color: #409eff; font-weight: 600; }
.approval-state.is-reject { color: #f56c6c; }
.approval-current-badge { font-size: 11px; color: #409eff; border: 1px solid #409eff; border-radius: 8px; padding: 0 5px; line-height: 16px; white-space: nowrap; }
.approval-meta { font-size: 12px; color: #909399; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approval-arrow { flex: 0 0 28px; text-align: center; color: #c0c4cc; font-size: 16px; }

/* ===== AI 助手悬浮窗（T13-4） ===== */
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 3000; width: 58px; height: 58px; border: none; border-radius: 50%; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #1f3a93, #409eff); box-shadow: 0 8px 22px rgba(31, 58, 147, 0.35); transition: transform .15s ease, box-shadow .15s ease; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(31, 58, 147, 0.45); }
.ai-fab-label { font-size: 11px; line-height: 1; margin-top: 2px; letter-spacing: 1px; }
.ai-chat-dialog { max-width: 96vw; }
.ai-chat-dialog .el-dialog__body { padding-top: 4px; }
.ai-chat-header { display: flex; align-items: center; gap: 8px; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #67c23a; display: inline-block; }
.ai-chat-sub { color: #909399; font-size: 12px; }
.ai-demo-tip { margin-bottom: 8px; }
.ai-chat-scroll { overflow-y: auto; padding: 4px 2px 2px; }
.ai-chat-empty { text-align: center; color: #606266; padding: 24px 10px; }
.ai-hero p { margin: 6px 0; }
.ai-hero-sub { color: #909399; font-size: 13px; }
.ai-sugs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.ai-sug { margin: 0 !important; white-space: normal; height: auto; line-height: 1.6; max-width: 100%; }
.ai-msg { display: flex; margin: 10px 0; }
.ai-msg.is-user { justify-content: flex-end; }
.ai-bubble { max-width: 88%; padding: 10px 14px; border-radius: 10px; line-height: 1.75; font-size: 14px; }
.is-ai .ai-bubble { background: #f4f6fb; color: #303133; }
.is-user .ai-bubble { background: #2c5cc5; color: #fff; }
.ai-text { white-space: pre-wrap; word-break: break-word; }
.ai-thinking { color: #909399; }
.ai-sources { margin-top: 8px; font-size: 12px; color: #909399; line-height: 1.9; }
.ai-source { background: #eef2ff; color: #2c5cc5; border-radius: 4px; padding: 1px 6px; margin-right: 6px; white-space: nowrap; display: inline-block; margin-bottom: 2px; }
.ai-refs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.ai-followups { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-followup-tip { font-size: 12px; color: #909399; }
.ai-feedback { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px dashed #e4e7ed; padding-top: 6px; }
.ai-feedback-tip { font-size: 12px; color: #909399; }
.ai-feedback-done { font-size: 12px; color: #909399; }
.ai-context-bar { display: flex; align-items: center; gap: 6px; margin: 2px 2px 6px; padding: 4px 10px;
  background: #f4f8ff; border: 1px solid #d9e6ff; border-radius: 6px; font-size: 12px; color: #2c5cc5; }
.ai-context-dot { width: 7px; height: 7px; border-radius: 50%; background: #2c5cc5; flex: none; }
.ai-context-note { margin-top: 6px; font-size: 12px; color: #909399; }
.ai-chat-input { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.ai-chat-input .el-textarea { flex: 1; }
.ai-history-item { border-bottom: 1px solid #ebeef5; padding: 10px 4px; font-size: 13px; }
.ai-history-head { display: flex; gap: 10px; align-items: center; color: #909399; font-size: 12px; }
.ai-history-head b { color: #303133; font-size: 13px; }
.ai-history-q { margin-top: 6px; color: #303133; }
.ai-history-a { margin-top: 4px; color: #606266; white-space: pre-wrap; }

/* AI 回答的 Markdown 渲染（T13-4 优化：先转义后渲染，见 app.js renderChatMarkdown） */
.ai-markdown { white-space: normal; }
.ai-markdown .md-p { margin: 3px 0; }
.ai-markdown .md-gap { height: 6px; }
.ai-markdown .md-h { font-weight: 600; color: #1f2a44; margin: 10px 0 4px; font-size: 15px; line-height: 1.5; }
.ai-markdown .md-h1, .ai-markdown .md-h2 { font-size: 16px; }
.ai-markdown .md-h3, .ai-markdown .md-h4 { font-size: 14.5px; }
.ai-markdown ul, .ai-markdown ol { margin: 4px 0 4px 22px; padding: 0; }
.ai-markdown li { margin: 2px 0; line-height: 1.7; }
.ai-markdown code { background: #e8ecf4; border-radius: 4px; padding: 1px 5px; font-family: Consolas, Menlo, monospace; font-size: 13px; }
.ai-markdown pre.md-pre { background: #1f2430; color: #e6e6e6; border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.ai-markdown pre.md-pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; line-height: 1.6; }
.ai-markdown blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid #c6d4f5; background: #f7f9ff; color: #5a6478; border-radius: 0 6px 6px 0; }
.ai-markdown hr { border: none; border-top: 1px solid #e4e7ed; margin: 8px 0; }
.ai-markdown table { border-collapse: collapse; margin: 8px 0; }
.ai-markdown .md-table-wrap { overflow-x: auto; max-width: 100%; }
.ai-markdown th, .ai-markdown td { border: 1px solid #dde3ee; padding: 4px 9px; font-size: 13px; text-align: left; vertical-align: top; }
.ai-markdown th { background: #eef2fa; font-weight: 600; white-space: nowrap; }
.ai-markdown a { color: #2c5cc5; text-decoration: underline; word-break: break-all; }

/* ===== 费用报销（T15-1）：多行明细录入块 ===== */
.exp-item-block { border: 1px solid #e4e7ed; border-radius: 6px; padding: 7px 10px 5px; margin-bottom: 8px; background: #fcfcfd; }
.exp-item-head { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #303133; margin-bottom: 5px; }
.exp-item-calc { margin-left: auto; font-size: 12px; color: #909399; white-space: nowrap; }
.exp-item-calc b { color: #303133; font-size: 13px; }
.exp-item-sep { margin: 0 6px; color: #c0c4cc; }
.exp-grid { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 5px 10px; }
.exp-field { min-width: 0; }
.exp-label { font-size: 12px; color: #606266; margin-bottom: 2px; line-height: 1.4; }
.exp-label .req { color: #f56c6c; }
.exp-file-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-height: 24px; }
.exp-file-chip { display: inline-flex; align-items: center; max-width: 150px; height: 22px; padding: 0 4px 0 6px; border-radius: 4px; background: #eef2ff; color: #2c5cc5; font-size: 12px; cursor: pointer; }
.exp-file-chip.is-existing { background: #f0f9eb; color: #529b2e; }
.exp-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.exp-chip-x { margin-left: 3px; border-radius: 50%; cursor: pointer; }
.exp-chip-x:hover { background: rgba(0, 0, 0, 0.06); }
.exp-file-empty { color: #c0c4cc; font-size: 12px; }
.exp-total { margin-top: 8px; padding-top: 8px; border-top: 1px solid #ebeef5; text-align: right; font-size: 14px; }

/* ===== 费用报销（T15-1）：明细行附件预览弹窗 ===== */
.exp-attach-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 12px; }
.exp-attach-item { width: 180px; }
.exp-attach-thumb { width: 180px; height: 130px; border-radius: 6px; border: 1px solid #ebeef5; background: #fafafa; cursor: zoom-in; }
.exp-attach-pdf { width: 180px; height: 130px; border: 1px dashed #c6d4f5; border-radius: 6px; background: #f7f9ff; color: #2c5cc5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 13px; }
.exp-attach-pdf:hover { border-color: #2c5cc5; background: #eef2ff; }
.exp-attach-name { margin-top: 4px; font-size: 12px; color: #606266; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 费用报销多行录入：相邻明细块交替底色，避免串行看错 */
.exp-item-block-alt { background: #f2f6fc; }

/* 费用报销填报：明细表格化（字段名做表头，一行一条明细） */
.exp-edit-table .el-table__cell .cell { padding-left: 3px; padding-right: 3px; }
.exp-edit-table .el-table__header .el-table__cell .cell { white-space: nowrap; }
.exp-edit-table .el-input-number .el-input__wrapper { padding-left: 4px; padding-right: 4px; }

/* 录入附件弹窗：附件分类分组 */
.exp-file-section { padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; margin-bottom: 10px; }


/* ===== 职工薪酬（T22-3）===== */
.payroll-sum-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin: 12px 0 10px; }
.payroll-sum-grid > div { background: #f5f7fa; border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.payroll-sum-grid span { color: #909399; font-size: 12px; }
.payroll-sum-grid b { font-size: 15px; color: #303133; }
