:root {
  --primary: #2e51ff;
  --primary-hover: #4a69ff;
  --primary-light: #f0f3ff;
  --primary-soft: #dfe5ff;
  --bg: #f6f7fc;
  --panel: #ffffff;
  --border: #e5e6eb;
  --border-strong: #e5e6eb;
  --text: #111111;
  --text-2: #666666;
  --muted: #8f959e;
  --danger: #f54a45;
  --warn: #ff8800;
  --ok: #00b42a;
  --row-hover: #fbf5ee;
  --row-active: #f6f7fb;
  --radius: 6px;
  --shadow: 0 6px 24px rgba(31, 35, 41, .12);
  --header-h: 50px;
  --tab-h: 40px;
  --page-pad: 15px;
  --rail-w: 160px;
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei", 微软雅黑, -apple-system, BlinkMacSystemFont, "PingFang SC", tahoma, arial, sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 6px; height: 7px; }
::-webkit-scrollbar-thumb { background: rgba(139, 152, 177, .5); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #8b98b1; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 按钮与输入 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; min-width: 60px; padding: 0 12px;
  border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { color: var(--primary); border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #fbc4c2; }
.btn.danger:hover { background: #fff1f0; }
.btn.text { border-color: transparent; background: transparent; color: var(--primary); padding: 0 6px; min-width: 0; }
.btn.sm { height: 24px; padding: 0 8px; font-size: 12px; min-width: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, .select, .textarea {
  height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; outline: none; width: 100%;
  transition: border-color .15s;
}
.input::placeholder, .textarea::placeholder { color: #a9aeb8; }
.textarea { height: auto; min-height: 60px; padding: 6px 8px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.input[readonly] { background: #f7f8fa; color: var(--text-2); }
/* 日期输入：右侧日历图标 + 自绘弹出日历 */
input.kp-date {
  padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646a73' stroke-width='1.8'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4M7 14h2M11 14h2M15 14h2M7 17.5h2M11 17.5h2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 14px;
}
input.kp-date[readonly] { cursor: default; }
.date-pop { position: fixed; z-index: 3000; width: 238px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .14); user-select: none; font-size: 12px; }
.date-pop .dp-hd { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.date-pop .dp-hd b { flex: 1; text-align: center; font-size: 13px; }
.date-pop .dp-hd a { width: 24px; height: 24px; line-height: 22px; text-align: center; border-radius: 4px; cursor: pointer; color: var(--text-2); font-size: 15px; }
.date-pop .dp-hd a:hover { background: #f2f3f5; color: var(--primary); }
.date-pop .dp-wk, .date-pop .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.date-pop .dp-wk span { color: var(--text-3, #8f959e); line-height: 26px; }
.date-pop .dp-days .d { line-height: 28px; margin: 1px; border-radius: 4px; cursor: pointer; }
.date-pop .dp-days .d:hover { background: #f0f3ff; }
.date-pop .dp-days .d.other { color: #c2c6cc; }
.date-pop .dp-days .d.today { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.date-pop .dp-days .d.sel { background: var(--primary); color: #fff; }
.date-pop .dp-ft { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.date-pop .dp-ft a { cursor: pointer; color: var(--primary); padding: 0 4px; }
/* 单据编号 + 刷新按钮 */
.no-box { position: relative; width: 100%; }
.no-box .input { padding-right: 28px; }
/* 凭证字号：记 ▾ 字 N 号 */
.vw-box { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; white-space: nowrap; }
.vw-box .vw-word { width: 62px; flex: none; }
.vw-box .vw-no { width: 48px; flex: none; text-align: center; padding: 0 4px; }
.no-box .no-refresh { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.no-box .no-refresh:hover { color: var(--primary); }
.no-box .no-refresh svg { width: 14px; height: 14px; }
.no-box .no-refresh.spin svg { animation: kp-spin .6s linear infinite; }
@keyframes kp-spin { to { transform: rotate(360deg); } }
label.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.req::after { content: "*"; color: var(--danger); margin-left: 2px; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-rows: var(--header-h) 1fr; grid-template-columns: var(--rail-w) 1fr; height: 100vh; }
.app.collapsed { --rail-w: 56px; }
.header {
  grid-column: 1 / 3; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 10px; background: #fff; z-index: 30;
}
.logo { width: 190px; flex: none; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--primary); letter-spacing: .5px; white-space: nowrap; }
.logo .mark { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #2e51ff, #00c2ff); color: #fff; display: grid; place-items: center; font-size: 15px; }
.logo small { font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.menu-search { position: relative; width: 200px; flex: none; }
.menu-search .input { height: 26px; border-radius: 8px; padding: 0 28px 0 8px; }
.menu-search > .ico { position: absolute; right: 12px; top: 5px; width: 16px; height: 16px; color: #4e5969; pointer-events: none; }
.menu-search > .ico svg { width: 16px; height: 16px; display: block; }
.search-pop { position: absolute; top: 24px; left: 0; width: 200px; background: #fff; border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); max-height: 302px; overflow: auto; z-index: 50; padding: 0; }
.search-pop div { height: 30px; line-height: 30px; padding: 0 12px 0 23px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-pop div:hover, .search-pop div.active { background: #f2f6ff; color: var(--primary); }
.header .spacer { flex: 1; }
.header .company { color: var(--text-2); }
.hd-sep { width: 1px; height: 18px; background: #d8d8d8; }
.user-menu { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.user-menu:hover { background: #f6f7fb; }
.user-menu > svg { width: 14px; height: 14px; color: #666; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #e8efff; color: var(--primary); display: grid; place-items: center; font-weight: 600; }
.dropdown { position: absolute; right: 0; top: 40px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); min-width: 140px; padding: 4px 0; z-index: 60; }
.dropdown div { padding: 8px 16px; cursor: pointer; }
.dropdown div:hover { background: #f5f6f8; }

.rail { background: #fff; display: flex; flex-direction: column; z-index: 20; position: relative; }
.rail-list { flex: 1; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
.rail-item {
  position: relative; flex: none; display: flex; align-items: center; height: 40px; margin: 10px 0 10px 8px; cursor: pointer; color: var(--text);
  white-space: nowrap; overflow: hidden;
}
.rail-item svg { width: 22px; height: 22px; flex: none; margin-left: 18px; }
.rail-item span { position: absolute; left: 22px; width: 118px; padding-left: 10px; text-align: center; line-height: 40px; }
.rail-item:hover, .rail-item.hover { background: var(--primary-soft); color: var(--primary); border-radius: 6px 0 0 6px; }
.rail-foot { border-top: 1px solid #d8d8d8; height: 40px; flex: none; display: grid; place-items: center; cursor: pointer; color: #4e5969; }
.rail-foot svg { width: 20px; height: 20px; }
.app.collapsed .rail-item svg { margin-left: 9px; }
.app.collapsed .rail-item span { display: none; }

.flyout {
  position: fixed; top: calc(var(--header-h) + 8px); left: calc(var(--rail-w) + 10px); background: #fff; border-radius: 8px; box-shadow: 0 4px 46px rgba(30, 50, 102, .14); flex-wrap: wrap; column-gap: 16px; row-gap: 16px;
  padding: 16px; display: none; z-index: 40; max-height: calc(100vh - 16px); overflow: auto;
}
.flyout.show { display: flex; }
.flyout .col { width: 160px; }
.flyout .col h4 { width: 142px; height: 32px; margin: 0; padding: 0 7px; font-size: 14px; font-weight: 700; line-height: 18px; color: var(--text); border-bottom: 1px solid #eaf2ff; }
.flyout .item { display: flex; align-items: center; justify-content: space-between; height: 36px; margin-top: 8px; color: var(--text); }
.flyout .item > span:first-child { flex: 1; min-width: 0; height: 36px; line-height: 36px; padding: 0 7px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flyout .item > span:first-child:hover { background: var(--primary-soft); color: var(--primary); }
.flyout .item .list-ico { flex: none; width: 24px; height: 24px; margin: 0 12px 0 4px; color: #8a8f99; display: grid; place-items: center; border-radius: 4px; cursor: pointer; }
.flyout .item .list-ico svg { width: 16px; height: 16px; }
.flyout .item .list-ico:hover { color: var(--primary); }
.flyout .item .tag { font-size: 10px; color: #fff; background: #7b61ff; border-radius: 3px; padding: 0 4px; margin-left: 4px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabbar { display: flex; height: var(--tab-h); background: #fff; flex: none; }
.tabs { display: flex; align-items: stretch; flex: 1; min-width: 0; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-tools { display: flex; align-items: center; gap: 10px; padding: 0 12px; flex: none; }
.tab-tools span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 4px; color: #4e5969; cursor: pointer; }
.tab-tools span:hover { color: var(--primary); }
.tab-tools span.disabled { color: #c9cdd4; pointer-events: none; }
.tab-tools svg { width: 15px; height: 15px; }
.tab {
  flex: none; height: var(--tab-h); padding: 0 30px 0 16px; display: flex; align-items: center; cursor: pointer; color: #333; background: #f7f8fa;
  white-space: nowrap; position: relative; user-select: none;
}
.tab:hover { background: #f6f6f6; color: var(--text); }
.tab.active, .tab.active:hover { color: var(--text); font-weight: 700; background: var(--primary-light); box-shadow: inset 0 -2px 0 var(--primary); }
.tab .x { position: absolute; right: 8px; top: 12px; width: 16px; height: 16px; border-radius: 4px; display: none; place-items: center; font-size: 12px; font-weight: 400; color: #666; transition: background .15s, color .15s; }
.tab:hover .x, .tab.active .x { display: grid; }
.tab .x:hover { background: #ff4532; color: #fff; }
.pages { flex: 1; position: relative; min-height: 0; background: var(--bg); }
.page { position: absolute; inset: 0; overflow: auto; padding: var(--page-pad); display: none; }
.page.active { display: block; }
.page.fill { display: none; flex-direction: column; }
.page.fill.active { display: flex; }

/* ---------- 面板 ---------- */
.panel { background: var(--panel); border-radius: 6px; padding: 16px; margin-bottom: 15px; }
.panel-title { font-weight: 700; font-size: 14px; color: #000; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-title .spacer { flex: 1; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px; }
.filters .f { display: flex; align-items: center; gap: 6px; }
.filters .f > span { color: var(--text-2); white-space: nowrap; }
.filters .f .input, .filters .f .select { width: 150px; }
.filters .f .ref { width: 170px; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; line-height: 20px; background: #f2f3f5; color: var(--text-2); }
.badge.ok { background: #e8ffea; color: #00a121; }
.badge.warn { background: #fff3e8; color: #e07000; }
.badge.danger { background: #ffece8; color: var(--danger); }
.badge.blue { background: var(--primary-light); color: var(--primary); }
.overdue-tag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; background: var(--danger); color: #fff; font-size: 11px; margin-left: 4px; vertical-align: middle; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 表格 ---------- */
.grid-wrap { position: relative; overflow: auto; border: 1px solid var(--border); background: #fff; }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; table-layout: fixed; }
table.grid th, table.grid td {
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0 8px; height: 41px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.grid th { position: sticky; top: 0; background: #f2f3f5; font-weight: 400; color: #000; z-index: 2; text-align: center; cursor: default; user-select: none; }
table.grid th.sortable { cursor: pointer; }
table.grid th.sortable:hover { background: #e9eaed; }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid td.center { text-align: center; }
table.grid tbody tr:hover td { background: var(--row-hover); }
table.grid tbody tr.selected td { background: var(--row-active); }
table.grid tfoot td { position: sticky; bottom: 0; background: #f7f8fa; font-weight: 600; z-index: 2; }
table.grid .rn { width: 44px; text-align: center; color: var(--text); }
table.grid th.rn { background: #f2f3f5; }
table.grid .ck { width: 36px; text-align: center; }
table.grid tr.bold td { font-weight: 600; background: #fafbfc; }
table.grid tbody tr.fill td, table.grid tbody tr.fill:hover td { padding: 0; border: 0; background: none; white-space: normal; }
.col-rz { position: absolute; top: 0; right: 0; bottom: 0; width: 6px; border-right: 2px solid transparent; cursor: col-resize; }
.col-rz:hover { border-right-color: var(--primary); }
body.col-rzing, body.col-rzing * { cursor: col-resize !important; user-select: none; }

/* 可编辑明细表 */
table.edit td { padding: 0; position: relative; }
table.edit td .cell { height: 40px; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: text; }
/* 不可编辑的格：空行不着色，整行跟随 hover 变色；选了商品的行显示底色，hover 时与可编辑的格区分开（参照原系统） */
table.edit td.ro .cell { cursor: default; }
table.edit.view td.ro .cell { color: var(--text-2); }
table.edit:not(.view) tbody tr:not(.blank) td.ro { background: #eff0f7; }
table.grid.edit .rn { width: 56px; }
table.edit .rn-ops { display: none; align-items: center; justify-content: center; gap: 6px; }
table.edit .rn-ops a { display: flex; color: var(--text-2); cursor: pointer; }
table.edit .rn-ops a:hover { color: var(--primary); }
table.edit .rn-ops svg { width: 15px; height: 15px; }
table.edit tbody tr:hover .rn-no { display: none; }
table.edit tbody tr:hover .rn-ops { display: flex; }
/* 商品选择弹窗 */
.pp-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pp-top .input { width: 280px; }
.pp-main { display: flex; gap: 10px; height: min(440px, calc(100vh - 290px)); min-height: 220px; }
.pp-side { flex: none; width: 140px; overflow: auto; border: 1px solid var(--border); }
.pp-side .tree { min-width: 0; }
.pp-side .tree .node { overflow: hidden; text-overflow: ellipsis; }
.pp-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-list { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); }
/* 窄屏横向滚动时行号和勾选框固定在左侧，始终能继续勾选 */
.pp-list .rn, .pp-list .ck { position: sticky; background: #fff; z-index: 1; }
.pp-list .rn { left: 0; }
.pp-list .ck { left: 44px; }
.pp-list th.rn, .pp-list th.ck { background: #f2f3f5; z-index: 3; }
.pp-picked { flex: 0 1 256px; min-width: 180px; overflow: auto; border: 1px solid var(--border); }
.pp-picked table.grid, .pp-list table.grid { min-width: 100%; }
.pp table.grid td .pp-qty { width: 100%; height: 28px; padding: 0 6px; border: 1px solid var(--primary); border-radius: 2px; outline: none; text-align: right; }
.pp-del { color: var(--text-2); cursor: pointer; font-size: 16px; }
.pp-del:hover { color: var(--danger); }
.pp-count { margin-top: 8px; color: var(--text-2); }
.pp .empty { padding: 40px 0; text-align: center; color: var(--text-2); }
table.edit td.num .cell { justify-content: flex-end; }
table.edit td .cell-input { position: absolute; inset: 0; border: 2px solid var(--primary); border-radius: 0; height: 100%; padding: 0 6px; outline: none; background: #fff; z-index: 3; width: 100%; }
table.edit td.focus { outline: 2px solid var(--primary); outline-offset: -2px; }
/* 凭证金额按位显示 */
.kb-digits { display: grid; grid-template-columns: repeat(12, 1fr); height: 100%; text-align: center; }
.kb-digits span { display: flex; align-items: center; justify-content: center; border-left: 1px solid #eef0f4; min-height: 34px; font-variant-numeric: tabular-nums; }
.kb-digits span:nth-child(2), .kb-digits span:nth-child(6), .kb-digits span:nth-child(9) { border-right: 1px solid #9db4e8; }
.kb-digits span:nth-child(10) { border-right: 1px solid #e88a8a; }
.kb-digits.head { font-weight: 400; font-size: 12px; margin-top: 4px; }
.kb-digits.head span { min-height: 20px; }
.kb-digits.neg { color: var(--danger); }
table.grid th.digits { height: auto; padding: 4px 0 0; }
table.edit td.digits .cell { display: block; padding: 0; }
table.edit .row-del { visibility: hidden; color: var(--danger); cursor: pointer; padding: 0 4px; }
table.edit tr:hover .row-del { visibility: visible; }
table.edit td .calc-input { padding-right: 26px; text-align: left; }
.calc-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 4; color: var(--text-2); cursor: pointer; display: flex; }
.calc-btn:hover { color: var(--primary); }
.calc-btn svg { width: 15px; height: 15px; }
.calc-field { position: relative; }
.calc-field .input { width: 100%; padding-right: 28px; }
.calc-pad { position: fixed; z-index: 1000; display: grid; grid-template-columns: repeat(4, 50px); grid-auto-rows: 36px; background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; user-select: none; }
.calc-k { border: 0; border-right: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; background: #fff; font-size: 14px; color: var(--text); cursor: pointer; padding: 0; }
.calc-k:nth-child(4n) { border-right: 0; }
.calc-k.op { background: #f7f8fa; }
.calc-k:hover { background: #f0f3ff; }
.calc-k.eq { grid-column: 4; grid-row: 4 / span 2; background: var(--primary); color: #fff; border: 0; }
.calc-k.eq:hover { filter: brightness(1.08); }
table.edit .ref-btn { position: absolute; right: 2px; top: 10px; color: var(--muted); padding: 0 4px; cursor: pointer; z-index: 4; }

/* ---------- 引用选择 ---------- */
.ref { position: relative; display: flex; }
.ref .input { padding-right: 26px; }
.ref .dots { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; letter-spacing: 1px; }
.ref-pop {
  position: fixed; background: #fff; border-radius: 6px; box-shadow: var(--shadow); z-index: 1000; max-height: 300px; overflow: auto; min-width: 280px; font-size: 14px;
}
.ref-pop table { width: 100%; border-collapse: collapse; }
.ref-pop td { padding: 6px 10px; white-space: nowrap; border-bottom: 1px solid #f2f3f5; }
.ref-pop tr { cursor: pointer; }
.ref-pop tr:hover td, .ref-pop tr.active td { background: var(--primary-light); }
.ref-pop .code { color: var(--muted); }
.ref-pop .foot { padding: 6px 10px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

/* ---------- 单据 ---------- */
.bill { max-width: 1400px; margin: 0 auto; }
.bill-head { position: relative; text-align: center; margin-bottom: 16px; }
.bill-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.bill-head .actions { position: absolute; right: 0; top: 0; display: flex; gap: 8px; }
.bill-head .status { position: absolute; left: 0; top: 2px; }
.bill-form { display: flex; gap: 16px; align-items: flex-start; }
.bill-form > .form-grid { flex: 1; min-width: 0; }
/* 单据详情（只读）：标题在左，印章和工具栏在右；表头字段显示为纯文字 */
.bill.view .bill-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; text-align: left; margin: -4px -16px 16px; padding: 0 16px 12px; border-bottom: 1px solid var(--border); }
.bill.view .bill-head .actions { position: static; flex-wrap: wrap; justify-content: flex-end; }
.bill.view .bill-head h2 { margin-right: auto; }
.bill.view .form-grid { gap: 8px 32px; }
.bill.view .form-grid .fi > label { color: var(--text-2); }
.bill.view .form-grid .fi > label::after { content: ':'; }
.bill.view .form-grid .input, .bill.view .form-grid .select, .bill.view .form-grid .textarea { background: transparent; border: 0; padding: 0; height: 24px; color: var(--text); box-shadow: none; opacity: 1; appearance: none; -webkit-appearance: none; cursor: text; outline: none; pointer-events: none; }
.bill.view .form-grid .select { background-image: none; }
.bill.view .grid-wrap { max-height: none; }
.bill-stamp { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; margin: -8px 0; border-radius: 50%; border: 2px solid #1a9c78; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px #1a9c78; color: #1a9c78; font-size: 12px; font-weight: 700; white-space: nowrap; transform: rotate(-18deg); user-select: none; flex: none; }
.bill-stamp.stop { color: var(--danger); border-color: var(--danger); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--danger); }
.bill-nav { display: flex; align-items: center; gap: 8px; }
.bill-pager { display: flex; }
.bill-pager .btn { padding: 0 10px; min-width: 0; font-size: 16px; line-height: 1; }
.bill-pager .btn:first-child { border-radius: 4px 0 0 4px; border-right: 0; }
.bill-pager .btn:last-child { border-radius: 0 4px 4px 0; }
.bill-refresh { border: 0; background: transparent; padding: 0 4px; min-width: 0; font-size: 16px; color: var(--text-2); }
/* 打印按钮：文字和箭头是两个点击区，外观是一个整体（边框在外层，中间没有竖线） */
.btn-split { display: inline-flex; box-sizing: border-box; height: 32px; border: 1px solid #ddd; border-radius: 4px; background: #fff; transition: border-color .15s; }
.btn-split:hover { border-color: var(--primary); }
.btn-split .btn { min-width: 0; height: 100%; border: 0; background: transparent; }
.btn-split .btn:first-child { padding: 0 4px 0 12px; }
.btn-split .btn:last-child { padding: 0 10px 0 6px; }
.btn-split .caret { display: inline-block; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); }
.bill-settle { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 48px; }
.bill-settle .fi { display: flex; align-items: center; gap: 8px; min-width: 240px; }
.bill-settle .fi > label { color: var(--text-2); white-space: nowrap; }
.bill-settle .fi > .ref, .bill-settle .fi > .calc-field, .bill-settle .fi > .input { width: 180px; }
.bill.view .bill-settle .input { background: transparent; border: 0; padding: 0; height: 24px; color: var(--text); pointer-events: none; }
.bill.view .bill-settle .fi > label::after { content: ':'; }
.bill-other .fi { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.bill-other .fi > label { color: var(--text-2); white-space: nowrap; line-height: 24px; }
.bill-other .fi > label::after { content: ':'; }
.bill-remark-text { line-height: 24px; white-space: pre-wrap; word-break: break-all; }
.bill-other .bill-meta { margin: 0; }
.bill-related-title { font-size: 16px; margin-bottom: 14px; }
.bill-chain-item { position: relative; display: flex; align-items: center; gap: 4px; padding: 0 0 18px 16px; }
.bill-chain-item:last-child { padding-bottom: 0; }
.bill-chain-item i { position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border: 2px solid var(--primary); border-radius: 50%; background: #fff; z-index: 1; box-sizing: border-box; }
.bill-chain-item:not(:last-child)::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -4px; border-left: 1px solid var(--border); }
.grid.edit th.row-acts, .grid.edit td.row-acts { position: sticky; right: 0; background: var(--panel); box-shadow: -1px 0 0 var(--border); z-index: 2; }
.grid.edit td.row-acts .cell { display: flex; gap: 12px; justify-content: center; white-space: nowrap; }
.grid.edit td.row-acts a { color: var(--primary); cursor: pointer; }
.stamp { position: absolute; right: 140px; top: -6px; border: 2px solid var(--danger); color: var(--danger); border-radius: 6px; padding: 0 10px; font-weight: 700; transform: rotate(-12deg); opacity: .7; letter-spacing: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 10px 32px; margin-bottom: 16px; }
.form-grid .fi { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; }
.form-grid .fi > label { text-align: right; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-grid .fi.wide { grid-column: 1 / -1; }
/* 资料编辑弹窗（参照原系统）：两列，分段标题 / 页签 */
.arch-form .form-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 10px 28px; margin-bottom: 8px; }
.arch-form .form-grid .fi { grid-template-columns: 96px 1fr; }
.arch-form-sec { font-weight: 600; margin: 4px 0 10px; padding-left: 8px; border-left: 3px solid var(--primary); line-height: 1.1; }
.arch-form .form-grid + .arch-form-sec { margin-top: 12px; }
.arch-form-tabs { display: flex; gap: 24px; margin: -6px 0 14px; border-bottom: 1px solid var(--border, #e5e6eb); }
.arch-form-tabs .ft { padding: 6px 2px; cursor: pointer; color: #555; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.arch-form-tabs .ft.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.form-grid .input:not(.textarea), .form-grid .select { height: 34px; }
.bill-foot { position: sticky; bottom: calc(var(--page-pad) * -1); margin: 0 calc(var(--page-pad) * -1) calc(var(--page-pad) * -1); background: #fff; border-top: 1px solid var(--border); padding: 10px 20px; display: flex; align-items: center; gap: 10px; justify-content: flex-end; z-index: 5; }
.bill-meta { color: var(--muted); font-size: 12px; margin-right: auto; display: flex; gap: 16px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 900; display: grid; place-items: center; animation: fade .15s; }
.dialog { position: relative; background: #fff; border-radius: 8px; box-shadow: var(--shadow); width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.dialog-head { flex: none; height: 50px; padding: 0 18px 0 30px; font-weight: 400; font-size: 16px; color: var(--text); background: #edf0f6; border-radius: 8px 8px 0 0; display: flex; align-items: center; cursor: move; user-select: none; }
.dialog-head .x { margin-left: auto; cursor: pointer; color: #999; font-size: 18px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; transition: background .15s, color .15s; }
.dialog-head .x:hover { background: #ff4532; color: #fff; }
.dialog-head .x.max-btn { font-size: 16px; }
.dialog-head .x.max-btn:hover { background: #dfe3ec; color: var(--text); }
.dialog-head .x.close-btn { margin-left: 4px; }
.dialog.max { width: 100vw !important; height: 100vh; max-width: none; max-height: none; border-radius: 0; left: 0 !important; top: 0 !important; }
.dialog.max .dialog-head { border-radius: 0; cursor: default; }
.dialog.max .pv-frame { height: calc(100vh - 160px) !important; }
.dialog-body { padding: 16px 20px; overflow: auto; flex: 1; }
.dialog-foot { padding: 12px 20px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); }
.dialog .form-grid { grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 12px 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast-box { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #fff; box-shadow: var(--shadow); border-radius: 6px; padding: 10px 16px; display: flex; gap: 8px; align-items: center; animation: fade .2s; max-width: 640px; }
.toast.error { border-left: 3px solid var(--danger); }
.toast.ok { border-left: 3px solid var(--ok); }
.toast.warn { border-left: 3px solid var(--warn); }

/* ---------- 首页 ---------- */
/* 首页看板（参照原系统图表中心）：一行 4 格，卡片宽 w1–w4、高 h1–h3（一行 170px） */
.dash-head { display: flex; justify-content: flex-end; gap: 16px; margin: -6px 0 8px; }
.dash-act { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); cursor: pointer; font-size: 13px; }
.dash-act.on { color: var(--warn); }
.dico { display: inline-flex; width: 16px; height: 16px; }
.dico svg { width: 100%; height: 100%; }
.dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 170px; grid-auto-flow: row dense; gap: 16px; }
.dash .panel { margin: 0; }
.dash .dcard { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.dash .dcard.w2, .dash .span2 { grid-column: span 2; }
.dash .dcard.w3 { grid-column: span 3; }
.dash .dcard.w4, .dash .span3 { grid-column: 1 / -1; }
.dash .dcard.h2 { grid-row: span 2; }
.dash .dcard.h3 { grid-row: span 3; }
.dash .dcard[draggable="true"] { cursor: move; outline: 1px dashed #c9cdd4; }
.dash .dcard.dragging { opacity: .4; }
@media (max-width: 1100px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash .dcard.w3 { grid-column: 1 / -1; } }
@media (max-width: 700px) { .dash { grid-template-columns: 1fr; } .dash .dcard.w2, .dash .span2 { grid-column: auto; } }
.dcard .panel-title { margin-bottom: 8px; flex: none; }
.dcard .dbody { flex: 1; min-height: 0; overflow: auto; position: relative; }
.dcard.k-line .dbody, .dcard.k-bar .dbody, .dcard.k-pie .dbody { overflow: hidden; }
.dtools { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.dtools a { color: #86909c; cursor: pointer; display: inline-flex; }
.dtools a:hover { color: var(--primary); }
.dtools .dico { width: 15px; height: 15px; }
.dperiod { height: 24px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; padding: 0 4px; background: #fff; }
.chart-empty { height: 100%; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; }
.chart-empty .dico { width: 28px; height: 28px; color: #c9cdd4; }
.chart-wrap { height: 100%; display: flex; flex-direction: column; }
.chart-svg { flex: 1; min-height: 0; position: relative; }
.chart-svg svg { position: absolute; inset: 0; display: block; }
.chart-legend { display: flex; justify-content: flex-end; gap: 16px; font-size: 12px; color: #4e5969; flex: none; }
.chart-legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.chart-tip { position: fixed; z-index: 3000; pointer-events: none; background: rgba(255, 255, 255, .96); border-radius: 6px; box-shadow: 0 4px 16px rgba(34, 87, 188, .16); padding: 8px 10px; font-size: 12px; min-width: 140px; }
.chart-tip .th { font-weight: 600; margin-bottom: 4px; }
.chart-tip .tr { display: flex; justify-content: space-between; gap: 16px; line-height: 22px; }
.chart-tip .tr i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.pie-wrap { height: 100%; display: grid; grid-template-columns: minmax(120px, 45%) 1fr; gap: 12px; align-items: center; }
.pie-wrap .chart-svg { height: 100%; }
.pie-legend { overflow: auto; max-height: 100%; font-size: 12px; }
.pie-legend .it { display: grid; grid-template-columns: 10px 1fr auto 48px; gap: 6px; align-items: center; line-height: 24px; }
.pie-legend .it i { width: 10px; height: 10px; border-radius: 2px; }
.pie-legend .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-legend .v { font-variant-numeric: tabular-nums; }
.pie-legend .p { color: var(--muted); text-align: right; }
.rank-list { font-size: 13px; }
.rank-list .rh, .rank-list .r { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 0 8px; }
.rank-list .rh { background: #f6f7fb; color: #4e5969; font-size: 12px; line-height: 30px; border-radius: 4px; }
.rank-list .rh span:last-child { text-align: right; }
.rank-list .r { line-height: 38px; cursor: pointer; border-bottom: 1px solid #f2f3f5; }
.rank-list .r:hover { background: #f6f7fb; }
.rank-list .r .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .r b { font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-list .no { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #86909c; line-height: 1; }
.rank-list .no.m1 { background: #f7b500; color: #fff; }
.rank-list .no.m2 { background: #a8b4c4; color: #fff; }
.rank-list .no.m3 { background: #d4915a; color: #fff; }
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.dcard-big .kpi-tiles { grid-template-columns: repeat(3, 1fr); }
.kpi { background: #f6f7fb; border-radius: 6px; padding: 12px 14px; cursor: pointer; min-width: 0; }
.kpi:hover { background: var(--primary-light); }
.kpi .t { color: #4e5969; font-size: 12px; }
.kpi .v { font-size: 22px; margin: 4px 0 2px; font-weight: 600; color: #000; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 12px; font-weight: 400; margin-left: 2px; }
.kpi .s { color: var(--muted); font-size: 12px; }
.kpi.danger .v { color: #f53f3f; }
.prog-list .pr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n d" "bar bar"; column-gap: 8px; padding: 6px 4px; cursor: pointer; border-bottom: 1px solid #f2f3f5; font-size: 12px; }
.prog-list .pr:hover { background: #f6f7fb; }
.prog-list .n { grid-area: n; display: flex; gap: 8px; min-width: 0; }
.prog-list .n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-list .d { grid-area: d; display: flex; gap: 8px; color: var(--muted); }
.prog-list .d b { color: var(--primary); }
.prog-list .bar { grid-area: bar; height: 6px; background: #f0f2f5; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.prog-list .bar i { display: block; height: 100%; background: var(--primary); }
.prog-list .overdue .bar i { background: #f53f3f; }
.prog-list .overdue .e { color: #f53f3f; }
.dcard-big { height: 62vh; overflow: auto; }
.dcard-big.k-line, .dcard-big.k-bar, .dcard-big.k-pie { overflow: hidden; }
.dash-menu { position: fixed; z-index: 3000; background: #fff; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .14); padding: 4px 0; min-width: 120px; }
.dash-menu .it { padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.dash-menu .it:hover { background: var(--primary-light); color: var(--primary); }
.dash-drawer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 2000; }
.dash-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -4px 0 16px rgba(0, 0, 0, .1); }
.dash-drawer .dd-head { display: flex; align-items: center; padding: 16px 20px; font-size: 15px; }
.dash-drawer .dd-head .spacer { flex: 1; }
.dash-drawer .dd-body { flex: 1; overflow: auto; padding: 0 20px; }
.dash-drawer .dd-gt { display: flex; justify-content: space-between; align-items: center; font-weight: 600; padding: 12px 0 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dash-drawer .dd-gt .caret { width: 0; height: 0; border: 5px solid transparent; border-top-color: #86909c; margin-top: 5px; transition: transform .15s; }
.dash-drawer .dd-group.fold .dd-gt .caret { transform: rotate(-90deg); margin-top: 0; }
.dash-drawer .dd-group.fold .dd-items { display: none; }
.dash-drawer .dd-items { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 8px 14px; }
.dash-drawer .dd-item { display: flex; align-items: center; gap: 6px; line-height: 28px; cursor: pointer; }
.dash-drawer .dd-item.disabled { color: #c9cdd4; cursor: not-allowed; }
.dash-drawer .dd-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 8px 16px; background: #fff; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat .t { color: var(--text); }
.stat .v { font-size: 24px; font-weight: 500; margin: 4px 0 2px; color: #000; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12px; }
.todo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.todo .it { text-align: center; padding: 10px 4px; border-radius: 8px; cursor: pointer; }
.todo .it:hover { background: #f6f7fb; }
.todo .it b { display: block; font-size: 22px; color: #000; }
.flow { --node-w: 96px; --arrow-w: 22px; display: grid; justify-content: start; align-items: start; row-gap: 0; padding: 4px 0; overflow-x: auto; }
.flow .node { --c: #2e51ff; --bg: #f0f3ff; width: var(--node-w); display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; text-align: center; }
.flow .node .ico { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--c); transition: all .15s; }
.flow .node .ico svg { width: 24px; height: 24px; }
.flow .node .lb { font-size: 13px; color: var(--text-2); line-height: 1.3; }
.flow .node:hover .ico { background: var(--c); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
.flow .node:hover .lb { color: var(--c); }
.flow .node.c1 { --c: #14b8a6; --bg: #e6f8f6; }
.flow .node.c2 { --c: #f59e0b; --bg: #fff4e0; }
.flow .node.c3 { --c: #8b5cf6; --bg: #f2edff; }
.flow .node.c4 { --c: #ef4444; --bg: #ffeded; }
.flow .node.c5 { --c: #0ea5e9; --bg: #e5f6fe; }
.flow .arrow { width: var(--arrow-w); height: 48px; display: flex; align-items: center; justify-content: center; color: #c9cdd4; }
.flow .arrow svg { width: 16px; height: 16px; }
/* 分支行之间的竖向/斜向箭头 */
.flow .arrow.d, .flow .arrow.u, .flow .arrow.ur, .flow .arrow.ul { width: auto; height: 40px; }
.flow .arrow.d svg, .flow .arrow.u svg, .flow .arrow.ur svg, .flow .arrow.ul svg { width: 18px; height: 18px; flex: none; }
.flow .arrow.d svg { transform: rotate(90deg); }
.flow .arrow.u svg { transform: rotate(-90deg); }
.flow .arrow.ur svg { transform: rotate(-45deg); }
.flow .arrow.ul svg { transform: rotate(-135deg); }
.alerts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.alerts .it { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 6px; border-radius: 6px; background: #f6f7fb; cursor: pointer; text-align: center; font-size: 12px; }
.alerts .it:hover { background: var(--primary-light); }
.alerts .it b { font-size: 20px; color: #000; }
.alerts .it.on b { color: var(--warn); }
.proc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.proc-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; cursor: pointer; }
.proc-card:hover { border-color: var(--primary); }
.proc-card .n { font-weight: 600; display: flex; justify-content: space-between; }
.proc-card .bar { height: 6px; background: #f0f2f5; border-radius: 3px; margin: 8px 0 6px; overflow: hidden; }
.proc-card .bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.proc-card .d { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

/* ---------- 派工 / 报工 ---------- */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sub-tabs div { height: 36px; line-height: 34px; padding: 0 14px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs div.active { color: var(--primary); border-color: var(--primary); font-weight: 700; }
.route { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; }
.route-card { width: 190px; flex: none; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.route-card .hd { background: var(--primary); color: #fff; padding: 6px 10px; display: flex; justify-content: space-between; align-items: center; }
.route-card .hd .seq { width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--primary); display: inline-grid; place-items: center; font-size: 11px; margin-right: 6px; font-weight: 700; }
.route-card.done .hd { background: var(--ok); }
.route-card .bd { padding: 10px; min-height: 64px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.route-card .emp { background: #8c95a5; color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.route-card .emp i { cursor: pointer; font-style: normal; opacity: .8; }
.route-card .add { width: 28px; height: 24px; border: 1px dashed var(--primary); color: var(--primary); border-radius: 4px; display: grid; place-items: center; cursor: pointer; }
.route-card .ft { border-top: 1px solid var(--border); padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; white-space: nowrap; }
.route-card .ft .input { order: 3; flex-basis: 100%; }
.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.task { border: 1px solid var(--border); border-radius: 8px; padding: 12px; cursor: pointer; background: #fff; transition: all .15s; }
.task:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(46, 81, 255, .12); }
.task.active { border-color: var(--primary); background: #f7f9ff; }
.task .no { font-weight: 600; display: flex; justify-content: space-between; }
.task .p { margin: 4px 0; color: var(--text-2); }
.task .q { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 360px; gap: 12px; align-items: start; }

/* 大屏 */
.bigscreen { background: radial-gradient(circle at 30% 0%, #0d2a5c, #050b1d 70%); color: #d8e6ff; min-height: 100%; margin: calc(var(--page-pad) * -1); padding: 20px; }
.bigscreen h1 { text-align: center; margin: 0 0 20px; font-size: 26px; letter-spacing: 6px; color: #fff; text-shadow: 0 0 12px #3b8bff; }
.bs-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 16px; }
.bs-box { border: 1px solid rgba(80, 150, 255, .35); background: rgba(10, 40, 90, .35); border-radius: 8px; padding: 14px; }
.bs-box h3 { margin: 0 0 10px; font-size: 14px; color: #7fb4ff; }
.bs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bs-kpi { text-align: center; padding: 10px; border-radius: 6px; background: rgba(40, 110, 255, .12); }
.bs-kpi b { display: block; font-size: 26px; color: #4ff0ff; font-variant-numeric: tabular-nums; }
.bs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bs-table td, .bs-table th { padding: 6px; border-bottom: 1px solid rgba(80, 150, 255, .15); text-align: left; }
.bs-table th { color: #7fb4ff; font-weight: 500; }

/* 插件中心 */
.pc { display: flex; flex-direction: column; gap: 4px; }
/* 负外边距盖住页面内边距，卡片滚动时从这一块下面经过，不会从四周露出来 */
.pc-sticky { position: sticky; top: calc(-1 * var(--page-pad)); z-index: 20; display: flex; flex-direction: column; gap: 14px; margin: calc(-1 * var(--page-pad)) calc(-1 * var(--page-pad)) 0; padding: var(--page-pad) var(--page-pad) 10px; background: var(--bg); }
.pc-fill { flex: 1; }
.pc-head, .pc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pc-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.pc-pending { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: #fff7e8; border: 1px solid #ffdfa8; border-radius: var(--radius); color: #7a4a00; }
.pc-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: #eceef6; border-radius: 8px; }
.pc-tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; }
.pc-tab:hover { color: var(--primary); }
.pc-tab.active { background: #fff; color: var(--primary); font-weight: 600; }
.pc-count { min-width: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #dfe2ec; color: var(--text-2); font-size: 12px; font-weight: 400; line-height: 18px; text-align: center; }
.pc-tab.active .pc-count { background: var(--primary-soft); color: var(--primary); }
.pc-count.alert, .pc-tab.active .pc-count.alert { background: var(--danger); color: #fff; }
.pc-search { flex: 0 1 280px; width: 280px; }
.pc-list { display: flex; flex-direction: column; gap: 18px; }
.pc-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.pc-group-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.pc-group-count, .pc-group-note { color: var(--text-2); font-size: 12px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.pc-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.pc-card:hover { border-color: #b9c4ff; box-shadow: 0 6px 20px rgba(31, 35, 41, .07); }
.pc-card.fail { border-color: #f2a9a6; }
.pc-card.menu-open { z-index: 10; }
.pc-top { display: flex; align-items: flex-start; gap: 12px; }
.pc-tile { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: #fff; }
.pc-card.builtin .pc-tile { background: #eaeeff; color: var(--primary); }
.pc-card.off .pc-tile { background: #eef0f3; color: var(--text-2); }
.pc-card.fail .pc-tile { background: #fff1f0; color: var(--danger); }
.pc-title { flex: 1; min-width: 0; }
.pc-name { font-size: 15px; font-weight: 700; }
.pc-card.off .pc-name { color: var(--text-2); }
.pc-ver, .pc-id { color: var(--text-2); font-size: 12px; }
.pc-id code { font-family: Consolas, "SF Mono", monospace; }
.pc-switch { flex: none; display: flex; justify-content: flex-start; width: 40px; height: 22px; padding: 2px; box-sizing: border-box; border: 0; border-radius: 11px; background: #8a909c; cursor: pointer; }
.pc-switch[aria-checked="true"] { justify-content: flex-end; background: var(--primary); }
.pc-switch span { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.pc-desc { display: -webkit-box; height: 39px; margin: 0; overflow: hidden; color: #434a57; font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-card.off .pc-desc { color: var(--text-2); }
.pc-err { padding: 7px 10px; background: #fff1f0; border-radius: var(--radius); color: #a8201c; font-size: 12px; word-break: break-word; }
.pc-msg { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; background: #fff7e8; border-radius: var(--radius); color: #7a4a00; font-size: 12px; }
.pc-msg span { flex: 1; }
.pc-msg button { flex: none; padding: 0; border: 0; background: none; color: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.pc-deps { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 6px; margin: 0; font-size: 12px; }
.pc-deps dt { color: var(--text-2); }
.pc-deps dd { margin: 0; overflow: hidden; color: #434a57; text-overflow: ellipsis; white-space: nowrap; }
.pc-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f1f4; font-size: 12px; }
.pc-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #0a7a2f; }
.pc-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pc-card.off .pc-status { color: var(--text-2); }
.pc-card.fail .pc-status { color: #c8322e; }
.pc-tag { padding: 0 6px; border-radius: 4px; background: #fff3dc; color: #7a4a00; }
.pc-res { color: var(--text-2); white-space: nowrap; }
.pc-more { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--text-2); cursor: pointer; }
.pc-more:hover { background: #f0f1f4; color: var(--text); }
.pc-menu { position: absolute; right: 12px; bottom: 50px; width: 200px; padding: 4px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.pc-menu button { display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: 4px; background: none; text-align: left; cursor: pointer; }
.pc-menu button:hover:not(:disabled) { background: var(--primary-light); }
.pc-menu button:disabled { color: #8a909c; cursor: not-allowed; }
.pc-menu button.danger { color: #c8322e; }
.pc-menu small { display: block; color: var(--text-2); font-size: 12px; }
.pc-menu hr { height: 1px; margin: 4px 0; border: 0; background: #f0f1f4; }

/* 插件开发文档 */
.pdoc { display: flex; align-items: flex-start; gap: 15px; }
.pdoc-nav { position: sticky; top: 0; flex: none; width: 220px; max-height: calc(100vh - 120px); margin: 0; overflow: auto; padding: 12px 8px; }
.pdoc-nav-title { padding: 0 8px 8px; font-weight: 700; }
.pdoc-link { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 4px; background: none; text-align: left; cursor: pointer; }
.pdoc-link:hover { background: #f5f6f8; }
.pdoc-link.active { background: var(--primary-light); color: var(--primary); }
.pdoc-main { flex: 1; min-width: 0; max-width: 1000px; }
.pdoc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pdoc-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.pdoc-head p { margin: 2px 0 0; color: var(--text-2); }
.pdoc-section { scroll-margin-top: 0; }
.pdoc-section h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.pdoc-body h3 { margin: 16px 0 6px; font-size: 14px; color: var(--text); }
.pdoc-body p { margin: 8px 0; }
.pdoc-body b { color: var(--text); }
.pdoc-body ul, .pdoc-body ol { margin: 8px 0; padding-left: 22px; }
.pdoc-body pre { margin: 8px 0; }
.pdoc-flow { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; list-style: none; counter-reset: pd; }
.pdoc-flow li { counter-increment: pd; padding: 4px 12px 4px 8px; border-radius: 16px; background: var(--primary-light); color: var(--text); }
.pdoc-flow li::before { content: counter(pd); display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; }
.pdoc-table { width: 100%; margin: 8px 0; border-collapse: collapse; }
.pdoc-table th, .pdoc-table td { padding: 7px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.pdoc-table th { background: #f2f3f5; color: #000; font-weight: 400; }
.pdoc-table code { margin-right: 2px; white-space: nowrap; }
@media (max-width: 900px) { .pdoc { flex-direction: column; align-items: stretch; } .pdoc-nav { position: static; width: auto; max-height: none; } }
.doc { line-height: 1.8; color: var(--text-2); }
.doc code, .doc pre { background: #f6f8fa; border-radius: 4px; font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.doc code { padding: 1px 5px; }
.doc pre { padding: 10px 12px; overflow: auto; line-height: 1.5; }
.doc h4 { margin: 14px 0 4px; color: var(--text); }

.tree { padding: 4px 0; min-width: 180px; }
.tree .node { padding: 5px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.tree .node:hover { background: #f5f6f8; }
.tree .node.active { background: var(--primary-light); color: var(--primary); }

.perm-tree { columns: 3; column-gap: 24px; }
.perm-tree .grp { break-inside: avoid; margin-bottom: 10px; }
.perm-tree .grp b { display: block; margin-bottom: 4px; }

@media print {
  .header, .rail, .tabbar, .bill-foot, .bill-head .actions, .toolbar, .filters { display: none !important; }
  .app { display: block; }
  .page { position: static; padding: 0; }
}

/* ---------- 明细表格工具、附件、审核流 ---------- */
table.edit tr.cur td.rn { background: var(--primary-light); color: var(--primary); }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.attach-item { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; background: #fafbfc; }
.attach-item .x { color: var(--muted); cursor: pointer; }
.attach-item .x:hover { color: var(--danger); }
.flow-steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.flow-steps .step { padding: 2px 10px; border-radius: 10px; background: #f2f3f5; font-size: 12px; }
.flow-steps .step.ok { background: #e8ffea; color: #00a121; }
.flow-steps .step.now { background: var(--primary-light); color: var(--primary); }
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sub-tabs a { padding: 8px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs a.active { color: var(--primary); border-color: var(--primary); }
.print-card { page-break-after: always; }

/* ---------- 通用弹出层（下拉菜单、更多筛选、显示列） ---------- */
.kp-pop { position: fixed; z-index: 80; background: #fff; border-radius: 6px; box-shadow: 0 4px 20px rgba(0, 0, 0, .12); border: 1px solid #ebedf0; }
.kp-pop.menu { padding: 4px 0; min-width: 120px; }
.kp-menu-item { padding: 7px 16px; cursor: pointer; white-space: nowrap; }
.kp-menu-item:hover { background: #f2f5ff; color: var(--primary); }
.kp-menu-item.active { color: var(--primary); font-weight: 600; }
.kp-menu-sep { height: 1px; margin: 4px 0; background: #ebedf0; }
.kp-pop.filter { padding: 20px 20px 14px; width: 360px; }

/* ---------- 报表页（参照原系统：顶部条件栏 + 分类树 + 表格 + 记录数） ---------- */
.panel.rpt {
  height: calc(100vh - var(--header-h) - var(--tab-h) - var(--page-pad) * 2); min-height: 360px; margin: 0; padding: 10px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 10px;
}
.rpt-bar { display: flex; align-items: center; gap: 12px; flex: none; }
.rpt-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.rpt-right.toolbar { margin: 0; flex-wrap: nowrap; gap: 12px; }
.rpt .btn, .rpt .input, .rpt .select { height: 32px; }
.rpt-preset { width: 92px; }
.rpt-range { display: inline-flex; align-items: center; height: 32px; border: 1px solid #dcdfe6; border-radius: 4px; background: #fff; padding: 0 4px; }
.rpt-range:focus-within { border-color: var(--primary); }
.rpt-range input { border: 0; outline: 0; background-color: transparent; height: 28px; width: 128px; padding: 0 22px 0 4px; }
.rpt-range span { color: var(--text-2); padding: 0 2px; }
.rpt-inline { display: inline-flex; align-items: center; gap: 8px; }
.rpt-inline .input, .rpt-inline .ref { width: 200px; }
.rpt-more.on { color: var(--primary); border-color: var(--primary); }
.rpt-refresh { color: #b0b4bd; font-size: 17px; cursor: pointer; line-height: 1; padding: 0 2px; }
.rpt-refresh:hover { color: var(--primary); }
.rpt-hint { color: var(--muted, #8a8f99); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-dd { padding: 0 10px 0 14px; }
.rpt-dd .caret, .rpt-dd + .caret { width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); margin-left: 6px; }
.rpt-fi { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.rpt-fi > label { text-align: right; color: var(--text); }
.rpt-fi .input, .rpt-fi .select, .rpt-fi .ref { width: 100%; }
.rpt-pop-foot { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.rpt-pop-foot .spacer { flex: 1; }

.rpt-body { flex: 1; min-height: 0; display: flex; }
.rpt-side { width: 250px; flex: none; border: 1px solid #e5e6eb; display: flex; flex-direction: column; overflow: hidden; }
.rpt-side.collapsed { display: none !important; }
.rpt-side-head { height: 40px; line-height: 40px; padding: 0 12px; background: #f6f7fb; font-weight: 700; flex: none; }
.rpt-side .tree { flex: 1; overflow: auto; padding: 4px 0; min-width: 0; }
.rpt-side .tree .node { height: 30px; line-height: 30px; padding-top: 0; padding-bottom: 0; border-radius: 0; }
.rpt-side .tree .node.active { background: #f0f3ff; color: var(--primary); }
.rpt-side-toggle { position: relative; width: 10px; flex: none; margin: 0 5px; align-self: center; height: 50px; border-radius: 5px; background: #d9dbe3; cursor: pointer; }
.rpt-side-toggle::after { content: ""; position: absolute; left: 2px; top: 50%; margin-top: -4px; border: 4px solid transparent; border-right: 5px solid #fff; border-left: 0; }
.rpt-side-toggle.collapsed::after { left: 3px; border-right: 0; border-left: 5px solid #fff; }
.rpt-side-toggle:hover { background: var(--primary); }
.rpt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rpt-main .grid-wrap { flex: 1; min-height: 0; border-color: #e5e6eb; border-radius: 0; }
.rpt-pager { flex: none; height: 36px; line-height: 36px; text-align: right; color: #666; padding-right: 4px; }

.rpt table.grid th, .rpt table.grid td { height: 41px; border-color: #e5e6eb; }
.rpt table.grid th { background: #f2f3f5; color: #000; font-weight: 400; }
.rpt table.grid th.sortable:hover { background: #e9e9ec; }
.rpt table.grid .rn { width: 40px; background: inherit; }
.rpt table.grid th.rn { background: #f2f3f5; }
.rpt table.grid tfoot td { background: #f3f5f9; font-size: 12px; font-weight: 700; color: #111; }
.grid-wrap .gear { cursor: pointer; color: #8a8f99; }
.grid-wrap .gear svg { width: 20px; height: 20px; vertical-align: middle; }
.grid-wrap .gear:hover { color: var(--primary); }
.grid-wrap.loading { opacity: .5; }

/* ---------- 分页条 ---------- */
.pager { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 4px 4px; color: #666; font-size: 13px; }
.pager .pg-info { margin-right: 6px; }
.pager .pg-btn { min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #333; font-size: 13px; cursor: pointer; }
.pager .pg-btn.edge { border-color: transparent; background: #f2f3f5; color: #555; display: inline-flex; align-items: center; justify-content: center; }
.pager .pg-btn.edge svg { width: 14px; height: 14px; }
.pager .pg-btn:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.pager .pg-btn.cur { color: var(--primary); border-color: var(--primary); }
.pager .pg-btn:disabled { cursor: not-allowed; color: #c0c4cc; }
.pager .pg-btn.edge:disabled { background: #f7f8fa; }
.pager .pg-more { color: #999; }
.pager .pg-size { height: 28px; margin-left: 8px; padding: 0 4px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #333; }
.pager .pg-label { margin-left: 4px; }
.pager .pg-jump { width: 40px; height: 28px; border: 1px solid #dcdfe6; border-radius: 3px; text-align: center; outline: none; }
.pager .pg-jump:focus { border-color: var(--primary); }

@media print {
  .rpt-bar, .rpt-side, .rpt-side-toggle, .pager { display: none !important; }
  .panel.rpt { height: auto; }
  .rpt-main .grid-wrap { max-height: none !important; }
}

/* ---------- 锁定列、列配置弹窗 ---------- */
table.grid .lock { position: sticky; z-index: 1; background: #fff; }
table.grid th.lock, table.grid tfoot td.lock { z-index: 3; }
table.grid th.lock { background: #f7f8fa; }
.rpt table.grid th.lock { background: #f2f3f5; }
.rpt table.grid tfoot td.lock { background: #f3f5f9; }
table.grid tbody tr:hover td.lock { background: var(--row-hover); }
table.grid tbody tr.selected td.lock { background: var(--row-active); }
table.grid .lock-end { box-shadow: 3px 0 4px -2px rgba(0, 0, 0, .12); }
.col-cfg { display: flex; gap: 8px; height: 400px; }
.col-cfg-side { width: 200px; flex: none; border: 1px solid #e5e6eb; overflow: auto; }
.col-cfg-side .tree .node { height: 30px; line-height: 30px; padding-top: 0; padding-bottom: 0; border-radius: 0; }
.col-cfg-side .tree .node.active { background: #f0f3ff; color: var(--primary); }
.col-cfg-main { flex: 1; min-width: 0; border-color: #e5e6eb; border-radius: 0; }
.col-cfg-main table.grid th { background: #f2f3f5; color: #000; font-weight: 400; }
.col-cfg-main table.grid th, .col-cfg-main table.grid td { height: 42px; border-color: #e5e6eb; }
.col-cfg-main td.edit-cell { padding: 0 6px; }
.col-cfg-main td.edit-cell .input { width: 100%; height: 30px; border-color: transparent; background: transparent; }
.col-cfg-main td.edit-cell .input:hover, .col-cfg-main td.edit-cell .input:focus { border-color: var(--primary); background: #fff; }
.col-cfg-main td.drag { color: #b0b4bd; cursor: grab; }
.col-cfg-main tr.dragging td { opacity: .45; }
.col-cfg-main tr.drop td { box-shadow: inset 0 2px 0 var(--primary); }
.dialog-foot:has(.btn[style*="margin-right"]) { background: #f6f7fb; }

/* ---------- 单据格式设置弹窗 ---------- */
.fmt-cfg { display: flex; flex-direction: column; height: 560px; }
.fmt-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e6eb; margin-bottom: 12px; flex: none; }
.fmt-tabs span { padding: 0 14px 8px; cursor: pointer; color: #666; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fmt-tabs span.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.fmt-cfg .col-cfg-main { flex: 1; min-height: 0; overflow: auto; }
.fmt-cfg tbody tr { cursor: grab; }
.fmt-note { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; flex: none; }
.fmt-note a { color: var(--primary); cursor: pointer; }

/* ---------- 基础资料页（参照原系统：左侧搜索 + 分类树，右侧工具栏 + 列表/卡片） ---------- */
.arch .rpt-main { gap: 10px; }
.arch-bar { display: flex; align-items: center; gap: 12px; flex: none; }
.arch-bar .spacer { flex: 1; }
.arch-search { width: 240px; }
.arch-side { width: 250px; flex: none; display: flex; flex-direction: column; gap: 10px; }
.arch-side.collapsed { display: none; }
.arch-side .arch-search { width: 100%; flex: none; }
.arch-tree { flex: 1; min-height: 0; border: 1px solid #e5e6eb; display: flex; flex-direction: column; overflow: hidden; }
.arch-tree .rpt-side-head { display: flex; align-items: center; justify-content: space-between; }
.arch-tree-edit { font-weight: 400; color: var(--primary); cursor: pointer; font-size: 14px; }
.arch-tree-edit.on { font-size: 13px; }
.arch-tree .tree { flex: 1; overflow: auto; padding: 4px 0; min-width: 0; }
.arch-tree .tree .node { display: flex; align-items: center; height: 30px; padding-top: 0; padding-bottom: 0; border-radius: 0; }
.arch-tree .tree .node.active { background: #f0f3ff; color: var(--primary); }
.arch-tree .tree .node .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.arch-tree .tree .ops { display: none; gap: 4px; padding-right: 8px; }
.arch-tree .tree .node:hover .ops { display: flex; }
.arch-tree .tree .ops i { font-style: normal; width: 18px; height: 18px; line-height: 17px; text-align: center; border-radius: 3px; color: var(--primary); font-size: 15px; }
.arch-tree .tree .ops i:hover { background: #dfe6ff; }
.arch-tree .tree.editing .node .tx { cursor: text; }
.arch-view { font-size: 18px; color: #8a8f99; cursor: pointer; line-height: 1; }
.arch-view:hover, .arch-view.on { color: var(--primary); }
.arch .btn, .arch .input { height: 32px; }
.arch .rpt-main .grid-wrap { max-height: none !important; }
.arch table.grid th, .arch table.grid td { height: 41px; border-color: #e5e6eb; }
.arch table.grid th { background: #f2f3f5; color: #000; font-weight: 400; }
.arch table.grid th.rn { background: #f2f3f5; }
.arch table.grid .rn { width: 40px; }
.arch-thumb { display: inline-block; width: 26px; height: 26px; object-fit: cover; vertical-align: middle; border-radius: 2px; }
.arch-thumb.none { background: #f2f3f5; position: relative; }
.arch-thumb.none::after { content: ""; position: absolute; inset: 7px 6px; border: 1.5px solid #c9cdd4; border-radius: 2px; }
.arch-cards { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; align-content: start; grid-auto-rows: max-content; }
.arch-card { border: 1px solid #e5e6eb; border-radius: 6px; overflow: hidden; background: #fff; cursor: pointer; }
.arch-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.arch-card .pic { height: 150px; background: #f7f8fa; display: grid; place-items: center; }
.arch-card .pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.arch-card .nopic { color: #c0c4cc; font-size: 12px; }
.arch-card .nm { padding: 10px 12px 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-card .price, .arch-card .muted { padding: 0 12px 12px; }
.arch-card .price { color: #f53f3f; font-size: 16px; }
.arch-import h3 { text-align: center; margin: 4px 0 14px; font-size: 18px; }
.arch-import > .check { justify-content: center; display: flex; }
.arch-import > .muted { text-align: center; margin: 4px 0; }
.arch-upload { margin: 14px auto; width: 240px; height: 110px; border: 1px dashed #c9cdd4; border-radius: 6px; background: #f7f8fa; display: grid; place-items: center; color: #4e5969; cursor: pointer; text-align: center; padding: 0 10px; word-break: break-all; }
.arch-upload:hover { border-color: var(--primary); color: var(--primary); }
@media print { .arch-bar, .arch-side { display: none !important; } }
.arch table.grid tr > :last-child { position: sticky; right: 0; z-index: 1; background: #fff; box-shadow: -3px 0 4px -2px rgba(0, 0, 0, .1); }
.arch table.grid thead tr > :last-child { z-index: 3; background: #f2f3f5; }
.arch table.grid tbody tr:hover > :last-child { background: var(--row-hover); }
.arch table.grid tbody tr.selected > :last-child { background: var(--row-active); }

/* 表头说明图标（列定义 tip） */
.th-tip { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 4px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; line-height: 1; cursor: help; vertical-align: 1px; }

/* ---------- 单据审核中心（参照原系统：左侧分类、右侧条件栏 + 表格、下方审核进度） ---------- */
.ac { height: calc(100vh - var(--header-h) - var(--tab-h) - var(--page-pad) * 2); min-height: 420px; display: flex; gap: 10px; }
.ac-card { background: var(--panel); border-radius: 8px; }
.ac-side { width: 165px; flex: none; padding: 12px 8px; overflow: auto; }
.ac-side .tree { min-width: 0; }
.ac-side .tree .node { height: 30px; line-height: 30px; padding: 0 8px 0 40px; border-radius: 0; }
.ac-side .tree .node.ac-group { padding-left: 4px; cursor: default; background: none; color: var(--text); }
.ac-side .tree .node.active { background: #f0f3ff; color: var(--primary); }
.ac-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-main { flex: 1; min-height: 0; padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 14px; }
.ac-main .rpt-main { flex: 1; min-height: 0; }
.ac-main .rpt-main .grid-wrap { max-height: none !important; }
.ac-set { flex: none; }
.ac-split { flex: none; align-self: center; width: 50px; height: 8px; margin: 3px 0 9px; border-radius: 0 0 5px 5px; background: #d9dbe3; cursor: pointer; position: relative; }
.ac-split::after { content: ""; position: absolute; left: 50%; top: 1px; margin-left: -5px; border: 5px solid transparent; border-top: 5px solid #fff; border-bottom: 0; }
.ac-split.collapsed::after { top: 1px; border-top: 0; border-bottom: 5px solid #fff; }
.ac-split:hover { background: var(--primary); }
.ac-flow { flex: none; height: 170px; padding: 16px 22px; overflow: auto; }
.ac-flow.collapsed { display: none; }
.ac-flow-title { font-size: 16px; margin-bottom: 12px; }
.ac-flow-body { display: flex; flex-direction: column; gap: 10px; }
.ac-log { align-self: flex-start; border-collapse: collapse; font-size: 13px; }
.ac-log th, .ac-log td { padding: 4px 16px 4px 0; text-align: left; white-space: nowrap; }
.ac-log th { color: var(--text-2); font-weight: 400; }

/* ---------- 单据列表（参照原系统） ---------- */
.bl-status { width: 92px; }
.bl-search .input { width: 200px; }
.rpt-right .spacer:empty { display: none; }

/* 下拉多选 */
.select.ms { display: flex; align-items: center; min-height: 32px; cursor: pointer; overflow: hidden; }
.ms-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-pop.ms-pop { max-height: 240px; overflow: auto; padding: 4px 0; z-index: 1100; }
.kp-pop.ms-pop .ms-item { display: flex; margin: 0; padding: 4px 10px; cursor: pointer; }
.ms-item:hover { background: #f5f6f8; }

/* ---------- 操作员权限（参照原系统：操作员、角色两页） ---------- */
.panel.op { display: flex; flex-direction: column; }
.op-title { text-align: center; margin: 0 0 6px; font-size: 18px; flex: none; }
.op .fmt-tabs { margin-bottom: 10px; }
.op-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.op-bar { display: flex; justify-content: flex-end; margin-bottom: 10px; flex: none; }
.op-roles { flex-direction: row; gap: 10px; }
.op-tree { width: 210px; flex: none; }
.op-matrix-box { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.op-matrix { flex: 1; min-height: 0; max-height: none; overflow: auto; border-color: #e5e6eb; border-radius: 0; }
.op-matrix table.grid th { position: sticky; top: 0; z-index: 2; }
.op-matrix td.op-mod { vertical-align: top; }
.op-detail .check { margin-right: 14px; }
.op-req { color: var(--danger); margin-right: 2px; }
.op-form .rpt-fi { grid-template-columns: 64px 1fr; }
.op-form .rpt-fi .input, .op-form .rpt-fi .select { height: 32px; }
.op-direct { margin: 0 0 4px 76px; }
.op-direct a { color: var(--primary); cursor: pointer; }

/* ---------- 单据审核设置（参照原系统：左侧单据树，右侧审核级次，底部保存/取消） ---------- */
.aus { height: calc(100vh - var(--header-h) - var(--tab-h) - var(--page-pad) * 2); min-height: 420px; display: flex; flex-direction: column; gap: 10px; }
.aus-body { flex: 1; min-height: 0; display: flex; gap: 10px; }
.aus-side { width: 200px; flex: none; padding: 10px 8px; overflow: auto; }
.aus-side .tree { min-width: 0; }
.aus-side .tree .node { height: 30px; line-height: 30px; padding: 0 8px 0 22px; border-radius: 0; }
.aus-side .tree .node.active { background: #f0f3ff; color: var(--primary); }
.aus-side .tree .node.ac-group { padding-left: 4px; cursor: default; background: none; color: var(--text); }
.aus-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f53f3f; margin-right: 8px; vertical-align: 1px; }
.aus-dot.on { background: #00b42a; }
.aus-right { flex: 1; min-width: 0; padding: 14px 16px; overflow: auto; }
.aus-main { display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.aus-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.aus-level { border: 1px solid #e5e6eb; border-radius: 6px; padding: 14px 16px; }
.aus-level-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; }
.aus-row { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.aus-label { width: 56px; flex: none; text-align: right; color: var(--text-2); }
.aus-who { margin-left: 40px; }
.aus-users { width: 280px; }
.aus-cond { width: 100%; margin-top: 4px; }
.aus-cond th { background: #f2f3f5; font-weight: 400; color: #000; text-align: center; }
.aus-cond td { padding: 2px 4px; }
.aus-cond .input, .aus-cond .select { width: 100%; height: 30px; }
.aus-foot { flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 8px 16px; background: var(--panel); border-radius: 8px; }
.kp-switch { position: relative; display: inline-block; width: 40px; height: 20px; border-radius: 10px; background: #c9cdd4; cursor: pointer; transition: background .15s; }
.kp-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.kp-switch.on { background: var(--primary); }
.kp-switch.on::after { left: 22px; }

/* 单据格式设置：左侧单据树 */
.fmt-wrap { display: flex; gap: 10px; height: 560px; }
.fmt-side { flex: none; width: 190px; }
.fmt-wrap .fmt-cfg { flex: 1; min-width: 0; height: auto; }
.fmt-tabs .fmt-add { margin-left: auto; color: var(--primary); cursor: pointer; font-size: 13px; }
.fmt-side .tree .node.ac-group { padding-left: 4px; cursor: default; background: none; color: var(--text); }

/* 系统重建 */
.rb-note { padding: 12px 16px; line-height: 1.9; background: #f4f5fa; border: 1px dashed #c9cdd4; border-radius: 4px; }
.rb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 14px 16px 0; }

/* 版本信息 */
.ver-head { display: flex; align-items: baseline; gap: 12px; padding: 4px 0 12px; border-bottom: 1px solid #e5e6eb; }
.ver-head b { font-size: 16px; }
.ver-cur { color: var(--primary); }
.ver-list { max-height: 420px; overflow: auto; padding-top: 4px; }
.ver-item { padding: 10px 0; border-bottom: 1px dashed #e5e6eb; }
.ver-item:last-child { border-bottom: 0; }
.ver-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ver-item ul { margin: 0; padding-left: 20px; line-height: 1.9; }

/* 系统设置（参照原系统实测：卡片圆角 8、间距 16；标签 100 + 输入框 268，三列共 384 一列；行高 32 行距 10） */
.set-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.set-card { background: var(--panel); border-radius: 8px; padding: 28px 15px 34px; flex: none; }
.set-title { display: flex; align-items: center; gap: 4px; line-height: 19px; color: #111; margin-bottom: 28px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, 376px); gap: 10px 8px; }
.set-fi { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; }
.set-fi.wide { grid-column: span 2; }
.set-fi > label { text-align: right; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-fi .input, .set-fi .select { width: 100%; height: 32px; }
.set-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.set-stack .set-fi { grid-template-columns: 100px minmax(0, 268px); }
.set-stack .set-fi.free { grid-template-columns: 100px minmax(0, 1fr); }
.set-radios { display: flex; flex-wrap: wrap; gap: 8px 20px; }
table.set-codes { width: 540px; table-layout: fixed; border-collapse: collapse; }
.set-codes th { width: 60px; height: 34px; font-weight: 400; background: #f2f3f5; border: 1px solid #e5e6eb; }
.set-codes td { padding: 0; border: 1px solid #e5e6eb; background: #fff; }
.set-codes .input { display: block; width: 100%; height: 34px; border: 0; border-radius: 0; text-align: center; }
.set-codes .input[readonly] { background: #f7f8fa; color: #86909c; }
.set-biz { display: flex; flex-direction: column; gap: 16px; padding-left: 72px; }
.set-biz-row { display: flex; align-items: center; gap: 12px; min-height: 20px; }
.set-biz-row > label.tx { width: 84px; flex: none; }
.set-biz-row .select { width: 168px; height: 32px; }
.set-tax { display: inline-flex; align-items: center; gap: 8px; margin-left: 170px; }
.set-tax .input { width: 138px; height: 32px; }
.set-sub { display: inline-flex; align-items: center; margin-left: 40px; }
.set-checks3 { display: grid; grid-template-columns: repeat(auto-fill, 376px); gap: 14px 8px; padding-left: 110px; }
.set-note { padding: 18px 0 0 110px; color: var(--text); }
.set-tip { display: inline-block; width: 14px; height: 14px; line-height: 13px; margin-left: 2px; border: 1px solid #c9cdd4; border-radius: 50%; color: #86909c; font-size: 11px; text-align: center; cursor: help; }
.set-other .set-fi { grid-template-columns: 112px minmax(0, 1fr); }
.set-other .set-checks { display: flex; flex-direction: column; gap: 14px; padding: 0 0 14px 72px; }

/* 期初财务、现金流量期初（参照原系统） */
.panel.fo { display: flex; flex-direction: column; }
.fo-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex: none; }
.fo-bar .spacer { flex: 1; }
.fo-tip { padding: 5px 10px; color: #d9730d; background: #fff7ec; border: 1px solid #f7c48a; border-radius: 3px; font-size: 12px; }
.fo-grid { flex: 1; min-height: 0; max-height: none !important; overflow: auto; border-color: #e5e6eb; border-radius: 0; }
.fo table.grid { table-layout: fixed; width: auto; }
.fo table.grid th { position: sticky; top: 0; z-index: 2; background: #f2f3f5; color: #000; font-weight: 400; text-align: center; }
.fo table.fo-subject thead tr:nth-child(2) th { top: 41px; }
.fo table.fo-subject th:nth-child(2) { width: 110px; }
.fo table.fo-subject thead tr:first-child th:nth-child(3) { width: 180px; }
.fo table.fo-subject thead tr:first-child th:nth-child(4) { width: 76px; }
.fo table.fo-subject thead tr:first-child th:nth-child(5), .fo table.fo-subject thead tr:first-child th:nth-child(7), .fo table.fo-subject thead tr:first-child th:nth-child(8) { width: 130px; }
.fo table.fo-subject thead tr:nth-child(2) th { width: 110px; }
.fo table.grid .rn { width: 44px; }
.fo tr.fo-parent td { background: #f7f8fa; font-weight: 600; }
.fo td.edit-cell { padding: 0 4px; }
.fo-num { width: 100%; height: 30px; text-align: right; }
.fo-result { text-align: center; margin-bottom: 12px; font-size: 14px; }
.fo-result.ok { color: #00b42a; }
.fo-result.bad { color: #f53f3f; }
.fo-trial { width: 100%; }
.fo-trial th { background: #f2f3f5; font-weight: 600; text-align: center; }
.fo-trial td { vertical-align: top; padding: 10px 12px; line-height: 1.9; height: auto; white-space: normal; }
.fo-sum { color: var(--primary); margin-top: 18px; }
.fo-trial td.fo-diff { color: #f53f3f; padding: 4px 12px; }
@media print { .fo-bar { display: none !important; } .fo-grid { max-height: none !important; overflow: visible; } }

/* 成本计算（参照原系统：进度条 + 结果框） */
.cc-bar { height: 16px; border-radius: 8px; background: #e5e6eb; overflow: hidden; position: relative; }
.cc-fill { height: 100%; width: 30%; background: var(--primary); border-radius: 8px; transition: width .3s; color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
.cc-hint { margin-right: auto; align-self: center; color: #999; font-size: 12px; }
.cc-single .fi { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.cc-single .fi .ref { flex: 1; }
.cc-log {margin-top: 12px; height: 460px; padding: 12px; overflow: auto; border: 1px solid #dcdfe6; border-radius: 4px; white-space: pre-wrap; line-height: 1.7; }

.cc-products { margin-top: 10px; }
.cc-product { border-top: 1px solid #e5e6eb; padding: 6px 0; }
.cc-product > summary { cursor: pointer; font-weight: 600; }
.cc-product > summary span { font-weight: 400; color: var(--text-2); margin-left: 10px; }
.cc-note { color: var(--text-2); padding: 4px 0; }
.cc-steps { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; white-space: nowrap; }
.cc-steps th, .cc-steps td { border: 1px solid #e5e6eb; padding: 3px 6px; }
.cc-steps th { background: #f2f3f5; font-weight: 400; }
.cc-steps td.num { text-align: right; }
.cc-steps tr.changed td { background: #fff7ec; }

/* 工作台（派工、工序委外） */
.wd-root { height: 100%; margin: 0; display: flex; flex-direction: column; min-height: 420px; box-sizing: border-box; }
.wd-head { flex: none; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.wd-tabs { flex: 1; border-bottom: 0; margin-bottom: 0; }
.wd-tabs-right { flex: none; display: flex; gap: 16px; padding-bottom: 8px; }
.wd-tabs-right a { color: var(--text); cursor: pointer; }
.wd-tabs-right a:hover { color: var(--primary); }
.wd-body, .wd-col { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wd-toolbar { flex: none; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wd-toolbar.in { flex-wrap: nowrap; }
.wd-toolbar .spacer, .wd-pick-head .spacer, .wd-rep .spacer, .wd-route .spacer, .wd-group .spacer, .wd-side-head .spacer { flex: 1; }
.wd-filter { flex: none; margin-bottom: 8px; }
.wd-search { position: relative; flex: none; max-width: 100%; }
.wd-search .input { width: 100%; padding-right: 28px; box-sizing: border-box; }
.wd-search .ico { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-2); cursor: pointer; display: flex; }
.wd-search .ico svg { width: 15px; height: 15px; }
.wd-ref { width: 170px; flex: none; }
.wd-ref > * { width: 100%; }
.wd-grid { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.wd-grid .grid-wrap { flex: 1; min-height: 0; max-height: none !important; }
.wd-gridfoot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wd-gridfoot .pager { flex: 1; }
.wd-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; }
.wd-blank { flex: 1; height: 100%; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.wd-blank i { width: 72px; height: 52px; border-radius: 6px; background: linear-gradient(135deg, #dfe7fb, #f1f4fc); }
.wd-trash { flex: none; color: var(--muted); cursor: pointer; display: inline-flex; }
.wd-trash:hover { color: var(--danger); }
.wd-trash svg { width: 16px; height: 16px; }
.wd-tag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; font-size: 11px; margin-left: 4px; vertical-align: middle; font-weight: 400; }
.wd-tag.urgent { background: var(--danger); color: #fff; }
.wd-tag.overdue { background: #ffece8; color: var(--danger); }
.wd-tag.refill { background: #fff3e0; color: var(--warn); }
.wd-fold { flex: none; display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 12px; margin: 4px 0 8px; }
.wd-fold::before, .wd-fold::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.wd-fold span { cursor: pointer; }
.wd-fold span:hover { color: var(--primary); }

/* 总览工序卡片 */
.wd-cards { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: 106px; overflow: hidden; }
.wd-cards.open { max-height: 228px; overflow: auto; }
.wd-card { position: relative; height: 106px; box-sizing: border-box; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 22px 12px 8px; }
.wd-card-tag { position: absolute; left: 0; top: 0; padding: 1px 12px 1px 8px; color: #fff; font-size: 12px; border-radius: 6px 0 12px 0; }
.wd-card-tag.green { background: #36b37e; }
.wd-card-tag.red { background: #e5606d; }
.wd-card-tag.purple { background: #8567e0; }
.wd-card-tag.blue { background: var(--primary); }
.wd-card .cnt { flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-right: 1px solid var(--border); padding-right: 10px; }
.wd-card .cnt b { font-size: 22px; font-weight: 600; }
.wd-card .cnt span { color: var(--muted); font-size: 12px; text-align: center; }
.wd-card .det { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.wd-card .det em { font-style: normal; color: var(--text); }
.wd-card .det em.ok { color: #36b37e; }
.wd-card .det em.bad { color: var(--danger); }
.wd-card .prog { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.wd-card .prog i { flex: 1; height: 5px; border-radius: 3px; background: #eef0f4; overflow: hidden; }
.wd-card .prog u { display: block; height: 100%; background: var(--primary); }
.grid td .route-chain { margin: 2px 0; }

/* 生产进度节点（kp.progressChain，参照原系统：70×32 圆角，灰 未开始 / 蓝 进行中 / 绿 已完成 / 红 已超期） */
.kp-prog { display: flex; align-items: flex-start; padding: 4px 0 2px; }
.kp-prog-node { display: flex; flex-direction: column; align-items: center; flex: none; width: 74px; cursor: default; }
.kp-prog-node .pill { position: relative; width: 64px; height: 28px; box-sizing: border-box; border: 3px solid #d4d7e2; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: #111; }
.kp-prog-node.doing .pill { border-color: #2e51ff; }
.kp-prog-node.overdue .pill { border-color: #ef3636; }
.kp-prog-node.finish .pill { border-color: #08bf3f; color: #08bf3f; font-size: 14px; }
.kp-prog-node .pill .ww { position: absolute; top: -9px; right: -9px; width: 16px; height: 16px; border-radius: 50%; background: #8f5cf7; color: #fff; font-size: 10px; font-style: normal; line-height: 16px; text-align: center; }
.kp-prog-node .name { max-width: 74px; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-prog-link { flex: none; width: 16px; height: 0; margin: 14px -2px 0; border-bottom: 2px solid #bbb; }
.grid td .kp-prog, .grid.edit td .cell:has(.kp-prog) { height: auto; }
table.edit td .cell:has(.kp-prog) { min-height: 34px; padding: 2px 8px; }
.kp-prog-card { position: fixed; z-index: 3000; min-width: 150px; padding: 10px 12px; background: #fff; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); font-size: 12px; line-height: 22px; color: var(--text); }
.kp-prog-card .title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.kp-prog-card .btn { width: 100%; margin-top: 6px; }

/* 待派工 */
.wd-top { flex: 1 1 45%; min-height: 150px; display: flex; flex-direction: column; }
.wd-split { flex: none; height: 16px; margin: 2px 0 6px; border-bottom: 1px solid var(--primary); text-align: center; cursor: pointer; }
.wd-split span { display: inline-block; width: 32px; height: 16px; line-height: 16px; border-radius: 3px 3px 0 0; background: #e3eaff; color: var(--primary); font-size: 11px; }
.wd-routes { flex: 1 1 55%; min-height: 150px; overflow: auto; }
.wd-route { border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: 4px; margin-bottom: 10px; }
.wd-route > .hd { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.wd-route > .hd b { margin-left: 24px; font-weight: 500; }
.wd-route > .procs { display: flex; gap: 12px; padding: 10px 12px; overflow-x: auto; }
.wd-proc { flex: none; width: 260px; border-radius: 4px; background: #f4f5f7; }
.wd-proc .hd { display: flex; justify-content: space-between; align-items: center; height: 36px; padding: 0 10px; border-radius: 4px 4px 0 0; background: var(--primary); color: #fff; font-weight: 600; }
.wd-proc.done .hd { background: #36b37e; }
.wd-proc .hd i { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border: 1px solid #fff; border-radius: 50%; font-size: 12px; font-style: normal; }
.wd-proc .bd { min-height: 56px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 12px 10px; }
.wd-proc .emp { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 4px; background: #fff; border: 1px solid var(--border); font-size: 12px; }
.wd-proc .emp u { text-decoration: none; color: var(--muted); cursor: pointer; }
.wd-proc .emp u:hover { color: var(--danger); }
.wd-rep .add, .wd-proc .add { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px dashed var(--primary); border-radius: 4px; color: var(--primary); font-size: 18px; cursor: pointer; background: #fff; }
.wd-proc .ft { position: relative; padding: 0 10px 10px; }
.wd-proc .ft .input { width: 100%; box-sizing: border-box; background: #fff; }
.wd-proc .ft .copy { display: none; position: absolute; right: 12px; top: -18px; color: var(--primary); cursor: pointer; }
.wd-proc .ft:hover .copy { display: block; }

/* 人员 / 单位选择弹窗 */
.wd-pick-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wd-pick-info { margin-right: auto; align-self: center; }
.wd-pick-info a { cursor: pointer; }
.wd-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wd-picks.one { grid-template-columns: 1fr; }
.wd-pick { position: relative; border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; cursor: pointer; overflow: hidden; }
.wd-pick:hover { border-color: #9db8ff; }
.wd-pick.on { border-color: var(--primary); }
.wd-pick.on::after { content: "✓"; position: absolute; right: 0; top: 0; width: 18px; height: 18px; line-height: 14px; text-align: right; padding-right: 2px; box-sizing: border-box; color: #fff; font-size: 10px; background: linear-gradient(45deg, transparent 50%, var(--primary) 50%); }
.wd-pick .n { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.wd-pick-tag { padding: 0 4px; border-radius: 2px; background: #e3eaff; color: var(--primary); font-size: 12px; white-space: nowrap; }
.wd-pick-tag.recent { background: #fff3e0; color: var(--warn); }
.wd-pick .d { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.wd-pick .d em { font-style: normal; color: var(--primary); }
.wd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.wd-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; background: #f6f7fb; border-radius: 4px; color: var(--text-2); font-size: 12px; }
.wd-stat b { font-size: 20px; font-weight: 500; color: var(--text); }
.wd-stat b.ok { color: #36b37e; }
.wd-stat b.bad { color: var(--danger); }
.wd-table { width: 100%; border-collapse: collapse; }
.wd-table th { background: #f2f4f8; font-weight: 500; }
.wd-table th, .wd-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.wd-table td .input { width: 100%; box-sizing: border-box; }
.wd-table a { cursor: pointer; }
.wd-proc-sec { padding: 12px 14px; border: 1px solid var(--border); min-height: 96px; }
.wd-proc-sec.alt { background: #f6f7fb; border-top: 0; }
.wd-proc-sec .tt { margin-bottom: 10px; color: var(--text-2); font-size: 12px; }
.wd-proc-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.wd-proc-chip { padding: 5px 10px; border: 1px solid var(--border); border-radius: 3px; background: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-proc-chip:hover { border-color: var(--primary); color: var(--primary); }
.wd-proc-chip i { margin-right: 6px; font-style: normal; color: var(--muted); }

/* 待报工 / 待下达：左列表 + 右明细 */
.wd-chips { flex: none; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.wd-chip { flex: none; padding: 3px 14px; border-radius: 12px; background: #f2f4f8; color: var(--text-2); cursor: pointer; }
.wd-chip.on { background: var(--primary); color: #fff; }
.wd-chip.on.sm { padding: 0 8px; border-radius: 3px; background: #e3eaff; color: var(--primary); cursor: default; }
.wd-rep-body { flex: 1; min-height: 0; display: flex; gap: 8px; }
.wd-side { flex: none; width: 340px; display: flex; flex-direction: column; min-height: 0; }
.wd-side .wd-search { flex: 1; width: auto !important; }
.wd-side-head { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: #f2f4f8; cursor: pointer; }
.wd-side-head .sort { color: var(--primary); cursor: pointer; }
.wd-list { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-top: 0; }
.wd-toolbar.in + .wd-list { border-top: 1px solid var(--border); }
.wd-group { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: #f2f4f8; color: var(--primary); }
.wd-group .fold { cursor: pointer; color: var(--text-2); }
.wd-item { display: flex; gap: 8px; padding: 8px 12px; cursor: pointer; }
.wd-item:hover, .wd-item.on { background: #f0f4ff; }
.wd-item .tx { flex: 1; min-width: 0; }
.wd-item .sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--text-2); font-size: 12px; }
.wd-work { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; }
.wd-rep { flex: none; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 10px; }
.wd-rep > .hd { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #eef1fb; flex-wrap: wrap; }
.wd-rep > .hd > b { margin-left: 20px; font-weight: 500; }
.wd-rep b.over { color: var(--danger); }
.wd-rep .people { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px; }
.wd-person { width: 300px; padding: 8px; background: #f6f7fb; border-radius: 4px; }
.wd-person .who { display: flex; align-items: center; margin-bottom: 8px; border: 1px solid var(--border); background: #fff; }
.wd-person .who > span { flex: none; padding: 5px 8px; background: #f2f4f8; border-right: 1px solid var(--border); font-size: 12px; }
.wd-person .who .name { flex: 1; display: flex; justify-content: space-between; padding: 0 8px; min-width: 0; }
.wd-person .who u { text-decoration: none; color: var(--muted); cursor: pointer; }
.wd-person .cells { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.wd-person .cell { display: flex; align-items: center; border: 1px solid var(--border); background: #fff; }
.wd-person .cell.wide { grid-column: 1 / -1; }
.wd-person .cell > span { flex: none; width: 46px; padding: 5px 0; text-align: center; background: #f2f4f8; border-right: 1px solid var(--border); font-size: 12px; }
.wd-person .cell.wide > span { width: 76px; }
.wd-person .cell .input, .wd-person .cell .select { flex: 1; min-width: 0; width: 100%; border: 0; height: 28px; box-sizing: border-box; }
.wd-supplier { width: 220px; padding: 8px; background: #f6f7fb; border-radius: 4px; }
.wd-supplier .n { display: flex; justify-content: space-between; margin-bottom: 6px; }
.wd-supplier u { text-decoration: none; color: var(--muted); cursor: pointer; }
.wd-supplier label { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; }
.wd-num { width: 100%; height: 26px; box-sizing: border-box; }
.wd-person .cell .calc-field, .wd-supplier label .calc-field { flex: 1; min-width: 0; }

/* 独立标签页页面 */
.page-standalone { height: 100vh; overflow: auto; }

/* 智造报工台：字体沿用系统规范（正文 14px，次要文字 --text-2，仅标题加粗，标签同 .badge 12px） */
.rd-root { height: 100%; display: flex; flex-direction: column; background: #f5f7fa; min-width: 960px; }
.rd-top { flex: none; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: #0f2557; color: #fff; }
.rd-title { font-size: 16px; font-weight: 700; margin-right: 12px; }
.rd-emp { width: 142px; }
.rd-emp .input { color: var(--text); background: #fff; }
.rd-clock { margin-left: auto; }
.rd-scan { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--primary); border-radius: 2px; cursor: pointer; background: var(--primary); color: #fff; }
.rd-scan svg { width: 16px; height: 16px; }
.rd-top .rd-scan { background: #fff; color: var(--primary); }

.rd-body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px; }
.rd-left, .rd-right { background: #fff; border-radius: 6px; min-height: 0; display: flex; flex-direction: column; }
.rd-left { flex: 1; min-width: 0; padding: 12px; }
.rd-right { flex: none; width: 490px; }

.rd-chips { flex: none; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.rd-chip { flex: none; min-width: 44px; padding: 0 12px; height: 26px; line-height: 26px; text-align: center; border-radius: 13px; background: #f5f6f8; cursor: pointer; }
.rd-chip:hover { color: var(--primary); }
.rd-chip.active, .rd-chip.active:hover { background: var(--primary); color: #fff; }

.rd-bar { flex: none; display: flex; align-items: center; gap: 4px; padding: 14px 0; }
.rd-search { position: relative; width: 200px; margin-left: auto; }
.rd-search .input { width: 100%; height: 30px; padding-right: 24px; box-sizing: border-box; }
.rd-search svg { position: absolute; right: 7px; top: 8px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }

.rd-cards { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; align-content: start; padding: 2px; }
.rd-card { padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; background: #fff; }
.rd-card:hover { border-color: var(--primary-hover); }
.rd-card.active { border-color: var(--primary); background: #fafafa; }
.rd-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rd-tag { flex: none; padding: 0 6px; border-radius: 3px; font-size: 12px; line-height: 18px; background: var(--primary); color: #fff; }
.rd-no { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-name { margin-top: 8px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-spec { margin-top: 2px; color: var(--text-2); min-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-prog { height: 6px; margin-top: 6px; border-radius: 3px; background: #e8eaf4; overflow: hidden; }
.rd-prog i { display: block; height: 100%; background: var(--primary); }
.rd-qty { display: flex; justify-content: space-between; margin-top: 8px; }
.rd-cards .empty { grid-column: 1 / -1; }

.rd-form { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; }
.rd-form > .empty { padding-top: 120px; }
.rd-form-title { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); }
.rd-form-title b { color: var(--primary); }
.rd-info { display: flex; gap: 6px; margin-top: 6px; }
.rd-info span { flex: none; width: 72px; text-align: right; color: var(--text-2); }
.rd-info b { font-weight: 400; }
.rd-sub { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.rd-sub a { cursor: pointer; }
.rd-total { margin-left: auto; }
.rd-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.rd-row > label { flex: none; width: 72px; text-align: right; white-space: nowrap; color: var(--text-2); }
.rd-row > :not(label) { flex: 1; min-width: 0; }
.rd-row .input, .rd-row .select { width: 100%; box-sizing: border-box; }
.rd-qty-row > label { height: 28px; line-height: 28px; text-align: center; border-radius: 3px; }
.rd-qty-row .input { height: 44px; }
.rd-good > label { background: #e8f8f1; color: #00a870; }
.rd-scrap > label { background: #fdecee; color: #e34d59; }
.rd-rework > label { background: #fff3e8; color: #ed7b2f; }
.rd-more { margin-top: 10px; text-align: right; }
.rd-more a { cursor: pointer; }
.rd-wage { color: var(--primary); font-weight: 400; }
.rd-foot { flex: none; display: flex; justify-content: flex-end; gap: 12px; padding: 12px 24px; box-shadow: 0 -2px 6px rgba(0, 0, 0, .06); }
.rd-detail { width: 100%; border-collapse: collapse; }
.rd-detail td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.rd-detail td:last-child { text-align: right; }

/* ---------- 打印：下拉菜单（打印样式子菜单）与模板设计器 ---------- */
.kp-pop.pm { min-width: 140px; }
.pm-has-sub { position: relative; display: flex; align-items: center; }
.pm-arrow { margin-left: auto; padding-left: 16px; color: #999; }
.kp-pop.pm-sub { position: absolute; left: 100%; top: -4px; display: none; min-width: 160px; }
.pm-has-sub:hover > .pm-sub { display: block; }
.pm-has-sub.pm-left > .pm-sub { left: auto; right: 100%; } /* 打印按钮靠右、右侧放不下时向左展开 */
.pm-check { display: inline-block; width: 16px; color: var(--primary); }
/* 右键菜单：快捷键提示、勾选、禁用、子菜单 */
.kp-pop.cm { min-width: 150px; font-size: 13px; z-index: 1200; }
.cm .kp-menu-item { display: flex; align-items: center; padding: 5px 14px; position: relative; }
.cm .kp-menu-item.disabled { color: #c0c4cc; cursor: default; background: none; }
.cm-check { width: 18px; flex: none; color: var(--primary); }
.cm-key { margin-left: auto; padding-left: 24px; color: #999; font-size: 12px; }
.cm-arrow { margin-left: auto; padding-left: 20px; color: #999; }
.cm-key + .cm-arrow { margin-left: 0; }
.kp-pop.cm-sub { position: absolute; left: 100%; top: -4px; display: none; }
.kp-pop.cm-sub.left { left: auto; right: 100%; }
.cm-has-sub:hover > .cm-sub { display: block; }
.pd-dialog { height: calc(100vh - 40px); max-height: none; }
.pd-dialog .dialog-body { display: flex; padding: 10px 14px; overflow: hidden; }
.pd-dialog .dialog-foot { padding: 8px 16px; }
.pd { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.pd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pd-bar .select { height: 28px; }
.pd-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.pd-edit { display: flex; gap: 8px; align-items: center; }
.pd-name { flex: none; min-width: 120px; height: 30px; line-height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: #f6f7fb; color: #333; font-size: 12px; white-space: nowrap; }
.pd-text { flex: 1; min-height: 30px; resize: vertical; font-family: inherit; }
.pd-main { flex: 1; display: flex; gap: 10px; min-height: 0; }
.pd-cwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.pd-cbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #f6f7fb; border-bottom: 1px solid var(--border); font-size: 12px; white-space: nowrap; }
.pd-cbar .btn.sm { min-width: 26px; }
.pd-zoomv { width: 44px; text-align: center; cursor: pointer; }
.pd-keys { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pd-canvas { flex: 1; overflow: auto; background: #e9ebf0; padding: 16px; }
.pd.pd-cmax > .pd-bar, .pd.pd-cmax .pd-panel { display: none; }
.pd-paper { position: relative; background: #fff; display: inline-block; padding: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.pd-selbox { position: absolute; border: 2px solid var(--primary); pointer-events: none; z-index: 3; box-sizing: border-box; }
.pd-dialog .dialog-head .x { font-size: 18px; }
.pd-grid { border-collapse: collapse; table-layout: fixed; font-family: SimSun, "Microsoft YaHei", sans-serif; }
.pd-grid td { border: 1px dashed #d5d9e0; padding: 0 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: cell; }
.pd-grid td.bd { border: 1px solid #333; }
.pd-grid td.sel { outline: 1px solid var(--primary); outline-offset: -2px; }
.pd-colw td { border: 0; background: #f6f7fb; padding: 2px; cursor: default; }
.pd-colw td.on { background: #e1e8ff; }
.pd-corner { font-size: 12px; color: #999; text-align: center; white-space: nowrap; }
.pd-grid td.pd-all { cursor: pointer; background: #eef0f5; border: 0; }
.pd-grid td.pd-all:hover { color: var(--primary); }
.pd-grid .pd-colh td, .pd-grid .pd-colw td, .pd-grid .pd-rowh { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
.pd-num::-webkit-inner-spin-button, .pd-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pd-num { -moz-appearance: textfield; }
.pd-colh td.pd-ch { position: relative; height: 22px; text-align: center; font-size: 12px; color: #666; background: #eef0f5; border: 1px solid #dcdfe6; cursor: s-resize; }
.pd-colh td.pd-ch.on { background: #dbe4ff; color: var(--primary); }
.pd-colh td.pd-ch.full { background: var(--primary); color: #fff; }
.pd-grid .pd-colh td.pd-ch, .pd-grid td.pd-rowh { overflow: visible; }
.pd-rz { position: absolute; z-index: 2; }
.pd-rz.col { top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }
.pd-rz.row { left: 0; bottom: -3px; height: 6px; width: 100%; cursor: row-resize; }
.pd-rz:hover { background: rgba(64, 128, 255, .35); }
.pd-rztip { position: fixed; z-index: 2000; background: #333; color: #fff; font-size: 12px; padding: 2px 6px; border-radius: 3px; pointer-events: none; }
body.row-rzing, body.row-rzing * { cursor: row-resize !important; user-select: none; }
.pd-rno { display: inline-block; width: 22px; text-align: center; color: #666; cursor: e-resize; }
.pd-row.full .pd-rowh { background: var(--primary); }
.pd-row.full .pd-rowh .pd-rno { color: #fff; }
.pd-num { width: 100%; border: 1px solid transparent; background: transparent; font-size: 12px; text-align: center; padding: 0; }
.pd-num:hover, .pd-num:focus { border-color: var(--border); background: #fff; }
.pd-rowh { background: #f6f7fb; border: 0 !important; cursor: default !important; font-size: 12px; position: relative; white-space: nowrap; }
.pd-rowh .pd-num { width: 38px; }
.pd-row.on .pd-rowh { background: #e1e8ff; }
.pd-area { display: inline-block; width: 28px; line-height: 18px; text-align: center; border-radius: 3px; color: #fff; margin-right: 2px; }
.pd-area.head { background: #5b8ff9; } .pd-area.detail { background: #f6903d; } .pd-area.foot { background: #61ddaa; }
.pd-area.ghead, .pd-area.gfoot { background: #9661bc; }
.pd-row.ghead td.pd-cell, .pd-row.gfoot td.pd-cell { background-image: linear-gradient(rgba(150, 97, 188, .07), rgba(150, 97, 188, .07)); }
.pd-grid td.insel { background-color: #dfe7ff; }
.pd-grid td.sel.insel { background-color: #fff; } /* 活动格：选区内留白，与 Excel 一致 */
.pd-grid td { user-select: none; }
/* 拖选单元格时不选中表头文字、列宽/行高数字（输入框获得焦点编辑时仍可选中） */
.pd-paper, .pd-paper * { user-select: none; -webkit-user-select: none; }
.pd-paper input:focus { user-select: text; -webkit-user-select: text; }
.pd-b { font-weight: bold; } .pd-i { font-style: italic; } .pd-u { text-decoration: underline; }
.pd-clr { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-weight: bold; }
.pd-color { width: 22px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; }
.pd-subtabs { gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.pd-stab { padding: 4px 14px; cursor: pointer; color: #666; }
.pd-stab.on { color: var(--primary); border-bottom: 2px solid var(--primary); }
.pd-sortrow { display: flex; gap: 6px; align-items: center; }
.pd-sortrow .select { flex: 1; min-width: 0; }
.pd-sortrow a { cursor: pointer; color: var(--primary); padding: 0 2px; }
.pd-sortrow a.danger { color: #f53f3f; }
.pd-row.detail td.pd-cell { background-image: linear-gradient(rgba(246, 144, 61, .07), rgba(246, 144, 61, .07)); }
.pd-tk { color: #1d5fe0; font-weight: normal; }
.pd-tag { font-size: 12px; background: #333; color: #fff; padding: 0 3px; margin-right: 3px; border-radius: 2px; }
.pd-panel { width: 330px; flex: none; border: 1px solid var(--border); border-radius: 4px; display: flex; flex-direction: column; min-height: 0; }
.pd-tabs { display: flex; border-bottom: 1px solid var(--border); }
.pd-tab { flex: 1; text-align: center; padding: 8px 0; cursor: pointer; color: #666; font-size: 13px; white-space: nowrap; }
.pd-tab.on { color: var(--primary); border-bottom: 2px solid var(--primary); }
.pd-pbody { flex: 1; overflow: auto; padding: 10px 12px; }
.pd-kinds { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pd-fields { border: 1px solid var(--border); border-radius: 4px; max-height: 320px; overflow: auto; }
.pd-field { padding: 5px 10px; cursor: pointer; display: flex; }
.pd-field:hover { background: #f2f5ff; }
.pd-ins { margin-left: auto; color: var(--primary); visibility: hidden; }
.pd-field:hover .pd-ins { visibility: visible; }
.pd-sub { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.pd-help { font-size: 12px; line-height: 1.6; margin-top: 8px; }
.pd-form { display: flex; flex-direction: column; gap: 10px; }
.pd-form .fi { display: flex; align-items: center; gap: 8px; }
.pd-form .fi > label { width: 90px; flex: none; color: #666; }
.pd-form .fi .input, .pd-form .fi .select { flex: 1; }
.pd-style { padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 6px; }
.pd-style.on { border-color: var(--primary); background: #f7f9ff; }
.pd-sops { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; }
.pd-sops a { color: var(--primary); cursor: pointer; }
.pd-sops a.danger { color: #f53f3f; }

/* 向导步骤（批量修改派工等） */
.wizard-steps { display: flex; gap: 28px; margin-bottom: 14px; }
.wizard-step { display: flex; align-items: center; gap: 8px; color: var(--text-3, #999); font-size: 13px; }
.wizard-step b { width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; }
.wizard-step.on { color: var(--primary); }
.wizard-step.on b { background: var(--primary); border-color: var(--primary); color: #fff; }
.wizard-step.done { color: var(--text); }

/* 报表数量穿透：蓝色数字 */
.grid td a.drill { color: var(--primary); cursor: pointer; }
.grid td a.drill:hover { text-decoration: underline; }

/* 报表：统计方式页签（参照原系统，表格上方）、关键字框 */
.rpt-tabs { display: flex; gap: 28px; padding: 0 4px; margin: -4px 0 10px; border-bottom: 1px solid var(--border, #e5e6eb); flex: none; }
.rpt-tabs a { padding: 8px 2px; color: var(--text); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rpt-tabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.rpt-kw { position: relative; display: inline-flex; align-items: center; }
.rpt-kw .input { width: 200px; padding-right: 28px; }
.rpt-kw .ico { position: absolute; right: 8px; color: var(--text-3, #999); cursor: pointer; display: inline-flex; }
.rpt-kw .ico svg { width: 15px; height: 15px; }
.rpt-view { width: auto; min-width: 90px; }

.rpt-days { color: var(--text-2, #666); white-space: nowrap; }
