/* 投标管理 PC 原型 · 共享样式
   Web 端基准族取值 挤压式两栏工作台
   阶段条已完成格按用户指定用 #13C2C2 配白字（用户 2026-11-13） */
:root {
  --brand: #1677FF;
  --brand-deep: #0958D9;
  --brand-light: #E6F4FF;
  --success-deep: #237804;
  --success-light: #F6FFED;
  --warn-deep: #AD4E00;
  --warn-light: #FFFBE6;
  --danger: #FF4D4F;
  --danger-deep: #CF1322;
  --danger-light: #FFF2F0;
  --progress: #13C2C2;
  --progress-deep: #006D75;
  --progress-light: #E6FFFB;
    --t1: #262626;
  --t2: #595959;
  --t3: #8C8C8C;
  --line: #F0F0F0;
  --line-strong: #D9D9D9;
  --page: #F5F5F5;
  --fill: #FAFAFA;
  --card: #FFFFFF;
  --shadow-card: 0 1px 2px rgba(0,0,0,.03), 0 1px 6px -1px rgba(0,0,0,.02), 0 2px 4px rgba(0,0,0,.02);
  --shadow-pop: 0 6px 16px rgba(0,0,0,.08), 0 3px 6px -4px rgba(0,0,0,.12), 0 9px 28px 8px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--t1);
  background: var(--page);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 22px;
  overflow: hidden;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.lucide { width: 16px; height: 16px; stroke-width: 2; flex: none; }

.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 1060;
  background: var(--card); color: var(--brand-deep); padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--line-strong);
}
.skip-link:focus { top: 8px; }

/* 顶部导航与面包屑 */
.topbar {
  position: relative; z-index: 100; height: 56px;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(12px, 1.6vw, 24px);
}
.brand { font-size: 16px; font-weight: 600; color: var(--t1); white-space: nowrap; }
.brand span { color: var(--t2); font-weight: 400; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.demo-mark { font-size: 12px; color: var(--t2); }
/* 挤压式两栏外壳 */
.workbench { position: relative; display: flex; height: calc(100vh - 56px); }
.pane { min-width: 0; height: 100%; }
.list-pane {
  flex: 1 1 auto; background: var(--page);
  transition: flex-basis .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
}
.workbench[data-depth="2"] .list-pane {
  flex: 0 0 320px; width: 320px; border-right: 1px solid var(--line-strong);
}
.detail-pane {
  flex: 0 0 0; width: 0; overflow: hidden; background: var(--page);
  transition: flex-basis .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
}
.workbench[data-depth="2"] .detail-pane { flex: 1 1 auto; width: auto; overflow: visible; }
.pane-scroll { height: 100%; overflow-y: auto; overflow-x: hidden; }
.detail-pane .pane-scroll { padding: 12px 24px 12px 12px; }

.pane-head {
  display: flex; align-items: center; gap: 8px; min-height: 36px;
  padding: 8px 12px 4px; flex-wrap: wrap;
}
.pane-head h1 { font-size: 16px; line-height: 24px; font-weight: 600; }
.workbench[data-depth="2"] .list-pane .pane-head { padding: 6px 8px 2px; min-height: 32px; }
.workbench[data-depth="2"] .list-pane .pane-head h1 { font-size: 14px; }

.link-btn {
  border: 0; background: none; padding: 4px 2px; min-height: 28px;
  font-size: 12px; line-height: 20px; color: var(--brand-deep);
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--t3); cursor: not-allowed; text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--t1);
  font-size: 12px; line-height: 20px; white-space: nowrap;
}
.btn:hover { background: var(--page); }
.btn:disabled { color: var(--t3); background: var(--fill); cursor: not-allowed; }
.btn-primary { background: var(--brand-deep); border-color: var(--brand-deep); color: #FFFFFF; }
.btn-primary:hover { background: #003EB3; }
.btn-sm { height: 28px; padding: 0 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--card); color: var(--t2);
}
.icon-btn:hover { background: var(--page); color: var(--t1); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-card); }
.card + .card { margin-top: 12px; }
.alert {
  display: flex; align-items: center; gap: 8px; margin: 0 12px 8px;
  padding: 8px 12px; border-radius: 6px; font-size: 12px; line-height: 20px;
  background: var(--warn-light); border: 1px solid #FFE58F; color: var(--warn-deep);
}
.alert.danger { background: var(--danger-light); border-color: #FFCCC7; color: var(--danger-deep); }

/* 满屏态筛选 一行常驻 */
.filter-bar {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(200px, 360px) 140px 120px 128px auto; justify-content: start;
  padding: 8px 12px;
}
.filter-bar select, .filter-bar .search-box { width: 100%; }
.field-err { font-size: 12px; color: var(--danger-deep); }
input[type="datetime-local"] { height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card); font-size: 12px; }
textarea {
  width: 100%; padding: 6px 8px; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card);
  font-size: 12px; line-height: 20px;
}
input[type="text"], input[type="date"], select {
  height: 32px; width: 100%; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card);
  font-size: 12px; line-height: 20px;
}
input::placeholder { color: var(--t2); }
.search-box { position: relative; }
.search-box .lucide { position: absolute; left: 8px; top: 8px; color: var(--t2); }
.search-box input { padding-left: 30px; }

