/* 西瓦科技 · 供货商工作台
   Scale — type: 12 / 13 / 14 / 16 / 20 / 28 px · spacing: 4 / 8 / 12 / 16 / 20 / 24 / 32 px
   Controls: 36 px (large 44 px) · radius: 8 (controls) / 12 (cards) · one neutral palette + 4 status colours. */
:root {
  --bg: #F4F5F7; --card: #FFFFFF; --text: #1F2329; --text-2: #4E5969; --sub: #86909C; --faint: #C9CDD4;
  --line: #E5E6EB; --line-2: #F0F1F3; --hover: #F5F6F8; --head: #FAFAFB;
  --blue: #3370FF; --blue-bg: #EBF1FF; --blue-line: #BCD0FF;
  --orange: #F08A24; --red: #E5484D; --green: #2E9E6B;
  --r-s: 8px; --r-l: 12px; --h: 36px; --h-l: 44px;
  --shadow: 0 1px 2px rgba(31,35,41,.04);
  --pop: 0 12px 32px rgba(31,35,41,.14);
  --page: 1440px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; line-height: 28px; margin: 0; font-weight: 600; }
h2.sec { font-size: 16px; line-height: 24px; margin: 32px 0 12px; font-weight: 600; }
button { font-family: inherit; }
.mono { font-family: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; }
.caption { color: var(--sub); font-size: 13px; }
.small { font-size: 13px; }
.sub { color: var(--sub); font-size: 12px; line-height: 18px; }
.none { color: var(--faint); }
.red { color: var(--red); } .green { color: var(--green); } .warn { color: var(--orange); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.flex1 { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not([disabled]) { background: var(--hover); text-decoration: none; }
.btn[disabled] { opacity: .4; cursor: default; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover:not([disabled]) { background: #2860E1; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover:not([disabled]) { background: #D23C41; }
.btn.link { border-color: transparent; background: none; color: var(--blue); padding: 0 8px; font-weight: 400; }
.btn.link:hover:not([disabled]) { background: var(--blue-bg); }
.btn.link.red { color: var(--red); }
.btn.icon { width: var(--h); padding: 0; }
.btn-big { height: var(--h-l); padding: 0 20px; }
.btn-danger-plain { display: block; width: 100%; height: var(--h-l); margin-top: 24px; border-radius: var(--r-l); border: 1px solid var(--line); background: #fff; color: var(--red); font-size: 14px; cursor: pointer; }
.btn-danger-plain:hover { background: #FFF5F5; }
.field { height: var(--h); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); font: inherit; font-size: 14px; background: #fff; color: var(--text); min-width: 0; }
.field:hover { border-color: #D0D3D9; }
textarea.field { height: auto; padding: 8px 12px; resize: vertical; width: 100%; }
.field:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,112,255,.15); }
.btn:focus-visible, a:focus-visible, .otab:focus-visible, .kseg:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; vertical-align: middle; }
.chev { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid var(--sub); border-bottom: 1.5px solid var(--sub); transform: translateY(-2px) rotate(45deg); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--page); margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 14px; color: var(--text-2); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.top-role { margin-left: auto; font-size: 13px; color: var(--sub); white-space: nowrap; }
.preview-bar { background: #FFF7E8; color: #8A5300; text-align: center; padding: 8px 24px; font-size: 13px; border-bottom: 1px solid #FBE3BC; }
.main { max-width: var(--page); margin: 0 auto; padding: 24px 24px 96px; }

/* ---------- shared blocks ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; min-height: 36px; }
.page-head .btn { margin-left: auto; }
.card, .ocard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.card { padding: 16px 20px; margin-bottom: 16px; }
.ocard { margin-bottom: 16px; }
.notice { background: var(--blue-bg); color: #2350B8; border-radius: var(--r-s); padding: 10px 16px; margin: 12px 0; font-size: 13px; }
.notice.bad { background: #FFF0F0; color: #B4282D; }
.notice.ok { background: #EAF7F0; color: #1D7A52; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 96px 0; color: var(--sub); }
.empty { text-align: center; padding: 64px 16px; color: var(--sub); }
.empty .t { font-size: 16px; color: var(--text-2); margin-bottom: 4px; }
.empty.small { padding: 32px 0; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 4px; font-size: 12px; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.tag.gray { color: var(--sub); } .tag.red { color: var(--red); background: #FFF0F0; } .tag.green { color: var(--green); background: #EAF7F0; }
.pill { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 500; }
.st { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.sku { font-size: 14px; font-weight: 600; }
.size { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; background: var(--text); color: #fff; border-radius: 5px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.spec { color: var(--text-2); font-size: 13px; }
.alert { color: var(--red); font-size: 12px; line-height: 18px; margin-top: 4px; }
.mine { color: var(--blue); font-size: 12px; line-height: 18px; margin-top: 4px; }
.unknown { color: var(--orange); font-weight: 500; }
.void { color: var(--sub); }
.ph { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-s); background: var(--hover); display: block; border: 1px solid var(--line-2); }
.ph.ok { cursor: zoom-in; }
.ph.sm { width: 40px; height: 40px; border-radius: 6px; }
.ph.big { width: 96px; height: 96px; border-radius: 10px; }

/* ---------- 订单: toolbar + 待办 ---------- */
.top-card { padding: 16px; }
.otoolbar { display: flex; gap: 8px; align-items: center; }
.otoolbar .scan { position: relative; flex: 1; display: flex; margin: 0; }
.scan-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--sub); font-size: 18px; line-height: 1; pointer-events: none; }
.scan-input { width: 100%; height: var(--h-l); font-size: 15px; padding: 0 16px 0 40px; background: var(--hover); border-color: transparent; }
.scan-input:hover { border-color: var(--line); }
.scan-input:focus { background: #fff; }
.ksegs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 12px; }
.kseg { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-radius: var(--r-s); background: var(--hover); color: var(--text-2); font-size: 13px; border: 1px solid transparent; transition: border-color .12s, background .12s; }
.kseg:hover { text-decoration: none; background: #fff; border-color: var(--line); }
.kseg b { font-size: 24px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 28px; }
.k-waiting b { color: var(--orange); } .k-late b, .k-shortage b, .k-exchange b { color: var(--red); } .k-shipped b { color: var(--blue); }
.kseg.on { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue); }

/* ---------- 订单: table header (dates · summary · actions) ---------- */
.ohead { display: flex; align-items: center; gap: 24px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 64px; }
.dnav { display: flex; align-items: center; gap: 4px; }
.dnav .btn.icon { border-color: transparent; font-size: 18px; color: var(--text-2); }
.dnav .btn.icon:hover:not([disabled]) { background: var(--hover); }
.dlabel { display: inline-flex; align-items: center; gap: 8px; height: var(--h); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; cursor: pointer; color: var(--text); }
.dlabel:hover { border-color: var(--blue); }
.dlabel span { font-size: 16px; font-weight: 600; }
.dlabel small { color: var(--sub); font-size: 13px; }
.dlabel .chev { margin-left: 2px; }
.dlabel.static { border: 0; padding: 0 4px; cursor: default; font-size: 16px; font-weight: 600; }
.osum { display: flex; align-items: center; gap: 8px 24px; flex: 1; color: var(--sub); font-size: 13px; flex-wrap: wrap; }
.osum > span:first-child { color: var(--text-2); }
.osum b { color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 0 2px; }
.osum #daybill { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.osum > span:first-child, .osum #daybill > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.osum b.red { color: var(--red); }
.oacts { display: flex; align-items: center; gap: 8px; }
.otabs { display: flex; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.otab { height: 44px; border: 0; background: none; font-size: 14px; color: var(--text-2); padding: 0 4px; margin-right: 20px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.otab span { margin-left: 4px; color: var(--sub); font-variant-numeric: tabular-nums; }
.otab:hover { color: var(--text); }
.otab.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.otab.on span { color: var(--blue); }

/* ---------- 订单: table ---------- */
.otable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.otable th { position: sticky; top: 56px; z-index: 2; height: 40px; padding: 0 12px; background: var(--head); text-align: left; font-weight: 500; font-size: 12px; color: var(--sub); border-bottom: 1px solid var(--line); white-space: nowrap; }
.otable td { height: 64px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; overflow: hidden; }
.otable tbody.grp:last-child tr:last-child td { border-bottom: 0; }
.otable tbody.grp:hover td { background: #FAFBFC; }
.otable tbody.sel td { background: #F3F7FF; }
.otable tbody.grp tr:not(:last-child) td { border-bottom-color: var(--line-2); }
.otable tbody.grp tr.more td { height: 52px; }
.otable tbody.grp tr:not(:last-child) td[rowspan] { border-bottom: 1px solid var(--line-2); }
.otable tbody.grp + tbody.grp tr:first-child td { border-top: 1px solid var(--line); }
.otable tr.voided td { color: var(--sub); }
.otable tr.voided .sku, .otable tr.voided .w-spec, .otable tr.voided .code-copy { text-decoration: line-through; color: var(--sub); }
.otable tr.flash td { animation: flash 2s ease-out; }
@keyframes flash { from { background: #FFF3D6; } to { background: transparent; } }
.otable .w-check { width: 40px; padding-right: 0; }
.otable .w-date { width: 72px; white-space: nowrap; }
.otable .w-seq { width: 48px; text-align: center; }
.otable td.w-seq { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.otable .w-photo { width: 60px; }
.otable .w-sku .sku { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otable .w-size { width: 76px; }
.otable .w-spec { width: 92px; }
.otable td.w-spec { color: var(--text-2); font-size: 13px; }
.otable .w-code { width: 124px; }
.otable .w-status { width: 136px; }
.otable .w-sku { width: 140px; }
.otable .w-note { width: auto; }
.otable .w-qty { width: 52px; text-align: center; }
.otable td.w-qty b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.otable td.w-qty b.many { color: var(--red); }
.otable .w-price { width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.otable .w-total { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.otable td.w-total b { font-weight: 600; }
.otable .w-print { width: 64px; text-align: center; }
.adm { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9A5B00; font-size: 12px; line-height: 18px; margin-top: 2px; }
.code-copy { border: 0; background: none; padding: 0; font-size: 12px; color: var(--text-2); cursor: copy; }
.code-copy:hover { color: var(--blue); }
.stcell { display: flex; }
.stsel { width: 120px; height: 30px; border: 1px solid; border-radius: 6px; padding: 0 24px 0 10px; font-size: 13px; font-weight: 500; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 13px center, right 9px center; background-size: 4px 4px; background-repeat: no-repeat; }
.stsel:focus { outline: none; box-shadow: 0 0 0 3px rgba(51,112,255,.15); }
.stsel option { color: var(--text); background: #fff; }
.saving { opacity: .5; pointer-events: none; }
.notein { width: 100%; height: 32px; border: 1px solid transparent; border-radius: 6px; padding: 0 8px; font: inherit; font-size: 13px; background: transparent; color: var(--blue); transition: border-color .12s, background .12s; }
.notein::placeholder { color: var(--faint); }
.otable tr:hover .notein { border-color: var(--line); background: #fff; }
.notein:focus { border-color: var(--blue); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(51,112,255,.15); color: var(--text); }
.notein.saved { border-color: var(--green); background: #EAF7F0; }
.print-btn { border: 0; background: none; font-size: 13px; color: var(--blue); cursor: pointer; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.print-btn:hover { background: var(--blue-bg); }
.print-btn.done { color: var(--sub); }
.print-btn.done:hover { color: var(--blue); }

/* bulk bar */
.bulk { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px; background: var(--text); color: #fff; border-radius: var(--r-l); padding: 8px 8px 8px 20px; box-shadow: 0 12px 32px rgba(31,35,41,.28); }
.bulk span { font-weight: 600; margin-right: 12px; white-space: nowrap; font-size: 14px; }
.bulk .btn { height: 34px; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; }
.bulk .btn:hover:not([disabled]) { background: rgba(255,255,255,.16); }
.bulk .btn-primary { background: var(--blue); border-color: var(--blue); }
.bulk .btn.link { color: rgba(255,255,255,.7); background: none; border-color: transparent; }

/* ---------- calendar ---------- */
.cal-pop { position: absolute; z-index: 50; width: 336px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--pop); padding: 12px 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; height: 36px; margin-bottom: 4px; font-size: 15px; }
.cal-head .btn.icon { border: 0; width: 32px; height: 32px; font-size: 18px; color: var(--text-2); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week span { text-align: center; color: var(--sub); font-size: 12px; height: 28px; line-height: 28px; }
.cal-cell { height: 44px; border: 0; border-radius: var(--r-s); background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; padding: 0; color: var(--text); }
.cal-cell .n { font-size: 14px; line-height: 18px; font-variant-numeric: tabular-nums; }
.cal-cell .c { font-size: 10px; line-height: 14px; color: var(--blue); font-weight: 600; }
.cal-cell.none { color: var(--faint); cursor: default; }
.cal-cell.has:hover { background: var(--hover); }
.cal-cell.late .c { color: var(--red); }
.cal-cell.done .c { color: var(--green); }
.cal-cell.today .n { font-weight: 700; }
.cal-cell.today:not(.on) { box-shadow: inset 0 0 0 1px var(--line); }
.cal-cell.on { background: var(--blue); }
.cal-cell.on .n, .cal-cell.on .c { color: #fff; }
.cal-legend { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--sub); }
.cal-legend .btn { margin-left: auto; height: 28px; }
.lg::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--blue); }
.lg.late::before { background: var(--red); } .lg.done::before { background: var(--green); }

/* ---------- side panel (装箱 / 装箱记录) ---------- */
.panel-mask { position: fixed; inset: 0; background: rgba(31,35,41,.32); z-index: 40; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: #fff; z-index: 41; padding: 20px 24px; overflow-y: auto; box-shadow: -8px 0 32px rgba(31,35,41,.12); }
.panel.wide { width: min(560px, 100vw); }
.panel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-top .tabs { margin: 0; }
.panel .close { border: 0; font-size: 16px; color: var(--sub); }
.panel .scan { display: flex; gap: 8px; margin-bottom: 12px; }
.panel .scan .btn { height: var(--h-l); }
.panel .scan-input { padding-left: 16px; }
.panel .card { padding: 16px; }
.boxhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.boxhead.click { cursor: pointer; }
.boxlines, .boxlist { display: flex; flex-direction: column; margin-top: 12px; }
.bline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-2); }
.bline .qty { margin-left: auto; font-weight: 600; }
.boxdetail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.photos { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.photos .ph { width: 72px; height: 72px; }
.daytitle { font-size: 16px; font-weight: 600; line-height: 24px; }
.dayacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card.done { border-color: #BFE5D0; background: #F3FBF7; }
.scanmsg { border-radius: var(--r-s); padding: 10px 16px; font-size: 15px; margin-bottom: 12px; }
.scanmsg.ok { background: #EAF7F0; color: #1D7A52; }
.scanmsg.bad { background: #FFF0F0; color: #B4282D; }

/* ---------- segmented tabs (panel, 对账) ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; padding: 3px; background: #EEF0F3; border-radius: var(--r-s); width: fit-content; }
.tab { height: 30px; padding: 0 14px; border-radius: 6px; border: 0; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tab b { color: var(--sub); font-weight: 500; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(31,35,41,.08); }

/* ---------- 对账 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 20px; box-shadow: var(--shadow); }
.stat .v { font-size: 28px; line-height: 36px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--sub); margin-top: 2px; }
.ptable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); }
.ptable th { height: 40px; padding: 0 16px; text-align: left; font-weight: 500; font-size: 12px; color: var(--sub); background: var(--head); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable th.num { text-align: right; }
.ptable td { height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable tr.bill { cursor: pointer; }
.ptable tr.bill:hover td { background: #FAFBFC; }
.ptable tr.sub td { background: var(--head); cursor: default; padding: 8px 16px 12px; }
.ptable .tw { display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid var(--sub); border-bottom: 1.5px solid var(--sub); transform: rotate(-45deg); margin: 0 12px 2px 2px; transition: transform .15s; }
.ptable tr.bill.open .tw { transform: rotate(45deg); margin-bottom: 4px; }
.ptable tr.bill.open td { border-bottom-color: var(--line-2); }
.ptable tr.dayrow { cursor: pointer; }
.ptable tr.dayrow td { height: 44px; background: var(--head); font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--line-2); }
.ptable tr.dayrow td.num { color: var(--text); }
.ptable tr.dayrow:hover td { background: #F2F6FF; }
.ptable tr.dayrow .dayname { padding-left: 22px; }
.ptable tr.dayrow .warn.small { font-size: 11px; line-height: 14px; }
.ptable tr.payrow td { height: 36px; background: var(--head); font-size: 12px; color: var(--green); padding-left: 38px; }
.link-like { color: var(--blue); font-size: 13px; }
.ptable .warn.small { font-size: 12px; }
.dayitem { display: inline-flex; align-items: center; gap: 16px; margin: 4px 8px 4px 0; padding: 6px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); color: var(--text); font-size: 13px; }
.dayitem:hover { border-color: var(--blue); text-decoration: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; color: var(--text-2); font-size: 13px; }

/* ---------- 设置 ---------- */
.list { padding: 0; overflow: hidden; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px 20px; border-bottom: 1px solid var(--line-2); color: var(--text); font-size: 14px; }
.li:last-child { border-bottom: 0; }
.li > span:first-child { color: var(--text-2); }
.li b { font-weight: 500; }
.li .caption { font-size: 12px; margin-top: 2px; }
a.li:hover { background: var(--hover); text-decoration: none; }
.li select.field { width: 280px; }

/* ---------- dialogs, toast, busy ---------- */
.layer { position: fixed; inset: 0; z-index: 60; background: rgba(31,35,41,.4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: #fff; border-radius: 14px; width: min(440px, 100%); padding: 24px; box-shadow: var(--pop); }
.dlg-title { font-size: 16px; font-weight: 600; line-height: 24px; margin-bottom: 12px; }
.dlg-text { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.dlg-input { width: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.opt b { font-variant-numeric: tabular-nums; }
.opt select { flex: 1; }
.dialog .caption { margin-top: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; justify-content: space-between; align-items: center; height: var(--h-l); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; font-size: 15px; cursor: pointer; text-align: left; color: var(--text); }
.choice:hover, .choice:focus { border-color: var(--blue); background: #F5F8FF; outline: none; }
.choice.on { color: var(--blue); }
.choice .cur { font-size: 12px; color: var(--sub); }
.layer.viewer { background: rgba(0,0,0,.84); cursor: zoom-out; }
.layer.viewer .dialog { background: none; box-shadow: none; padding: 0; width: auto; }
.viewer-img { max-width: 92vw; max-height: 90vh; border-radius: var(--r-s); display: block; }
#toast { position: fixed; top: 72px; left: 50%; transform: translate(-50%, -8px); background: rgba(31,35,41,.92); color: #fff; padding: 10px 20px; border-radius: var(--r-s); font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: rgba(180,40,45,.95); }
#busy { position: fixed; inset: 0; z-index: 65; background: rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center; }
.busybox { background: #fff; border-radius: var(--r-l); padding: 16px 24px; display: flex; gap: 12px; align-items: center; box-shadow: var(--pop); font-size: 14px; }

/* ---------- login / pick / fatal ---------- */
body.login-page { background: linear-gradient(180deg, #EEF3FF 0%, var(--bg) 60%); }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { background: #fff; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 16px 48px rgba(31,35,41,.08); padding: 40px; width: min(420px, 100%); text-align: center; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; }
.login-title { font-size: 20px; font-weight: 600; line-height: 28px; margin-top: 16px; }
.login-sub { color: var(--sub); margin-top: 4px; font-size: 13px; }
.qr-box { position: relative; width: 220px; height: 220px; margin: 24px auto 12px; border: 1px solid var(--line); border-radius: var(--r-l); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr canvas { width: 200px; height: 200px; image-rendering: pixelated; display: block; }
.qr-mask { position: absolute; inset: 0; background: rgba(255,255,255,.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 14px; }
.login-steps { color: var(--text-2); font-size: 13px; line-height: 22px; padding: 16px; margin: 20px 0 0; background: var(--hover); border-radius: var(--r-s); }
.login-steps p { margin: 0; }
.login-steps .login-support { color: var(--sub); font-size: 12px; margin-top: 8px; }
.login-msg { margin-top: 16px; background: #FFF0F0; color: #B4282D; border-radius: var(--r-s); padding: 8px 12px; font-size: 13px; }
.fatal, .pick { max-width: 720px; margin: 80px auto; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 0 24px; }
.fatal .t, .ptitle { font-size: 20px; font-weight: 600; }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; width: 100%; margin-top: 12px; }
.sup { height: 52px; border: 1px solid var(--line); border-radius: var(--r-l); background: #fff; font-size: 15px; cursor: pointer; color: var(--text); }
.sup:hover { border-color: var(--blue); color: var(--blue); }


/* ---------- notes, 装箱 page ---------- */
.otable .w-rmk { width: 200px; }
/* Notes are shown in full: they wrap instead of being cut off. */
.rmk { display: block; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; color: #9A5B00; font-size: 12px; line-height: 18px; padding: 4px 0; }
.otable td.w-rmk { font-size: 12px; }
.otoolbar .scan .btn-big { margin-left: 8px; }
.seg-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.seg-row .tabs { margin: 0; }
.scanmsg.inline { margin: 0; padding: 6px 12px; font-size: 14px; flex: 1; min-width: 0; }
.otable .w-wh { width: 112px; font-size: 13px; color: var(--text-2); }
.otable tr.pickrow { cursor: pointer; }
.otable tr.pickrow.sel td { background: #F3F7FF; }
.otable tr.pickrow:hover td { background: #FAFBFC; }
.otable tr.pickrow.sel:hover td { background: #EAF1FF; }
.otable.boxes td { height: 56px; }
.otable .w-no { width: 52px; text-align: center; color: var(--text-2); }
.otable .w-time { width: 120px; font-size: 13px; color: var(--text-2); }
.otable .w-trk { width: 180px; }
.otable .w-trk .code-copy { font-size: 13px; color: var(--text); }
.otable .w-bnote { width: 200px; }
.otable .w-recv { width: 96px; font-size: 13px; }
.otable .w-edit { width: 72px; text-align: right; }
.bprod { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.bitem .mono { font-weight: 600; }
/* 装箱记录: click a box to open its pieces */
.otable .w-open { width: 36px; padding-right: 0; color: var(--sub); }
.otable tr.boxrow { cursor: pointer; }
.chev { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid var(--sub); border-bottom: 1.5px solid var(--sub); transform: rotate(-45deg); transition: transform .15s; }
.boxgrp.open .chev { transform: rotate(45deg); }
.otable tr.boxrow:hover td { background: #FAFBFC; }
.otable tbody.boxgrp.open tr.boxrow td { background: #F3F7FF; border-bottom-color: transparent; }
.otable tr.boxdetail > td { height: auto; padding: 4px 12px 16px 48px; background: #F8FAFD; overflow: visible; }
.boxbar { display: flex; align-items: center; gap: 8px; padding: 8px 0 10px; }
.btn-del { color: var(--red); }
.btn-del:hover:not(:disabled) { background: #FFF5F5; }
.otable.sub { background: #fff; border: 1px solid var(--line-2); border-radius: 8px; }
.otable.sub th { position: static; height: 34px; }
.otable.sub td { height: 52px; }
.layer.wide .dialog { width: min(760px, 100%); }
.addlist { max-height: 52vh; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.flabel { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.flabel .field { width: 100%; }
.ptable .w-bnote { width: 180px; max-width: 220px; }

/* ---------- narrow screens ---------- */
@media (max-width: 1320px) {
  .tscroll { overflow-x: auto; }
  .otable { min-width: 1260px; }
  .otable th { position: static; }
}
@media (max-width: 1100px) {
  .osum { order: 3; width: 100%; flex: none; }
  .ohead > .oacts { margin-left: auto; }
}
@media (max-width: 760px) {
  .top-in { padding: 0 16px; gap: 16px; }
  .top-role { display: none; }
  .main { padding: 16px 16px 112px; }
  .otoolbar { flex-wrap: wrap; } .otoolbar .scan { width: 100%; flex: none; }
  .otoolbar .btn-big { flex: 1; }
  .ksegs { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ohead { gap: 12px; }
  .osum { gap: 8px 16px; }
  .stats, .stats.three { grid-template-columns: 1fr; }
  .ptable.bills { display: block; overflow-x: auto; }
  .li select.field { width: 100%; }
  .li { flex-wrap: wrap; }
  .bulk { left: 16px; right: 16px; transform: none; flex-wrap: wrap; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } #toast, .btn, .kseg { transition: none; } .otable tr.flash td { animation: none; } }

/* ---------- 仓库：收货 / 出库 / 今日记录 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.uchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.uchip .st { height: 20px; line-height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.uchip.click { cursor: pointer; }
.uchip.click:hover { border-color: var(--blue-line); background: var(--blue-bg); }
.uchip.cur { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.otable.whtable td { vertical-align: middle; }
.otable tr.phead td { background: var(--head); padding: 8px 16px; border-top: 1px solid var(--line); }
.otable tbody.grp:first-of-type tr.phead td { border-top: 0; }
.phead-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pnum { font-weight: 600; font-size: 14px; color: var(--text); }
.prog { font-size: 13px; color: var(--orange); font-weight: 500; }
.prog.done { color: var(--green); }
.rowacts { display: flex; justify-content: flex-end; gap: 0; white-space: nowrap; }
.rowacts .btn.link { height: 28px; padding: 0 6px; font-size: 13px; }
.otable.whtable .w-edit { width: 160px; }
.otable.whtable .w-sku .sub { margin-top: 2px; }
.curcard { border: 2px solid var(--blue-line); }
.curcard.blocked { border-color: #F7C6C7; background: #FFFBFB; }
.cur-in { display: flex; gap: 20px; padding: 20px; align-items: flex-start; }
.cur-photo .ph.big { width: 128px; height: 128px; cursor: zoom-in; }
.cur-main { flex: 1; min-width: 0; }
.cur-l1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cur-l1 .sku { font-size: 20px; font-weight: 600; }
.cur-l1 .size { font-size: 16px; }
.cur-l2 { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.cur-l2.remark { color: var(--orange); }
.cur-parcel { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
.cur-acts { display: flex; flex-direction: column; gap: 8px; min-width: 160px; }
.sup.sup-wh { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; height: 64px; padding: 0 20px; width: 100%; max-width: 640px; margin: 16px auto 0; border-color: var(--blue-line); background: var(--blue-bg); text-align: left; }
.sup.sup-wh b { color: var(--blue); }
@media (max-width: 900px) { .cur-in { flex-wrap: wrap; } .cur-acts { flex-direction: row; min-width: 0; width: 100%; } }

/* Receiving progress stays separate from label/selection state in the outbound queue. */
.otable .w-receipt { width: 172px; min-width: 140px; white-space: normal; font-size: 13px; line-height: 1.5; }

/* 仓库收货列表：日期 序号 包裹号 图片 尺码 颜色 类型 状态 备注 操作；日期/包裹号跨该包裹全部行 */
.otable.whtable { table-layout: fixed; width: 100%; min-width: 1240px; }
.otable.whtable col.c-date { width: 100px; } .otable.whtable col.c-seq { width: 60px; } .otable.whtable col.c-parcel { width: 140px; }
.otable.whtable col.c-photo { width: 210px; } .otable.whtable col.c-size { width: 86px; } .otable.whtable col.c-color { width: 90px; }
.otable.whtable col.c-type { width: 80px; } .otable.whtable col.c-note { width: 190px; } .otable.whtable col.c-act { width: 150px; } .otable.whtable col.c-supsize { width: 104px; }
.otable.whtable th { font-size: 13px; padding: 0 16px; }
.otable.whtable td { height: 116px; padding: 10px 16px; font-size: 15px; vertical-align: middle; }
.otable.whtable .ac { text-align: center; } .otable.whtable .ar { text-align: right; }
.otable.whtable td.c-date, .otable.whtable td.c-parcel { background: #fff; }
.otable.whtable td.c-parcel { border-right: 1px solid var(--line-2); }
.otable.whtable tbody.grp:hover td.c-date, .otable.whtable tbody.grp:hover td.c-parcel { background: #FAFBFC; }
.otable.whtable td.c-date { color: var(--text-2); white-space: nowrap; }
.otable.whtable td.c-status .chips { flex-direction: column; align-items: flex-start; gap: 6px; }
.otable.whtable td.c-seq { font-variant-numeric: tabular-nums; color: var(--text-2); }
.otable.whtable .pnum { font-size: 15px; font-weight: 600; }
.otable.whtable .prog { margin-top: 6px; font-size: 13px; color: var(--orange); font-weight: 500; }
.otable.whtable .prog.done { color: var(--green); }
.otable.whtable .prod { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph.lg { width: 96px; height: 96px; border-radius: 10px; flex: none; }
.otable.whtable .prod-t { min-width: 0; }
.otable.whtable .prod .sku { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otable.whtable .qty-n { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--orange); }
.otable.whtable .size { height: 28px; padding: 0 10px; font-size: 15px; }
.otable.whtable td.c-size .sub { margin-top: 4px; }
.otable.whtable .uchip { height: 30px; font-size: 13px; }
.otable.whtable .uchip .st { height: 24px; line-height: 24px; font-size: 13px; }
.otable.whtable td.c-note .alert { margin: 0; font-size: 13px; }
.otable.whtable td.c-note .rmk { font-size: 13px; color: var(--text-2); }
.otable.whtable .rowacts { justify-content: flex-end; flex-wrap: nowrap; }
.otable.whtable .rowacts .btn.link { font-size: 14px; padding: 0 6px; }

/* 第二轮：多件包裹浅蓝底 + 左侧色条；供货商尺码列；收货按钮；状态可点击提示 */
.otable.whtable th { height: 44px; color: var(--sub); font-weight: 500; }
.otable.whtable .th-hint { font-weight: 400; color: var(--faint); margin-left: 4px; }
.otable.whtable tbody.grp tr:not(:last-child) td:not([rowspan]) { border-bottom: 1px dashed var(--line); }
.otable.whtable tbody.grp.multi td, .otable.whtable tbody.grp.multi td.c-date, .otable.whtable tbody.grp.multi td.c-parcel { background: #F5F8FF; }
.otable.whtable tbody.grp.multi:hover td, .otable.whtable tbody.grp.multi:hover td.c-date, .otable.whtable tbody.grp.multi:hover td.c-parcel { background: #EEF3FF; }
.otable.whtable tbody.grp.multi td.c-date { box-shadow: inset 4px 0 0 var(--blue); }
.otable.whtable tbody.grp.multi td.c-parcel { border-right-color: var(--blue-line); }
.otable.whtable td.c-date { font-size: 14px; }
.otable.whtable .size.sup { background: #fff; color: var(--text); border: 1px solid var(--line); }
.otable.whtable .size.sup.diff { border-color: var(--orange); color: var(--orange); }
.otable.whtable .uchip.click { padding-right: 6px; transition: border-color .12s, background .12s; }
.otable.whtable .uchip .chip-caret { font-size: 10px; color: var(--faint); }
.otable.whtable .uchip.click:hover .chip-caret { color: var(--blue); }
.otable.whtable .act-recv { height: 30px; padding: 0 14px; border-color: var(--blue-line); color: var(--blue); background: var(--blue-bg); font-size: 14px; }
.otable.whtable .act-recv:hover:not([disabled]) { background: #DCE7FF; }
.otable.whtable .rowacts { align-items: center; gap: 8px; }
.otable.whtable .ph.lg { border-color: var(--line); }

/* 第三轮：产品号与状态分列；状态在操作前；同一产品多件时两列逐件对齐 */
.otable.whtable { min-width: 1380px; }
.otable.whtable col.c-date { width: 92px; } .otable.whtable col.c-seq { width: 56px; } .otable.whtable col.c-parcel { width: 136px; }
.otable.whtable col.c-photo { width: 200px; } .otable.whtable col.c-size { width: 80px; } .otable.whtable col.c-supsize { width: 96px; }
.otable.whtable col.c-color { width: 80px; } .otable.whtable col.c-type { width: 72px; } .otable.whtable col.c-code { width: 150px; }
.otable.whtable col.c-note { width: auto; } .otable.whtable col.c-status { width: 140px; } .otable.whtable col.c-act { width: 136px; }
.otable.whtable .stack { display: flex; flex-direction: column; gap: 6px; }
.otable.whtable .stack > * { height: 30px; display: flex; align-items: center; }
.otable.whtable td.c-code .code { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otable.whtable .stchip { justify-content: space-between; gap: 6px; width: 112px; padding: 0 8px 0 10px; border: 1px solid; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.otable.whtable .stchip:hover { filter: brightness(.96); }
.otable.whtable .stchip .chip-caret { font-size: 10px; opacity: .7; }

/* 第四轮：收货弹窗、序号逐件对齐、表头筛选、分页 */
.otable.whtable col.c-type { width: 92px; } .otable.whtable col.c-color { width: 92px; } .otable.whtable col.c-date { width: 104px; } .otable.whtable col.c-supsize { width: 112px; }
.otable.whtable td.c-type, .otable.whtable td.c-color, .otable.whtable td.c-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otable.whtable td.c-seq .stack > * { justify-content: center; font-variant-numeric: tabular-nums; }
.otable.whtable th { white-space: nowrap; }
.thf { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.thf:hover { background: var(--hover); color: var(--text); }
.thf .thf-c { font-size: 10px; opacity: .6; }
.thf.on { background: var(--blue-bg, #EAF1FF); color: var(--blue); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.thf.on .thf-c { opacity: 1; }
.recv-layer { z-index: 50; }
.recv-dialog { width: min(820px, 100%); padding: 0; overflow: hidden; }
.recv-dialog .curcard { margin: 0; border: 0; box-shadow: none; border-radius: 0; }
.recv-dialog .curcard.blocked { border: 0; }

.stnote { font-size: 12px; color: #E04C4C; margin-top: 4px; line-height: 1.4; word-break: break-all; }

/* Notes dialog (notes-ui.js): 包裹备注 / 产品备注 / 供货商备注 */
.layer.notes .dialog { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.nfield { margin-top: 14px; }
.nlabel { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.nro { font-weight: 400; color: var(--text-3, #8F959E); }
.nchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.nchip { border: 1px solid var(--line, #DEE0E3); background: #F5F6F7; border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; color: inherit; }
.nchip:hover { border-color: #3D78F2; color: #3D78F2; background: #EEF3FE; }
.ninput { width: 100%; resize: vertical; }
.ntext { padding: 8px 10px; border-radius: 8px; background: #F5F6F7; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
.ntext.none { color: var(--text-3, #8F959E); }
.pnote, .pninput { margin-top: 6px; }
.notein.pn { width: 100%; }
.supnote { font-size: 12px; color: #2F6BD8; margin-top: 4px; word-break: break-all; }

/* Warehouse piece popup (wh-receive.js drawPiece): same layout as the mini program's unit-sheet. */
.recv-dialog.up { width: min(600px, 100%); padding: 22px 24px; overflow: auto; max-height: 94vh; }
.recv-dialog.up.blocked { background: #FFFBFB; }
.up-head { display: flex; align-items: center; gap: 14px; }
.up-date { font-size: 26px; font-weight: 700; color: var(--text); }
.up-seq { font-size: 26px; font-weight: 700; color: var(--blue); }
.up-flex { flex: 1; }
.up-pill { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.up-photo { position: relative; margin-top: 14px; width: 100%; height: min(300px, 34vh); border-radius: 14px; background: #F5F6F7; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.up-photo img { width: 100%; height: 100%; object-fit: contain; }
.up-zoom { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.up-noimg { color: var(--text-3, #8F959E); }
.up-sku { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.up-sku .mono { font-size: 28px; font-weight: 700; }
.up-sku .size { font-size: 20px; }
.up-spec { margin-top: 4px; font-size: 16px; color: var(--text-2); }
.up-info { margin-top: 12px; border-top: 1px solid var(--line, #EEF0F2); }
.up-line { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line, #EEF0F2); font-size: 15px; }
.up-k { width: 96px; flex: none; color: var(--text-2); }
.up-v { flex: 1; display: flex; align-items: center; gap: 12px; }
.up-v.strong { font-weight: 700; color: var(--orange); }
.up-v.warn { color: var(--red); }
.up-got { color: var(--orange); font-weight: 600; }
.up-got.ok { color: var(--green, #299E6B); }
.up-notes { display: block; width: 100%; text-align: left; margin-top: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: #FFF7E8; cursor: pointer; font: inherit; color: inherit; }
.up-notes:hover { background: #FFF0D6; }
.up-note { display: flex; gap: 8px; font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
.up-nk { flex: none; width: 76px; color: #9A5B00; }
.up-nv { flex: 1; white-space: pre-wrap; word-break: break-all; }
.up-noteedit { font-size: 14px; color: var(--blue); }
.up .scanmsg { margin: 12px 0 0; }
.up-acts { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.up-acts .btn { width: 100%; }
.up-problem { color: var(--red); border-color: #F7C6C7; }
/* Note cell in the receiving table: one block, click to edit. */
.notecell { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 4px 6px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.notecell:hover { background: #F5F6F7; }
.notecell .rmk { white-space: pre-wrap; word-break: break-all; }
.noteadd { color: var(--text-3, #8F959E); font-size: 13px; }
.notecell.pnote { color: var(--orange); font-size: 13px; margin-top: 6px; padding: 2px 4px; }
/* 备注 column (2026-10-16): wide enough that a longer note wraps as a few lines, not one character per line. */
.otable.whtable { min-width: 1560px; }
.otable.whtable col.c-note { width: 280px; }
.otable.whtable td.c-note .rmk, .otable.whtable td.c-note .alert, .otable.whtable td.c-note .supnote { line-height: 1.5; }
/* 2026-10-16: the receiving table must fit the 1440px page (it overflowed the card and the status/操作 columns
   showed outside it). Tighter fixed columns, the note column takes the rest, and the table scrolls inside its card
   instead of spilling out when the window is narrower. */
.wscroll { overflow-x: auto; }
.otable.whtable { min-width: 1280px; }
.otable.whtable th, .otable.whtable td { padding-left: 10px; padding-right: 10px; }
.otable.whtable col.c-date { width: 92px; } .otable.whtable col.c-seq { width: 50px; } .otable.whtable col.c-parcel { width: 128px; }
.otable.whtable col.c-photo { width: 186px; } .otable.whtable col.c-size { width: 70px; } .otable.whtable col.c-supsize { width: 96px; }
.otable.whtable col.c-color { width: 80px; } .otable.whtable col.c-type { width: 80px; } .otable.whtable col.c-code { width: 136px; }
.otable.whtable col.c-note { width: auto; } .otable.whtable col.c-status { width: 140px; } .otable.whtable col.c-act { width: 96px; }
.otable.whtable .stchip { width: 118px; }
.otable.whtable .ph.lg { width: 84px; height: 84px; }
.otable.whtable .prod { gap: 10px; }
/* 2026-10-16 (2): inside the card's own horizontal scroll the sticky header (top: 56px) slid down over the first
   row and left an empty strip above; the header sits in place there. Tiles: 待收货 / 收到有问题 / 供货商已发货 / 今日收到. */
.wscroll .otable.whtable th { position: static; }
.k-today b { color: var(--green, #299E6B); }

/* ===================== 管理后台 (首页 / 订单处理 / 邮件) =====================
   Same tokens and scale as the warehouse workbench above; only layout pieces are added here. */
:root { --purple: #7B5CD6; --gray: #86909C; }
.top.admin .top-role a { margin-left: 8px; }
.main.wide { max-width: 1680px; }
.main.full { max-width: none; padding: 16px 24px 16px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gray); flex: none; }
.d-blue { background: var(--blue); } .d-orange { background: var(--orange); } .d-red { background: var(--red); } .d-green { background: var(--green); } .d-purple { background: var(--purple); } .d-gray { background: var(--faint); }
.st.s-blue { color: var(--blue); background: var(--blue-bg); } .st.s-orange { color: #B25F0A; background: #FFF3E6; } .st.s-red { color: var(--red); background: #FFF0F0; }
.st.s-green { color: var(--green); background: #EAF7F0; } .st.s-purple { color: var(--purple); background: #F2EEFC; } .st.s-gray { color: var(--text-2); background: var(--hover); }
.tag.t-blue { color: var(--blue); background: var(--blue-bg); } .tag.t-orange { color: #B25F0A; background: #FFF3E6; } .tag.t-red { color: var(--red); background: #FFF0F0; } .tag.t-gray { color: var(--text-2); }
.pend { color: var(--orange); font-weight: 500; }
.sup.sup-admin { margin-top: 24px; border-color: var(--blue); }
.tabs.sm { margin: 0; } .tabs.sm .tab { height: 26px; padding: 0 10px; font-size: 12px; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 28px; }
.card-h b { font-size: 16px; font-weight: 600; }
.card-h .tabs { margin-left: auto; }
.card-h.pad { padding: 16px 20px 0; }

/* dropdown menu + filter buttons */
.amenu { position: absolute; z-index: 55; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--pop); padding: 6px; max-height: min(420px, 70vh); display: flex; flex-direction: column; }
.amenu-q { margin: 2px 2px 6px; height: 32px; }
.amenu-list { overflow-y: auto; display: flex; flex-direction: column; }
.amenu-i { display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 6px; background: none; text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.amenu-i:hover, .amenu-i:focus-visible { background: var(--hover); outline: none; }
.amenu-i.on { color: var(--blue); font-weight: 500; }
.amenu-i.dis { color: var(--faint); cursor: not-allowed; }
.amenu-t { flex: 1; display: flex; flex-direction: column; }
.amenu-t small { font-size: 12px; color: var(--sub); font-weight: 400; }
.amenu-i b { font-weight: 500; color: var(--sub); font-size: 12px; font-variant-numeric: tabular-nums; }
.amenu-ok { font-style: normal; color: var(--blue); }
.amenu-none { padding: 12px; color: var(--sub); font-size: 13px; text-align: center; }
.fbtn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.fbtn:hover, .fbtn.open { border-color: #C2C7D0; color: var(--text); }
.fbtn.on { border-color: var(--blue-line); background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.fbtn.plain { border-color: transparent; background: none; }
.fbtn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.fbtn .chev { transform: translateY(-2px) rotate(45deg); }

/* ---------- 首页 ---------- */
.ahead { margin-bottom: 12px; }
.ahead-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ahead-r .btn { margin-left: 0; }
.ahead-r .btn .chev { transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.periods { margin-bottom: 16px; }
.jobbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; background: var(--blue-bg); border-radius: var(--r-s); font-size: 13px; color: #2350B8; }
.jstep { display: inline-flex; align-items: center; gap: 6px; } .jstep.waiting { color: var(--sub); } .jstep.done { color: var(--green); }
.jstep .spin { width: 12px; height: 12px; }
.jsep { width: 16px; height: 1px; background: var(--blue-line); }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis.big { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 20px; box-shadow: var(--shadow); min-width: 0; }
.kpi-l { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.kpi-l .dl { margin-left: auto; }
.kpi-v { text-align: left; font-size: 22px; line-height: 30px; font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; }
.kpis.big .kpi-v { font-size: 32px; line-height: 40px; margin-top: 8px; }
.kpi-s { margin-top: 4px; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.sm { padding: 14px 16px; }
.dl { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dl.up { color: var(--green); } .dl.down { color: var(--red); } .dl.flat { color: var(--faint); }
.arow { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; }
.arow > .card { margin-bottom: 16px; }
.todo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.todo { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-s); background: var(--hover); color: var(--text-2); font-size: 13px; border: 1px solid transparent; position: relative; }
.todo:hover { text-decoration: none; background: #fff; border-color: var(--line); }
.todo b { font-size: 24px; line-height: 30px; font-weight: 600; text-align: left; }
.todo.t-blue b { color: var(--blue); } .todo.t-orange b { color: var(--orange); } .todo.t-red b { color: var(--red); } .todo.t-purple b { color: var(--purple); } .todo.t-gray b { color: var(--text-2); }
.todo.zero b { color: var(--faint); }
.todo em { position: absolute; right: 10px; top: 10px; font-style: normal; font-size: 12px; color: var(--red); }
.todo-grid .todo:last-child:nth-child(odd) { grid-column: 1 / -1; }
.chart { position: relative; min-height: 240px; }
.chart svg { display: block; }
.chart .g { stroke: var(--line-2); } .chart .g0 { stroke: var(--faint); }
.chart .ax { fill: var(--sub); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--blue); } .chart .pos { fill: var(--green); } .chart .neg { fill: var(--red); }
.chart .hit { fill: transparent; cursor: default; } .chart .hit.on { fill: rgba(51,112,255,.06); }
.tip { position: absolute; top: 0; width: 180px; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--pop); padding: 8px 12px; font-size: 13px; line-height: 20px; }
.stable { border: 0; border-radius: 0; box-shadow: none; margin-top: 12px; }
.stable th { cursor: pointer; user-select: none; }
.stable th:hover { color: var(--text); } .stable th.sorted { color: var(--blue); }
.stable td { height: 48px; font-variant-numeric: tabular-nums; }
.stable td .sub { display: block; }
.stable td.st-name { white-space: nowrap; }
.stable td.st-name .sub { margin-top: 0; }
.stable tr.idle td { color: var(--faint); }
.stable tfoot td { background: var(--head); font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.salecell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.salecell i { flex: none; width: 64px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.salecell i s { display: block; height: 100%; border-radius: 3px; background: var(--blue-line); }
.salecell span { min-width: 72px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 订单处理 ---------- */
.wb { display: grid; grid-template-columns: 176px 1fr; gap: 20px; align-items: start; }
.wb-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin; }
.wb-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.wb-gt { font-size: 12px; color: var(--sub); padding: 6px 12px 4px; }
.wb-gsep { height: 1px; background: var(--line); margin: 4px 12px 8px; }
.wb-q { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--r-s); color: var(--text-2); font-size: 14px; }
.wb-q:hover { background: #fff; text-decoration: none; color: var(--text); }
.wb-q.on { background: #fff; color: var(--blue); font-weight: 600; box-shadow: var(--shadow), 0 0 0 1px var(--line) inset; }
.wb-q b { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.wb-q b.red { color: var(--red); }
.wb-main { min-width: 0; }
.wb-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wb-search { position: relative; flex: 1; max-width: 560px; margin-left: 16px; display: flex; align-items: center; }
.wb-search .scan-input { height: var(--h); font-size: 14px; }
.wb-search .btn.link { position: absolute; right: 4px; height: 28px; }
.wb-top #reload { margin-left: auto; }
.fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; min-height: 32px; }
.wb-card { overflow: visible; }
.wbtable { table-layout: fixed; min-width: 1180px; }
.wbtable col.c-check { width: 40px; } .wbtable col.c-parcel { width: 196px; } .wbtable col.c-items { width: auto; } .wbtable col.c-src { width: 168px; }
.wbtable col.c-cust { width: 148px; } .wbtable col.c-route { width: 196px; } .wbtable col.c-amt { width: 100px; } .wbtable col.c-hint { width: 200px; }
.wbtable th.num { text-align: right; }
.wbtable td { height: auto; padding: 12px; vertical-align: top; }
.wbtable td.w-check { padding-top: 14px; }
.wbtable tbody.wbrow { cursor: pointer; }
.wbtable tbody.wbrow td { border-bottom: 1px solid var(--line-2); }
.wbtable .pnum { font-size: 14px; }
.wbtable .sub { margin-top: 2px; }
.wbtable .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pnote { display: block; max-width: 100%; margin-top: 6px; padding: 2px 6px; margin-left: -6px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: 12px; line-height: 18px; color: var(--faint); text-align: left; cursor: pointer; white-space: pre-wrap; overflow-wrap: anywhere; }
.pnote:hover { background: var(--hover); color: var(--blue); }
.pnote.has { color: #9A5B00; }
.it { display: flex; gap: 10px; align-items: flex-start; }
.it { min-height: 48px; }
.it + .it { margin-top: 8px; }
.it.removed { opacity: .5; } .it.removed .sku { text-decoration: line-through; }
.it .ph.sm { cursor: zoom-in; flex: none; }
.it-t { min-width: 0; }
.it-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.it-l1 .size { height: 20px; font-size: 12px; padding: 0 6px; }
.it-l2 { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.it-note { font-size: 12px; color: #9A5B00; margin-top: 2px; }
.qmany { color: var(--red); font-weight: 600; }
.srcline { min-height: 48px; display: flex; align-items: flex-start; padding-top: 2px; }
.srcline + .srcline { margin-top: 8px; }
.src { display: flex; flex-direction: column; font-size: 13px; color: var(--text); line-height: 18px; }
.src em { font-style: normal; font-size: 12px; color: var(--sub); } .src em.warn { color: var(--orange); }
.src.stock { color: var(--green); }
.none-src { color: var(--red); font-size: 13px; font-weight: 500; }
.cellpick { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 28px; padding: 3px 8px; margin: 0 0 4px -8px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer; }
.cellpick:hover, .cellpick.open { border-color: var(--line); background: #fff; }
.cellpick .chev { flex: none; transform: translateY(-2px) rotate(45deg); opacity: .6; }
.wbtable td.w-route > div:not(.sub) { font-size: 13px; }
.w-amt .sub { text-align: right; }
.w-hint > * + * { margin-top: 4px; }
.err { color: var(--red); font-size: 12px; line-height: 18px; }
.holdr { color: var(--text-2); font-size: 12px; line-height: 18px; }
.miss { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin: 0 4px 4px 0; border-radius: 4px; background: #FFF0F0; color: var(--red); font-size: 12px; }
.w-hint .miss + .miss { margin-top: 0; }
.wb-loading { text-align: center; padding: 64px 16px !important; color: var(--sub); }
.wb-loading .t { color: var(--text-2); font-size: 16px; margin-bottom: 8px; }
.wb-loading .spin { margin-right: 8px; vertical-align: -3px; }
.wb-foot { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; border-top: 1px solid var(--line-2); }
.resl { max-height: 320px; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--r-s); }
.resl-i { display: flex; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.resl-i:last-child { border-bottom: 0; }
.resl-i b { flex: none; width: 128px; }
.resl-i span { color: var(--red); }

/* drawer */
.adrawer.wide { width: min(720px, 100vw); padding: 0; display: flex; flex-direction: column; }
.adrawer .loading { flex: 1; }
.dr-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 4px; }
.dr-t { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.dr-sub { padding: 0 24px 12px; color: var(--sub); font-size: 13px; }
.adrawer .notice { margin: 0 24px 8px; }
.dr-tabs { margin: 8px 24px 0; }
#dbody { flex: 1; overflow-y: auto; padding: 0 24px 24px; }
.dr-foot { display: flex; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--line); background: #fff; }
.dsec { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 20px 0 10px; }
.ditems { display: flex; flex-direction: column; gap: 12px; }
.ditem { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-l); }
.ditem .ph.big { cursor: zoom-in; flex: none; }
.ditem.removed { opacity: .5; }
.dsrc { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dsrc .src { flex-direction: row; gap: 8px; align-items: center; }
.ditem .notein.pn { margin-top: 4px; color: #9A5B00; margin-left: -8px; width: calc(100% + 8px); }
.ditem:hover .notein { border-color: var(--line); background: #fff; }
.addr { padding: 12px 16px; background: var(--head); border-radius: var(--r-s); font-size: 14px; line-height: 22px; }
.aform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.droute { display: flex; flex-direction: column; gap: 6px; }
.droute .opt .fbtn { max-width: 420px; }
.code-copy.big { font-size: 14px; color: var(--text); }
.dsave { display: flex; gap: 8px; margin-top: 10px; }
.olist .li { padding: 8px 0; min-height: 40px; }
.ctable { margin-top: 16px; }
.ctable td { height: 56px; padding: 6px 8px; }
.ctable th { padding: 0 8px; }
.cin { width: 100%; height: 32px; padding: 0 8px; font-size: 13px; }
.cin.need { border-color: #F7C6C7; background: #FFFBFB; }
.opt.ioss { margin-top: 12px; } .opt.ioss .field { width: 220px; }
.tline { margin-top: 16px; }
.tl-i { display: flex; gap: 12px; padding-bottom: 16px; position: relative; font-size: 14px; }
.tl-i i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin-top: 6px; box-shadow: 0 0 0 3px var(--blue-bg); }
.tl-i:not(:last-child)::before { content: ''; position: absolute; left: 4px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl-i:not(:first-child) i { background: var(--faint); box-shadow: none; }

/* ---------- 邮件 ---------- */
.mail { display: grid; grid-template-columns: 360px minmax(0, 1fr) 400px; gap: 0; height: calc(100vh - 56px - 32px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.ml-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: #FCFCFD; }
.ml-top { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); background: #fff; }
.ml-search { position: relative; display: block; }
.ml-search .field { width: 100%; padding-left: 36px; background: var(--hover); border-color: transparent; }
.ml-search .field:focus { background: #fff; }
.ml-search .scan-ic { left: 12px; font-size: 16px; }
.ml-boxes { display: flex; flex-wrap: wrap; gap: 2px 2px; margin: 10px 0 8px; }
.mbox { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.mbox:hover { background: var(--hover); color: var(--text); }
.mbox.on { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.mbox b { font-weight: 500; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.mbox b.hot { color: var(--red); }
.mbox.on b { color: var(--blue); }
.ml-filters { display: flex; align-items: center; gap: 6px; }
.ml-items { flex: 1; overflow-y: auto; }
.mitem { display: block; width: 100%; text-align: left; padding: 12px 14px 12px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: none; font: inherit; color: var(--text); cursor: pointer; position: relative; }
.mitem:hover { background: #F7F8FA; }
.mitem.on { background: #EEF3FF; }
.mitem.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.mi-l1 { display: flex; align-items: center; gap: 6px; }
.mi-from { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem.unread .mi-from { font-weight: 700; }
.mitem.unread .mi-from::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.mi-n { font-size: 12px; color: var(--sub); }
.mi-time { font-size: 12px; color: var(--sub); white-space: nowrap; }
.mi-subj { font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.mitem.unread .mi-subj { font-weight: 600; }
.mi-snip { font-size: 12px; line-height: 18px; color: var(--sub); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mi-tags { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: nowrap; overflow: hidden; }
.mi-tags .tag { height: 18px; font-size: 11px; padding: 0 6px; }
.mi-st { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.mi-st.s-red { color: var(--red); background: #FFF0F0; } .mi-st.s-orange { color: #B25F0A; background: #FFF3E6; } .mi-st.s-blue { color: var(--blue); background: var(--blue-bg); }
.mi-st.s-green { color: var(--green); background: #EAF7F0; } .mi-st.s-purple { color: var(--purple); background: #F2EEFC; } .mi-st.s-gray { color: var(--text-2); background: var(--hover); }
.ml-more { margin: 12px auto; display: flex; }
.loading.small { padding: 32px 0; }
.ml-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ml-thread > .empty, .ml-thread > .loading { margin: auto; }
.mt-head { padding: 16px 24px 12px; border-bottom: 1px solid var(--line); }
.mt-head h2 { font-size: 18px; line-height: 26px; margin: 0; font-weight: 600; }
.mt-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mt-who { border: 0; background: none; padding: 0 4px; font: inherit; font-size: 13px; color: var(--text-2); cursor: copy; }
.mt-who:hover { color: var(--blue); }
.mt-acts { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.mt-acts .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.mt-acts .btn .chev { transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.zh-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.mt-note { display: flex; align-items: center; gap: 8px; padding: 6px 24px; border-bottom: 1px solid var(--line-2); background: #FFFBF2; font-size: 12px; color: #9A5B00; }
.mt-note span { flex: none; }
.mt-note .notein { color: #9A5B00; height: 28px; }
.mt-note:hover .notein { border-color: #F2DDB4; background: #fff; }
.mt-msgs { flex: 1; overflow-y: auto; padding: 16px 24px 32px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 18px; max-width: 760px; }
.msg.out { align-self: flex-end; background: #F6F9FF; border-color: var(--blue-line); }
.msg-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ava { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #E8EAEE; color: var(--text-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.msg.out .ava { background: var(--blue); color: #fff; }
.msg-b { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 22px; }
.msg-b.orig { display: none; color: var(--text-2); }
.msg.show-orig .msg-b.zh { display: none; } .msg.show-orig .msg-b.orig { display: block; }
.msg-sw { margin-top: 6px; height: 24px; padding: 0 4px; font-size: 12px; }
.msg .photos .ph { cursor: zoom-in; }
.ml-ai { border-left: 1px solid var(--line); overflow-y: auto; min-height: 0; background: #fff; }
.ai-sec { padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.ai-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-h b { font-size: 14px; font-weight: 600; }
.ai-h .btn.link { height: 28px; font-size: 13px; }
.ai-h .btn .spin { width: 12px; height: 12px; margin-right: 4px; }
.ai-dl { margin: 0; font-size: 13px; line-height: 20px; }
.ai-dl dt { color: var(--sub); font-size: 12px; margin-top: 10px; }
.ai-dl dt:first-child { margin-top: 0; }
.ai-dl dd { margin: 2px 0 0; color: var(--text); }
.ai-dl ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.ai-empty { font-size: 13px; color: var(--sub); line-height: 20px; padding: 8px 12px; background: var(--hover); border-radius: var(--r-s); }
.aord { border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; font-size: 13px; }
.aord + .aord { margin-top: 8px; }
.aord.excluded { opacity: .55; background: var(--head); }
.ao-l1 { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ao-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.ao-it { display: flex; align-items: center; gap: 8px; }
.ao-it .ph.sm { width: 32px; height: 32px; border-radius: 6px; }
.ao-it > span { display: flex; flex-direction: column; line-height: 16px; }
.ao-acts { display: flex; align-items: center; margin-top: 6px; margin-left: -8px; }
.ao-acts .btn.link { height: 26px; font-size: 12px; }
.ai-sec.draft { border-bottom: 0; }
.ai-text { font-size: 13px; line-height: 20px; min-height: 200px; }
.ai-zh { margin: 8px 0; font-size: 13px; color: var(--text-2); }
.ai-zh summary { cursor: pointer; color: var(--blue); font-size: 12px; }
.ai-zh div { white-space: pre-wrap; margin-top: 6px; padding: 8px 10px; background: var(--hover); border-radius: var(--r-s); line-height: 20px; }
#instr { width: 100%; margin-top: 8px; height: 32px; font-size: 13px; }
.ai-acts { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.ai-acts .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.ai-acts .btn .spin { width: 12px; height: 12px; }
.ai-foot { margin-top: 10px; font-size: 12px; }

/* ---------- narrow screens ---------- */
@media (max-width: 1480px) {
  .wbtable { min-width: 1000px; }
  .wbtable col.c-parcel { width: 168px; } .wbtable col.c-src { width: 140px; } .wbtable col.c-cust { width: 124px; }
  .wbtable col.c-route { width: 168px; } .wbtable col.c-amt { width: 88px; } .wbtable col.c-hint { width: 150px; }
  .wb { grid-template-columns: 156px 1fr; gap: 16px; }
}
@media (max-width: 1360px) {
  .mail { grid-template-columns: 320px minmax(0, 1fr) 340px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .wb { grid-template-columns: 1fr; }
  .wb-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .wb-group { flex-direction: row; flex-wrap: wrap; margin: 0; } .wb-gt, .wb-gsep { display: none; }
  .wb-q { height: 32px; }
  .arow { grid-template-columns: 1fr; }
  .kpis.big { grid-template-columns: repeat(2, 1fr); }
  .mail { grid-template-columns: 300px minmax(0, 1fr); }
  .ml-ai { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .mail { height: auto; }
  .ml-list, .ml-thread { height: calc(100vh - 120px); }
}
@media (max-width: 760px) {
  .kpis, .kpis.big { grid-template-columns: 1fr 1fr; }
  .mail { grid-template-columns: 1fr; }
  .ml-list { height: 50vh; }
  .ahead-r { margin-left: 0; width: 100%; }
  .wb-top { flex-wrap: wrap; } .wb-search { margin-left: 0; max-width: none; width: 100%; flex: none; }
}

/* ===================== 订单处理 · 供应链 / 库存 / 产品库 / 结算 / 设置 ===================== */
.wb-side .ic { width: 6px; height: 6px; border-radius: 2px; background: var(--faint); flex: none; }
.wb-q.on .ic { background: var(--blue); }
.wb-search.sm { flex: 0 1 300px; margin-left: 0; }
.wb-search.sm .scan-input { height: 32px; font-size: 13px; }
.layer.xwide .dialog { width: min(1080px, 100%); max-height: 92vh; overflow: auto; }
.dlg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dlg-head .dlg-title { margin: 0; }
.stabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.stab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.stab:hover { border-color: #C2C7D0; }
.stab.on { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.stab.idle { color: var(--faint); }
.stab b { font-size: 12px; font-weight: 600; color: #fff; background: var(--blue); border-radius: 9px; padding: 0 6px; line-height: 18px; }
.stab em { font-style: normal; font-size: 12px; color: var(--orange); }
.stab em.red { color: var(--red); }
.dstrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.dchip { flex: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 84px; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; font: inherit; cursor: pointer; color: var(--text); position: relative; }
.dchip span { font-size: 14px; font-weight: 500; white-space: nowrap; }
.dchip small { font-size: 12px; color: var(--blue); }
.dchip.late small { color: var(--red); } .dchip.done small { color: var(--green); }
.dchip:hover { border-color: #C2C7D0; }
.dchip.on { background: var(--blue); border-color: var(--blue); } .dchip.on span, .dchip.on small { color: #fff; }
.dchip.all small { color: var(--sub); }
.dchip.cal { min-width: 48px; align-items: center; } .dchip.cal input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.shead > b { font-size: 14px; }
.tabs .tab.zero { color: var(--faint); } .tabs .tab.zero b { color: var(--faint); }
.sbill { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--sub); }
.sbill b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.sbill .btn.link { height: 24px; padding: 0 4px; }
.stbl, .itbl, .ltbl { min-width: 1180px; table-layout: auto; }
.stbl th, .itbl th, .ltbl th, .settable th { position: static; }
.stbl td, .itbl td, .ltbl td { height: 56px; padding: 6px 10px; font-size: 13px; overflow: visible; }
.stbl th, .itbl th, .ltbl th { padding: 0 10px; }
.stbl .c-seq { width: 44px; text-align: center; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.c-ph { width: 56px; } .c-op { width: 48px; text-align: right; } .c-d { width: 64px; white-space: nowrap; }
.stbl tr.sel td, .itbl tr.sel td { background: #F3F7FF; }
.stbl tr.srow { cursor: default; }
.stbl tr:hover td, .itbl tbody tr:hover td, .ltbl tbody tr:hover td { background: #FAFBFC; }
.itbl tbody tr, .ltbl tbody tr { cursor: pointer; }
.stbl tr.voided td { color: var(--faint); } .stbl tr.voided .sku { text-decoration: line-through; }
.stbl .notecell { max-width: 180px; }
.stbl .rmk, .stbl .supnote { padding: 0; }
.stchip2 { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 10px; border: 0; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.stchip2 .chev { width: 5px; height: 5px; transform: translateY(-1px) rotate(45deg); border-color: currentColor; opacity: .6; }
.stchip2.s-blue { color: var(--blue); background: var(--blue-bg); } .stchip2.s-red { color: var(--red); background: #FFF0F0; } .stchip2.s-green { color: var(--green); background: #EAF7F0; }
.stchip2.s-purple { color: var(--purple); background: #F2EEFC; } .stchip2.s-gray { color: var(--text-2); background: var(--hover); }
.mp-top { display: grid; grid-template-columns: 1fr 200px; gap: 12px; }
.mp-search { display: flex; gap: 8px; margin-bottom: 8px; } .mp-search .field { flex: 1; }
.mp-res { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; margin-bottom: 8px; }
.mp-hit { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.mp-hit:hover { border-color: var(--blue); background: #F5F8FF; }
.mp-lines td { height: 48px; padding: 4px 6px; } .mp-lines th { padding: 0 6px; }
.mp-lines .cin { min-width: 72px; } .mp-lines .cin.q { width: 72px; min-width: 0; }
.mp-empty { text-align: center; padding: 20px !important; }
/* settlement */
.settable { table-layout: auto; min-width: 1100px; }
.settable th { padding: 0 12px; height: 40px; }
.settable th.mc, .settable td.mc { text-align: center; vertical-align: middle; border-left: 1px solid var(--line-2); }
.settable td { height: 40px; padding: 4px 12px; font-size: 13px; vertical-align: middle; overflow: visible; }
.settable tbody.per + tbody.per tr:first-child td { border-top: 2px solid var(--line); }
.settable tbody.per.overdue td { background: #FFF8F8; }
.settable .pl { font-weight: 600; } .settable .pa { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.dlink { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); cursor: pointer; white-space: nowrap; }
.dlink:hover { text-decoration: underline; }
.paysel { height: 30px; width: 96px; font-size: 13px; } .paysel.paid { color: var(--green); border-color: #BFE5D0; background: #F3FBF7; }
.paydate { height: 30px; width: 140px; font-size: 13px; }
.pnote2 { height: auto; min-height: 52px; width: 180px; text-align: center; resize: none; padding: 6px 8px; line-height: 18px; color: var(--text); }
.settable tr:hover .pnote2 { border-color: var(--line); background: #fff; }
/* inventory + library */
.chiprow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chiprow-l { font-size: 12px; color: var(--sub); width: 48px; flex: none; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.fchip b { font-weight: 500; color: var(--sub); font-size: 12px; }
.fchip:hover { border-color: #C2C7D0; color: var(--text); }
.fchip.on { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue); } .fchip.on b { color: var(--blue); }
#selbar { display: flex; align-items: center; gap: 4px; }
.ihead { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.istats { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; color: var(--sub); } .istats b { color: var(--text); font-size: 16px; }
.cprod { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--blue-line); background: #F5F8FF; border-radius: var(--r-s); margin-bottom: 8px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 260px; overflow: auto; margin-bottom: 12px; }
.vchip { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-s); font-size: 13px; cursor: pointer; }
.vchip img { width: 28px; height: 28px; border-radius: 4px; }
.vchip.on { border-color: var(--blue); background: var(--blue-bg); }
.ltbl .ell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltbl .btn.link { height: 26px; padding: 0 4px; font-size: 13px; }
.sku.warn { color: var(--orange); }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cgrid.sm { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.ccard { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-l); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.ccard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); background: var(--hover); }
.ccard.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.pinfo { display: flex; gap: 16px; margin-top: 8px; }
.ph.pbig { width: 120px; height: 120px; border-radius: 12px; cursor: zoom-in; }
.sitelist { display: flex; flex-direction: column; gap: 6px; }
.site { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); color: var(--text); font-size: 13px; }
.site:hover { border-color: var(--blue-line); text-decoration: none; background: #F5F8FF; }
.site .sub { margin-left: auto; }
.qtable td { height: 48px; padding: 4px 6px; } .qtable th { padding: 0 6px; }
.qtable .cin.q { width: 84px; }
details.adv { margin-top: 20px; } details.adv summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
/* settings */
.settabs { margin-bottom: 16px; }
.wdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-left: 4px; }
.settbl { border: 0; border-radius: 0; }
.settbl td { height: 48px; padding: 6px 12px; } .settbl th { padding: 0 12px; height: 38px; }
.settbl tr.clickrow { cursor: pointer; } .settbl tr.clickrow:hover td { background: #FAFBFC; }
.settbl .cin.wide { width: 320px; }
.setsave { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: #FFFBF2; }
.pgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.pgrid.three { grid-template-columns: repeat(3, 1fr); } .pgrid.two { grid-template-columns: 1fr 1fr; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.pcard b { font-size: 15px; } .pcard.miss { border-color: #F7D9B0; background: #FFF9F0; } .pcard.miss b { color: var(--orange); }
.pcard.acc { gap: 8px; } .acc-h { display: flex; align-items: center; justify-content: space-between; }
.acc-l { display: flex; justify-content: space-between; font-size: 13px; color: var(--sub); } .acc-l b { font-size: 13px; font-weight: 500; }
.ocard.pad { padding: 16px 20px; } .ocard.pad > b { display: block; margin-bottom: 12px; }
.caption.pad { padding: 10px 16px; }
.sitechk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; } .sitechk label { display: flex; align-items: center; gap: 6px; }
.nchip.on { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.cus { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.cus-list { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 8px; }
.cus-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px; }
.cus-g { font-size: 12px; color: var(--sub); padding: 8px 8px 4px; }
.cus-i { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: var(--text); }
.cus-i:hover { background: var(--hover); } .cus-i.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.cus-i .sub { margin-left: auto; }
.cus-none { font-size: 12px; color: var(--faint); padding: 2px 8px 6px 22px; }
.cus-body { padding: 16px 20px; } .cus-body .sub.sec { font-weight: 600; color: var(--text-2); font-size: 13px; margin: 4px 0 10px; }
input.switch { width: 36px; height: 20px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 10px; position: relative; cursor: pointer; transition: background .15s; flex: none; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
input.switch:checked { background: var(--blue); } input.switch:checked::after { left: 18px; }
label.li { cursor: pointer; }
@media (max-width: 1360px) { .pgrid { grid-template-columns: repeat(3, 1fr); } .cus { grid-template-columns: 200px 1fr; } }

.adrawer.wide.xl { width: min(880px, 100vw); }
.qtable select.cin[data-f="supplierId"] { min-width: 132px; } .qtable select.cin[data-f="equivalent"] { min-width: 104px; }
.qtable input.cin[data-f="link"] { min-width: 160px; } .qtable input.cin[data-f="article"] { min-width: 84px; }

/* 第三批：更多操作、物流轨迹、邮件多选 */
.dr-hacts { display: flex; align-items: center; gap: 8px; }
.dr-hacts .btn { height: 32px; } .dr-hacts .btn .chev { transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.trk-h { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; background: var(--head); border-radius: var(--r-s); }
.ml-list { position: relative; }
.btn.link.sm { height: 26px; font-size: 12px; padding: 0 6px; } .btn.link.sm.on { background: var(--blue-bg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.mitem.multi { padding-left: 40px; } .mi-chk { position: absolute; left: 14px; top: 14px; pointer-events: none; }
.mitem.picked { background: #F3F7FF; }
.ml-batch { border-top: 1px solid var(--line); background: #fff; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.mb-l { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.mb-acts { display: flex; flex-wrap: wrap; gap: 6px; }

.mail-knowledge { width:min(900px,94vw); padding:20px; overflow:auto; }
.mail-knowledge section { margin:18px 0; padding:12px; border:1px solid var(--line); border-radius:8px; }
.mail-knowledge details { margin:10px 0 10px 12px; }
.mail-knowledge summary { cursor:pointer; }
.mail-knowledge p { line-height:1.6; }
.mail-knowledge .panel-head { display:flex; justify-content:space-between; align-items:center; }

/* Full workbench fields stay readable and selectable; customs scrolls inside its drawer. */
.wbtable { min-width: 1440px; }
.wbtable col.c-items { width: 280px; }
.wbtable col.c-cust { width: 220px; }
.wbtable .sub, .wbtable .it-l2 { overflow-wrap: anywhere; }
.ctable { min-width: 2000px; }
.ctable input.field { min-width: 100px; }
