/* =========================================================
   KingMetal 订单跟进系统 - 全局样式
   设计目标：像 Excel 一样清楚、密集、一眼看懂
   ========================================================= */

:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #dfe4ea;
  --line-soft: #eef1f5;
  --head: #f1f4f8;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #14507d;
  --brand-dark: #0f3f63;
  --brand-soft: #eaf2f9;
  --red: #c62828;
  --red-soft: #fdecec;
  --orange: #c25e00;
  --orange-soft: #fff4e5;
  --green: #1b7a3d;
  --green-soft: #e9f7ef;
  --shadow: 0 2px 8px rgba(16, 28, 44, .08);
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 通用 ---------- */
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, "Courier New", monospace; }
.req { color: var(--red); }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border: 1px solid var(--line);
  background: #fff; color: var(--text);
  border-radius: var(--radius); cursor: pointer;
  font-size: 13px; line-height: 1.2; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: #f7f9fb; border-color: #c8d2de; }
.btn:active { background: #eff3f8; }
.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-primary:active { background: #0c3453; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; font-size: 15px; }
.btn-danger { color: var(--red); border-color: #f0c9c9; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }

.inp {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: 13px; outline: none; min-width: 0;
}
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 80, 125, .1); }

/* ---------- 可输入可展开的筛选组合框 ---------- */
.km-select { position: relative; width: 146px; flex: none; }
.km-select-input {
  width: 100%; height: 33px; padding: 7px 44px 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: 13px; outline: none;
}
.km-select-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 80, 125, .1); }
.km-select.has-value .km-select-input { color: #0f4c81; font-weight: 500; background: #f4f9ff; border-color: #cfe0ef; }
.km-select-arrow {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: #8a97a8; font-size: 11px; pointer-events: none;
}
.km-select-clear {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  display: none; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%;
  background: #e8edf3; color: #667486; font-size: 12px; line-height: 17px; cursor: pointer;
}
.km-select.has-value .km-select-clear { display: block; }
.km-select-clear:hover { background: #dce6ef; color: #33475b; }
.km-select-menu {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow: auto; background: #fff; border: 1px solid #d7e1ec;
  border-radius: 7px; box-shadow: 0 8px 24px rgba(15, 47, 74, .14); z-index: 70; padding: 4px;
}
.km-select.open .km-select-menu { display: block; }
.km-opt {
  padding: 7px 9px; font-size: 12.5px; color: #33475b; border-radius: 5px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.km-opt:hover { background: #f0f7fd; color: #0f4c81; }
.km-opt.active { background: #e7f1fb; color: #0f4c81; font-weight: 600; }
.km-opt-none { padding: 8px 9px; font-size: 12px; color: #9aa6b2; text-align: center; }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.chk input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 52px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-home { display: inline-flex; align-items: center; gap: 8px; padding: 4px 2px; }
.brand-home:hover { text-decoration: none; }
.brand-logo { display: block; object-fit: contain; }
.brand-logo.qm { height: 34px; max-width: 54px; }
.brand-logo.yh { height: 28px; max-width: 34px; }
.brand-divider { width: 1px; height: 26px; background: #dfe6ee; }
.brand-copy { display: inline-flex; flex-direction: column; line-height: 1.1; margin-right: 3px; }
.brand-copy b { font-size: 12.5px; letter-spacing: .9px; color: #123a5b; font-weight: 700; }
.brand-copy em { font-style: normal; font-size: 10.5px; color: #778596; margin-top: 3px; letter-spacing: .4px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 5px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .5px;
}
.brand-mark.sm { width: 28px; height: 28px; font-size: 13px; }
.topbar-title { font-weight: 600; font-size: 14px; color: #0f2f4a; padding-left: 10px; border-left: 1px solid #e3e9f0; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.top-link { font-size: 13px; color: #475569; }
.top-link:hover { color: var(--brand); }
.who { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; }
.who b { color: #0f2f4a; }
.who em { font-style: normal; color: var(--muted); font-size: 12px; }
.badge-scope {
  font-size: 12px; color: var(--orange); background: var(--orange-soft);
  border: 1px solid #f2d7ae; padding: 2px 8px; border-radius: 10px;
}

/* ---------- 页面主体 ---------- */
.page { padding: 12px 14px 0; }

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; margin-bottom: 10px; overflow: visible;
}
.toolbar-wrap { flex-wrap: wrap; overflow-x: visible; }
.toolbar #q { width: 210px; flex: 0 0 210px; }
.filter-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.summary { font-size: 13px; color: var(--muted); white-space: nowrap; }
.view-row {
  display: flex; align-items: center; gap: 10px; margin: -2px 0 10px;
  padding: 7px 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.view-switch { display: flex; align-items: center; gap: 8px; }
.view-state { font-size: 12.5px; color: var(--muted); }
.copy-groups { display: flex; flex-direction: column; gap: 10px; }
.copy-group { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fafcfe; }
.copy-group .copy-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.copy-group input { width: 100%; }
.copy-merge-chk { margin: 2px 0 8px; font-weight: 600; }
.copy-source-info { margin-bottom: 8px; }
.copy-merge-tip { padding: 8px 10px; border-radius: 6px; background: #eef6ff; color: var(--brand); font-size: 12.5px; }
.copy-group-head, .copy-header-title { font-size: 13.5px; margin: 2px 0 8px; }
.copy-group-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.copy-group-head b { color: var(--brand); }
.copy-header-title { font-weight: 700; color: #334155; }
.copy-edit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 10px; }
.copy-item-card { border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 12px 2px; margin-top: 8px; background: #fff; }
.copy-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.copy-item-head b { font-size: 13px; color: #334155; }
.copy-item-head span { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.copy-item-remove { border: 0; background: transparent; color: #b42318; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.copy-add-wrap { margin-top: 10px; text-align: center; }
.copy-add-btn { border-style: dashed; color: var(--brand); background: #f8fbff; width: 100%; }
.copy-item-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 10px; }
.copy-span2 { grid-column: span 2; }
.copy-origin { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; margin-top: 8px; }
.copy-origin-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.copy-origin-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: #445; }
.copy-origin-remark { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.copy-origin-items { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.copy-origin-items li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; }
.copy-origin-items li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-origin-items li em { color: var(--muted); font-style: normal; }
.copy-origin-items li b { color: #7a4b12; font-weight: 600; }
.copy-merged-box { border: 1px solid #cfe1f3; border-radius: 8px; padding: 12px; background: #f7fbff; }
.copy-merged-title { font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.copy-push { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.copy-push-title { width: 100%; font-weight: 700; font-size: 13px; }
.copy-push select { min-width: 180px; }
.push-box { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfdff; }
.push-box .radio-row label { white-space: nowrap; }
.push-box .radio-row { row-gap: 8px; }
.accept-btn { background: #e9f7ef; border-color: #9ed5b5; color: #157a43; }
.accept-link { color: #157a43 !important; font-weight: 700; }
.ship-rows { display: flex; flex-direction: column; gap: 7px; }
.ship-row { display: grid; grid-template-columns: 1fr 126px 88px; align-items: center; gap: 8px; font-size: 12.5px; }
.ship-row .ship-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-row .ship-stock { color: var(--muted); font-size: 12px; }
.sel-pill {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: #dbe7f2; color: var(--brand); font-size: 12px; text-align: center;
}

/* ---------- 主表格（Excel 风格） ---------- */
.grid-wrap {
  overflow: auto; max-height: calc(100vh - 210px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative;
}
.grid {
  border-collapse: collapse; table-layout: fixed; width: 100%;
  font-size: 13px;
}
.grid.order-grid { width: max(100%, 2182px); min-width: 2182px; }
.grid td > .cell-clip { min-width: 0; }
.grid td.km-fixed-col { overflow: hidden; }
.grid td.km-fixed-col > .cell-clip,
.grid td.km-fixed-col > .cell-clip * {
  white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis;
  flex-wrap: nowrap !important; word-break: normal !important; overflow-wrap: normal !important;
}
.grid td.km-fixed-col > .cell-clip .cell-pre,
.grid td.km-fixed-col > .cell-clip .merged-cell-edit {
  white-space: pre-wrap !important; overflow-wrap: break-word; word-break: break-word;
  flex-wrap: wrap !important; text-overflow: clip;
}
.c-process .cell-pre, .c-process .merged-cell-edit,
.c-remark .cell-pre, .c-remark .merged-cell-edit,
.c-material .cell-pre {
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
}
.grid tr.km-fixed-row > td > .cell-clip { overflow: hidden; }
.layout-layer {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 20;
}
.layout-handle { position: absolute; pointer-events: auto; background: transparent; }
.layout-handle.col { width: 7px; margin-left: -3px; cursor: col-resize; }
.layout-handle.col:hover { background: rgba(20, 80, 125, .16); }
.layout-handle.row { height: 7px; margin-top: -3px; cursor: row-resize; }
.layout-handle.row:hover { background: rgba(20, 80, 125, .12); }
body.col-resizing, body.row-resizing { user-select: none; }
body.col-resizing .layout-layer, body.row-resizing .layout-layer { display: none; }
.grid thead th {
  position: sticky; top: 0; z-index: 30;
  background: var(--head); color: #33475b;
  border: 1px solid var(--line); border-bottom: 1px solid #cfd8e3;
  font-weight: 600; font-size: 12.5px; padding: 9px 8px;
  white-space: nowrap; text-align: left;
}
.grid td {
  border: 1px solid var(--line-soft); padding: 6px 8px;
  vertical-align: top; background: #fff; line-height: 1.45;
  word-break: break-word;
}
.grid td.po-cell { background: #f7fafd; }
.grid td.rowspan-cell { background: #fbfcfe; }
tr.is-overdue td { background: #fffafa; }
tr.is-overdue td.po-cell { background: #fdf6f6; }
tr.po-start td { border-top: 2px solid #cfdae6; }
tr.item-row:hover td { background: #f7fbff; }
tr.item-row:hover td.po-cell { background: #eff6fd; }

.c-sel { width: 0; display: none; }
.c-sales { width: 76px; }
.c-date { width: 92px; }
.c-po { width: 200px; }
.c-country { width: 78px; }
.c-product { width: 205px; }
.c-img { width: 150px; }
.c-qty { width: 96px; }
.c-owner { width: 104px; }
.c-status { width: 190px; }
.c-material { width: 130px; }
.c-supplier { width: 105px; }
.c-stage { width: 122px; }
.c-due { width: 122px; }
.c-process { width: 210px; }
.c-remark { width: 150px; }
.c-ops { width: 152px; }

.cell-center { text-align: center; }
.product-line { display: flex; align-items: flex-start; gap: 5px; flex-wrap: wrap; }
.product-line .item-check { width: 14px; height: 14px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.product-line .cell-text { flex: 1; min-width: 80px; }
.exempt-badge, .done-badge {
  display: inline-block; font-size: 10.5px; line-height: 17px; padding: 0 5px; border-radius: 4px; white-space: nowrap;
}
.exempt-badge { color: #8a5a00; background: #fff4d8; border: 1px solid #ead29b; }
.done-badge { color: #176b4a; background: #eaf8f1; border: 1px solid #b8e3ce; }
.ship-done { margin-top: 3px; font-size: 11.5px; font-weight: 600; color: #176b4a; }
.ship-part { margin-top: 3px; font-size: 11.5px; color: #9a6200; }

.po-line { display: flex; align-items: flex-start; gap: 6px; }
.po-line input[type="checkbox"] { margin-top: 2px; accent-color: var(--brand); width: 14px; height: 14px; }
.po-no { font-weight: 600; color: #0f4c81; word-break: break-all; font-size: 13px; }
.po-meta { margin-top: 6px; font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.po-meta a { color: var(--muted); border-bottom: 1px dashed #c8d2de; }
.po-meta a:hover { color: var(--brand); text-decoration: none; }

.cell-text { display: block; min-height: 18px; cursor: text; border-radius: 3px; padding: 1px 2px; }
.cell-text:hover { background: #f0f6fc; box-shadow: inset 0 0 0 1px #d7e5f2; }
.cell-pre { white-space: pre-wrap; }
.cell-edit {
  width: 100%; min-width: 60px; border: 1px solid var(--brand); border-radius: 3px;
  padding: 2px 4px; font-size: 13px; line-height: 1.4; outline: none; background: #fff;
  box-shadow: 0 0 0 3px rgba(20, 80, 125, .12); font-family: inherit;
}
textarea.cell-edit {
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
  resize: vertical; min-height: 60px;
}
tr.flash td { background: #fff8d8 !important; transition: background .3s; }

.status-sel {
  width: 100%; padding: 3px 18px 3px 4px; font-size: 12px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.status-sel:hover, .owner-sel:hover { border-color: #a9bfd4; background: #fbfdff; }
.last-note { font-size: 11.5px; color: #6b7280; margin-top: 4px; line-height: 1.4; cursor: pointer; }
.merged-line { margin-top: 4px; line-height: 1.45; }
.merged-line b { display: inline-block; margin-right: 6px; font-weight: 600; color: #33475b; }
.merged-line span { white-space: pre-wrap; }
.merge-part { overflow: hidden; }
.merge-part .merged-line { margin-top: 0; }
.merged-cell-edit { display: block; padding: 1px 2px; border-radius: 3px; cursor: text; }
.merged-cell-edit:hover { background: #f0f6fc; box-shadow: inset 0 0 0 1px #d7e5f2; }
.merged-line .merged-cell-edit { margin-top: 2px; }
.last-note:hover { color: var(--brand); text-decoration: underline; }

.owner-sel {
  width: 100%; padding: 3px 18px 3px 4px; font-size: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.owner-ro { font-size: 12.5px; font-weight: 500; color: #33475b; line-height: 1.4; }
.stage-ro { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #33475b; font-weight: 500; }
.stage-dot { width: 6px; height: 6px; border-radius: 50%; background: #7fa8c9; flex: none; }
.date-ro { font-size: 12.5px; color: #26394c; font-variant-numeric: tabular-nums; }
.date-ro.is-overdue { color: var(--red); font-weight: 600; }
.date-ro.is-soon { color: var(--orange); font-weight: 600; }
.po-field-edit { border-bottom: 1px dashed #d7e3ef; min-height: 20px; }
.po-field-edit:hover { background: #edf6ff; }
.po-field-edit .placeholder { color: #a8b3bf; font-size: 12px; }
.cell-pre-ro { white-space: pre-wrap; color: #33475b; font-size: 12.5px; }
.rowspan-cell .last-note { font-size: 11px; }

/* 行高列宽拖拽手柄 */
.grid thead th { position: sticky; }
.col-resizer {
  position: absolute; right: -2px; top: 0; bottom: 0; width: 6px;
  cursor: col-resize; z-index: 40;
}
.col-resizer:hover { background: rgba(20, 80, 125, .22); }
.grid td.c-sel { position: relative; }
.row-resizer {
  position: absolute; left: 0; right: 0; bottom: -3px; height: 6px;
  cursor: row-resize; z-index: 10;
}
.row-resizer:hover { background: rgba(20, 80, 125, .16); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
body.row-resizing, body.row-resizing * { cursor: row-resize !important; user-select: none; }
.due-inp {
  width: 100%; padding: 3px 4px; font-size: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.due-inp.is-overdue { border-color: #e8a9a9; background: var(--red-soft); color: var(--red); font-weight: 600; }
.due-inp.is-soon { border-color: #efcf9f; background: var(--orange-soft); color: var(--orange); }
.due-warn { font-size: 11px; margin-top: 3px; }
.due-warn.red { color: var(--red); }
.due-warn.orange { color: var(--orange); }

.thumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 3px;
  border: 1px solid #dde4ec; cursor: zoom-in; background: #f7f9fb;
}
.thumb.sm { width: 30px; height: 30px; }

.ops { display: flex; flex-wrap: wrap; gap: 3px; }
.ops button {
  padding: 2px 5px; font-size: 11.5px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: #33475b;
}
.ops button:hover { background: #f0f6fc; border-color: #bcd3e6; color: var(--brand); }
.ops button.danger:hover { background: var(--red-soft); border-color: #e9bdbd; color: var(--red); }

.empty { padding: 70px 20px; text-align: center; color: #8a94a6; }
.empty p { margin: 4px 0; }

.legend {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 2px 10px; font-size: 12px; color: #566274;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot-red { background: #e05252; }
.dot-orange { background: #e39a3c; }

/* ---------- 弹窗 ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 100; }
.modal.open { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 30, 45, .45); }
.modal-panel {
  position: relative; margin: 4vh auto; background: #fff; border-radius: 8px;
  width: 92%; max-width: 560px; box-shadow: 0 12px 40px rgba(10, 20, 35, .25);
  display: flex; flex-direction: column; max-height: 92vh;
  animation: pop .16s ease-out;
}
.modal-md { max-width: 720px; }
.modal-lg { max-width: 1080px; }
@keyframes pop { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.icon-btn {
  border: 0; background: transparent; font-size: 22px; line-height: 1;
  cursor: pointer; color: #8a94a6; padding: 0 4px;
}
.icon-btn:hover { color: #344054; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--line-soft); background: #fbfcfe;
  border-radius: 0 0 8px 8px;
}
.modal-foot .muted { margin-right: auto; font-size: 12px; }
.modal-foot .muted.err { color: var(--red); font-weight: 600; }
.req-err { margin-top: 8px; color: var(--red); font-size: 12.5px; line-height: 1.5; }

.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12.5px; color: #475569; margin-bottom: 5px; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); outline: none; background: #fff;
}
.combo { position: relative; display: flex; }
.combo > input { padding-right: 32px; }
.combo-btn { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 28px; border: 0; border-left: 1px solid var(--line); background: #f8fafc; color: #64748b; cursor: pointer; border-radius: 0 6px 6px 0; font-size: 12px; line-height: 1; }
.combo-btn:hover { background: #eef6fc; color: var(--brand); }
.pick-menu {
  position: absolute; z-index: 1200; left: 0; right: 0; top: calc(100% + 3px);
  display: none; max-height: 220px; overflow: auto; background: #fff;
  border: 1px solid #d7e1ec; border-radius: 7px; box-shadow: 0 8px 22px rgba(23, 43, 66, .14);
}
.pick-menu.show { display: block; }
.pick-opt { padding: 8px 10px; font-size: 13px; color: #33475b; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.pick-opt:last-child { border-bottom: 0; }
.pick-opt:hover, .pick-opt.active { background: #eef6fc; color: var(--brand); }
.pick-empty { padding: 10px; font-size: 12px; color: var(--muted); }
.combo-grow { flex: 1; }.fld input:focus, .fld select:focus, .fld textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 80, 125, .1);
}
.fld textarea {
  resize: vertical; line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: break-word; word-break: break-word; min-height: 72px;
}

.po-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
.po-fields .fld { margin-bottom: 10px; }

.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 10px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.sec-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.order-items { display: flex; flex-direction: column; gap: 10px; }

.item-card { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fbfcfe; }
.item-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.item-card-head b { font-size: 13px; color: var(--brand); }
.item-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; }
.item-grid .fld { margin-bottom: 0; }
.item-grid .span2 { grid-column: span 2; }
.item-grid .span4 { grid-column: span 4; }
.item-card .imgs { margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.dropzone {
  border: 1px dashed #bbc9d8; border-radius: 6px; padding: 10px 12px;
  font-size: 12px; color: var(--muted); cursor: pointer; background: #fff;
  display: inline-flex; align-items: center; gap: 6px; min-width: 220px;
  transition: .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.thumbs-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-edit { position: relative; }
.thumb-edit img { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; border: 1px solid #dbe3ec; }
.thumb-edit .rm {
  position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%;
  background: #444; color: #fff; border: 0; font-size: 11px; line-height: 17px; text-align: center;
  cursor: pointer; padding: 0;
}
.thumb-edit .rm:hover { background: var(--red); }

.scope-box {
  background: var(--brand-soft); border: 1px solid #d6e5f2; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: #26394c; margin-bottom: 12px;
  max-height: 110px; overflow: auto;
}
.radio-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.radio-row label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.radio-row input[type="radio"] { accent-color: var(--brand); }
#fNewDue { width: auto; padding: 5px 8px; }

.hist { display: flex; flex-direction: column; gap: 0; }
.hist-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.hist-time { width: 86px; flex: none; font-size: 12px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.hist-body { flex: 1; }
.hist-body .who-line { font-size: 12.5px; color: var(--brand); font-weight: 600; margin-bottom: 3px; }
.hist-body .txt { font-size: 13px; white-space: pre-wrap; line-height: 1.55; }
.hist-body .due-change { margin-top: 5px; font-size: 12px; color: var(--orange); }

/* 登录后的交期提醒 */
.alert-block { margin-bottom: 14px; }
.alert-block h3 { margin: 0 0 8px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.alert-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: 5px; margin-bottom: 6px;
  cursor: pointer; background: #fff;
}
.alert-row:hover { background: #f7fbff; border-color: #cfe0ef; }
.alert-row .ar-main { flex: 1; min-width: 0; }
.alert-row .ar-title { font-size: 13px; font-weight: 600; color: #0f2f4a; }
.alert-row .ar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert-row .ar-days { font-size: 12px; font-weight: 600; white-space: nowrap; }
.alert-row .ar-days.red { color: var(--red); }
.alert-row .ar-days.orange { color: var(--orange); }
.alert-row img { width: 34px; height: 34px; object-fit: cover; border-radius: 3px; border: 1px solid #dde4ec; }

/* 图片查看器 */
.img-viewer {
  position: relative; margin: 4vh auto; width: min(94vw, 1100px); max-height: 92vh;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.img-viewer > * { pointer-events: auto; }
.img-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: min(72vh, 680px); overflow: hidden;
  cursor: grab; touch-action: none;
}
.img-stage.dragging { cursor: grabbing; }
.img-stage img {
  max-width: none; max-height: none; border-radius: 6px; background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  transform-origin: center center; transition: transform .18s ease;
  user-select: none; -webkit-user-drag: none;
}
.img-stage.dragging img { transition: none; }
.img-caption { color: #dbe3ec; font-size: 12.5px; }
.img-close {
  position: absolute; top: -34px; right: 0; color: #fff; font-size: 26px;
}
.img-tools {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px;
}
.img-tool {
  min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(20,35,50,.62); color: #fff; border-radius: 6px; cursor: pointer;
  font-size: 16px; line-height: 1;
}
.img-tool:hover { background: rgba(20,35,50,.85); }
.img-tool:disabled { opacity: .35; cursor: not-allowed; }
.img-zoom { color: #dbe3ec; font-size: 12px; min-width: 46px; text-align: center; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; top: 64px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #17324b; color: #fff; padding: 9px 14px; border-radius: 6px;
  font-size: 13px; box-shadow: 0 6px 18px rgba(10,20,35,.25); animation: pop .18s ease-out;
  max-width: 360px; line-height: 1.5;
}
.toast.err { background: #a02323; }
.toast.ok { background: #1b6b3a; }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #eef3f8 0%, #f7f9fb 45%, #eaf0f6 100%);
  padding: 24px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(18, 40, 64, .1);
  padding: 30px 32px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 600; color: #0f2f4a; letter-spacing: .2px; }
.brand-sub { margin: 3px 0 0; font-size: 12px; color: #93a0b0; text-transform: uppercase; letter-spacing: 1px; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; margin-bottom: 24px; }
.login-logos { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.login-logos img { display: block; object-fit: contain; }
.login-logos img:first-child { height: 74px; max-width: 96px; }
.login-logos img:last-child { height: 58px; max-width: 66px; }
.login-logos span { width: 1px; height: 52px; background: #e2e8f0; }
.login-brand h1 { margin: 0; font-size: 16px; font-weight: 600; color: #123a5b; letter-spacing: .1px; line-height: 1.35; }
.login-brand .brand-cn { margin: 5px 0 0; font-size: 14px; color: #33475b; letter-spacing: 2px; }
.login-brand .brand-sub { margin: 7px 0 0; font-size: 11px; color: #8a97a8; letter-spacing: 1.2px; }
.login-card .field { display: block; margin-bottom: 14px; }
.login-card .field span { display: block; font-size: 12.5px; color: #475569; margin-bottom: 5px; }
.login-card .field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); outline: none;
}
.login-card .field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,80,125,.1); }
.login-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 页脚品牌 ---------- */
.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 18px; padding: 18px 16px 20px; border-top: 1px solid var(--line); background: #fff;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand img { height: 22px; object-fit: contain; opacity: 1; }
.footer-brand img:first-child { max-width: 34px; }
.footer-brand img:last-child { max-width: 24px; }
.footer-divider { width: 1px; height: 18px; background: #e3e9f0; }
.footer-company { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: #8794a3; line-height: 1.35; }
.footer-company b { font-size: 11.5px; color: #4b5d70; font-weight: 600; letter-spacing: .3px; }

/* ---------- 安装向导 ---------- */
.env-check { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.env-check span { font-size: 12px; padding: 4px 9px; border-radius: 4px; border: 1px solid var(--line); }
.env-check .ok { color: var(--green); background: var(--green-soft); border-color: #c8e6d3; }
.env-check .bad { color: var(--red); background: var(--red-soft); border-color: #f0cccc; }
.sec-title { font-size: 13.5px; margin: 18px 0 10px; color: #0f2f4a; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.login-card label { display: block; margin-bottom: 11px; font-size: 12.5px; color: #475569; }
.login-card label input { width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); outline: none; }
.login-card label input:focus { border-color: var(--brand); }
.tips { font-size: 13px; color: #33475b; padding-left: 18px; line-height: 1.9; }

.alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.alert-ok { background: var(--green-soft); color: #17603a; border: 1px solid #c8e6d3; }
.alert-warn { background: var(--orange-soft); color: #8a4a00; border: 1px solid #f0d5ab; }
.alert-bad { background: var(--red-soft); color: #8e2020; border: 1px solid #efcaca; }

/* ---------- 仪表台 ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 6px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.kpi-num { font-size: 24px; font-weight: 700; color: #0f2f4a; line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-red .kpi-num { color: var(--red); }
.kpi-orange .kpi-num { color: var(--orange); }
.block-title { font-size: 15px; margin: 22px 0 10px; color: #0f2f4a; display: flex; align-items: center; gap: 10px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-scroll { overflow: auto; }
.dash-grid { min-width: 1180px; table-layout: fixed; width: 100%; }
.dash-grid th, .dash-grid td { text-align: center; padding: 7px 4px; overflow: hidden; text-overflow: ellipsis; }
.dash-grid th.dash-name, .dash-grid td.dash-name { text-align: left; padding-left: 12px; width: 110px; }
.dash-grid .dash-m { width: 52px; }
.dash-grid .dash-total { width: 78px; }
.dash-grid .dash-open { width: 84px; }
.dash-grid .dash-f { width: 88px; }
.zero { color: #b4bcc6; }
.overdue-num { color: var(--red); font-weight: 600; }
.soon-num { color: var(--orange); font-weight: 600; }
.tag-red { font-size: 12px; font-weight: 500; color: var(--red); background: var(--red-soft); padding: 1px 7px; border-radius: 9px; }
.tag-orange { font-size: 12px; font-weight: 500; color: var(--orange); background: var(--orange-soft); padding: 1px 7px; border-radius: 9px; }
.bars { padding: 12px 16px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-name { width: 78px; font-size: 13px; color: #33475b; }
.bar-track { flex: 1; height: 12px; background: #f0f3f7; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #d9534f, #e88b7a); border-radius: 6px; }
.bar-val { width: 30px; text-align: right; font-size: 12.5px; color: var(--red); font-weight: 600; }
.detail-grid { min-width: 1180px; table-layout: fixed; width: 100%; }
.detail-grid th, .detail-grid td { text-align: left; padding: 7px 9px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 管理页 ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 9px 16px; border: 1px solid transparent; border-bottom: 0; background: transparent;
  cursor: pointer; font-size: 14px; color: #566274; border-radius: 6px 6px 0 0;
}
.tab.active { background: #fff; border-color: var(--line); color: var(--brand); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.pane-head .muted { margin: 0; font-size: 13px; line-height: 1.6; }
.admin-grid { min-width: 980px; }
.admin-grid th, .admin-grid td { padding: 8px 10px; }
.role-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef2f7; color: #3f5368; }
.role-admin { background: #e8f0f8; color: var(--brand); }
.role-sales { background: #eef7ee; color: var(--green); }
.role-owner { background: #fff4e5; color: var(--orange); }
.preset-box { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 14px; }
.preset-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; display: flex; flex-direction: column; }
.preset-card-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); background: #fafcfe; border-radius: 8px 8px 0 0; }
.preset-card-head b { font-size: 14px; color: #2c3e50; }
.preset-card-head .muted { font-size: 12px; }
.preset-rows { padding: 10px 14px 4px; max-height: 430px; overflow-y: auto; }
.preset-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.preset-row .inp { flex: 1; min-width: 0; height: 32px; }
.preset-row.is-locked .inp { background: #f4f6f8; color: #6b7785; }
.preset-lock { flex: none; font-size: 11.5px; color: #8a94a3; background: #eef2f7; border-radius: 9px; padding: 2px 7px; }
.preset-del { flex: none; font-size: 12px; color: var(--red); background: none; border: 0; cursor: pointer; padding: 4px 6px; }
.preset-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 13px; }
@media (max-width: 900px) { .preset-box { grid-template-columns: 1fr; } }
.ok-text { color: var(--green); font-weight: 600; }
.bad-text { color: var(--red); font-weight: 600; }
.log-grid { min-width: 1000px; }
.log-grid td { padding: 7px 10px; font-size: 12.8px; }
.log-grid td.detail { max-width: 520px; white-space: normal; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; font-size: 13px; color: var(--muted); }
.settings-panel { padding: 18px 20px; }
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px dashed var(--line-soft); }
.switch-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 3px; flex: none; }
.sub-switches { padding-left: 18px; background: #fafcfe; border-radius: 6px; margin: 8px 0 0; }
.settings-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; }

/* ---------- 新增：名单 / 备份 / 提示 ---------- */
.zero { color: #b9c3cf; }
.dash-sub { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.tag-orange { font-size: 12px; font-weight: 500; color: var(--orange); background: var(--orange-soft); padding: 1px 7px; border-radius: 9px; }
.hint-line { font-size: 11.5px; color: var(--orange); margin-top: 4px; }
.hint-line.err { color: var(--red); font-weight: 600; }
.inline-add { display: flex; gap: 8px; align-items: center; }
.inline-add .inp { width: 180px; }
.bar-track { min-width: 120px; }

/* ---------- 写跟进：产品勾选 / 豁免 / 供应商 ---------- */
#modalFollow .radio-row { flex-wrap: wrap; row-gap: 6px; }
#modalFollow .radio-row label { white-space: nowrap; }
#modalRework .radio-row label { white-space: nowrap; }
#modalFollow .hint-line { line-height: 1.6; margin: 4px 0 6px; }
.due-new-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.due-new-row span { font-size: 12px; color: #6d7c8c; }
.due-new-row input[type="date"] { max-width: 200px; }
.due-kind-inline { display: inline-flex; gap: 12px; margin-left: 14px; font-size: 12px; color: #5b6b7c; }
.due-kind-inline label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.due-kind-inline input[type="radio"] { width: auto; margin: 0; }
.modal-body { min-height: 0; }
.pick-tools { display: flex; gap: 8px; margin: 4px 0 6px; }
#fPickWrap { margin-top: 14px; }
#fPickWrap > span { display: block; margin-bottom: 6px; }
.pick-list {
  border: 1px solid var(--line); border-radius: 6px; background: #fbfcfe;
  max-height: 190px; overflow: auto; padding: 4px;
}
.pick-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 4px;
  cursor: pointer; font-size: 12.5px;
}
.pick-item:hover { background: #f0f6fc; }
.pick-item.on { background: #eef6ff; }
.pick-item input { accent-color: var(--brand); }
.pick-item input[type="checkbox"] { width: 14px; height: 14px; flex: 0 0 auto; margin: 0; padding: 0; }
.pick-name { font-weight: 600; color: #23405c; flex: 0 1 auto; }
.pick-meta { color: var(--muted); font-size: 11.5px; margin-left: auto; text-align: right; }

.ex-box {
  background: #fffaf2; border: 1px solid #f0dcc0; border-radius: 6px; padding: 10px 12px;
}
.ex-box textarea { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  background: #eef4fa; border: 1px solid #d7e5f2; color: #23405c; border-radius: 12px; padding: 2px 8px;
}
.chip button { border: 0; background: transparent; cursor: pointer; color: #7b8a9b; font-size: 13px; line-height: 1; }
.chip button:hover { color: var(--red); }

/* ---------- 仪表台：供应商统计 ---------- */
.sup-grid { table-layout: fixed; width: 100%; min-width: 1080px; }
.sup-grid th, .sup-grid td { padding: 8px 10px; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.sup-grid .sup-name { width: 190px; }
.sup-grid .sup-note { width: 380px; }
.sup-grid th:nth-child(2), .sup-grid td:nth-child(2),
.sup-grid th:nth-child(3), .sup-grid td:nth-child(3),
.sup-grid th:nth-child(4), .sup-grid td:nth-child(4) { width: 130px; text-align: center; }
.sup-grid th:nth-child(5), .sup-grid td:nth-child(5) { width: 160px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c6d0da; border-radius: 5px; border: 2px solid #fff; }
::-webkit-scrollbar-track { background: #f4f6f9; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .po-fields, .item-grid, .copy-edit-grid, .copy-item-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid .span4, .copy-span2 { grid-column: span 2; }
  .who em { display: none; }
}

/* ---------- 仪表台：可收起统计面板 ---------- */
.fold-panel { margin: 16px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.fold-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; user-select: none; }
.fold-panel summary::-webkit-details-marker { display: none; }
.fold-title { font-size: 15px; font-weight: 700; color: #22364a; }
.fold-meta { font-size: 12.5px; color: #64748b; }
.fold-caret { margin-left: auto; color: #64748b; transition: transform .18s; }
.fold-panel[open] .fold-caret { transform: rotate(180deg); }
.fold-body { padding: 0 18px 18px; border-top: 1px dashed var(--line); }
.fold-sum { margin: 12px 0 0; font-size: 12.5px; color: #5b6b7c; }
.fold-sum b { color: #22364a; }
.fold-tools { margin: 12px 0 6px; }
.fold-tools .inp { max-width: 320px; }
.sub-title { font-size: 13px; color: #33475b; margin: 14px 0 6px; font-weight: 700; }
.stat-table { width: 100%; min-width: 620px; }
.stat-table th[data-sort] { cursor: pointer; white-space: nowrap; }
.stat-table th[data-sort]:hover { color: var(--brand); }
.sort-arrow { color: #9aa8b6; font-weight: 400; font-size: 11px; }
.money-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* ---------- 管理员删除提醒 ---------- */
.alert-panel { border: 1px solid #f0c2bd; background: #fff5f4; border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.alert-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.alert-head b { color: #b03a2e; }
.alert-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.alert-list li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 6px 8px; background: #fff; border-radius: 6px; }
.alert-type { color: #b03a2e; font-weight: 700; white-space: nowrap; }
/* ---------- 项目文件 ---------- */
.proj-files { display: flex; flex-direction: column; gap: 8px; }
.file-drop { border: 1.5px dashed #c7d2de; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; background: #fafcfe; font-size: 13px; }
.file-drop:hover, .file-drop.drag { border-color: var(--brand); background: #f3f8ff; }
.po-file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.po-file { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12.5px; max-width: 100%; }
.po-file.new { border-color: #e8a33a; background: #fff8eb; box-shadow: 0 0 0 2px #fbe6c2 inset; }
.po-file .ficon { width: 26px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: #eef3f8; color: #345; font-size: 9px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.po-file .fname { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-file .fsize { color: #8a99a8; font-size: 11px; }
.po-file a { color: #2b5d8c; text-decoration: none; }
.po-file .fx { border: 0; background: transparent; color: #b03a2e; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.po-file .pending { color: #8a6d1f; }
.po-file .fmain { display: flex; flex-direction: column; gap: 4px; min-width: 170px; max-width: 250px; }
.po-file .fmain .fname { max-width: 240px; }
.po-file .fbar { display: block; height: 7px; border-radius: 4px; background: #dce7f2; border: 1px solid #cbd9e7; overflow: hidden; }
.po-file .fbar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--brand); transition: width .15s linear; }
.po-file .fbar.active i { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 4px, transparent 4px 8px); background-size: 11px 11px; animation: filebar 0.7s linear infinite; }
@keyframes filebar { from { background-position: 0 0; } to { background-position: 11px 0; } }
.po-file .fbar.err i { background: #c0392b; }
.po-file.pending.uploading { border-color: #7aa7d4; background: #f3f8ff; }
.po-file.pending.done { border-color: #7fc08b; background: #f3fbf5; }
.po-file.pending.error { border-color: #d98b82; background: #fff5f4; }
.po-file.pending.error .fsize { color: #b03a2e; }
.po-file .fx:disabled { color: #c3ccd6; cursor: not-allowed; }
.file-badge { display: inline-block; margin-top: 4px; padding: 2px 7px; border-radius: 5px; font-size: 11.5px; cursor: pointer; border: 1px solid #cfdbe8; color: #2b5d8c; background: #f6fafd; }
.file-badge.new { border-color: #e8a33a; background: #fff3dc; color: #9a6200; font-weight: 600; }
.po-file-line { margin-top: 6px; padding-left: 20px; }
.po-file-line a.file-link { display: inline-block; padding: 1px 6px; border: 1px solid #cfdbe8; border-radius: 5px; background: #f6fafd; color: #2b5d8c; text-decoration: none; }
.po-file-line a.file-link.new { border-color: #e8a33a; background: #fff3dc; color: #9a6200; font-weight: 600; }
.po-file-line a.file-link:hover { border-color: #2b5d8c; color: #17456f; }

/* ---------- 审批入口 / 审批提醒 ---------- */
.nav-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: #c0392b; color: #fff; font-size: 11px;
  line-height: 17px; text-align: center; vertical-align: 1px;
}
.approval-tip { display: flex; flex-direction: column; gap: 12px; }
.appr-tip-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.appr-tip-num { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--brand); color: #fff; font-size: 18px; font-weight: 700; flex: none; }
.appr-tip-num.red { background: #c0392b; }
.po-meta a.danger-link { color: #b03a2e; border-bottom-color: #e6b7b2; }
.ops button.reject-btn { color: #b03a2e; border-color: #eccac6; }

/* ---------- 审批中心 ---------- */
.approval-page { padding-bottom: 24px; }
.approval-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 2px 0 6px; }
.approval-kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.approval-kpi span { font-size: 12.5px; color: #64748b; }
.approval-kpi b { font-size: 22px; color: #0f3f63; font-variant-numeric: tabular-nums; }
.approval-section { margin-top: 18px; }
.approval-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.approval-head h2 { margin: 0; font-size: 16px; color: #0f2f4a; }
.approval-head .muted { font-size: 12.5px; }
.approval-empty { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 22px; text-align: center; color: #7b8794; font-size: 13px; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.approval-grid { width: 100%; min-width: 980px; table-layout: auto; }
.approval-grid th, .approval-grid td { padding: 8px 10px; font-size: 12.5px; vertical-align: top; }
.approval-grid td.po-cell { background: #fff; }
.pend-items { display: flex; flex-wrap: wrap; gap: 5px; max-width: 360px; }
.pend-item { display: inline-flex; align-items: center; gap: 4px; background: #f1f6fb; border: 1px solid #dbe6f1; border-radius: 5px; padding: 2px 7px; font-size: 12px; }
.pend-item em { font-style: normal; color: #7d8b9a; font-size: 11px; }
.approval-ops { white-space: nowrap; }
.approval-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.approval-filter .inp { min-width: 150px; }
.approval-reject-wrap { max-height: 60vh; }
.accept-grid { min-width: 1080px; }
.accept-grid .reason-cell { max-width: 360px; }
.reason-cell { max-width: 280px; white-space: pre-wrap; word-break: break-word; }
.review-cell { max-width: 220px; }
.req-status { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 11.5px; white-space: nowrap; }
.rs-pending { background: #fff4e5; color: #b46000; border: 1px solid #f0d2a8; }
.rs-approved { background: #e9f7ef; color: #17703a; border: 1px solid #bfe3cf; }
.rs-declined { background: #f1f3f5; color: #6b7280; border: 1px solid #dfe4ea; }
.approval-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.approval-stats .panel { padding: 12px 14px; }
.approval-stats .stat-table { min-width: 0; width: 100%; }

/* ---------- 移动端卡片列表（默认隐藏） ---------- */
.mobile-list, .mobile-empty { display: none; }

/* ---------- 820 以下：移动端 ---------- */
@media (max-width: 820px) {
  .topbar { height: 50px; padding: 0 10px; }
  .topbar-right { gap: 10px; }
  .topbar-title, .brand-copy { display: none; }
  .brand-logo.qm { height: 28px; max-width: 44px; }
  .brand-logo.yh { height: 24px; max-width: 28px; }
  .brand-divider { height: 21px; }
  .view-row { margin: 0 0 8px; padding: 6px 8px; flex-wrap: wrap; }
  .view-state { display: none; }
  .view-row #btnCopySelected { margin-left: auto; }
  .site-footer { padding: 14px 10px; }
  .footer-company { display: none; }
  .who em { display: none; }
  .topbar-right .top-link:not(.nav-approval):not([href="logout.php"]):not([href="index.php"]) { display: none; }
  .badge-scope { display: none; }
  .page { padding: 8px 8px 20px; }

  .toolbar { flex-wrap: nowrap; gap: 8px; padding: 8px; overflow: visible; justify-content: space-between; }
  .toolbar #q, .toolbar #fSales, .toolbar #fCountry, .toolbar #fOwner,
  .toolbar #fStatus, .toolbar #fSupplier, .toolbar .chk,
  .toolbar .km-select,
  .toolbar #btnBatchFollow, .toolbar #btnClearAllFollow, .toolbar #btnResetLayout, .toolbar #btnUndoLayout,
  .toolbar .filter-sep, .toolbar .summary, .toolbar .spacer { display: none; }
  .toolbar .btn { padding: 8px 12px; }

  .grid-wrap, .legend { display: none !important; }
  .mobile-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
  .mobile-empty { display: none; background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 34px 16px; text-align: center; }

  .m-card { background: #fff; border: 1px solid #dfe6ee; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(16, 28, 44, .05); }
  .m-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #f7fafd; border-bottom: 1px solid #eef1f5; }
  .m-head-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
  .m-sales { font-size: 11.5px; color: #6b7280; }
  .m-po { font-size: 15px; font-weight: 700; color: #0f4c81; word-break: break-all; }
  .m-po-follow { border: 1px solid #cfdbe8; background: #fff; color: #14507d; border-radius: 7px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  .m-items { display: flex; flex-direction: column; }
  .m-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid #f0f3f7; }
  .m-item:first-child { border-top: 0; }
  .m-imgbox { position: relative; width: 58px; height: 58px; flex: none; }
  .m-thumb { display: block; width: 58px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; background: #fff; }
  .m-noimg { display: flex; align-items: center; justify-content: center; color: #9aa6b4; font-size: 11px; background: #f2f5f8; }
  .m-imgcount { position: absolute; right: 2px; bottom: 2px; background: rgba(15, 40, 65, .72); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 15px; }
  .m-qty { flex: 1; min-width: 0; }
  .m-prodline { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; min-width: 0; }
  .m-prodname { font-size: 13px; font-weight: 600; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-badge { flex: none; font-size: 10px; line-height: 16px; padding: 0 5px; border-radius: 3px; background: #fff2d8; color: #9a6200; border: 1px solid #eed59b; }
  .m-qtyline { display: flex; align-items: baseline; gap: 5px; }
  .m-qtyline em { font-style: normal; font-size: 11px; color: #8a95a1; }
  .m-qtyline b { font-size: 16px; color: #1f2937; word-break: break-all; }
  .m-shipsmall { font-size: 11px; color: #5b6b7c; margin-top: 1px; }
  .m-shipsmall.done { color: #237a4d; font-weight: 600; }
  .m-follow { flex: none; min-width: 72px; padding: 10px 12px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 600; }
  .m-follow:active { background: var(--brand-dark); }
  .m-card.flash, .m-item.flash { background: #fff8d8; transition: background .3s; }

  .modal-panel, .modal-panel.modal-md, .modal-panel.modal-lg {
    width: 100%; max-width: none; height: 100%; max-height: 100vh;
    margin: 0; border-radius: 0;
  }
  .modal-body { max-height: calc(100vh - 120px); padding: 12px 14px; }
  .modal-head { padding: 12px 14px; }
  .modal-foot { padding: 10px 14px; border-radius: 0; }
  .modal-foot .btn { padding: 9px 14px; }
  .po-fields, .item-grid, .copy-edit-grid, .copy-item-grid { grid-template-columns: 1fr; }
  .item-grid .span2, .item-grid .span4, .copy-span2 { grid-column: span 1; }
  .approval-kpis { grid-template-columns: repeat(2, 1fr); }
  .approval-stats { grid-template-columns: 1fr; }
  .approval-grid { min-width: 760px; }
  .approval-filter .inp { flex: 1 1 100%; }
}

/* ===== 批量导入订单 ===== */
.import-guide { border: 1px solid #e3ebf3; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fbfdff; }
.import-guide > b { color: #0f3f63; font-size: 13.5px; }
.import-guide p { color: #5f6f80; font-size: 12.5px; line-height: 1.65; margin: 6px 0; }
.import-tpl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.import-drop { border: 1.5px dashed #b9cde2; background: #fff; border-radius: 9px; padding: 18px; text-align: center; cursor: pointer; }
.import-drop b { display: block; color: #14507d; font-size: 13.5px; margin-bottom: 6px; }
.import-drop span { display: block; font-size: 12px; }
.import-drop.over { border-color: var(--brand); background: #f3f8fd; }
.import-file-name { font-size: 12.5px; color: #14507d; margin: 8px 0; word-break: break-all; }
.import-result { margin-top: 12px; border-radius: 9px; overflow: hidden; border: 1px solid #dbe8d3; }
.import-ok { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 10px 12px; background: #f2faee; color: #215c26; font-size: 13px; }
.import-ok b { font-size: 13.5px; }
.import-ok .warn-text { color: #9a5a00; }
.import-issues { padding: 10px 12px; background: #fffdf3; border-top: 1px solid #f0e4bf; font-size: 12.5px; color: #6b5629; }
.import-issues b { display: block; margin-bottom: 5px; color: #8a5a00; }
.import-issues ul { margin: 0; padding-left: 18px; line-height: 1.7; max-height: 180px; overflow: auto; }

/* ===== 总统计 ===== */
.total-kpi-row { grid-template-columns: repeat(4, 1fr); }
.stat-year-form label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4d5f73; }
.stat-year-form select { height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: #fff; }
.stats-note { background: #f6faff; border: 1px solid #dceaf7; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: #44607a; margin: 0 0 14px; }
.total-table { min-width: 1180px; }
.total-name, .total-sup { min-width: 130px; white-space: nowrap; }
.total-year { width: 64px; text-align: center; }
.total-month { width: 46px; text-align: center; padding: 6px 2px !important; font-size: 12px; }
.total-sum { width: 58px; text-align: center; }
.total-last { min-width: 128px; white-space: nowrap; font-size: 12px; }
.total-note { min-width: 210px; max-width: 300px; font-size: 12px; }
.zero { color: #c3ccd6; }
.overdue-num { color: #b42318; font-weight: 700; background: #fff6f5; }
.ok-text { color: #177245; }
@media (max-width: 760px) {
  .total-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .stat-year-form label { width: 100%; justify-content: space-between; }
}
.reset-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.reset-row .muted { font-size: 12px; margin-right: 4px; }
.total-admin-panel { padding: 14px 16px; margin-bottom: 16px; background: #f8fbff; border-color: #d6e6f5; }
.total-admin-panel .pane-head { padding: 0; }
.total-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sup-grid { min-width: 1450px; }
.sup-grid .dash-m { width: 44px !important; text-align: center !important; padding: 7px 2px !important; }
.sup-grid .dash-last { width: 150px; }
.sup-grid .sup-note { width: 300px; }

/* ===== 零件重做 ===== */
.c-qty { min-width: 110px; }
.qty-orig { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.3; color: #7a8797; white-space: nowrap; }
.cost-flag { display: inline-flex; align-items: center; margin-top: 4px; padding: 2px 6px; border: 1px solid #f1b27a; border-radius: 4px; background: #fff5e8; color: #a55a00; font-size: 10.5px; cursor: pointer; }
.cost-flag:hover { background: #ffe9cc; }
.redo-btn { position: relative; }
.redo-btn.has-pending { border-color: #e29a4b; color: #9a5300; background: #fff8ee; }
.redo-dot { display: inline-block; width: 6px; height: 6px; margin-left: 3px; border-radius: 50%; background: #d98213; vertical-align: 1px; }
.rk-meta { padding: 8px 10px; margin-bottom: 12px; background: #f7faff; border: 1px solid #dfeaf5; border-radius: 7px; font-size: 12.5px; line-height: 1.7; color: #42566a; }
.rk-qty-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rk-qty-row input { width: 130px; }
.rk-preview { font-size: 12.5px; color: #14507d; }
.rk-proc-row { display: grid; grid-template-columns: 1fr 130px 28px; gap: 6px; margin-bottom: 6px; }
.rk-proc-row .icon-btn { width: 28px; height: 30px; color: #9b2c2c; }
.rk-history-head { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid #e7edf4; font-size: 13px; }
.rk-history-head .muted { font-size: 11.5px; }
.rk-history { max-height: 300px; overflow: auto; padding-right: 4px; }
.rk-empty { padding: 18px 0; text-align: center; color: #8a97a6; font-size: 12.5px; }
.rw-rec { padding: 9px 10px; margin-bottom: 8px; border: 1px solid #e2e9f1; border-radius: 7px; background: #fbfcfe; font-size: 12px; }
.rw-rec.is-pending { border-color: #f0c896; background: #fffaf2; }
.rw-rec-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.rw-rec-top b { font-size: 13px; color: #17293d; }
.rw-rec-top span { color: #8391a1; font-size: 11px; }
.rw-rec-body { margin-top: 5px; color: #485b6e; line-height: 1.6; }
.rw-rec-process, .rw-rec-note { margin-top: 4px; color: #5c6d7f; line-height: 1.6; }
.rw-rec-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: #5c6d7f; }
.pending-text { color: #b35c00 !important; font-weight: 700; }
.link-btn { border: 0; background: none; color: #14507d; font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.rw-cost-editor { margin-top: 8px; padding: 8px; border: 1px dashed #e8c79f; border-radius: 6px; background: #fff; }
.rw-cost-row { display: grid; grid-template-columns: 1fr 140px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.rw-cost-row .inp { height: 30px; }
.rw-cost-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ===== 项目文件清单 ===== */
.pf-list { max-height: 420px; overflow: auto; border: 1px solid #e2e9f1; border-radius: 8px; }
.pf-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #edf1f6; cursor: pointer; }
.pf-item:last-child { border-bottom: 0; }
.pf-item:hover { background: #f7fbff; }
.pf-item input { flex: 0 0 auto; }
.pf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-name { font-size: 13px; color: #203549; word-break: break-all; }
.pf-meta { font-size: 11.5px; color: #7c8b9b; }
.pf-new { flex: 0 0 auto; padding: 2px 6px; border-radius: 3px; background: #fff0d6; color: #a35a00; font-size: 10.5px; font-weight: 700; }

/* ===== 总统计：重做 ===== */
.block-subtitle { margin: 18px 0 8px; font-size: 14px; color: #203549; }
.rework-table { min-width: 980px; }
.rw-po { min-width: 150px; white-space: nowrap; }
.rw-product { min-width: 190px; }
.rw-num { width: 82px; text-align: center; }
.rw-money { width: 110px; text-align: right; }
.rw-time { min-width: 128px; white-space: nowrap; font-size: 12px; }
.rw-reason { width: 120px; white-space: nowrap; }
.rw-name { min-width: 190px; }


/* ===== 跟进照片与语音 ===== */
.voice-row { display: flex; gap: 8px; align-items: flex-end; }
.voice-row textarea { flex: 1; min-width: 0; }
.voice-btn { white-space: nowrap; height: 34px; }
.voice-btn.on { background: #fdeceb; border-color: #c0392b; color: #a93226; }
.photo-drop { margin-top: 6px; border: 1px dashed #c9d6e3; border-radius: 8px; padding: 10px 12px; text-align: center; cursor: pointer; background: #fbfdff; display: flex; flex-direction: column; gap: 3px; }
.photo-drop:hover, .photo-drop.over { border-color: #2f6f8f; background: #f0f8fc; }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-item { position: relative; width: 104px; border: 1px solid #dce5ee; border-radius: 6px; overflow: hidden; background: #f7f9fb; }
.photo-item img { width: 100%; height: 72px; object-fit: cover; display: block; }
.photo-ph { height: 72px; display: flex; align-items: center; justify-content: center; color: #8a99a8; font-size: 11px; background: #eef3f7; }
.photo-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 3px 5px; font-size: 10.5px; color: #5b6b7c; }
.photo-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta em { font-style: normal; color: #c0392b; flex: none; }
.photo-bar { height: 3px; background: #e6ebf0; }
.photo-bar i { display: block; height: 100%; background: #2f6f8f; transition: width 0.15s; }
.photo-rm { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(32, 53, 73, 0.72); color: #fff; cursor: pointer; line-height: 18px; padding: 0; }
.hist-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hist-photos a { display: block; width: 68px; height: 68px; border-radius: 5px; overflow: hidden; border: 1px solid #dce5ee; }
.hist-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 批量导入预览 ===== */
.import-issues-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 6px; }
.import-issue-scroll { max-height: 230px; overflow: auto; border: 1px solid #e2e9f1; border-radius: 6px; }
.import-issue-table { min-width: 620px; width: 100%; border-collapse: collapse; font-size: 12px; }
.import-issue-table th, .import-issue-table td { padding: 6px 8px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: top; }
.import-issue-table th { position: sticky; top: 0; background: #f5f8fb; color: #40556a; font-weight: 600; }
.import-issue-table td.mono { font-family: Consolas, monospace; }
.import-rollback { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf1f6; }

.imp-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; padding: 0 2px; }
.imp-edit-head b { color: #0f3f63; font-size: 13.5px; }
.imp-edit-head span { color: #66788a; font-size: 12px; }
.imp-group { border: 1px solid #dce8f2; border-radius: 9px; padding: 12px; margin-bottom: 12px; background: #fbfdff; }
.imp-head-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; }
.imp-po-remark { margin-bottom: 10px; }
.imp-items { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.imp-item-card { border: 1px solid #e2ecf3; border-radius: 8px; background: #fff; }
.imp-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px dashed #e2ecf3; font-size: 12.5px; }
.imp-item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 10px; }
.imp-item-grid .fld { margin: 0; }
.imp-item-grid .fld span { font-size: 11.5px; }
.imp-inp { height: 32px; font-size: 12.5px; }
.imp-add-item { margin-top: 2px; }
.imp-del-item { color: var(--red); }

/* ===== 多供应商分拆与附件管理 ===== */
.split-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #fff3e8; color: #a54c12; font-size: 11px; border: 1px solid #f5d7bd; white-space: nowrap; }
.sup-split { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; line-height: 1.35; }
.sup-split-row { display: flex; gap: 4px; border-bottom: 1px dashed #edf1f6; padding-bottom: 1px; }
.sup-split-row:last-child { border-bottom: 0; }
.sup-split-row b { color: #2f4f65; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-split { margin: 4px 0 10px; border: 1px dashed #d5e2ec; border-radius: 7px; padding: 8px; background: #fbfcfe; }
.split-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.split-head b { color: #2f4f65; }
.split-head span { flex: 1; min-width: 180px; font-size: 11.5px; }
.split-empty { font-size: 11.5px; padding: 6px 0 2px; }
.split-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.split-row { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; background: #fff; border: 1px solid #edf2f7; border-radius: 6px; padding: 7px; }
.split-row .fld { margin: 0; }
.split-row .fld span { font-size: 11px; }
.split-row input { height: 30px; font-size: 12px; padding: 0 6px; }
.split-del { height: 30px; }
.sup-history-line { display: flex; align-items: center; gap: 8px; margin: -2px 0 8px; font-size: 11.5px; }
.copy-items-head { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.copy-items-head h3 { margin: 0; white-space: nowrap; }
.copy-items-head .muted { white-space: nowrap; }
.copy-item-body { display: flex; gap: 10px; align-items: flex-start; }
.copy-item-imgs { display: flex; flex-wrap: wrap; gap: 4px; width: 78px; flex: none; }
.copy-item-imgs a { display: block; width: 78px; height: 62px; border: 1px solid #dce5ee; border-radius: 5px; overflow: hidden; background: #f4f7fa; }
.copy-item-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.copy-img-more { width: 78px; text-align: center; font-size: 11px; color: #7190a8; }
.copy-item-grid { flex: 1; min-width: 0; }
.pf-toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.hist-filter { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; border-bottom: 1px solid #edf2f7; margin-bottom: 8px; }
.hist-filter span { font-size: 12px; color: #5d7184; }
.hist-filter select { height: 30px; border: 1px solid #d5e1ec; border-radius: 5px; padding: 0 8px; background: #fff; }
.sup-current-box { padding: 10px; border: 1px solid #dce8f2; border-radius: 7px; background: #f7fbfe; margin-bottom: 12px; }
.sup-section-title { font-weight: 700; color: #2f4f65; font-size: 13px; margin: 0 0 8px; }
.sup-now { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed #e1eaf1; font-size: 12.5px; }
.sup-now:last-child { border-bottom: 0; }
.sup-now .muted { font-size: 11.5px; }
.split-follow-list { display: flex; flex-direction: column; gap: 8px; }
.split-follow-item { border: 1px solid #dce8f2; border-radius: 6px; padding: 8px; background: #fbfdff; }
.split-follow-name { font-weight: 700; color: #2f4f65; margin-bottom: 5px; font-size: 12.5px; }
.split-follow-row { display: grid; grid-template-columns: minmax(100px, 1.1fr) minmax(120px, 1.6fr) minmax(100px, 1fr); gap: 8px; align-items: center; padding: 4px 0; border-top: 1px dashed #edf2f7; }
.split-follow-row:first-of-type { border-top: 0; }
.split-follow-sup { font-size: 12px; }
.split-follow-row .inp { height: 30px; }
.admin-filter-bar { margin-bottom: 0; }
.admin-bulkbar { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #e6edf4; flex-wrap: wrap; }
.admin-bulkbar .chk { margin: 0; font-size: 12.5px; }
.admin-bulkbar .spacer { flex: 1; }
.chk-col { width: 34px; text-align: center; }
.fu-content { max-width: 420px; white-space: normal; line-height: 1.45; }

@media (max-width: 820px) {
  .voice-row { align-items: stretch; }
  .voice-btn { height: 38px; }
  .photo-item { width: 88px; }
  .photo-item img, .photo-ph { height: 64px; }
  .import-issues-head { flex-wrap: wrap; }
  .imp-head-grid, .imp-item-grid { grid-template-columns: 1fr 1fr; }
  .split-row { grid-template-columns: 1fr 1fr; }
  .split-row .split-del { grid-column: 1 / -1; }
  .copy-item-body { display: block; }
  .copy-item-imgs { width: auto; margin-bottom: 6px; }
  .split-follow-row { grid-template-columns: 1fr; gap: 3px; }
}
