:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --text: #172822;
  --muted: #66756e;
  --green: #184737;
  --dark: #12392e;
  --lime: #d7ef9d;
  --line: #e1e8e2;
  --panel: #ffffff;
  --bg: #f5f7f3;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button, a, input, select, textarea, summary, [tabindex] { outline-offset: 3px; }
:focus-visible { outline: 2px solid #55824d; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.sidebar { width: 218px; position: fixed; inset: 0 auto 0 0; z-index: 2; background: #102e25; color: #eef5eb; display: flex; flex-direction: column; padding: 29px 16px 20px; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 9px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--lime); color: var(--dark); }
.brand-mark svg { width: 25px; height: 25px; }
.brand strong { display: block; font-size: 18px; letter-spacing: .045em; line-height: 1.25; }
.brand small { display: block; margin-top: 5px; color: #adc1b7; font-size: 11px; letter-spacing: .06em; }
.side-nav { margin-top: 43px; display: flex; flex-direction: column; gap: 5px; }
.side-nav > p { padding: 0 11px 8px; color: #91aa9e; font-size: 11px; letter-spacing: .12em; font-weight: 600; }
.nav-link { display: flex; width: 100%; align-items: center; gap: 11px; border: 1px solid transparent; padding: 11px 10px; border-radius: 8px; color: #c5d7ce; background: none; text-align: left; min-height: 44px; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link.active { color: #e0f3b3; border-color: #37584a; background: #28473b; font-weight: 700; }
.nav-link:hover { background: #29483d; color: #fff; }
.nav-number { margin-left: auto; padding: 2px 7px; border-radius: 5px; background: #375448; color: #e6f0e4; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid #315044; }
.account { display: flex; gap: 9px; align-items: center; width: 100%; border: 0; background: transparent; color: inherit; border-radius: 8px; padding: 7px 5px; text-align: left; }
.account:hover { background: #28473b; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; display: inline-grid; place-items: center; background: #d9e9d2; color: #305344; font-size: 14px; font-weight: 700; }
.avatar svg { width: 18px; height: 18px; }
.account-name { min-width: 0; }
.account-name strong, .account-name small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-name strong { font-size: 13px; }
.account-name small { margin-top: 3px; font-size: 11px; color: #a9bdb2; }
.account-arrow { margin-left: auto; width: 16px; height: 16px; color: #a9bdb2; }

.body-wrap { margin-left: 218px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 0 34px; background: var(--panel); border-bottom: 1px solid var(--line); }
.header-location, .header-actions { display: flex; align-items: center; gap: 10px; }
.header-location { min-width: 0; }
.header-location strong { font-size: 13px; white-space: nowrap; }
.bread-root { color: var(--muted); font-size: 13px; white-space: nowrap; }
.breadcrumb-arrow { width: 13px; height: 13px; color: #86948d; }
.mobile-brand, .mobile-account { display: none !important; }
.workspace { max-width: 1450px; padding: 29px 34px 34px; margin: 0 auto; }
.hero { position: relative; min-height: 230px; overflow: hidden; border-radius: 14px; background: linear-gradient(112deg, #143c30, #1b4b3b); color: #f3f8ee; isolation: isolate; }
.hero-image { position: absolute; inset: 0 0 0 auto; z-index: -1; width: 53%; background: linear-gradient(90deg, #163f33 0%, transparent 38%), url('/boxes.webp') center 53% / cover no-repeat; }
.hero-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 85%, #102f2638); }
.hero-content { padding: 33px 34px 31px; }
.hero h1 { font-size: clamp(31px, 3.8vw, 47px); line-height: 1.19; font-weight: 780; letter-spacing: .04em; }
.hero p { margin-top: 13px; font-size: 14px; color: #d2e3d8; line-height: 1.6; }
.hero-actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; line-height: 1.35; font-weight: 650; white-space: nowrap; transition: background .14s, border-color .14s; }
.button svg { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: var(--green); }
.btn-primary:hover { background: #225b47; }
.btn-lime { background: var(--lime); color: #1c3523; }
.btn-lime:hover { background: #e5f7b8; }
.btn-glass { background: #ffffff0d; color: #f3f7ef; border-color: #f0faf155; }
.btn-glass:hover { background: #ffffff21; }
.btn-white { background: #fff; color: #344b40; border-color: #dfe7df; }
.btn-white:hover { background: #f3f7ef; }
.btn-text { background: transparent; color: #466457; }
.btn-text:hover { background: #e9f0e5; }
.icon-button { width: 36px; min-height: 36px; padding: 0; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0 25px; }
.metric { position: relative; width: 100%; display: flex; align-items: center; gap: 13px; padding: 17px 18px; text-align: left; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.metric:hover { border-color: #9bbb9d; background: #fcfefa; }
.metric-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; }
.box-icon { background: #edf1e6; color: #53694d; }
.wait-icon { background: #f9f1da; color: #9a6e1e; }
.done-icon { background: #e5f1e5; color: #367856; }
.metric-label { display: block; font-size: 12px; margin: 0 0 4px; color: var(--muted); }
.metric strong { display: block; font-size: 27px; line-height: 1; font-weight: 710; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.metric-arrow { width: 15px; height: 15px; position: absolute; top: 17px; right: 16px; color: #768b80; }

.records { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.records-intro, .records-tools, .records-footer, .bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 20px; padding-right: 20px; }
.records-intro { padding-top: 15px; padding-bottom: 10px; }
.records-title { display: flex; align-items: center; gap: 10px; }
.records-title h2 { font-size: 20px; letter-spacing: .015em; }
.records-tools { padding-bottom: 13px; flex-wrap: wrap; }
.view-tabs { display: inline-flex; gap: 3px; align-items: center; padding: 3px; border-radius: 8px; background: #f1f4ef; }
.view-tabs button { white-space: nowrap; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #52655a; padding: 6px 11px; font-size: 12px; font-weight: 650; }
.view-tabs button.active { color: #244e3c; background: #fff; border-color: #e1e8e0; box-shadow: 0 1px 2px #1735240d; }
.view-tabs button:hover { color: var(--dark); }
.filters { display: flex; gap: 7px; align-items: center; min-width: 0; }
.filter { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; color: #596e61; position: relative; min-height: 35px; padding: 0 8px; min-width: 0; }
.filter svg { width: 16px; height: 16px; }
.filter input, .filter select { background: transparent; border: none; color: #354b3e; width: 100%; height: 33px; min-width: 0; font-size: 12px; padding: 0; }
.filter-date { width: 126px; }
.filter-date:focus-within { outline: 2px solid #668f5d; outline-offset: 1px; }
.filter-date input { outline: none; cursor: pointer; }
.filter-date:not(.filled) input { color: transparent; }
.filter-date input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.date-placeholder { position: absolute; inset: 0 25px 0 30px; display: grid; align-items: center; pointer-events: none; white-space: nowrap; font-size: 12px; }
.filter-date.filled .date-placeholder { display: none; }
.filter-address { width: 153px; }
.filters .icon-button { width: 33px; min-height: 33px; }
.bulk-bar { justify-content: flex-start; background: #eef4ea; padding-top: 7px; padding-bottom: 7px; border-top: 1px solid var(--line); color: #365b47; flex-wrap: wrap; }
.bulk-bar .button { min-height: 32px; }
.records-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
thead { background: #f7f9f5; color: #586b60; }
th { font-size: 12px; font-weight: 650; white-space: nowrap; }
th, td { padding: 10px 11px; border-top: 1px solid #e9eee8; }
td { font-size: 13px; min-height: 57px; }
tr:last-child td { border-bottom: 1px solid #e9eee8; }
tbody tr:hover { background: #fcfdfb; }
tbody tr.selected { background: #f2f7ee; }
.check-cell { padding-left: 20px; width: 43px; }
.action-cell { padding-right: 19px; text-align: right; white-space: nowrap; }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0; vertical-align: middle; accent-color: var(--green); cursor: pointer; }
input[type="checkbox"]:disabled { cursor: default; }
.code-pill { min-height: 30px; display: inline-flex; gap: 7px; align-items: center; color: #254b3c; background: #eef3ed; border: 1px solid #e8eee5; padding: 3px 7px; border-radius: 6px; text-align: left; max-width: 160px; }
.code-pill:hover { background: #e3eee0; }
.code-pill span { min-width: 0; overflow-wrap: anywhere; font: 650 12px/1.4 "IBM Plex Mono", Consolas, monospace; letter-spacing: .025em; }
.code-pill svg { width: 13px; height: 13px; color: #637e70; }
.address { color: #233c31; font-weight: 650; overflow-wrap: anywhere; }
.row-small { color: var(--muted); font-size: 11px; margin-top: 4px; display: block; overflow-wrap: anywhere; }
.owner { white-space: normal; overflow-wrap: anywhere; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; white-space: nowrap; font-size: 11px; font-weight: 650; }
.status-pill::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.pending-pill { color: #885915; background: #faf1db; }
.picked-pill { color: #327153; background: #e8f3e6; }
.picker { overflow-wrap: anywhere; }
.missing { color: #78877e; }
.pick-row { color: #2d664d; background: #f7faf5; border: 1px solid #dfeade; min-height: 29px; font-size: 11px; padding: 4px 7px; font-weight: 650; }
.pick-row:hover { background: #e6f1e2; }
.pick-row svg { width: 13px; height: 13px; }
.row-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.delete-row { color: #913d2e; border-color: #efddd7; background: #fff9f7; }
.delete-row:hover { background: #fbeae4; }
.btn-danger { color: #fff; background: #973f2d; }
.btn-danger:hover { background: #7e3021; }
.records-footer { min-height: 45px; color: #637268; font-size: 11px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 37px 20px; text-align: center; color: var(--muted); border-bottom: 1px solid var(--line); }
.empty .metric-icon { margin-bottom: 1px; }
.empty strong { color: var(--text); font-size: 15px; }

dialog { padding: 0; border: 1px solid #d7e4d9; border-radius: 15px; width: min(500px, calc(100% - 28px)); max-height: calc(100% - 28px); box-shadow: 0 18px 68px #0e332a3a; color: var(--text); }
dialog::backdrop { background: #0f241f80; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 23px 15px; }
.dialog-heading h2 { font-size: 21px; }
.dialog-heading p { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; }
.entry-tabs { display: flex; margin: 0 23px 16px; gap: 4px; border-radius: 8px; padding: 3px; background: #f0f4ed; }
.entry-tabs button { display: flex; flex: 1; justify-content: center; align-items: center; gap: 7px; color: #52695b; padding: 8px 6px; background: transparent; border: 1px solid transparent; border-radius: 6px; }
.entry-tabs button.active { color: var(--green); font-weight: 700; background: #fff; border-color: #dce8da; }
.entry-tabs svg { width: 16px; height: 16px; }
form { padding: 0 23px; }
.form-field { display: block; margin-bottom: 13px; }
.form-field > span { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.form-field span > span { color: #9b532e; }
.form-field small { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-field input, .form-field textarea { width: 100%; padding: 10px; background: #fff; border: 1px solid #dce6dc; border-radius: 7px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #758278; opacity: 1; }
.form-field textarea { resize: vertical; line-height: 1.6; }
#text-panel { margin-bottom: 14px; }
#text-panel .form-field { margin-bottom: 6px; }
.field-message { padding: 7px 9px; margin: 8px 0; background: #edf4e9; color: #355c44; font-size: 12px; border-radius: 6px; line-height: 1.6; }
.field-message.error { background: #fae9e3; color: #90391e; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 18px 0 22px; }
.upload-zone { display: flex; align-items: center; justify-content: center; min-height: 81px; margin: 4px 0 12px; border: 1px dashed #a1bba4; background: #f7faf4; border-radius: 8px; padding: 12px; gap: 10px; cursor: pointer; }
.upload-zone:hover, .upload-zone.dragging { background: #ecf4e8; }
.upload-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 8px; background: #e6efe2; color: #38644f; }
.upload-zone img { width: 65px; height: 51px; object-fit: contain; border-radius: 4px; }
.upload-zone strong { display: block; overflow-wrap: anywhere; font-size: 13px; margin-bottom: 5px; }
.upload-zone small { font-size: 11px; color: var(--muted); }
details { margin: 0 0 12px; font-size: 12px; color: #3a614b; }
details summary { cursor: pointer; }
pre { max-height: 120px; overflow: auto; white-space: pre-wrap; }
.account-link { margin: 0 23px 22px; }
.toast { position: fixed; z-index: 8; right: 24px; bottom: 24px; max-width: calc(100% - 48px); padding: 12px 15px; background: #173e32; color: #fff; border-radius: 9px; line-height: 1.5; box-shadow: 0 5px 18px #173e322b; }

@media (max-width: 1130px) {
  .workspace { padding-right: 25px; padding-left: 25px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .sidebar { width: 190px; }
  .body-wrap { margin-left: 190px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .body-wrap { margin-left: 0; }
  .mobile-brand { display: grid !important; width: 34px; height: 34px; border-radius: 9px; }
  .mobile-brand svg { width: 22px; height: 22px; }
  .mobile-account { display: inline-flex !important; }
}
@media (max-width: 640px) {
  .workspace { padding: 15px 12px 24px; }
  .topbar { padding: 0 12px; min-height: 57px; }
  .header-actions, .header-location { gap: 6px; }
  .header-actions .button { font-size: 12px; padding: 6px 8px; min-height: 34px; }
  .mobile-account span { display: none; }
  .bread-root, .breadcrumb-arrow { display: none; }
  .hero { min-height: 193px; border-radius: 11px; }
  .hero-content { padding: 20px 16px; }
  .hero-image { width: 70%; opacity: .46; background-position: 58% 50%; }
  .hero h1 { font-size: 31px; }
  .hero p { margin-top: 9px; font-size: 12px; }
  .hero-actions { margin-top: 18px; gap: 6px; }
  .hero-actions .button { padding: 5px 8px; min-height: 35px; font-size: 12px; }
  .metrics { gap: 7px; margin: 11px 0 16px; }
  .metric { padding: 10px 7px; gap: 6px; }
  .metric-icon { width: 30px; height: 30px; border-radius: 7px; }
  .metric-icon svg { width: 16px; height: 16px; }
  .metric-label { font-size: 10px; }
  .metric strong { font-size: 20px; }
  .metric-arrow { display: none; }
  .records-intro, .records-tools, .records-footer, .bulk-bar { padding-left: 11px; padding-right: 11px; }
  .records-title h2 { font-size: 17px; }
  .records-tools { gap: 8px; }
  .view-tabs button { padding: 6px 8px; }
  .filters { flex-wrap: wrap; width: 100%; }
  .filter-address { flex: 1; }
  .records-table { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .records-table.has-select thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: block; border-top: 1px solid var(--line); }
  .records-table.has-select thead tr, .records-table.has-select thead .check-cell { display: block; }
  .records-table.has-select thead th { display: none; }
  .records-table.has-select thead .check-cell { width: auto; padding: 5px 11px; border: 0; }
  .records-table.has-select thead .check-cell::after { content: attr(data-selection-label); margin-left: 7px; }
  tbody tr { display: grid; grid-template-columns: 20px 1fr 1fr auto; gap: 7px; align-items: center; padding: 11px; border-top: 1px solid #e9eee8; }
  tbody tr:last-child { border-bottom: 1px solid #e9eee8; }
  .records-table tbody td { border: 0; padding: 0; min-height: 0; font-size: 12px; min-width: 0; }
  tbody .check-cell { grid-area: 1 / 1; display: flex; align-items: center; width: auto; }
  tbody .code-cell { grid-area: 1 / 2 / 2 / 4; }
  tbody .address-cell { grid-area: 2 / 2 / 3 / 5; }
  tbody .owner-cell { grid-area: 3 / 2; }
  tbody .owner-cell .owner::before { content: "登记："; }
  tbody .state-cell { grid-area: 1 / 4; justify-self: end; }
  tbody .picker-cell { grid-area: 3 / 3; }
  tbody .picker-cell .picker::before { content: "代拿："; }
  tbody .action-cell { grid-area: 3 / 4; }
  tbody .action-cell.own-actions { grid-area: 4 / 2 / 5 / 5; }
  .records-footer { font-size: 10px; min-height: 38px; }
}
