/* 曜瓴科技 · YorLead Workbench 工作台骨架
   配色：浅紫蓝品牌风（回退到最初版本观感）。
   主色 #7C3AED（柔和品牌紫，替代原霓虹紫 #8500FD 做文字，护眼不刺眼），
   页面底浅紫蓝渐变 #F5F1FE→#EAF4FF，品牌渐变 #8500FD→#2E93FD 仅用于 Logo / 头像 / 卡片点缀 */

/* ===== 自托管中文字体（Noto Sans SC 子集，SIL OFL 1.1）=====
   目的：不依赖客户端是否安装中文字体，避免「渲染器缺字 → 回落宋体」导致界面观感差；
   子集覆盖 ASCII + 常用符号 + GB2312 汉字（约 7600 字），变量字重 100–900。 */
@font-face {
  font-family: "Noto Sans SC UI";
  src: url("/fonts/NotoSansSC-UI.woff2") format("woff2-variations"),
       url("/fonts/NotoSansSC-UI.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 字体：优先自托管 UI 字体 → 系统优质黑体 → 兜底无衬线 */
  --font-ui: "Noto Sans SC UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC",
    "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  /* 品牌渐变：浅紫蓝，用于 Logo / 头像 / 卡片点缀 */
  --brand-grad: linear-gradient(135deg, #8500fd 0%, #2e93fd 100%);
  /* 主强调色：品牌紫（柔和版，护眼不刺眼，替代原霓虹紫 #8500FD 做文字） */
  --accent: #7c3aed;          /* violet-600 主色 */
  --accent-strong: #6d28d9;   /* violet-700 激活/加深 */
  --accent-bg: #f5f1fe;       /* 浅紫底 */
  --accent-line: rgba(124, 58, 237, 0.16);
  --fg: #1f2937;              /* 正文 */
  --muted: #6b7280;           /* 次要 */
  --line: #ececf3;            /* 描边（浅紫灰） */
  --bg: linear-gradient(135deg, #f5f1fe 0%, #eaf4ff 100%);  /* 浅紫蓝页面底 */
  --side: #ffffff;            /* 侧栏底 */
  --side-active: #f3f0fc;     /* 选中项浅紫底 */
  --ok: #16a34a;
  --bad: #dc2626;
  --shadow: 0 10px 30px rgba(124, 58, 237, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* [hidden] 兜底：作者样式里的 display 会盖掉浏览器默认的 [hidden]{display:none}，
   一旦某个组件样式把它覆盖，元素就"永远挂在页面上"（遮罩层/抽屉最常见） */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.62;
  letter-spacing: .01em;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* 表单控件默认不继承字体 → 显式继承，避免 input/select/button 用浏览器默认（中文常为宋体） */
button, input, select, textarea, optgroup { font-family: inherit; font-size: inherit; line-height: inherit; }

/* 等宽/代码：统一字体与数字对齐 */
code, kbd, samp, pre { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* ===== 顶栏 ===== */
.topbar {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 30px; width: auto; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; color: var(--fg); }
.brand-sub {
  font-size: 12px; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 12px;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.health { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(22,163,74,.15); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(220,38,38,.15); }
.dot.pending { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
.divider { width: 1px; height: 22px; background: var(--line); }
/* 账户区：头像 + 姓名 → 点击弹出菜单（修改密码 / 退出登录） */
.user-wrap { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 9px 5px 5px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: 14px; color: var(--fg);
  transition: background .15s, border-color .15s;
}
.user-btn:hover { background: var(--accent-bg); }
.user-btn[aria-expanded="true"] { background: var(--accent-bg); border-color: var(--accent-line); }
.ucaret { font-size: 10px; color: var(--muted); transition: transform .15s; }
.user-wrap.open .ucaret { transform: rotate(180deg); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 168px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(31,41,55,.14);
  padding: 6px; z-index: 90;
}
.um-item {
  display: flex; align-items: center; width: 100%;
  padding: 10px 12px; border: 0; background: transparent; border-radius: 8px;
  font-size: 14px; color: var(--fg); cursor: pointer; text-align: left;
}
.um-item:hover { background: var(--accent-bg); color: var(--accent); }
.um-item.um-danger { color: var(--bad); }
.um-item.um-danger:hover { background: #fef2f2; color: var(--bad); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-grad); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== 主体 ===== */
.body { flex: 1; display: flex; min-height: 0; }

/* ===== 左侧菜单 ===== */
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: var(--side);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 14px 10px;
}
.menu { display: flex; flex-direction: column; gap: 2px; }

/* 顶级（一级）菜单 */
.m-lv1 > .m-row {
  font-size: 14px; font-weight: 600; color: #374151;
  padding: 11px 12px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.m-lv1 > .m-row:hover { background: #f5f1fe; }
.m-lv1.open > .m-row { color: var(--accent); }

/* 二级菜单 */
.m-lv2 > .m-row {
  font-size: 13.5px; color: #4b5563; font-weight: 500;
  padding: 9px 12px 9px 30px; border-radius: 9px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.m-lv2 > .m-row:hover { background: #f5f1fe; }
.m-lv2.open > .m-row { color: var(--accent); }

/* 三级菜单（叶子） */
.m-lv3 > .m-row {
  font-size: 13px; color: var(--muted);
  padding: 8px 12px 8px 50px; border-radius: 9px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; position: relative;
}
.m-lv3 > .m-row:hover { background: #f5f1fe; color: var(--fg); }
.m-lv3.active > .m-row { background: var(--side-active); color: var(--accent); font-weight: 600; }

/* 分组小标题（采购管理 → 采购单据 / 供应商协同；产品 → 产品信息 / 基础信息）：
   只做视觉分组，不可点击、无圆点、无选中态；文字与同级叶子项文字左对齐 */
.m-section { padding: 12px 12px 2px 70px; }
.m-section-t { font-size: 12px; color: #9ca3af; letter-spacing: .04em; display: block; }
@media (max-width: 900px) { .m-section { padding: 10px 12px 2px 36px; } }

/* 折叠箭头 */
.caret {
  margin-left: auto; width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .18s ease; color: #9ca3af; font-size: 11px;
}
.open > .m-row .caret { transform: rotate(90deg); color: var(--accent); }

/* 子菜单容器 */
.m-children { display: none; flex-direction: column; gap: 1px; }
.open > .m-children { display: flex; }

/* 一级图标 */
.m-ico {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent-bg); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; flex: 0 0 22px;
}
/* 叶子（三级）图标 */
/* 三级叶子项的圆点：一个 12px 圆环承载状态。
   未选中＝浅灰空心环；选中＝环变主题色、环内出现实心点（即「◉」）。
   不要再额外画一个独立圆点，否则会和圆环并排成两个点。 */
.m-leaf-ico {
  width: 12px; height: 12px; flex: 0 0 12px; box-sizing: border-box;
  border: 1.5px solid #cbd5e1; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s ease;
}
.m-lv3 > .m-row:hover .m-leaf-ico { border-color: #b9a7ea; }
.m-lv3.active > .m-row .m-leaf-ico { border-color: var(--accent); }
.m-lv3.active > .m-row .m-leaf-ico::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: #b45309; background: #fef3c7; padding: 2px 8px; border-radius: 999px;
}
.m-lv1.open > .m-row .badge { display: none; }

/* ===== 内容区 ===== */
.content { flex: 1; overflow-y: auto; padding: 26px 30px; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb b { color: var(--fg); font-weight: 600; }
.crumb .sep { color: #cbd5e1; }

.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.page-title { font-size: 23px; font-weight: 700; color: var(--fg); letter-spacing: -.3px; }
.page-en { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; box-shadow: var(--shadow);
}
.placeholder-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-bg); border: 1px solid var(--accent-line);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.placeholder-text { font-size: 14px; color: #4b5563; line-height: 1.7; }
.placeholder-text code {
  background: #f3f4f6; border-radius: 5px; padding: 1px 6px; font-size: 13px; color: var(--accent);
}

/* 首页仪表盘 */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 6px; }
.dash-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  border-top: 3px solid var(--accent);
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dash-card .dc-ico {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-bg);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.dash-card h4 { font-size: 15px; margin-bottom: 4px; color: var(--fg); }
.dash-card p { font-size: 12.5px; color: var(--muted); }
/* 业务数据卡：主数值 + 单位（首页驾驶舱「业务数据」四板块） */
.dash-card .dc-val { font-size: 25px; font-weight: 700; color: var(--fg); line-height: 1.15; margin: 2px 0 3px; letter-spacing: -.3px; }
.dash-card .dc-unit { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.dash-card.k-bad { border-top-color: var(--bad); }
.dash-card.k-bad .dc-val { color: var(--bad); }
.dash-card .dc-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* 业务数据卡「暂不可用」状态（后端该模块 available===false 时如实展示，绝不用 0 掩盖） */
.dash-card.dash-unavail { border-top-color: var(--muted); cursor: pointer; background: repeating-linear-gradient(45deg, #fafafa, #fafafa 8px, #f4f4f4 8px, #f4f4f4 16px); }
.dash-card.dash-unavail .dc-val.dc-unavail { font-size: 18px; font-weight: 700; color: var(--muted); }
.dash-card.dash-unavail .dc-retry { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* 首页问候区（替代原先的开发期占位文案） */
.home-hero {
  background: linear-gradient(135deg, #f6f2ff 0%, #eef6ff 100%);
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 18px;
}
.hh-hello { font-size: 21px; font-weight: 700; color: var(--fg); letter-spacing: -.2px; }
.hh-date { font-size: 13px; color: var(--muted); margin-top: 5px; }
.hh-sub { font-size: 13.5px; color: #4b5563; margin-top: 12px; }

/* 区块标题（左标题 + 右说明） */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-title { font-size: 15px; font-weight: 700; color: var(--fg); }
.sec-sub { font-size: 12.5px; color: var(--muted); }

/* ===== 审批中心（发起 / 待办 / 我发起的 / 全部审批）===== */
.flow-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.flow-st.ok { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.flow-st.bad { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.flow-st.warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.flow-st.muted { color: #6b7280; background: #f3f4f6; border-color: #e5e7eb; }
.flow-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.flow-actions { display: flex; gap: 10px; margin-top: 18px; }
.flow-form .form-grid { margin-bottom: 4px; }
.form-fld label i { font-style: normal; color: var(--bad); }
/* 审批详情 */
.flow-detail { display: flex; flex-direction: column; gap: 9px; }
.fd-row { display: flex; gap: 12px; font-size: 13.5px; }
.fd-k { flex: 0 0 68px; color: var(--muted); }
.fd-v { flex: 1 1 auto; color: var(--fg); word-break: break-word; }
/* 处理轨迹时间轴 */
.flow-tl { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.tl-item { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); margin-left: 5px; }
.tl-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl-dot { position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.tl-item.pending .tl-dot { background: var(--accent); }
.tl-t { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.tl-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 滚动条 */
.sidebar::-webkit-scrollbar, .content::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb { background: #ececf3; border-radius: 8px; }

/* 退出登录按钮（顶栏） */
.logout-btn {
  margin-left: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.logout-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-bg);
}

/* ===== 通用：工具栏 / 按钮 / 表格 / 标签 / 状态 ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--fg);
  font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 9px; cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-mini { border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 7px; cursor: pointer; margin-right: 6px; }
.btn-mini:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
.btn-mini.danger:hover { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.inp { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: 13px; color: var(--fg); background: #fff; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
/* 原生日期/月历选择器跟随系统主色（accent-color 控制 Android/WebView 原生日历面板配色） */
input[type="date"].inp, input[type="month"].inp, input[type="time"].inp,
input[type="date"], input[type="month"], input[type="time"] { accent-color: var(--accent); color-scheme: light; }
.loading { color: var(--muted); padding: 14px 0; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--bad); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-line); padding: 2px 9px; border-radius: 999px; }
.dot-ok { color: var(--ok); font-size: 13px; font-weight: 600; }
.dot-bad { color: var(--bad); font-size: 13px; font-weight: 600; }

/* ===== 列表分页条 ===== */
.tb-spacer { flex: 1 1 auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pager-btns { display: inline-flex; align-items: center; gap: 6px; }
.pager-btns .btn-mini { margin-right: 0; }
.pager-info { font-size: 12px; color: var(--muted); padding: 0 6px; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.btn-mini:disabled { opacity: .45; cursor: not-allowed; }
.btn-mini:disabled:hover { color: var(--muted); border-color: var(--line); background: #fff; }
.inp-mini { padding: 4px 8px; font-size: 12px; border-radius: 7px; }

/* 成员分页条（重做：紧凑、按钮等高、不再被拉伸） */
.pager-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; width: 100%; }
.pager-summary { font-size: 12.5px; }
.pager-ctl { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager .pg-btn { height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; padding: 0 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.pager .pg-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
.pager .pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-now { font-size: 12px; color: var(--muted); padding: 0 4px; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.pager .pg-size { height: 30px; }
.req { color: var(--bad); margin-left: 2px; }
.readonly-field { font-size: 13px; padding: 8px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #faf9ff; letter-spacing: .02em; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--fg); }
.tbl tr:hover td { background: #fbfaff; }
.row-actions { white-space: nowrap; }
/* 操作列（限表格内）：左对齐，按钮自左向右排列，与列表其余内容对齐 */
.tbl th.row-actions, .tbl td.row-actions { text-align: left; }

/* ===== 模态框 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(31,41,55,.42); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; box-shadow: 0 24px 60px rgba(124,58,237,.22); }
.modal.wide { width: 560px; }
.modal.wide.cat-xl { width: min(1080px, 96vw); max-width: 96vw; max-height: 92vh; }
.modal.wide.xwide { width: 980px; max-width: 94vw; }
/* 辅料管理「供应商报价」页签：13 列子表需要更宽的弹窗，避免右侧列只在横向滚动后才可见 */
.modal.wide.xwide.acc-wide { width: 1320px; max-width: 96vw; }
/* 产品档案「采购信息」页签字段最多（规格信息 + 8 列明细表），单独再放宽，避免全挤在一起 */
.modal.wide.xwide.acc-wide.pd-purchase-wide { width: min(1600px, 97vw); max-width: 97vw; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--fg); }
.modal-close { border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--accent); }
.modal-body { padding: 20px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form input, .form select { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: 13px; color: var(--fg); background: #fff; }
.form input:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.form-actions { margin-top: 6px; }

/* ===== 角色管理 ===== */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.role-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.role-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.role-top b { font-size: 15px; color: var(--fg); }
.role-top [data-del] { margin-left: auto; }
.role-code { font-size: 12px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.role-desc { font-size: 13px; color: var(--muted); min-height: 18px; margin-bottom: 8px; }
.role-perm-count { font-size: 12px; color: var(--accent); margin-bottom: 10px; }
/* 多角色勾选 / 可见菜单勾选：限高滚动，避免长列表把弹窗撑爆 */
.role-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 168px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pick-tools { display: flex; gap: 8px; margin: 6px 0; }
.pick-box { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pick-box .perm-chk { display: block; padding: 3px 0; }
.perm-matrix { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.perm-group { border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.perm-group:last-child { border-bottom: none; }
.perm-res { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.perm-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--fg); cursor: pointer; }
.perm-chk input { accent-color: var(--accent); }

/* ===== 审批流程配置 ===== */
.wf-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.wf-side { padding: 18px; }
.wf-main { padding: 18px; }
.wf-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wf-side-title { font-size: 15px; font-weight: 700; color: var(--fg); }
.wf-side-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wf-main-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.wf-main-title { font-size: 16px; font-weight: 700; color: var(--fg); }
.wf-main-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.wf-mobile-tip { font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px; padding: 8px 12px; margin-bottom: 12px; }
.wf-none { font-size: 12.5px; color: var(--muted); line-height: 1.75; padding: 6px 2px 2px; }
.wf-toolbar { margin-bottom: 12px; }
.wf-formrow { display: flex; gap: 10px; margin-bottom: 12px; }
.wf-formrow .inp { flex: 1; }
.wf-list { display: flex; flex-direction: column; gap: 10px; }
.wf-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; transition: all .15s; }
.wf-item:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.wf-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.wf-item-top b { font-size: 14px; color: var(--fg); }
.wf-item-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.wf-item-time { font-size: 11.5px; color: #9ca3af; }
.wf-panel { margin-top: 12px; border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: 12px; padding: 14px 16px; }
.wf-panel-title { font-size: 14px; font-weight: 700; color: var(--fg); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.wf-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.wf-panel-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wf-panel-grid .inp { width: 100%; background: #fff; }
.wf-summary { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.wf-summary-title { font-size: 13px; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.wf-sum-item { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.wf-sum-item:last-child { border-bottom: none; }
.wf-sum-item b { min-width: 160px; color: var(--fg); font-weight: 600; }
.wf-sum-item > span { color: #4b5563; }
.wf-sum-mode { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 审批流条件分支（P0）：标签 / 金额区间 / 条件边编辑（主样式，勿放进媒体查询） */
.wf-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-right: 6px; color: #fff; }
.wf-tag.ap { background: #3b6cf6; }
.wf-tag.cond { background: #d9822b; }
.wf-tag.auto { background: #2f9e6b; }
.wf-cond-mini { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 2px; }
.wf-amt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wf-amt-row .inp { width: auto; }
.wf-amt-up { width: 120px !important; }
.wf-amt-arrow { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wf-amt-role { width: 130px !important; }
.wf-cond-row { border: 1px solid var(--accent-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--accent-bg); }
.wf-cond-tgt { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--fg); }
.wf-cond-def { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.wf-cond-fields { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wf-cond-fields .inp { width: auto; }
.wf-cond-field { width: 120px !important; }
.wf-cond-val { width: 150px !important; }
.wf-cond-vmin, .wf-cond-vmax { width: 92px !important; }
.wf-cond-sep { color: var(--muted); }
.lf-canvas { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fbfaff; margin-top: 4px; }

/* LogicFlow 节点配色（贴合品牌紫） */
.lf-canvas .lf-node-rect .lf-node-text, .lf-canvas .lf-node-circle .lf-node-text { fill: #4b5563; font-size: 13px; }
.lf-canvas .lf-edge-text { fill: #6b7280; }

/* ===== Toast：浅紫蓝主题轻通知，统一置于顶栏下方居中，视线不离开正在看的区域 ===== */
.toast-wrap { position: fixed; left: 0; right: 0; top: 72px; bottom: auto; z-index: 5000; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(92vw, 420px); width: fit-content; padding: 10px 12px 10px 11px; border-radius: 10px; font-size: 13px; line-height: 1.5; color: var(--fg); background: #fff; border: 1px solid var(--accent-line); border-left: 3px solid var(--accent); opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; box-shadow: 0 10px 30px rgba(31,41,55,.12); display: flex; align-items: flex-start; gap: 9px; word-break: break-word; cursor: default; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok, .toast.info { border-left-color: var(--accent); }
.toast.err { border-left-color: var(--bad); }
.toast .toast-ico { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; background: var(--accent); }
.toast.err .toast-ico { background: var(--bad); }
.toast .toast-msg { flex: 1 1 auto; }
.toast .toast-x { flex: 0 0 auto; margin-left: 4px; cursor: pointer; color: var(--muted); opacity: .8; font-weight: 700; line-height: 1; padding: 0 2px; }
.toast .toast-x:hover { color: var(--fg); opacity: 1; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }

/* ===== 菜单权限管理 / 数据范围提示 ===== */
#scope-hint { margin-bottom: 12px; padding: 8px 12px; background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 9px; font-size: 12.5px; }
.mtable { display: flex; flex-direction: column; gap: 2px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; margin-bottom: 6px; }
.mrow:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.m-title { font-weight: 600; color: var(--fg); min-width: 120px; font-size: 14px; }
.m-id { font-size: 11.5px; color: #9ca3af; font-family: var(--font-mono); font-variant-numeric: tabular-nums; background: #f7f7fb; border-radius: 5px; padding: 1px 6px; }
.m-chks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; }
.mperm-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.mperm-chk input { accent-color: var(--accent); }
.mperm-chk input:disabled { opacity: .5; cursor: not-allowed; }
.m-locked { font-size: 11px; color: #8a6d1a; background: #fff7e0; border: 1px solid #f0dca0; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.mlegend { font-size: 12.5px; color: var(--muted); line-height: 1.6; background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 9px; padding: 9px 13px; margin-bottom: 10px; }

/* ===== 成员页：敏感字段脱敏提示 ===== */
.masked-note {
  margin-bottom: 12px; padding: 9px 13px; font-size: 12.5px; line-height: 1.6;
  color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px;
}
.masked-note strong { color: #b45309; }

/* ===== 字段级数据权限（字段权限）页面 ===== */
.fp-group { margin-bottom: 18px; }
.fp-res { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.fp-group .tbl th { background: #faf9ff; }
.fp-group .tbl code { background: #f3f4f6; border-radius: 5px; padding: 1px 6px; font-size: 12px; color: var(--accent); }
.fp-vis { margin: 0; }

/* ===== 组织架构（树形增删改查）===== */
.org-card { padding: 18px; }
.org-note { margin-bottom: 14px; }
.org-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.org-search { position: relative; flex: 1 1 240px; max-width: 360px; }
.org-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6; }
.org-search .inp { padding-left: 32px; width: 100%; }
.org-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.org-tree-pane { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; min-height: 320px; max-height: calc(100vh - 240px); overflow: auto; }
.org-tree2, .org-tree2 .org-tree2 { list-style: none; margin: 0; padding-left: 0; }
.org-tree2 .org-tree2 { padding-left: 18px; border-left: 1px dashed var(--line); margin-left: 6px; }
.org-node2 { position: relative; }
.org-row2 { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.org-row2:hover { background: var(--accent-bg); }
.org-row2.on { background: var(--side-active); box-shadow: inset 2px 0 0 var(--accent); }
.org-caret2 { width: 14px; height: 14px; padding: 0; border: 0; display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 10px; transition: transform .15s; flex: none; }
/* 占位箭头：只占位不显示。不能叫 .empty —— 会撞上全局空态组件（padding 34px + 虚线边框）把行撑高 */
.org-caret2.is-blank, .org-caret2.empty { visibility: hidden; padding: 0; border: 0; background: none; }
.org-name2 { font-size: 14px; color: var(--fg); font-weight: 500; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-count2 { margin-left: 6px; flex: none; }
.org-acts { display: none; gap: 2px; flex: none; }
.org-row2:hover .org-acts { display: inline-flex; }
.iconbtn { border: 1px solid var(--line); background: #fff; color: var(--muted); width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.iconbtn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
.iconbtn.danger:hover { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.org-empty { font-size: 13px; padding: 12px; }
.org-detail-pane { min-height: 320px; }
.org-detail-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; flex-wrap: wrap; }
.odh-l { flex: 1 1 auto; min-width: 0; }
.odh-name { font-size: 17px; font-weight: 700; color: var(--fg); }
.odh-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.org-detail-acts { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.org-meta { display: flex; gap: 28px; flex-wrap: wrap; padding: 12px 16px; }
.om-item { display: flex; flex-direction: column; gap: 3px; }
.om-k { font-size: 12px; color: var(--muted); }
.om-v { font-size: 14px; color: var(--fg); font-weight: 500; }
.org-mem-title { font-size: 14px; font-weight: 700; color: var(--fg); margin: 16px 0 10px; padding-left: 10px; border-left: 3px solid var(--accent); }
.av { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-grad); color: #fff; font-size: 12px; font-weight: 600; vertical-align: middle; margin-right: 4px; }
.org-lead { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-line); }
.mem-search { margin-bottom: 10px; }
.mem-pick-list { max-height: 320px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 14px; }
.mem-pick { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; }
.mem-pick:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.mem-pick input { width: 16px; height: 16px; accent-color: var(--accent); }
.mp-name { font-weight: 500; }
.btn-danger-ghost { border-color: #fecaca; color: #b91c1c; }
.btn-danger-ghost:hover { background: #fef2f2; border-color: #fca5a5; }
/* 前置条件未满足的按钮（如未勾选时的「批量删除」）：灰化但保留点击反馈，故不能用 disabled/pointer-events:none */
.btn.is-disabled, .btn.is-disabled:hover { color: var(--muted); border-color: var(--line); background: #fff; cursor: not-allowed; }
.role-members { list-style: none; margin: 10px 0 0; padding: 0; }
.role-members li { font-size: 12.5px; color: var(--fg); padding: 3px 0 3px 12px; border-left: 2px solid var(--accent-line); margin-left: 4px; }

/* 响应式：窄屏堆叠 */
@media (max-width: 860px) {
  .org-layout { grid-template-columns: 1fr; }
  .org-tree-pane { max-height: 280px; }
  .mem-pick-list { grid-template-columns: 1fr; }
  .org-detail-head { gap: 10px; }
  .org-detail-acts { width: 100%; margin-top: 2px; }
}

/* ===== 统一授权（权限配置）===== */
#pg-scope { margin-left: 0; }

/* ===== 字段权限：可编辑列 ===== */
.fp-vis { margin: 0; }
#fp-wrap .tbl td { vertical-align: middle; }
#fp-wrap .tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ===== 审批流程：绑定菜单 + 版本条 ===== */
.wf-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.wf-formrow { align-items: flex-start; flex-wrap: wrap; gap: 14px 16px; max-width: 780px; margin-bottom: 14px; }
.wf-formrow .inp { min-width: 160px; }
.wf-verbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 9px; font-size: 13px; }
.wf-verbar b { color: var(--accent); }
.wf-verinfo { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wf-verinfo .btn-mini { margin-right: 0; }
.wf-verinfo .ver-cur { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
/* 流程状态徽标（编辑器头部 + 侧栏列表项） */
.wf-status { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; }
.wf-status.drf { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.wf-status.pub { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.wf-status.arc { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.wf-dirty { display: inline-flex; align-items: center; height: 22px; margin-left: 10px; color: #e5484d; font-size: 13px; font-weight: 600; }
.wf-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1; margin-left: 8px; }
.wf-badge.drf { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.wf-badge.pub { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.wf-badge.arc { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* =======================================================================
   界面友好化 + 移动端适配（2026-10-12 UI Polish 层）
   ① 层级菜单选择器 .mpick  ② 分段控件 .seg  ③ 空态 / 骨架加载
   ④ 表格横滑 .tbl-wrap     ⑤ 手机抽屉侧栏 + 全站响应式
   ======================================================================= */

/* ---------- 1. 基础：无障碍与触控友好 ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 10px 0; font-size: 13px;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .btn-mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  min-height: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.btn-mini { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.inp { min-height: 38px; }

/* select：去掉浏览器默认外观，统一品牌箭头（Mac/Windows 观感一致） */
select, select.inp {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
  max-width: 100%;
}
select:disabled { cursor: not-allowed; opacity: .6; }

/* 表格：小屏横向滑动而不是把内容挤碎 */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap .tbl { min-width: 520px; }
/* 单元格不换行：让整表横向滚动，而不是把「姓名」挤成两行竖排 */
.tbl th, .tbl td { white-space: nowrap; }
.tbl-wrap .tbl td { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

/* ---------- 2. 空态 / 骨架加载 ---------- */
.empty {
  text-align: center; padding: 34px 20px;
  border: 1px dashed var(--line); border-radius: 14px; background: #fdfcff;
}
.empty-ico {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--accent-bg); color: var(--accent);
}
.empty-title { font-size: 14.5px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.empty-hint { font-size: 12.5px; color: var(--muted); line-height: 1.75; max-width: 560px; margin: 0 auto; }
.empty-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty.compact { padding: 20px 16px; }
.empty.compact .empty-ico { width: 34px; height: 34px; font-size: 16px; margin-bottom: 8px; border-radius: 10px; }

.skel { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px; }
.skel-row {
  height: 13px; border-radius: 7px;
  background: linear-gradient(90deg, #f2eefc 25%, #e9e3f8 37%, #f2eefc 63%);
  background-size: 400% 100%; animation: skelShine 1.35s ease infinite;
}
.skel-row.w95 { width: 95%; } .skel-row.w80 { width: 80%; } .skel-row.w60 { width: 60%; } .skel-row.w40 { width: 40%; }
.skel-row.tall { height: 34px; border-radius: 10px; }
@keyframes skelShine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel-row { animation: none; } }

/* ---------- 3. 层级菜单选择器（绑定菜单用） ---------- */
.wf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wf-field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
/* 受限宽度：避免在宽屏上两个字段被拉到卡片两端、中间留出一大片空白 */
.wf-field.grow { flex: 1 1 300px; max-width: 380px; }
.wf-field .inp { width: 100%; }

/* 步骤提示：做成一行「步骤胶囊」，比默认 ol 序号更清爽 */
.wf-steps { list-style: none; counter-reset: wfstep; display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; padding: 0; }
.wf-steps li { counter-increment: wfstep; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 13px 4px 10px; }
.wf-steps li::before { content: counter(wfstep); width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.mpick { position: relative; width: 100%; min-width: 0; }
.mpick-trigger {
  width: 100%; min-height: 42px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 6px 12px; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.mpick-trigger:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.mpick.open .mpick-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.12); background: #fff; }
.mpick-ico {
  width: 24px; height: 24px; border-radius: 7px; flex: 0 0 24px;
  background: var(--accent-bg); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.mpick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mpick-main {
  font-size: 13.5px; font-weight: 600; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mpick-sub {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mpick-sub:empty { display: none; }
.mpick-ph .mpick-main { color: #9ca3af; font-weight: 500; }
.mpick-caret { flex: 0 0 auto; color: #9ca3af; font-size: 11px; transition: transform .18s; }
.mpick.open .mpick-caret { transform: rotate(180deg); color: var(--accent); }

.mpick-pop {
  position: fixed; z-index: 300; display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 18px 46px rgba(31,41,55,.18); padding: 10px;
}
.mpick-search { position: relative; }
.mpick-search input {
  width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px 8px 32px; font-size: 13px; color: var(--fg); background: #fbfaff;
  font-family: inherit;
}
.mpick-search input:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.mpick-search::before {
  content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: #9ca3af; font-size: 15px; pointer-events: none;
}
.mpick-list { overflow-y: auto; min-height: 0; }
.mpick-group {
  padding: 9px 8px 5px; font-size: 11.5px; font-weight: 700;
  color: #9ca3af; letter-spacing: .04em;
}
.mpick-opt { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.mpick-opt:hover, .mpick-opt.hl { background: var(--accent-bg); }
.mpick-opt.sel { background: var(--accent-bg); }
.mpick-opt.sel .mpick-opt-name { color: var(--accent); font-weight: 700; }
.mpick-opt.disabled { cursor: not-allowed; }
.mpick-opt.disabled:hover { background: #fafafc; }
.mpick-opt.disabled .mpick-opt-name { color: var(--muted); }
.mpick-opt-ico { flex: 0 0 auto; color: #cbd5e1; font-size: 11px; line-height: 1.5; }
.mpick-opt.sel .mpick-opt-ico { color: var(--accent); }
.mpick-opt-body { min-width: 0; flex: 1; }
.mpick-opt-name {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 13px; color: var(--fg); line-height: 1.45;
}
.mpick-opt-path {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mpick-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.mpick-foot {
  border-top: 1px dashed var(--line); padding-top: 9px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted);
}
.mpick-chip {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.mpick-chip.bound { color: #b45309; background: #fef3c7; border: 1px solid #fde68a; }
.mpick-chip.free { color: #15803d; background: #ecfdf5; border: 1px solid #bbf7d0; }
.mpick-chip.nofield { color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; }

/* ---------- 4. 分段控件（主体类型：角色/用户/组织/用户组） ---------- */
.seg {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: #f5f3fb; border: 1px solid var(--line); border-radius: 10px;
  max-width: 100%; overflow-x: auto;
}
.seg-item {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 14px; border-radius: 8px; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
  min-height: 32px;
}
.seg-item:hover { color: var(--accent); }
.seg-item.on { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(124,58,237,.16); }

/* 过滤器行：把"类型 + 主体 + 菜单"排成有标签的字段组 */
.filter-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-bar .fld > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-bar .fld > select, .filter-bar .fld > input { min-width: 150px; width: 100%; }
.filter-bar .fld.grow { flex: 1 1 240px; }
.filter-bar .fb-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------- 5. 侧栏抽屉（移动端） ---------- */
.nav-toggle { display: none; }
.sidebar-head, .sidebar-foot { display: none; }
.sidebar-mask { position: fixed; inset: 0; z-index: 45; background: rgba(31,41,55,.45); backdrop-filter: blur(2px); }

/* ---------- 6. 平板 ---------- */
@media (max-width: 1180px) {
  .wf-layout { grid-template-columns: 1fr; }
  .wf-side .wf-list { max-height: 320px; overflow-y: auto; }
}

/* ---------- 7. 手机 / 小屏 ---------- */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 38px; flex: 0 0 38px; margin-right: 10px;
    border: 1px solid var(--line); background: #fff; border-radius: 10px;
    cursor: pointer; padding: 0 9px;
  }
  .nav-toggle:hover { border-color: var(--accent-line); background: var(--accent-bg); }
  .nav-toggle-bar { display: block; height: 2px; border-radius: 2px; background: var(--fg); width: 100%; }

  .sidebar {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0;
    width: 84vw; max-width: 310px; flex: none;
    padding: 0 10px 16px; display: flex; flex-direction: column;
    transform: translateX(-104%); transition: transform .24s ease;
    box-shadow: 0 0 44px rgba(31,41,55,.26);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1; background: var(--side);
    padding: 14px 8px 11px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
  }
  .sidebar-title { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
  .sidebar-close {
    border: none; background: transparent; cursor: pointer;
    font-size: 25px; line-height: 1; color: var(--muted); padding: 0 6px;
  }
  .sidebar-close:hover { color: var(--accent); }
  .sidebar-foot {
    display: block; margin-top: auto; padding: 14px 10px 4px;
    border-top: 1px solid var(--line); font-size: 11.5px; color: #9ca3af;
  }
  .menu { overflow-y: auto; padding: 4px 2px 12px; }
  /* 手机端菜单：大触控区 + 清晰层级 */
  .m-lv1 > .m-row, .m-lv2 > .m-row, .m-lv3 > .m-row { min-height: 48px; }
  .m-lv1 > .m-row { font-size: 15px; padding: 12px; }
  .m-lv1.open > .m-row { background: var(--accent-bg); border-radius: 10px; }
  .m-lv2 > .m-row { font-size: 14.5px; padding: 11px 12px 11px 16px; }
  .m-lv3 > .m-row { font-size: 14px; padding: 10px 12px 10px 16px; }
  .m-ico { width: 26px; height: 26px; flex: 0 0 26px; font-size: 14px; }
  .caret { width: 22px; height: 22px; font-size: 12px; }
  /* 子菜单左侧引导线，层级一眼可辨 */
  .menu .m-children { margin: 2px 0 8px 22px; padding-left: 10px; border-left: 2px solid #ece9f8; gap: 2px; }
  .menu .m-children .m-children { margin-left: 14px; }
  body.nav-open { overflow: hidden; }
}

/* ---------- 人事管理（花名册 / 入职 / 离职 / 合同） ---------- */
.hr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hr-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, #fff, #fcfaff); }
.hr-stat .hs-val { font-size: 22px; font-weight: 700; color: var(--fg); line-height: 1.2; font-variant-numeric: tabular-nums; }
.hr-stat .hs-lb { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hr-stat.k-ok .hs-val { color: var(--ok); }
.hr-stat.k-warn .hs-val { color: #b45309; }
.hr-stat.k-bad .hs-val { color: var(--bad); }
.hr-stat.k-mute .hs-val { color: var(--muted); }
.hr-stat.k-info .hs-val { color: var(--accent); }

/* 状态标签变体（在职/试用/到期/终止 等） */
.tag-ok { color: var(--ok); background: #f0fdf4; border-color: #bbf7d0; }
.tag-warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.tag-bad { color: var(--bad); background: #fef2f2; border-color: #fecaca; }
.tag-mute { color: var(--muted); background: #f9fafb; border-color: var(--line); }

/* 人事模块：列表工具栏 / 搜索框 / 附件列表 / 字典 */
.hr-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.hr-toolbar .sp { flex: 1 1 auto; }
.hr-toolbar .inp { min-height: 34px; }
.inp-search { min-width: 160px; flex: 1 1 200px; max-width: 280px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fdfcff; }
.file-row .btn-mini { margin-right: 0; }
.dict-box { margin-bottom: 18px; }
.dict-box h4 { font-size: 14px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.dict-items { display: flex; flex-wrap: wrap; gap: 8px; }
.dict-items .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; }
.dict-items .tag code { font-size: 11px; color: var(--muted); }
.dict-items .tag .btn-mini { margin-right: 0; padding: 2px 8px; }

/* 模态内表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-fld.wide { grid-column: 1 / -1; }
.form-fld > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-fld .inp { width: 100%; }
.form-fld textarea.inp { resize: vertical; min-height: 68px; font-family: inherit; }
/* 密码眼睛：输入框右侧内嵌按钮，默认灰色，点显示后高亮；不挤占栅格宽度 */
.pwd-eye-wrap { position: relative; width: 100%; min-width: 0; }
.pwd-eye-wrap .inp { width: 100%; padding-right: 40px; box-sizing: border-box; }
.pwd-eye-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 32px; height: 30px; padding: 0; border: 0; background: transparent; color: #9ca3af; cursor: pointer; border-radius: 7px; }
.pwd-eye-btn:hover { background: #f3f0fb; color: var(--accent); }
.pwd-eye-btn.is-on { color: var(--accent); }
/* 单位后缀（如回款费率 ‰）：符号常驻输入框右侧，纯视觉、不拦截点击 */
.inp-unit-wrap { position: relative; width: 100%; min-width: 0; }
.inp-unit-wrap .inp { width: 100%; padding-right: 34px; box-sizing: border-box; }
.inp-unit { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 15px; font-weight: 600; line-height: 1; color: var(--accent); pointer-events: none; }
/* 内存态扫描控件（银行卡识别）：图片只用于识别、不保存到系统 */
.scan-btn-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.scan-hint { font-size: 11.5px; color: #9ca3af; }
.scan-live { flex-basis: 100%; font-size: 12px; line-height: 1.5; }
.scan-live:empty { display: none; }
.scan-live.is-running { color: var(--accent); }
.scan-live.is-ok { color: #059669; }
.scan-live.is-err { color: #dc2626; }
.form-hint { font-size: 11.5px; color: #9ca3af; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfaff; }

/* 分区表单（供应商维护）：四列栅格，窄屏逐级降列；只作用于 .cols4，不影响其他业务页 */
.form-sec + .form-sec { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.form-sec-t { margin: 0 0 12px; padding-left: 9px; border-left: 3px solid var(--accent); font-size: 13px; font-weight: 700; color: var(--fg); }
.form-grid.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.cols4 .span2 { grid-column: span 2; }
.form-grid.cols4 .span3 { grid-column: span 3; }
.form-grid.cols4 .span4 { grid-column: span 4; }
.form-grid.cols4 .form-fld { min-width: 0; }
.form-grid.cols4 .form-fld .inp, .form-grid.cols4 .form-fld .ysel-btn { min-width: 0; width: 100%; }
.form-grid.cols4 .form-hint { line-height: 1.45; }

/* 业务列表筛选下拉：自研下拉按钮 .ysel-btn 默认 width:100%，在 flex 工具栏里会被拉成整行，
   这里给它固定宽度，避免「合作状态 / 收款方式」各吃掉一整行、右侧大片空白。 */
.hr-toolbar .inp-filter, .hr-toolbar .inp-filter + .ysel-btn {
  flex: 0 0 170px; width: 170px; min-width: 0; max-width: 170px;
}

@media (max-width: 1100px) {
  .form-grid.cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols4 .span3, .form-grid.cols4 .span4 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .modal.wide.xwide { width: 100%; max-width: 100%; }
  .form-grid.cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .form-grid.cols4 .span2, .form-grid.cols4 .span3, .form-grid.cols4 .span4 { grid-column: span 2; }
  .form-grid.cols4 .form-fld { min-width: 0; }
  .form-grid.cols4 .form-fld .inp, .form-grid.cols4 .form-fld .ysel-btn { min-width: 0; width: 100%; }
  .hr-toolbar .inp-filter + .ysel-btn { width: 100%; max-width: none; flex: none; }
}

/* 表格单元格补充 */
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.tbl .cell-clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 720px) {
  /* 顶栏：手机端不允许收缩换行（否则「曜瓴科技」断行、改密/退出竖排） */
  .topbar { height: 54px; flex-basis: 54px; padding: 0 10px; gap: 6px; }
  .brand { gap: 8px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .brand-logo { height: 30px; flex: 0 0 auto; }
  .brand-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .brand-sub { display: none; }
  .topbar-right { gap: 6px; flex: 0 0 auto; }
  .bell-btn { flex: 0 0 auto; }
  .health { display: none; }
  .divider { display: none; }
  .user-wrap { flex: 0 0 auto; }
  .user-name { display: none; }
  .avatar { width: 26px; height: 26px; font-size: 12px; flex: 0 0 auto; }
  .user-btn { padding: 4px 7px 4px 4px; gap: 5px; }
  .user-menu { min-width: 152px; }
  .home-hero { padding: 18px; border-radius: 14px; margin-bottom: 14px; }
  .hh-hello { font-size: 19px; }
  .hh-sub { font-size: 13px; }

  .content { padding: 16px 12px 40px; }
  .card { padding: 16px; border-radius: 12px; }
  .crumb { font-size: 12px; margin-bottom: 10px; }
  .page-head { margin-bottom: 12px; gap: 8px; }
  .page-title { font-size: 19px; }
  .page-en { display: none; }

  .toolbar { gap: 8px; }
  .toolbar .btn { flex: 1 1 auto; }
  .filter-bar { gap: 10px; }
  .filter-bar .fld, .filter-bar .fld > select, .filter-bar .fld > input { width: 100%; min-width: 0; }
  .filter-bar .fld.grow { flex: 1 1 100%; }
  .filter-bar .fb-actions { margin-left: 0; width: 100%; }
  .filter-bar .fb-actions .btn { flex: 1 1 auto; }

  #member-search { min-width: 0 !important; width: 100%; flex: 1 1 100%; }

  .role-grid, .dash-grid { grid-template-columns: 1fr; gap: 12px; }
  .perm-matrix { max-height: 260px; }

  .modal-overlay { padding: 12px; }
  .modal, .modal.wide, .modal.wide.cat-xl { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 14px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }

  .mpick-foot { font-size: 11px; }
  .mpick-opt { padding: 10px; }

  .wf-sum-item { flex-direction: column; align-items: flex-start; gap: 3px; }
  .wf-sum-item b { min-width: 0; }
  .wf-sum-mode { margin-left: 0; }
  .lf-canvas { height: 340px; }
  .wf-panel-grid { grid-template-columns: 1fr; }

  .pager { justify-content: flex-start; }
  .pager-btns { flex-wrap: wrap; }

  /* 人事：统计卡两列、表单单列 */
  .hr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hr-stat { padding: 10px 12px; }
  .hr-stat .hs-val { font-size: 19px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .modal-foot { flex-direction: row-reverse; }

  .toast-wrap { left: 0; right: 0; top: 62px; bottom: auto; padding: 0 12px; }
  .toast { text-align: left; }

  /* 菜单权限行 → 结构化卡片：标题+#id 一行、复选框四列等宽对齐、删除居右 */
  .mrow { flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px !important; }
  .mrow .m-title { min-width: 0; flex: 1 1 auto; font-size: 14.5px; }
  .mrow .m-id { margin-left: auto; }
  .mrow .m-chks {
    order: 3; width: 100%; margin-left: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px;
  }
  .mrow .m-chks .mperm-chk { font-size: 12.5px; white-space: nowrap; }
  .mrow > .btn-mini { order: 4; margin-left: auto; }

  /* ===== 表格 → 卡片（手机端）：每行一张卡，字段名在左、值在右 ===== */
  .tbl-wrap { overflow-x: visible; }
  .tbl-wrap .tbl { min-width: 0; display: block; }
  .tbl-wrap .tbl thead { display: none; }
  .tbl-wrap .tbl tbody { display: block; }
  .tbl-wrap .tbl tr {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: 8px 14px; margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(31,41,55,.05);
  }
  .tbl-wrap .tbl tr:hover td { background: transparent; }
  .tbl-wrap .tbl td {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
    border-bottom: none; padding: 7px 0; white-space: normal;
    overflow: visible; text-overflow: clip; max-width: none;
    text-align: right; overflow-wrap: anywhere;
  }
  .tbl-wrap .tbl td::before {
    content: attr(data-label); flex: 0 0 auto;
    font-size: 12px; font-weight: 600; color: var(--muted); text-align: left;
  }
  .tbl-wrap .tbl td:first-of-type { font-weight: 600; }
  /* 操作列：按钮平铺整行，好按 */
  .tbl-wrap .tbl td.row-actions {
    flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line);
  }
  .tbl-wrap .tbl td.row-actions::before { content: none; }
  .tbl-wrap .tbl td.row-actions .btn-mini { flex: 1 1 auto; text-align: center; padding: 8px 10px; white-space: nowrap; }
  .tbl .cell-clip { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; }
  /* 人事列表：工具栏重排为栅格（主按钮整行 / 次按钮两列 / 搜索·筛选自适应）
     🔴 列必须 minmax(0,1fr)（纯 1fr=minmax(auto,1fr) 会被月份输入框等固有宽度撑破容器） */
  .hr-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; margin-bottom: 12px; }
  .hr-toolbar .sp { display: none; }
  .hr-toolbar > .btn { width: 100%; }
  .hr-toolbar [data-act="new"] { grid-column: 1 / -1; }
  .hr-toolbar .inp-search { grid-column: 1 / -1; max-width: none; min-width: 0; }
  .hr-toolbar .inp { width: 100%; min-width: 0; }
  /* 筛选下拉占满整行：源 select（.inp-filter 或只用 data-ef 的普通 select）经 selObserver
     转成 .ysel-btn 后，320px 下两列各约 120px，「经营状态：全部」这类标签+值会被 ellipsis
     截成「经营状态：…」。占满整行后文字完整，且不与相邻筛选互相挤压。
     注意：日期选择器是 .dp-disp、月份是 input[type=month]，都不是 .ysel-btn，不受影响。 */
  .hr-toolbar .inp-filter, .hr-toolbar .ysel-btn, .hr-toolbar select.inp[data-ef] { grid-column: 1 / -1; width: 100%; max-width: none; flex: none; }
  .hr-toolbar select.inp:only-of-type { grid-column: 1 / -1; }
  .hr-toolbar > span:not(.sp) { grid-column: 1 / -1; }

  /* 字段名（data-label）由 JS 注入：加载态 / 空态单元格不显示标签 */
  .tbl-wrap .tbl td.loading-cell::before { content: none; }
  .tbl-wrap .tbl td.loading-cell { justify-content: center; color: var(--muted); }
  .tbl-wrap .tbl td.empty-cell::before { content: none; }
  /* 空态行：整行不套卡片样式，让内部 .empty 正常铺开 */
  .tbl-wrap .tbl tr.empty-row { background: transparent; border: none; box-shadow: none; padding: 0; margin: 0; }
  .tbl-wrap .tbl tr.empty-row td.empty-cell { display: block; padding: 0; }
  /* 卡片里空白字段不占行（值全空时卡片才清爽） */
  .tbl-wrap .tbl td.cell-empty { display: none; }
}

/* ---------- 8. 超小屏微调 ---------- */
@media (max-width: 420px) {
  .brand-name { font-size: 15px; letter-spacing: 0; }
  .toolbar .btn { flex: 1 1 100%; }
  .seg-item { padding: 6px 10px; font-size: 12.5px; }

  /* 分页条：320px 下 5 个按钮必须挤在一行，不能让「末页」孤儿般掉到第二行。
     缩小内边距与间距，字号略降；pager-info 去掉左右留白。 */
  .pager { gap: 6px; }
  .pager-btns { flex-wrap: nowrap; gap: 3px; width: 100%; justify-content: space-between; }
  .pager-btns .btn-mini { padding: 5px 6px; font-size: 11.5px; white-space: nowrap; }
  .pager-info { min-width: 0; padding: 0 2px; font-size: 11.5px; }
  /* 成员分页同理：4 按钮 + 页码 + 每页条数保持两行内的紧凑排布，不出现第三行 */
  .pager-row { gap: 6px; }
  .pager-ctl { flex-wrap: nowrap; gap: 3px; width: 100%; justify-content: space-between; }
  .pager .pg-btn { padding: 0 5px; font-size: 11.5px; }
  .pager-now { min-width: 0; padding: 0 2px; }
  /* 每页条数：原生 select 与 selObserver 生成的 .ysel-btn 都要给宽度，
     否则按钮被压成 44px，「20 条/页」被截成一个数字并掉到第二行。 */
  .pager .pg-size, .pager-ctl > .ysel-btn { max-width: 88px; width: 88px; flex: 0 0 88px; font-size: 11.5px; padding-right: 22px; }
}

/* ---------- 9. 手机端底部导航（替代抽屉） ---------- */
.bottomnav, .bn-sheet, .bn-sheet-mask { display: none; }
@media (max-width: 900px) {
  .nav-toggle { display: none !important; }
  .content { padding-bottom: 96px; }

  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 14px rgba(31,41,55,.07);
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 0 4px; border-radius: 10px; cursor: pointer; user-select: none;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .bn-item .bn-ico {
    width: 26px; height: 26px; border-radius: 9px; background: #f3f4f6; color: #6b7280;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
  }
  .bn-item.on { color: var(--accent); }
  .bn-item.on .bn-ico { background: var(--accent-bg); color: var(--accent); }
  .bn-item:active { background: var(--accent-bg); }

  .bn-sheet-mask { display: block; position: fixed; inset: 0; z-index: 64; background: rgba(31,41,55,.45); backdrop-filter: blur(2px); }
  .bn-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
    background: #fff; border-radius: 18px 18px 0 0;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: 68vh; overflow-y: auto;
    box-shadow: 0 -10px 34px rgba(124,58,237,.22);
    animation: bnUp .22s ease;
  }
  .bn-sheet::before { content: ''; display: block; width: 42px; height: 4px; border-radius: 3px; background: var(--accent-line); margin: 0 auto 12px; }
  @keyframes bnUp { from { transform: translateY(30%); opacity: .4; } to { transform: none; opacity: 1; } }
  .bn-sheet-title { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .06em; text-align: center; margin-bottom: 12px; }
  .bn-sheet-title::after { content: ''; display: block; width: 34px; height: 3px; border-radius: 2px; background: var(--accent); margin: 8px auto 0; }
  .bn-sheet-list { display: flex; flex-direction: column; gap: 2px; }
  .bn-opt {
    display: flex; align-items: center; min-height: 48px; padding: 10px 14px;
    border-radius: 12px; font-size: 15.5px; font-weight: 600; color: var(--fg); cursor: pointer;
  }
  .bn-opt:active, .bn-opt:hover { background: var(--accent-bg); color: var(--accent); }
  .bn-opt.on { background: var(--accent-bg); color: var(--accent); }
  .bn-group { font-size: 12px; font-weight: 700; color: var(--accent); padding: 12px 14px 4px; }
  .bn-group::before { content: ''; display: inline-block; width: 3px; height: 11px; border-radius: 2px; background: var(--accent); margin-right: 7px; vertical-align: -1px; }
  .bn-opt.bn-sub { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--accent-line); border-radius: 0 12px 12px 0; font-size: 14.5px; font-weight: 500; color: #374151; min-height: 44px; }
  .bn-cancel {
    width: 100%; margin-top: 12px; min-height: 48px; border: 1px solid var(--accent-line);
    background: var(--accent-bg); border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--accent); cursor: pointer;
  }
}

/* ---------- 10. 垫付台账 ---------- */
.sp-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 6px; }
.sp-detail .sd-item { min-width: 0; }
.sp-detail .sd-lb { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.sp-detail .sd-vl { font-size: 14px; color: var(--fg); word-break: break-word; }
.sp-detail .sd-item.wide { grid-column: 1 / -1; }
.sp-sec { font-size: 13px; font-weight: 700; color: var(--fg); margin: 12px 0 8px; }
.sp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 4px; }
.sp-thumb { position: relative; aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f9fafb; }
.sp-thumb a { display: block; width: 100%; height: 100%; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-thumb-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(31, 41, 55, .68); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.sp-thumb-del:hover { background: var(--danger, #dc2626); }
.sp-thumb-name { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 11px; color: var(--fg); background: rgba(255,255,255,.85); border-radius: 5px; padding: 2px 5px; line-height: 1.35; max-height: 36px; overflow: hidden; white-space: normal; }
.sp-none { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.chk-row { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 4px 0; }
.chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fg); cursor: pointer; }
.chk-inline input { accent-color: var(--accent); }
.sp-voucher-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.sp-voucher-box .btn { margin: 2px 0 6px; }
.amt-high { color: #c2410c; font-weight: 700; }
.amt-flag { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; background: #c2410c; color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
@media (max-width: 720px) {
  .sp-detail { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- 11. 自研日历选择器（系统紫，日/月两模式） ---------- */
.dp-disp { cursor: pointer; caret-color: transparent; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 32px; }
.dp-backdrop { position: fixed; inset: 0; z-index: 400; background: rgba(31,41,55,.35); }
.dp-panel { position: fixed; z-index: 401; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(124,58,237,.28); animation: dpIn .16s ease; }
@keyframes dpIn { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.dp-head { background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%); color: #fff; padding: 14px 18px 16px; }
.dp-head-y { font-size: 12.5px; opacity: .85; margin-bottom: 2px; }
.dp-head-b { font-size: 21px; font-weight: 700; letter-spacing: .02em; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px; font-size: 14px; font-weight: 600; color: var(--fg); }
.dp-nav button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 18px; color: var(--accent); cursor: pointer; }
.dp-nav button:hover { background: var(--accent-bg); }
.dp-wk { display: grid; grid-template-columns: repeat(7, 1fr); padding: 4px 12px 2px; font-size: 11.5px; color: var(--muted); text-align: center; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4px 12px 8px; }
.dp-months { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 14px 10px; }
.dp-cell { height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 13.5px; color: var(--fg); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dp-months .dp-cell { height: 40px; border-radius: 10px; font-size: 13px; }
.dp-cell:hover { background: var(--accent-bg); }
.dp-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 600; }
.dp-cell.on { background: var(--accent); color: #fff; font-weight: 700; box-shadow: none; }
.dp-cell.on:hover { background: var(--accent); }
.dp-empty { visibility: hidden; }
.dp-foot { display: flex; align-items: center; gap: 6px; padding: 8px 14px 12px; }
.dp-sp { flex: 1; }
.dp-fb { border: 0; background: transparent; color: var(--accent); font-size: 13.5px; font-weight: 600; padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.dp-fb:hover { background: var(--accent-bg); }
.dp-ok { background: var(--accent); color: #fff; }
.dp-ok:hover { background: #6d28d9; }

/* ---------- 11b. 自研主题化下拉选择器（替代原生 select 系统弹层） ---------- */
.ysel-btn {
  width: 100%; display: block; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.ysel-btn.ysel-empty { color: var(--muted); }
.ysel-btn:disabled { cursor: not-allowed; opacity: .6; }
.filter-bar .fld > .ysel-btn { min-width: 150px; }
.sel-backdrop { position: fixed; inset: 0; z-index: 400; background: rgba(31,41,55,.35); }
.sel-panel {
  position: fixed; z-index: 401; background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(124,58,237,.28);
  animation: dpIn .16s ease;
}
.sel-head { flex: 0 0 auto; background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%); color: #fff; padding: 12px 16px 13px; }
.sel-head-t { font-size: 12px; opacity: .85; margin-bottom: 2px; }
.sel-head-b { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-list { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px; }
.sel-empty { padding: 22px 10px; text-align: center; font-size: 13px; color: var(--muted); }
.sel-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 42px; padding: 8px 12px; border: 0; background: transparent; border-radius: 10px;
  font-size: 14.5px; color: var(--fg); text-align: left; cursor: pointer; font-family: inherit;
}
.sel-opt-t { flex: 1 1 auto; min-width: 0; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.sel-tick { flex: 0 0 auto; color: var(--accent); font-weight: 800; font-size: 14px; opacity: 0; }
.sel-opt:hover { background: var(--accent-bg); }
.sel-opt.on { background: var(--accent-bg); }
.sel-opt.on .sel-opt-t { color: var(--accent); font-weight: 700; }
.sel-opt.on .sel-tick { opacity: 1; }
.sel-opt:disabled { opacity: .45; cursor: not-allowed; }
.sel-foot { flex: 0 0 auto; padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.sel-fb { width: 100%; min-height: 44px; border: 1px solid var(--accent-line); background: var(--accent-bg); color: var(--accent); border-radius: 11px; font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.sel-fb:hover { background: #ece4fd; }

/* ---------- 12. 应用内确认弹窗（替代浏览器原生 confirm） ---------- */
.cd-overlay { z-index: 200; }
.cd-modal { width: 400px; max-width: 88vw; overflow: hidden; }
.cd-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.cd-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: var(--accent); background: var(--accent-bg); }
.cd-ico.danger { color: var(--bad); background: #fef2f2; }
.cd-title { font-size: 15.5px; font-weight: 700; color: var(--fg); }
.cd-body { padding: 12px 20px 6px; }
.cd-msg { font-size: 13.5px; line-height: 1.65; color: #4b5563; word-break: break-word; }
.cd-inp { width: 100%; margin-top: 12px; }
.cd-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 18px; }
.cd-danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.cd-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
/* 危险动作小按钮：hr-ui 用的是 btn-danger（此前未定义样式），统一补上 */
.btn-mini.btn-danger { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.btn-mini.btn-danger:hover { color: #b91c1c; border-color: #fca5a5; background: #fee2e2; }

/* ---------- 13. 顶栏消息铃铛 + 消息中心 ---------- */
.bell-btn { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; color: var(--muted); padding: 0; }
.bell-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.inbox-modal { width: 560px; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 12px; }
.inbox-tabs { display: flex; gap: 6px; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 54vh; overflow: auto; }
.inbox-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.inbox-item.unread { background: var(--accent-bg); border-color: var(--accent-line); }
.inbox-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inbox-item-title { font-size: 13.5px; font-weight: 700; color: var(--fg); }
.inbox-item-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.inbox-item-body { font-size: 12.5px; color: #4b5563; margin-top: 5px; line-height: 1.6; word-break: break-word; }
.inbox-item-foot { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.inbox-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.inbox-empty { padding: 26px 0; }
@media (max-width: 720px) {
  .cd-modal { width: 100%; }
  .inbox-modal { width: 100%; }
  .inbox-list { max-height: 60vh; }
}

@media print {
  .sidebar, .topbar, .nav-toggle, .sidebar-mask, .bottomnav, .bn-sheet, .bn-sheet-mask { display: none !important; }
  .content { overflow: visible; padding: 0; }
}

/* ===== 首页驾驶舱（待办 / 我的数据 / 后续开放 / 最近消息） ===== */
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.hr-stat[data-go] { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.hr-stat[data-go]:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hr-stat[data-go]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fff; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.todo-row:hover { transform: translateY(-1px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.todo-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo-row .tr-main { flex: 1 1 auto; min-width: 0; }
.todo-row .tr-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.todo-row .tr-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.todo-row .tr-count { flex: 0 0 auto; font-size: 20px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.todo-row .tr-go { flex: 0 0 auto; font-size: 12.5px; color: var(--accent); }

.dash-card.is-building { opacity: .72; cursor: default; }
.dash-card.is-building:hover { transform: none; box-shadow: none; }
.dash-card .dc-flag {
  display: inline-block; margin-top: 8px; font-size: 11.5px; color: var(--muted);
  background: #f9fafb; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.dash-foot { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

.nt-list { display: flex; flex-direction: column; gap: 8px; }
.nt-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.nt-row:last-child { border-bottom: none; }
.nt-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.nt-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.nt-title { font-size: 13.5px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .todo-row { flex-wrap: wrap; }
  .todo-row .tr-main { flex: 1 1 100%; }
  .nt-main { flex-direction: column; align-items: flex-start; gap: 2px; }
  .nt-title { white-space: normal; }
}
.tag-info { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-line); }

/* ===== 审批催办 / 转办 / 超时标记 ===== */
.flow-od { color: var(--danger, #dc2626); font-weight: 600; }
tr.row-od { background: rgba(220, 38, 38, .04); }
.btn-mini[disabled] { opacity: .55; cursor: not-allowed; }
.todo-row-od .tr-title { color: var(--bad, #dc2626); }
.todo-row-od .tr-count { color: var(--bad, #dc2626); }

/* ===== 产品 → 辅料管理（三页签表单 / 报价子表 / 多图） ===== */
.acc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
.acc-tab {
  border: 0; background: none; cursor: pointer; padding: 9px 16px 10px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.acc-tab:hover { color: var(--accent); }
.acc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
/* 产品档案 · 采购信息 · 规格信息：公制/英制切换（嵌在页签内部，不是独立页签） */
.pd-measure-tabs { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; min-width: 0; }
.pd-measure-label { font-size: 12px; color: var(--muted); flex: none; }
.pd-measure-tabs .acc-tab { padding: 6px 14px; border: 1px solid var(--line); border-radius: 4px; background: transparent; font-size: 12px; }
.pd-measure-tabs .acc-tab.active { border-color: var(--accent); color: var(--accent); background: transparent; }
/* 英制字段组：默认带 yl-imperial-hidden 隐藏，选「英制」由 JS 移除该类才展开（参照领星）。
   只切换隐藏类、不改写 display，桌面 td=table-cell / 手机卡片 td=flex 各走各自原有样式。 */
.yl-imperial-hidden { display: none !important; }
/* 英制派生值：只读，用浅灰底+不可编辑光标提示用户这是公制自动换算出来的 */
input.yl-derived { background: var(--bg-soft, #f5f6f8); color: var(--muted, #64748b); cursor: default; }
.acc-panel[hidden] { display: none !important; }
/* 基本信息字段分类：表单用主分区标题，详情用次级小标题，避免 13 个字段平铺成一整块 */
.acc-panel .form-sec-t { font-size: 12.5px; }
.acc-subsec + .acc-subsec { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.acc-subsec-t { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.acc-subsec .acc-detail-val { font-size: 12.5px; }
.acc-subbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.acc-subbar .sp { flex: 1 1 auto; }
.acc-drop-hint {
  font-size: 12px; color: #9a6a12; background: #fff8ec;
  border: 1px solid #f4e2bd; border-radius: 8px; padding: 6px 10px;
}
.acc-tip {
  background: #eef4ff; border: 1px solid #d8e6ff; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; font-size: 12.5px; color: #334155;
}
.acc-tip b { color: #1e3a8a; }
.acc-tip ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.75; }
.acc-quotes-wrap { overflow-x: auto; }
.acc-quotes { min-width: 1120px; }
.acc-quotes .inp-sm { width: 100%; min-width: 78px; padding: 5px 8px; font-size: 12.5px; }
.acc-qno { width: 46px; }
.acc-scroll-hint {
  margin: 0 0 8px; padding: 6px 10px; border-radius: 8px;
  font-size: 12px; color: #9a6a12; background: #fff8ec; border: 1px solid #f4e2bd;
}
.acc-scroll-hint[hidden] { display: none !important; }
.acc-drop {
  border: 1px dashed var(--accent-line); border-radius: 12px; padding: 12px;
  min-height: 120px; background: #fcfbff; transition: border-color .15s ease, background .15s ease;
}
.acc-drop.dragover { border-color: var(--accent); background: var(--accent-bg); }
.acc-drop-empty { text-align: center; padding: 18px 0 6px; font-size: 12.5px; }
.acc-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.acc-thumb {
  position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; min-width: 0; padding-bottom: 20px;
}
.acc-thumb img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f3f4f6; }
.acc-thumb-cap {
  display: block; font-size: 11px; color: var(--muted); padding: 4px 6px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acc-thumb-src {
  position: absolute; left: 6px; top: 6px; font-size: 10px; color: #fff;
  background: rgba(30, 41, 59, .72); border-radius: 999px; padding: 2px 6px;
}
.acc-thumb-del {
  position: absolute; right: 5px; top: 5px; width: 22px; height: 22px; line-height: 20px;
  border: 0; border-radius: 50%; cursor: pointer; font-size: 15px;
  color: #fff; background: rgba(30, 41, 59, .72);
}
.acc-thumb-del:hover { background: var(--bad, #dc2626); }
.inp-with-suf { position: relative; min-width: 0; }
.inp-with-suf .inp { padding-right: 46px; box-sizing: border-box; }
.inp-suf {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--muted); pointer-events: none;
  border-left: 1px solid var(--line); padding-left: 8px;
}
.acc-count { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 3px; }
.acc-detail-val { padding: 4px 0; word-break: break-all; font-size: 13px; color: var(--fg); }

@media (max-width: 1100px) {
  .acc-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .acc-tabs { overflow-x: auto; }
  .acc-tab { padding: 9px 12px; }
  .acc-subsec-t { font-size: 11.5px; }
  .modal.wide.xwide.acc-wide { width: 100%; max-width: 100%; }
  .acc-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-quotes { min-width: 0; }
  .acc-quotes thead { display: none; }
  .acc-quotes tbody tr {
    display: block; border: 1px solid var(--line); border-radius: 10px;
    margin-bottom: 10px; padding: 8px 10px;
  }
  .acc-quotes tbody td {
    display: flex; align-items: center; gap: 8px;
    border: 0; padding: 4px 0; min-width: 0;
  }
  .acc-quotes tbody td::before {
    content: attr(data-label); flex: 0 0 88px;
    color: var(--muted); font-size: 12px;
  }
  .acc-quotes .inp-sm { min-width: 0; }
  .acc-subbar .sp { display: none; }
  .acc-drop-hint { width: 100%; }
}

/* ===== 产品管理（product-manage）专用补充样式 =====
   基础组件（acc-tabs / acc-panel / acc-subbar / acc-thumbs / form-grid cols4 / acc-wide）
   复用辅料模块；这里只补产品页新增的少量结构。 */
.pd-tabs { flex-wrap: wrap; row-gap: 6px; }
/* 子表面板（规格明细 / 关联辅料 / 相关产品配对 / 质检项）紧接在上方字段之后，
   原先 margin-top 为 0：39px 高的「+ 新增」按钮会压住上一个输入框底边，
   输入框底线还会横穿右侧「共 N 行」计数，看起来挤在一起。留出间隔 + 一条虚线分隔。 */
.acc-panel > .acc-panel { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
/* 「关联辅料」「相关产品配对」这两个页签没有上方字段，子面板就是首个子元素：
   此时不需要分隔线和额外间距，否则页签下会凭空多出一条虚线 */
.acc-panel > .acc-panel:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pd-sub { min-width: 900px; }
.pd-sub .inp-sm { min-width: 90px; }
.pd-sub .acc-sel { min-width: 150px; max-width: 220px; }
/* 子表控件跟随列宽收缩。input / select 自带约 20 字符的固有宽度，表格按 auto 布局会把它当成
   最小内容宽度——12 列的「关联辅料」子表因此被撑到 2206px，而弹窗内可用只有 1280px，
   1440 下也出现横向滚动、末列（采购链接）看不见。改成百分比宽度 + 合理下限即可整表收敛。 */
.pd-sub td .inp-sm { width: 100%; min-width: 72px; }
.pd-sub td .acc-sel { width: 100%; min-width: 110px; }
/* 下拉框的固有宽度取「最长选项」的宽度，供应商名称动辄十几个字，会把整张「供应商报价」表撑出横向滚动。
   只给供应商下拉封顶 + 允许收缩，超长名称由原生 select 自行裁切，表格宽度不再随某个名称变长而漂移。 */
.pd-sub td select.sup-sel { min-width: 0; max-width: 168px; }
/* 原生 select 会被 selObserver 换成 .ysel-btn 按钮且原元素 display:none，
   宽度上限必须同时落到按钮上，否则供应商列仍按最长名称撑宽整表 */
.pd-sub td:has(select.sup-sel) .ysel-btn { width: 100%; min-width: 0; max-width: 168px; }
.pd-sub td:has(select.sup-sel) { max-width: 200px; }
/* 带单位的数字格（外箱·长 cm 等）：输入框占满整格后会把单位挤出可视区、被单元格省略号吃掉。
   改为单位绝对定位在格内右侧 + 输入框留右内边距，与上方表单字段的单位后缀观感一致。 */
.pd-sub td { position: relative; }
.pd-sub td .cell-unit { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin: 0; pointer-events: none; }
/* 只给「确实带单位」的格子留右内边距，避免所有文本格白白损失 26px；
   不支持 :has 的旧内核退化为不留白，单位仍可见、仅极端长数字时才可能贴近单位。 */
.pd-sub td:has(.cell-unit) .inp-sm { padding-right: 26px; }
.pd-sub .cell-unit { margin-left: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.pd-sub.acc-wide-table { min-width: 1240px; }
/* 单元格内的单位（税率 % 等）与数字留出间距，避免截图里「%」紧贴输入框右边缘挤在一起 */
.pd-sub td:has(.cell-unit) .inp-sm { padding-right: 34px; }
.pd-sub td .cell-unit { right: 10px; }
/* 需要更宽的输入框（采购链接 / 备注） */
.pd-sub td .inp-wide { min-width: 220px; }
/* 关联辅料：辅料比例「主料 [ ] : [ ] 辅料」并排；控件收得住、不撑破列宽 */
.acc-ratio { display: flex; align-items: center; gap: 4px; min-width: 0; }
.acc-ratio .inp-sm { flex: 1 1 0; width: 0; min-width: 0; text-align: center; padding-right: 4px; }
.acc-ratio-l { flex: 0 0 auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.acc-ratio-sep { flex: 0 0 auto; color: var(--muted); }
/* 质检内容：多行文本 + 0/512 字数，计数贴在右下 */
.qc-content-box { position: relative; min-width: 0; }
.qc-content { width: 100%; min-width: 0; resize: vertical; line-height: 1.5; padding: 6px 8px 22px; }
.qc-count { position: absolute; right: 8px; bottom: 6px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
/* 供应商报价条件列：开票类型≠普票/专票时隐藏税率、采购类型=线下采购时隐藏采购链接、
   是否含运费=否时隐藏运费金额。td 本身保留以撑住表头列宽，只隐藏内部控件并显示「—」占位。 */
.pd-sub td.yl-cond-off > .inp,
.pd-sub td.yl-cond-off > .ysel-btn,
.pd-sub td.yl-cond-off > .cell-unit { display: none !important; }
.pd-sub td.yl-cond-off::after {
  content: '—';
  color: var(--muted, #94a3b8);
  font-size: 13px;
  line-height: 1;
}
/* ===== 供应商报价：一条报价 = 一张双行卡片 =====
   上排放供应商/币种/开票/税率/数量/单价/含税单价/交期，下排放采购类型/链接/运费/备注。
   外层 div[data-sbody] 装多张 table，tbody[data-srow] 仍是一笔报价，提交与计算逻辑不变。 */
.quote-list { display: flex; flex-direction: column; gap: 12px; }
.quote-card-table { width: 100%; min-width: 0; table-layout: fixed; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card, #fff); }
.quote-card-table td { position: relative; padding: 6px 8px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; min-width: 0; }
/* 双行卡片没有独立表头，列名直接落在每格控件上方的小标签里，避免用户看不出每格是什么 */
.quote-card-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: nowrap; }
.quote-card-table tr:last-child td { border-bottom: 0; }
.quote-card-table .q-no { text-align: center; color: var(--muted); font-size: 12px; }
.quote-card-table .q-no::before, .quote-card-table .q-empty::before { display: none; }
.quote-card-table .q-empty { padding: 0; }
.quote-card-table td .inp-sm { width: 100%; min-width: 0; }
.quote-card-table td .ysel-btn { width: 100%; min-width: 0; max-width: none; }
.quote-card-table td:has(select.sup-sel) .ysel-btn { max-width: none; }
.quote-card-table .cell-unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); margin: 0; pointer-events: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.quote-card-table td:has(.cell-unit) .inp-sm { padding-right: 34px; }
.quote-card-table .quote-remark { display: block; width: 100%; min-width: 0; height: 54px; line-height: 1.4; resize: vertical; }
/* ===== 采购规格明细（领星式）：10 列表格，每格内「公制在上、英制在下」两行 =====
   一个规格仍是一行 tr，所有控件 data-k 不变；只改视觉排布，不触碰提交/换算逻辑。
   体积列为系统派生只读值（cm³ / inch³）。 */
.pd-sub.ps-spec-table { min-width: 940px; width: 100%; table-layout: fixed; }
.pd-sub.ps-spec-table th:nth-child(1) { width: 48px; }
.pd-sub.ps-spec-table th:nth-child(2) { width: 13%; }  /* 辅料名称 */
.pd-sub.ps-spec-table th:nth-child(3) { width: 8%; }   /* 单位数量 */
.pd-sub.ps-spec-table th:nth-child(4),
.pd-sub.ps-spec-table th:nth-child(5) { width: 19%; }  /* 外箱/包装规格：3+3 输入 */
.pd-sub.ps-spec-table th:nth-child(6),
.pd-sub.ps-spec-table th:nth-child(7) { width: 9%; }   /* 外箱体积/包装体积（只读） */
.pd-sub.ps-spec-table th:nth-child(8),
.pd-sub.ps-spec-table th:nth-child(9) { width: 9%; }   /* 单箱重量/单品毛重 */
.pd-sub.ps-spec-table th:nth-child(10) { width: 56px; } /* 操作 */
/* 外箱/包装规格：长/宽/高 写在输入框内做占位提示（表头再给一次「长×宽×高」）。
   早先放在框外的 span 在窄列会被挤到下一行，公制/英制两行样式对不上，已废弃。 */
.ps-dim-h { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.ps-line .inp-sm::placeholder { font-size: 11px; color: var(--muted); opacity: .8; }
.pd-box-sec-t { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ps-pair { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ps-line { display: flex; align-items: center; gap: 3px; min-width: 0; }
.ps-line .inp-sm { flex: 1 1 0; width: 0; min-width: 0; padding-right: 4px; text-align: center; }
/* 单位（cm / inch / cm³ / inch³ / kg / g / lb）定宽，不能被输入框挤到只剩半个字 */
.ps-line .ps-unit { flex: 0 0 auto; width: 40px; text-align: center; color: var(--muted); font-size: 10.5px; letter-spacing: -.2px; white-space: nowrap; }
.ps-detail-unit { line-height: 1.5; }
.ps-detail-imp { color: var(--muted); }
/* 单品条码与「+ 新增采购规格明细」按钮之间留出呼吸空间 */
.pd-purchase-spec .form-grid + .acc-subbar { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; min-height: 34px; }
.radio-l { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--fg); cursor: pointer; }
.radio-l input { accent-color: var(--accent); }
.pd-total { margin-top: 12px; text-align: right; font-size: 13.5px; color: var(--muted); }
.pd-total b { color: var(--fg); font-variant-numeric: tabular-nums; }
.pd-detail .form-sec-t { margin-top: 18px; }
.pd-detail .form-sec-t:first-child { margin-top: 4px; }
.pd-kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.pd-kv { display: flex; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.pd-kv span { color: var(--muted); flex: 0 0 88px; }
.pd-kv b { color: var(--fg); font-weight: 500; word-break: break-word; min-width: 0; }
.pd-desc { font-size: 13px; line-height: 1.6; color: var(--fg); white-space: pre-wrap; background: var(--bg-soft, #f8fafc); padding: 10px 12px; border-radius: 8px; }
.pd-detail .acc-thumbs { margin-top: 6px; }

@media (max-width: 720px) {
  .pd-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
  .pd-kv { flex-direction: column; gap: 2px; }
  .pd-kv span { flex: none; font-size: 11.5px; }
  .pd-sub, .pd-sub.acc-wide-table, .pd-sub.ps-spec-table { min-width: 0; }
  /* 领星式明细：320px 下「标签 + 3 个输入框 + 单位」横向塞不下（会截掉第三格和单位），
     改为标签独占一行、输入区占满整行；桌面仍保持紧凑的上下两行。 */
  .pd-sub.ps-spec-table tbody td:has(.ps-pair) { flex-direction: column; align-items: stretch; gap: 4px; }
  .pd-sub.ps-spec-table tbody td:has(.ps-pair)::before { flex: none; padding-top: 0; }
  .ps-pair { width: 100%; flex: 1 1 auto; min-width: 0; }
  .ps-line { width: 100%; }
  .ps-line .inp-sm { min-width: 0; width: 0; font-size: 11px; padding-left: 2px; padding-right: 2px; }
  .ps-line .ps-unit { width: 32px; flex-basis: 32px; font-size: 10px; }
  .ps-line .inp-sm::placeholder { font-size: 10px; }
  .ps-dim-h { font-size: 9.5px; }
  .pd-sub thead { display: none; }
  .pd-sub tbody tr {
    display: block; border: 1px solid var(--line); border-radius: 10px;
    margin-bottom: 10px; padding: 8px 10px;
  }
  .pd-sub tbody td {
    display: flex; align-items: center; gap: 8px;
    border: 0; padding: 4px 0; min-width: 0;
  }
  .pd-sub tbody td::before {
    content: attr(data-label); flex: 0 0 96px;
    color: var(--muted); font-size: 12px;
  }
  .pd-sub .inp-sm, .pd-sub .acc-sel { min-width: 0; width: 100%; }
  /* 拉长输入框在卡片模式下随卡片撑满，不得保留桌面端的 220px 下限，否则 320px 溢出 */
  .pd-sub td .inp-wide { min-width: 0; }
  /* 领星式三输入框行：上面的通用 width:100% 会与 flex-basis:0 打架，320px 下把单位挤出格子。
     这里用更高优先级锁回弹性收缩，保证长宽高三格 + 单位始终在卡片内完整显示。 */
  .pd-sub.ps-spec-table .ps-line .inp-sm { flex: 1 1 0; width: 0; min-width: 0; }
  .pd-sub.ps-spec-table .ps-line .ps-unit { width: 40px; flex-basis: 40px; }
  /* 关联辅料：辅料下拉的占位文字在 320px 会被「标签96px + 按钮」挤到省略号，
     让这一格标签独占一行、下拉占满整行（与采购规格明细同口径）。 */
  .pd-sub tbody td:has(> .acc-sel),
  .pd-sub tbody td:has(> .ysel-btn) { flex-direction: column; align-items: stretch; gap: 4px; }
  .pd-sub tbody td:has(> .acc-sel)::before,
  .pd-sub tbody td:has(> .ysel-btn)::before { flex: none; padding-top: 0; }
  .pd-sub tbody td .acc-sel,
  .pd-sub tbody td .ysel-btn { width: 100%; max-width: none; }
  /* 关联辅料比例：卡片模式下标签固定、两个输入框弹性收缩，320px 下不溢出 */
  /* 窄屏让「辅料比例」标签独占一行、双输入占满剩余宽度，避免 320px 下横向溢出 */
  .pd-sub tbody td:has(.acc-ratio) { flex-wrap: wrap; }
  .pd-sub tbody td:has(.acc-ratio)::before { flex: 0 0 100%; padding-top: 0; }
  .acc-ratio { flex: 1 1 100%; width: 100%; }
  .acc-ratio .inp-sm { flex: 1 1 0; width: 0; min-width: 0; }
  /* 质检内容：卡片模式下文本域占满剩余宽度，计数绝对定位不参与伸缩 */
  .qc-content-box { flex: 1 1 auto; width: 100%; }
  .qc-content { width: 100%; min-width: 0; }
  /* 卡片模式下供应商下拉要占满整行，桌面端为防撑宽设的 168px 上限在这里没意义 */
  .pd-sub td:has(select.sup-sel), .pd-sub td:has(select.sup-sel) .ysel-btn { max-width: none; }
  /* 供应商报价：双行卡片在窄屏改为纵向字段列表，每条报价仍是一整块 */
  .quote-card-table, .quote-card-table tbody { display: block; width: 100%; }
  .quote-card-table colgroup { display: none; }
  /* 覆盖上面 .pd-sub tbody tr 的通用卡片样式：一条报价的两排共用同一个外框，中间只留一条虚线 */
  .pd-sub.quote-card-table tbody tr { display: block; margin-bottom: 0; padding: 4px 10px; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; }
  .pd-sub.quote-card-table tbody tr:last-child { border-bottom: 0; }
  .quote-card-table td, .quote-card-table tbody td { display: flex; align-items: center; gap: 8px; border: 0; padding: 4px 0; min-width: 0; }
  .quote-card-table td::before { content: attr(data-label); flex: 0 0 96px; color: var(--muted); font-size: 12px; padding-bottom: 0; white-space: normal; }
  .quote-card-table .q-empty { display: none !important; }
  .quote-card-table td:has(.ysel-btn) { flex-direction: column; align-items: stretch; gap: 4px; }
  .quote-card-table td:has(.ysel-btn)::before { flex: none; padding-top: 0; }
  .quote-card-table .quote-remark { flex: 1 1 auto; width: 100%; }
  .radio-row { gap: 12px; }
}

/* ===== 基础信息：分类管理 / 图片管理（迁移 046） ===== */
.cat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.cat-table-pane, .img-table-pane { min-width: 0; }
.cat-tree-pane, .img-dir-pane { max-height: calc(100vh - 300px); }
/* 分类树：左侧真树形 + 视图切换；右侧「上级分类」为完整路径，允许换行不撑破 */
.cat-scope { display: flex; gap: 6px; margin: 10px 0 6px; }
.cat-scope .btn-mini.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); font-weight: 600; }
/* 跨页选择计数：始终单行不换行，避免把工具栏顶高或触发横向溢出 */
.cat-sel-info { display: inline-flex; align-items: center; white-space: nowrap; font-size: 12.5px; color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 14px; padding: 4px 10px; }
.cat-sel-info[hidden] { display: none; }
.cat-sel-info a { color: var(--accent); margin-left: 2px; text-decoration: underline; }
@media (max-width: 720px) { .cat-sel-info { max-width: 100%; } .cat-drop { min-height: 160px; } .hr-toolbar [data-act="selpage"] { grid-column: 1 / -1; width: 100%; } }
.cat-tree-pane .org-tree2 .org-tree2 { border-left: 0; }
/* 三级叶节点的空箭头在嵌套 list-item 里会被拉伸，把行高从 37px 撑到 84px；显式锁定行与箭头尺寸 */
.cat-tree-pane .org-row2 { height: 37px; min-height: 37px; box-sizing: border-box; }
.cat-tree-pane .org-caret2 { flex: 0 0 14px; width: 14px; height: 14px; min-height: 14px; max-height: 14px; align-self: center; }
.cat-tree-pane .org-row2.on .org-name2 { font-weight: 600; }
.cat-table-pane td[data-label="上级分类"] { word-break: break-all; }
.cat-import-tip { background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: 12.5px; line-height: 1.6; }
.cat-import-tip ol { margin: 6px 0 0; padding-left: 20px; }
.cat-drop { box-sizing: border-box; min-height: 220px; display: flex; align-items: center; justify-content: center; padding: 26px 16px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.7; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.cat-drop:hover, .cat-drop.dragover { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.cat-drop.dragover { border-style: solid; box-shadow: 0 0 0 3px var(--accent-line); }
/* 导入前确认弹窗：沿用浅紫主题，不用绿色实心提示 */
.cat-confirm-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 13.5px; color: var(--fg); }
.cat-confirm-summary b { color: var(--accent); font-weight: 700; word-break: break-all; }
.cat-preview-wrap { max-height: 46vh; min-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cat-preview { margin: 0; white-space: nowrap; }
.cat-preview th, .cat-preview td { padding: 7px 10px; font-size: 12.5px; }
.cat-preview thead th { position: sticky; top: 0; z-index: 1; background: var(--accent-bg); color: var(--accent); }
.cat-import-confirm #cat-preview-pager { margin-top: 10px; }
.cat-confirm-note { margin: 12px 0 0; padding: 9px 12px; background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 9px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.cat-import-actions, .img-upload-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 分类详情抽屉：右侧滑出，展示基本信息与字段级数据日志 */
.yl-drawer-mask { position: fixed; inset: 0; background: rgba(31,41,55,.30); z-index: 180; }
.yl-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(470px, 100vw); background: #fff; z-index: 181; display: flex; flex-direction: column; box-shadow: -16px 0 44px rgba(31,41,55,.16); animation: ylDrawerIn .18s ease-out; }
@keyframes ylDrawerIn { from { transform: translateX(24px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.yl-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--fg); }
.yl-drawer-head .yl-drawer-close { border: none; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.yl-drawer-head .yl-drawer-close:hover { color: var(--accent); }
.yl-drawer-body { flex: 1 1 auto; overflow: auto; padding: 16px 18px 28px; }
.yl-drawer-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.yl-drawer-tab { border: none; background: transparent; color: var(--muted); font-size: 13px; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.yl-drawer-tab.on { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.yl-drawer-sec { font-size: 12.5px; font-weight: 700; color: var(--accent); margin: 0 0 10px; padding-left: 8px; border-left: 3px solid var(--accent); }
.yl-kv { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 8px 12px; font-size: 13px; margin: 0 0 22px; }
.yl-kv dt { color: var(--muted); }
.yl-kv dd { margin: 0; color: var(--fg); word-break: break-all; }
.yl-log-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.yl-log-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.yl-log-avatar { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.yl-log-op { color: var(--fg); font-weight: 600; }
.yl-log-act { color: var(--accent); background: var(--accent-bg); border-radius: 10px; padding: 1px 7px; font-size: 11.5px; }
.yl-log-time { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.yl-log-count { font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.yl-log-chg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; padding: 5px 0; }
.yl-log-chg-label { color: var(--muted); min-width: 62px; }
.yl-log-before { color: var(--muted); text-decoration: line-through; background: #f6f7f9; border-radius: 5px; padding: 2px 6px; word-break: break-all; }
.yl-log-arrow { color: var(--muted); }
.yl-log-after { color: var(--accent); background: var(--accent-bg); border-radius: 5px; padding: 2px 6px; word-break: break-all; }
.yl-log-remark { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.yl-log-empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
@media (max-width: 720px) { .yl-drawer { width: 100vw; } .yl-kv { grid-template-columns: 76px minmax(0,1fr); } }

/* 供应商详情抽屉：复用分类抽屉的骨架，字段多且抽屉窄，改为单列排布 */
.yl-detail .form-sec { margin: 0 0 18px; }
.yl-detail .form-sec-t { font-size: 12.5px; font-weight: 700; color: var(--accent); margin: 0 0 10px; padding-left: 8px; border-left: 3px solid var(--accent); }
.yl-detail .form-grid { display: block; }
.yl-detail .form-fld { margin: 0 0 10px; }
.yl-detail .form-fld > label { color: var(--muted); font-size: 12.5px; }
.yl-detail .form-fld > div { padding: 2px 0; font-size: 13px; }
.yl-img-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); }
.yl-img-link:hover .yl-img-name { text-decoration: underline; }
.yl-img-thumb { width: 118px; height: 82px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f8f7fc; }
.yl-img-name { font-size: 12.5px; word-break: break-all; }
/* 主体管理列表的营业执照缩略图：小尺寸、可点开大图，只读角色显示锁定占位 */
.biz-thumb-link { display: inline-flex; text-decoration: none; }
.biz-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f8f7fc; }
.biz-thumb-link:hover .biz-thumb { border-color: var(--accent); }
.biz-thumb-doc { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); font-size: 11px; font-weight: 700; text-decoration: none; }

/* 表单内图片控件：左侧预览图 + 右侧「文件名在上、按钮一行」，避免长文件名把按钮挤得换行 */
.form-img-pick { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.form-img-pick-main { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.form-img-pick-name { font-size: 12.5px; color: var(--muted); word-break: break-all; line-height: 1.4; }
.form-img-pick-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 已上传图片预览：编辑态直接看到原图缩略图，点击打开大图；PDF 用文字占位 */
/* 营业执照为横向图：用较宽的框 + contain 完整居中显示，避免 cover 裁切导致内容偏在一边 */
.img-pick-prev { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 132px; height: 92px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8f7fc; text-decoration: none; }
.img-pick-prev[href]:hover { border-color: var(--accent); }
.img-pick-prev-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.img-pick-prev-pdf { display: none; }
.img-pick-prev.is-pdf .img-pick-prev-img { display: none; }
.img-pick-prev.is-pdf .img-pick-prev-pdf { display: inline; color: var(--accent); font-size: 13px; font-weight: 700; }

/* 长表单弹窗（如供应商 30+ 字段）：底部操作栏吸底，避免「保存」按钮被挤出视口 */
.modal-foot { position: sticky; bottom: 0; z-index: 2; }

/* 表单内提醒横幅（识别告警 / 保存校验提醒）：不弹窗、不打断填写 */
.form-warn { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; font-size: 12.5px; line-height: 1.7; }
.form-warn-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #b45309; margin-bottom: 4px; }
.form-warn-x { border: none; background: transparent; color: #b45309; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.form-warn p { margin: 0 0 4px; color: #92400e; }
.form-warn ul { margin: 0; padding-left: 18px; color: #92400e; }
.img-tabs .btn-mini.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); font-weight: 600; }
.img-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; background: var(--bg-soft, #f8fafc); }
.img-preview { text-align: center; padding: 10px; }
.img-preview img { max-width: 100%; max-height: 70vh; object-fit: contain; cursor: zoom-out; }
.img-upload { display: grid; gap: 14px; max-width: 720px; }
.img-upload .form-fld { max-width: 420px; }
/* 上传图片弹窗：加宽到 780px，拖拽区加高，队列改双列，长文件名有地方展示 */
.modal.wide.img-up-wide { width: min(780px, 94vw); }
.img-up-wide .img-upload { max-width: none; }
.img-up-wide #up-drop { min-height: 220px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.img-up-wide .img-pick-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 40vh; }
@media (max-width: 720px) {
  .modal.wide.img-up-wide { width: 100%; }
  .img-up-wide #up-drop { min-height: 160px; }
  .img-up-wide .img-pick-list { grid-template-columns: minmax(0, 1fr); }
}
/* 详情里的数据日志页签（与抽屉同一套视觉，嵌在弹窗里时去掉上边距） */
.pd-dtabs { margin: -4px 0 12px; }
/* 网址列：只对 http/https 渲染成链接，颜色跟主题一致 */
.pd-link, .yl-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.pd-link:hover, .yl-link:hover { color: var(--accent-strong, var(--accent)); }
.small { font-size: 11.5px; }
.ok-text { color: #15803d; font-size: 13px; }

/* ===== 图片管理：按 SKU 维护（2026-11-24）===== */
.img-bar { align-items: center; }
.img-bar-tip { font-size: 12px; color: var(--muted); max-width: 620px; }
.img-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; align-items: start; }
.img-sku-pane { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; display: flex; flex-direction: column; min-height: 460px; max-height: calc(100vh - 250px); }
.img-sku-tabs { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.img-sku-tab { flex: 1 1 0; min-width: 0; border: 0; background: #fff; color: var(--muted); font-size: 13px; padding: 8px 6px; cursor: pointer; }
.img-sku-tab + .img-sku-tab { border-left: 1px solid var(--line); }
.img-sku-tab.on { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
/* 左栏是纵向 flex，.org-search 自带的 flex:1 1 240px 会把输入框撑成一整块空白，这里必须复位 */
.img-sku-search { margin: 10px 0 6px; max-width: none; flex: 0 0 auto; }
.img-sku-list { flex: 1 1 auto; overflow: auto; min-height: 0; padding-right: 2px; }
.img-sku-row { position: relative; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.img-sku-row:hover { background: var(--accent-bg); }
.img-sku-row.on { background: var(--side-active); box-shadow: inset 2px 0 0 var(--accent); }
.img-sku-top { display: flex; align-items: center; gap: 8px; }
.img-sku-code { font-size: 13px; font-weight: 600; word-break: break-all; }
.img-sku-n { margin-left: auto; flex: none; font-size: 11px; color: var(--muted); }
.img-sku-sub { margin-top: 2px; padding-right: 42px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-sku-detail { display: none; position: absolute; right: 8px; bottom: 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--accent); font-size: 11px; cursor: pointer; }
.img-sku-row:hover .img-sku-detail, .img-sku-row.on .img-sku-detail { display: inline-block; }
.img-side-empty { margin: 12px 6px; font-size: 12.5px; color: var(--muted); }
.img-more-btn { width: 100%; margin-top: 8px; font-size: 12.5px; }
.img-main { border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; min-height: 460px; }
.img-main-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.img-main-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.img-title-code { font-weight: 700; }
.img-title-name { color: var(--muted); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-title-n { font-size: 11.5px; color: var(--muted); }
.img-title-empty { color: var(--muted); }
.img-head-acts { display: flex; gap: 6px; }
.img-tabs2 { display: flex; gap: 4px; margin-left: auto; }
.img-tab2 { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.img-tab2:hover { background: var(--bg-soft, #f8fafc); }
.img-tab2.on { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.img-pane { padding: 12px; }
.img-tbl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.img-tbl-count { font-size: 12px; color: var(--muted); }
.img-tbl-empty { padding: 10px 0; }
.img-tbl td[data-label="名称"] { max-width: 260px; }
.img-name { word-break: break-all; }
.img-main-tag { display: inline-block; padding: 0 5px; border-radius: 4px; background: #e8f7ee; border: 1px solid #bfe8cf; color: #067647; font-size: 11px; line-height: 16px; }
.img-src { font-size: 11px; color: var(--muted); margin-top: 2px; }
.img-row-main .img-thumb { border-color: #34a853; }
.img-op-btn, .img-dl { white-space: nowrap; }
.img-caret { font-size: 10px; opacity: .8; }
.img-menu { position: fixed; z-index: 1400; min-width: 132px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 30px rgba(15, 23, 42, .16); }
.img-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.img-menu button:hover { background: var(--accent-bg); color: var(--accent); }
.img-menu button:disabled { color: var(--muted); cursor: default; background: transparent; }
.img-menu button.danger { color: var(--bad); }
.img-menu button.danger:hover { background: #fef2f2; }
.img-blank { padding: 40px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.img-log-sec { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.img-log-empty { margin: 10px 0; font-size: 12.5px; color: var(--muted); }
.img-log-wrap { max-height: calc(100vh - 340px); overflow: auto; padding-right: 4px; }
.img-pick-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.img-pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.img-pick img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.img-pick-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; font-size: 12.5px; }
.img-pick-meta span:first-child { word-break: break-all; }
.img-pick-del { border: 0; background: transparent; color: var(--bad); font-size: 12px; cursor: pointer; }
.img-pick-one { font-size: 12.5px; }
.img-modal-tip { margin: 0; font-size: 13px; line-height: 1.75; color: var(--text); }
.img-url-area { width: 100%; min-height: 110px; font-family: inherit; }
.img-preview-cap { text-align: center; margin-top: 6px; }
@media (max-width: 900px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-tree-pane, .img-dir-pane { max-height: 260px; }
  .img-layout { grid-template-columns: 1fr; }
  .img-sku-pane { max-height: 240px; min-height: 0; }
  .img-main { min-height: 0; }
  .img-log-wrap { max-height: none; }
}
@media (max-width: 720px) {
  .cat-import-actions, .img-upload-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-import-actions .muted, .img-upload-actions .muted { grid-column: 1 / -1; min-width: 0; word-break: break-all; }
  .cat-layout > *, .cat-import, .img-upload { min-width: 0; }
  .cat-tree-pane input, .img-dir-pane input { min-width: 0; }
  .img-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .img-bar .sp { display: none; }
  .img-bar .btn { width: 100%; min-width: 0; }
  .img-bar-tip { grid-column: 1 / -1; max-width: 100%; }
  .img-main-head { align-items: center; }
  .img-head-acts { order: 2; margin-left: auto; }
  .img-tabs2 { order: 3; margin-left: 0; width: 100%; }
  .img-tab2 { flex: 1 1 0; }
  .img-pane { padding: 10px; }
  .img-layout { min-width: 0; }
  .img-sku-pane, .img-main { min-width: 0; }
}

/* ===== 采购管理：采购计划 / 采购单 / 采购退货单（迁移 047） ===== */
.pd-doc { min-width: 0; }
.pd-doctabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.pd-tab { border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.pd-tab:hover { color: var(--text); background: var(--bg-soft, #f8fafc); }
/* 选中页签换成实心主色：灰字 → 白字紫底，点哪个一眼能看出来 */
.pd-tab.on { color: #fff; border-color: var(--accent); background: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(124, 58, 237, .22); }
.pd-tab.on:hover { color: #fff; background: var(--accent); }
/* 页签数量角标：与参考系统一致，直接在页签名后面点一个数 */
.pd-tab-n { display: inline-block; margin-left: 6px; padding: 0 6px; min-width: 16px; height: 16px; line-height: 16px;
  border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-bg); text-align: center; }
.pd-tab.on .pd-tab-n { color: var(--accent); background: #fff; }
/* 勾选列：窄、居中，不抢内容列的宽度 */
.pd-l-pick { text-align: center; padding-left: 4px !important; padding-right: 2px !important; }
.pd-l-pick input { margin: 0; cursor: pointer; }
/* 勾选后出现的批量操作条：吸在列表上方，滚到哪儿都能点到 */
.pd-batch-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px;
  padding: 8px 12px; border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: 10px; }
.pd-batch-bar[hidden] { display: none; }
.pd-bb-n { font-size: 12.5px; color: var(--muted); margin-right: 4px; }
.pd-bb-n b { color: var(--accent); font-size: 14px; }
.btn-mini-pri { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-mini-pri:hover { color: #fff; background: var(--accent); border-color: var(--accent); filter: brightness(1.06); }
.tag-danger { color: var(--bad); background: #fef2f2; border-color: #fecaca; }
.tag-muted { color: var(--muted); background: #f1f5f9; border-color: #e2e8f0; }
/* 带单位的数字框（如预付比例 %）：单位固定在框内右侧，不参与输入 */
.pd-inp-unit { position: relative; display: block; }
.pd-inp-unit .inp { padding-right: 34px; }
.pd-inp-unit-t { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.pd-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-filters .inp { min-width: 0; }
.pd-sp { flex: 1 1 auto; }
.pd-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.pd-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--bg-soft, #f8fafc); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pd-group-title { font-size: 12.5px; color: var(--muted); }
.pd-group-actions { display: flex; align-items: center; gap: 8px; }
.pd-table-wrap { width: 100%; overflow-x: auto; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 720px; }
.pd-table th, .pd-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; white-space: nowrap; }
.pd-table th { background: var(--bg-soft, #f8fafc); color: var(--muted); font-weight: 600; position: sticky; top: 0; }
.pd-table tbody tr:hover { background: var(--accent-bg); }
/* 采购计划列表：一张表 + 批次父行（灰底）+ 明细子行 + 合计行，列口径对齐参考系统的采购计划列表 */
.pd-list-wrap { width: 100%; overflow: auto; border-top: 1px solid var(--line); }
.pd-list { width: 100%; min-width: 1370px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.pd-list th { height: 40px; padding: 0 10px; background: #fafbfc; color: #1f2329; font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid #eef0f3; border-right: 1px solid #f2f3f5; }
.pd-list td { height: 46px; padding: 6px 10px; border-bottom: 1px solid #f4f5f7; vertical-align: middle; }
.pd-list .pd-l-parent td { background: #f6f8fc; border-bottom: 1px solid #eaedf3; }
.pd-lp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: 12px; color: #5b6068; min-height: 20px; }
.pd-lp b { color: #1f2329; font-weight: 600; }
.pd-lp .pd-lno { color: var(--accent); }
.pd-lpk { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pd-l-item:hover td { background: var(--accent-bg); }
.pd-l-status { text-align: center; border-left: 1px solid #f2f3f5; }
.pd-l-op { white-space: nowrap; border-left: 1px solid #f2f3f5; }
.pd-lnk { padding: 0 7px 0 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; cursor: pointer; }
.pd-lnk:hover { text-decoration: underline; }
.pd-lnk-del { color: #e54545; padding-right: 0; }
.pd-l-empty { text-align: center; color: var(--muted); }
.pd-l-sum td { height: 42px; background: #fafbfc; color: #5b6068; font-size: 12.5px; border-bottom: 0; }
.pd-l-sumv { color: #1f2329; font-weight: 600; }
.pd-cell-input { width: 100px; padding: 4px 6px; font-size: 12px; }
.pd-form-note { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.pd-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
.pd-field { min-width: 0; }
.pd-flabel { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pd-flabel .req { color: #dc2626; }
.pd-field .inp { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; }
.pd-field textarea.inp { min-height: 92px; padding: 10px 11px; resize: vertical; }
.pd-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding-top: 6px; }
.pd-detail-bar { display: flex; gap: 8px; margin: 16px 0 8px; }
.pd-form-table { max-height: 45vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pd-form-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; }
.pd-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.pd-picker-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pd-picker #pp-list, .pd-picker #pl-list { max-height: 60vh; overflow-y: auto; }
.pd-plan-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.modal.pd-modal { width: min(1360px, 96vw); max-width: min(1360px, 96vw); }
.modal.pd-picker-modal { width: min(1280px, 96vw); max-width: min(1280px, 96vw); }
/* ===== 采购计划全屏工作页（对照参考系统「添加采购计划」：整页做计划，表头吸顶） ===== */
/* ===== 采购计划：整页工作页（2026-11-26 按参考系统版式重做） =====
   结构：白卡片（标题 / 下划线抬头 / 描边工具条 / 撑满的明细表 / 底部居中按钮）。 */
.pp-page { display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - 160px); }
.pp-card { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.pp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 20px 2px; }
.pp-title { margin: 0; font-size: 19px; font-weight: 600; color: var(--fg); }
.pp-no { font-size: 12px; color: var(--muted); }

/* 抬头：下划线式，标签即占位文字（参考系统同款） */
.pp-fields { display: grid; grid-template-columns: minmax(170px, 20%) minmax(190px, 26%) minmax(0, 1fr); gap: 0 26px; padding: 8px 20px 12px; align-items: center; }
.pp-fld { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pp-uline { width: 100%; height: 34px; padding: 4px 2px; border: 0; border-bottom: 1px solid #dcdfe6; border-radius: 0; background: transparent; font-size: 13px; color: var(--fg); outline: none; }
.pp-uline:focus { border-bottom-color: var(--accent); }
select.pp-uline { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #a8abb2 50%), linear-gradient(135deg, #a8abb2 50%, transparent 50%); background-position: calc(100% - 12px) 15px, calc(100% - 7px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 22px; }
.pp-uline.is-empty { color: #a8abb2; }
.pp-fld-remark { padding-right: 58px; }
.pp-cnt { position: absolute; right: 0; bottom: 9px; font-size: 11.5px; color: #a8abb2; pointer-events: none; }
.pp-fld-file { height: 34px; border-bottom: 1px solid #dcdfe6; }
.pp-fld-file .pp-file-btn { border-bottom: 0; height: 33px; }
.pp-file-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 2px; border: 0; border-bottom: 1px solid #dcdfe6; background: transparent; font-size: 13px; color: var(--fg); cursor: pointer; flex: 0 0 auto; }
.pp-file-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pp-file-ico { font-size: 13px; color: #8f959e; }
.pp-file-list { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.pp-file-none { font-size: 12px; color: #a8abb2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-file-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 170px; padding: 1px 4px 1px 8px; border-radius: 4px; background: #f2f3f5; font-size: 12px; color: var(--fg); }
.pp-file-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
a.pp-file-name:hover { color: var(--accent); text-decoration: underline; }
.pp-file-del { border: 0; background: transparent; color: #8f959e; font-size: 13px; line-height: 1; cursor: pointer; padding: 0 2px; }
.pp-file-del:hover { color: var(--bad); }

/* 工具条：描边按钮 + 右侧状态 */
.pp-tools { display: flex; align-items: center; gap: 8px; padding: 0 20px 10px; flex-wrap: wrap; }
.pp-tbtn { height: 30px; padding: 0 12px; border: 1px solid #dcdfe6; border-radius: 4px; background: #fff; font-size: 12.5px; color: #1f2329; cursor: pointer; white-space: nowrap; }
.pp-tbtn:hover { border-color: var(--accent); color: var(--accent); }
.pp-tools-sp { flex: 1 1 auto; }
.pp-tools-stat { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* 状态下拉：selObserver 会把它换成 .ysel-btn，箭头要自己补（background 简写会把箭头图清掉） */
.pp-status-sel { width: 110px; height: 30px; padding: 0 22px 0 9px; border: 1px solid #dcdfe6; border-radius: 4px; background-color: #fff; background-repeat: no-repeat; background-position: right 7px center; background-size: 10px 7px; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%238f959e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); font-size: 12.5px; color: #1f2329; flex: 0 0 auto; }

/* 明细表 */
.pp-table-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 240px; overflow: auto; border-top: 1px solid var(--line); }
.pp-table-inner { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 1582px; }
.pp-table { flex: 0 0 auto; width: 100%; min-width: 1582px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.pp-table th, .pp-table td { padding: 8px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid #f0f1f5; }
.pp-table thead th { position: sticky; top: 0; z-index: 2; height: 40px; background: #fafbfc; color: #1f2329; font-weight: 600; white-space: nowrap; border-right: 1px solid #eef0f3; }
.pp-table thead th:last-child { border-right: 0; }
.pp-table tbody td { height: 52px; background: #fff; }
.pp-table tbody tr.pp-row-blank td { background: #f2f6fd; }
.pp-table tbody tr:hover td { background: var(--accent-bg); }
.pp-req { color: var(--bad); font-style: normal; margin-right: 2px; }
.pp-i { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; margin-left: 4px; border: 1px solid #c0c4cc; border-radius: 50%; font-size: 9px; font-style: normal; color: #a8abb2; line-height: 1; cursor: help; vertical-align: 1px; }
.pp-batch { margin-left: 6px; padding: 0; border: 0; background: transparent; color: #2f6bff; font-size: 12px; font-weight: 400; cursor: pointer; white-space: nowrap; }
.pp-batch:hover { text-decoration: underline; }
.pp-c-idx { width: 44px; color: var(--muted); text-align: center; }
.pp-no-txt { font-size: 12px; color: #1f2329; white-space: nowrap; }
.pp-no-pre { font-size: 12px; color: #9aa0a6; white-space: nowrap; border-bottom: 1px dashed #d6d9de; cursor: help; }
.pp-table td.pp-c-idx { text-align: center; color: var(--muted); }
.pp-table td.pp-c-img { text-align: center; }
.pp-c-op { width: 56px; }
/* 采购员列：原生 select 被全站 selObserver 换成 .ysel-btn，这里压回表格里的灰色小箭头 */
.pp-table .ysel-btn { height: 30px; padding: 0 22px 0 8px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 12.5px; color: var(--fg); background-position: right 7px center; background-size: 10px 7px; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%238f959e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pp-table .ysel-btn.ysel-empty { color: #a8abb2; }
.pp-c-name { white-space: normal; }
.pp-c-img { text-align: center; }
.pp-name-t { font-size: 12.5px; color: var(--fg); line-height: 1.35; word-break: break-word; }
.pp-sku-t { font-size: 11.5px; color: #2f6bff; line-height: 1.35; word-break: break-all; }
.pp-c-img .pd-thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; display: inline-block; }
.pp-dash { color: #909399; }
.pp-inp { width: 100%; height: 30px; padding: 0 8px; border: 1px solid #dcdfe6; border-radius: 4px; background: #fff; font-size: 12.5px; color: var(--fg); }
.pp-inp:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-line); }
.pp-inp-wrap { position: relative; display: block; }
.pp-inp-wrap .pp-inp { padding-right: 52px; }
.pp-inp-cnt { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-style: normal; color: #a8abb2; pointer-events: none; }
.pp-box-cell { display: flex; align-items: center; gap: 6px; }
.pp-box-cell .pp-inp { width: 64px; flex: 0 0 64px; }
.pp-box-wrap { min-width: 0; }
.pp-box-hint { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pp-box-hint.warn { color: #f08a24; }
.pp-box-hint.warn b { font-weight: 600; }
.pp-box-ico { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; font-weight: 700; line-height: 1; }
.pp-rm { border: 0; background: transparent; color: #2f6bff; font-size: 12.5px; cursor: pointer; padding: 0; }
.pp-rm:hover { text-decoration: underline; }
.pp-addrow { width: 22px; height: 22px; border: 1px solid var(--accent); border-radius: 4px; background: #fff; color: var(--accent); font-size: 14px; line-height: 1; cursor: pointer; }
.pp-addrow:hover { background: var(--accent-bg); }
.pp-find-wrap { display: block; }
.pp-find { width: 100%; height: 30px; padding: 0 8px; border: 1px solid #dcdfe6; border-radius: 4px; background: #fff; font-size: 12.5px; color: var(--fg); }
.pp-find::placeholder { color: #a8abb2; }
.pp-find:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-line); }
/* 产品下拉：表头「图片 / 品名·SKU」+ 行式清单 + 底部分页，码值＝产品名称 + SKU + 图片 */
.pp-find-sug { position: fixed; z-index: 90; overflow: hidden; background: #fff; border: 1px solid #e3e6eb; border-radius: 6px; box-shadow: 0 14px 32px rgba(15, 23, 42, .16); }
.pp-find-head { display: flex; align-items: center; height: 34px; padding: 0 10px; background: #f7f8fa; border-bottom: 1px solid #eceef2; font-size: 12px; font-weight: 600; color: #5b6068; }
.pp-find-head span:first-child { flex: 0 0 46px; }
.pp-find-head span:last-child { flex: 1 1 auto; padding-left: 12px; border-left: 1px solid #e6e8ec; }
.pp-find-list { max-height: 312px; overflow-y: auto; }
.pp-find-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 52px; padding: 0 10px; border: 0; border-bottom: 1px solid #f4f5f7; background: #fff; cursor: pointer; text-align: left; }
.pp-find-row:last-child { border-bottom: 0; }
.pp-find-row:hover { background: var(--accent-bg); }
.pp-find-img { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 4px; object-fit: cover; display: block; }
.pp-find-noimg { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; background: #f2f3f5; border-radius: 4px; font-size: 10px; color: #a8abb2; }
.pp-find-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-left: 12px; border-left: 1px solid #f0f1f3; }
.pp-find-txt b { font-size: 12.5px; font-weight: 400; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-find-txt em { font-size: 12px; font-style: normal; color: #5b6068; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-find-empty { padding: 18px 12px; font-size: 12px; color: var(--muted); text-align: center; }
.pp-find-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; height: 38px; padding: 0 10px; border-top: 1px solid #eceef2; background: #fff; font-size: 12px; color: #5b6068; }
.pp-find-pg { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: #7b8189; font-size: 14px; line-height: 1; cursor: pointer; }
.pp-find-pg:disabled { color: #d0d4da; cursor: default; }
.pp-find-cur { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 4px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-style: normal; font-size: 12px; }
.pp-find-slash { color: #a8abb2; }
.pp-sum-bar { margin-top: auto; position: sticky; bottom: 0; z-index: 3; background: #fafbfc; border-top: 1px solid var(--line); }
.pp-table-sum { min-width: 1582px; }
.pp-table.pp-table-sum tbody td { height: 40px; background: #fafbfc; color: var(--muted); font-size: 12.5px; border-bottom: 0; padding: 8px 10px; }
.pp-sum-l { padding-left: 20px; }
.pp-sum-v { color: var(--fg); font-weight: 600; }
.pp-sum-n { font-size: 11.5px; text-align: right; padding-right: 16px; }
.pp-foot { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 20px 0; flex: 0 0 auto; }
.pp-foot .btn { min-width: 88px; }

/* 导入采购产品 / 自动带出辅料 */
.pp-imp-tip { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.pp-imp-tip b { color: var(--fg); }
.pp-imp-ta { width: 100%; min-height: 200px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; resize: vertical; }
.pp-imp-msg { margin: 8px 0 0; min-height: 18px; font-size: 12px; color: #f08a24; }
.pp-imp-sp { flex: 1 1 auto; }
.modal.pp-imp-modal { width: min(680px, 94vw); }

@media (max-width: 900px) {
  .pp-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 20px; }
  .pp-fld-remark { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .pp-page { min-height: 0; }
  .pp-head { padding: 14px 14px 0; }
  .pp-title { font-size: 17px; }
  .pp-fields { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 6px 14px 10px; }
  .pp-tools { padding: 0 14px 10px; }
  .pp-tools-stat { display: none; }
  .pp-tbtn { flex: 1 1 auto; }
  .pp-table-wrap { min-height: 200px; }
  .pp-foot .btn { flex: 1 1 0; }
  /* 320px 下整页最窄处只剩 292px，1500+ 宽的合计表会把数字推到横向滚动区外 → 改成紧凑单行 */
  .pp-table.pp-table-sum, .pp-table-sum tbody, .pp-table-sum tr { display: flex; align-items: center; gap: 8px; width: auto; min-width: 0; }
  .pp-table-sum colgroup { display: none; }
  .pp-table.pp-table-sum tbody td { display: block; width: auto; height: auto; padding: 0; border: 0; font-size: 12.5px; }
  .pp-table-sum tr { padding: 11px 14px; }
  .pp-sum-l { padding-left: 0; }
  .pp-sum-l::after { content: '：'; }
  .pp-sum-n { display: block; padding-right: 0; text-align: left; }
}
/* ===== 采购计划明细详情（整页）：点列表里的计划编号进入 ===== */
/* 列表里的计划编号 = 进详情的入口，一个屏上只有这一个「看起来像链接」的元素 */
.pdi-link { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(124, 58, 237, .4); }
.pdi-link:hover { color: var(--accent-strong); text-decoration-color: var(--accent-strong); }
.pdi-page { display: flex; flex-direction: column; min-height: 100%; }
.pdi-loading { padding: 4px 0; }
.pdi-crumb { display: flex; align-items: center; gap: 7px; padding: 0 0 10px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.pdi-back { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.pdi-back:hover { color: var(--accent); border-color: var(--accent-line); }
.pdi-crumb-t { cursor: default; }
.pdi-crumb-sep { color: #c9ccd4; }
.pdi-crumb-c { color: var(--fg); }
.pdi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pdi-hl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pdi-no { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .2px; color: var(--fg); word-break: break-all; }
.pdi-acts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pdi-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 14px; font-size: 12px; color: var(--muted); }
.pdi-step { display: inline-flex; align-items: center; gap: 6px; }
.pdi-step i { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 10px; font-style: normal; font-weight: 600; }
.pdi-step b { font-weight: 500; color: var(--fg); }
.pdi-step em { font-style: normal; color: var(--muted); }
/* 未发生 / 被驳回的步骤：灰掉而不是隐藏，让人一眼看出流程走到哪一步 */
.pdi-step-off i { background: #f0f1f5; color: #a8acb8; }
.pdi-step-off b { color: #a8acb8; font-weight: 400; }
.pdi-step-bad i { background: #fdecec; color: #d9534f; }
.pdi-step-bad b { color: #d9534f; }
.pdi-sep { color: #c9ccd4; }
.pdi-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.pdi-tabs::-webkit-scrollbar { display: none; }
.pdi-tab { flex: 0 0 auto; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
.pdi-tab:hover { color: var(--fg); }
.pdi-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.pdi-card { margin-top: 14px; padding: 14px 16px; background: #f8f8fb; border-radius: 6px; }
.pdi-flds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; }
.pdi-fld { display: flex; gap: 8px; min-width: 0; font-size: 13px; line-height: 1.5; }
.pdi-fld > span { flex: 0 0 auto; color: var(--muted); }
.pdi-fld > b { min-width: 0; font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }
.pdi-fld-wide { grid-column: 1 / -1; }
/* 附件：一条一个 chip，长文件名省略并保留完整标题，避免三个哈希名糊成一片 */
.pdi-atts { display: flex; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.pdi-att { display: inline-block; max-width: 280px; font-size: 12px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdi-att:hover { border-color: var(--accent-line); text-decoration: none; background: var(--accent-bg); }
.pdi-dash { color: #b7bbc2; }
.pdi-batch { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 14px 2px 8px; font-size: 12px; color: var(--muted); }
.pdi-batch b { color: var(--fg); font-weight: 600; }
.pdi-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pdi-table { width: 100%; min-width: 1330px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.pdi-table thead th { padding: 10px 8px; background: #fafafc; color: var(--fg); font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.pdi-table tbody td { padding: 11px 8px; color: #303540; vertical-align: middle; border-bottom: 1px solid #f3f4f7; }
.pdi-table tbody tr:last-child td { border-bottom: 0; }
.pdi-c-name { white-space: normal; }
.pdi-thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; display: block; }
.pdi-name { color: var(--fg); line-height: 1.4; overflow-wrap: anywhere; }
.pdi-sku { margin-top: 2px; font-size: 11.5px; color: var(--accent); }
@media (max-width: 900px) {
  .pdi-flds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pdi-no { font-size: 17px; }
  .pdi-head { align-items: stretch; }
  .pdi-acts { width: 100%; }
  .pdi-acts .btn { flex: 1 1 0; }
  .pdi-flds { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pdi-card { padding: 12px 14px; }
  .pdi-flow { gap: 6px 8px; }
  .pdi-tab { padding: 8px 11px; font-size: 12.5px; }
}

/* ===== 采购计划批次详情（整页）：点列表父行的「创建批次号」进入 ===== */
/* 父行批次号也是可点入口，字号跟父行正文一致，别比周围大一号 */
.pd-lp .pd-lno { font-size: 12px; }
.pdi-batch-no { font-size: 12px; font-weight: 600; }
.pbi-table { min-width: 1364px; }
/* 批次备注与附件各占两列，与上面四个字段排在同一行；窄屏回落到整行，避免 span 撑出隐式列 */
.pbi-fld-half { grid-column: span 2; }
@media (max-width: 900px) {
  .pbi-fld-half { grid-column: 1 / -1; }
}
.pbi-empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.pbi-sum td { height: 42px; padding: 9px 8px; background: #fafbfc; color: #5b6068; border-top: 1px solid var(--line); border-bottom: 0; }
.pbi-sum-v { color: var(--fg); font-weight: 600; }
/* 窄屏表格要在容器里横滚，合计数字会被滚出视口 → 在「合计」后面补一份紧凑值（桌面端不重复显示） */
.pbi-sum-m { display: none; }
@media (max-width: 720px) {
  .pbi-sum-m { display: inline; color: var(--fg); font-weight: 600; }
  .pbi-sum-v { visibility: hidden; }
}

/* 采购单据附件：真正的文件上传区，不再是文本框 */.pd-file-box { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; min-height: 96px; background: var(--bg-soft, #f8fafc); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pd-file-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-file-hint { font-size: 11.5px; }
.pd-file-list { min-width: 0; }
.pd-file-empty { margin: 0; font-size: 12px; }
.pd-file-items { display: flex; flex-direction: column; gap: 6px; }
.pd-file-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; min-width: 0; }
.pd-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); text-decoration: none; }
a.pd-file-name:hover { text-decoration: underline; }
.pd-file-pending { flex: 0 0 auto; font-size: 11px; }
.pd-detail-atts { display: flex; flex-direction: column; gap: 4px; }
.pd-detail-atts a { color: var(--accent); text-decoration: none; word-break: break-all; }
.pd-detail-atts a:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .pd-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  /* 采购计划全屏页：抬头单列、搜索占满、表格自己横向滚（外层不溢出） */
  .pp-meta { grid-template-columns: minmax(0, 1fr); }
  .pp-search { flex: 1 1 100%; max-width: none; }
  .pp-table-wrap { max-height: none; }
  .pp-title { font-size: 16px; }
  .pp-head { align-items: flex-start; }
  .pp-head-acts { width: 100%; }
  .pp-head-acts .btn { flex: 1 1 0; }
  .pp-stat { width: 100%; }
  .pd-form-grid, .pd-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-filters > * { min-width: 0; }
  .pd-filters .inp { width: 100%; }
  .pd-table { font-size: 12px; }
  /* 状态页签与分组操作按钮：窄屏只允许整颗换行，不允许单字竖排 */
  .pd-tab { padding: 5px 11px; font-size: 12.5px; white-space: nowrap; }
  .pd-group-actions { gap: 6px; }
  .pd-group-actions .btn-mini { margin-right: 0; white-space: nowrap; }
  .pd-group-head .tag { white-space: nowrap; }
  .pd-field:has(.pd-file-box) { grid-column: 1 / -1; }
  .pd-file-hint { display: block; width: 100%; margin-top: 2px; }
  .pd-file-bar { gap: 6px; }
  .pd-file-item { flex-wrap: wrap; }
  .pd-file-name { flex: 1 1 100%; }
  .pd-file-pending { flex: 0 0 auto; }
}

/* 供应商这类 4 列长表单：手机端强制单列，避免「供应商名称 / 详细地址」被挤成窄条 */
@media (max-width: 720px) {
  .modal.xwide .form-grid,
  .modal.xwide .form-grid.cols4 { grid-template-columns: minmax(0, 1fr); }
  .modal.xwide .form-fld { grid-column: auto !important; }
}

/* ===== 产品表单：分类树下拉（取值来自「分类管理」，按分类 id 关联） ===== */
.cat-pick { position: relative; }
.cat-pick-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; }
.cat-pick-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-pick-txt.is-empty { color: #9ca3af; }
.cat-pick-caret { flex: 0 0 auto; color: #9ca3af; font-size: 12px; }
/* 表单在 .modal 内（overflow:auto），absolute 会被裁掉，所以用 fixed 按按钮坐标定位 */
.cat-pick-pop {
  position: fixed; z-index: 400; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 36px rgba(17, 24, 39, .16); padding: 8px;
}
.cat-pick-q { padding: 2px 2px 8px; }
.cat-pick-q .inp { width: 100%; }
.cat-pick-tree { max-height: 260px; overflow: auto; }
.cp-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--fg);
}
.cp-row:hover { background: #f5f1fe; }
.cp-row.on { background: var(--side-active); color: var(--accent); font-weight: 600; }
.cp-caret { flex: 0 0 14px; width: 14px; padding: 0; border: 0; text-align: center; color: #9ca3af; font-size: 11px; }
/* 同上：占位箭头不能复用全局 .empty */
.cp-caret.is-blank, .cp-caret.empty { visibility: hidden; padding: 0; border: 0; background: none; }
.cp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-code { flex: 0 0 auto; color: #9ca3af; font-size: 11px; letter-spacing: .02em; }
.cp-kids { margin-left: 7px; padding-left: 14px; border-left: 1px dashed var(--line); }
.cat-pick-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.cp-empty { margin: 6px 8px; font-size: 12.5px; }


/* ===== 产品管理 · 附件与描述（参考领星：标题行右侧上传按钮 + 富文本描述框） ===== */
.pd-att-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pd-att-head .form-sec-t { margin-bottom: 0; flex: 1 1 auto; }
.pd-att-btn { margin-right: 0; flex: 0 0 auto; white-space: nowrap; }
/* 工具栏在编辑区上方，与原 textarea rows=4（约 88px）相比：编辑区 180px + 工具栏 32px，面积约两倍 */
.pd-editor-tools { position: relative; display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 7px; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: #fafafa; }
/* 预设色板：替代系统原生取色器，样式参考领星的下拉色块 */
.pd-palette { position: absolute; z-index: 60; padding: 9px 10px 10px; background: #fff; border: 1px solid var(--accent-line); border-radius: 9px; box-shadow: 0 10px 28px rgba(31,41,55,.16); }
.pd-palette-title { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.pd-palette-grid { display: grid; grid-template-columns: repeat(5, 22px); gap: 7px; }
.pd-swatch { width: 22px; height: 22px; padding: 0; border: 1px solid rgba(0,0,0,.14); border-radius: 5px; background: var(--sw); cursor: pointer; }
.pd-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.pd-swatch-none { background: linear-gradient(135deg, #fff 46%, #dc2626 47%, #dc2626 53%, #fff 54%); }
.pd-tool { min-width: 26px; height: 24px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #4b5563; font-size: 12px; cursor: pointer; }
.pd-tool:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.pd-editor {
  width: 100%; min-height: 180px; max-height: 480px; overflow: auto;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 0 0 9px 9px;
  background: #fff; color: var(--fg); font-size: 13px; line-height: 1.65; outline: none;
  white-space: pre-wrap; word-break: break-word;
}
.pd-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.pd-editor:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; }
.pd-editor p, .pd-editor div { margin: 0 0 4px; }
.pd-editor ul, .pd-editor ol { margin: 4px 0; padding-left: 22px; }
.pd-editor hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.pd-editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-editor-bar .acc-count { margin-top: 3px; }
.acc-count.over, .pd-editor-bar .acc-count.over { color: var(--bad); font-weight: 700; }
/* 产品备注：点击展开为多行 */
/* 产品备注：默认两行约 70px（参考领星红框面积），点进去继续展开；同一个 textarea，值不经过任何回写。
   选择器必须带上 .form-fld textarea.inp 才压得过通用规则（否则聚焦不展开）。 */
.form-fld textarea.inp.pd-remark { min-height: 70px; resize: vertical; transition: min-height .12s; }
.form-fld textarea.inp.pd-remark.is-expanded { min-height: 120px; }
/* 附件列表 */
.pd-att-list:empty, .pd-att-empty { margin: 8px 0 0; font-size: 12px; }
.pd-att-items { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pd-att-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.pd-att-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); text-decoration: none; }
.pd-att-name:hover { text-decoration: underline; }
.pd-att-item .muted { flex: 0 0 auto; }
.pd-att-del { margin-right: 0; }
@media (max-width: 720px) {
  .pd-editor { min-height: 160px; }
  .pd-att-item { flex-wrap: wrap; }
  .pd-att-name { flex: 1 1 100%; }
}

/* ===== OCR 识别：按钮转圈 + 就地进度/结果（主体管理、供应商管理） ===== */
/* 反馈紧贴在识别按钮下方，不再是屏幕右下角的全局 toast——弹窗居中时视线不该离开弹窗 */
@keyframes ocr-spin { to { transform: rotate(360deg); } }
.btn-mini.ocr-loading { opacity: .78; cursor: progress; }
.btn-mini.ocr-loading::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: ocr-spin .7s linear infinite;
}
.ocr-live { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; padding: 7px 9px; border-radius: 8px; font-size: 12px; line-height: 1.55; word-break: break-word; }
.ocr-running { color: var(--accent, #6d28d9); background: var(--accent-bg, #f5f3ff); border: 1px solid var(--accent-line, #ddd6fe); }
.ocr-ok { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.ocr-err { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.ocr-live-ico { flex: 0 0 auto; font-weight: 700; line-height: 1.45; }
.ocr-running .ocr-live-ico { display: inline-block; animation: ocr-spin 1.1s linear infinite; }
.ocr-live-msg { flex: 1 1 auto; min-width: 0; }
.ocr-live-x { flex: 0 0 auto; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 1px 2px; opacity: .65; }
.ocr-live-x:hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .ocr-live-ico, .btn-mini.ocr-loading::before { animation: none; }
}

/* ===== 生成采购单（整页）=====
   版式口径对齐参考系统的「生成采购单」流程：
   合并规则提示 → 采购单信息 → 批量设置 → 明细表（行内可改） → 底部合计与四个动作。
   明细列多，允许表格在自己的容器里横滚，但页面本身不出现横向滚动条。 */
.bg-page { display: flex; flex-direction: column; gap: 14px; padding: 0 0 8px; }
.bg-head { display: flex; align-items: center; gap: 10px; }
.bg-back { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.bg-back:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
.bg-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.bg-sub { font-size: 12.5px; color: var(--muted); }
.bg-sub b { color: var(--text); }
.bg-tip { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: 10px; font-size: 12.5px; color: var(--muted); }
.bg-tip-ic { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; line-height: 18px; font-style: normal; }
.bg-tip-tx { flex: 1 1 auto; min-width: 0; line-height: 1.65; }
.bg-tip-tx b { color: var(--text); }
.bg-tip-x { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.bg-tip-x:hover { color: var(--text); }
.bg-card { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 16px; }
.bg-h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.bg-h3-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.bg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.bg-grid-1 { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
.bg-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bg-fld > span { font-size: 12px; color: var(--muted); }
.bg-fld-wide { grid-column: 1 / -1; }
.bg-fld-btn { justify-content: flex-end; }
.bg-fld .inp { width: 100%; min-width: 0; }
.bg-warn { margin-bottom: 10px; padding: 8px 12px; border: 1px solid #fde68a; background: #fffbeb;
  border-radius: 8px; font-size: 12.5px; color: #b45309; }
.bg-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.bg-table { width: 100%; min-width: 1420px; border-collapse: collapse; font-size: 12.5px; }
.bg-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: var(--muted); font-weight: 600;
  text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bg-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft, #eef2f7); vertical-align: middle; }
.bg-table tr:last-child td { border-bottom: 0; }
.bg-c { text-align: center; }
.bg-amt { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.bg-plan-no { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; color: var(--text); }
.bg-plan-it { font-family: var(--mono, ui-monospace, monospace); font-size: 11px; color: var(--muted); }
.bg-name { color: var(--text); }
.bg-sku { font-size: 11px; color: var(--muted); }
/* 行内控件：高度压到 28px，避免表格被撑高；宽度 100% + min-width 0 才不会被列的固有宽度顶破 */
.bg-inp { width: 100%; min-width: 0; height: 28px; padding: 2px 6px; font-size: 12.5px; border-radius: 6px; }
.bg-inp-bad { border-color: #fecaca; background: #fef2f2; }
.bg-del { width: 22px; height: 22px; border: 1px solid var(--line); background: #fff; border-radius: 6px;
  color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.bg-del:hover { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.bg-sum { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px;
  background: #f8fafc; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.bg-sum > span:first-child { color: var(--text); font-weight: 600; }
.bg-sum-i b { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bg-sum-warn { margin-left: auto; color: var(--muted); }
.bg-foot { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 10px; }
/* 合并预览弹窗内容 */
.bg-pv-lead { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.bg-pv-lead b { color: var(--text); }
.bg-pv-list { display: flex; flex-direction: column; gap: 8px; max-height: 48vh; overflow-y: auto; }
.bg-pv-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.bg-pv-t { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.bg-pv-m { font-size: 12px; color: var(--muted); line-height: 1.7; }
.bg-pv-m b { color: var(--text); }

@media (max-width: 900px) {
  .bg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bg-tip-tx { font-size: 12px; }
  .bg-sum-warn { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 720px) {
  .bg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bg-card { padding: 12px; }
  .bg-title { font-size: 16px; }
  .bg-sub { flex-basis: 100%; }
  .bg-head { flex-wrap: wrap; }
  .bg-sum { gap: 10px; font-size: 12px; }
  .bg-foot .btn { flex: 1 1 calc(50% - 10px); min-width: 0; }
}
@media (max-width: 420px) {
  .bg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bg-fld-wide { grid-column: 1 / -1; }
  .bg-foot .btn { flex-basis: 100%; }
}
