:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172c28;
  background: #eef4f3;
  --deep: #043c33;
  --deep-2: #125548;
  --brand: #0c7462;
  --gold: #efbd45;
  --ground: #eef4f3;
  --line: #dce7e4;
  --muted: #71837f;
  --danger: #c94f4f;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { width: 19px; height: 19px; stroke-width: 2; flex: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { background: var(--deep); color: #c7ddd8; width: 264px; flex: 0 0 264px; min-height: 100vh; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 15; }
.brand { min-height: 106px; padding: 18px 20px; border-bottom: 1px solid #ffffff1c; display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 54px; height: 54px; border-radius: 14px; background: var(--gold); color: var(--deep); display: grid; place-items: center; font-size: 25px; font-weight: 800; flex: none; }
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 21px; white-space: nowrap; }
.brand small { color: #9fc0b9; font-size: 11px; margin-top: 4px; }
.nav-caption { padding: 29px 25px 10px; color: #8ebbb4; font-size: 12px; }
.sidebar nav { padding: 0 12px; display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 14px; padding: 13px 17px; color: #c7ddd8; border-radius: 7px; text-decoration: none; font-size: 15px; font-weight: 650; }
.sidebar nav a:hover { background: #ffffff15; color: #fff; }
.sidebar nav a.active { background: #0d6c58; color: #fff; }
.nav-icon { display: grid; place-items: center; width: 20px; }
.sidebar-foot { border-top: 1px solid #ffffff24; margin: auto 20px 0; padding: 20px 0; font-size: 13px; color: #dfd7bd; line-height: 1.6; }
.sidebar-foot small { color: #9fc0b9; padding-left: 16px; }
.connection-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 8px; }
.main-shell { min-width: 0; flex: 1; }
.topbar { height: 70px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; }
.top-left, .top-right { display: flex; align-items: center; gap: 16px; }
.top-title { font-size: 15px; font-weight: 700; }
.top-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.preview-badge { font-size: 12px; color: #856512; background: #fff5d8; border: 1px solid #f3d477; border-radius: 5px; padding: 6px 10px; white-space: nowrap; }
.icon-button { border: 0; background: transparent; color: #36514b; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 5px; }
.icon-button:hover { background: #e8efed; }
.menu-toggle { display: none; }
.content { max-width: 1460px; margin: 0 auto; padding: 32px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.overline { font-size: 12px; font-weight: 700; color: var(--brand); margin: 0 0 7px; }
h1, h2, h3, p { margin-top: 0; }
.page-heading h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
.page-heading p:last-child { color: var(--muted); margin: 0; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; border-radius: 6px; border: 1px solid var(--line); font-weight: 650; min-height: 38px; text-decoration: none; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--deep-2); }
.button.secondary { background: #fff; color: var(--deep-2); }
.button.secondary:hover:not(:disabled) { border-color: var(--brand); }
.button.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.button.small { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.erp-login { max-width: 380px; }
.erp-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.erp-tab { padding: 10px 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); }
.erp-tab.selected { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.erp-query { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.erp-query .field { flex: 1 1 120px; min-width: 0; max-width: 210px; }
.erp-table td { overflow-wrap: anywhere; max-width: 270px; }
.erp-log { border-bottom: 1px solid var(--line); padding: 13px 20px; }
.erp-log summary { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; cursor: pointer; }
.erp-log summary time { color: var(--muted); margin-left: auto; font-size: 12px; }
.erp-log dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.erp-log dt { color: var(--muted); }
.erp-log dd { margin: 0; overflow-wrap: anywhere; }
.erp-task-audit { padding: 12px 20px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.erp-task-audit:last-child { border-bottom: 0; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: #e8f3ef; border: 1px solid #bfdbd2; border-radius: 6px; margin: 0 0 24px; color: #20584c; line-height: 1.6; }
.notice svg { margin-top: 1px; }
.notice.warning { background: #fff8e8; border-color: #eedca7; color: #6c551b; }
.notice strong { display: block; color: #183b34; }
.summary-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 24px; }
.summary-item { border: 0; border-right: 1px solid var(--line); background: transparent; text-align: left; padding: 17px 20px; min-width: 0; }
.summary-item:last-child { border-right: 0; }
.summary-item:hover { background: #f7faf9; }
.summary-item span { display: block; color: var(--muted); font-size: 12px; }
.summary-item strong { display: block; font-size: 25px; margin-top: 3px; }
.summary-item strong.alert { color: var(--danger); }
.section { border-top: 3px solid var(--deep); background: #fff; margin-bottom: 22px; }
.section-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.section-body { padding: 18px 20px; }
.task-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.task-link { display: flex; gap: 13px; align-items: center; background: #f8fbfa; border: 1px solid var(--line); border-radius: 6px; padding: 16px; text-align: left; min-width: 0; }
.task-link:hover { border-color: var(--brand); background: #f0f8f5; }
.task-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; color: var(--brand); background: #e2f3ec; border-radius: 6px; }
.task-icon.warn { background: #fff5d8; color: #856512; }
.task-copy { min-width: 0; flex: 1; }
.task-copy strong, .task-copy small { display: block; }
.task-copy strong { font-size: 14px; }
.task-copy small { color: var(--muted); margin-top: 3px; font-size: 12px; }
.task-link > svg { color: #90a09d; width: 16px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 28px; height: 28px; margin-bottom: 10px; color: #9eb0ac; }
.empty strong { display: block; color: #36514b; font-size: 15px; margin-bottom: 5px; }
.empty p { margin-bottom: 14px; }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 5px; height: 36px; background: #fff; padding: 0 10px; color: #172c28; }
.toolbar input { width: min(310px, 100%); }
.toolbar .toolbar-end { margin-left: auto; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; min-width: 730px; }
.data-table th, .data-table td { text-align: left; padding: 13px 15px; border-bottom: 1px solid #edf2f1; vertical-align: middle; }
.data-table th { font-size: 12px; color: #657873; background: #f8fbfa; font-weight: 650; }
.data-table td { font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfa; }
.cell-muted { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.tag { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 4px; white-space: nowrap; font-size: 11px; background: #edf2f1; color: #4b635e; }
.tag.amber { background: #fff1d7; color: #946716; }
.tag.teal { background: #e2f3ec; color: #08765c; }
.tag.red { background: #fde7e5; color: #b63e3e; }
.tag.gray { background: #eef2f1; color: #65736f; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr); gap: 20px; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.read-field span, .read-field strong { display: block; overflow-wrap: anywhere; }
.read-field span { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.read-field strong { font-size: 14px; font-weight: 600; }
.form-stack { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; min-width: 0; color: #36514b; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #cbdad6; border-radius: 5px; background: #fff; color: #172c28; font-weight: 400; }
.field textarea { resize: vertical; min-height: 84px; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 5px; }
.blocked { padding: 14px; border-left: 3px solid var(--gold); background: #fff8e8; color: #6c551b; font-size: 13px; line-height: 1.6; }
.blocked strong { display: block; }
.steps { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 8px; color: #657873; font-size: 12px; }
.steps li:not(:last-child)::after { content: '→'; margin-left: 2px; color: #9eb0ac; }
.steps b { background: #e4f3ee; color: #08765c; border-radius: 4px; padding: 4px 7px; font-weight: 600; }
.muted-copy { color: var(--muted); line-height: 1.6; }
.audit-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: start; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row time { color: var(--muted); font-size: 12px; }
.audit-row strong { display: block; font-size: 13px; }
.audit-row small { display: block; color: var(--muted); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-dialog { width: min(560px, calc(100vw - 24px)); max-height: min(90vh, 800px); border: 0; border-radius: 8px; padding: 0; color: #172c28; box-shadow: 0 18px 46px #102c3840; }
.form-dialog::backdrop { background: #102c3866; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 19px; }
.dialog-fields { display: grid; gap: 14px; padding: 20px 22px; max-height: 65vh; overflow-y: auto; }
.dialog-footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.form-error { margin: 0 22px 10px; color: var(--danger); font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--deep); color: #fff; border-radius: 5px; padding: 10px 14px; box-shadow: 0 6px 24px #0003; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; z-index: 40; }
.toast.visible { opacity: 1; transform: translateY(0); }
.mobile-overlay { display: none; }
@media (max-width: 1050px) {
  .sidebar { width: 222px; flex-basis: 222px; }
  .brand { padding: 16px 14px; gap: 9px; }
  .brand-mark { width: 44px; height: 44px; font-size: 20px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 10px; }
  .content { padding: 24px; }
  .detail-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-item:nth-child(3) { border-right: 0; }
  .summary-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .erp-task-table { min-width: 0; width: 100%; }
  .erp-task-table thead { display: none; }
  .erp-task-table tbody tr { display: grid; border-bottom: 1px solid var(--line); padding: 12px 15px; gap: 10px; }
  .erp-task-table tbody tr:last-child { border-bottom: 0; }
  .erp-task-table td, .erp-task-table tr:last-child td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  .erp-task-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
  .erp-task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; width: 264px; height: 100vh; }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay:not([hidden]) { display: block; position: fixed; inset: 0; background: #043c3370; z-index: 14; }
  .menu-toggle { display: inline-grid; }
  .topbar { height: 58px; padding: 0 14px; }
  .top-date { display: none; }
  .content { padding: 22px 14px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 24px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item:nth-child(3) { border-right: 1px solid var(--line); }
  .summary-item:nth-child(even) { border-right: 0; }
  .summary-item:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .summary-item:last-child { grid-column: 1 / -1; }
  .task-links, .fields-grid { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 1fr auto; }
  .audit-row time { grid-column: 1 / -1; }
}

/* V1.4.1 虚拟仓利润计算器 */
.calc-version { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 11px 16px; margin-bottom: 18px; font-size: 13px; }
.calc-version strong { color: var(--deep-2); }
.calc-version span { color: var(--muted); }
.calc-group + .calc-group { margin-top: 18px; }
.calc-group-title { margin: 0 0 10px; font-size: 15px; color: var(--deep); }
.calc-group-title small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.calc-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.calc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 12px 14px; border: 1.5px solid #cbdad6; border-radius: 8px; background: #fff; min-height: 104px; transition: border-color .15s, background .15s; }
.calc-card:hover { border-color: var(--brand); }
.calc-card.selected { border: 2px solid var(--brand); background: #e6f4ef; box-shadow: 0 0 0 3px #0c746226; }
.calc-card.selected .calc-card-name::before { content: "✓ "; color: var(--brand); }
.calc-card.placeholder { background: #f3f5f4; border-style: dashed; color: #8a9893; }
.calc-card.placeholder.selected { background: #eceff0; border-color: #8a9893; box-shadow: none; }
.calc-card-name { font-weight: 700; font-size: 14px; color: #172c28; }
.calc-card.placeholder .calc-card-name { color: #7b8a86; }
.calc-card-price { font-size: 12px; color: #36514b; line-height: 1.5; }
.calc-date { display: inline-block; font-size: 11px; color: #08765c; background: #e2f3ec; border-radius: 4px; padding: 2px 6px; font-weight: 600; }
.calc-date.none { color: #7b8a86; background: #eef2f1; }
.calc-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 12px; }
.calc-dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.calc-zones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: #36514b; }
.calc-zone { border: 1px solid var(--line); background: #fff; padding: 7px 12px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.calc-zone small { font-size: 11px; color: var(--muted); font-weight: 400; }
.calc-zone.selected { background: var(--deep-2); color: #fff; border-color: var(--deep-2); }
.calc-zone.selected small { color: #d8e8e2; }
.calc-zones em { font-style: normal; color: var(--muted); font-size: 12px; }
.calc-card-label { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.calc-zone.est { border-style: dashed; }
.calc-zone small.calc-est-mark { background: #fbe9c8; color: #8a5a00; padding: 0 4px; font-weight: 700; }
.calc-zone small.calc-default-mark { background: #dcefe7; color: #1f5a49; padding: 0 4px; font-weight: 700; }
.calc-zone-reason { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.calc-set-default { margin-left: 8px; vertical-align: baseline; border: 1px solid var(--deep); background: #e0f3ec; color: var(--deep); padding: 2px 8px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 4px; }
.calc-set-default:hover:not(:disabled) { background: var(--deep); color: #fff; }
.calc-set-default:disabled { opacity: 0.55; cursor: default; background: #eef4f1; border-color: #b7c9c1; color: #5b746c; }
.calc-src { display: inline-block; padding: 0 5px; font-size: 12px; font-weight: 600; }
.calc-src.official { background: #dcefe7; color: #1f5a49; }
.calc-src.estimated { background: #fbe9c8; color: #8a5a00; }
.calc-src.measured { background: #e3e6fb; color: #2f3c8f; }
.calc-zone-table th.calc-est, .calc-zone-table td.estimated { background: #fdf4e3; color: #8a5a00; }
.calc-zone-table td.measured { background: #eceefc; color: #2f3c8f; font-weight: 700; }
.calc-zone-table th small { margin-left: 3px; font-size: 11px; }
.calc-legend { font-size: 12px; color: var(--muted); margin: 8px 0; }
.calc-origin ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.calc-ref { margin: 12px 0 0; }
.calc-ref img { display: block; max-width: 100%; border: 1px solid var(--line); cursor: zoom-in; }
.calc-ref figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.calc-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.calc-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #36514b; }
.calc-hero { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 8px; background: #e6f4ef; margin-bottom: 14px; }
.calc-hero.negative { background: #fde7e5; }
.calc-hero span { display: block; color: var(--muted); font-size: 12px; }
.calc-hero strong { font-size: 34px; line-height: 1.15; color: var(--brand); }
.calc-hero.negative strong { color: var(--danger); }
.calc-hero-meta { font-size: 13px; color: #36514b; line-height: 1.8; }
.calc-formula { color: #4b635e; }
.calc-value { font-weight: 700; white-space: nowrap; }
.positive { color: var(--brand); }
.negative { color: var(--danger); }
.calc-table { min-width: 0; }
.calc-fold { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.calc-fold summary { cursor: pointer; padding: 11px 14px; font-weight: 650; color: var(--deep-2); }
.calc-rules { padding: 10px 14px; }
.calc-rules p { margin: 4px 0; font-size: 13px; color: #36514b; }
@media (max-width: 1100px) { .calc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .calc-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .calc-dims-field { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .calc-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-card { min-height: 0; padding: 10px; }
  .calc-hero { grid-template-columns: 1fr 1fr; }
  .calc-hero-meta { grid-column: 1 / -1; }
  .calc-hero strong { font-size: 26px; }
  .calc-form-foot { flex-wrap: wrap; }
}

/* V1.5.0 员工入口 */
.calc-actions, .staff-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.calc-login { max-width: 420px; display: grid; gap: 12px; }
.account-hint { margin: 8px 0 0; color: var(--muted, #667085); font-size: 13px; }
.account-generated { margin: 12px 0; padding: 10px 12px; border: 1px dashed #f79009; border-radius: 8px; background: #fffaeb; display: grid; gap: 6px; }
.account-generated code { font-size: 16px; word-break: break-all; user-select: all; }
.form-error:not([hidden]) { color: #b42318; }
.button.danger { background: #fff; color: #b42318; border: 1px solid #f3b8b2; }
.button.danger:hover { background: #fde7e5; }
.staff-perms { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; }
.staff-perm { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.staff-row { border: 1px solid var(--line, #e4e7ec); border-radius: 8px; padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; }
.staff-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.staff-head small { color: var(--muted, #667085); margin-left: auto; }
.staff-edit, .staff-pw { display: grid; gap: 6px; }
.staff-edit .field, .staff-pw .field { max-width: 320px; }
.staff-edit > .button { justify-self: start; }
.top-user { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.top-user svg { width: 16px; height: 16px; }
@media (max-width: 760px) { #top-user-name { display: none; } }

/* V1.5.1 统一登录页 + 主账号/员工身份 */
[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, var(--deep), #1f6b4f); }
.login-card { width: 400px; max-width: 100%; background: #fff; border-radius: 12px; padding: 36px; box-shadow: 0 12px 40px #0003; display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-bottom: 10px; }
.login-brand strong { color: var(--deep); font-size: 22px; margin-top: 6px; }
.login-brand small { color: var(--muted); font-size: 12px; }
.login-card .field input { width: 100%; }
.login-submit { width: 100%; padding: 11px; font-size: 16px; margin-top: 8px; }
.login-note { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.nav-sep { border-top: 1px solid #ffffff22; margin: 10px 6px; }
.nav-tag { font-size: 10px; background: var(--gold); color: var(--deep); padding: 1px 6px; border-radius: 3px; margin-left: auto; font-weight: 700; }
.top-user { display: inline-flex; align-items: center; gap: 12px; }
.user-badge { background: #e6f2ec; color: var(--deep-2); padding: 5px 12px; border-radius: 14px; font-weight: 650; white-space: nowrap; }
.staff-table { width: 100%; border-collapse: collapse; }
.staff-table th, .staff-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.staff-table th { color: var(--muted); font-weight: 600; background: #f8faf9; font-size: 13px; }
.staff-ops { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.link-btn.danger { color: var(--danger); }
.staff-on { color: var(--brand); } .staff-off { color: var(--danger); }
.staff-editor td { background: #f8fbfa; }
.staff-editor form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.staff-form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .staff-form-row { grid-template-columns: 1fr; } .staff-table-wrap { overflow-x: auto; } }
.staff-table tr.staff-row { display: table-row; border: 0; border-radius: 0; padding: 0; margin: 0; }
/* V1.5.2 规则参考：海鸥 / 云顶并排紧凑对照 */
.calc-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 12px 12px; }
.calc-rule-col { min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.calc-rule-col h4 { margin: 2px 0 8px; font-size: 14px; color: var(--deep-2); }
.calc-rule-col h4 small { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 12px; }
.calc-rule-table { font-size: 12.5px; }
.calc-rule-table th, .calc-rule-table td { padding: 5px 8px; height: 30px; box-sizing: border-box; white-space: nowrap; }
.calc-rule-table td:first-child { white-space: normal; }
.calc-rule-table td small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-rule-table tr.calc-rule-first td { border-top: 1px solid var(--line); }
.calc-rule-table tr.calc-rule-pad td { color: var(--muted); }
.calc-rule-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 2px; font-size: 12.5px; line-height: 1.5; }
.calc-rule-facts dt { font-weight: 650; color: var(--deep-2); white-space: nowrap; }
.calc-rule-facts dd { margin: 0; color: var(--ink, #333); }
@media (max-width: 900px) { .calc-rule-grid { grid-template-columns: 1fr; } }
.calc-weight { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 12px 0; background: #fbfcfb; }
.calc-weight-title { font-weight: 700; color: var(--deep-2); margin-bottom: 6px; }
.calc-weight dl { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.calc-weight dl > div { display: flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 6px; background: #f1f4f2; }
.calc-weight dt { font-weight: 650; color: var(--muted); }
.calc-weight dd { margin: 0; }
.calc-weight dl > div.pick { background: #fff4d6; outline: 1px solid #f0c75e; }
.calc-weight dl > div.pick dd { font-weight: 700; }
.calc-weight-final { background: #e3f2ec !important; }
.calc-weight-final strong { color: var(--deep-2); font-size: 15px; }
.calc-rule-table { min-width: 0 !important; width: 100%; table-layout: fixed; }
.calc-rule-table th:nth-child(1) { width: 44%; } .calc-rule-table th:nth-child(2) { width: 26%; } .calc-rule-table th:nth-child(3), .calc-rule-table th:nth-child(4) { width: 15%; }
.calc-rule-table td { height: 28px; }
.calc-rule-table td.calc-rule-name { vertical-align: middle; border-right: 1px solid var(--line); }
.calc-rule-table tr.calc-rule-pad td { background: #fafbfa; }

/* V1.5.3 记住密码 */
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #36514b; margin: 2px 0 4px; cursor: pointer; }
.login-remember input { width: 16px; height: 16px; accent-color: var(--brand); }

/* V1.5.4 计算器两栏一屏（深绿主题）：左 45% 仓库切换 + 渠道卡片 + 输入；右 55% 吸顶结果 */
.calc-work { display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.calc-work .section { margin-bottom: 0; }
.calc-right { position: sticky; top: 12px; }
.calc-work .section-heading { padding: 10px 14px; }
.calc-work .section-body { padding: 10px 14px; }
.calc-work .calc-pick-body { padding-bottom: 0; }
.calc-wh-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.calc-wh-tab { padding: 8px; border: 1.5px solid #cbdad6; background: #fff; color: #657873; font-weight: 700; font-size: 14px; cursor: pointer; }
.calc-wh-tab + .calc-wh-tab { border-left: 0; }
.calc-wh-tab.on { background: var(--deep); border-color: var(--deep); color: #fff; }
.calc-groups { display: block; }
.calc-group[hidden] { display: none; }
.calc-group-title { display: none; }
.calc-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
.calc-card { min-height: 0; padding: 7px 10px; gap: 2px; opacity: .6; border: 1.5px solid #d5e0dd; }
.calc-card:hover { opacity: 1; }
.calc-card-name { font-size: 13px; }
.calc-card-price { font-size: 12px; line-height: 1.35; }
.calc-card-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 11px; }
.calc-card .calc-date { display: none; }
.calc-card.selected { opacity: 1; border: 3px solid var(--deep); background: #e0f3ec; box-shadow: 0 0 0 3px #0c746226; }
.calc-card.selected .calc-card-name, .calc-card.selected .calc-card-name::before { color: var(--deep); }
.calc-card.selected .calc-card-name::before { content: "✓ "; font-weight: 800; }
.calc-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; margin: 0 0 10px; border-left: 8px solid var(--deep); background: #e0f3ec; border-radius: 6px; }
.section-heading .calc-pick { margin: 4px 0 0; padding: 3px 10px; border-left-width: 5px; }
.calc-pick-check { color: var(--deep); font-weight: 900; font-size: 20px; }
.calc-pick-name { font-size: 22px; color: var(--deep); }
.section-heading .calc-pick-name { font-size: 14px; }
.section-heading .calc-pick-check { font-size: 14px; }
.calc-pick-meta { flex-basis: 100%; font-size: 14px; color: #24413b; font-weight: 600; }
.calc-stale { margin: 0; padding: 12px; background: #fff4d6; border: 1px solid #e7b84a; border-radius: 6px; font-weight: 700; color: #8a5a00; }
.calc-work .calc-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.calc-work .calc-dims-field { grid-column: 1 / -1; }
.calc-work .field input { padding: 7px 9px; }
.calc-work .calc-zones { gap: 4px; margin-top: 10px; }
.calc-work .calc-zone.selected small.calc-default-mark { background: #dcefe7; color: var(--deep); }
.calc-work .calc-hero { grid-template-columns: 1fr 1fr; padding: 10px 16px; gap: 10px; margin-bottom: 10px; }
.calc-work .calc-hero-meta { display: none; }
.calc-work .calc-hero strong { font-size: 32px; }
.calc-work .calc-weight { margin: 0 0 10px; padding: 8px 12px; }
.calc-work .data-table { min-width: 0; }
.calc-work .data-table th, .calc-work .data-table td { padding: 6px 8px; font-size: 12.5px; }
.calc-version { margin-bottom: 10px; padding: 7px 12px; }
@media (max-width: 1100px) { .calc-work { grid-template-columns: 1fr; } .calc-right { position: static; } }


/* V1.5.6 固定均价尾程 */
.calc-zone-flat { gap: 4px; }
.calc-flat-wrap { display: inline-flex; align-items: center; gap: 0; font-weight: 700; }
.calc-flat-usd { width: 4.2em; margin-left: 2px; padding: 2px 4px; border: 1px solid #9bb8ad; border-radius: 3px; font: inherit; font-weight: 700; color: inherit; background: #fff; }
.calc-zone-flat.selected .calc-flat-usd { border-color: #cfe6dc; background: #e8f6f0; color: var(--deep); }
.calc-flat-hint { margin: 4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.calc-src.flat { background: #e8f0ff; color: #234a8a; }

/* V1.5.7 本地仓备货：沿用 section/button/field/tag/summary/table 组件。 */
.local-stock-rules { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; }
.local-stock-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.local-stock-input { display: flex; align-items: center; gap: 7px; }
.local-stock-input input { flex: 1; width: 70px; }
.local-stock-input > span { flex: none; font-size: 12px; color: var(--muted); font-weight: 400; }
.local-stock-formula { background: var(--ground); border: 1px dashed var(--line); border-radius: 6px; padding: 15px; font-size: 12px; line-height: 1.9; }
.local-stock-formula > strong { color: var(--deep); }
.local-stock-formula p { margin: 8px 0; }
.local-stock-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.local-stock-stats .summary-item { border-bottom: 0; }
.local-stock-high { color: #bc641e; }
.tag.orange { background: #fff0e1; color: #a75719; }
.local-stock-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.local-stock-toolbar { justify-content: space-between; }
.local-stock-source { margin: 12px 0 0; font-size: 12px; }
.local-stock-table { min-width: 1130px; }
.local-stock-table th, .local-stock-table td { padding: 12px 10px; }
.local-stock-table td:first-child, .local-stock-table th { white-space: nowrap; }
.local-stock-table td:nth-child(n+3):nth-child(-n+7), .local-stock-table th:nth-child(n+3):nth-child(-n+7), .local-stock-quantity { text-align: right; font-variant-numeric: tabular-nums; }
.local-stock-table td:nth-child(2) { min-width: 150px; }
.local-stock-table td:last-child { width: 122px; }
@media (max-width: 1250px) { .local-stock-rules { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .local-stock-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .local-stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .local-stock-stats .summary-item:last-child { grid-column: auto; }
  .local-stock-stats .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .local-stock-rules { gap: 16px; }
}
