@charset "UTF-8";
/* 资产管理系统 v1.0 —— 基础样式 */

:root {
  --ink: #1b2430;
  --ink-soft: #5b6775;
  --ink-faint: #8b95a2;
  --line: #e3e7ec;
  --line-soft: #eef1f4;
  --paper: #f3f5f7;
  --surface: #ffffff;
  /* 悬停底色：比 --line-soft 明显加深，保证在白底上一眼看得出来 */
  --hover: #e4ebf2;
  --hover-strong: #d5dee8;
  --brand: #14706a;
  --brand-dark: #0e544f;
  --brand-soft: #e7f2f1;
  --warn: #a86a10;
  --warn-soft: #fdf3e2;
  --danger: #b0392c;
  --danger-soft: #fbeceb;
  --done: #2c7a58;
  --done-soft: #e8f4ee;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(27, 36, 48, .06), 0 6px 20px rgba(27, 36, 48, .05);
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Yu Gothic", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Noto Sans Mono", monospace;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.strong { font-weight: 600; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
}
.topbar a, .topbar button { color: #fff; }
.topbar form { margin: 0; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 16px; letter-spacing: .02em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
}
.nav-toggle {
  display: none; background: none; border: 0; color: #fff;
  font-size: 20px; line-height: 1; padding: 8px; cursor: pointer; border-radius: 6px;
}
.nav-toggle:hover { background: rgba(255,255,255,.2); }

.topbar-search { flex: 1; max-width: 420px; margin-left: 8px; }
.topbar-search input {
  width: 100%; height: 34px; padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  background: rgba(255,255,255,.1); color: #fff; font-size: 14px; font-family: inherit;
}
.topbar-search input::placeholder { color: rgba(255,255,255,.55); }
.topbar-search input:focus { background: rgba(255,255,255,.16); outline: none; border-color: rgba(255,255,255,.4); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; font-size: 14px;
}
.top-link:hover { background: rgba(255,255,255,.2); text-decoration: none; }
button.top-link {
  border: 1px solid rgba(255,255,255,.32);
  background: transparent;
  font-family: inherit; font-size: 14px; line-height: 1.4;
  cursor: pointer; min-height: 32px;
}
button.top-link:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.7); }
.top-user { display: flex; align-items: center; gap: 8px; padding-left: 8px; font-size: 14px; }
.top-user .who { line-height: 1.2; text-align: right; }
.top-user .who small { display: block; color: rgba(255,255,255,.6); font-size: 12px; }
.badge-dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-family: var(--mono); display: inline-grid; place-items: center;
}

/* ---------------- 骨架 ---------------- */
.shell { display: flex; align-items: flex-start; }
.sidebar {
  width: 216px; flex: 0 0 216px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px 0 28px;
}
.nav-group { padding: 6px 0 10px; }
.nav-group h6 {
  margin: 0; padding: 6px 18px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  color: var(--ink-faint); text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; color: var(--ink); font-size: 14.5px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--hover-strong); text-decoration: none; }
.nav-item.active { color: var(--brand-dark); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }
.nav-item .count { margin-left: auto; }

.main { flex: 1; min-width: 0; padding: 22px 24px 80px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { font-size: 20px; }
.page-head .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 卡片与面板 ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line-soft); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* 统计块 */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12.5px; color: var(--ink-soft); letter-spacing: .04em; }
.stat .value {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 600; line-height: 1.25; margin-top: 4px;
}
.stat .value small { font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-left: 3px; }
.stat.alert .value { color: var(--danger); }
.stat.warn .value { color: var(--warn); }
.stat a { display: block; }
.stat a:hover { text-decoration: none; }

