:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --border: #e3e8ef;
  --border-strong: #cdd5df;
  --text: #16202e;
  --text-2: #5a6a7d;
  --text-3: #8b98a8;
  --primary: #1f6feb;
  --primary-dark: #1858c4;
  --primary-soft: #eaf2ff;
  --success: #16a34a;
  --success-soft: #e8f7ee;
  --warn: #d97706;
  --warn-soft: #fdf3e3;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --info: #0891b2;
  --info-soft: #e4f6fa;
  --purple: #7c3aed;
  --purple-soft: #f1e9fe;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 3px rgba(16, 32, 60, .06), 0 6px 20px rgba(16, 32, 60, .06);
  --shadow-lg: 0 12px 40px rgba(16, 32, 60, .16);
}

* { box-sizing: border-box; }

/* ---------- 内联 SVG 图标 ---------- */
.ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ico svg { width: 1em; height: 1em; display: block; }
.nav-item .ico { width: 17px; height: 17px; }
.nav-item .ico svg { width: 17px; height: 17px; }
.brand-title .ico svg { width: 18px; height: 18px; }
.alert .ico svg { width: 17px; height: 17px; margin-top: 1px; }
.alert .ico { flex-shrink: 0; }
.feature-card .fc-ico svg { width: 22px; height: 22px; color: var(--primary); }
.upload-box .ico svg { width: 22px; height: 22px; color: var(--text-3); }
.tab-line .ico svg, .tab-line > svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.pill .ico svg { width: 13px; height: 13px; }
.file-row > .ico svg { width: 17px; height: 17px; }
.req-chip .ico svg { width: 14px; height: 14px; }
/* 未完成项的方框标记 */
.sq {
  display: inline-block; width: 13px; height: 13px; border: 1.5px solid currentColor;
  border-radius: 3px; opacity: .55; flex-shrink: 0;
}
.del-btn svg, .btn .ico svg { width: 14px; height: 14px; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ============ 布局 ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: #10192a; color: #cdd7e5;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-title { font-size: 15px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
/* 侧边栏公司 Logo：与文字同行，圆角小徽标 */
.brand-logo {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.brand-sub { font-size: 11px; color: #6b7a90; margin-top: 3px; }
.role-badge {
  display: inline-block; margin-top: 9px; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.role-supplier { background: rgba(31,111,235,.2); color: #7fb0ff; }
.role-consignee { background: rgba(124,58,237,.2); color: #b79bf5; }
.role-admin { background: rgba(217,119,6,.2); color: #f0b357; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group-title { font-size: 11px; color: #5d6c82; padding: 12px 10px 5px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: #b9c5d4; font-size: 13.5px;
  transition: background .13s, color .13s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item .ico { width: 17px; text-align: center; flex-shrink: 0; }
.nav-item .count {
  margin-left: auto; background: rgba(255,255,255,.14); padding: 0 6px;
  border-radius: 9px; font-size: 11px; min-width: 19px; text-align: center;
}
.nav-item.active .count { background: rgba(255,255,255,.25); }
.nav-item .count.hint-dot {
  background: none; color: #7f93ab; font-size: 15px; line-height: 1; padding: 0 2px;
}
.nav-item.active .count.hint-dot { background: none; color: rgba(255,255,255,.8); }
.nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 4px; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { font-size: 12px; color: #8595ab; margin-bottom: 10px; word-break: break-all; }
.sidebar-user b { color: #dbe4ef; display: block; font-size: 13px; margin-bottom: 2px; }
/* 深色侧栏上的按钮需提高文字对比度 */
.sidebar-foot .btn {
  color: #cdd7e5; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14);
  justify-content: center;
}
.sidebar-foot .btn:hover { background: rgba(255,255,255,.13); color: #fff; border-color: rgba(255,255,255,.25); }
.sidebar-foot .btn .ico svg { stroke: currentColor; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 13px 24px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; }
.topbar .crumb { font-size: 12px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 20px 24px 48px; flex: 1; }

/* ============ 组件 ============ */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: all .13s; white-space: nowrap;
}
.btn .ico { font-size: 14px; }
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #128a3d; border-color: #128a3d; }
.btn-danger { background: #fff; border-color: #f0b4b1; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: #eef1f6; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px;
  border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill-draft { background: var(--warn-soft); color: var(--warn); }
.pill-saved { background: var(--info-soft); color: var(--info); }
.pill-confirmed { background: var(--success-soft); color: var(--success); }
.pill-neutral { background: #eef1f6; color: var(--text-2); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-primary { background: var(--primary-soft); color: var(--primary); }

.tag { display:inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; background: #eef1f6; color: var(--text-2); }

table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; padding: 9px 12px; font-size: 12px; font-weight: 600;
  color: var(--text-2); background: var(--panel-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.clickable { cursor: pointer; }

/* 合作方详情页：层级穿透（点击行展开 / 跳转） */
.p-link { cursor: pointer; }
.p-link:hover { color: var(--primary); text-decoration: underline; }
tr.prow { cursor: pointer; }
tr.prow td .ico svg { width: 12px; height: 12px; opacity: .45; transition: transform .15s; }
tr.prow.open td .ico svg { transform: rotate(90deg); opacity: .9; }
tr.prow.open td { background: var(--primary-soft); }
tr.pexp-row > td { background: #f7f9fc; padding: 0 !important; border-top: 1px dashed var(--border); }
.pexp-body { padding: 14px 18px; }
.pexp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* 收货人板块：界面语言切换（侧栏底部） */
.lang-pick { margin-bottom: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lang-label { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; }
.lang-label .ico svg { width: 12px; height: 12px; }
.lang-chips { display: flex; gap: 5px; }
.lang-chip {
  flex: 1; padding: 5px 0; border: 1px solid var(--border-strong); border-radius: 6px;
  background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer; text-align: center;
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lang-chip:hover { border-color: var(--primary); color: var(--primary); }
.lang-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; cursor: default; }

/* 「文件」模块：上传区（类别 / 备注 / 选文件 / 按钮一行排布） */
.cfile-upload { display: grid; grid-template-columns: 180px 1fr 1fr auto; gap: 12px; align-items: start; }
.cfile-upload .field { margin-bottom: 0; }
.cfile-upload .field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
@media (max-width: 900px) { .cfile-upload { grid-template-columns: 1fr 1fr; } }

.empty { text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .55; }
.empty .big .ico svg { width: 42px; height: 42px; stroke-width: 1.2; }
.empty .t { font-size: 14px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; position: relative; overflow: hidden;
}
.stat .label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
/* 可点击统计卡：点数字直达对应列表（详情穿透入口） */
.stat-click { cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.stat-click:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(30, 80, 160, .10); }
.stat-click .label .ico svg { width: 13px; height: 13px; opacity: .55; }
.stat .value { font-size: 23px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.stat .hint { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.stat.accent-primary .value { color: var(--primary); }
.stat.accent-success .value { color: var(--success); }
.stat.accent-warn .value { color: var(--warn); }
.stat.accent-danger .value { color: var(--danger); }
.stat.accent-purple .value { color: var(--purple); }

.progress { height: 6px; background: #eceff4; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.progress.success > i { background: var(--success); }
.progress.warn > i { background: var(--warn); }

/* 表单 */
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: #3c4a5c; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
/* 按角色分区锁定的字段：整块置灰、控件禁用（服务端还会再过滤一次） */
.field-locked { opacity: .78; }
.field-locked > label { color: var(--text-3); }
.field-locked .input, .field-locked .select, .field-locked .textarea,
.field-locked input, .field-locked select, .field-locked textarea {
  background: #f5f7fa; color: var(--text-2); cursor: not-allowed;
}
.field-locked .seg-tag { margin-left: 6px; font-weight: 500; vertical-align: 1px; }
.input, .select, .textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; outline: none; transition: border-color .13s, box-shadow .13s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.input:disabled, .select:disabled { background: #f4f6f9; color: var(--text-2); }
.input-unit { position: relative; }
.input-unit .unit {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-3); pointer-events: none;
}
.input-unit .input { padding-right: 44px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols4 { grid-template-columns: repeat(4, 1fr); }

.marks-group { display: flex; flex-wrap: wrap; gap: 8px; }
.mark-btn {
  padding: 5px 14px; border: 1px solid var(--border-strong); border-radius: 20px;
  background: #fff; cursor: pointer; font-size: 13px; transition: all .13s;
}
.mark-btn:hover { border-color: var(--primary); }
.mark-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 明细表格编辑器 */
.tbl-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
table.grid-edit { width: 100%; border-collapse: collapse; min-width: 780px; }
table.grid-edit th {
  background: var(--panel-2); padding: 7px 8px; font-size: 11.5px; font-weight: 600;
  color: var(--text-2); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
}
table.grid-edit td { padding: 3px 5px; border-bottom: 1px solid #f0f3f7; }
table.grid-edit td input, table.grid-edit td select {
  width: 100%; padding: 5px 7px; border: 1px solid transparent; background: transparent;
  border-radius: 5px; outline: none;
}
/* 单位/短选项列需留出足够宽度，否则 select 文字被截断 */
table.grid-edit td select { min-width: 62px; }
table.grid-edit td input[type=number] { min-width: 54px; }
table.grid-edit td input:hover, table.grid-edit td select:hover { border-color: var(--border); background: #fff; }
table.grid-edit td input:focus, table.grid-edit td select:focus { border-color: var(--primary); background: #fff; }
table.grid-edit td input.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid-edit td.calc { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--primary); padding: 7px 8px; }
table.grid-edit .row-no { text-align: center; color: var(--text-3); font-size: 12px; }
table.grid-edit .del-btn {
  border: 0; background: transparent; cursor: pointer; color: var(--text-3);
  padding: 3px 6px; border-radius: 4px;
}
table.grid-edit .del-btn:hover { background: var(--danger-soft); color: var(--danger); }
.tbl-foot { padding: 7px 10px; background: var(--panel-2); display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--border); }
.tbl-total { margin-left: auto; font-size: 13px; font-weight: 600; }
.tbl-total b { color: var(--primary); font-size: 15px; }

/* 上传 */
.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; cursor: pointer; background: var(--panel-2);
  transition: all .13s;
}
.upload-box:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-box .ico { font-size: 22px; margin-bottom: 4px; }
.upload-box .t { font-size: 13px; color: var(--text-2); }
.upload-box .s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; margin-top: 10px; }
.thumb {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; position: relative;
}
.thumb img { width: 100%; height: 76px; object-fit: cover; display: block; background: #f0f3f7; }
.thumb .file-view {
  height: 76px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; background: #f4f6f9;
}
.thumb .meta { padding: 4px 6px; font-size: 10.5px; color: var(--text-2); word-break: break-all; line-height: 1.35; }
.thumb .bar { position: absolute; top: 4px; left: 4px; }
.thumb .rm {
  position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff;
  border: 0; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 12px; line-height: 1;
}
.thumb .rm:hover { background: var(--danger); }

.file-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 7px; background: #fff;
}
.file-row .nm { flex: 1; min-width: 0; font-size: 13px; word-break: break-all; }
.file-row .sz { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* 三态工具条 */
.state-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--panel-2); border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius); position: sticky; bottom: 0; z-index: 5;
}
.state-bar .tip { font-size: 12px; color: var(--text-3); margin-right: auto; }

/* 提示 */
.alert {
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px;
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 13px; line-height: 1.55;
}
.alert-info { background: var(--primary-soft); color: #14448f; }
.alert-warn { background: var(--warn-soft); color: #92500a; }
.alert-danger { background: var(--danger-soft); color: #9b1c1c; }
.alert-success { background: var(--success-soft); color: #146c43; }
.alert .ico { flex-shrink: 0; }

/* 步骤条 */
.steps { display: flex; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 7px; padding: 8px 16px 8px 14px;
  background: #fff; border: 1px solid var(--border); border-right: 0;
  font-size: 13px; color: var(--text-2); cursor: pointer; position: relative;
}
.step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.step:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.step .n {
  width: 20px; height: 20px; border-radius: 50%; background: #e6eaf0; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.step.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.step.active .n { background: rgba(255,255,255,.28); color: #fff; }
.step.done { color: var(--success); }
.step.done .n { background: var(--success); color: #fff; }

/* 认证页 */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 28px 18px;
  background: linear-gradient(135deg, #10192a 0%, #1b2f4d 55%, #1f6feb 130%);
}
.auth-card {
  width: 100%; max-width: 940px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden; display: flex;
}
.auth-side {
  flex: 0 0 300px; background: linear-gradient(160deg, #10192a, #1e3a63); color: #cdd7e5;
  padding: 32px 26px; display: flex; flex-direction: column;
}
.auth-side h2 { color: #fff; font-size: 19px; margin: 0 0 4px; line-height: 1.45; }
/* 公司 Logo（原图为米白底方形 JPG，深色背景上以圆角徽标呈现，比例 1:1 不拉伸） */
.auth-logo {
  width: 58px; height: 58px; border-radius: 13px; display: block;
  margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.auth-en { font-size: 11px; color: #7e93af; margin-bottom: 14px; letter-spacing: .2px; }
.auth-side .lead { font-size: 13px; color: #8fa2ba; margin-bottom: 22px; line-height: 1.7; }
.auth-feature { display: flex; gap: 9px; margin-bottom: 13px; font-size: 12.5px; line-height: 1.55; }
.auth-feature .ico { flex-shrink: 0; }
.auth-side .foot { margin-top: auto; font-size: 11.5px; color: #66788f; padding-top: 20px; }
.auth-main { flex: 1; padding: 30px 34px; }
.auth-tabs { display: flex; gap: 4px; background: #eef1f6; padding: 4px; border-radius: 9px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 8px; text-align: center; border-radius: 7px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: all .15s; border: 0; background: transparent;
}
.auth-tab.on { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
/* 新建账户成功后的凭据展示行 */
.cred-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.cred-row:last-of-type { border-bottom: none; }
.cred-label { width: 84px; flex: none; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.cred-val { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cred-val code { flex: 1; font-size: 13.5px; padding: 6px 10px; background: #f5f7fa; border-radius: 6px; overflow-x: auto; }
.role-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 13px;
  cursor: pointer; text-align: center; transition: all .15s; background: #fff;
}
.role-card:hover { border-color: var(--primary); }
.role-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.role-card .ico { font-size: 23px; }
.role-card .nm { font-weight: 650; margin-top: 4px; font-size: 13.5px; }
.role-card .ds { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.45; }

/* Toast */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: #10192a; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: slideDown .2s ease; max-width: 480px;
}
.toast.ok { background: #146c43; }
.toast.err { background: #a41d1d; }
.toast.warn { background: #92500a; }
@keyframes slideDown { from { opacity:0; transform: translateY(-12px);} to {opacity:1; transform:none;} }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 25, 42, .5); z-index: 900;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 13px; width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); animation: popIn .18s ease; margin: auto 0;
}
.modal.wide { max-width: 940px; }
.modal-head { padding: 15px 19px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 650; }
.modal-head .x { margin-left: auto; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text-3); line-height: 1; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 19px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 13px 19px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; background: var(--panel-2); border-radius: 0 0 13px 13px; }
@keyframes popIn { from { opacity:0; transform: scale(.97) translateY(-8px);} to {opacity:1; transform:none;} }

.preflight-item { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 7px; }
.preflight-item.ok { background: var(--success-soft); border-color: #b7e6c8; }
.preflight-item.miss { background: var(--warn-soft); border-color: #f2ddb4; }
.preflight-item .nm { flex: 1; font-size: 13.5px; }
.preflight-item .mk { font-size: 15px; }

/* ---------- HS 编码查询 ---------- */
/* 说明行与 .hs-field 兄弟，靠 .hs-wrap 做锚点（JS 用 closest('.hs-wrap') 定位说明行） */
.hs-wrap { min-width: 0; }
/* 输入框 + 查询按钮：按钮内嵌在输入框右侧，选中后仍可继续手工微调 */
.hs-field { display: flex; gap: 6px; align-items: stretch; }
.hs-field .input { flex: 1; min-width: 0; }
.hs-field .btn { flex-shrink: 0; white-space: nowrap; }
.hs-desc {
  margin-top: 4px; font-size: 11.5px; color: var(--text-2); line-height: 1.5;
}
.hs-desc .code { font-family: var(--mono, ui-monospace, Consolas, monospace); color: var(--primary); font-weight: 600; }
.hs-desc.hit { color: var(--success); }
.hs-desc.miss { color: var(--text-3); }

/* 弹窗内布局：左侧章筛选 + 右侧结果 */
.hs-picker { display: grid; grid-template-columns: 168px 1fr; gap: 14px; min-height: 380px; }
.hs-chapters {
  border-right: 1px solid var(--border); padding-right: 12px;
  max-height: 52vh; overflow-y: auto;
}
.hs-chapters .grp {
  font-size: 11px; color: var(--text-3); padding: 8px 8px 4px; font-weight: 600; letter-spacing: .3px;
}
.hs-chapters .ch {
  display: flex; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 6px;
  cursor: pointer; font-size: 12.5px; color: var(--text-2);
}
.hs-chapters .ch:hover { background: var(--panel-2); color: var(--text); }
.hs-chapters .ch.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.hs-chapters .ch .no { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; flex-shrink: 0; }
.hs-chapters .ch .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-chapters .ch .ct { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.hs-chapters .ch.on .ct { color: var(--primary); }

.hs-results { display: flex; flex-direction: column; min-width: 0; }
.hs-search { display: flex; gap: 7px; margin-bottom: 10px; }
.hs-search .input { flex: 1; }
.hs-list { flex: 1; overflow-y: auto; max-height: 40vh; border: 1px solid var(--border); border-radius: 8px; }
.hs-row {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.hs-row:last-child { border-bottom: 0; }
.hs-row:hover { background: var(--primary-soft); }
.hs-row.on { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.hs-row .code {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 650;
  color: var(--primary); flex-shrink: 0; width: 62px; padding-top: 1px;
}
.hs-row .info { flex: 1; min-width: 0; }
.hs-row .nm { font-size: 13px; color: var(--text); line-height: 1.45; }
.hs-row .en { font-size: 11.5px; color: var(--text-3); line-height: 1.4; margin-top: 1px; }
.hs-row .note {
  display: inline-block; margin-top: 4px; font-size: 11px; padding: 1px 6px;
  border-radius: 4px; background: var(--warn-soft); color: var(--warn);
}
.hs-hint { font-size: 11.5px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }
.hs-sugg { margin-bottom: 10px; }
.hs-sugg .t { font-size: 11.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.hs-sugg .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-sugg .chip {
  padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 14px;
  font-size: 12px; cursor: pointer; background: #fff; color: var(--text-2);
}
.hs-sugg .chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.hs-sugg .chip b { font-family: ui-monospace, Consolas, monospace; color: var(--primary); margin-right: 4px; }

@media (max-width: 760px) {
  .hs-picker { grid-template-columns: 1fr; }
  .hs-chapters { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 10px; max-height: 132px; }
}

.tabs-line { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab-line {
  padding: 8px 15px; cursor: pointer; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tab-line:hover { color: var(--text); }
.tab-line.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }
.tab-line-lock {
  margin-left: auto; color: var(--text-3); font-size: 12px; cursor: default;
  border-bottom-style: dashed; padding-left: 14px;
}

.row-flex { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money-pos { color: var(--success); }
.money-neg { color: var(--danger); }
.divider { height: 1px; background: var(--border); margin: 15px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.req-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.req-chip {
  display: flex; align-items: center; gap: 7px; padding: 7px 11px;
  border: 1px solid var(--border); border-radius: 20px; font-size: 12.5px; background: #fff;
}
.req-chip.ok { border-color: #b7e6c8; background: var(--success-soft); color: #146c43; }
.req-chip.miss { border-color: #f2ddb4; background: var(--warn-soft); color: #92500a; }

.feature-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; background: #fff; position: relative;
}
.feature-card.reserved { border-style: dashed; background: var(--panel-2); }
.feature-card .fc-ico { font-size: 21px; margin-bottom: 6px; }
.feature-card .fc-nm { font-weight: 650; font-size: 13.5px; }
.feature-card .fc-ds { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.feature-card .fc-badge { position: absolute; top: 12px; right: 12px; }

/* ---------------- 导出中心 ---------------- */
/* 移交提示项：可点击进入说明页，但视觉上区别于常规操作入口 */
.nav-item-note { color: #b9c6d8; }
.nav-item-note:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item-note.on-note { background: rgba(255,255,255,.13); color: #fff; border-left: 3px solid #7aa7e8; }
.nav-item-note .count.note {
  background: rgba(255,255,255,.12); color: #a8bad2; font-size: 10px; font-weight: 500;
}

.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 11px; }
.ex-grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.ex-card {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.ex-card:hover { border-color: #b9cfe8; background: #fbfcfe; }
.ex-card.on { border-color: var(--primary); background: var(--primary-soft); }
.ex-card input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--primary); }
.ex-ico { flex-shrink: 0; display: flex; }
.ex-ico svg { width: 20px; height: 20px; color: var(--primary); }
.ex-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ex-nm { font-weight: 650; font-size: 13.5px; }
.ex-ds { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.ex-rows {
  flex-shrink: 0; font-size: 11px; color: var(--text-3); background: var(--panel-2);
  border-radius: 20px; padding: 2px 9px; font-variant-numeric: tabular-nums;
}
.ex-ext { font-size: 11px; color: var(--text-3); background: var(--panel-2); border-radius: 4px; padding: 1px 6px; }
#ex-progress i { transition: width .4s ease; }

@media (max-width: 1000px) {
  .sidebar { width: 190px; }
  .form-grid.cols4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .auth-card { flex-direction: column; }
  .auth-side { display: none; }
  .form-grid, .form-grid.cols3, .form-grid.cols4 { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .content { padding: 14px; }
}
/* ============================================================
   一键填写向导
   ============================================================ */

/* --- 步骤条 --- */
.qf-steps { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.qf-step { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 190px;
  padding: 11px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .15s, background .15s; }
.qf-step.on { border-color: var(--primary); background: var(--primary-soft); }
.qf-step.done { border-color: rgba(31,111,235,.32); }
.qf-num { width: 25px; height: 25px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  color: var(--text-3); font-size: 12px; font-weight: 700; }
.qf-step.on .qf-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.qf-step.done .qf-num { background: var(--success); border-color: var(--success); color: #fff; }
.qf-nm { font-size: 13.5px; font-weight: 650; }
.qf-ds { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* --- 第一步：定位业务 --- */
.qf-pick { display: flex; gap: 9px; }
.qf-pick .input { flex: 1; }
.qf-pick-list { display: grid; gap: 7px; margin-top: 13px; }
.qf-pick-item { display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 13px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; text-align: left;
  transition: border-color .15s, background .15s; }
.qf-pick-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.qf-pick-item .mono { font-weight: 650; }
.qf-pick-item .dim { color: var(--text-3); font-size: 12px; margin-left: auto; }

/* --- 自动计算指标卡 --- */
.qf-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 10px; margin-bottom: 15px; }
.qf-stat .value { font-size: 19px; }
.qf-stat .value small { font-size: 11px; color: var(--text-3); margin-left: 3px; font-weight: 500; }

/* --- 只读计算框 --- */
.calc-ro { background: var(--panel-2) !important; color: var(--text-2) !important;
  border-style: dashed !important; cursor: default; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 13px; }
.form-grid .fg.col2 { grid-column: span 2; }
.fg > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.fg > span b { color: var(--danger); font-weight: 700; }
.fg-hint { display: block; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.fg-hint.ok { color: var(--success); }
.fg-hint.warn { color: var(--warn); }
.qf-checks { display: flex; gap: 20px; flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--primary); }

/* --- 第三步：图片资料 --- */
.qf-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.qf-mcard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.qf-mhead { display: flex; gap: 9px; padding: 11px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.qf-mico svg { width: 19px; height: 19px; color: var(--primary); }
.qf-mnm { font-size: 13px; font-weight: 650; }
.qf-mds { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.45; }
.qf-mbody { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px; min-height: 84px; align-content: flex-start; }
.qf-mfile { position: relative; width: 74px; }
.qf-mfile img { width: 74px; height: 56px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: zoom-in; display: block; }
.qf-mfn { display: block; font-size: 10px; color: var(--text-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qf-mst { display: inline-block; font-size: 9.5px; padding: 0 5px; border-radius: 8px; margin-top: 2px; }
.qf-mst.draft { background: var(--warn-soft); color: var(--warn); }
.qf-mst.saved { background: var(--primary-soft); color: var(--primary); }
.qf-mst.confirmed { background: var(--success-soft); color: var(--success); }
.qf-upload { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; width: 74px; height: 56px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-3); font-size: 10.5px; cursor: pointer; text-align: center;
  transition: border-color .15s, color .15s, background .15s; }
.qf-upload:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.qf-upload svg { width: 17px; height: 17px; }

/* --- 底部保存条 --- */
.qf-savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 11px 15px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 5; }
.qf-savebtns { display: flex; gap: 8px; margin-left: auto; }

/* --- 营业执照识别 --- */
.qf-lic { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 15px; align-items: start; }
.qf-lic-canvas { position: relative; display: inline-block; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); user-select: none; }
.qf-lic-canvas canvas { display: block; }
.qf-box { position: absolute; border: 2px solid #1f6feb; background: rgba(31,111,235,.10);
  box-shadow: 0 0 0 1px rgba(255,255,255,.85) inset; }
.qf-box.b0 { border-color: #1f6feb; background: rgba(31,111,235,.12); }
.qf-box.b1 { border-color: #16a34a; background: rgba(22,163,74,.12); }
.qf-box.b2 { border-color: #d97706; background: rgba(217,119,6,.12); }
.qf-box-tag { position: absolute; top: -19px; left: -2px; font-size: 10px; padding: 1px 6px;
  border-radius: 4px 4px 0 0; background: #1f6feb; color: #fff; white-space: nowrap; font-weight: 600; }
.qf-box.b1 .qf-box-tag { background: #16a34a; }
.qf-box.b2 .qf-box-tag { background: #d97706; }
.qf-box.on { box-shadow: 0 0 0 2px rgba(255,255,255,.9), var(--shadow-lg); }
.qh { position: absolute; width: 9px; height: 9px; background: #fff;
  border: 2px solid #1f6feb; border-radius: 2px; }
.qf-box.b1 .qh { border-color: #16a34a; }
.qf-box.b2 .qh { border-color: #d97706; }
.qh.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.qh.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.qh.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.qh.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.qf-lic-hint { position: absolute; left: 8px; bottom: 8px; font-size: 10.5px;
  background: rgba(22,32,46,.72); color: #fff; padding: 3px 8px; border-radius: 5px; pointer-events: none; }
.qf-lic-fields { display: grid; gap: 13px; }
.qf-lic-row { display: grid; gap: 5px; }
.qf-lic-lb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.qf-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.qf-dot.b0 { background: #1f6feb; } .qf-dot.b1 { background: #16a34a; } .qf-dot.b2 { background: #d97706; }
.qf-lic-hs { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.qf-cand { font-size: 11.5px; padding: 5px 8px; }
.qf-lic-act { display: flex; gap: 7px; padding-top: 3px; }

@media (max-width: 900px) {
  .qf-lic { grid-template-columns: 1fr; }
  .form-grid .fg.col2 { grid-column: span 1; }
}

/* --- 向导工具条 --- */
.qf-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 15px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.qb-info { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 650; }
.qb-info .dim { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.qb-act { display: flex; gap: 8px; margin-left: auto; }
.qf-tip { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px;
  font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
.qf-tip .ico svg { width: 14px; height: 14px; margin-top: 1px; color: var(--info); }

/* ---------------- 物流进度 ---------------- */
#lg-slot:not(:empty) { margin: 0 0 16px; }
.lg-card .card-head .sub b { color: var(--text); }
.lg-card .sub .mono { font-size: 12.5px; }
.lg-card .lg-src { font-size: 11px; color: var(--text-3); }

.warn-text { color: var(--warn); font-weight: 600; }

.lg-bar {
  position: relative; height: 26px; border-radius: 6px;
  background: var(--panel-2); overflow: hidden; border: 1px solid var(--border);
}
.lg-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #2f81f7 100%);
  transition: width .3s ease;
}
.lg-bar-txt {
  position: absolute; inset: 0; display: flex; align-items: center;
  padding-left: 11px; font-size: 12px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.28); pointer-events: none;
}

.lg-timeline { margin-top: 14px; position: relative; padding-left: 20px; }
.lg-timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.lg-node { position: relative; padding-bottom: 14px; }
.lg-node:last-child { padding-bottom: 0; }
.lg-dot {
  position: absolute; left: -19px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-3); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1.5px var(--border);
}
.lg-dot.auto { background: var(--success); }
.lg-dot.manual { background: var(--warn); }
.lg-node-body { font-size: 13px; }
.lg-node-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-node-top b { font-size: 13.5px; }
.lg-node-detail {
  margin-top: 4px; font-size: 12px; color: var(--text-2);
  line-height: 1.6; word-break: break-word;
}
.lg-src { font-size: 11px; color: var(--text-3); }

.lg-add {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
}
/* 轨迹卡上的业务摘要行：合同号 / 收货人 / 唛头号 / 运输公司 */
.lg-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 16px; margin-top: 14px; padding: 11px 13px;
  background: var(--bg-2, #f7f8fa); border: 1px solid var(--border); border-radius: 8px;
}
.lg-meta-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-meta-item > span { font-size: 11.5px; color: var(--text-3); }
.lg-meta-item > b {
  font-size: 12.5px; color: var(--text-1); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lg-add-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 10px;
}
.lg-add-h .ico svg { width: 14px; height: 14px; color: var(--primary); }
.lg-add-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 12px; margin-bottom: 12px;
}
.lg-add-grid .field { display: flex; flex-direction: column; gap: 4px; }
.lg-add-grid .field label { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.lg-add-grid .input { width: 100%; }

@media (max-width: 900px) {
  .lg-add-grid { grid-template-columns: 1fr; }
  .lg-bar-txt { font-size: 11px; padding-left: 8px; }
}
.pill-success { background: var(--success-soft); color: var(--success); }
.lg-del {
  border: 1px solid var(--border); background: var(--panel); color: var(--text-3);
  border-radius: 6px; width: 24px; height: 24px; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.lg-del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.lg-del .ico svg { width: 13px; height: 13px; }

/* ---------------- 商品库 ---------------- */
.lib-card { margin-bottom: 16px; }
.lib-card.open { border-color: var(--primary); box-shadow: var(--shadow); }
.lib-head { cursor: pointer; user-select: none; align-items: center; gap: 10px; }
.lib-head:hover { background: var(--panel-2); }
.lib-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
}
.lib-ico svg { width: 16px; height: 16px; }
.lib-caret {
  display: inline-flex; color: var(--text-3); transition: transform .2s ease;
  margin-left: 2px;
}
.lib-card.open .lib-caret { transform: rotate(90deg); }
.lib-card.open .lib-caret svg { width: 16px; height: 16px; }

.lib-search { display: flex; gap: 8px; margin-bottom: 12px; }
.lib-search .input { flex: 1; }

.lib-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px;
}
.lib-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--panel);
}
.lib-item:hover { border-color: var(--primary); }
.lib-item-main { flex: 1; min-width: 0; }
.lib-item-name {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 700;
}
.lib-item-meta {
  margin-top: 3px; font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-used {
  font-size: 10.5px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); padding: 1px 6px; border-radius: 20px;
}
.lib-img {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--text-3);
}
.lib-img svg { width: 12px; height: 12px; }
.lib-item-act { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

/* 商品库缩略图：按图选货，最多 3 张 + 剩余计数 */
.lib-thumbs { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.lib-thumb {
  width: 38px; height: 38px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; background: var(--panel); cursor: zoom-in;
  transition: border-color .15s, transform .15s;
}
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-thumb:hover { border-color: var(--primary); transform: scale(1.06); }
.lib-thumb-more {
  font-size: 10.5px; color: var(--text-3); font-weight: 600;
  background: var(--bg-soft); border-radius: 20px; padding: 2px 6px;
}
.lib-del {
  border: 1px solid var(--border); background: var(--panel); color: var(--text-3);
  border-radius: 6px; width: 26px; height: 26px; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.lib-del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.lib-del svg { width: 13px; height: 13px; }

.qf-tolib {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 4px 10px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 600;
}
.qf-tolib:hover { background: #dbeaff; }
.qf-tolib .ico svg { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .lib-list { grid-template-columns: 1fr; }
  .qf-savebar { flex-wrap: wrap; }
  .qf-tolib { order: 3; width: 100%; justify-content: center; }
}

/* ================= 货币 =================
   多币种不做汇率换算，跨币种金额一律按币种分组显示。
   .mc-* 是分组统计块，.cur-tag 是表格里的币种标记。 */

/* 表格/卡片里的币种标记 */
.cur-tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* 统计卡内嵌的多币种列表（卡空间窄，用小字分行） */
.mc-inline {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--text);
}
.mc-inline > div { display: flex; align-items: center; gap: 6px; }

/* 独立的多币种分组块 */
.mc-block { font-size: 13px; }
.mc-label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 12px; margin-bottom: 8px;
}
.mc-warn {
  padding: 1px 7px; border-radius: 20px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 11px; font-weight: 600;
}
.mc-rows { display: flex; flex-direction: column; gap: 6px; }
.mc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.mc-v { font-size: 15px; font-weight: 600; }
.mc-hint { margin-top: 8px; color: var(--text-3); font-size: 11.5px; line-height: 1.6; }
.mc-empty { color: var(--text-3); font-size: 12.5px; padding: 6px 0; }

/* 金额列右对齐时给符号留位 */
td.money, .stat .value { font-variant-numeric: tabular-nums; }

/* ---------- 收货人指派 ---------- */
.consignee-card { margin-top: 14px; }
.cg-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cg-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }
.cg-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.cg-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
/* 电话用斜体弱化：是指派记录的一部分，不是要突出显示的信息 */
.cg-chip .cg-tel { font-style: normal; font-weight: 400; opacity: .75; margin-left: 2px; }
.cg-empty { font-size: 12.5px; color: var(--text-3); }
.cg-hint { display: flex; align-items: center; gap: 5px; margin-top: 9px; font-size: 11.5px; color: var(--text-3); }

/* 弹窗：上方候选列表，下方已选区。候选区限高可滚，避免收货人多了把弹窗撑爆 */
#cg-picker { display: flex; flex-direction: column; gap: 12px; }
.cg-search-row { flex-shrink: 0; }
.cg-cands { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cg-cand {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.cg-cand:hover { border-color: var(--primary); }
/* 勾选态用浅色底 + 主色边框区分，不能只靠勾选框 —— 勾选框在项目自定义主题下不够醒目 */
.cg-cand.on { border-color: var(--primary); background: var(--primary-soft); }
.cg-cand input { margin-top: 2px; flex-shrink: 0; }
.cg-cand-main { min-width: 0; }
.cg-cand-name { font-size: 13.5px; font-weight: 600; }
.cg-cand-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; word-break: break-all; }
/* 登录账号：公司名与联系人可能完全相同（同一公司多个收货点、甚至测试数据批量同值），
   只显示上面两行会出现几条一模一样的条目，用户无从下手挑。账号名是唯一区分标识，
   用等宽 + 更弱的灰做视觉降级，但保持可读 —— 挑错人比多看一行字糟糕得多 */
.cg-cand-acct {
  font-size: 11px; color: var(--text-3); margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: .8; word-break: break-all;
}

.cg-picked {
  flex-shrink: 0; padding-top: 12px; border-top: 1px dashed var(--border);
}
.cg-picked-head { font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
.cg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-chip.on { padding-right: 4px; }
.cg-chip .x {
  border: none; background: transparent; cursor: pointer; padding: 0 3px;
  color: inherit; font-size: 15px; line-height: 1; opacity: .6;
}
.cg-chip .x:hover { opacity: 1; }
.cg-tip { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }

/* ===== 一键填写 2.0：订单表格 + 商品详细信息 ===== */
.order-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.order-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.order-table th, .order-table td {
  padding: 6px 7px; border-bottom: 1px solid var(--border); vertical-align: middle;
  font-size: 12.5px; text-align: left; white-space: nowrap;
}
.order-table thead th {
  background: var(--primary-soft); color: var(--text-2); font-weight: 600;
  font-size: 11.5px; position: sticky; top: 0;
}
.order-table thead th b { color: #d64545; }
.order-table tbody tr:hover { background: #f7f9fc; }
.order-table .ot-idx { width: 34px; text-align: center; color: var(--text-3); }
.order-table td .input { min-width: 68px; padding: 5px 7px; font-size: 12.5px; }
.order-table td:nth-child(2) .input { min-width: 130px; }
.order-table td:nth-child(11) .input { min-width: 90px; }
.order-table .ot-amount { background: #f4f6fa; font-weight: 600; }
.order-table .ot-cur2 { color: var(--text-3); font-size: 12px; }
.order-table tr.ot-empty td { text-align: center; color: var(--text-3); padding: 18px; }
.order-table tr.has-detail td:nth-child(2) { position: relative; }
.order-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.order-total { margin-left: auto; font-size: 13px; color: var(--text-2); }
.order-total b { color: var(--primary); font-size: 15px; }

/* 商品详细信息 */
.qfd-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 12px; }
.qfd-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px;
  cursor: pointer; background: #fff; color: var(--text-2);
}
.qfd-chip:hover { border-color: var(--primary); }
.qfd-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.qfd-chip i { font-style: normal; font-size: 11.5px; }
.qfd-chip i.dim { color: var(--text-3); }
.qfd-form { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 16px; background: #fbfcfe; }
.qfd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.qfd-head b { font-size: 14px; }
.qfd-metrics { font-size: 11.5px; color: var(--text-3); text-align: right; }
.qfd-sect {
  font-size: 12px; font-weight: 700; color: var(--text-2); margin: 14px 0 8px;
  padding-left: 8px; border-left: 3px solid var(--primary); line-height: 1.3;
}
.qfd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 12px; }
.qfd-grid .fg.col2 { grid-column: span 2; }
.qfd-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.qfd-actions .chk { font-size: 12.5px; }
@media (max-width: 900px) { .qfd-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 一键填写 · 信息识别框 ---------- */
.recog-act { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
#qf-recog-text { font-family: inherit; resize: vertical; }
#qf-recog-out .alert { margin-top: 10px; }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.fld-err { border-color: var(--danger) !important; background: var(--danger-soft) !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, .12); }
.fld-err:focus { outline: none; border-color: var(--danger) !important; }

/* ---------- 合同管理：修改与发送记录时间线 ---------- */
.ev-list { display: flex; flex-direction: column; }
.ev-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.ev-item:last-child { border-bottom: none; }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--muted, #9aa4b2); }
.ev-dot.a-upload { background: var(--primary, #2563eb); }
.ev-dot.a-modify { background: #d97706; }
.ev-dot.a-send { background: #16a34a; }
.ev-dot.a-withdraw { background: var(--danger, #dc2626); }
.ev-dot.a-assign { background: #16a34a; }
.ev-main { min-width: 0; }
.ev-t { font-size: 13px; line-height: 1.5; word-break: break-all; }
.cm-ops { white-space: nowrap; }
.cm-ops .btn { margin-right: 6px; }

/* ===== 待办事项 / 提醒中心 / 消息中心 ===== */

/* 顶栏铃铛：红点用绝对定位，不参与按钮尺寸计算，避免有无红点时按钮跳动 */
.bell-btn { position: relative; padding: 6px 9px; }
.bell-btn .ico svg { width: 17px; height: 17px; }
.bell-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: #dc2626; color: #fff; border-radius: 9px;
  font-size: 10.5px; line-height: 17px; font-weight: 700; text-align: center;
  box-shadow: 0 0 0 2px var(--bg-1, #fff);
}
.bell-dot[hidden] { display: none; }

/* 分段选择（未完成 / 已完成 / 全部） */
.seg-group { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg {
  border: 0; background: transparent; padding: 5px 12px; cursor: pointer;
  font-size: 12.5px; color: var(--text-2); font-family: inherit;
}
.seg + .seg { border-left: 1px solid var(--border); }
.seg.on { background: var(--primary); color: #fff; font-weight: 600; }

/* 待办表格 */
.todo-table td { vertical-align: middle; }
.todo-check {
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid var(--border-strong, #cbd2dc); background: transparent;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.todo-check.on { background: #16a34a; border-color: #16a34a; }
.todo-check .ico svg { width: 13px; height: 13px; }
.todo-done td b { text-decoration: line-through; color: var(--text-3); }
.soon { color: #d97706; font-weight: 600; }
.over { color: #dc2626; font-weight: 700; }

/* 提醒设置弹窗 */
.tr-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 7px;
}
.tr-row .ico svg { width: 14px; height: 14px; color: var(--primary); }
.tr-add { display: flex; gap: 8px; margin-top: 10px; }
.tr-add .input { flex: 1; }

/* 提醒中心浮层 */
.notice-head { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.notice-badge {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto;
}
.notice-badge.primary { background: var(--primary); }
.notice-badge.danger { background: #dc2626; }
.notice-badge .ico svg { width: 17px; height: 17px; }
.notice-list { max-height: 380px; overflow-y: auto; margin-top: 11px; }
.notice-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px;
}
.notice-item.over { border-color: #fca5a5; background: #fef2f2; }
.notice-main { flex: 1; min-width: 0; }
.notice-main b { font-size: 13.5px; }
.notice-foot { padding-top: 10px; border-top: 1px solid var(--border); text-align: center; }

/* 消息中心 */
.msg-list { display: flex; flex-direction: column; }
.msg-item {
  display: flex; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start;
}
.msg-item:last-child { border-bottom: 0; }
.msg-item.unread { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.msg-ico {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2, #f1f3f7); color: var(--text-2);
}
.msg-ico.info { background: #e6f0ff; color: #2563eb; }
.msg-ico.success { background: #e7f7ee; color: #16a34a; }
.msg-ico.warn { background: #fef3c7; color: #d97706; }
.msg-ico .ico svg { width: 16px; height: 16px; }
.msg-main { flex: 1; min-width: 0; }
.msg-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.msg-new {
  font-size: 10px; font-weight: 700; color: #fff; background: #dc2626;
  border-radius: 4px; padding: 0 5px; line-height: 15px;
}
.msg-body { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.msg-time { margin-top: 4px; }

/* ===== 管理员：供货商 / 收货人关联中心 ===== */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 18px; margin-top: 12px;
}
.detail-item { min-width: 0; }
.detail-item label {
  display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 2px;
}
.detail-item > div {
  font-size: 13.5px; word-break: break-all; line-height: 1.5;
}
