:root {
  color-scheme: light;
  --bg: #f2f6fb;
  --surface: #fff;
  --surface-soft: #f7faff;
  --line: #dbe4ee;
  --text: #17283e;
  --muted: #687b91;
  --blue: #2563dc;
  --green: #1ca886;
  --orange: #e9912f;
  --red: #d94a58;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 92% 0, rgba(73,190,166,.1), transparent 30rem), var(--bg); font-size: 14px; }
button, input, select { font: inherit; }
/* 下拉的样子统一写在 workbench.css「下拉收起态」一节（D-405 第二批）。这里原有一条带 !important 的全局规则，
   把所有下拉右留白撑到 40px、箭头用旧蓝灰色，各页自己的尺寸因此全部失效。 */
button { cursor: pointer; }
[hidden] { display: none !important; }
.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; }
.brand-label { width: max-content; padding: 5px 10px; border-radius: 999px; color: white; background: linear-gradient(135deg,#3185ec,#1760d1); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.section-kicker { margin: 0 0 6px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 18px 20px; border-right: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(16px); }
.admin-brand { display: grid; justify-items: start; color: inherit; text-decoration: none; padding: 0 8px 25px; border-bottom: 1px solid var(--line); }
.admin-brand strong { margin-top: 12px; font-size: 17px; }
.admin-brand strong span { color: var(--orange); }
.admin-brand small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.sidebar nav { display: grid; gap: 7px; margin-top: 24px; }
.nav-item { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 13px; color: #52667c; border: 0; border-radius: 11px; background: transparent; text-align: left; font-size: 13px; font-weight: 700; }
.nav-item span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: #edf3fa; font-weight: 900; }
.nav-item:hover { color: var(--text); background: #f5f8fc; }
.nav-item.is-active { color: #1553bd; background: #edf4ff; }
.nav-item.is-active span { color: white; background: var(--blue); }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.sidebar-foot span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sidebar-foot i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sidebar-foot .session-state { display: grid; grid-template-columns: auto 1fr; }
.sidebar-foot .session-state i { grid-row: 1 / 3; align-self: center; }
.sidebar-foot .session-state b { color: #405873; font-size: 12px; }
.sidebar-foot .session-state small { color: var(--muted); font-size: 12px; }
.sidebar-foot button { width: max-content; min-height: 36px; padding: 0 12px; color: #52677d; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 12px; font-weight: 800; }

.main-area { min-width: 0; padding: 26px clamp(20px, 3vw, 42px) 42px; }
/* 内容区封顶 1280（GitHub Primer container-xl / Linear 同值，2026-09-24 Lemon 定）：宽屏多出来的当页边距，不再让表格吃掉整块屏。 */
.main-area .topbar, .main-area .view { max-width: 1280px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.sync-time { color: var(--muted); font-size: 12px; }
.ghost-button, .text-button { border: 0; background: none; color: var(--blue); font-size: 12px; font-weight: 800; }
.ghost-button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #405873; }
.ghost-button:disabled { cursor: wait; opacity: .7; }
.ghost-button.is-loading::before { content: ""; width: 10px; height: 10px; display: inline-block; margin-right: 6px; border: 2px solid #b7c6d8; border-top-color: #405873; border-radius: 50%; vertical-align: -2px; animation: refresh-spin .7s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
.view { min-width: 0; display: grid; gap: 18px; }
.metrics-grid { display: grid; gap: 18px; }
.metric-group { display: grid; gap: 9px; }
.metric-group-title { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.metric-card { min-height: 118px; position: relative; overflow: hidden; padding: 19px; border: 1px solid var(--line); border-radius: 16px; color: inherit; background: var(--surface); box-shadow: 0 12px 30px rgba(50,78,112,.05); text-align: left; }
.metric-card:hover, .metric-card:focus-visible { border-color: #9cb9df; box-shadow: 0 15px 34px rgba(50,78,112,.1); outline: none; }
.metric-card::after { content: ""; position: absolute; width: 75px; height: 75px; right: -24px; top: -28px; border-radius: 50%; background: var(--metric-color, #eaf2ff); }
.metric-card > span { display: block; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 9px; font-size: 27px; letter-spacing: -.03em; }
.metric-card small { display: block; margin-top: 6px; color: #78899d; font-size: 12px; line-height: 1.4; }
.readiness-list { display: grid; gap: 0; }
.readiness-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.readiness-row:last-child { border-bottom: 0; }
.readiness-row strong, .readiness-row small { display: block; }
.readiness-row strong { font-size: 13px; }.readiness-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.readiness-blocked strong { color: var(--red); }.readiness-action { flex: none; }.readiness-ok { color: var(--green); font-weight: 900; }
.stock-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; }
.stock-card { padding: 21px; }
.stock-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.stock-summary div { padding: 14px; border-radius: 12px; background: var(--surface-soft); }
.stock-summary span { display: block; color: var(--muted); font-size: 12px; }
.stock-summary strong { display: block; margin-top: 5px; font-size: 24px; }
.stock-definition { margin-bottom: 8px; }
.provider-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 16px; }
.provider-summary > div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.provider-summary span, .provider-summary small { color: var(--muted); font-size: 12px; line-height: 1.45; }.provider-summary strong { display: block; margin-top: 3px; font-size: 16px; }
.provider-summary > small, .provider-summary > p { grid-column: 1 / -1; margin: 0; }.provider-warning { color: #b42318 !important; font-weight: 800; }
.threshold-form > div { display: flex; gap: 8px; margin-top: 7px; }.threshold-form input { width: 110px; }
.stock-settings-details { border-top: 1px solid var(--line); padding-top: 12px; }
.stock-settings-details > summary, .stock-advanced-details > summary { cursor: pointer; color: #405873; font-size: 13px; font-weight: 800; }
.stock-settings-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 14px; }
.stock-advanced-details { padding: 18px 21px; }
.stock-advanced-details[open] > summary { margin-bottom: 14px; }
.advanced-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.advanced-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.stock-open-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stock-open-form label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.stock-open-form input, .stock-open-form select, .threshold-form input { min-height: 34px; border: 1px solid var(--wb-bd); border-radius: 9px; padding: 0 11px; color: var(--wb-t); background: var(--wb-s); }
.stock-presets { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stock-presets > span { margin-right: 2px; color: var(--muted); font-size: 12px; }
.stock-preset { min-width: 60px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #405873; font-weight: 800; }
.stock-preset:hover, .stock-preset.is-active { border-color: #5279a8; background: #edf4fc; color: #234f7f; }
.stock-card-profile { min-height: 40px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 2px 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.stock-card-type-label { grid-column: 1 / -1; align-items: start; }
.stock-card-type-label select { width: min(100%, 310px); }
.stock-card-profile { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.stock-card-profile > div { min-width: 0; padding-right: 10px; border-right: 1px solid var(--line); }
.stock-card-profile > div:nth-child(3) { padding-right: 0; border-right: 0; }
.stock-card-profile span { display: block; color: var(--muted); font-size: 12px; }
.stock-card-profile strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.stock-card-profile p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.stock-confirm-label, .stock-cost, .danger-button { grid-column: 1 / -1; }
.stock-cost { display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px; background: #fff7e8; color: #9a5b00; font-weight: 800; }
.stock-cost strong { font-size: 14px; }.stock-cost small { font-size: 12px; font-weight: 600; line-height: 1.45; }.stock-cost-warning { background: #fff0ef; color: #b42318; }
.danger-button { min-height: 44px; border: 0; border-radius: 10px; background: #b42318; color: white; font-weight: 800; }
.danger-button:disabled { cursor: not-allowed; opacity: .45; }
.stock-card-list strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.stock-card-list [data-card] { cursor: pointer; }
.stock-card-list [data-card]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.metric-1 { --metric-color: #fff1de; }.metric-2 { --metric-color: #eaf2ff; }.metric-3 { --metric-color: #fff0e7; }.metric-4 { --metric-color: #e5f7f2; }
.dashboard-grid { min-width: 0; display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.92); box-shadow: 0 14px 36px rgba(50,78,112,.05); }
.status-card, .settings-card, .recent-card, .orders-card { padding: 20px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.alerts-card .card-heading { align-items: center; }
.stock-card-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.card-heading h2 { margin: 0; font-size: 16px; }
.readonly-badge { padding: 5px 8px; border-radius: 999px; color: var(--green); background: #e9f8f4; font-size: 12px; font-weight: 800; }
.write-badge { padding: 5px 8px; border-radius: 999px; color: #9a611a; background: #fff2df; font-size: 12px; font-weight: 800; }
.card-description { max-width: 720px; margin: -2px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.intake-explanation { margin: 0 0 10px; padding: 10px 12px; border-radius: 9px; color: #52677d; background: #edf4fc; font-size: 12px; line-height: 1.55; }
.status-list { display: grid; gap: 10px; }
.mini-list-heading { margin: 8px 0 4px; color: var(--muted); font-size: 12px; font-weight: 800; }
.overview-secondary-grid { align-items: stretch; }
.alerts-card .card-heading, .alerts-card .mini-list { max-width: 960px; }
.alerts-card .mini-list > div { justify-content: flex-start; }
.alerts-card .mini-list > div > em { margin-left: auto; }
.status-list > button { display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: left; }
.status-list > button > span { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-list strong { font-size: 12px; }
.status-bar { width: 100%; height: 4px; overflow: hidden; border: 0; border-radius: 999px; background: #edf2f7; appearance: none; }
.status-bar::-webkit-progress-bar { border-radius: inherit; background: #edf2f7; }
.status-bar::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg,#4b8dea,#32b594); }
.status-bar::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg,#4b8dea,#32b594); }
.status-chip { width: max-content; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-blue { color: #2863c8; background: #edf4ff; }.status-green { color: #168368; background: #e9f8f3; }.status-orange { color: #aa691c; background: #fff4e5; }.status-red { color: #b23b47; background: #fff0f1; }.status-gray { color: #66798d; background: #eef2f6; }
.setting-list { display: grid; }
.setting-list > div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #edf1f5; }
.setting-list > div:last-child { border: 0; }
.setting-list strong, .setting-list small { display: block; }
.setting-list strong { font-size: 13px; }.setting-list small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.segmented-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.switch-state { padding: 5px 8px; border-radius: 999px; color: #8b5960; background: #fff0f1; font-size: 12px; font-style: normal; font-weight: 800; }
.switch-state.is-on { color: #168368; background: #e9f8f3; }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 0 11px 10px; color: #8291a2; text-align: left; font-weight: 700; white-space: nowrap; }
td { padding: 12px 11px; border-top: 1px solid #edf1f5; color: #53677d; white-space: nowrap; }
.order-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 16px; }
.order-summary-item { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 12px 13px; border: 1px solid var(--wb-bd); border-radius: 12px; background: var(--wb-s); text-align: left; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.order-summary-item:hover, .order-summary-item:focus-visible { border-color: var(--wb-a-soft); background: var(--wb-s2); box-shadow: var(--wb-shadow); }
.order-summary-item.is-active { border-color: var(--wb-a); background: var(--wb-a-soft); box-shadow: inset 0 0 0 1px var(--wb-a); }
.order-summary-item span { color: var(--muted); font-size: 12px; font-weight: 700; }
.order-summary-item strong { grid-row: span 2; align-self: center; color: var(--ink); font-size: 21px; font-variant-numeric: tabular-nums; }
.order-summary-item small { color: var(--muted); font-size: 12px; }
.order-card-link { padding: 0; border: 0; background: transparent; color: var(--wb-a-ink); font-size: 12px; font-weight: 800; text-align: left; cursor: pointer; }
.order-card-link:hover { background: transparent; text-decoration: underline; }
.cell-muted { color: var(--wb-t3); }
tbody tr[data-order] { cursor: pointer; outline: none; }
tbody tr[data-order]:hover, tbody tr[data-order]:focus { background: #f7faff; }
.order-link { color: #245bb8; font-size: 12px; }
.attention-note { margin-top: 5px !important; color: #b42318 !important; font-weight: 800; }
.cell-main, td small { display: block; }.cell-main { color: #30465d; }.cell-main + small { margin-top: 4px; color: #7d8c9d; font-size: 12px; }
.empty-cell, .empty-state, .loading-state { padding: 26px 10px; color: #8c9aaa; text-align: center; font-size: 12px; }

.filters { display: grid; grid-template-columns: minmax(260px, 1fr) 170px 150px 145px 145px auto; gap: 10px; margin-bottom: 18px; }
.batch-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.batch-toolbar > span { margin-right: auto; font-weight: 800; }
.reconciliation-filters { grid-template-columns: 190px 190px auto; }
.case-actions { display: flex; align-items: center; gap: 8px; }
.login-card input { width: 100%; height: 42px; padding: 0 12px; color: var(--text); border: 1px solid #cfdbe8; border-radius: 10px; outline: none; background: #f8fbff; }
.login-card input:focus { border-color: #4f86de; box-shadow: 0 0 0 3px rgba(53,111,208,.1); background: white; }
/* 后台筛选与表单输入框跟下拉一起降到 34（D-405 第二批：原 42，与下拉一高一矮）；登录页那一个不动 */
.filters input, .filters select { width: 100%; height: 34px; padding: 0 11px; color: var(--wb-t); border: 1px solid var(--wb-bd); border-radius: 9px; outline: none; background: var(--wb-s); }
.filters input:focus-visible { border-color: var(--wb-a); box-shadow: 0 0 0 3px var(--wb-a-soft); }
/* 按钮跟字段下沿对齐：带可见标签的表单（导入卡、账单地址）里，grid 会把按钮拉成「标签 + 字段」那么高（原先约 61px） */
.filters .primary-small { min-height: 34px; align-self: end; }
.primary-small, .primary-button { border: 0; border-radius: 10px; color: white; background: linear-gradient(135deg,#2f7aeb,#2256cb); font-weight: 800; }
.primary-small { padding: 0 20px; }
.danger-small { min-height: 36px; padding: 0 14px; border: 1px solid #efb8bd; border-radius: 10px; color: #a8323e; background: #fff2f3; font-weight: 800; }
.danger-small:disabled, .primary-small:disabled { cursor: default; opacity: .55; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; align-items: center; gap: 10px; }
.pagination button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: #53677d; background: white; font-size: 12px; }
.pagination button:disabled { cursor: default; opacity: .45; }
.page-notice { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1100; width: max-content; max-width: calc(100vw - 32px); padding: 14px 16px; border: 1px solid var(--wb-danger); border-radius: 9px; color: var(--wb-danger); background: var(--wb-danger-soft); box-shadow: var(--wb-shadow); font-size: 14px; font-weight: 600; line-height: 1.5; }
.page-notice[data-tone="success"] { border-color: #9bd9bd; color: #176943; background: #effbf5; }
.page-notice[data-tone="warning"] { border-color: #eccb8e; color: #85530b; background: #fff9eb; }

.detail-drawer { width: min(560px, 100%); height: 100vh; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--line); background: white; box-shadow: -24px 0 60px rgba(32,55,82,.16); }
.detail-drawer::backdrop { background: rgba(23,40,62,.28); }
.drawer-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.drawer-heading h2 { margin: 0; font-size: 17px; }
.close-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: #607388; background: white; font-size: 20px; }
#detail-content { padding: 20px 24px 40px; }
.detail-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.detail-evidence { margin-top: 4px; border-top: 1px solid var(--line); }
.detail-evidence > summary { padding: 16px 0; cursor: pointer; color: #405873; font-size: 13px; font-weight: 800; }
.detail-evidence[open] > summary { margin-bottom: 0; }
.detail-evidence .detail-section:last-child { border-bottom: 0; }
.detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-section:first-child { padding-top: 0; }.detail-section:last-child { border: 0; }
.detail-section h3 { margin: 0 0 13px; font-size: 13px; }
.detail-status { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.key-values { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.key-values div { min-width: 0; padding: 11px; border-radius: 10px; background: var(--surface-soft); }
.key-values dt { color: #718398; font-size: 12px; }.key-values dd { margin: 6px 0 0; color: #30465d; overflow-wrap: anywhere; font-size: 12px; }
.timeline { display: grid; gap: 14px; }
.timeline article { display: grid; grid-template-columns: 10px 1fr; gap: 11px; }
.timeline article > i { width: 8px; height: 8px; margin-top: 3px; border: 2px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px #bfe8dc; }
.timeline strong { font-size: 12px; }.timeline p { margin: 4px 0; color: #53677d; font-size: 12px; line-height: 1.5; }.timeline small { color: #7d8c9d; font-size: 12px; }
.mini-list { display: grid; }.mini-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f5; }
.mini-list strong, .mini-list small { display: block; }.mini-list strong { font-size: 12px; }.mini-list small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }.mini-list em { color: var(--blue); font-size: 12px; font-style: normal; font-weight: 800; }

.login-body { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, rgba(255,157,63,.11), transparent 25rem), radial-gradient(circle at 90% 5%, rgba(37,99,220,.11), transparent 30rem), var(--bg); }
.login-shell { width: min(900px, 100%); min-height: 500px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: 0 30px 80px rgba(40,65,95,.12); }
.login-brand { display: flex; flex-direction: column; justify-content: center; padding: 54px; background: radial-gradient(circle at 10% 90%, rgba(44,190,166,.12), transparent 18rem), radial-gradient(circle at 95% 8%, rgba(60,120,221,.12), transparent 22rem); }
.login-brand h1 { margin: 18px 0 0; font-size: 42px; letter-spacing: -.045em; }.login-brand > p { margin: 15px 0 0; color: var(--muted); }
.login-points { display: grid; gap: 10px; margin-top: 36px; color: #50657b; font-size: 12px; }.login-points span { display: flex; align-items: center; gap: 9px; }.login-points i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.login-card { align-self: center; margin: 30px; padding: 30px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 18px 45px rgba(50,78,112,.07); }.login-card h2 { margin: 0; font-size: 20px; }.login-card > p:not(.section-kicker) { margin: 8px 0 24px; color: var(--muted); font-size: 13px; }.login-card form { display: grid; gap: 10px; }.login-card label { font-size: 13px; font-weight: 800; }.primary-button { min-height: 44px; margin-top: 7px; }.primary-button:disabled { opacity: .6; cursor: wait; }.notice { margin-top: 12px; padding: 10px 12px; border: 1px solid #efb8bd; border-radius: 9px; color: #a8323e; background: #fff2f3; font-size: 12px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }.sidebar { min-width: 0; position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 14px 18px; overflow: hidden; }.admin-brand { min-width: 0; padding: 0; border: 0; }.admin-brand .brand-label, .admin-brand small { display: none; }.admin-brand strong { margin: 0; }.sidebar nav { min-width: 0; max-width: 100%; grid-column: 1 / -1; grid-row: 2; display: flex; margin: 14px 0 0; overflow-x: auto; }.nav-item { flex: none; }.sidebar-foot { align-self: center; padding: 0; border: 0; }.sidebar-foot .session-state { display: none; }.main-area { min-width: 0; padding-top: 20px; }.metrics-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.dashboard-grid, .stock-grid { grid-template-columns: minmax(0, 1fr); }.filters { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }.filters .search-field { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; }.sync-time { display: none; }.metrics-grid { gap: 9px; }.metric-card { min-height: 105px; padding: 15px; }.dashboard-grid, .view { gap: 12px; }.status-card, .settings-card, .recent-card, .orders-card, .stock-card { padding: 15px; }.filters, .stock-open-form, .stock-settings-body { grid-template-columns: 1fr; }.batch-toolbar, .advanced-heading { align-items: flex-start; flex-wrap: wrap; }.stock-open-form > * { grid-column: 1 !important; }.stock-card-type-label select { width: 100%; }.stock-card-profile { grid-template-columns: 1fr; }.stock-card-profile > div { padding: 0 0 9px; border-right: 0; border-bottom: 1px solid var(--line); }.stock-card-profile > div:nth-child(3) { padding-bottom: 0; border-bottom: 0; }.primary-small { min-height: 40px; }.pagination { align-items: flex-start; }.key-values { grid-template-columns: 1fr; }.detail-drawer { width: 100%; }.login-body { padding: 12px; }.login-shell { grid-template-columns: 1fr; }.login-brand { padding: 30px; }.login-brand h1 { font-size: 32px; }.login-points { display: none; }.login-card { margin: 0 18px 24px; padding: 24px; }.order-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* order execution timeline (Browser stage events) */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; align-items: baseline; padding: 6px 8px; border-left: 3px solid var(--line, #d9d9d9); }
.timeline-item time { font-variant-numeric: tabular-nums; color: var(--muted, #666); font-size: 12px; }
.timeline-item small { grid-column: 2; color: var(--muted, #666); }
.timeline-freeze { border-left-color: var(--danger, #c0392b); }
.timeline-checkpoint { border-left-color: var(--accent, #2f6fed); }

/* home: five decisions */
.decisions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.decision { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line, #e3e3e3); border-radius: 10px; background: var(--card, #fff); }
.decision strong { font-size: 14px; }
.decision small { color: var(--muted, #666); line-height: 1.4; }
.decision .segmented-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.decision select { max-width: 100%; }
.metrics-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.filters-compact { grid-template-columns: minmax(260px, 1fr) 170px auto auto; align-items: center; }
.drawer-summary .detail-status { margin-bottom: 10px; }
.drawer-action-line { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff4ed; color: #b42318; font-size: 12px; font-weight: 800; line-height: 1.5; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-actions > small { color: #8c9aaa; font-size: 12px; }
.drawer-hint { display: block; margin-top: 8px; color: #718398; font-size: 12px; }
.stock-settings-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.stock-inline-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.stock-inline-details > summary { cursor: pointer; color: #405873; font-size: 13px; font-weight: 800; }
.stock-inline-details[open] > summary { margin-bottom: 12px; }
.filters-two { grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) auto; }
.stock-advanced-details > .filters { margin-top: 4px; }
#diagnostics-heartbeat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#diagnostics-heartbeat small { display: block; margin-top: 4px; }

/* askForm：单个对话框收完一次操作的全部输入（替代连环 confirm/prompt） */
.ask-dialog { width: min(480px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 16px; background: white; box-shadow: 0 24px 60px rgba(23,40,62,.22); }
.ask-dialog::backdrop { background: rgba(23,40,62,.28); }
.ask-form { display: grid; gap: 14px; padding: 22px 24px 20px; }
/* 弹窗字色与输入框用工作台那一套（D-405 第二批：原为旧版蓝灰，蓝色选中框） */
.ask-form h3 { margin: 0; font-size: 16px; color: var(--wb-t); }
.ask-message { margin: 0; font-size: 13px; line-height: 1.6; color: var(--wb-t2); }
.ask-field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--wb-t2); }
.ask-field small { font-weight: 400; color: var(--wb-t3); }
.ask-field input, .ask-field select, .ask-field textarea { width: 100%; padding: 0 11px; border: 1px solid var(--wb-bd); border-radius: 9px; font: inherit; font-size: 13px; font-weight: 500; color: var(--wb-t); background: var(--wb-s); }
.ask-field input { height: 34px; }
.ask-field textarea { resize: vertical; min-height: 72px; padding: 8px 11px; }
.ask-field input:focus-visible, .ask-field textarea:focus-visible { outline: none; border-color: var(--wb-a); box-shadow: 0 0 0 3px var(--wb-a-soft); }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.ask-actions .primary-small, .ask-actions .danger-small { min-height: 36px; }