/* ---------------- 资产卡片 ---------------- */
.asset-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.asset-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.asset-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 6px 24px rgba(27,36,48,.14); }
.asset-thumb {
  position: relative; display: block; aspect-ratio: 4 / 3;
  background: var(--line-soft); overflow: hidden;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb .chip { position: absolute; left: 8px; top: 8px; }
.asset-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.asset-name { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.asset-name a { color: var(--ink); }
.asset-meta { font-size: 12px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.asset-stock {
  display: flex; align-items: baseline; gap: 4px; margin-top: auto;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.asset-stock b { font-size: 19px; font-weight: 600; }
.asset-stock span { font-size: 12px; color: var(--ink-soft); }
.asset-card .btn { width: 100%; }
.label-strip {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: var(--ink-faint); border-top: 1px dashed var(--line);
  padding: 5px 12px; background: #fafbfc;
}

/* ---------------- 状态标签 ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 4px;
  font-size: 12px; font-weight: 600; line-height: 1.7;
  border: 1px solid transparent; white-space: nowrap;
}
.chip-done { background: var(--done-soft); color: var(--done); border-color: #c3e2d3; }
.chip-wait { background: var(--warn-soft); color: var(--warn); border-color: #f0dcbb; }
.chip-progress { background: #e9f0fa; color: #2a5c9c; border-color: #cddfef; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dcbb; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: #f0cdc9; }
.chip-muted { background: #eef0f3; color: var(--ink-soft); border-color: #e0e4e9; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover-strong); border-color: #c8d3de; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #96301f; border-color: #96301f; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label, .field-label {
  display: block; margin-bottom: 5px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.req::after { content: "＊"; color: var(--danger); font-size: 11px; margin-left: 2px; }

input[type=text], input[type=password], input[type=number], input[type=email],
input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,112,106,.12);
}
textarea { min-height: 82px; resize: vertical; line-height: 1.6; }
input[type=number] { font-family: var(--mono); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 筛选条 */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px;
}
.filters .f { display: flex; flex-direction: column; gap: 4px; }
.filters .f label { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; letter-spacing: .04em; }
.filters input, .filters select { min-width: 130px; height: 36px; min-height: 36px; font-size: 14px; }
.filters .grow { flex: 1; min-width: 180px; }
.filters .grow input { width: 100%; }

/* 分类快捷筛选 */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-soft); font-size: 13.5px;
}
.pill:hover { background: var(--hover); border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500; }

/* ---------------- 表格 ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 14px; text-align: left; vertical-align: middle; }
table.data thead th {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-soft);
  background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--hover); }
table.data td.num, table.data th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.row-thumb { width: 38px; height: 38px; border-radius: var(--radius-sm); object-fit: cover; background: var(--line-soft); }
.cell-title { display: flex; align-items: center; gap: 10px; }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-faint); }
.empty p { margin: 0 0 14px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft);
  font-family: var(--mono); font-size: 13px;
}
.pager a:hover { background: var(--hover); border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.pager .cur { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .info { border: 0; background: none; font-family: var(--sans); }

/* ---------------- 消息 ---------------- */
.flash-area { margin-bottom: 16px; display: grid; gap: 8px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid; font-size: 14px;
}
.flash-success { background: var(--done-soft); border-color: #bfe0d0; color: #1f5f43; }
.flash-error { background: var(--danger-soft); border-color: #f0cdc9; color: #8f2b20; }
.flash-info { background: #eaf1f8; border-color: #cfdff0; color: #29537f; }

/* ---------------- 流程时间线 ---------------- */
.timeline { display: grid; gap: 0; }
.tl-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; }
.tl-mark { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 15px; height: 15px; border-radius: 50%; margin-top: 5px;
  border: 2px solid var(--line); background: var(--surface); flex: none;
}
.tl-line { width: 2px; flex: 1; background: var(--line); min-height: 22px; }
.tl-body { padding-bottom: 16px; }
.tl-title { font-size: 14.5px; font-weight: 600; }
.tl-time { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.tl-note { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.tl-step.done .tl-dot { border-color: var(--done); background: var(--done); }
.tl-step.done .tl-line { background: var(--done); }
.tl-step.current .tl-dot { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px rgba(20,112,106,.14); }
.tl-step.current .tl-title { color: var(--brand-dark); }
.tl-step.rejected .tl-dot { border-color: var(--danger); background: var(--danger); }
.tl-step.rejected .tl-title { color: var(--danger); }
.tl-step.todo .tl-title, .tl-step.skipped .tl-title { color: var(--ink-faint); font-weight: 500; }
.tl-step:last-child .tl-line { display: none; }

/* 详情描述表 */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; }
.dl dt { color: var(--ink-soft); font-size: 13px; }
.dl dd { margin: 0; }

/* 展开式操作面板 */
details.inline-form { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
details.inline-form > summary {
  cursor: pointer; font-size: 13.5px; color: var(--brand); font-weight: 600;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form > summary::before { content: "＋"; font-family: var(--mono); }
details.inline-form[open] > summary::before { content: "－"; }
details.inline-form .body { padding-top: 10px; }

/* 库存行卡片 */
.stock-row {
  border-bottom: 1px solid var(--line-soft); padding: 12px 16px;
}
.stock-row:last-child { border-bottom: 0; }
.stock-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stock-main .grow { flex: 1; min-width: 160px; }
.stock-qty { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; }

/* 登录页 */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, #1b2430 0%, #1b2430 42%, var(--paper) 42%);
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(15, 22, 32, .22); padding: 30px 28px 26px;
}
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .brand-mark { width: 42px; height: 42px; font-size: 17px; margin: 0 auto 12px; border-radius: 10px; }
.auth-head h1 { font-size: 19px; }
.auth-head p { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--ink-faint); }

/* 底部标签栏（手机） */
.tabbar { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1023px) {
  .nav-toggle { display: block; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 35;
    height: auto; transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: ""; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(15,22,32,.42); z-index: 34;
  }
  .main { padding: 16px 14px 90px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 2px 6px; font-size: 11px; color: var(--ink-soft); position: relative;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--brand); font-weight: 600; }
  .tabbar .ic { font-size: 17px; line-height: 1.1; }
  .tabbar .badge-dot { position: absolute; top: 2px; right: 50%; margin-right: -22px; }
}

@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .topbar-search { display: none; }
  .top-user .who { display: none; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .asset-body { padding: 9px 10px 10px; }
  .asset-name { font-size: 13.5px; }
  .page-head h1 { font-size: 18px; }
  .panel-body { padding: 13px; }
  .filters { padding: 12px; }
  .filters .f, .filters .f select, .filters .f input { width: 100%; }
  .filters .f { flex: 1 1 100%; }

  /* 表格转卡片 */
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive thead { display: none; }
  table.responsive tbody tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 10px; padding: 8px 12px; background: var(--surface);
  }
  table.responsive td { padding: 5px 0; text-align: left !important; border: 0; }
  table.responsive td::before {
    content: attr(data-label) ; display: block;
    font-size: 11.5px; color: var(--ink-faint); font-weight: 600; letter-spacing: .04em;
  }
  table.responsive td.no-label::before { content: none; }
  table.responsive td.num { text-align: left; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 8px; }
}

@media (max-width: 380px) {
  .asset-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .sidebar, .tabbar, .head-actions, .filters, .no-print { display: none !important; }
  .main { padding: 0; }
  .panel { box-shadow: none; border-color: #ccc; }
}

/* ================================================================
   采购工作流模块
   ================================================================ */

/* ---------------- 流程步骤条 ---------------- */
.flow {
  display: flex; gap: 0; overflow-x: auto; padding: 6px 0 4px;
  scrollbar-width: thin;
}
.flow-step {
  flex: 1 0 auto; min-width: 88px; position: relative;
  text-align: center; padding: 0 2px;
}
.flow-step::before, .flow-step::after {
  content: ""; position: absolute; top: 15px; height: 2px; background: var(--line);
}
.flow-step::before { left: 0; right: 50%; margin-right: 17px; }
.flow-step::after  { left: 50%; right: 0;  margin-left: 17px; }
.flow-step:first-child::before, .flow-step:last-child::after { display: none; }
.flow-dot {
  position: relative; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 7px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink-faint);
}
.flow-name { font-size: 11.5px; line-height: 1.35; color: var(--ink-soft); }
.flow-meta { font-size: 10.5px; color: var(--ink-faint); font-family: var(--mono); margin-top: 2px; }

.flow-step.done .flow-dot { background: var(--done); border-color: var(--done); color: #fff; }
.flow-step.done::before, .flow-step.done::after { background: var(--done); }
.flow-step.done .flow-name { color: var(--ink); }
.flow-step.active .flow-dot {
  border-color: var(--brand); color: var(--brand-dark);
  box-shadow: 0 0 0 4px rgba(20,112,106,.14);
}
.flow-step.active::before { background: var(--done); }
.flow-step.active .flow-name { color: var(--brand-dark); font-weight: 600; }
.flow-step.overdue .flow-dot { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 0 4px rgba(176,57,44,.13); }
.flow-step.overdue .flow-name { color: var(--danger); font-weight: 600; }
.flow-step.skipped .flow-dot { border-style: dashed; }
.flow-step.skipped .flow-name { color: var(--ink-faint); text-decoration: line-through; }

/* ---------------- 阶段聚合标签 ---------------- */
.stage-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stage-tab {
  flex: 1 1 130px; min-width: 120px;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.stage-tab:hover { background: var(--hover); border-color: var(--brand); text-decoration: none; }
.stage-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.stage-tab.active .stage-num { color: #fff; }
.stage-tab.alert { border-color: #edc9c4; }
.stage-tab.alert .stage-num { color: var(--danger); }
.stage-label { font-size: 12.5px; color: var(--ink-soft); }
.stage-tab.active .stage-label { color: rgba(255,255,255,.75); }
.stage-num {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 23px; font-weight: 600; line-height: 1.25; margin-top: 2px;
}

/* ---------------- 任务卡片 ---------------- */
.task-list { display: grid; gap: 10px; }
.task-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.task-card.is-overdue { border-left-color: var(--danger); }
.task-card.is-soon    { border-left-color: var(--warn); }
.task-card.is-normal  { border-left-color: var(--brand); }
.task-card.is-done    { border-left-color: var(--done); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.task-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.task-side { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }

/* 优先级标记 */
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.prio::before { content: "●"; font-size: 9px; }
.prio-urgent { color: var(--danger); }
.prio-high   { color: var(--warn); }
.prio-normal { color: var(--ink-faint); }
.prio-low    { color: var(--ink-faint); }

/* ---------------- 人员负荷 ---------------- */
.load-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
.load-row:last-child { border-bottom: 0; }
.load-row .who { flex: 1; min-width: 0; }
.load-name { font-size: 14px; font-weight: 500; }
.load-meta { font-size: 12px; color: var(--ink-faint); }
.load-bar-wrap { width: 128px; flex: none; }
.load-bar { height: 7px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.load-bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.load-bar.warn span  { background: var(--warn); }
.load-bar.full span  { background: var(--danger); }
.load-num {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--ink-soft); margin-top: 3px; text-align: right;
}

/* ---------------- 分配中心 ---------------- */
.assign-grid { display: grid; gap: 16px; grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; }
.pick-list { max-height: 560px; overflow-y: auto; }
.pick-item {
  display: block; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink);
}
.pick-item:hover { background: var(--hover); text-decoration: none; }
.pick-item.active { background: var(--brand-soft); border-left: 3px solid var(--brand); padding-left: 11px; }
.pick-item:last-child { border-bottom: 0; }

/* 人员选择网格 */
.people-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.person-pick {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: 13.5px;
}
.person-pick:hover { background: var(--hover); border-color: var(--brand); }
.person-pick input { accent-color: var(--brand); flex: none; }
.person-pick .pi { flex: 1; min-width: 0; }
.person-pick .pi small { display: block; color: var(--ink-faint); font-size: 11.5px; }
.person-pick.recommended { border-color: var(--brand); background: var(--brand-soft); }

/* ---------------- 采购明细表 ---------------- */
.item-rows { display: grid; gap: 10px; }
.item-row {
  display: grid; gap: 8px;
  grid-template-columns: 2fr 1.4fr 70px 80px 100px 34px;
  align-items: end;
  padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfc;
}
.item-row input, .item-row select { min-height: 34px; font-size: 13.5px; }
.item-row .rm {
  min-height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 15px;
}
.item-row .rm:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* ---------------- 详情页小组件 ---------------- */
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.kv-row + .kv-row { border-top: 1px dashed var(--line-soft); }
.kv-row dt { color: var(--ink-soft); font-size: 13px; }

.node-panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.node-panel > summary {
  padding: 11px 14px; background: #fafbfc; cursor: pointer;
  display: flex; align-items: center; gap: 10px; font-size: 14px; list-style: none;
}
.node-panel > summary::-webkit-details-marker { display: none; }
.node-panel > summary .seq {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--line); color: var(--ink-soft);
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
}
.node-panel > summary .grow { flex: 1; min-width: 0; }
.node-panel[open] > summary { border-bottom: 1px solid var(--line-soft); }
.node-panel .body { padding: 13px 14px; }
.node-panel.done > summary .seq { background: var(--done); color: #fff; }
.node-panel.active > summary { background: var(--brand-soft); }
.node-panel.active > summary .seq { background: var(--brand); color: #fff; }

.sub-task {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px;
}
.sub-task:last-child { border-bottom: 0; }
.sub-task .st-main { flex: 1; min-width: 0; }
.sub-task.is-done .st-main { color: var(--ink-faint); text-decoration: line-through; }

.quote-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.quote-row:last-child { border-bottom: 0; }
.quote-row.selected { background: var(--done-soft); margin: 0 -14px; padding: 10px 14px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1023px) {
  .assign-grid { grid-template-columns: 1fr; }
  .pick-list { max-height: 340px; }
}

@media (max-width: 767px) {
  .flow-step { min-width: 76px; }
  .flow-name { font-size: 11px; }
  .stage-row { gap: 6px; }
  .stage-tab { flex: 1 1 calc(50% - 3px); min-width: 0; padding: 9px 11px; }
  .stage-num { font-size: 20px; }
  .task-card { flex-direction: column; gap: 8px; padding: 12px; }
  .task-side { flex-direction: row; align-items: center; text-align: left; flex-wrap: wrap; }
  .load-bar-wrap { width: 88px; }
  .item-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "name name" "spec spec" "qty unit" "price price" "rm rm";
  }
  .item-row .f-name  { grid-area: name; }
  .item-row .f-spec  { grid-area: spec; }
  .item-row .f-qty   { grid-area: qty; }
  .item-row .f-unit  { grid-area: unit; }
  .item-row .f-price { grid-area: price; }
  .item-row .rm      { grid-area: rm; }
  .people-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   条形码与扫码入库
   ================================================================ */

.barcode { display: block; max-width: 100%; height: auto; }

.barcode-label {
  display: inline-block; padding: 10px 14px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; text-align: center;
}
.barcode-label .bl-name { font-size: 13.5px; font-weight: 600; margin-bottom: 1px; }
.barcode-label .bl-spec { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 5px; }
.barcode-label .bl-no   { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

/* 扫码入库 */
.scan-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 14px;
  border: 2px solid var(--brand); border-radius: var(--radius);
  background: var(--brand-soft);
}
.scan-box .si { flex: 1; min-width: 200px; }
.scan-box input {
  width: 100%; height: 44px; font-size: 17px;
  font-family: var(--mono); letter-spacing: .06em;
  border-color: var(--brand); background: #fff;
}
.scan-box .hintline { font-size: 12.5px; color: var(--brand-dark); margin-top: 5px; }
.scan-status {
  min-width: 190px; padding: 9px 13px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; text-align: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
.scan-status.ok   { background: var(--done-soft);   border-color: #bfe0d0; color: var(--done); }
.scan-status.bad  { background: var(--danger-soft); border-color: #f0cdc9; color: var(--danger); }
.scan-status.warn { background: var(--warn-soft);   border-color: #f0dcbb; color: var(--warn); }

.scan-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft);
}
.scan-row:last-child { border-bottom: 0; }
.scan-row.hit { animation: scanhit .55s ease; }
@keyframes scanhit {
  0%   { background: var(--done-soft); }
  100% { background: transparent; }
}
.scan-row .sr-bc   { flex: none; }
.scan-row .sr-main { flex: 1; min-width: 160px; }
.scan-row .sr-name { font-size: 14.5px; font-weight: 600; }
.scan-row .sr-meta { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.scan-row .sr-count {
  display: flex; align-items: center; gap: 8px;
}
.scan-row .sr-count input {
  width: 84px; height: 40px; font-size: 18px; font-weight: 600;
  text-align: center; font-family: var(--mono);
}
.scan-row .sr-of {
  font-family: var(--mono); font-size: 14px; color: var(--ink-soft); white-space: nowrap;
}
.scan-row.full .sr-count input { border-color: var(--done); background: var(--done-soft); }
.scan-row.over .sr-count input { border-color: var(--danger); background: var(--danger-soft); }

.scan-unlinked {
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--warn-soft); border: 1px solid #f0dcbb;
  font-size: 13.5px; color: var(--warn);
}

@media (max-width: 767px) {
  .scan-row { gap: 10px; }
  .scan-row .sr-bc svg { max-width: 160px; }
  .scan-status { min-width: 100%; }
}

/* 只打印条码标签 */
@media print {
  body.print-barcode-only * { visibility: hidden !important; }
  body.print-barcode-only .barcode-print-area,
  body.print-barcode-only .barcode-print-area * { visibility: visible !important; }
  body.print-barcode-only .barcode-print-area {
    position: absolute; left: 0; top: 0; margin: 0; padding: 0;
  }
  body.print-barcode-only .barcode-label { border: 0; }
}
