:root {
  --primary: #2b5c9b;
  --primary-dark: #20456f;
  --primary-soft: #eaf0f7;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --border: #e1e6ed;
  --border-strong: #cfd7e3;
  --text: #1f2937;
  --text-sub: #5b6675;
  --muted: #8a94a3;
  --success: #2f7d54;
  --success-soft: #e8f3ec;
  --warn: #a86a12;
  --warn-soft: #fdf3e3;
  --danger: #b32d2d;
  --danger-soft: #fbeceb;
  /* 本人负责任务的专用色，与其它任务行区分 */
  --mine-soft: #fdf6e4;
  --mine-accent: #c08a12;
  --mine-hover: #faedcb;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: 0 0 208px; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
.brand-title { font-size: 15px; font-weight: 700; color: var(--primary-dark); line-height: 1.35; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.nav-group-title { font-size: 11px; color: var(--muted); padding: 10px 8px 4px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 1px 0;
  border-radius: var(--radius); color: var(--text-sub); cursor: pointer; font-size: 13px;
}
.nav-item:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .badge { margin-left: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-weight: 600; font-size: 14px; }
.topbar .spacer { flex: 1; }
.content { padding: 16px 20px 40px; }

/* ---------------- common ---------------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.card-head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 14px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.page-head .sub { color: var(--muted); font-size: 12px; }
.page-head .spacer { flex: 1; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 5px; justify-content: center; height: 30px; padding: 0 12px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  cursor: pointer; font-size: 13px; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: #e7bcbc; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.lg { height: 40px; font-size: 15px; width: 100%; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.link { border: none; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn.link:hover { text-decoration: underline; }
.btn.link.danger { color: var(--danger); }
.btn.link.danger:hover { background: none; text-decoration: underline; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  height: 30px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px;
  font-size: 13px; background: #fff; color: var(--text); width: 100%; font-family: inherit; outline: none;
}
textarea { height: auto; padding: 6px 8px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(43, 92, 155, .12); }
/* 与物料档案一致的字段（名称 / 规格 / 单位）锁定为只读，避免采购单位与入库单位不一致 */
input.locked { background: #f1f3f6; color: var(--text-sub); cursor: not-allowed; border-color: var(--border); }
input.locked:focus { border-color: var(--border); box-shadow: none; }
label.field, div.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-sub); }
.field .req { color: var(--danger); }
.inline-form { display: flex; gap: 6px; align-items: center; }

/* 可搜索下拉：输入框 + 箭头 + 过滤面板（用于关联项目等候选较多的场景） */
.combo { position: relative; }
.combo .combo-input { padding-right: 26px; }
.combo .combo-arrow {
  position: absolute; top: 1px; right: 1px; width: 24px; height: 28px; line-height: 1;
  border: none; border-left: 1px solid var(--border); background: #f7f9fc; color: var(--text-sub);
  cursor: pointer; font-size: 13px; border-radius: 0 var(--radius) var(--radius) 0;
}
.combo .combo-arrow:hover { background: #eef2f7; color: var(--primary); }
.combo .combo-panel {
  position: absolute; z-index: 20; top: 32px; left: 0; right: 0; max-height: 240px; overflow: auto;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .14);
}
.combo .combo-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.combo .combo-item:hover { background: var(--primary-soft); }
.combo .combo-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.combo .combo-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo .combo-sub { flex: none; font-size: 11.5px; color: var(--muted); }
.combo .combo-empty { padding: 8px; font-size: 12px; color: var(--muted); text-align: center; }
/* 弹窗内的可搜索下拉：面板挂到 body 下（fixed 定位），不被 .modal-body 的滚动区裁剪 */
.combo-panel-float {
  position: fixed; z-index: 400; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
}
.combo-panel-float .combo-item { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; font-size: 13px; color: var(--text); cursor: pointer; }
.combo-panel-float .combo-item:hover { background: var(--primary-soft); }
.combo-panel-float .combo-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.combo-panel-float .combo-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-panel-float .combo-sub { flex: none; font-size: 11.5px; color: var(--muted); }
.combo-panel-float .combo-empty { padding: 8px; font-size: 12px; color: var(--muted); text-align: center; }
/* 采购明细「物品」栏：纯手动输入；已关联物料档案时显示「✕ 解除」（改回自定义物品） */
.pi-unlink {
  margin-top: 4px; padding: 0; border: none; background: none;
  color: var(--primary); font-size: 12px; cursor: pointer;
}
.pi-unlink:hover { text-decoration: underline; }
/* 只读展示字段（如「当前库存」） */
.field-ro {
  height: 30px; line-height: 28px; padding: 0 8px; font-size: 13px; color: var(--text);
  background: #f1f3f6; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.field-ro .muted { color: var(--muted); }
.field-ro .warn { color: var(--warn); font-weight: 600; }

.grid { display: grid; gap: 12px; }
.grid.cols2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols2.cards { align-items: start; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: middle; }
table.tbl th { background: #f7f9fc; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
table.tbl tbody tr:hover { background: #fafbfd; }
table.tbl.compact th, table.tbl.compact td { padding: 4px 6px; font-size: 12.5px; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .center { text-align: center; }
.table-wrap { overflow-x: auto; }

/* 本人负责的任务：整行浅黄底色 + 左侧色条 + 「我负责」标签 */
table.tbl tbody tr.mine > td { background: var(--mine-soft); }
table.tbl tbody tr.mine > td:first-child { box-shadow: inset 3px 0 0 var(--mine-accent); }
table.tbl tbody tr.mine:hover > td { background: var(--mine-hover); }
table.tbl tbody tr.mine > td.mine-cell { font-weight: 600; color: var(--mine-accent); }
.tag-mine {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px;
  font-size: 11px; line-height: 16px; color: #fff; background: var(--mine-accent); white-space: nowrap;
}
.gantt-bar.mine { box-shadow: 0 0 0 2px var(--mine-accent); }
.gantt-row.mine { color: var(--mine-accent); font-weight: 600; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; border: 1px solid transparent; white-space: nowrap; }
.badge.gray { background: #f0f2f5; color: var(--text-sub); border-color: var(--border); }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); border-color: #cddcec; }
.badge.green { background: var(--success-soft); color: var(--success); border-color: #c9e2d3; }
.badge.orange { background: var(--warn-soft); color: var(--warn); border-color: #eddfc4; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: #f0cfcd; }

.progress { height: 6px; background: #eceff4; border-radius: 3px; overflow: hidden; min-width: 60px; flex: 1; }
.progress > i { display: block; height: 100%; background: var(--primary); }
.progress-sub > i { background: #8aa9cd; }
.pg-value { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.progress-row { display: flex; align-items: center; gap: 6px; }

.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 2px; }
a.stat.link-card { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat.link-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(43, 92, 155, .14); transform: translateY(-1px); }
a.stat.link-card:hover .label { color: var(--primary); }

.empty { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

.modal-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .38); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow: auto; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-width: 100%; box-shadow: 0 12px 32px rgba(16,24,40,.18); }
.modal.wide { width: 840px; }
.modal.xwide { width: 980px; }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px; max-height: 68vh; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.close-btn { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); line-height: 1; }

.toast-wrap { position: fixed; top: 62px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; border-left: 3px solid var(--primary); box-shadow: var(--shadow); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; min-width: 220px; max-width: 420px; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.warn { border-left-color: var(--warn); }

.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 10px 12px; }
.pagination .info { color: var(--muted); font-size: 12px; margin-right: auto; }

.alert { padding: 10px 12px; border-radius: var(--radius); font-size: 13px; border: 1px solid; margin-bottom: 10px; }
.alert.warn { background: var(--warn-soft); border-color: #eddfc4; color: var(--warn); }
.alert.error { background: var(--danger-soft); border-color: #f0cfcd; color: var(--danger); }
.alert.info { background: var(--primary-soft); border-color: #cddcec; color: var(--primary-dark); }

/* ---------------- gantt ---------------- */
.gantt-area { overflow-x: auto; }
.gantt { display: flex; border: 1px solid var(--border); user-select: none; }
.gantt-left { width: 240px; flex: 0 0 240px; border-right: 1px solid var(--border); }
.gantt-head { height: 40px; border-bottom: 1px solid var(--border-strong); background: #f7f9fc; font-weight: 600; font-size: 12px; line-height: 40px; padding-left: 8px; }
.gantt-row { height: 22px; border-bottom: 1px solid var(--border); font-size: 12px; line-height: 22px; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-right { position: relative; }
/* 双行时间刻度：上排月份、下排日期，避免两者混淆 */
.gantt-scale { position: relative; border-bottom: 1px solid var(--border-strong); background: #f7f9fc; }
.gantt-months { position: relative; height: 20px; }
.gantt-month { position: absolute; top: 0; height: 20px; line-height: 20px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-sub); overflow: hidden; white-space: nowrap; border-left: 1px solid var(--border-strong); }
.gantt-days { position: relative; height: 20px; }
.gantt-day { position: absolute; top: 0; height: 20px; line-height: 20px; text-align: center; font-size: 10px; color: var(--muted); overflow: hidden; font-variant-numeric: tabular-nums; }
.gantt-day.weekend { background: #e9edf3; color: #7b8695; }
.gantt-day.today { background: #c0392b; color: #fff; font-weight: 700; border-radius: 2px; }
.gantt-bars { position: relative; }
.gantt-bg { position: absolute; inset: 0; pointer-events: none; }
.gantt-bg .wk { position: absolute; top: 0; bottom: 0; background: #f5f7fa; }
.gantt-bg .ms { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 1px; background: #c0392b; opacity: .65; pointer-events: none; }
.gantt-bar-cell { position: relative; height: 22px; border-bottom: 1px solid var(--border); }
.gantt-bar { position: absolute; top: 4px; height: 14px; border-radius: 3px; background: var(--primary); }
.gantt-bar.sub { background: #8aa9cd; top: 6px; height: 10px; }
.gantt-bar.draggable { cursor: grab; }
.gantt-bar.draggable:hover { box-shadow: 0 0 0 1px rgba(43,92,155,.45); }
.gantt-bar.draggable:active { cursor: grabbing; }
/* 两端把手：左端调开始日期、右端调完成日期 */
.gantt-bar-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.gantt-bar-handle::after { content: ''; position: absolute; top: 3px; bottom: 3px; left: 2px; width: 2px; background: rgba(255,255,255,.9); border-radius: 1px; }
.gantt-bar-handle.left { left: 0; }
.gantt-bar-handle.right { right: 0; }
.gantt-bar.draggable:hover .gantt-bar-handle::after { background: #fff; }
.gantt-bar-fill { position: absolute; top: 0; bottom: 0; right: 0; background: rgba(255,255,255,.4); border-radius: 0 3px 3px 0; }
.gantt-note { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.gantt-legend { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; }
.gantt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.gantt-legend i.today { background: #c0392b; }
.gantt-legend i.weekend { background: #e9edf3; border: 1px solid var(--border); }
/* 拖拽时跟随光标的日期提示 */
.gantt-tip { position: fixed; z-index: 3000; background: #22303f; color: #fff; font-size: 11.5px; padding: 4px 8px; border-radius: 4px; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.gantt-tip.warn { background: #8a4b00; }

/* ---------------- login ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #eef1f6; }
.login-card { width: 380px; background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 28px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; color: var(--primary-dark); }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
/* 扫码登录：二维码 + 提示并排，二维码固定尺寸便于对准 */
.qr-login { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.qr-box {
  flex: none; width: 172px; height: 172px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff;
}
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-tip { flex: 1; font-size: 13px; line-height: 1.6; }
.qr-tip .small { margin-top: 4px; }

/* 登录页「记住登录」勾选：默认不勾（安全口径），与下方演示区用留白区分 */
.login-remember { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--text-sub); cursor: pointer; user-select: none; }
.login-remember input { margin: 1px 0 0; flex: none; }
.login-remember b { color: #b7791f; font-weight: 600; }
.demo-accounts { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 10px; }
.demo-accounts .row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); padding: 3px 0; }
.demo-accounts .row code { background: #f2f4f7; padding: 0 4px; border-radius: 3px; }

/* ---------------- project detail ---------------- */
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 4px 8px; font-size: 13px; }
.kv .k { color: var(--muted); }
/* 两列信息栏（任务详情等）：一行放两组「标签 + 值」，降低弹窗高度；
   v-wide 让备注 / 附件等长内容独占整行（在单列 kv 中等价于普通第二列，可安全复用） */
.kv.cols2 { grid-template-columns: 88px 1fr 88px 1fr; }
.kv .v-wide { grid-column: 2 / -1; }
.bm-row { display: grid; grid-template-columns: 1.3fr 1.5fr 1fr; gap: 12px; padding: 5px 8px; background: #f8fafc; border: 1px solid var(--border); border-radius: 4px; font-size: 12.5px; }
.bm-row .k { color: var(--muted); }
/* 右侧双模块（财务记账 / 进度统计）的切换标签（2026-11-02） */
.mini-tabs { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mini-tabs.sub { padding-top: 8px; border-bottom: none; }
.mini-tab {
  border: 1px solid var(--border); background: transparent; color: var(--text-sub);
  font-size: 12.5px; line-height: 1.6; padding: 2px 12px; border-radius: 12px; cursor: pointer;
}
.mini-tab:hover { border-color: var(--primary); color: var(--primary); }
.mini-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mini-body { padding: 4px 12px 12px; }

/* 名称与前后置关系同行并列（2026-11-02）：独立任务不渲染关系节点，行内自然不占位。
   用 baseline 对齐 + 允许换行，名称过长时关系自动折到下一行，不会把表格撑破。 */
.task-name-cell { display: flex; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.task-rel { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.member-picker { border: 1px solid var(--border); border-radius: 4px; padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow: auto; }
.member-picker label { display: flex; align-items: center; gap: 3px; font-size: 12px; background: #f5f7fa; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.member-picker input { width: auto; height: auto; }

.msg-item { border-bottom: 1px dashed var(--border); padding: 8px 0; }
.msg-item .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.msg-item .text { font-size: 13px; margin-top: 2px; white-space: pre-wrap; }

.matrix { overflow-x: auto; }
.matrix table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.matrix th, .matrix td { text-align: center; border: 1px solid var(--border); padding: 6px 4px; white-space: nowrap; }
.matrix td:first-child, .matrix th:first-child { text-align: left; padding-left: 8px; position: sticky; left: 0; background: #fff; z-index: 2; }
.matrix thead th { background: #f7f9fc; }
.matrix input { width: 15px; height: 15px; }
.matrix td.on { background: #f3f8fc; }

.step-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }
.step-item.done { background: #f8faf9; }
.step-item.current { border-color: var(--primary); background: var(--primary-soft); }
.step-item.rejected { border-color: #e7bcbc; background: var(--danger-soft); }
.step-no { width: 22px; height: 22px; border-radius: 50%; background: #e7ecf3; color: var(--text-sub); display: flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 22px; }
.step-item.current .step-no { background: var(--primary); color: #fff; }
.step-item.done .step-no { background: var(--success); color: #fff; }
.step-item.rejected .step-no { background: var(--danger); color: #fff; }

.timeline-item { border-left: 2px solid var(--border); padding-left: 12px; margin-left: 8px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; }
.chk input { margin: 0; }
/* 分段选择（如入库登记的「固定产品 / 临时产品」） */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.seg-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius, 8px); cursor: pointer; background: var(--bg, #fff); }
.seg-item input { margin: 0 6px 0 0; }
.seg-item.active { border-color: var(--primary); background: var(--primary-soft); }
.seg-item.active b { color: var(--primary-dark); }

.todo-row { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.todo-row.clickable, .linkable { cursor: pointer; }
.todo-row.clickable:hover { background: var(--primary-soft); border-radius: 4px; }
.linkable:hover { color: var(--primary); text-decoration: underline; }

/* 概览四个信息模块：卡片高度固定，内容区内部右侧滚动（高度对齐「最新项目信息」3 条留言） */
.card.fixed-card { display: flex; flex-direction: column; overflow: hidden; }
.card.fixed-card > .card-head { flex: 0 0 auto; }
.card.fixed-card > .card-body { flex: 0 0 auto; height: 268px; overflow-y: auto; overscroll-behavior: contain; }
.card.fixed-card > .card-body::-webkit-scrollbar { width: 8px; }
.card.fixed-card > .card-body::-webkit-scrollbar-track { background: #f1f4f8; border-radius: 4px; }
.card.fixed-card > .card-body::-webkit-scrollbar-thumb { background: #c3ccd9; border-radius: 4px; border: 2px solid #f1f4f8; }
.card.fixed-card > .card-body::-webkit-scrollbar-thumb:hover { background: #a7b3c4; }
.card.fixed-card > .card-body { scrollbar-width: thin; scrollbar-color: #c3ccd9 #f1f4f8; }
.card.fixed-card > .card-body .empty { padding: 22px 12px; }
.card.fixed-card > .card-body .todo-row:last-child { border-bottom: none; }

/* 通知中心条目：可点击跳转 */
.notify-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 6px; border-bottom: 1px dashed var(--border); cursor: pointer; border-radius: 4px; }
.notify-item:hover { background: var(--primary-soft); }
.notify-item.unread { background: #f7f9fc; }
.notify-item.unread:hover { background: var(--primary-soft); }

/* 留言附件 */
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.attach-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 12px; background: #f7f9fc; font-size: 12px; color: var(--text-sub); }
.attach-chip img.thumb { width: 22px; height: 22px; object-fit: cover; border-radius: 3px; }
.file-btn { display: inline-flex; align-items: center; gap: 4px; }

/* 附件可点击预览（详情 / 留言 / 列表均适用） */
.attach-chip.clickable { cursor: pointer; border-color: var(--primary); background: #eef4fb; color: var(--primary); }
.attach-chip.clickable:hover { background: #e2ecf8; border-color: var(--primary); }
.attach-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 10px; background: #f7f9fc; font-size: 12px; line-height: 18px; }
.attach-badge:hover { border-color: var(--primary); background: #eef4fb; }
.attach-icon { vertical-align: -1px; }

/* 附件预览弹窗 */
.attach-preview-img { text-align: center; background: #f7f9fc; border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.attach-preview-img img { max-width: 100%; max-height: 56vh; object-fit: contain; cursor: zoom-in; }
/* 「原始大小」：按 1:1 像素查看，弹窗内可滚动，不损失细节 */
.attach-preview-img img.full { max-width: none; max-height: none; cursor: zoom-out; }
.attach-preview-frame { width: 100%; height: 56vh; border: 1px solid var(--border); border-radius: 6px; background: #f7f9fc; }
.attach-preview-meta { margin-top: 4px; }
.attach-preview-meta .k { display: inline-block; width: 60px; color: var(--muted); }

/* 附件列表（画廊）：任务列表点附件数时先展示全部缩略 */
.attach-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.attach-card { border: 1px solid var(--border); border-radius: 6px; padding: 8px; cursor: pointer; background: #fff; }
.attach-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(43, 92, 155, .12); }
.attach-card-thumb { height: 84px; display: flex; align-items: center; justify-content: center; background: #f7f9fc; border-radius: 4px; overflow: hidden; }
.attach-card-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.attach-file-icon { font-size: 13px; font-weight: 700; color: var(--primary); }
.attach-card-name { margin-top: 6px; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-card-meta { font-size: 11px; color: var(--muted); }
.attach-card.no-preview { cursor: pointer; }

/* 进度滑块（拖拽）+ 收窄的数字输入框，同行排列 */
.pg-slider-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pg-slider-row .pg-range { flex: 1; min-width: 0; accent-color: var(--primary); height: 22px; }
.pg-slider-row .pg-num { width: 66px; flex: none; text-align: center; padding: 4px 6px; }
.pg-slider-row .small { flex: none; }

/* 任务名称点击查看详情 */
.task-link { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.task-link:hover { color: var(--primary); text-decoration: underline; }

/* 附件上传区（点击选择 + 拖拽上传） */
.attach-drop {
  margin-top: 4px; border: 1px dashed var(--border-strong, #b9c3d0); border-radius: var(--radius);
  background: #fafbfc; padding: 14px 12px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.attach-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.attach-drop.over { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 2px rgba(43, 92, 155, .18); }
.attach-drop.has-file { border-style: solid; }
.attach-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.attach-drop-icon { width: 26px; height: 26px; line-height: 24px; border-radius: 50%; border: 1px solid var(--primary); color: var(--primary); font-size: 16px; }
.attach-drop-main { font-size: 13px; color: var(--text-sub); }

.monosp { font-variant-numeric: tabular-nums; }
.mono { font-family: Consolas, Menlo, monospace; font-size: 13px; letter-spacing: .2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mt8 { margin-top: 8px; }
.mt14 { margin-top: 14px; }

/* 审批人选择器（有序、可增删调序） */
.ap-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-top: 6px; background: var(--bg-soft, #fafbfc); }
.ap-list { min-height: 34px; display: flex; flex-direction: column; gap: 6px; }
.ap-chip { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.ap-chip .ap-step { background: var(--primary); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.ap-chip .ap-name { flex: 1; min-width: 0; }
.ap-add { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ap-add select { flex: 1; min-width: 0; }

/* 页内 Tab（物料管理：物料台账 / 出入库申请 / 补货申请 / 库存流水） */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.tab-item { padding: 8px 16px; font-size: 13px; color: var(--text-sub); cursor: pointer; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: transparent; }
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); font-weight: 600; background: #fff; border-color: var(--border); box-shadow: inset 0 2px 0 var(--primary); }
.tab-item .badge { margin-left: 6px; }
.sub-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.sub-toolbar .spacer { flex: 1; }
.mt-link { color: var(--primary); cursor: pointer; }
.mt-link:hover { text-decoration: underline; }

/* 打印（弹窗内「打印」按钮：只打印单据正文） */
.print-host { display: none; }
@media print {
  html.printing body > *:not(.print-host) { display: none !important; }
  html.printing .print-host { display: block !important; }
  body { background: #fff !important; }
  .print-doc { font-size: 12px; color: #000; padding: 0; }
  .print-doc .print-title { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 4px; }
  .print-doc .print-meta { font-size: 11px; color: #444; text-align: center; margin-bottom: 8px; }
  .print-doc hr { border: none; border-top: 1px solid #333; margin: 6px 0 10px; }
  .print-doc .kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 12px; }
  .print-doc .kv .k { color: #555; }
  .print-doc table.tbl { width: 100%; border-collapse: collapse; margin: 6px 0; }
  .print-doc table.tbl th, .print-doc table.tbl td { border: 1px solid #999; padding: 4px 6px; font-size: 12px; text-align: left; }
  .print-doc .badge { border: 1px solid #666; padding: 0 4px; border-radius: 3px; font-size: 11px; color: #000 !important; background: transparent !important; }
  .print-doc .step-item { border: 1px solid #999; padding: 4px 6px; margin-bottom: 4px; display: flex; gap: 8px; }
  .print-doc .print-note { margin-top: 10px; font-size: 11px; color: #444; line-height: 1.6; }
  /* 签字栏：多级审批（采购 / 出入库）会按审批链逐级留白，超出一页宽自动换行 */
  .print-doc .print-sign { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px 40px; font-size: 12px; }
}

/* ---------- 合同管理 ---------- */
.tab { padding: 8px 16px; font-size: 13px; color: var(--text-sub); cursor: pointer; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: transparent; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); font-weight: 600; background: #fff; border-color: var(--border); box-shadow: inset 0 2px 0 var(--primary); }
.lnk { color: var(--primary); cursor: pointer; }
.lnk:hover { text-decoration: underline; }
.inline-input { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; min-width: 260px; }
.ov-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
/* 总计模块：与上方概览卡同宽、左右并列（销售总计 / 采购总计） */
.ov-board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; align-items: start; }
.ov-sale { border-top: 3px solid var(--primary); }
.ov-buy { border-top: 3px solid #e0883a; }
/* 概览卡为左右两张（各占半屏），卡内指标用 3 列 × 2 行才不会挤成一团 */
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; }
.ov-grid .ov-num { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-grid .ov-lab { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
/* 逾期/欠款类数字强调：剩余、未开票用橙色，已付/已开票用绿色 */
.ov-num.warn { color: #e0883a; }
.ov-num.ok { color: var(--success, #2f9e57); }
table.tbl td.k, table.tbl th.k { color: var(--muted); background: #fafbfc; white-space: nowrap; width: 96px; }
.tl-block { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.tl-block:last-child { border-bottom: none; }
.tl-title { font-weight: 600; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.tl-step { display: flex; gap: 8px; align-items: center; padding: 2px 0; font-size: 13px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: none; }
.tl-step.ok .tl-dot { background: var(--success, #2f9e57); }
.tl-step.reject .tl-dot { background: var(--danger); }
.tl-step.cur .tl-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(46,111,203,0.15); }
.tl-name { color: var(--text-sub); }
.mt4 { margin-top: 4px; }
.ml8 { margin-left: 8px; }
.ok { color: var(--success, #2f9e57); }
.warn { color: #e0883a; }

/* 合同详情底部：收付款 / 发票 / 增补扣款 / 执行完成 四合一紧凑区（2×2，取代原四个整宽卡片） */
.ct-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .ct-mini-grid { grid-template-columns: 1fr; } }
.ct-mini { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.ct-mini-hd { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #f7f9fc; border-bottom: 1px solid var(--border); font-size: 13px; }
.ct-mini-hd .right { margin-left: auto; }
.ct-mini-body { padding: 8px 10px; max-height: 240px; overflow: auto; }
.ct-mini-kv { font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; }
/* 合同详情：金额汇总压成一行（横向排列，过窄时整条横向滚动，不折行） */
.ct-sum-card .card-body { padding: 8px 12px; }
.ct-sum-line { display: flex; align-items: baseline; gap: 20px; white-space: nowrap; overflow-x: auto; }
.ct-sum-cap { font-size: 13px; font-weight: 600; color: var(--text); flex: none; }
.ct-sum-item { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ct-sum-lab { font-size: 12px; color: var(--muted); }
.ct-sum-num { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ct-sum-num.warn { color: #e0883a; }
.ct-sum-num.ok { color: var(--success, #2f9e57); }
table.tbl.xs { font-size: 12px; }
table.tbl.xs th, table.tbl.xs td { padding: 3px 6px; }
table.tbl.xs .btn.link { padding: 0 4px; font-size: 12px; }

/* 完成审批未全额收 / 付款的高亮警示 */
.ct-warn, .ct-warn-inline { border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger); border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.6; }
.ct-warn-inline { margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ct-warn-inline .right, .ct-warn-inline .btn { margin-left: 4px; }
/* 客户业务负责人变更待办置顶条 */
.ct-banner { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.ct-banner-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed rgba(0,0,0,.08); font-size: 13px; }
.ct-banner-row:last-child { border-bottom: none; }
.ct-banner-row .right { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }

/* 审批链：只读锁定展示 + 配置步骤排序 */
.ct-chain-lock { border: 1px dashed var(--border); background: #f7f9fc; border-radius: 6px; padding: 8px 10px; font-size: 13px; color: var(--text-sub); }
.chain-step { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; font-size: 13px; }
.chain-step .step-no { color: var(--muted); font-size: 12px; }
.chain-step .right { margin-left: auto; }

/* 合同执行审核：业务负责人统一方式（三选一） */
.ct-radio { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; font-size: 13px; line-height: 1.6; cursor: pointer; }
.ct-radio:hover { background: #f7f9fc; }
.ct-radio input { margin-top: 3px; flex: 0 0 auto; }

/* 采购明细卡片式两行排版（2026-10-20）：一条明细仍是一个 <tr>，
   只在 tr 内部用卡片承载「主行 + 副行」两行字段，字段自带小标题、原表头隐藏。
   表头隐藏是因为它与两行版式无法对齐，字段标题已内联到每个控件上方。 */
#pu-items thead { display: none; }
#pu-items tbody td { padding: 3px 0; border: 0; vertical-align: top; }
#pu-items tbody tr:hover td { background: transparent; }
.pi-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fbfcfe; }
.pi-card:hover { border-color: #c7d3e3; }
.pi-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.pi-line-sub { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border); }
.pi-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 130px; min-width: 100px; }
.pi-field > span { font-size: 12px; line-height: 1.4; color: var(--text-sub); }
.pi-field input, .pi-field select { width: 100%; box-sizing: border-box; }
.pi-f-name { flex: 2.4 1 220px; }
.pi-narrow { flex: 0 0 84px; min-width: 72px; }
.pi-ctl { display: flex; gap: 4px; align-items: center; }
.pi-ctl input { flex: 1 1 auto; min-width: 0; }
.pi-del { margin-bottom: 1px; flex: 0 0 auto; }
.pi-unlink { font-size: 12px; padding: 2px 6px; white-space: nowrap; }

/* 外协单表单（2026-10-20）：分区小标题 + 工件明细表
   版式：上方「基本信息」每行两栏，下方「工件明细」一行一工件。 */
/* 基本信息两栏栅格：一行放两个信息栏（外协弹窗等 field 表单复用） */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: start; }
.row2 .field { min-width: 0; }
/* 我的任务页顶部两栏（备忘录 + 右侧占位模块）：窄屏自动堆成一列，避免挤成一团 */
@media (max-width: 1000px) { .row2.top-row { grid-template-columns: 1fr; } }
/* 我的任务页顶部两栏等高固定（2026-11-02）：
   备忘录与右侧模块（财务记账 / 进度统计）高度一致且固定，内容多时各自内部滚动，
   切换子页签时整页不再上下跳动。 */
.row2.top-row > .card { display: flex; flex-direction: column; height: 340px; }
.row2.top-row > .card > .card-head { flex: 0 0 auto; }
.row2.top-row > .card > .card-body {
  flex: 1 1 auto; height: auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.row2.top-row > .card > .card-body::-webkit-scrollbar { width: 8px; }
.row2.top-row > .card > .card-body::-webkit-scrollbar-thumb { background: #c3ccd9; border-radius: 4px; border: 2px solid #f1f4f8; }
.os-sec-title {
  font-weight: 600; font-size: 13px; color: var(--text-sub);
  padding: 0 0 6px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
#osf-steps tbody td { vertical-align: middle; }
#osf-steps input[type="date"] { width: 128px; }
#osf-steps .os-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
#osf-steps .os-punit { margin-left: 4px; }
#osf-total { font-weight: 600; color: var(--primary, #2f6fed); }
.os-seq { text-align: center; color: var(--text-sub); }


/* 抄送人勾选栏（2026-10-21）：横排胶囊复选，选中蓝底白字；用于合同审批发起 / 产品出库登记弹窗 */
.cc-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-picker label { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 14px; font-size: 12.5px; line-height: 1.6; cursor: pointer; user-select: none; background: #fff; color: var(--text); transition: background .15s, color .15s, border-color .15s; }
.cc-picker label:hover { border-color: var(--primary); }
.cc-picker label input { display: none; }
.cc-picker label.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 我的任务页：备忘录模块（2026-10-21）——仅当前账号的私人便签，支持提醒 */
.memo-add { display: flex; gap: 6px; margin-bottom: 8px; }
.memo-add input[type="text"] { flex: 1; }
.memo-add input[type="datetime-local"] { width: 200px; flex: none; }
.memo-list { display: flex; flex-direction: column; gap: 4px; }
.memo-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
.memo-item:hover { background: #f7f9fc; }
.memo-item .memo-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-item.done .memo-text { color: var(--muted); text-decoration: line-through; }
.memo-item .memo-check { display: inline-flex; align-items: center; cursor: pointer; flex: none; }

/* ==========================================================================
   方案 B「深色侧栏」主题（2026-11-04，用户从三套 UI 方向中选定）
   全部是追加在文件末尾的覆盖规则，不改上面任何业务样式；要回退删掉本段即可。
   层次感来源：深色导航框架 vs 浅色工作区、卡片头浅灰底带 + 蓝色竖条、
   指标卡左侧色条、表格斑马纹、页头下划线。主色仍是 --primary #2b5c9b。
   ========================================================================== */

/* ---- 深色侧栏 ---- */
.sidebar {
  background: #1b3a63;
  border-right: 1px solid #142c4c;
  box-shadow: 2px 0 12px rgba(15, 32, 58, .10);
}
.brand {
  padding: 18px 16px 16px;
  background: #162f52;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.brand-title { color: #fff; font-size: 15px; letter-spacing: .3px; }
.brand-sub { color: #93aecf; }
.nav { padding: 12px 10px; }
.nav-group-title { color: #7e9bc0; padding: 12px 10px 5px; letter-spacing: 1.2px; }
.nav-item {
  color: #c8d8ea; padding: 8px 10px; margin: 2px 0; border-radius: 6px;
  transition: background .15s, color .15s;
}
/* 菜单文字前的小方块：纯 CSS 生成，不动 layout.js 的 HTML */
.nav-item > span:first-child::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 2px;
  background: rgba(255, 255, 255, .35); margin-right: 8px; vertical-align: 2px;
}
.nav-item:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.nav-item.active {
  background: #2b5c9b; color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 #6ea8ff, 0 2px 6px rgba(0, 0, 0, .15);
}
.nav-item.active > span:first-child::before { background: #8ec0ff; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .30); }

/* ---- 顶栏：面包屑竖条 + 细投影 ---- */
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #dbe3ed;
  box-shadow: 0 2px 8px rgba(16, 32, 58, .05);
}
.topbar .crumb { font-size: 15px; color: #1c3556; padding-left: 13px; position: relative; }
.topbar .crumb::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 2px; background: var(--primary);
}

/* ---- 工作区 ---- */
body { background: #f4f6f9; }
.content { padding: 18px 22px 40px; }
.page-head { padding-bottom: 11px; margin-bottom: 16px; border-bottom: 1px solid #dce3ec; }
.page-head h2 { font-size: 20px; color: #1c3556; }

/* ---- 卡片：头部浅灰底带 + 蓝色竖条 ---- */
.card {
  border-color: #dbe3ed; border-radius: 8px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 32, 58, .06);
}
.card-head {
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
  border-bottom: 1px solid #dbe3ed; padding: 11px 16px;
}
.card-head h3 { color: #1c3556; padding-left: 11px; position: relative; }
.card-head h3::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 2px; background: var(--primary);
}
.card-body { padding: 16px; }

/* ---- 指标卡：左侧色条 ---- */
.stat {
  border-color: #dbe3ed; border-radius: 8px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 32, 58, .06);
  position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.stat .value { font-size: 24px; color: #1c3556; }
a.stat.link-card:hover { box-shadow: 0 6px 18px rgba(43, 92, 155, .16); }

/* ---- 表格：表头加深 + 斑马纹（我负责的浅黄行优先级更高，不受影响） ---- */
table.tbl th { background: #eef2f8; color: #3b4c62; border-bottom: 2px solid #d6e0ed; }
table.tbl tbody tr:nth-child(even) { background: #f8fafc; }
table.tbl tbody tr:hover { background: #eef4fb; }
table.tbl tbody tr.mine > td { background: var(--mine-soft); }
table.tbl tbody tr.mine:hover > td { background: var(--mine-hover); }

/* ---- 页签 ---- */
.tab-item.active, .tab.active {
  background: #fff;
  box-shadow: inset 0 2px 0 var(--primary), 0 -2px 6px rgba(16, 32, 58, .04);
}

@media (max-width: 900px) {
  .sidebar { width: 176px; flex-basis: 176px; }
  .content { padding: 14px; }
}

/* ===== 项目附件汇总页 + 任务列表附件栏链接（2026-11-04） ===== */
.attach-link, .attach-head-link { text-decoration: none; }
.attach-head-link { font-weight: 600; padding: 0; }
.pf-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 12px; }
.pf-card {
  border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 10px;
  cursor: pointer; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
.pf-card:hover { border-color: var(--primary); box-shadow: 0 3px 12px rgba(43, 92, 155, .14); }
.pf-thumb {
  height: 100px; display: flex; align-items: center; justify-content: center;
  background: #f5f7fa; border-radius: 6px; overflow: hidden;
}
.pf-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pf-file-ext { font-size: 22px; font-weight: 700; color: #8a99ab; letter-spacing: 1px; }
.pf-name { margin-top: 8px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-meta { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tags { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
@media (max-width: 700px) { .pf-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }

/* ===== 任务列表 Excel 批量录入模式（2026-11-04，projectDetail） ===== */
.excel-entry input[type="text"],
.excel-entry input[type="date"],
.excel-entry select {
  width: 100%; box-sizing: border-box; font-size: 12px; padding: 3px 6px; height: 27px;
}
.excel-entry td { vertical-align: middle; }
.excel-entry tr.excel-err > td { background: #fdf2f2; }
.excel-entry input.invalid, .excel-entry select.invalid { border-color: var(--danger); background: #fdf2f2; }
.excel-hint { font-size: 11px; margin-top: 2px; line-height: 1.3; }
.excel-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px dashed var(--border); }
.excel-err-list { color: var(--danger); font-size: 12px; padding: 4px 12px 10px; line-height: 1.7; }

/* ===== WBS 序号列 / 甘特行序号（2026-11-04） ===== */
.no-cell { text-align: center; white-space: nowrap; }
.gantt-no { display: inline-block; min-width: 24px; color: var(--muted); font-size: 11px; }
/* 日期框点击任意位置即弹出日历选择（配合 app.js 的 showPicker 委托） */
input[type="date"] { cursor: pointer; }

/* ===== 财务记账独立页（2026-11-04） ===== */
.fx-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 0 10px; }
.fx-filters .inp { width: auto; min-width: 110px; }
.fx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.fx-kpi { background: #f5f7fa; border-radius: 8px; padding: 10px 12px; }
.fx-kpi-label { font-size: 12px; color: var(--muted); }
.fx-kpi-val { font-size: 18px; font-weight: 600; margin-top: 2px; }
.fx-kpi.in { background: #f0f8f2; }
.fx-kpi.out { background: #fdf4ef; }
.c-in { color: #1f7a45; }
.c-out { color: #b3541e; }
.fx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fx-sec { font-weight: 600; font-size: 13px; margin: 4px 0 6px; }
.fx-bar { height: 6px; background: #eef1f5; border-radius: 3px; overflow: hidden; margin: 2px 0; }
.fx-bar i { display: block; height: 100%; }
.fx-bar i.in { background: #3f9a63; }
.fx-bar i.out { background: #d1732f; }
@media (max-width: 900px) {
  .fx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-grid2 { grid-template-columns: 1fr; }
}

/* 进度统计卡片头部（标题在卡片内，W.card 的 title 会被转义故不能用 HTML） */
.mini-head { padding: 10px 12px 0; border-bottom: 1px solid var(--border); }
.mini-head h3 { margin: 0 0 8px; font-size: 14px; }
.mini-head + .mini-tabs { border-bottom: 1px solid var(--border); }
