:root {
  --gold: #B8860B;
  --gold-deep: #92690A;
  --gold-soft: #F6ECCF;
  --gold-line: #E8D5A3;
  --bg: #F8F6F1;
  --card: #FFFFFF;
  --text: #2C2A25;
  --sub: #5E594F;
  --muted: #928C7E;
  --line: #E9E4D8;
  --line-soft: #F1EDE3;
  --ok: #2E7D5B;
  --ok-bg: #E8F4EE;
  --warn: #C07A0A;
  --warn-bg: #FDF3DF;
  --danger: #B93B2E;
  --danger-bg: #FBEAE7;
  --shadow: 0 2px 12px rgba(90, 76, 40, .06);
  --shadow-lg: 0 12px 40px rgba(60, 48, 20, .16);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.link { border: 0; background: none; color: var(--gold); font-size: 12px; padding: 2px 0; }
.link:hover { text-decoration: underline; }
.danger { color: var(--danger) !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: none; background: #FFFDF8; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, #D9A93C, #A97408); color: #fff; box-shadow: 0 4px 10px rgba(169, 116, 8, .22);
}
.brand-mark .ic { width: 21px; height: 21px; stroke-width: 1.6; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 145px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--sub); font-size: 13.5px; text-align: left; transition: .15s;
}
.nav-item .ic { width: 17px; height: 17px; }
.nav-item:hover { background: var(--gold-soft); color: var(--gold-deep); }
.nav-item.active { background: var(--gold-soft); color: var(--gold-deep); font-weight: 650; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line-soft); }
.store-badge { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--sub); }
.store-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.side-tip { margin-top: 6px; font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 30px; background: rgba(255, 253, 248, .9); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.topbar p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.today { font-size: 12.5px; color: var(--sub); white-space: nowrap; }
.content { padding: 24px 30px 60px; max-width: 1440px; margin: 0 auto; }
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px;
  padding: 9px 15px; border: 1px solid transparent; font-size: 13px; font-weight: 600;
  background: var(--line-soft); color: var(--text); transition: .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(145deg, #CB9831, #AD7A0B); color: #fff; box-shadow: 0 3px 9px rgba(173, 122, 11, .22); }
.btn-primary:hover { box-shadow: 0 5px 14px rgba(173, 122, 11, .3); }
.btn-outline { background: #fff; border-color: var(--gold-line); color: var(--gold-deep); }
.btn-outline:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--sub); }
.btn-ghost:hover { background: #fff; border-color: var(--gold-line); color: var(--gold-deep); }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 8px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > .card { margin-bottom: 16px; }
.two-col.wide-left { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 0; }
.side-stack .card { margin-bottom: 16px; }
.divider { height: 1px; background: var(--line-soft); margin: 15px 0; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px 26px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(115deg, #FBF3DE 0%, #F6E7C4 55%, #F3DFB6 100%);
  border: 1px solid var(--gold-line);
}
.hero-kicker { font-size: 11px; letter-spacing: 2px; color: var(--gold-deep); font-weight: 700; margin-bottom: 6px; }
.hero h2 { font-size: 21px; font-weight: 700; }
.hero p { font-size: 12.5px; color: #7A6A43; margin-top: 5px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after { content: ''; position: absolute; right: -14px; top: -14px; width: 62px; height: 62px; border-radius: 50%; background: var(--gold-soft); opacity: .5; }
.kpi .k-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 29px; font-weight: 700; line-height: 1.25; margin-top: 7px; letter-spacing: -.5px; }
.kpi .k-foot { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi.tone-warn .k-value { color: var(--warn); }
.kpi.tone-danger .k-value { color: var(--danger); }
.kpi.tone-ok .k-value { color: var(--ok); }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 12.5px; color: var(--sub); margin-bottom: 6px; font-weight: 600; }
.field label em { color: var(--danger); font-style: normal; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #FDFCF9;
  outline: none; transition: .15s; font-size: 13.5px; min-width: 0;
}
.input:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(184, 134, 11, .1); }
.input::placeholder { color: #B5AFA2; }
.input-lg { padding: 13px 14px; font-size: 16px; letter-spacing: .4px; font-weight: 600; }
.input-xl { padding: 15px 15px 15px 42px; font-size: 16px; border-radius: 11px; }
.input-sm { padding: 7px 10px; font-size: 12px; width: auto; flex: 1; min-width: 130px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #928C7E 50%), linear-gradient(135deg, #928C7E 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input-with-btn { display: flex; gap: 7px; }
.input-with-btn .btn { flex: none; }
.input-with-icon { position: relative; flex: 1; min-width: 180px; }
.input-with-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-with-icon .input { padding-left: 34px; }
.form-foot { margin-top: 6px; }
.settings-form .btn { margin-top: 4px; }
.last-ok { margin-top: 14px; padding: 11px 13px; background: var(--ok-bg); border: 1px solid #CDE7D9; border-radius: 9px; font-size: 12.5px; color: #225E45; }
.last-ok strong { font-weight: 700; }
.tips { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--sub); line-height: 2; }
.switch { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--sub); margin: 4px 0 14px; cursor: pointer; }
.switch input { margin-top: 3px; accent-color: var(--gold); }

/* ---------- lists ---------- */
.list-box { display: flex; flex-direction: column; gap: 8px; max-height: 310px; overflow: auto; }
.list-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: #FDFCF9; }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item .li-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.list-item .li-side { text-align: right; font-size: 11.5px; color: var(--sub); white-space: nowrap; }
.slot-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 7px; background: var(--gold-soft); color: var(--gold-deep); font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty .ic { width: 26px; height: 26px; display: block; margin: 0 auto 8px; opacity: .5; }

/* ---------- charts ---------- */
.chart-box { width: 100%; min-height: 176px; }
.chart-lg { min-height: 220px; }
.chart-svg { width: 100%; height: 176px; display: block; overflow: visible; }
.chart-lg .chart-svg { height: 220px; }
.chart-svg text { font-size: 10.5px; fill: var(--muted); }
.chart-svg .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart-svg .bar-in { fill: #D6A542; }
.chart-svg .bar-out { fill: #8FBFA6; }
.legend { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg-in { background: #D6A542; }
.lg-out { background: #8FBFA6; margin-left: 8px; }
.bars { display: flex; flex-direction: column; gap: 11px; min-height: 150px; }
.bar-row { display: grid; grid-template-columns: 76px 1fr 42px; gap: 10px; align-items: center; font-size: 12px; }
.bar-row .bar-name { color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #D6A542, #B8860B); border-radius: 6px; min-width: 2px; transition: width .3s; }
.bar-fill.green { background: linear-gradient(90deg, #9CC7B0, #4E9B78); }
.bar-fill.red { background: linear-gradient(90deg, #E5A79C, #C0503F); }
.bar-row .bar-val { text-align: right; color: var(--sub); font-variant-numeric: tabular-nums; }
.summary { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--sub); line-height: 1.8; }
.summary b { color: var(--text); }

/* ---------- outbound ---------- */
.search-card { padding: 18px 20px 12px; }
.search-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.search-wrap .search-ic { position: absolute; left: 14px; color: var(--muted); width: 19px; height: 19px; }
.search-meta { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; padding-bottom: 90px; }
.pick-card {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 14px; cursor: pointer;
  transition: .15s; position: relative; box-shadow: var(--shadow);
}
.pick-card:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.pick-card.selected { border-color: var(--gold); background: #FFFCF3; box-shadow: 0 3px 12px rgba(184, 134, 11, .14); }
.pick-card .pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pick-card .pc-no { font-size: 13.5px; font-weight: 700; word-break: break-all; }
.pick-card .pc-check { width: 19px; height: 19px; border: 1.5px solid var(--line); border-radius: 6px; flex: none; display: grid; place-items: center; }
.pick-card.selected .pc-check { background: var(--gold); border-color: var(--gold); color: #fff; }
.pick-card .pc-check .ic { width: 13px; height: 13px; stroke-width: 2.4; opacity: 0; }
.pick-card.selected .pc-check .ic { opacity: 1; }
.pick-card .pc-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: 12px; color: var(--sub); }
.pick-card .pc-foot { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag-normal { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-out { background: var(--line-soft); color: var(--muted); }
.checkout-bar {
  position: fixed; left: 224px; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 14px;
  padding: 13px 30px; background: rgba(255, 253, 248, .96); border-top: 1px solid var(--gold-line);
  backdrop-filter: blur(8px); box-shadow: 0 -6px 20px rgba(90, 76, 40, .06);
}
.checkout-info { display: flex; align-items: baseline; gap: 5px; min-width: 92px; }
.checkout-info strong { font-size: 24px; color: var(--gold-deep); }
.checkout-info span { font-size: 12px; color: var(--muted); }
.checkout-bar .input { max-width: 280px; margin-left: auto; }

/* ---------- table ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 12px; }
.filter-bar .input { width: auto; flex: 0 1 auto; min-width: 118px; }
.filter-bar .input-with-icon { flex: 1 1 220px; }
.table-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; padding: 10px 11px; background: #FBF9F3; color: var(--muted); font-weight: 600; font-size: 11.5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: #FFFCF5; }
.table .td-no { font-weight: 650; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .2px; }
.table .td-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.row-actions { display: flex; gap: 5px; }
.icon-btn { width: 29px; height: 29px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { color: var(--gold-deep); border-color: var(--gold-line); background: var(--gold-soft); }
.icon-btn.danger:hover { color: var(--danger); border-color: #E9BDB6; background: var(--danger-bg); }
.icon-btn .ic { width: 15px; height: 15px; }
.load-more { text-align: center; padding-top: 14px; }

/* ---------- logs ---------- */
.log-list { display: flex; flex-direction: column; max-height: 620px; overflow: auto; }
.log-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-soft); }
.log-time { font-size: 11.5px; color: var(--muted); width: 116px; flex: none; font-variant-numeric: tabular-nums; }
.log-badge { font-size: 11px; padding: 3px 9px; border-radius: 6px; flex: none; min-width: 52px; text-align: center; font-weight: 600; }
.log-badge.t-in { background: var(--gold-soft); color: var(--gold-deep); }
.log-badge.t-out { background: var(--ok-bg); color: var(--ok); }
.log-badge.t-delete, .log-badge.t-clear { background: var(--danger-bg); color: var(--danger); }
.log-badge.t-edit, .log-badge.t-settings, .log-badge.t-import, .log-badge.t-restore { background: var(--line-soft); color: var(--sub); }
.log-badge.t-photo { background: var(--gold-soft); color: var(--gold-deep); }
.log-text { flex: 1; font-size: 12.5px; color: var(--sub); min-width: 0; word-break: break-all; }

/* ---------- help ---------- */
.help-card { margin-top: 2px; }
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.help-grid h4 { font-size: 12.5px; color: var(--gold-deep); margin-bottom: 5px; }
.help-grid p { font-size: 12.5px; color: var(--sub); line-height: 1.8; }

/* ---------- toast & modal ---------- */
.toast { position: fixed; top: 22px; left: 50%; transform: translate(-50%, -16px); z-index: 100; opacity: 0; pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-inner { display: flex; align-items: center; gap: 9px; padding: 11px 17px; border-radius: 10px; background: #2F2C24; color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); }
.toast-inner.ok .ic { color: #8ED3AE; }
.toast-inner.err .ic { color: #F0A79B; }
.modal-mask { position: fixed; inset: 0; background: rgba(40, 34, 20, .35); z-index: 90; display: grid; place-items: center; padding: 18px; }
.modal { width: min(440px, 100%); background: #fff; border-radius: 16px; padding: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 16px; margin-bottom: 8px; }
.modal p { font-size: 12.5px; color: var(--sub); line-height: 1.75; margin-bottom: 16px; }
.modal .field-row { gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

/* ---------- photos ---------- */
.photo-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-preview:empty, .proof-preview:empty { display: none; }
.proof-preview { display: flex; gap: 6px; align-items: center; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: var(--line-soft); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(44, 42, 37, .76); color: #fff; display: grid; place-items: center; padding: 0; }
.thumb-del .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.proof-preview .thumb { width: 36px; height: 36px; border-radius: 7px; }
.proof-preview .thumb-del { display: none; }
.ph-box { padding: 12px 14px; background: #FBF9F3; border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 14px; }
.ph-box[hidden] { display: none; }
.ph-box .field:last-child { margin-bottom: 0; }
.ph-box .muted { margin-left: 10px; }
.nut-tip b { color: var(--gold-deep); }
.nut-tip p { font-size: 12px; color: var(--sub); line-height: 1.75; margin-top: 5px; }
.photo-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; padding: 2px 7px; border: 0; border-radius: 6px; background: var(--gold-soft); color: var(--gold-deep); font-size: 11px; font-weight: 600; cursor: pointer; }
.photo-badge:hover { background: var(--gold-line); }
.photo-badge .ic { width: 12px; height: 12px; }
.viewer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-height: 58vh; overflow: auto; }
.viewer-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #FDFCF9; }
.viewer-item .viewer-img { height: 130px; background: var(--line-soft); display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; padding: 8px; }
.viewer-item img { width: 100%; height: 100%; object-fit: cover; }
.viewer-item .viewer-meta { padding: 7px 9px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.viewer-item .viewer-meta button { border: 0; background: none; color: var(--danger); font-size: 11px; padding: 0; white-space: nowrap; }
.viewer-kind { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--line-soft); color: var(--sub); }

/* ---------- 查件 ---------- */
.quick-lookup { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px; }
.ql-label { display: flex; align-items: center; gap: 7px; font-weight: 650; white-space: nowrap; color: var(--gold-deep); }
.ql-row { display: flex; flex: 1; gap: 8px; min-width: 0; }
.ql-row .input { flex: 1; min-width: 0; }
.lookup-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.lookup-head h3 { font-size: 16px; }
.lookup-head p { margin-top: 2px; }
.lookup-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; margin-bottom: 12px; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 10px; font-size: 12.5px; color: var(--sub); }
.lookup-summary strong { color: var(--gold-deep); font-size: 13.5px; }
.lookup-summary[hidden] { display: none; }
.lookup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 13px; align-items: start; }
.lookup-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 12px; padding: 15px 16px; box-shadow: var(--shadow); }
.lookup-card.is-out { border-left-color: var(--muted); background: #FCFBF8; }
.lookup-empty { grid-column: 1 / -1; }
.lookup-quick { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--gold-line); background: #FFFCF3; color: var(--gold-deep); border-radius: 999px; padding: 4px 11px; font-size: 12px; }
.chip:hover { background: var(--gold-soft); }
.lc-top { display: flex; align-items: center; gap: 8px; }
.lc-carrier { font-size: 12px; color: var(--sub); }
.lc-copy { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 3px; display: grid; place-items: center; }
.lc-copy:hover { color: var(--gold); }
.lc-copy .ic { width: 15px; height: 15px; }
.lc-no { font-size: 16px; font-weight: 700; word-break: break-all; margin: 9px 0 10px; letter-spacing: .3px; }
.lc-slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-radius: 10px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.is-out .lc-slot { background: var(--line-soft); border-color: var(--line); }
.lc-slot > div > span { font-size: 11px; color: var(--sub); display: block; }
.lc-slot strong { font-size: 23px; line-height: 1.25; color: var(--gold-deep); letter-spacing: .5px; }
.is-out .lc-slot strong { color: var(--sub); }
.lc-stay { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.lc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 12px; }
.lc-grid > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lc-grid span { font-size: 11px; color: var(--muted); }
.lc-grid b { font-size: 12.5px; font-weight: 600; word-break: break-all; }
.lc-wide { grid-column: 1 / -1; }
.lc-note { margin-top: 10px; font-size: 11.5px; color: var(--warn); background: var(--warn-bg); border-radius: 7px; padding: 5px 9px; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }

/* ---------- 摄像头 ---------- */
.cam-mask { position: fixed; inset: 0; z-index: 120; background: rgba(24, 20, 14, .82); display: grid; place-items: center; padding: 14px; }
.cam-panel { width: min(720px, 100%); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.cam-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cam-head h3 { font-size: 15px; }
.cam-x { border: 0; background: none; color: var(--muted); display: grid; place-items: center; padding: 4px; }
.cam-x:hover { color: var(--text); }
.cam-stage { position: relative; background: #17150F; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.cam-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); color: #fff; font-size: 12px; text-align: center; }
.cam-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff; font-size: 13px; line-height: 1.8; background: rgba(30, 26, 20, .9); }
.cam-error[hidden] { display: none; }
.cam-error span { color: #E6D9BC; font-size: 12px; }
.cam-thumbs { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; }
.cam-thumbs:empty { display: none; }
.cam-thumb { width: 58px; height: 58px; flex: none; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.cam-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cam-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px; padding: 12px 14px 16px; }
.cam-actions .btn-primary { min-width: 120px; }

/* ---------- 取件码 / 取件标签 / 合并出库 ---------- */
.field-hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.code-input { font-weight: 700; letter-spacing: 1.2px; color: var(--gold-deep); }
.last-ok .li-ok { margin-bottom: 9px; }
.code-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 9px 11px; background: #fff; border: 1px dashed var(--gold-line); border-radius: 9px; }
.code-hero > span { font-size: 11.5px; color: var(--sub); }
.code-hero strong { font-size: 25px; line-height: 1.1; letter-spacing: 2px; color: var(--gold-deep); word-break: break-all; }
.code-hero .btn:first-of-type { margin-left: auto; }
.code-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 7px; background: #FFF8E4; border: 1px solid var(--gold-line); color: var(--gold-deep); font-size: 11.5px; font-weight: 700; letter-spacing: .6px; }
.code-chip .ic { width: 12px; height: 12px; }
.lc-code { display: flex; align-items: center; gap: 8px; margin: 9px 0 2px; padding: 7px 11px; border-radius: 9px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.lc-code .ic { width: 15px; height: 15px; color: var(--gold-deep); }
.lc-code > span { font-size: 11px; color: var(--sub); flex: none; }
.lc-code strong { font-size: 19px; letter-spacing: 1.4px; color: var(--gold-deep); word-break: break-all; }
.is-out .lc-code { background: var(--line-soft); border-color: var(--line); }
.is-out .lc-code strong, .is-out .lc-code .ic { color: var(--sub); }
.lc-code-copy { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 3px; display: grid; place-items: center; }
.lc-code-copy:hover { color: var(--gold); }
.lc-code-copy .ic { width: 15px; height: 15px; }
.merge-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-deep) !important; font-size: 11.5px !important; font-weight: 600; }
.merge-hint[hidden] { display: none; }
.merge-hint .ic { width: 14px; height: 14px; }
.checkout-info { flex-wrap: wrap; align-items: center; }
.label-sheet { width: min(320px, 100%); margin: 0 auto 6px; padding: 16px 18px; border: 1px dashed var(--gold); border-radius: 12px; background: #fff; text-align: center; }
.ls-station { font-size: 14px; font-weight: 700; }
.ls-caption { font-size: 11px; color: var(--muted); margin-top: 9px; letter-spacing: 2px; }
.ls-code { font-size: 42px; line-height: 1.15; font-weight: 800; letter-spacing: 3px; word-break: break-all; }
.ls-slot { font-size: 13px; margin: 5px 0 10px; }
.ls-slot b { font-size: 17px; color: var(--gold-deep); }
.ls-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--sub); padding: 2px 0; }
.ls-no { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); word-break: break-all; }
@media print {
  @page { margin: 10mm; }
  body.printing-label { background: #fff; }
  body.printing-label .app, body.printing-label .toast, body.printing-label #cameraRoot,
  body.printing-label #importFile { display: none !important; }
  body.printing-label #modalRoot { display: block !important; }
  body.printing-label .modal-mask { position: static; inset: auto; display: block; padding: 0; background: #fff; }
  body.printing-label .modal.label-modal { width: 100%; max-width: none; box-shadow: none; border-radius: 0; padding: 0; animation: none; }
  body.printing-label .label-modal > h3, body.printing-label .label-modal > p,
  body.printing-label .modal-actions { display: none !important; }
  body.printing-label .label-sheet { width: 80mm; border: 1px dashed #333; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .checkout-bar { left: 0; }
}
@media (max-width: 760px) {
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 2px 9px; }
  .brand-text span, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; flex: none; padding: 8px 11px; font-size: 12px; }
  .nav-item .ic { width: 15px; height: 15px; }
  .nav-item.active { box-shadow: inset 0 -2px 0 var(--gold); }
  .app { flex-direction: column; }
  .topbar { padding: 12px 16px; position: static; }
  .topbar h1 { font-size: 17px; }
  .topbar p, .today { display: none; }
  .content { padding: 16px 14px 90px; }
  .card { padding: 15px 14px; }
  .hero { padding: 18px; }
  .hero h2 { font-size: 18px; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 13px; }
  .kpi .k-value { font-size: 23px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .help-grid { grid-template-columns: 1fr; }
  .checkout-bar { padding: 10px 14px; gap: 9px; flex-wrap: wrap; }
  .checkout-bar .input { max-width: none; flex: 1; min-width: 120px; margin-left: 0; }
  .checkout-info { min-width: auto; }
  .pick-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .filter-bar .input { flex: 1 1 45%; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 8px 10px; }
  .table td { border: 0; padding: 4px 2px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; flex: none; text-align: left; }
  .table td.td-actions { justify-content: flex-end; }
  .table td.td-actions::before { margin-right: auto; }
  .log-time { width: 92px; }
  .viewer-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-picker .muted { width: 100%; }
  .quick-lookup { flex-direction: column; align-items: stretch; gap: 8px; }
  .lookup-grid { grid-template-columns: 1fr; }
  .search-wrap { flex-wrap: wrap; }
  .search-wrap .input-xl { flex: 1 1 100%; }
  .lookup-summary { gap: 4px 12px; }
  .code-hero strong { font-size: 22px; }
  .code-hero .btn:first-of-type { margin-left: 0; }
  .merge-hint { flex-basis: 100%; }
  .cam-stage { aspect-ratio: 4 / 3; }
  .cam-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 460px) {
  .pick-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .btn { padding: 8px 11px; }
  .checkout-bar .btn { flex: 1 1 auto; }
  .lc-slot strong { font-size: 20px; }
  .lc-code strong { font-size: 17px; }
  .ls-code { font-size: 36px; }
}
