:root {
  --nav-w: 224px;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --border: rgba(0, 0, 0, .10);
  --border-2: rgba(0, 0, 0, .18);
  --text: #1c1c1a;
  --muted: #6d6d67;
  --muted-2: #93938c;
  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --radius: 10px;
  --radius-lg: 14px;
  --s-not: #888780;
  --s-ing: #185fa5;
  --s-wait: #ba7517;
  --s-done: #1d9e75;
  --s-block: #e24b4a;
  --s-skip: #b4b2a9;
  --s-up: #e8890c;
  --s-down: #1d9e75;
  --hl-up: #fff4e2;
  --hl-down: #e8f8f0;
  --s-lock: #c9a227;
  --hl-lock: #fdf6df;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
}
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: rgba(0, 0, 0, .05); }
button:disabled { opacity: .45; cursor: not-allowed; }

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 5px 9px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 0; }

/* ---------- 布局 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.brand span { color: var(--accent); }
.topbar .spacer { flex: 1; }

.tabs { display: flex; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabs button {
  border: none; background: transparent; border-radius: 0;
  padding: 10px 16px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.page { padding: 20px; }
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bar .grow { flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.grid { display: grid; gap: 14px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 600; line-height: 1.25; }
.kpi .sub { font-size: 12px; color: var(--muted-2); }

.proj-card { cursor: pointer; transition: border-color .12s; }
.proj-card:hover { border-color: var(--border-2); }
.proj-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.proj-head { display: flex; gap: 12px; align-items: flex-start; }
.proj-title { font-weight: 600; font-size: 14px; line-height: 1.4; }
.proj-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.ring { flex: none; }
.ring svg { display: block; }
.ring-t { font-size: 13px; font-weight: 600; fill: var(--text); }

.pbar { height: 6px; background: rgba(0,0,0,.07); border-radius: 4px; overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

.chiprow { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px; padding: 1px 8px; border-radius: 20px;
  background: rgba(0,0,0,.05); color: var(--muted); white-space: nowrap;
}
.chip.dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 5px; vertical-align: 1px; background: currentColor;
}

/* ---------- 表 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }

/* ---------- 泳道矩阵 ---------- */
.matrix { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.mx-head { display: grid; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mx-head > div { padding: 9px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mx-head > div + div { border-left: 1px solid var(--border); }
.mx-phase { border-top: 1px solid var(--border); }
.mx-phase:first-child { border-top: none; }
.mx-phase-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.mx-phase-hd .nm { font-weight: 600; font-size: 13px; }
.mx-row { display: grid; }
.mx-cell { padding: 10px 12px; border-left: 1px solid var(--border); min-height: 56px; }
.mx-cell:first-child { border-left: none; }

.tcard {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 6px 9px;
  margin-bottom: 6px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}
.tcard:hover { background: var(--surface-2); }
.tcard .nm { font-weight: 500; }
.tcard .dt { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tcard.od { background: #fdf0ef; border-color: #f5c9c7; }
.tcard.dn { opacity: .5; }
.tcard.dn .nm { text-decoration: line-through; }

/* 责任矩阵 · 推进顺序（R29）：流程带 / 步序徽标 / 前置解锁提示 / 任务序号 */
.mx-flow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
}
.mx-flow-t { font-size: 11px; font-weight: 700; color: var(--muted); flex: none; letter-spacing: 1px; }
.mx-flow-lv { display: inline-flex; gap: 5px; }
.mx-flow-arw { color: var(--accent); font-weight: 700; font-size: 14px; flex: none; }
.mx-flow-node {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-top-width: 3px; border-radius: 8px;
  padding: 3px 8px; background: var(--surface); font-size: 11.5px; cursor: pointer;
}
.mx-flow-node:hover { border-color: var(--accent); }
.mx-flow-node.on { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--accent-soft); }
.mx-flow-node .fseq {
  flex: none; min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; padding: 0 3px;
}
.mx-flow-node .fnm { font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-flow-node .fpct { font-style: normal; color: var(--muted); font-size: 10.5px; }
.mx-flow-node .fico { font-style: normal; font-size: 10.5px; }
.mx-flow-node .fico.ok { color: var(--s-done); }
.mx-flow-node .fico.wait { color: var(--s-lock); }
.mx-step {
  flex: none; font-size: 10.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 9px; padding: 1px 8px;
}
.chip.mx-rel { background: var(--surface-2); border-style: dashed; font-weight: 400; }
.chip.mx-rel.down { color: var(--accent); }
.tseq {
  flex: none; display: inline-block; min-width: 17px; margin-right: 5px; padding: 0 3px;
  text-align: center; font-size: 9.5px; font-weight: 700; line-height: 14px;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; vertical-align: 1.5px;
}

/* ---------- 甘特 ---------- */
.gantt { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.gantt-scroll { overflow: auto; max-height: 68vh; }
.gantt-grid { display: grid; }
.gleft { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); }
.gright { position: relative; }
.grow { display: grid; }
.grow:hover { background: rgba(0,0,0,.02); }
.gcell { border-bottom: 1px solid rgba(0,0,0,.05); padding: 0 10px; display: flex; align-items: center; font-size: 12px; }
.gcell.name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcell.phase { background: var(--surface-2); font-weight: 600; font-size: 13px; }
.gcell.stage { color: var(--muted); font-size: 12px; padding-left: 22px; }
.gcell.task { padding-left: 38px; }
.gbar { position: absolute; height: 16px; border-radius: 4px; top: 50%; transform: translateY(-50%); min-width: 8px; }
.gbar-label {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); white-space: nowrap; pointer-events: none;
}
.gms { position: absolute; top: 50%; width: 11px; height: 11px; transform: translateY(-50%) rotate(45deg); }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #e24b4a; z-index: 5; }
.ghead { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); }
.gmonth { display: flex; font-size: 11px; color: var(--muted); }
.gmonth > div { border-left: 1px solid var(--border); padding: 3px 8px; }
.gdays { display: flex; font-size: 10px; color: var(--muted-2); }
.gdays > div { text-align: center; border-left: 1px solid rgba(0,0,0,.05); }

/* ---------- 看板 ---------- */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.kb-col.over { border-color: var(--accent); background: var(--accent-soft); }
.kb-hd { padding: 10px 12px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.kb-body { padding: 10px; min-height: 120px; }
.kb-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--s-not);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; font-size: 12px;
}
.kb-card:active { cursor: grabbing; }
.kb-card .nm { font-weight: 500; line-height: 1.45; }
.kb-card .dt { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- 抽屉 ---------- */
/* 必须用 fixed：absolute 会以文档流顶端定位，页面往下滚之后抽屉就跑到看不见的地方 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw;
  background: var(--surface); z-index: 51; border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 36px rgba(0,0,0,.14);
  animation: drawer-in .16s ease-out;
}
@keyframes drawer-in { from { transform: translateX(22px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-hd { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-bd { padding: 16px; overflow: auto; flex: 1; overscroll-behavior: contain; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }

/* ---------- 杂项 ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted-2); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; color: #fff; white-space: nowrap; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: rgba(0,0,0,.06); color: var(--muted); }
.scroll-x { overflow-x: auto; }
.list-link { cursor: pointer; }
.list-link:hover { color: var(--accent); }
.banner {
  background: #fdf6e6; border: 1px solid #f0dfb4; color: #6b5410;
  border-radius: var(--radius); padding: 8px 12px; font-size: 12px; margin-bottom: 14px;
}

/* ================= 类型编辑器 ================= */
.page.wide { max-width: none; }

.tpl-wrap { display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-side {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: 108px;
}
.tpl-side-hd {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; background: var(--surface-2);
}
.tpl-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid rgba(0,0,0,.045); }
.tpl-item:last-child { border-bottom: none; }
.tpl-item:hover { background: var(--surface-2); }
.tpl-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.tpl-ico {
  flex: none; width: 30px; height: 30px; border-radius: 8px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.tpl-nm { font-weight: 600; font-size: 13px; line-height: 1.4; }

.tpl-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; min-width: 0; }
.tpl-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tpl-hd .ico-in { width: 46px; text-align: center; font-size: 16px; }
.tpl-hd .nm-in { width: 240px; font-weight: 600; }
.tpl-hd input[type=color] { width: 34px; height: 30px; padding: 2px; cursor: pointer; }
.tpl-hd .grow { flex: 1; min-width: 160px; }

.tpl-sec { margin-bottom: 20px; }
.tpl-sec-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.tpl-sec-hd .grow { flex: 1; }

.role-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.role-card {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  border: 1px solid var(--border-2); border-radius: 20px; background: var(--surface-2);
}
.role-card input[type=color] { width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; cursor: pointer; }
.role-card input[type=text], .role-card input:not([type]) { width: 96px; border: none; background: transparent; padding: 2px 0; }
.role-card input:not([type=color]):focus { outline: none; background: var(--surface); }

.ph-block { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ph-row, .st-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ph-row { background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ph-row input[type=color] { width: 26px; height: 26px; padding: 1px; cursor: pointer; }
.ph-row .nm { flex: 1; min-width: 150px; font-weight: 600; }
.ph-row .note { flex: 1; min-width: 130px; font-size: 12px; }
.lvl {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: rgba(0,0,0,.06); color: var(--muted); flex: none;
}
.st-block { border-top: 1px solid rgba(0,0,0,.05); padding: 8px 10px 8px 22px; }
.st-block:first-of-type { border-top: none; }
.st-row .nm { flex: 1; min-width: 150px; }
.st-row .note { width: 120px; font-size: 12px; }

.tk-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.tk-tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.tk-tbl td { padding: 3px 6px; border-bottom: 1px solid rgba(0,0,0,.04); }
.tk-tbl td input, .tk-tbl td select { width: 100%; padding: 3px 6px; font-size: 12px; }
.tk-tbl td.nowrap { white-space: nowrap; }
.ph-foot { padding: 8px 10px 10px 22px; display: flex; gap: 8px; align-items: center; }
.tk-add { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

button.sm { padding: 2px 8px; font-size: 11px; border-radius: 6px; }
button.hot { border-color: var(--s-up); color: var(--s-up); background: var(--hl-up); }
button.x {
  border: none; background: transparent; color: var(--muted-2);
  padding: 1px 5px; font-size: 13px; line-height: 1.2; border-radius: 5px;
}
button.x:hover { background: rgba(0,0,0,.07); color: var(--text); }
button.x.danger:hover { background: #fdecec; color: var(--s-block); }
button.x:disabled { opacity: .25; }

/* ================= 弹窗 ================= */
.mask.fixed { position: fixed; z-index: 80; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 560px; max-width: 94vw; max-height: 84vh; z-index: 81;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 16px 56px rgba(0,0,0,.24);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.modal-hd .grow { flex: 1; }
.modal-bd { padding: 14px 16px; overflow: auto; flex: 1; }
.modal-ft { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--surface-2); }
.modal-ft .grow { flex: 1; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; cursor: pointer; }
.pick-row:hover { background: var(--surface-2); }

/* ================= 依赖高亮 ================= */
.rel-tag { margin-left: 5px; padding: 0 4px; border-radius: 4px; font-size: 10px; }
.rel-tag.up { background: var(--hl-up); color: var(--s-up); }
.rel-tag.down { background: var(--hl-down); color: var(--s-down); }

.tcard.r-focus { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.tcard.r-up { background: var(--hl-up); border-color: var(--s-up); }
.tcard.r-down { background: var(--hl-down); border-color: var(--s-down); }
.tcard.r-dim { opacity: .26; }
.tcard { transition: opacity .12s, background .12s, box-shadow .12s; }

.lg-up { color: var(--s-up); font-style: normal; font-weight: 600; }
.lg-down { color: var(--s-down); font-style: normal; font-weight: 600; }
.cp-arrow { color: var(--muted-2); }

/* ================= 依赖图 ================= */
.gedge-layer { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; z-index: 5; }  /* 连线画在方块上方，端点圆点/箭头不被卡片盖住；被拖动方块 z-index:12 仍在线之上 */
.gedge { fill: none; stroke: #c9c8c1; stroke-width: 1.4; transition: stroke .12s, stroke-width .12s, opacity .12s; }
.gedge.on-up { stroke: var(--s-up); stroke-width: 2.2; }
.gedge.on-down { stroke: var(--s-down); stroke-width: 2.2; }
.gedge.off { opacity: .18; }


/* 「直接挂在阶段下」的伪流程 */
.st-block.direct { background: #fdfaf3; }
.lvl.warn { background: #fbedd4; color: #8a6414; }
.st-block.direct .nm:disabled { background: transparent; color: #8a6414; font-weight: 600; }

/* ================= 项目管理页 ================= */
table.proj-tbl td { vertical-align: middle; }
table.proj-tbl tr.on { background: var(--accent-soft); }
.plink { font-weight: 600; cursor: pointer; line-height: 1.4; }
.plink:hover { color: var(--accent); }
button.ghost.danger { color: var(--s-block); }
button.ghost.danger:hover { background: #fdecec; }
.pbar + .small { display: inline-block; margin-top: 3px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .row2 { grid-template-columns: 1fr; } }

.type-preview {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px;
}
.tp-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ================= 阶段门禁 ================= */
.chip.gate { background: rgba(0,0,0,.05); }
.chip.gate.ok { background: var(--hl-down); color: var(--s-done); }
.chip.gate.wait { background: var(--hl-up); color: var(--s-wait); }
.chip.gate.lock { background: var(--hl-lock); color: var(--s-lock); }
.chip.xs { padding: 0 5px; font-size: 10px; }

.gate-list { display: flex; flex-direction: column; gap: 6px; }
.gate-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface-2); border-left: 3px solid var(--border-2);
}
.gate-row.ok { background: var(--hl-down); border-left-color: var(--s-done); }
.gate-row.locked { background: var(--hl-lock); border-left-color: var(--s-lock); }
.gate-row.wait { background: var(--hl-up); border-left-color: var(--s-wait); }
.gate-ico { font-size: 14px; width: 16px; text-align: center; flex: none; }
.gate-row .dy { font-size: 12px; color: var(--muted); }
.gate-row .dy b { color: var(--text); }

/* 锁定徽标 */
.lkm { margin-right: 3px; font-size: 11px; }
.rel-tag.lock { background: var(--hl-lock); color: var(--s-lock); }
.tcard.lk { background: #fffdf5; border-color: #eadfb8; }
.tcard.lk .nm { color: #6b5a1e; }
.kb-card.lk { background: #fffdf5; }
.gcell.locked-row { background: #fffdf5; }
/* 抽屉里的前置/下游清单 */
.dep-field label { margin-bottom: 6px; }
.deplist { display: flex; flex-direction: column; gap: 4px; }
.depitem {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 7px; background: var(--surface-2); font-size: 12px;
}
.depitem .dn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner.lock { background: var(--hl-lock); border-color: #eadfb8; color: #6b5410; }
.banner.lock b { color: #8a6414; }

.okmark { color: var(--s-done); font-weight: 600; }
.lockmark { color: var(--s-lock); font-weight: 600; }
.waitmark { color: var(--s-wait); font-weight: 600; }
.pflow { background: rgba(0,0,0,.05); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.pflow.ok { background: var(--hl-down); color: var(--s-done); }
.gedge.ph-ok { stroke: #9dbfa9; stroke-width: 1.6; }
.gedge.ph-lock { stroke: var(--s-lock); stroke-width: 2.2; stroke-dasharray: 6 4; }

.flowline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.flowline:last-child { border-bottom: none; }
.fchip {
  font-size: 11px; padding: 1px 8px; border-radius: 20px;
  background: rgba(0,0,0,.05); color: var(--muted); white-space: nowrap;
}
.fchip.ok { background: var(--hl-down); color: var(--s-done); }
.fchip.run { background: var(--accent-soft); color: var(--accent); }

/* 甘特左栏 */
.gcell .gname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcell .badge, .gcell .chip { flex: none; }
.gcell .chip.gate { margin-left: 2px; }

/* 阶段行第二排：最终成果 + 前置阶段 */
.ph-row2 {
  flex-basis: 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-top: 5px; margin-top: 3px; border-top: 1px dashed var(--border);
}
.ph-row2 .depl { flex: 1; min-width: 220px; font-size: 12px; }
.ph-row2 .lvl { background: var(--hl-lock); color: #8a6414; }

/* ================= 全景图（阶段 × 流程 无限画布） ================= */
.pano-view {
  position: relative; overflow: hidden; height: 76vh; min-height: 460px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background-color: var(--surface);
  /* 固定的点阵背景：平移时不动，强化「无限画布」的观感 */
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab; user-select: none;
}
.pano-view.grabbing { cursor: grabbing; }
.pano-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }

.pano-col {
  position: absolute; top: 0; background: var(--surface-2); border-radius: 12px;
}
.pano-col.soft { background: #f4f7fb; }
.pano-col-t {
  position: absolute; top: 8px; left: 12px; display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}

/* ---- 阶段方块 ---- */
.pcard {
  position: absolute; box-sizing: border-box; overflow: hidden;
  border: 1px solid var(--border); border-top-width: 3px; border-radius: 11px;
  background: var(--surface); cursor: pointer;
  transition: box-shadow .12s, background .12s;
}
.pcard:hover { box-shadow: 0 5px 18px rgba(0,0,0,.09); z-index: 3; }
.pcard.exp { z-index: 2; box-shadow: 0 6px 20px rgba(0,0,0,.10); }
.pcard.locked { background: #fdfaf0; border-color: #eadfb8; }
.pcard.ok { background: #f6fcf9; }
.pcard.isdone { opacity: .96; }

.pc-hd { position: absolute; left: 10px; right: 10px; top: 6px; height: 32px; display: flex; align-items: center; gap: 6px; }
.pc-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-fold { flex: none; color: var(--muted); font-size: 11px; }
.pc-depl { position: absolute; left: 10px; right: 10px; top: 42px; height: 18px; display: flex; align-items: center; gap: 6px; font-size: 11px; overflow: hidden; white-space: nowrap; }
.pc-depl b { font-size: 11.5px; }
.okmark { color: var(--s-done); flex: none; }
.lockmark { color: var(--s-lock); flex: none; }
.waitmark { color: var(--s-wait); flex: none; }
.pc-prog { position: absolute; left: 10px; right: 10px; top: 64px; height: 22px; display: flex; align-items: center; gap: 8px; }
.pc-prog .pbar { flex: 1; }
.pc-flows { position: absolute; left: 10px; right: 10px; top: 90px; height: 18px; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.pc-meta { position: absolute; left: 10px; right: 10px; top: 112px; height: 16px; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.pc-flows .pflow { font-size: 10.5px; padding: 1px 7px; border-radius: 20px; background: rgba(0,0,0,.05); color: var(--muted); white-space: nowrap; }
.pc-flows .pflow.ok { background: var(--hl-down); color: var(--s-done); }

.pmchip { font-size: 10px; padding: 1px 7px; border-radius: 20px; white-space: nowrap; }
.pmchip.par { background: #eef3fb; color: #3f6ab0; }
.pmchip.lk { background: var(--hl-lock); color: #8a6414; }
.pmchip.dep { background: rgba(0,0,0,.05); color: var(--muted); }
.pmchip.hint { margin-left: auto; color: var(--muted); }

/* ---- 展开内容 ---- */
.pc-rows { position: absolute; inset: 0; pointer-events: none; }  /* 容器透明：否则盖住标题条与折叠按钮，展开后按钮无效、卡片拖不动 */
.pc-sec { position: absolute; left: 10px; right: 10px; height: 20px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: default; pointer-events: auto; }
.prow {
  position: absolute; left: 10px; right: 10px; height: 22px; box-sizing: border-box;
  pointer-events: auto;  /* 父容器 .pc-rows 已关命中，子行单独恢复（点开任务/悬停提示） */
  display: flex; align-items: center; gap: 6px; padding: 0 6px; border-radius: 6px;
  font-size: 11.5px; overflow: hidden;
}
.prow.task { cursor: pointer; }
.prow.task:hover { background: var(--accent-soft); }
.prow.done .pr-nm { text-decoration: line-through; color: var(--muted); }
.prow.lock { background: #fdfaf0; }
.prow.sel { box-shadow: 0 0 0 2px var(--s-wait); }
.prow.stage { font-weight: 600; color: var(--muted); cursor: default; border-top: 1px dashed var(--border); border-radius: 0; }
.prow .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pr-st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-dt { flex: none; font-size: 10px; }
.pr-lk { flex: none; font-size: 10px; }
.pc-actions { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 26px; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

.gedge.tedge { stroke-width: 1.2; }
.gedge.tedge.off { opacity: .12; }
.pano-hint {
  position: absolute; left: 12px; bottom: 10px; pointer-events: none;
  background: rgba(255,255,255,.86); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 12px;
}
.psep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

/* ================= 全景图 · 升级：全屏 / 拖拽 / 聚焦 / 小地图 ================= */
button.ghost.on {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}

/* ---- 全屏 ---- */
.pano-view.full {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: auto; height: auto; min-height: 0;
  border: none; border-radius: 0; z-index: 70;
}
.pano-fs-exit {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  background: rgba(255,255,255,.94); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 12px; cursor: pointer;
}
.pano-fs-exit:hover { background: #fff; border-color: var(--border-2); }

/* ---- 方块拖拽 ---- */
.pc-hd { cursor: grab; }
.pano-view.moving, .pano-view.moving .pc-hd { cursor: grabbing; }
.pcard.moving {
  z-index: 12; opacity: .94;
  box-shadow: 0 14px 34px rgba(0,0,0,.22); outline: 2px solid var(--accent);
}
.pano-view.free .pc-hd::after {
  content: '自由摆放'; margin-left: auto; font-size: 10px; color: var(--muted-2);
}

/* ---- 聚焦链路 / 关键路径 / 定位闪烁 ---- */
.pcard.dim { opacity: .26; filter: grayscale(.5); }
.pcard.crit { outline: 2px solid var(--s-block); outline-offset: -2px; }
.pcard.flash { animation: pflash 1.6s ease-out; }
@keyframes pflash {
  0%   { box-shadow: 0 0 0 0 rgba(24,95,165,.55); }
  40%  { box-shadow: 0 0 0 10px rgba(24,95,165,.10); }
  100% { box-shadow: 0 0 0 0 rgba(24,95,165,0); }
}
.prow.crit { background: #fdecec; }
.prow.crit .pr-nm { color: #b03a34; font-weight: 600; }
.gedge.tedge.crit { stroke: #d9807a; stroke-width: 2.2; opacity: 1; }
.pmchip.od { background: #fdecec; color: #b03a34; }

/* ---- 阶段搜索定位 ---- */
.pano-search { position: relative; }
.pano-search input {
  width: 190px; padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
}
.pano-search input:focus { outline: none; border-color: var(--accent); }
.pn-sug {
  position: absolute; top: 100%; right: 0; margin-top: 4px; z-index: 30;
  min-width: 250px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 26px rgba(0,0,0,.13); overflow: hidden;
}
.pn-sug .sug {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; cursor: pointer;
}
.pn-sug .sug:hover { background: var(--accent-soft); }
.pn-sug .sug .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pn-sug .sug .nm { font-size: 12.5px; }
.pn-sug .sug .small { margin-left: auto; }

/* ---- 缩略导航 ---- */
.pano-mini {
  position: absolute; right: 12px; bottom: 12px; z-index: 6;
  padding: 6px; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,.93); box-shadow: 0 6px 18px rgba(0,0,0,.10);
  cursor: crosshair;
}
.mini-inner { position: relative; }
.mini-card {
  position: absolute; border-radius: 2px; opacity: .55;
}
.mini-card.ok { opacity: .8; }
.mini-card.locked { opacity: .35; }
.mini-card.dim { opacity: .18; }
.mini-vp {
  position: absolute; border: 1.5px solid var(--accent); border-radius: 3px;
  background: rgba(24,95,165,.10); pointer-events: none;
}
.pano-hint { max-width: calc(100% - 200px); }

/* ================= 停留 / 工期预警 ================= */
:root {
  --s-severe: #b03a34;
  --s-over: #d85a30;
  --s-watch: #c08a1e;
}

.card.kpi.clickable { cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.card.kpi.clickable:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); border-color: var(--border-2); }
.card.kpi.clickable.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---- 任务卡 / 全景行上的停留徽标 ---- */
.dwl-tag {
  display: inline-block; font-size: 10.5px; line-height: 1.5;
  padding: 0 6px; border-radius: 20px; white-space: nowrap;
  background: rgba(0,0,0,.06); color: var(--muted);
}
.dwl-tag.severe { background: #fdecec; color: var(--s-severe); font-weight: 600; }
.dwl-tag.overdue { background: #fdeee8; color: var(--s-over); }
.dwl-tag.late_start { background: var(--hl-lock); color: var(--s-lock); }
.dwl-tag.watch { background: #fdf6e3; color: var(--s-watch); }
.dwl-tag.blocked { background: rgba(0,0,0,.06); color: var(--muted); }

.pr-dw {
  flex: none; font-size: 10px; padding: 0 5px; border-radius: 20px;
  background: rgba(0,0,0,.06); color: var(--muted);
}
.pr-dw.severe { background: #fdecec; color: var(--s-severe); font-weight: 600; }
.pr-dw.overdue { background: #fdeee8; color: var(--s-over); }
.pr-dw.late_start { background: var(--hl-lock); color: var(--s-lock); }
.pr-dw.watch { background: #fdf6e3; color: var(--s-watch); }

/* ---- 预警页分组表 ---- */
.al-group { margin-top: 18px; }
.al-group:first-of-type { margin-top: 6px; }
.al-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 2px; border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.al-group .tbl td { vertical-align: top; }
.dwl-strong { font-weight: 600; font-size: 13px; }
.dwl-mini {
  height: 4px; border-radius: 3px; background: rgba(0,0,0,.07);
  margin-top: 4px; overflow: hidden; max-width: 130px;
}
.dwl-mini i { display: block; height: 100%; border-radius: 3px; }
.dwl-pill {
  display: inline-block; font-size: 11px; line-height: 1.7;
  padding: 0 8px; border-radius: 20px; color: #fff; white-space: nowrap;
}
.dwl-pill.soft { background: #fdf6e3; color: var(--s-watch); }

/* ---- 抽屉里的停留面板 ---- */
.dwell-box {
  border: 1px solid var(--border); border-left: 3px solid var(--muted-2);
  border-radius: 8px; padding: 9px 11px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 4px;
}
.dwell-box.severe { border-left-color: var(--s-severe); background: #fdf6f5; }
.dwell-box.overdue { border-left-color: var(--s-over); background: #fdf7f5; }
.dwell-box.late_start { border-left-color: var(--s-lock); background: var(--hl-lock); }
.dwell-box.watch { border-left-color: var(--s-watch); background: #fdfaf0; }
.dwell-box.done { border-left-color: var(--s-done); background: var(--hl-down); }
.dwb-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.dwb-row span { color: var(--muted); }
.dwb-row b { font-size: 13px; }
.dwb-bar { height: 5px; border-radius: 3px; background: rgba(0,0,0,.08); overflow: hidden; margin: 3px 0 2px; }
.dwb-bar i { display: block; height: 100%; border-radius: 3px; }

/* ============================================================
   简化改造：二级页签 / 问题清单 / 悬浮浮层 / 阶段所需与影响
   ============================================================ */

.tabs.sub { padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tabs.sub button {
  font-size: 12px; padding: 6px 12px; border: none; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); border-radius: 0;
}
.tabs.sub button:hover { color: var(--text); background: rgba(0,0,0,.03); }
.tabs.sub button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: var(--surface); }
.sbadge {
  display: inline-block; margin-left: 5px; min-width: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--s-block); color: #fff; font-size: 10px; line-height: 15px; text-align: center;
}

/* ============================================================
   统一状态徽章：彩色圆点 + 状态文字（6 状态全站统一）
   未开始=灰 · 进行中=蓝 · 待外部=琥珀 · 阻塞=红 · 已完成=绿 · 无需办理=浅灰
   ============================================================ */
.st-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2); flex: none;
}
.stx {
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap; vertical-align: middle; font-size: 12px; color: var(--text);
}
.nd-miss .st-dot, .tcard .st-dot, .kb-card .st-dot, .gname .st-dot { margin-right: 5px; }
.st-tx { font-size: 11px; color: var(--muted); margin-left: 5px; }
.st-legend-wrap {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px;
}
.st-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px;
  font-size: 11.5px; color: var(--muted);
}
.st-legend .stx { font-size: 11.5px; color: var(--muted); }
.st-note { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; line-height: 1.6; }

/* ============================================================
   左侧导航栏（全局）+ 顶栏偏移 + 项目卡分页
   收缩：body.nav-collapsed 把 --nav-w 覆盖为 60px（body 上定义，
   对 .sidenav/.topbar/.tabs.sub/.page 全部生效），并记忆到 localStorage。
   ============================================================ */
body.nav-collapsed { --nav-w: 60px; }

.sidenav {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--nav-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; z-index: 40;
  padding: 14px 12px; overflow-y: auto; overflow-x: hidden;
  transition: width .18s ease;
}
.nav-brand {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 15px; font-weight: 700; letter-spacing: .3px; padding: 2px 6px 10px; white-space: nowrap;
}
.nav-brand .nb-txt { flex: 1; min-width: 0; overflow: hidden; }
.nav-brand span { color: var(--accent); }
.nav-fold {
  flex: none; width: 24px; height: 24px; padding: 0; line-height: 22px;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px;
  color: var(--muted); font-size: 13px; cursor: pointer;
}
.nav-fold:hover { color: var(--accent); border-color: var(--accent); }

/* 分组小标题 */
.nav-sec-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .8px; color: var(--muted-2);
  padding: 12px 10px 4px; white-space: nowrap;
}

.nav-main { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; border-radius: 9px;
  color: var(--muted); font-size: 13.5px; text-align: left; cursor: pointer;
  border-left: 3px solid transparent; white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.nav-item .ni { width: 18px; height: 18px; flex: none; }
.nav-item .ni path { fill: currentColor; }
.nav-item .nl { flex: 1; }
.nav-badge {
  min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--s-block);
  color: #fff; font-size: 10px; line-height: 17px; text-align: center; flex: none;
}

.nav-foot { margin-top: auto; padding-top: 12px; }
.nav-foot .block { width: 100%; }

/* 收缩态：只留图标 */
.sidenav.collapsed { padding: 14px 8px; }
.sidenav.collapsed .nav-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.sidenav.collapsed .nb-txt, .sidenav.collapsed .nav-sec-label,
.sidenav.collapsed .nav-item .nl, .sidenav.collapsed .bf-full { display: none; }
.sidenav.collapsed .bf-mini { display: inline; }
.sidenav.collapsed .nav-item { position: relative; justify-content: center; padding: 10px 0; }
.sidenav.collapsed .nav-item .nav-badge { position: absolute; }
.sidenav.collapsed .nav-foot .block { width: 100%; padding: 8px 0; font-size: 15px; }
.bf-mini { display: none; }

/* 顶栏 / 二级页签 / 内容区让出导航栏宽度（含平滑过渡） */
.topbar { margin-left: var(--nav-w); transition: margin-left .18s ease; }
.tabs.sub { margin-left: var(--nav-w); transition: margin-left .18s ease; }
.page { margin-left: var(--nav-w); transition: margin-left .18s ease; }

/* 面包屑：顶栏左，标明当前位置（工作区 / 项目 / 视图） */
.crumb { display: flex; align-items: baseline; gap: 7px; font-size: 13px; min-width: 0; overflow: hidden; }
.crumb-sep { color: var(--muted-2); }
.crumb-item { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-item.on { color: var(--text); font-weight: 600; }

.pager { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pager .grow { flex: 1; }

@media (max-width: 1024px) {
  :root { --nav-w: 180px; }
  .nav-item .nl { font-size: 12.5px; }
}
@media (max-width: 720px) {
  /* 窄屏默认收成图标条（用户仍可手动展开，body.nav-collapsed 的 60px 会覆盖此值） */
  body:not(.nav-collapsed) { --nav-w: 56px; }
  .sidenav { padding: 14px 8px; }
  .sidenav:not(.collapsed) .nb-txt, .sidenav:not(.collapsed) .nav-sec-label,
  .sidenav:not(.collapsed) .nav-item .nl, .sidenav:not(.collapsed) .bf-full { display: none; }
  .sidenav:not(.collapsed) .bf-mini { display: inline; }
  .sidenav:not(.collapsed) .nav-brand { justify-content: center; }
  .sidenav:not(.collapsed) .nav-item { position: relative; justify-content: center; padding: 10px 0; }
  .sidenav:not(.collapsed) .nav-item .nav-badge { position: absolute; }
}

/* ============================================================
   多项目扩展：当前项目上下文徽标 + 组合视图
   ============================================================ */
/* 顶栏当前项目只读徽标（切换项目走总览项目卡 / 项目台账） */
.ctx-chip { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* 总览分区节奏：标题行 + 与上一区块的明确间隔 */
.dash-sec { margin-top: 22px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sec-title { font-weight: 600; font-size: 15px; }

/* 组合项目卡：风险徽标 */
.proj-card .chip.dot[style*="b03a34"] { font-weight: 600; }

/* ---- 问题清单 ---- */
.prob-card { padding: 0; overflow: hidden; }
.prob-card .tbl { border: none; }
.prob-card tbody tr:hover { background: var(--hl-lock); }

/* ---- 原因分类 chip ---- */
.rk {
  display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; line-height: 16px;
  background: #eee; color: #666; white-space: nowrap;
}
.rk.k-external { background: #fdf0e3; color: #a35a06; }
.rk.k-approve  { background: #eaf0fb; color: #24508f; }
.rk.k-material { background: #f3ecfb; color: #5a3d8c; }
.rk.k-money    { background: #fdecec; color: #a33b3b; }
.rk.k-internal { background: #e8f5f0; color: #12735a; }
.rk.k-other    { background: #eeeeea; color: var(--muted); }
.auto-rsn {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px; font-size: 10px;
  background: #fdf6e3; color: var(--s-watch); border: 1px dashed #d9c48a;
}
.rsn { margin-top: 2px; color: var(--text); }

/* ---- 节点悬浮浮层 ---- */
.nodepop {
  position: fixed; z-index: 9999; width: 330px; background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 12px 14px; pointer-events: none;
}
.np-hd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.np-nm { font-size: 13px; line-height: 1.4; }
.np-sub { margin-bottom: 8px; }
.np-stick { display: inline-block; padding: 2px 9px; border-radius: 9px; color: #fff; font-size: 11px; margin-bottom: 8px; }
.np-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 8px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.np-grid > div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12px; }
.np-grid span { color: var(--muted); }
.np-grid b { font-weight: 600; }
.np-grid b.od { color: var(--s-block); }
.np-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.np-rsn { flex: 1; min-width: 0; }
.np-ft { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }

/* ---- 阶段所需与影响 ---- */
.need-list { display: flex; flex-direction: column; gap: 12px; }
.need-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.need-card.blocking { border-color: #e8c9c6; box-shadow: 0 1px 0 rgba(176,58,52,.10); }
.need-card.obtained { border-color: #c6e6da; }
.nd-hd {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); border-left: 4px solid var(--accent);
}
.nd-nm { font-weight: 600; font-size: 14px; }
.tag.warn { background: #fdecec; color: var(--s-severe); font-weight: 600; }
.nd-body { display: flex; gap: 16px; padding: 12px 14px; align-items: flex-start; }
.nd-col { flex: 0 0 210px; min-width: 0; }
.nd-col.grow2 { flex: 1 1 auto; }
.nd-t { font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-bottom: 4px; }
.nd-v { font-size: 12.5px; }
.nd-miss {
  display: inline-block; margin: 2px 4px 2px 0; padding: 1px 7px; border-radius: 8px;
  background: #fdf6e3; color: #8a6a10; font-size: 11.5px; cursor: pointer; border: 1px solid #ecdcb4;
}
.nd-miss:hover { background: #fbeecd; }
.nd-flows { display: flex; gap: 8px; flex-wrap: wrap; }
.nd-flow { flex: 1 1 150px; min-width: 140px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.nd-flow.done { background: #f0f9f5; border-color: #c6e6da; }
.nd-flow.run { background: #fdfaf0; border-color: #ecdcb4; }
.nf-hd { display: flex; align-items: center; gap: 5px; font-size: 12px; margin-bottom: 4px; }
.nf-nm { font-weight: 600; }
.nf-ok { margin-left: auto; color: var(--s-done); }
.nf-miss { margin-top: 5px; }
.pbar.xs { height: 4px; }
.nd-blk { display: flex; align-items: baseline; gap: 5px; font-size: 12px; padding: 2px 0; }
.nd-blk.on { color: var(--s-block); }
.nd-blk .bd { width: 14px; }

/* ---- 影响面 / 卡点原因（抽屉） ---- */
.impact-box {
  border: 1px solid var(--border); border-left: 3px solid var(--s-over);
  border-radius: 8px; padding: 8px 10px; background: var(--surface-2);
}
.imp-hd { font-size: 13px; margin-bottom: 4px; }
.imp-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.imp-item { padding: 1px 7px; border-radius: 8px; background: #eee; color: #555; font-size: 11.5px; }
.chiprow.hold-kind button { font-size: 12px; padding: 3px 9px; margin-bottom: 6px; }
.chiprow.hold-kind button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   工作情况总览 / 项目对比 / 分享管理
   ============================================================ */
.tbl td.num, .tbl th.num { text-align: center; font-variant-numeric: tabular-nums; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.tbl tfoot td { background: var(--surface-2); font-weight: 600; }
.share-url { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.share-link {
  padding: 9px 10px; background: var(--accent-soft); color: var(--accent);
  border-radius: 8px; cursor: pointer; word-break: break-all; font-size: 13px;
}
.share-link:hover { text-decoration: underline; }

/* 项目对比：左侧勾选 + 右侧对比表 */
.cmp-wrap { display: flex; gap: 16px; align-items: flex-start; }
.cmp-pick { width: 264px; flex: none; position: sticky; top: 64px; padding: 12px; }
.cmp-pick-list { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; }
.cmp-pick-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 6px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.cmp-pick-item:hover { background: var(--surface-2); }
.cmp-pick-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cmp-pick-item .nm {
  flex: 1; font-size: 13px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmp-pick-item:last-child { border-bottom: none; }
.cmp-table { flex: 1; min-width: 0; overflow-x: auto; padding: 0; }
.cmp td.dim, .cmp th.dim {
  font-weight: 600; background: var(--surface-2); white-space: nowrap;
  text-align: left; padding: 8px 12px;
}

/* 工作情况表（项目工作台 · 看板后页签）：项目为列、阶段分组行 + 任务行 */
.wk td, .wk th { vertical-align: middle; }
.wk td.dim {
  font-weight: 600; background: var(--surface-2); white-space: nowrap;
  text-align: left; padding: 8px 12px;
}
.wk-ph td {
  background: #e7f0e9; font-weight: 600; text-align: left;
  padding: 7px 12px; border-left: 3px solid var(--s-done);
}
.wk .obt { color: var(--s-done); font-size: 12px; font-weight: 600; margin-left: 6px; }
.wk td .stx { white-space: nowrap; }
.wk td b { margin-left: 5px; font-size: 11px; }
/* 状态格第二行：计划完成 + 剩余/超期天数（超期红字） */
.wk-plan {
  display: block; font-size: 11.5px; color: var(--muted);
  margin-top: 3px; white-space: nowrap;
}
.wk-plan.odv { color: var(--s-block); }

/* 打印（对比表 / 总览表）：只打内容，隐藏导航与工具栏 */
@media print {
  .sidenav, .topbar, .tabs, .no-print, .mask, .drawer, .cmp-pick { display: none !important; }
  .page, .topbar, .tabs.sub { margin: 0 !important; }
  body { background: #fff; }
  .cmp-wrap { display: block; }
  .cmp-table { overflow: visible; box-shadow: none; }
  .tbl { font-size: 11px; }
}

/* ========================= 登录界面（未登录整页覆盖） ========================= */
.login-mask {
  position: fixed; inset: 0; z-index: 9000;
  display: grid; grid-template-columns: minmax(340px, 46%) 1fr;
  background: var(--bg);
}
.login-brand {
  background: linear-gradient(160deg, #1c4a36 0%, #235841 58%, #2a6449 100%);
  color: #fff; padding: 56px 52px 34px;
  display: flex; flex-direction: column;
}
.lb-eyebrow {
  font-size: 11px; letter-spacing: .3em; opacity: .68; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.lb-eyebrow::before { content: ""; width: 22px; height: 1px; background: rgba(255,255,255,.5); }
.login-brand h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; line-height: 1.3; letter-spacing: .02em; }
.lb-co { font-size: 15px; opacity: .86; margin-top: 12px; letter-spacing: .06em; }
.lb-feat { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.lb-feat span {
  font-size: 13px; opacity: .9; display: flex; align-items: center; gap: 9px;
}
.lb-feat span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #7fc7a4; flex: none;
}
.lb-foot { font-size: 12px; opacity: .55; margin-top: 30px; border-top: 1px solid rgba(255,255,255,.16); padding-top: 14px; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 28px; }
.login-card {
  width: min(380px, 100%); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px -12px rgba(30, 40, 32, .18);
  padding: 34px 34px 26px;
  animation: login-in .45s cubic-bezier(.2, .7, .3, 1);
}
@keyframes login-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lc-mark { font-size: 17px; font-weight: 700; color: #20563f; letter-spacing: .5px; }
.lc-hi { font-size: 20px; font-weight: 650; margin: 14px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field input { width: 100%; }
.login-card .field label { font-size: 12px; color: var(--muted); }
.login-err {
  background: #fdeceb; border: 1px solid #f6c6c3; color: #b03a34;
  font-size: 12.5px; border-radius: 8px; padding: 8px 12px; margin: 4px 0 12px;
}
.lc-btn { width: 100%; height: 42px; font-size: 15px; letter-spacing: .3em; margin-top: 4px; }
.lc-ft { font-size: 12px; color: var(--muted-2); text-align: center; margin-top: 20px; }
@media (max-width: 760px) {
  .login-mask { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { padding: 34px 26px 22px; }
  .lb-feat { display: none; }
  .lb-foot { margin-top: 18px; }
  .login-brand h1 { font-size: 22px; }
  .login-side { align-items: flex-start; padding-top: 34px; }
}

/* ========================= 顶栏用户区 ========================= */
.user-chip { position: relative; margin-left: 4px; }
.uc-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 8px;
  background: var(--surface);
}
.uc-btn:hover { border-color: var(--border-2); }
.uc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-not); flex: none; }
.uc-dot.adm { background: var(--s-ing); }
.uc-name { font-weight: 600; }
.uc-role { font-size: 11px; color: var(--muted); border-left: 1px solid var(--border); padding-left: 8px; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 500;
  width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.18); overflow: hidden;
}
.um-id { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.um-id b { font-size: 14px; }
.um-item {
  display: block; width: 100%; text-align: left; border: none; border-radius: 0;
  padding: 10px 14px; background: transparent;
}
.um-item:hover { background: var(--surface-2); }
.um-out { border-top: 1px solid var(--border); color: var(--s-block); }

/* ========================= 用户管理（部门 + 用户表） ========================= */
.users-grid {
  display: grid; grid-template-columns: 250px 1fr; gap: 14px; align-items: start;
}
.dept-card { padding: 12px; }
.dept-hd { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 10px; }
.dept-add { display: flex; gap: 6px; margin-bottom: 10px; }
.dept-add input { flex: 1; min-width: 0; }
.dept-list { display: flex; flex-direction: column; }
.dept-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; border-radius: 8px; border-bottom: 1px solid var(--border);
}
.dept-row:last-child { border-bottom: none; }
.dept-row:hover { background: var(--surface-2); }
.dept-row .dn { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-row .da { display: none; gap: 2px; }
.dept-row:hover .da { display: inline-flex; }
.empty.sm { font-size: 12.5px; padding: 12px 6px; }
@media (max-width: 860px) {
  .users-grid { grid-template-columns: 1fr; }
}
@media print { .login-mask { display: none; } }

/* ========================= 材料就绪度徽标（④）+ 材料台账细节（③） ========================= */
.prow .pr-mat {
  margin-left: auto; flex: none;
  font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 8px;
  color: #ba7517; background: rgba(186, 117, 23, .12);
}
.prow .pr-mat.ok { color: var(--s-done); background: rgba(29, 158, 117, .12); }

/* ---- 全景图材料供给线（产出 ✦ → 需材料 📎，虚线） ---- */
.gedge.medge { stroke-width: 1.5; stroke-dasharray: 5 4; }
.gedge.medge.mat-ok { stroke: #1d9e75; opacity: .85; }
.gedge.medge.mat-pend { stroke: #8b5cf6; opacity: .8; }
.gedge.medge:hover { stroke-width: 2.6; opacity: 1; }
.mlabel {
  font-size: 10px; pointer-events: none;
  paint-order: stroke; stroke: rgba(255, 255, 255, .88); stroke-width: 3px;
  fill: #6d5bd0; font-weight: 500;
}
.mlabel.mat-ok { fill: #0f7a58; }
.prow .pr-out {
  flex: none; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 8px;
  color: #6d28d9; background: rgba(139, 92, 246, .13); cursor: default;
}
.mats td { vertical-align: top; }

/* 材料行内小标记：「成果」（某线最终成果）/「共享」（跨线流通） */
.m-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 11px; line-height: 18px; border-radius: 9px; vertical-align: 1px;
  background: #eaf3de; color: #3b6d11; border: 0.5px solid #97c459;
}
.m-tag.shared { background: #e6f1fb; color: #185fa5; border-color: #85b7eb; }
/* 成果门禁一键确认按钮：绿色描边突出「可解锁下游」 */
.gate-go { color: #1d9e75; border-color: #5dcaa5; }

/* ========================= 全景图交互升级（R27） ========================= */
/* ---- 悬停高亮关联线 / 淡化无关 ---- */
.gedge.hl { stroke-width: 2.8; opacity: 1; }
.gedge.dim2 { opacity: .1; }
.mlabel.dim2 { opacity: .12; }
/* ---- 材料线两端「供给口」圆点：产出侧实心 / 消费侧空心 ---- */
.gedge.medge { stroke-width: 2; }
.mport { fill: #1d9e75; stroke: #fff; stroke-width: 1.4; pointer-events: none; }
.mport.mat-pend { fill: #8b5cf6; }
.mport.end { fill: #fff; stroke: #8b5cf6; }
.mport.mat-ok.end { stroke: #1d9e75; }
.mport.hl { stroke-width: 2.2; }
.mport.dim2 { opacity: .12; }
/* ---- 任务行悬停高亮：依赖链上下游 / 材料伙伴 ---- */
.prow.r-focus { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.prow.r-up { background: var(--hl-up); }
.prow.r-down { background: var(--hl-down); }
.prow.r-dim { opacity: .28; }
.prow.mhl { box-shadow: 0 0 0 2px #8B5CF6; background: rgba(139, 92, 246, .08); }
/* 悬停任务的材料伙伴在收起方块里 → 方块紫色描边 */
.pcard.mhl { outline: 2px solid #8B5CF6; outline-offset: -1px; }
/* ---- 整卡可拖 + 折叠按钮 ---- */
.pano-view.free .pcard { cursor: move; }
.pc-fold {
  flex: none; width: 22px; height: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--muted);
  font-size: 11px; line-height: 1; cursor: pointer;
}
.pc-fold:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* ---- 层（列）标题拖动排序 ---- */
.pano-col-t { cursor: grab; }
.pano-col-t:active { cursor: grabbing; }
.col-grip { color: var(--muted-2); font-size: 13px; line-height: 1; }
.pano-col.drag { outline: 1.5px dashed var(--accent); outline-offset: -2px; }
.pano-col.drag .pano-col-t { color: var(--accent); }
