* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f4f6fa; --card: #ffffff; --text: #1f2937; --muted: #6b7280;
  --line: #e5e7eb; --primary: #2563eb; --primary-l: #eff4ff;
  --green: #16a34a; --green-l: #eaf7ef; --orange: #d97706; --orange-l: #fdf3e2;
  --red: #dc2626; --red-l: #fdecec; --purple: #7c3aed; --purple-l: #f3efff;
  --teal: #0d9488; --teal-l: #e7f7f5; --shadow: 0 1px 3px rgba(16,24,40,.06),0 4px 14px rgba(16,24,40,.04);
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
#header { position: fixed; top: 0; left: 0; right: 0; height: 60px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; z-index: 20; gap: 16px; }
.logo { font-size: 17px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.logo .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.spacer { flex: 1; }
.role-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
select, input, textarea { font-family: inherit; font-size: 13px; color: var(--text); background: #fff; border: 1px solid #d6dbe3; border-radius: 7px; padding: 8px 10px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; min-height: 64px; }
.btn { border: 1px solid transparent; border-radius: 7px; padding: 8px 14px; font-size: 13px; cursor: pointer; background: var(--primary); color: #fff; font-weight: 500; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn.ghost { background: #fff; color: var(--text); border-color: #d6dbe3; }
.btn.ghost:hover { background: #f8fafc; }
.btn.ghost.danger { color: var(--red); border-color: #f0c2c2; }
.btn.ghost.danger:hover { background: #fef2f2; border-color: var(--red); }
.draft-tip { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-tip .link-btn { background: none; border: none; color: #b45309; text-decoration: underline; cursor: pointer; font-size: 12.5px; padding: 0; font-weight: 500; }
.draft-tip .link-btn:hover { color: #78350f; }
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.draft-status { font-size: 12px; color: var(--green); }
.draft-status:empty { display: none; }
.ex-hint { margin-top: 6px; font-size: 12px; color: var(--muted); min-height: 16px; }
.ex-hint.ok { color: var(--green); }
.ex-hint.maybe { color: #b45309; }
.ex-hint b { font-weight: 600; }
.express-link { text-decoration: none; color: var(--primary); }
.express-link:hover { text-decoration: underline; }
.btn.track { color: var(--teal); border-color: #b8e0dc; }
.btn.track:hover { background: #f0fbfa; border-color: var(--teal); }
.track-box { background: #f0fbfa; border: 1px solid #b8e0dc; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.track-t { font-size: 12px; color: var(--teal); font-weight: 600; margin-bottom: 6px; }
.track-line { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.track-hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.track-src { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.track-live { margin-top: 4px; }
.track-loading { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.spin { width: 12px; height: 12px; border: 2px solid #cbd5e1; border-top-color: var(--teal); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.track-err { font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.track-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 20px; margin-bottom: 10px; }
.track-state.done { background: #e8f7ef; color: var(--green); }
.track-state.moving { background: #fff4e6; color: var(--orange); }
.track-com { font-size: 10.5px; font-weight: 400; opacity: .7; }
.track-list { position: relative; padding-left: 0; max-height: 240px; overflow-y: auto; }
.track-item { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.track-item:last-child { padding-bottom: 2px; }
.track-item::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1px; background: #e2e8f0; }
.track-item:last-child::before { display: none; }
.track-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; margin-top: 4px; z-index: 1; }
.track-item.active .track-dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
.track-body { flex: 1; min-width: 0; }
.track-ctx { font-size: 12.5px; line-height: 1.5; color: var(--text); }
.track-item.active .track-ctx { color: var(--teal); font-weight: 600; }
.track-time { font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.track-actions { display: flex; gap: 8px; margin-top: 10px; }
.track-cell { min-width: 150px; max-width: 210px; }
.tk-loading { font-size: 11.5px; color: var(--muted); }
.tk-none { font-size: 11.5px; color: #cbd5e1; }
.tk-err { font-size: 11.5px; color: var(--muted); }
.tk-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.tk-badge.moving { background: #fff4e6; color: var(--orange); }
.tk-badge.done { background: #e8f7ef; color: var(--green); }
.tk-ctx { font-size: 11.5px; color: var(--text); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-time { font-size: 10.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.tk-warn { display: inline-block; font-size: 10.5px; font-weight: 600; color: #b45309; background: #fef3c7; border: 1px solid #fde68a; border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; cursor: help; }
.track-warn { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; font-size: 12px; line-height: 1.5; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.svc-hint { font-size: 12.5px; line-height: 1.6; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.svc-hint.warn { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.btn.green { background: var(--green); }
.btn.orange { background: var(--orange); }
.btn.red { background: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
#sidebar { position: fixed; top: 60px; left: 0; bottom: 0; width: 216px; background: var(--card); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; }
.nav-title { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: #4b5563; font-size: 13.5px; margin-bottom: 2px; }
.nav-item:hover { background: #f6f8fb; }
.nav-item.active { background: var(--primary-l); color: var(--primary); font-weight: 600; }
.nav-item .ic { width: 18px; text-align: center; font-size: 15px; }
#main { margin-left: 216px; padding: 84px 26px 40px; min-height: 100vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-head h1 { font-size: 21px; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.metric .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.metric .val { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; }
.metric .sub { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 9px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.b-blue { background: var(--primary-l); color: var(--primary); }
.b-green { background: var(--green-l); color: var(--green); }
.b-orange { background: var(--orange-l); color: var(--orange); }
.b-red { background: var(--red-l); color: var(--red); }
.b-purple { background: var(--purple-l); color: var(--purple); }
.b-teal { background: var(--teal-l); color: var(--teal); }
.b-gray { background: #f1f2f4; color: #6b7280; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f3f4f6; }
.thumb[onclick] { cursor: zoom-in; }
.placeholder { width: 40px; height: 40px; border-radius: 6px; background: #eef1f6; display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 11px; }
.table-wrap { overflow-x: auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 7px 10px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: #4b5563; font-weight: 500; }
.field .hint { font-size: 11.5px; color: #9ca3af; }
.field.full { grid-column: 1 / -1; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 720px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  display: flex; flex-direction: column; max-height: calc(100vh - 80px); }
.modal.wide { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex: 0 0 auto; background: #fff; border-radius: 0 0 14px 14px; }
.modal-foot .draft-status { margin-right: auto; font-size: 12px; color: var(--green); }
.modal-foot .draft-status:empty { display: none; }
.close { cursor: pointer; color: #9ca3af; font-size: 22px; line-height: 1; border: none; background: none; }

/* 全屏图片查看器 */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8,11,18,.96); display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: rgba(255,255,255,.05); border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.lb-hint { color: #9aa4b2; font-size: 12px; }
.lb-tools { display: flex; align-items: center; gap: 6px; }
.lb-btn { background: rgba(255,255,255,.1); color: #e8ecf2; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer; line-height: 1.4; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-btn.close { background: rgba(220,38,38,.85); border-color: rgba(220,38,38,.9); color: #fff; padding: 5px 14px; font-size: 15px; }
.lb-btn.close:hover { background: #dc2626; }
.lb-pct { color: #e8ecf2; font-size: 12px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.lb-stage { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; }
.lb-stage.grabbing { cursor: grabbing; }
.lb-img { max-width: none; max-height: none; object-fit: contain; user-select: none; -webkit-user-drag: none; image-rendering: auto; }
.lb-banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; background: #7c2d12; border-top: 1px solid #b45309; color: #fed7aa; font-size: 13px; padding: 10px 16px; }
.lb-banner b { color: #fff; }
.lb-banner-h { color: #fdba74; font-size: 12px; }
.lightbox.drag-over { outline: 3px dashed #f59e0b; outline-offset: -8px; }
.mi-item.low-res { outline: 2px solid #f59e0b; outline-offset: 1px; }
.mi-item.low-res::after { content: attr(data-low); position: absolute; left: 0; bottom: 0; right: 0; background: rgba(245,158,11,.95); color: #1f2937; font-size: 9px; text-align: center; padding: 1px 0; font-weight: 600; }
.lb-tip { text-align: center; color: #6b7280; font-size: 11.5px; padding: 8px 16px 12px; }
.lb-tip b { color: #d1d5db; }
.lb-tip.warn { color: #fbbf24; }
.lb-tip.warn b { color: #fde68a; }
.lb-reupload { display: inline-block; margin-left: 10px; background: #f59e0b; color: #1f2937; border: none; border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.lb-reupload:hover { background: #fbbf24; }
.img-preview { max-width: 120px; max-height: 90px; border-radius: 6px; border: 1px solid var(--line); display: none; margin-top: 6px; }
.empty { text-align: center; color: #9ca3af; padding: 40px 16px; font-size: 13px; }
.empty .big { font-size: 34px; margin-bottom: 8px; opacity: .5; }
.kpi-row { display: flex; gap: 18px; flex-wrap: wrap; }
.kpi-row .item { flex: 1; min-width: 120px; }
.kpi-row .item .l { font-size: 12px; color: var(--muted); }
.kpi-row .item .v { font-size: 20px; font-weight: 700; margin-top: 3px; }
.bar { height: 8px; border-radius: 6px; background: #eef1f6; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.stock-warn { color: var(--red); font-weight: 600; }
.money { font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; color: var(--muted); background: #f3f4f6; padding: 2px 7px; border-radius: 5px; }
.note-box { background: var(--primary-l); border: 1px solid #d9e5ff; color: #1e40af; border-radius: 9px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6; }
.actions { display: flex; gap: 5px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.divider { height: 1px; background: var(--line); margin: 4px 0 2px; }
.txt-r { text-align: right; }
.form-sec { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin-bottom: 12px; }
.form-sec-t { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 10px; cursor: pointer; list-style: none; }
.form-sec-t::before { content: ''; display: inline-block; width: 3px; height: 13px; background: var(--primary); border-radius: 2px; margin-right: 8px; vertical-align: -2px; }
details.form-sec > summary.form-sec-t { display: block; }
.form-sec.highlight { border-color: #f5c2c0; background: #fff8f7; }
.form-sec.highlight .form-sec-t { color: var(--red); }
.form-sec.highlight .form-sec-t::before { background: var(--red); }
.req { font-size: 10px; color: var(--red); background: #fdecec; border-radius: 4px; padding: 1px 5px; font-weight: 500; vertical-align: 1px; }
.express-tag { font-size: 12px; color: var(--orange); background: var(--orange-l); border-radius: 5px; padding: 2px 7px; font-weight: 500; white-space: nowrap; }
.mi-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mi-list:empty { display: none; }
.img-drop { border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 12px; background: #fbfdff; transition: border-color .15s, background .15s; cursor: pointer; }
.img-drop:hover { border-color: var(--teal); background: #f6fdfc; }
.img-drop.over { border-color: var(--teal); background: #e6fbf8; border-style: solid; }
.img-drop input[type=file] { font-size: 12px; color: var(--muted); }
.drop-tip { font-size: 12px; color: var(--muted); margin-top: 8px; }
.drop-tip b { color: var(--teal); }
.mi-item { position: relative; width: 84px; height: 84px; }
.mi-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); cursor: pointer; }
.mi-del { position: absolute; top: -6px; right: -6px; width: 19px; height: 19px; border-radius: 50%; background: var(--red); color: #fff; font-size: 14px; line-height: 18px; text-align: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.po-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.po-imgs img { border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.po-mini { display: flex; gap: 4px; align-items: center; }
.po-mini img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.mi-more { font-size: 11px; color: var(--muted); }
.po-info { border-color: #d9e5ff; background: #fafcff; }
.pi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pi-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #e8edf5; font-size: 13px; }
.pi-row:last-child { border-bottom: none; }
.pi-k { flex: 0 0 76px; color: var(--muted); }
.pi-v { flex: 1; color: var(--text); word-break: break-all; }
.po-info > .pi-row .pi-k { flex-basis: 96px; }
.po-link { color: var(--primary); text-decoration: none; word-break: break-all; }
.po-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
  #sidebar { width: 64px; } .nav-item span:not(.ic), .nav-title { display: none; }
  #main { margin-left: 64px; padding-left: 16px; padding-right: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* 权限管理矩阵 */
.perm-table th, .perm-table td { white-space: nowrap; }
.perm-table th.txt-c, .perm-table td.txt-c { text-align: center; }
.perm-key { font-size: 10.5px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; margin-left: 4px; }
.perm-table tr.perm-group td { background: #f1f5f9; font-weight: 600; font-size: 12px; color: #334155; letter-spacing: .3px; }
.perm-table input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--teal); }
.perm-table input[type=checkbox]:disabled { cursor: not-allowed; opacity: .45; }

/* 运营身份只读标签 */
.op-chip { color: #0f766e; background: #e6fbf8; border: 1px solid #b8ece4; border-radius: 6px; padding: 5px 12px; font-size: 13px; font-weight: 600; }

/* 物流：已完成的单不自动查询，显示可点击的占位 */
.tk-idle { color: #64748b; font-size: 12px; cursor: pointer; text-decoration: underline dotted; }
.tk-idle:hover { color: var(--teal); }

/* 操作日志 */
.log-time { font-size: 12px; color: #64748b; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; }
.log-detail { font-size: 12.5px; line-height: 1.9; }
.log-chg { display: inline-block; background: #f1f5f9; border-radius: 5px; padding: 2px 7px; margin: 1px 3px 1px 0; }
.log-chg i { font-style: normal; color: #b42318; text-decoration: line-through; }
.log-chg b { color: #0f766e; }

/* 操作日志 */
.log-time { font-size: 12px; color: #64748b; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; }
.log-detail { font-size: 12.5px; line-height: 1.9; }
.log-chg { display: inline-block; background: #f1f5f9; border-radius: 5px; padding: 2px 7px; margin: 1px 3px 1px 0; }
.log-chg i { font-style: normal; color: #b42318; text-decoration: line-through; }
.log-chg b { color: #0f766e; }

/* 顺丰缺手机号时的补填入口 */
.tk-need { color: #b45309; font-size: 12px; cursor: pointer; text-decoration: underline dotted; }
.tk-need:hover { color: #b42318; }

/* 物流轨迹弹窗 */
.tk-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tk-modal-head b { font-size: 15px; letter-spacing: .3px; }
.tk-sub { margin-left: 10px; font-size: 12.5px; color: #64748b; }
.tk-modal-foot { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.tk-modal-foot a { color: #64748b; }
.tk-modal-foot a:hover { color: var(--teal); }
.tk-click { cursor: pointer; }
.tk-click:hover .tk-ctx { color: var(--teal); }
.tk-click { cursor: pointer; }
.tk-click:hover .tk-ctx { color: var(--teal); }

/* 库存：SKU 与货架号 */
.sku-cell span[onclick] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--teal); cursor: pointer; border-bottom: 1px dotted var(--teal); }
.shelf-cell { cursor: pointer; font-size: 13px; }
.shelf-cell:hover { background: #f8fafc; }
.shelf-empty { color: #94a3b8; border-bottom: 1px dotted #cbd5e1; }
.shelf-cell:hover .shelf-empty { color: var(--teal); border-color: var(--teal); }

/* 库存：可点击修改的数字 */
.stock-edit { cursor: pointer; border-bottom: 1px dotted var(--teal); color: var(--teal); }
.stock-edit:hover { background: #ecfdf5; }

/* 采购列表：付款凭证缩略图 */
.proof-cell { width: 66px; }
.proof-cell img { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.proof-cell img:hover { border-color: var(--teal); }
.proof-miss { color: #b45309; font-size: 12px; border-bottom: 1px dotted #b45309; }

/* 货架号旁的打印小图标 */
.shelf-print { font-size: 12px; opacity: .45; margin-left: 2px; cursor: pointer; }
.shelf-print:hover { opacity: 1; }

/* 出货流程：待打包高亮 */
.row-pending td { background: #fffbeb; }
.ship-st { font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ship-st.pending { background: #fef3c7; color: #92400e; }
.ship-st.done { background: #ecfdf5; color: #047857; }

/* 库存：待打包预占提示 */
.stock-reserved { font-size: 11px; color: #b45309; margin-top: 2px; }

/* 库存共享标记 */
.share-tag { font-size: 11px; background: #e0f2fe; color: #0369a1; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.share-btn { cursor: pointer; opacity: .5; margin-left: 4px; }
.share-btn:hover { opacity: 1; }
.share-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }

/* 表单内联小提示 */
.hint-inline { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* 仓库工作台表格细节 */
.sub-line { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.addr-cell { max-width: 240px; font-size: 12.5px; line-height: 1.35; }
.remark-cell { max-width: 140px; font-size: 12.5px; color: #475569; }

/* 追溯快递单号列 */
.trace-cell { white-space: nowrap; }
.trace-cell .express-tag { font-size: 12px; }

/* 包裹链接 */
.parcel-link { cursor: pointer; border-bottom: 1px dotted currentColor; }
.parcel-link:hover { opacity: .8; }
.mini-table { width: 100%; font-size: 13px; }
.mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }

/* 采购多品行 */
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row .ir-p { flex: 1; min-width: 180px; }
.item-row .ir-p select { width: 100%; }
.item-row .ir-qty { width: 90px; }
.item-row .ir-price { width: 110px; }

/* 多品行内的图片按钮 */
.item-row .ir-img { white-space: nowrap; }
.item-row .ir-img-n { color: var(--teal); font-weight: 700; }

/* 多品行：行内图片区 */
.item-row-wrap { margin-bottom: 10px; }
.ir-imgbox { margin: 6px 0 10px; padding: 10px 12px; background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; }
.ir-imgbox .mi-wrap { min-height: 70px; }

/* 多品行：第二行下单链接 */
.ir-link-row { margin-top: -4px; margin-bottom: 2px; }
.ir-link-row .ir-link { width: 100%; font-size: 12.5px; padding: 5px 8px; }

/* 多品行：产品名/规格输入 */
.item-row .ir-name { width: 100%; }
.item-row .ir-spec { width: 130px; }

/* 弹窗内容区滚动条：内容很长时只滚中间，头尾按钮始终看得见 */
.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 8px; border: 2px solid #fff; background-clip: content-box;
}
.modal-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
.modal-body { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

/* 小屏（笔记本、平板）压缩一点留白，多露内容 */
@media (max-height: 760px) {
  .modal-mask { padding: 20px 16px; }
  .modal { max-height: calc(100vh - 40px); }
  .modal-body { padding: 16px; }
}

/* 执行采购：多款图片分组 */
.pi-img-group { margin-bottom: 14px; }
.pi-img-group:last-child { margin-bottom: 0; }
.pi-img-t { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #334155; }

/* ============ 手机端（<=640px）============ */
@media (max-width: 640px) {
  /* 侧边栏收成 48px 图标条，正文留出空间 */
  #sidebar { width: 48px; }
  #main { margin-left: 48px; padding: 12px 10px 40px; }
  .nav-item { padding: 12px 0; }
  .ic { font-size: 16px; }

  /* 标题区：按钮换行，不挤压标题 */
  .head { flex-direction: column; align-items: stretch; gap: 10px; }
  .head h1 { font-size: 18px; }
  .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .head-actions .btn { flex: 1 1 auto; }

  /* 表格：横向滚动 + 首列吸附，横滑时知道在看哪一行 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 680px; }
  .table-wrap th, .table-wrap td { padding: 10px 8px; font-size: 12.5px; }

  /* 弹窗铺满，按钮更大好点 */
  .modal-mask { padding: 0; align-items: stretch; }
  .modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; gap: 10px; }
  .modal-foot .btn { flex: 1 1 auto; padding: 12px 14px; font-size: 14px; }

  /* 表单控件放大，避免 iOS 自动缩放 */
  input[type=text], input[type=number], input[type=date], select, textarea { font-size: 16px; padding: 10px 12px; }
  .field label { font-size: 12.5px; }

  /* 指标卡：两列变一列 */
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 12px; }
  .metric .mv { font-size: 22px; }

  /* 多品采购行：竖排，别挤成一条 */
  .item-row { flex-wrap: wrap; }
  .item-row .ir-p { flex: 1 1 100%; }
  .item-row .ir-spec { flex: 1 1 45%; width: auto; }
  .item-row .ir-qty, .item-row .ir-price { flex: 1 1 22%; width: auto; }

  /* 提示框字号 */
  .note-box, .hint { font-size: 12px; }
}

/* 采购明细表（详情页 / 执行采购共用） */
.po-items { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 8px; overflow: hidden; }
.po-items th { background: #f1f5f9; color: #334155; font-weight: 600; font-size: 12px; padding: 7px 8px; text-align: left; white-space: nowrap; }
.po-items td { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.po-items tr:hover td { background: #f8fafc; }
.po-items .po-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
.po-items .po-link-cell { max-width: 240px; word-break: break-all; line-height: 1.35; }
.po-items .po-link-cell a { font-size: 12px; }

/* 出货明细行 */
.ship-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ship-item .si-key { flex: 1; min-width: 200px; }
.ship-item .si-qty { width: 90px; }

/* ===== 仓库拣货卡：一包一卡，逐款一行 ===== */
.pick-list { display: flex; flex-direction: column; gap: 12px; }
.pick-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.pick-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: #fffbeb; border-bottom: 1px solid #fde68a; }
.pick-title { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pick-title b { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pick-date { color: var(--muted); font-size: 12px; }
.pick-sum { font-size: 13px; color: #92400e; }
.pick-sum b { font-size: 15px; }
.pick-info { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 14px;
  font-size: 12.5px; color: #475569; border-bottom: 1px dashed var(--line); }
.pick-addr { flex: 1 1 240px; color: #334155; }
.pick-op { color: var(--muted); }
.pick-body { padding: 6px 6px 2px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; }
.pick-row + .pick-row { border-top: 1px solid #f1f5f9; }
.pick-row.picked { background: #f0fdf4; }
.pick-row.picked .pick-name { text-decoration: line-through; color: #94a3b8; }
.pick-chk input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--teal); }
.pick-img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; cursor: zoom-in; flex: 0 0 auto; display: block; }
.pick-img.placeholder { display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #cbd5e1; font-size: 11px; }
.pick-main { flex: 1; min-width: 0; }
.pick-name { font-size: 13.5px; font-weight: 600; color: #0f172a; margin-bottom: 4px; line-height: 1.35; word-break: break-all; }
.pick-spec { font-weight: 500; color: #475569; background: #f1f5f9; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.pick-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.pick-sku { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f8fafc; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: #334155; }
.pick-shelf { color: #b45309; font-weight: 600; }
.pick-shelf.muted { color: #cbd5e1; font-weight: 400; }
.pick-loc { color: #64748b; }
.pick-qty { flex: 0 0 auto; font-size: 18px; color: #0f766e; min-width: 48px; text-align: right; }
.pick-qty b { font-weight: 700; }
.pick-remark { padding: 6px 14px 10px; font-size: 12.5px; color: #b45309; }
.pick-foot { padding: 10px 14px; border-top: 1px solid var(--line); text-align: right; background: #fafbfc; }

@media (max-width: 640px) {
  .pick-img { width: 50px; height: 50px; }
  .pick-qty { font-size: 16px; min-width: 38px; }
  .pick-head { flex-wrap: wrap; }
}

/* 确认出货弹窗里的货品清单 */
.cfg-items { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.cfg-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.cfg-item + .cfg-item { border-top: 1px solid #f1f5f9; }
.cfg-img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; flex: 0 0 auto; }
.cfg-img.placeholder { display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #cbd5e1; font-size: 10px; }
.cfg-main { flex: 1; min-width: 0; }
.cfg-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cfg-meta { display: flex; gap: 8px; margin-top: 3px; font-size: 11.5px; }
.cfg-qty { font-weight: 700; color: #0f766e; }

/* 列表筛选条 */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.filter-bar .fb-label { font-size: 13px; color: #475569; font-weight: 600; }
.filter-bar input[type=date] { width: 150px; padding: 6px 8px; font-size: 13px; }
.filter-bar .fb-sep { color: var(--muted); font-size: 13px; }
.filter-bar .fb-count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.filter-bar .fb-count b { color: var(--teal); }

@media (max-width: 640px) {
  .filter-bar input[type=date] { width: calc(50% - 40px); }
  .filter-bar .fb-count { margin-left: 0; width: 100%; }
}

/* 库存流水 */
.lg-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.lg-cards .metric { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.lg-cards .mk { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.lg-cards .mv { font-size: 22px; font-weight: 700; }
.muted-cell { font-size: 12px; color: #64748b; max-width: 240px; }
@media (max-width: 640px) { .lg-cards { grid-template-columns: 1fr 1fr; } }

/* 入库：多款清单 */
.si-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.si-table th { background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 600; padding: 7px 8px; text-align: left; }
.si-table td { padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.si-table .si-qty { width: 90px; text-align: right; }
.si-table .si-chk { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }

/* ===== 品牌区（弘浩出海） ===== */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #0f172a; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; display: block; box-shadow: 0 1px 3px rgba(15,23,42,.18); }
.brand-name { font-size: 15px; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 6px; }
.brand-erp {
  font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: #0f766e; background: #e6fffb; border: 1px solid #99f6e4;
  padding: 1px 6px; border-radius: 5px;
}
@media (max-width: 640px) {
  .brand-name { font-size: 13px; }
  .brand-logo { width: 24px; height: 24px; }
  .brand-name .brand-erp { display: none; }
}

/* 登录页品牌 */
.login-brand { display: flex; align-items: center; gap: 14px; justify-content: center; }
.login-logo { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 6px 18px rgba(13,148,136,.28); }
.login-brand h1 { font-size: 20px; margin: 0; }
.login-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); letter-spacing: .5px; }

/* 产品目录：搜索框与开关 */
.search-inp { padding: 7px 12px; border: 1px solid #d8dee9; border-radius: 8px; font-size: 13px; width: 220px; outline: none; }
.search-inp:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.switch-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; cursor: pointer; user-select: none; }
.switch-line input { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.note-box.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
@media (max-width: 640px) { .search-inp { width: 100%; } }

/* ===== 扫码收货 ===== */
.scan-card { display: flex; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.scan-left { flex: 1 1 420px; min-width: 280px; }
.scan-t { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.scan-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.scan-row { display: flex; gap: 8px; }
.scan-inp { flex: 1; font-size: 16px; padding: 10px 12px; border: 2px solid var(--teal);
  border-radius: 9px; outline: none; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; }
.scan-inp:focus { box-shadow: 0 0 0 4px rgba(13,148,136,.14); }
.scan-right { flex: 0 0 210px; border-left: 1px dashed var(--line); padding-left: 14px; }
.scan-log-t { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.scan-log { font-size: 12px; color: #334155; padding: 3px 0; border-bottom: 1px dotted #eef2f7; word-break: break-all; }
.scan-log b { font-family: ui-monospace, Menlo, Consolas, monospace; }
.scan-log.miss { color: #b45309; }
.scan-empty { font-size: 12px; color: #cbd5e1; }
@media (max-width: 720px) { .scan-right { flex: 1 1 100%; border-left: 0; border-top: 1px dashed var(--line); padding: 10px 0 0; } }

/* 拣货序号 */
.pick-no { flex: 0 0 22px; height: 22px; border-radius: 50%; background: #0f766e; color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* 入库货架号输入 */
.si-table .si-shelf { width: 118px; font-size: 12.5px; }

/* 图片查看器：极简版（无顶栏、无提示、点一下就关） */
.lightbox { cursor: zoom-out; }
.lb-stage { cursor: zoom-out; overflow: auto; padding: 12px; }
.lb-img { cursor: zoom-out; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.lb-x { position: fixed; top: 14px; right: 16px; z-index: 201; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; font-size: 16px;
  cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; }
.lb-x:hover { background: rgba(255,255,255,.22); }

/* 采购明细行：SKU 提示 */
.ir-sku { font-size: 11px; color: #0f766e; margin-top: 2px; line-height: 1.3; min-height: 14px; }
.ir-sku b { font-family: ui-monospace, Menlo, Consolas, monospace; }