.result-count { font-size: 12px; color: var(--t2); }
.chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 0 12px 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px;
  padding: 0 6px; border: 1px solid #91CAFF; border-radius: 4px;
  background: var(--brand-light); color: var(--brand-deep); font-size: 12px;
}
.chip .lucide { width: 12px; height: 12px; }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; min-width: 960px; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--fill); border-bottom: 1px solid var(--line-strong);
  padding: 6px 12px; text-align: left; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--t1);
  white-space: nowrap;
}
tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  font-size: 12px; line-height: 20px; vertical-align: top;
}
tbody tr[data-id] { cursor: pointer; }
tbody tr:nth-child(even) { background: var(--fill); }
tbody tr:hover { background: var(--brand-light); }
.cell-name { min-width: 220px; }
.cell-link { display: flex; align-items: center; gap: 6px; color: var(--brand-deep); font-size: 12px; line-height: 20px; font-weight: 500; }
.cell-step { min-width: 200px; max-width: 280px; }
.cur-step { display: block; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-step b { font-weight: 500; color: var(--t2); font-variant-numeric: tabular-nums; }
.cur-due { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.cell-sub { display: block; color: var(--t2); font-size: 12px; line-height: 20px; }
.cell-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 20px; padding: 0 6px; border-radius: 4px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.tag .lucide { width: 12px; height: 12px; }
.tag-info { background: var(--brand-light); color: var(--brand-deep); }
.tag-success { background: var(--success-light); color: var(--success-deep); }
.tag-progress { background: var(--progress-light); color: var(--progress-deep); }
.tag-danger { background: var(--danger-light); color: var(--danger-deep); }
.tag-warn { background: var(--warn-light); color: var(--warn-deep); }
.tag-neutral { background: var(--fill); color: var(--t2); border: 1px solid var(--line-strong); }
.tag-limit { background: var(--fill); color: var(--t2); border: 1px solid var(--line-strong); }
.tag-urgent { background: var(--danger-light); color: var(--danger-deep); border: 1px solid #FFCCC7; font-weight: 500; }
/* 行内阶段节点：形状与颜色双通道，短名常驻 */
.cell-nodes { min-width: 312px; }
.nodes { display: flex; align-items: flex-start; }
.node { display: flex; flex-direction: column; align-items: center; width: 50px; flex: none; }
.node-l { display: flex; align-items: center; width: 100%; height: 16px; }
.node-l i { flex: 1; height: 1px; background: var(--line-strong); }
.node-l i.done { background: var(--progress); }
.node-l i.hide { background: transparent; }
.nd {
  display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  background: var(--card); color: #FFFFFF;
}
.nd .lucide { width: 10px; height: 10px; stroke-width: 3; }
.node-done .nd { background: var(--progress); }
.node-cur .nd { background: var(--brand); box-shadow: 0 0 0 3px #BAE0FF; }
.node-todo .nd { border: 1px solid var(--line-strong); }
.node-bad .nd { background: var(--danger); }
.node-t { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--t2); white-space: nowrap; }
.node-done .node-t { color: var(--t1); }
.node-cur .node-t { color: var(--brand-deep); font-weight: 500; }
.node-bad .node-t { color: var(--danger-deep); font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--t2); }
.empty-row td { background: var(--card); }
.empty-row:hover td { background: var(--card); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 0; color: var(--t2); }
.empty .lucide { width: 20px; height: 20px; color: var(--t3); }
.empty strong { color: var(--t1); font-size: 14px; font-weight: 500; }
.empty span { font-size: 12px; }
.empty .btn { margin-top: 8px; }

/* 挤压态左栏 */
.compact-toolbar { padding: 4px 8px 8px; }
.compact-toolbar .search-box { width: 100%; }
.compact-chips { padding: 0 8px 8px; }
.compact-chips .chips { padding: 0; }
.compact-list { padding: 0 8px 8px; }
.compact-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: 1px solid var(--line); border-bottom: 0; background: var(--card);
}
.compact-item:first-child { border-radius: 6px 6px 0 0; }
.compact-item:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.compact-item:hover { background: var(--brand-light); }
.compact-item.is-active { background: var(--brand-light); box-shadow: inset 3px 0 0 var(--brand); }
.ci-top { display: flex; align-items: center; gap: 6px; }
.ci-name { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 20px; font-weight: 500; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-mid { display: block; margin-top: 2px; font-size: 12px; line-height: 20px; }
.ci-nodes { display: block; margin-top: 6px; }
.ci-nodes .node { width: 42px; }
.compact-pager { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 8px 12px; font-size: 12px; color: var(--t2); }

/* 右栏详情 */
.detail-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 12px; }
.detail-head h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
.dh-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.detail-head .code { flex-basis: 100%; font-size: 12px; color: var(--t2); }
.detail-head .head-tags { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.meta-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
  padding: 0 12px 12px; border-bottom: 1px solid var(--line);
}
.meta-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-item .k { font-size: 12px; line-height: 20px; color: var(--t2); }
.meta-item .v { font-size: 14px; line-height: 22px; color: var(--t1); font-variant-numeric: tabular-nums; }
/* 详情箭头式阶段条：外层填描边色 内层 inset 1px 填底色 clip-path 咬合 */
.stage-wrap { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.stage { display: flex; align-items: stretch; }
.stg {
  flex: 1; min-width: 0; position: relative; padding: 4px 14px 4px 22px; margin-left: -5px;
  background: var(--card); color: #FFFFFF; text-align: left;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
}
.stg::before { content: ""; position: absolute; inset: 1px; clip-path: inherit; background: var(--stg-bg); }
.stg:first-child { margin-left: 0; padding-left: 10px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.stg:last-child { padding-right: 10px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); }
.stg > b, .stg > span { position: relative; z-index: 1; display: block; }
.stg > b { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.stg > b .lucide { width: 12px; height: 12px; stroke-width: 3; flex: none; }
.stg-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stg > span { font-size: 12px; line-height: 16px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stg-done { --stg-bg: #13C2C2; }
.stg-cur { --stg-bg: #006D75; }
.stg-cur::before { box-shadow: inset 0 0 0 2px #FFFFFF; }
.stg-cur > b { font-weight: 600; }
.stg-todo { --stg-bg: #F0F0F0; color: #595959; }
.stg-bad { --stg-bg: #CF1322; }
.detail-alert { margin: 0 12px 12px; }
.detail-alert .lucide { flex: none; }
.detail-alert .link-btn { margin-left: auto; flex: none; color: var(--danger-deep); }

.phase { margin-top: 12px; }
.phase-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.phase-head h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.phase-hint { font-size: 12px; color: var(--t2); }
.phase-head.is-toggle { cursor: pointer; }
.phase-head.is-toggle:hover { background: var(--page); }
.phase-head.is-toggle { border-radius: 8px 8px 0 0; }
.phase.is-collapsed .phase-head { border-bottom: 0; border-radius: 8px; }
.phase-toggle {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  font-size: 16px; line-height: 24px; font-weight: 600; color: var(--t1);
}
.phase-toggle .lucide { color: var(--t2); }
.phase-count { margin-left: auto; font-size: 12px; color: var(--progress-deep); font-variant-numeric: tabular-nums; }
.step-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 196px; gap: 12px; align-items: start;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.step-row:last-child { border-bottom: 0; }
.step-row.is-done { box-shadow: inset 3px 0 0 var(--progress); }
.step-row.is-lock, .step-row.is-wait { padding-top: 6px; padding-bottom: 6px; }
.step-row.is-lock .step-name, .step-row.is-wait .step-name { color: var(--t2); font-weight: 400; }
.step-row { transition: background-color .12s ease; }
.step-row:hover { background: var(--page); }
.step-row.is-cur { box-shadow: inset 3px 0 0 var(--brand); }
.step-row.is-cur .step-name { font-weight: 600; }
.step-row.is-over { box-shadow: inset 3px 0 0 var(--danger); }
.step-main { display: flex; gap: 10px; min-width: 0; }
.step-text { display: block; min-width: 0; flex: 1; }
.step-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; line-height: 22px; font-weight: 500; }
.step-no { min-width: 22px; color: var(--t2); font-size: 12px; font-variant-numeric: tabular-nums; }
.step-note { display: block; margin-top: 2px; font-size: 12px; line-height: 20px; color: var(--t2); }
.step-note .who { color: var(--t1); }
.sep { margin: 0 6px; color: var(--t3); }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 22px; flex: none; color: var(--t3); }
.mark .lucide { width: 16px; height: 16px; }
.mark.is-open { color: var(--t2); }
.mark.is-done { color: var(--progress-deep); }
.step-ops { display: flex; justify-content: flex-end; }
.choice { display: inline-flex; align-items: center; gap: 8px; }
.choice-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 88px; height: 28px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--t1); font-size: 12px; line-height: 20px; font-weight: 400;
}
.choice-btn:hover { border-color: var(--brand-deep); color: var(--brand-deep); }
.choice-btn .lucide { width: 12px; height: 12px; stroke-width: 3; }
.choice-btn[aria-pressed="true"] { border-color: var(--progress-deep); background: var(--progress-light); color: var(--progress-deep); font-weight: 500; }
.choice-btn.is-end:hover { border-color: var(--danger-deep); color: var(--danger-deep); }
.choice-btn.is-end[aria-pressed="true"] { border-color: var(--danger-deep); background: var(--danger-light); color: var(--danger-deep); }
.subs { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.step-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 12px; line-height: 20px; min-width: 0; }
.step-meta .num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--t2); }
.meta-label, .meta-sub { color: var(--t2); font-size: 12px; }

/* 操作记录弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: min(720px, 90vw); max-height: min(80vh, 720px);
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 8px; box-shadow: var(--shadow-pop);
}
.modal-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.modal-head .count { font-size: 12px; color: var(--t2); }
.modal-head .head-right { margin-left: auto; }
.modal-head select { width: 240px; margin-left: 8px; }
.modal-body { padding: 8px 16px 16px; overflow-y: auto; }
.modal-sm { width: min(440px, 90vw); }
.confirm-body { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; font-size: 14px; line-height: 22px; }
.confirm-body .field { display: flex; flex-direction: column; gap: 4px; }
.confirm-body label { font-size: 12px; color: var(--t2); }
.confirm-list { margin: 0; padding-left: 20px; font-size: 12px; line-height: 20px; color: var(--t1); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.btn-danger { background: var(--danger-deep); border-color: var(--danger-deep); color: #FFFFFF; }
.btn-danger:hover { filter: brightness(.9); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line-strong); }
.tl-item { position: relative; padding: 8px 0 10px 12px; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -17px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--progress); border: 2px solid var(--card);
}
.tl-time { display: block; font-size: 12px; color: var(--t2); font-variant-numeric: tabular-nums; }
.tl-body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; line-height: 20px; }
.tl-step { color: var(--t1); }
.tl-step b { font-weight: 500; }
.tl-note { width: 100%; margin-top: 2px; color: var(--t2); font-size: 12px; line-height: 20px; }
.rail-empty { padding: 24px 0; font-size: 12px; color: var(--t2); text-align: center; }
#toast {
  position: fixed; top: 68px; right: 24px; z-index: 1060;
  max-width: 360px; padding: 8px 14px; border-radius: 6px;
  background: var(--t1); color: #FFFFFF; font-size: 12px; line-height: 20px;
  box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(-6px);
  pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1200px) {
  .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .workbench[data-depth="2"] .list-pane { flex: 1 1 auto; width: 100%; border-right: 0; }
  .workbench[data-depth="2"] .detail-pane {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: min(560px, 100vw); flex: none; opacity: 1;
    box-shadow: var(--shadow-pop); border-left: 1px solid var(--line-strong);
  }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}
