:root {
  --xh-bg: #f6f8f9;
  --xh-panel: #ffffff;
  --xh-border: #e8e8e8;
  --xh-text: #1a1a1a;
  --xh-muted: #666;
  --xh-green: #00c17c;
  --xh-green-2: #00a86a;
  --xh-red: #e5484d;
  --xh-orange: #d97706;
  --xh-deep: #0f766e;
  --xh-deep-2: #087a65;
  --xh-deep-3: #0d7a6a;
  --xh-grad-a: #1aa88a;
  --xh-focus: #7ed9b8;
  --xh-soft: #eafaf3;
  --xh-soft-hi: #f0fdf8;
  --xh-soft-border: #d8efe4;
  --xh-soft-border-2: #9ee0c8;
  --xh-glow: rgba(0, 193, 124, .12);
  --xh-glow-soft: rgba(0, 193, 124, .16);
  --xh-glow-strong: rgba(0, 193, 124, .55);
  --xh-glow-deep: rgba(15, 118, 110, .08);
  --xh-glow-deep-mid: rgba(15, 118, 110, .28);
  --xh-glow-deep-hi: rgba(15, 118, 110, .42);
  --xh-sider-w: 228px;
  --xh-radius: 8px;
  --xh-font: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --xh-font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --xh-fs-caption: 11px;
  --xh-fs-meta: 12px;
  --xh-fs-body: 13px;
  --xh-fs-title: 14px;
  --xh-fs-dialog: 17px;
  --xh-fs-page: 20px;
  --xh-fs-kpi: 22px;
  --xh-lh-tight: 1.25;
  --xh-lh-body: 1.5;
  --xh-lh-note: 1.6;
  --xh-fw-regular: 400;
  --xh-fw-medium: 500;
  --xh-fw-semibold: 600;
  --xh-fw-bold: 700;
  --xh-text-secondary: #55616d;
  --xh-text-tertiary: #7c8992;
  --xh-shadow: 0 8px 28px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
html {
  scrollbar-width: thin;
  scrollbar-color: var(--xh-glow-deep-mid) transparent;
}
html::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: var(--xh-glow-deep-mid); border-radius: 999px; }
html::-webkit-scrollbar-thumb:hover { background: var(--xh-glow-deep-hi); }
html::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
body {
  font-family: var(--xh-font);
  font-size: var(--xh-fs-body);
  font-weight: var(--xh-fw-regular);
  line-height: var(--xh-lh-body);
  background: var(--xh-bg);
  color: var(--xh-text);
}
a { color: var(--xh-green); text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--xh-focus); outline-offset: 2px;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(14px, 2.4vh, 28px) 24px;
  position: relative;
  background:
    radial-gradient(900px 520px at 18% 12%, var(--xh-glow-soft), transparent 58%),
    linear-gradient(145deg, var(--xh-soft) 0%, var(--xh-soft-hi) 42%, var(--xh-soft) 100%);
}
.login-layout {
  width: calc(100vw - 48px);
  max-width: 1080px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.login-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 20px;
  box-shadow: 0 18px 48px rgba(0,0,0,.16);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.login-logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--xh-grad-a), var(--xh-deep-3));
}
.login-brand { font-size: 20px; font-weight: 700; color: var(--xh-deep); }
.login-title { margin: 0 0 5px; font-size: 25px; }
.login-sub { color: var(--xh-muted); margin: 0 0 18px; line-height: 1.55; }
.login-field { margin-bottom: 12px; }
.login-field label { display: block; margin-bottom: 5px; font-weight: 500; }
.login-field input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--xh-border); border-radius: 8px; background: #f8fafb;
}
.login-submit { width: 100%; height: 42px; margin-top: 4px; letter-spacing: .12em; }
.login-mobile-access {
  display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; align-items: center;
  margin-top: 14px; padding: 10px; border: 1px solid var(--xh-soft-border); border-radius: 12px;
  background: linear-gradient(135deg, var(--xh-soft-hi), var(--xh-soft-hi)); box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 6px 18px var(--xh-glow-deep);
}
.login-mobile-qr {
  box-sizing: border-box; width: 124px; height: 124px; padding: 3px; display: grid; place-items: center;
  border: 1px solid var(--xh-soft-border-2); border-radius: 10px; background: #fff; box-shadow: 0 3px 10px var(--xh-glow-deep);
}
.login-mobile-qr canvas, .login-mobile-qr img { display: block; width: 116px !important; height: 116px !important; }
.login-mobile-qr .empty { margin: 0; color: var(--xh-text-secondary); font-size: 11px; line-height: 1.45; text-align: center; }
.login-mobile-copy { min-width: 0; }
.login-mobile-kicker { margin: 0 0 2px; color: var(--xh-deep); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.login-mobile-copy h2 { margin: 0; color: var(--xh-text); font-size: 14px; line-height: 1.35; }
.login-mobile-tip { margin: 4px 0 6px; color: var(--xh-text-secondary); font-size: 11.5px; line-height: 1.45; }
.login-mobile-url { display: block; color: var(--xh-deep); font-size: 10.5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.4; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 2px; }
.login-mobile-url:hover { color: var(--xh-deep-2); }
.login-mobile-copy-btn { margin-top: 7px; border-color: var(--xh-soft-border-2); color: var(--xh-deep); background: #fff; }
.login-mobile-copy-btn:hover { background: var(--xh-soft); }
.login-links { margin-top: 14px; text-align: center; }
.login-roles { min-width: 0; background: #fff; border-radius: 14px; padding: 20px; box-shadow: var(--xh-shadow); }
.login-roles h2 { margin: 0 0 5px; font-size: 16px; }
.login-roles-tip { color: var(--xh-muted); margin: 0 0 10px; line-height: 1.5; }
.login-role-group-title { font-size: 12px; color: var(--xh-text-tertiary); margin: 8px 0 6px; }
.login-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.login-role-card {
  text-align: left; border: 1px solid var(--xh-border); background: var(--xh-soft-hi);
  border-radius: 10px; padding: 8px 9px; transition: all .15s;
}
.login-role-card:hover { border-color: var(--xh-green); box-shadow: 0 4px 14px var(--xh-glow); }
.login-role-card.active { border-color: var(--xh-green); background: var(--xh-soft-hi); }
.login-role-card strong { display: block; }
.login-role-cred { color: var(--xh-deep); font-size: 12px; }
.login-role-card em { display: block; color: var(--xh-text-tertiary); font-style: normal; font-size: 12px; }

/* 登录页预览条：模拟登录后右上角栏目 */
.login-preview { margin-top: 10px; }
.login-preview-cap {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0; background: transparent;
  color: var(--xh-deep); font-size: 12px; font-weight: 600; margin-bottom: 5px; text-align: left;
}
.login-preview-cap:hover { color: var(--xh-deep-2); text-decoration: underline; text-underline-offset: 3px; }
.login-preview-cap:focus-visible { outline: 2px solid var(--xh-glow-strong); outline-offset: 3px; border-radius: 4px; }
.login-preview-cap:disabled { cursor: wait; opacity: .65; text-decoration: none; }
.login-preview-cap i { font-style: normal; }
.lp-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow: hidden;
  background: #fff; border: 1px solid var(--xh-soft-border); border-radius: 10px; padding: 7px 9px;
  box-shadow: inset 0 0 0 1px var(--xh-soft-hi);
}
.lp-crumb {
  flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--xh-text-tertiary); font-size: 11px;
  text-overflow: ellipsis; white-space: nowrap;
}
.lp-actions {
  display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: 5px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
}
.lp-actions::-webkit-scrollbar { display: none; }
.lp-chip {
  position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px 0 5px; border: 1px solid var(--xh-border); border-radius: 7px;
  background: #fff; color: var(--xh-muted); font-size: 11.5px; white-space: nowrap;
}
.lp-chip .lp-ico {
  min-width: 16px; height: 16px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--xh-soft); color: var(--xh-deep); font-size: 9.5px; font-weight: 800; white-space: nowrap; padding: 0 2px;
}
.lp-chip.lp-todo .lp-ico { background: var(--xh-green); color: #fff; }
.lp-chip .lp-badge {
  position: absolute; top: -5px; right: -3px; min-width: 13px; height: 13px; padding: 0 3px;
  border-radius: 999px; background: var(--xh-red); color: #fff; font-size: 9px; line-height: 13px;
  text-align: center; font-style: normal; font-weight: 700;
}
.lp-chip.lp-user { border-color: #f0e6ff; background: #faf7ff; }
.lp-chip.lp-user .lp-ico { background: #f0e6ff; color: #7e22ce; }
.lp-div { flex: 0 0 auto; width: 1px; height: 18px; background: var(--xh-border); }
.lp-uname { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.login-preview-note { margin-top: 5px; color: var(--xh-text-tertiary); font-size: 11px; line-height: 1.4; }

.layout { display: flex; min-height: 100vh; }
.layout.sider-off .sider { display: none; }
.sider-mask { display: none; }
.sider {
  width: var(--xh-sider-w); background: #fff; border-right: 1px solid var(--xh-border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden;
  z-index: 8;
}
.sider-nav {
  flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 4px 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sider-nav::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent;
}
.sider-nav::-webkit-scrollbar-button,
.sider-nav::-webkit-scrollbar-button:start:decrement,
.sider-nav::-webkit-scrollbar-button:end:increment,
.sider-nav::-webkit-scrollbar-button:vertical:start:decrement,
.sider-nav::-webkit-scrollbar-button:vertical:end:increment,
.sider-nav::-webkit-scrollbar-button:single-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.table-wrap,
.modal-body,
.hours-box,
.print-layer {
  scrollbar-width: thin;
  scrollbar-color: var(--xh-glow-deep-mid) transparent;
}
.table-wrap::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.hours-box::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.table-wrap::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.hours-box::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.hours-box::-webkit-scrollbar-thumb {
  background: var(--xh-glow-deep-mid);
  border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.hours-box::-webkit-scrollbar-thumb:hover {
  background: var(--xh-glow-deep-hi);
}
.table-wrap::-webkit-scrollbar-button,
.modal-body::-webkit-scrollbar-button,
.hours-box::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.sider-brand { width: 100%; flex-shrink: 0; padding: 14px 12px 8px; border: 0; background: transparent; text-align: left; font-weight: var(--xh-fw-bold); color: var(--xh-deep); display: flex; align-items: center; gap: 8px; }
.sider-brand:hover { color: var(--xh-deep-2); }
.sider-role { font-style: normal; font-weight: var(--xh-fw-regular); font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); color: var(--xh-text-tertiary); background: var(--xh-soft); border-radius: 99px; padding: 2px 8px; }
.sider-search { flex-shrink: 0; padding: 0 12px 8px; }
.sider-search input {
  width: 100%; height: 30px; border: 1px solid var(--xh-border); border-radius: 8px;
  padding: 0 10px; font-size: var(--xh-fs-meta); background: #f8fafb; color: var(--xh-text);
}
.sider-search input:focus { outline: 0; border-color: var(--xh-focus); background: #fff; box-shadow: 0 0 0 3px var(--xh-glow); }
.sider-toggle {
  position: fixed; top: 10px; left: calc(var(--xh-sider-w) - 42px); z-index: 30;
  height: 30px; min-width: 30px; padding: 0 8px;
  border: 1px solid var(--xh-border); border-radius: 8px; background: #fff;
  color: var(--xh-deep); font-size: 15px; line-height: 1; cursor: pointer;
  transition: left .18s ease, color .15s, border-color .15s;
}
.sider-toggle:hover { color: var(--xh-green-2); border-color: var(--xh-green); }
.layout.sider-off .sider-toggle { left: 12px; }
.nav-group { padding: 5px 10px 8px; position: relative; }
.nav-group + .nav-group { margin-top: 2px; }
.nav-label {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); color: var(--xh-text-tertiary); padding: 10px 8px 6px; border: 0; background: transparent; text-align: left;
  letter-spacing: .04em; transition: color .15s ease;
}
.nav-label:hover { color: var(--xh-deep-2); }
.nav-label em {
  font-style: normal; color: var(--xh-text-tertiary);
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; font-weight: var(--xh-fw-medium);
  transition: background .15s ease, color .15s ease, transform .2s ease;
}
.nav-label:hover em { background: var(--xh-soft); color: var(--xh-deep); }
.nav-label.on { color: var(--xh-deep-3); font-weight: var(--xh-fw-semibold); }
.nav-label.on .nav-no { color: var(--xh-deep-3); }
.nav-no { font-style: normal; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; font-weight: var(--xh-fw-medium); color: var(--xh-text-secondary); background: var(--xh-soft); border-radius: 7px; margin-right: 8px; flex-shrink: 0; letter-spacing: 0; font-variant-numeric: tabular-nums; transition: background .15s ease, color .15s ease; }
.nav-label.on .nav-no { background: linear-gradient(145deg, var(--xh-grad-a), var(--xh-deep-3)); color: #fff; }
.nav-row { display: flex; align-items: center; gap: 2px; }
.nav-item {
  position: relative;
  flex: 1; text-align: left; border: 0; background: transparent;
  padding: 7px 10px 7px 25px; border-radius: 8px; color: var(--xh-text); font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight);
  transition: background .15s ease, color .15s ease;
}
.nav-item::before {
  content: ''; position: absolute; left: 11px; top: 50%;
  width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: #d5dcde; transition: background .15s ease, transform .15s ease, box-shadow .15s ease, height .15s ease, margin-top .15s ease;
}
.nav-item:hover { background: var(--xh-soft); color: var(--xh-deep-2); }
.nav-item:hover::before { background: var(--xh-green); }
.nav-item.stat { color: var(--xh-deep); }
.nav-item.active { background: var(--xh-glow); color: var(--xh-deep-3); font-weight: var(--xh-fw-semibold); }
.nav-item.active::before {
  left: 10px; width: 3px; height: 16px; margin-top: -8px; border-radius: 999px;
  background: var(--xh-green); box-shadow: 0 0 0 3px var(--xh-glow-soft);
}
.nav-help {
  width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent;
  color: var(--xh-text-tertiary); font-size: var(--xh-fs-meta); line-height: 1; flex-shrink: 0;
}
.nav-help:hover, .nav-help.on { background: var(--xh-soft); color: var(--xh-deep); }
.help-mask { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 38; }
.help-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 92vw);
  background: #fff; z-index: 39; display: flex; flex-direction: column;
  box-shadow: -18px 0 48px rgba(15,23,42,.16);
  transform: translateX(105%); transition: transform .22s ease;
}
.help-panel.open { transform: translateX(0); }
.help-panel-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--xh-border);
}
.help-panel-head h2 { margin: 2px 0 0; font-size: var(--xh-fs-dialog); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.help-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 20px; }
.help-block { margin-bottom: 18px; }
.help-block h3 { margin: 0 0 8px; font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); color: var(--xh-deep); }
.help-block p { margin: 0; color: var(--xh-text-secondary); line-height: var(--xh-lh-note); font-size: var(--xh-fs-meta); }
.help-fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.help-fields li { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--xh-soft); background: var(--xh-panel); border-radius: 8px; padding: 8px 10px; }
.help-fields strong { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); color: var(--xh-text); }
.help-fields em { font-style: normal; color: var(--xh-muted); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); }
.help-req { align-self: flex-start; font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); color: var(--xh-red); border: 1px solid #fecaca; background: #fef2f2; border-radius: 99px; padding: 0 6px; margin-top: 2px; }
.btn-back {
  display: inline-flex; align-items: center; height: 28px; margin: 0 8px 0 0;
  padding: 0 10px; border: 0; border-radius: 8px; background: var(--xh-soft); color: var(--xh-deep-3);
  font-size: 13px; vertical-align: middle;
}
.topbar h1 .btn-back { margin-bottom: 2px; }
.drill-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--xh-soft-hi); border: 1px solid var(--xh-soft-border); border-radius: 8px;
  padding: 8px 12px; margin: 0 0 12px; color: var(--xh-text-secondary);
}
.drill-from {
  font-weight: 600; color: var(--xh-deep-3); background: #fff; border: 1px solid var(--xh-soft-border);
  border-radius: 99px; padding: 2px 10px; font-size: 12px;
}
.sider-foot { flex-shrink: 0; margin-top: auto; padding: 14px; border-top: 1px solid var(--xh-border); color: var(--xh-muted); }
.sider-foot .site-foot { display: block; margin-top: 10px; font-size: 12px; color: var(--xh-text-tertiary); }

.main { flex: 1; min-width: 0; padding: 12px 18px 28px; container: workspace / inline-size; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 10px; }
.crumb { color: var(--xh-text-tertiary); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); }
.topbar h1 { margin: 4px 0 0; font-size: var(--xh-fs-page); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-quick { display: flex; align-items: center; gap: 6px; }
.quick-role {
  align-self: stretch; display: inline-flex; align-items: center; justify-content: center;
  min-width: 58px; padding: 0 8px; margin-right: 2px; border-radius: 8px;
  background: var(--xh-soft); border: 1px solid var(--xh-soft-border); color: var(--xh-deep);
  font-size: var(--xh-fs-meta); font-weight: var(--xh-fw-bold); line-height: var(--xh-lh-tight); letter-spacing: .04em; white-space: nowrap;
}
.top-sep { width: 1px; align-self: stretch; background: var(--xh-border); margin: 0 2px; }
.quick-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px; border: 1px solid var(--xh-border); border-radius: 8px;
  background: #fff; color: var(--xh-muted); font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); transition: all .15s;
}
.quick-btn:hover { color: var(--xh-green); border-color: var(--xh-green-2); }
.quick-btn.on { background: var(--xh-soft); color: var(--xh-green-2); border-color: var(--xh-green); }
.quick-btn .quick-ico {
  min-width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--xh-soft); color: var(--xh-deep); font-size: var(--xh-fs-caption); font-weight: var(--xh-fw-bold); line-height: 1; white-space: nowrap; padding: 0 3px;
}
.quick-btn .quick-ico:empty { display: none; }
.quick-btn.quick-todo .quick-ico { background: var(--xh-green); color: #fff; }
.quick-btn.quick-home .quick-ico { background: #e0f2fe; color: #0369a1; }
.quick-btn.quick-help .quick-ico { background: #f3e8ff; color: #7e22ce; }
.quick-btn .quick-badge {
  position: absolute; top: -6px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--xh-red); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; font-style: normal; font-weight: var(--xh-fw-bold); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.notify-wrap { position: relative; }
.quick-bell .quick-ico { color: var(--xh-muted); }
.quick-bell.on { background: var(--xh-soft); color: var(--xh-green-2); border-color: var(--xh-green); }
.notify-panel {
  position: absolute; top: 42px; right: 0; width: 340px; max-height: 440px;
  background: #fff; border: 1px solid var(--xh-border); border-radius: 10px;
  box-shadow: var(--xh-shadow); z-index: 40; display: flex; flex-direction: column; overflow: hidden;
}
.notify-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--xh-border);
}
.notify-head strong { font-size: var(--xh-fs-title); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.notify-head .link { font-size: var(--xh-fs-meta); }
.notify-list { overflow-y: auto; max-height: 380px; }
.notify-item { display: block; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid #f2f2f2; background: #fff; text-align: left; color: inherit; cursor: pointer; }
.notify-item:hover { background: var(--xh-soft-hi); }
.notify-item.unread { background: var(--xh-soft); }
.notify-item.unread:hover { background: var(--xh-soft); }
.notify-t { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.notify-t strong { font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.notify-t em { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); color: var(--xh-text-tertiary); font-style: normal; }
.notify-b { display: block; margin-top: 3px; font-size: var(--xh-fs-meta); color: var(--xh-muted); line-height: var(--xh-lh-body); }
.notify-item.unread .notify-t strong::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--xh-red); margin-right: 6px; vertical-align: middle;
}
.user-wrap { position: relative; }
.user-wrap .quick-ico { background: var(--xh-green); color: #fff; }
.user-panel {
  position: absolute; top: 42px; right: 0; width: 200px;
  background: #fff; border: 1px solid var(--xh-border); border-radius: 10px;
  box-shadow: var(--xh-shadow); z-index: 40; overflow: hidden;
}
.user-panel-head {
  padding: 12px 14px; border-bottom: 1px solid var(--xh-border);
  font-size: var(--xh-fs-title); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); color: var(--xh-text);
}
.user-panel-head em { display: block; font-style: normal; font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); color: var(--xh-text-tertiary); font-weight: var(--xh-fw-regular); margin-top: 2px; }
.user-panel-item {
  display: block; width: 100%; text-align: left; border: 0; background: #fff;
  padding: 11px 14px; font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); color: var(--xh-red); cursor: pointer;
}
.user-panel-item:hover { background: #fef2f2; }
.user-panel-item.on { color: var(--xh-deep-3); font-weight: var(--xh-fw-semibold); background: var(--xh-soft); }
.lang-btn .quick-label { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 920px) {
  .quick-btn .quick-label { display: none; }
  .quick-btn { padding: 0 9px; }
  .notify-panel { width: 300px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; flex: 1; }
}
.search { height: 36px; padding: 0 10px; border: 1px solid var(--xh-border); border-radius: 8px; min-width: 220px; }
.page-guide { display: none; }

.btn { border: 0; border-radius: 8px; height: 36px; padding: 0 14px; }
.btn-primary { background: var(--xh-green); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--xh-border); }
.link { background: none; border: 0; color: var(--xh-green); padding: 0 6px; }
.link.danger { color: var(--xh-red); }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { min-width: 0; }
.kpi > span, .kpi-label { display: block; color: var(--xh-muted); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); }
.kpi > b, .kpi-value { display: block; margin-top: 6px; font-size: var(--xh-fs-kpi); line-height: 1.15; font-weight: var(--xh-fw-bold); color: var(--xh-deep-3); font-variant-numeric: tabular-nums; }
.entry-wrap { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.entry-label { font-size: 12px; color: var(--xh-muted); margin-bottom: 8px; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.entry-card {
  text-align: left; border: 1px solid var(--xh-border); background: #fff;
  border-radius: 10px; padding: 12px 12px 10px;
}
.entry-card strong { display: block; font-size: 14px; }
.entry-card span { color: var(--xh-text-tertiary); font-size: 12px; }
.entry-card.personal { border-top: 3px solid var(--xh-green); }
.entry-card.sales { border-top: 3px solid #38bdf8; }
.entry-card.buy { border-top: 3px solid #f59e0b; }
.entry-card.site { border-top: 3px solid #8b5cf6; }
.form-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.form-tabs button {
  border: 1px solid var(--xh-border); background: #fff; border-radius: 8px;
  height: 32px; padding: 0 10px; color: var(--xh-muted);
}
.form-tabs button.active { background: var(--xh-glow); color: var(--xh-deep-3); border-color: var(--xh-soft-border-2); }
.wf-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.wf-box {
  text-align: left; border: 1px solid var(--xh-border); background: #fff;
  border-radius: 10px; padding: 12px 14px;
}
.wf-box strong { display: block; font-size: 22px; color: var(--xh-deep); }
.wf-box span { color: var(--xh-muted); font-size: 12px; }
.wf-box.active { border-color: var(--xh-soft-border-2); background: var(--xh-soft-hi); box-shadow: 0 0 0 2px var(--xh-glow); }
.cal-month { font-size: 18px; min-width: 96px; text-align: center; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
  background: #fff; border: 1px solid var(--xh-border); border-radius: 10px; padding: 12px;
}
.cal-head { text-align: center; color: var(--xh-muted); font-size: 12px; padding: 4px 0; }
.cal-cell {
  min-height: 64px; border: 1px solid var(--xh-border); border-radius: 8px;
  background: #f8fafb; text-align: left; padding: 8px;
}
.cal-cell em { display: block; font-style: normal; font-weight: 700; }
.cal-cell span { font-size: 12px; color: var(--xh-muted); }
.cal-cell.empty { visibility: hidden; }
.cal-cell.t-工作日 { background: #ecfdf5; border-color: #bbf7d0; }
.cal-cell.t-休息日 { background: #fff7ed; border-color: #fed7aa; }
.cal-cell.t-节假日 { background: #fef2f2; border-color: #fecaca; }
.cal-cell.t-none { background: #f3f4f6; }
.inv-filter { display: flex; gap: 10px; align-items: end; margin-bottom: 12px; flex-wrap: wrap; }
.inv-filter label { display: flex; flex-direction: column; gap: 4px; color: var(--xh-muted); }
.inv-filter input, .inv-filter select { height: 36px; border: 1px solid var(--xh-border); border-radius: 8px; padding: 0 10px; min-width: 180px; }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--xh-border); border-radius: 8px; padding: 6px 8px; }
.photo-chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.photo-upload { position: relative; overflow: hidden; }
.photo-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.kpi { background: #fff; border: 1px solid var(--xh-border); border-radius: 10px; padding: 14px 16px; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--xh-green); box-shadow: 0 4px 14px var(--xh-glow); }
.kpi[role="button"] { text-align: left; }
.kpi-label { color: var(--xh-muted); }
.kpi-hint { color: var(--xh-text-tertiary); font-size: var(--xh-fs-caption); line-height: var(--xh-lh-body); margin-top: 6px; }
.kpi-value { font-size: var(--xh-fs-kpi); font-weight: var(--xh-fw-bold); margin-top: 6px; }
.kpi-value.pos, .pos { color: var(--xh-green-2); }
.kpi-value.neg, .neg { color: var(--xh-red); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card-grid--financial .card--finance { grid-column: 1 / -1; }
.card { min-width: 0; background: #fff; border: 1px solid var(--xh-border); border-radius: 10px; padding: 14px; }
.card h3 { margin: 0 0 10px; font-size: var(--xh-fs-title); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.table-wrap { position: relative; overflow: auto; border: 1px solid var(--xh-border); border-radius: 8px; background: #fff; scrollbar-gutter: stable; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--xh-border); text-align: left; white-space: nowrap; }
th { background: var(--xh-soft-hi); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); color: var(--xh-text-secondary); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--xh-deep); }
th.num-col, td.num-col { text-align: right; }
.sort-ico { font-style: normal; font-size: 9px; margin-left: 3px; color: var(--xh-green); vertical-align: 1px; }
td { font-size: var(--xh-fs-body); line-height: var(--xh-lh-body); color: var(--xh-text); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--xh-border); font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-medium); white-space: nowrap; }
.tag.ok { background: #dcfce7; color: #166534; }
.tag.warn { background: #fef3c7; color: #92400e; }
.tag.bad { background: #fee2e2; color: #991b1b; }
.empty { text-align: center; color: var(--xh-text-tertiary); padding: 20px; font-size: var(--xh-fs-meta); line-height: var(--xh-lh-note); }
.empty-box p { margin: 0 0 8px; }
.pager { display: flex; gap: 8px; align-items: center; padding-top: 10px; color: var(--xh-muted); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); flex-wrap: wrap; }
.pager select, .pager-jump input { height: 32px; border: 1px solid var(--xh-border); border-radius: 6px; padding: 0 8px; }
.pager-jump input { width: 56px; font-variant-numeric: tabular-nums; }
.pager-pages { display: inline-flex; align-items: center; gap: 4px; }
.pager-page {
  min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--xh-border);
  border-radius: 6px; background: #fff; color: var(--xh-muted); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight);
}
.pager-page:hover { border-color: var(--xh-green-2); color: var(--xh-green-2); }
.pager-page.cur { background: var(--xh-green); color: #fff; border-color: var(--xh-green); font-weight: var(--xh-fw-semibold); }
.pager-page.gap { border-color: transparent; background: transparent; cursor: default; }
.ops { white-space: nowrap; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(112px, 180px) minmax(72px, 1fr) max-content; gap: 10px; min-height: 32px; align-items: center; }
.bar-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--xh-muted); }
.bar-row .tag { overflow: visible; text-overflow: clip; white-space: nowrap; }
.bar-row i { display: block; min-width: 0; height: 10px; background: var(--xh-green); border-radius: 99px; }
.bar-row i.pay { background: #38bdf8; }
.bar-row em { min-width: 0; font-style: normal; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-row--todo { grid-template-columns: minmax(0, 1fr) max-content max-content; }
.bar-row--finance { grid-template-columns: minmax(180px, 1fr) minmax(120px, 1.25fr) minmax(260px, 360px); align-items: start; padding: 4px 0; }
.fx-value { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 3px 8px; color: var(--xh-text); }
.fx-value strong, .fx-value span, .fx-value small { white-space: nowrap; }
.fx-value strong { color: var(--xh-deep-3); font-size: 14px; }
.fx-value small { color: var(--xh-muted); font-size: 12px; }
.fx-value small.neg { color: var(--xh-red); }
.fx-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; border-top: 1px dashed var(--xh-soft-border); margin-top: 4px; padding-top: 8px; color: var(--xh-text); font-size: 12px; }
.fx-summary span, .fx-summary strong { white-space: nowrap; }
.fx-summary strong { color: var(--xh-text); font-size: 13px; }
.fx-summary .neg { color: var(--xh-red); }

.modal { position: fixed; inset: 0; background: rgba(15,23,42,.42); display: grid; place-items: center; z-index: 20; padding: 12px; }
.modal-box {
  background: #fff; width: min(760px, 100%); max-height: 88vh;
  border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15,23,42,.22);
}
.modal-box.sm { width: min(480px, 100%); }
.modal-box.md { width: min(620px, 100%); }
.modal-box.lg { width: min(760px, 100%); }
.modal-box.xl { width: min(960px, 100%); }
.form-grid.sm { grid-template-columns: 1fr; }
.form-section { grid-column: 1 / -1; font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); color: var(--xh-deep); margin: 6px 0 2px; padding-bottom: 4px; border-bottom: 1px solid var(--xh-border); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px 8px; border-bottom: 1px solid var(--xh-border); }
.modal-kicker { margin: 0; color: var(--xh-text-tertiary); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); }
.modal-box h2 { margin: 2px 0 0; font-size: var(--xh-fs-dialog); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.modal-x { width: 32px; height: 32px; border: 0; background: #f3f4f6; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--xh-muted); }
.modal-body { padding: 10px 16px 12px; overflow: auto; flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--xh-text-secondary); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-medium); }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid label.bad input, .form-grid label.bad select, .form-grid label.bad textarea { border-color: #f3b4b4; background: #fff7f7; }
.field-label { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); }
.field-label i { color: var(--xh-red); margin-left: 3px; font-style: normal; }
.field-err { color: var(--xh-red); font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); font-weight: var(--xh-fw-regular); }
.field-hint { display: block; font-size: var(--xh-fs-meta); color: var(--xh-text-secondary); line-height: var(--xh-lh-body); font-weight: var(--xh-fw-regular); }
.field-hint.warn { color: var(--xh-red); }
.region-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--xh-border); border-radius: 8px; padding: 6px 10px; font-size: var(--xh-fs-body); line-height: var(--xh-lh-body); font-weight: var(--xh-fw-regular); background: #fbfcfd;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: 0; border-color: var(--xh-focus); box-shadow: 0 0 0 3px var(--xh-glow); background: #fff;
}
.img-field { display: flex; flex-direction: column; gap: 6px; }
.img-thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--xh-border); background: #fff; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-file { border: 1px dashed var(--xh-border); border-radius: 8px; padding: 6px 8px; font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); color: var(--xh-text-secondary); background: #fbfcfd; cursor: pointer; }
.img-name { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-body); color: var(--xh-text-secondary); word-break: break-all; }
.hours-box { margin-top: 10px; overflow: auto; }
.hours-box input { width: 100%; min-width: 64px; border: 1px solid var(--xh-border); border-radius: 6px; padding: 4px 6px; }
.hours-box input[type="number"] { font-variant-numeric: tabular-nums; }
.hours-head { font-weight: var(--xh-fw-semibold); margin-bottom: 8px; color: var(--xh-deep); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px 12px; border-top: 1px solid var(--xh-border); background: #fafbfc; }
.wm {
  position: fixed; inset: -20%; pointer-events: none; z-index: 6; opacity: .028;
  display: flex; flex-wrap: wrap; transform: rotate(-18deg); overflow: hidden;
}
.wm span { width: auto; padding: 48px 24px; font-size: 15px; color: var(--xh-deep); white-space: nowrap; }
.page-foot, .site-foot { color: var(--xh-text-tertiary); font-size: 12px; }
.page-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--xh-border); }
.login-foot { margin-top: 14px; text-align: center; }

.toasts { position: fixed; right: 16px; top: 16px; z-index: 30; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 8px 12px; border-radius: 8px; }
.toast.ok { background: #047857; }
.toast.err { background: #b91c1c; }

.click-row { cursor: pointer; }
.click-row[role="button"] { width: 100%; min-height: 38px; border: 0; background: transparent; color: inherit; padding: 4px 0; text-align: left; font: inherit; }
.click-row:hover { background: var(--xh-soft); }
/* 行长行警示（超差 / 待处理）：左侧红条 + 浅底 */
tr.row-warn > td { background: #fff7f7; }
tr.row-warn > td:first-child { box-shadow: inset 3px 0 0 var(--xh-red); }
/* 看板内联筛选条（过磅作业 / 磅差台账 / 弹窗表单） */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters > label { display: flex; flex-direction: column; gap: 4px; font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); color: var(--xh-text-secondary); }
.filters > label > input,
.filters > label > select { height: 32px; min-width: 132px; padding: 0 8px; border: 1px solid var(--xh-border); border-radius: 6px; background: #fff; font: inherit; color: inherit; }
.filters > label > input[type="month"] { min-width: 148px; }
.filters > label > input:focus,
.filters > label > select:focus { outline: 2px solid var(--xh-glow-deep-mid); outline-offset: 1px; }
.print-layer { position: fixed; inset: 0; z-index: 40; background: #f5f6f5; overflow: auto; }
.print-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--xh-border); }
.print-sheet { max-width: 760px; margin: 24px auto 40px; background: #fff; padding: 28px 32px; border: 1px solid var(--xh-border); }
.print-sheet h1 { margin: 0 0 4px; font-size: 22px; color: var(--xh-deep); }
.print-sub { color: var(--xh-muted); margin: 0 0 18px; }
.print-sheet table { width: 100%; border-collapse: collapse; }
.print-sheet th { text-align: left; width: 28%; color: var(--xh-muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--xh-border); }
.print-sheet td { padding: 6px 8px; border-bottom: 1px solid var(--xh-border); }
.print-items { margin-top: 16px; }
.print-items th { width: auto; background: var(--xh-soft-hi); }
.print-foot { margin-top: 24px; color: var(--xh-text-tertiary); font-size: 12px; }

@media print {
  .layout, .modal, .toasts, .wm, .print-toolbar, .login-page { display: none !important; }
  .print-layer { position: static; background: #fff; overflow: visible; }
  .print-sheet { border: 0; margin: 0; max-width: none; }
}

@media (min-width: 901px) and (max-height: 800px) {
  .login-page { align-items: start; padding: 12px 24px; }
  .login-box { padding: 22px 26px 16px; }
  .login-logo { margin-bottom: 9px; }
  .login-title { font-size: 24px; }
  .login-sub { margin-bottom: 14px; }
  .login-field { margin-bottom: 10px; }
  .login-field label { margin-bottom: 4px; }
  .login-submit { margin-top: 2px; }
  .login-mobile-access { margin-top: 10px; padding: 8px; gap: 8px; }
  .login-roles { padding: 16px; }
  .login-roles-tip { margin-bottom: 8px; }
  .login-role-group-title { margin: 6px 0 5px; }
  .login-role-card { padding: 7px 8px; }
  .login-preview { margin-top: 8px; }
  .login-foot { margin-top: 10px; }
}

@media (max-width: 900px) {
  .login-layout { width: calc(100vw - 48px); max-width: 640px; margin-inline: auto; grid-template-columns: minmax(0, 1fr); }
  .form-grid, .entry-wrap, .wf-boxes, .region-row { grid-template-columns: 1fr; }
  .sider-mask { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(15, 23, 42, .22); }
  .layout.sider-off .sider { display: none; }
  .layout.sider-off .sider-toggle { left: auto; right: 12px; }
  .layout:not(.sider-off) .sider {
    display: flex; position: fixed; z-index: 16; box-shadow: 12px 0 32px rgba(0,0,0,.12);
  }
}

.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tb-left, .tb-right { display: flex; min-width: 0; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-count { color: var(--xh-muted); font-size: 12px; }
.tb-count b { color: var(--xh-green-2); }
.col-sel { width: 32px; text-align: center; padding: 8px 6px !important; }
.col-sel input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--xh-green); vertical-align: middle; }
.import-guide { background: var(--xh-soft-hi); border: 1px solid var(--xh-soft-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.import-guide p { margin: 4px 0; color: var(--xh-muted); font-size: 12px; line-height: 1.5; }
.import-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.import-file { position: relative; overflow: hidden; cursor: pointer; }
.import-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import-file-name { font-size: 12px; color: var(--xh-muted); margin-bottom: 6px; }
.import-err { color: var(--xh-red); font-size: 12px; margin: 6px 0; }
.import-result { background: var(--xh-soft-hi); border: 1px solid var(--xh-soft-border); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.import-result p { margin: 4px 0; font-size: 12px; color: var(--xh-text-secondary); }
.qr-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr-tip { color: var(--xh-muted); font-size: 13px; margin: 0 0 14px; }
.qr-img { width: 230px; height: 230px; border: 1px solid var(--xh-border); border-radius: 10px; padding: 8px; background: #fff; }
.qr-img img { width: 100%; height: 100%; display: block; }
.qr-url { display: flex; gap: 8px; width: 100%; margin-top: 14px; align-items: center; }
.qr-link {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  height: 34px; line-height: 34px; border: 1px solid var(--xh-border); border-radius: 8px;
  padding: 0 10px; font-size: 12px; color: var(--xh-deep); background: #fafbfc; text-align: left;
}

/* ===== 五金版 UI 补充样式 ===== */
.nav-count {
  font-style: normal; margin-left: 8px; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--xh-red); color: #fff; font-size: 11px;
  line-height: 17px; text-align: center; display: inline-block;
}
.filt-label { display: inline-flex; align-items: center; gap: 6px; color: var(--xh-muted); }
.filt-label select { height: 32px; border: 1px solid var(--xh-border); border-radius: 8px; padding: 0 8px; }
.detail-head-ops { display: flex; align-items: center; gap: 10px; }
.detail-total { font-size: 18px; font-weight: 700; color: var(--xh-deep-3); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-bottom: 14px; }
.detail-field { display: flex; gap: 8px; border-bottom: 1px dashed var(--xh-border); padding: 7px 2px; font-size: 13px; }
.detail-k { color: var(--xh-text-tertiary); flex-shrink: 0; min-width: 74px; }
.detail-v { color: var(--xh-text); word-break: break-all; white-space: pre-wrap; }
.detail-v.money { font-weight: 600; color: var(--xh-deep-3); font-variant-numeric: tabular-nums; }
.detail-sec { margin: 18px 0 10px; font-size: 14px; color: var(--xh-deep); border-left: 4px solid var(--xh-green); padding-left: 10px; }
.rels-empty { margin: 8px 0 16px; font-size: 13px; }
.ship-track-line { display: flex; flex-direction: column; gap: 0; margin: 4px 0 8px; }
.st-node { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.st-node::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--xh-soft-border-2); }
.st-node:last-child::before { display: none; }
.st-dot { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--xh-green); flex-shrink: 0; margin-top: 2px; }
.st-node:last-child .st-dot { border-color: var(--xh-green-2); }
.st-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-body strong { font-size: 13px; color: var(--xh-deep); }
.st-time { font-size: 12px; color: var(--xh-text-tertiary); font-variant-numeric: tabular-nums; }
.st-meta { font-size: 12px; color: var(--xh-text-secondary); }
.st-meta em { font-style: normal; margin-left: 8px; color: var(--xh-text-tertiary); }
.st-meta em::before { content: '·'; margin-right: 8px; color: var(--xh-text-tertiary); }

.detail-items th, .detail-items td { white-space: normal; }
.detail-items td { max-width: 220px; overflow-wrap: break-word; }
.rels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rel-card {
  position: relative; text-align: left; border: 1px solid var(--xh-soft-border); background: var(--xh-panel);
  border-radius: 10px; padding: 10px 34px 10px 12px; display: flex; flex-direction: column; gap: 3px;
  transition: border-color .15s, box-shadow .15s;
}
.rel-card:hover { border-color: var(--xh-soft-border-2); box-shadow: 0 4px 14px var(--xh-glow); }
.rel-module { font-style: normal; color: var(--xh-deep); font-size: 11px; font-weight: 600; }
.rel-card strong { font-size: 15px; color: var(--xh-text); font-variant-numeric: tabular-nums; }
.rel-line { color: var(--xh-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-meta { display: flex; gap: 8px; align-items: center; color: var(--xh-text-tertiary); font-size: 12px; font-style: normal; }
.rel-go { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--xh-soft-border-2); font-size: 18px; }
.prod-cell { position: relative; }
.prod-cell input { width: 100%; border: 1px solid var(--xh-border); border-radius: 8px; padding: 6px 10px; font: inherit; background: #fbfcfd; }
.prod-pop {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 2px); background: #fff;
  border: 1px solid var(--xh-border); border-radius: 10px; box-shadow: var(--xh-shadow); max-height: 240px; overflow: auto;
}
.prod-opt { width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid #f2f2f2; background: #fff; text-align: left; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.prod-opt:hover { background: var(--xh-soft-hi); }
.prod-opt strong { font-size: 13px; }
.prod-opt span { color: var(--xh-text-tertiary); font-size: 12px; }
.cell-sub { display: block; margin-top: 2px; color: var(--xh-text-tertiary); font-size: 12px; }
.hours-box td .money, .hours-box .money { font-variant-numeric: tabular-nums; }
.look-pop {
  position: fixed; z-index: 90; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(460px, 92vw); background: #fff; border: 1px solid var(--xh-border); border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15,23,42,.22); padding: 12px; display: flex; flex-direction: column;
}
.look-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; }
.look-opt { text-align: left; border: 0; background: var(--xh-panel); border-bottom: 1px solid #f2f2f2; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.look-opt:hover { background: var(--xh-soft-hi); }
@media (max-width: 1000px) {
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .rels-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ===== 引导条 / 逆向按钮 ===== */
.guide-line {
  background: var(--xh-soft-hi); border: 1px solid var(--xh-soft-border); border-radius: 8px; color: var(--xh-text-secondary);
  padding: 8px 12px; margin: 0 0 10px; font-size: 12.5px; line-height: 1.7;
}
.guide-line i { color: var(--xh-red); font-style: normal; }
.state-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--xh-soft-border); border-radius: 8px; background: var(--xh-soft-hi); color: var(--xh-text-secondary); }
.state-note.error { border-color: #fecaca; background: #fff7f7; color: #991b1b; }
.state-note .btn { flex: 0 0 auto; }
.danger-ghost { color: var(--xh-red) !important; border-color: #fecaca !important; }
.danger-ghost:hover { background: #fef2f2 !important; }

/* ===== 移动/窄屏增强 ===== */
@media (max-width: 640px) {
  .modal { padding: 6px; }
  .modal-box { width: calc(100vw - 12px) !important; max-height: calc(100dvh - 12px); border-radius: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.wide { grid-column: 1; }
  .modal-actions { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .detail-grid, .rels-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 17px; }
  .main { padding: 10px 10px 20px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); }
  .login-mobile-access { grid-template-columns: 124px minmax(0, 1fr); gap: 8px; padding: 8px; text-align: left; }
  .login-mobile-qr { justify-self: start; }
  .login-mobile-copy-btn { margin-left: 0; margin-right: 0; }
  .guide-line { font-size: 12px; }
}
@media (max-width: 420px) {
  .login-page { padding: 12px; }
  .login-layout { width: calc(100vw - 24px); }
  .login-box, .login-roles { padding: 20px 16px; }
  .login-title { font-size: 23px; }
  .login-sub { margin-bottom: 15px; font-size: 12px; }
  .login-mobile-access { grid-template-columns: 120px minmax(0, 1fr); }
  .login-mobile-qr { width: 120px; height: 120px; padding: 1px; }
  .login-mobile-url { font-size: 10px; }
  .quick-btn .quick-label { display: none; }
}

/* 看板域过滤 chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--xh-border); background: #fff; border-radius: 99px; padding: 5px 13px; color: var(--xh-text); font-size: 13px; }
.chip.on { background: var(--xh-green); border-color: var(--xh-green); color: #fff; font-weight: 600; }

/* 海外结算与汇兑损益卡片 */
.guide-note { margin: 6px 0 0; color: var(--xh-text-secondary); font-size: 12px; line-height: 1.6; }
.muted { color: #7c8992; }
.event-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--xh-border); }
.event-row:last-child { border-bottom: 0; }
.event-title { color: var(--xh-text); font-weight: 600; }
.event-sub { margin-top: 3px; color: #7c8992; font-size: 12px; line-height: 1.5; }
.event-time { flex: 0 0 150px; color: #7c8992; font-variant-numeric: tabular-nums; }
@container workspace (max-width: 680px) {
  .event-row { align-items: stretch; flex-direction: column; gap: 3px; }
  .event-time { flex-basis: auto; width: auto !important; }
}

/* ===== 销售订单去重（疑似重复/合并/批量） ===== */
.dup-row { background: #fff6f4 !important; }
.dup-row:hover { background: #ffefec !important; }
.dup-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 5px;
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 600; line-height: 16px;
  vertical-align: 1px; white-space: nowrap;
}
.detail-head-ops .dup-tag { margin-right: 8px; }
.dup-panel {
  border: 1px solid #f5cfc9; background: linear-gradient(180deg, #fff7f4, #fffaf8);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0 12px;
}
.dup-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dup-badge {
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 99px;
}
.dup-head strong { color: #7f1d1d; font-size: 13px; }
.dup-desc { color: #a06a63; font-size: 12px; }
.dup-group {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; margin-top: 8px; background: #fff; border: 1px dashed #edc2bb;
  border-radius: 10px; flex-wrap: wrap;
}
.dup-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dup-cust { color: var(--xh-text); font-size: 13px; }
.dup-po { color: #b45309; font-size: 12px; background: #fff7ed; border-radius: 6px; padding: 1px 7px; }
.dup-docs { color: var(--xh-text); font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.dup-amt { color: #c0392b; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.dup-cnt { color: var(--xh-text-tertiary); font-size: 12px; }
.detail-dup-line {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 2px; padding: 8px 12px; background: #fff8f5; border: 1px dashed #edc2bb;
  border-radius: 8px; color: #7f1d1d; font-size: 12.5px;
}
.detail-dup-line b { color: #c0392b; }
/* 经营分析 P2 */
.an-card { margin-top: 12px; }
.an-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.an-wide { grid-column: span 4; }
.an-block { min-width: 0; }
.an-block b { display: block; font-size: 12px; color: var(--xh-muted); margin-bottom: 6px; }
.an-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 0; font-size: 12.5px; border-bottom: 1px dashed var(--xh-border); }
.an-row.clickable { cursor: pointer; }
.an-row[role="button"] { width: 100%; min-height: 36px; border: 0; background: transparent; color: inherit; text-align: left; }
.an-row.clickable:hover { background: var(--xh-soft-hi); }
.an-row .tag, .an-code, .an-value { flex: 0 0 auto; white-space: nowrap; }
.an-code { font-family: ui-monospace, Consolas, monospace; color: var(--xh-muted); }
.an-label, .an-detail { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-label { color: var(--xh-text); }
.an-detail { color: var(--xh-text-tertiary); }
.an-value { color: var(--xh-muted); font-variant-numeric: tabular-nums; }
.an-bar-row { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 5px 0; font-size: 12.5px; }
.an-ym { flex: 0 0 34px; width: 34px; color: var(--xh-muted); white-space: nowrap; }
.an-bar { flex: 1 1 auto; min-width: 64px; height: 10px; background: var(--xh-border); border-radius: 99px; overflow: hidden; display: block; }
.an-bar em { display: block; height: 100%; background: linear-gradient(90deg, var(--xh-grad-a), var(--xh-deep-3)); border-radius: 99px; min-width: 2px; }
.an-bar em.neg { background: #ef8a8a; }
.an-num { flex: 0 0 108px; width: 108px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

@container workspace (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .an-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-wide { grid-column: span 3; }
}
@container workspace (max-width: 940px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-wide { grid-column: span 2; }
}
@container workspace (max-width: 680px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: auto auto; column-gap: 8px; row-gap: 6px; }
  .bar-row > i { grid-column: 1 / -1; grid-row: 2; width: 100% !important; height: 8px; }
  .bar-row--todo { grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: auto auto; }
  .bar-row--todo > .tag { grid-column: 2; }
  .bar-row--todo > em { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .bar-row--finance { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .bar-row--finance > span:first-child { grid-column: 1; grid-row: 1; }
  .bar-row--finance > i { grid-column: 1; grid-row: 2; }
  .bar-row--finance > .fx-value { grid-column: 1; grid-row: 3; justify-content: flex-start; text-align: left; }
  .fx-summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .an-grid { grid-template-columns: minmax(0, 1fr); }
  .an-wide { grid-column: span 1; }
  .an-row { align-items: flex-start; flex-wrap: wrap; gap: 4px 8px; }
  .an-label { white-space: normal; overflow: visible; text-overflow: clip; }
  .an-detail { flex: 0 0 100%; white-space: normal; overflow: visible; text-overflow: clip; }
  .an-bar-row { gap: 8px; }
  .an-bar { min-width: 0; }
}
@container workspace (max-width: 440px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 主色调切换 ===== */
html[data-accent='blue'] {
  --xh-green: #2f6fed; --xh-green-2: #2457e6;
  --xh-deep: #1e4bd6; --xh-deep-2: #1a3fc4; --xh-deep-3: #1a3fb8;
  --xh-grad-a: #4f8bfb; --xh-focus: #93b4f8;
  --xh-soft: #eef4ff; --xh-soft-hi: #f4f8ff;
  --xh-soft-border: #d6e2ff; --xh-soft-border-2: #b3c9fa;
  --xh-glow: rgba(47, 111, 237, .12); --xh-glow-soft: rgba(47, 111, 237, .16);
  --xh-glow-strong: rgba(47, 111, 237, .55);
  --xh-glow-deep: rgba(30, 75, 214, .08); --xh-glow-deep-mid: rgba(30, 75, 214, .28);
  --xh-glow-deep-hi: rgba(30, 75, 214, .42);
}
html[data-accent='orange'] {
  --xh-green: #e07b00; --xh-green-2: #c96a00;
  --xh-deep: #b45309; --xh-deep-2: #9a4308; --xh-deep-3: #92400e;
  --xh-grad-a: #f59e0b; --xh-focus: #f3b95f;
  --xh-soft: #fff4e6; --xh-soft-hi: #fff9ef;
  --xh-soft-border: #f8dcb8; --xh-soft-border-2: #eec28c;
  --xh-glow: rgba(224, 123, 0, .12); --xh-glow-soft: rgba(224, 123, 0, .16);
  --xh-glow-strong: rgba(224, 123, 0, .55);
  --xh-glow-deep: rgba(180, 83, 9, .08); --xh-glow-deep-mid: rgba(180, 83, 9, .28);
  --xh-glow-deep-hi: rgba(180, 83, 9, .42);
}

/* ===== 侧边栏密度：紧凑 ===== */
html[data-density='compact'] {
  --xh-sider-w: 196px;
}
html[data-density='compact'] .sider-brand { padding: 8px 10px 5px; font-size: 12.5px; gap: 6px; }
html[data-density='compact'] .sider-search { padding: 0 10px 6px; }
html[data-density='compact'] .sider-search input { height: 26px; font-size: 11.5px; }
html[data-density='compact'] .sider-toggle { top: 8px; left: calc(var(--xh-sider-w) - 40px); height: 26px; min-width: 26px; padding: 0 6px; font-size: 13px; }
html[data-density='compact'] .nav-group { padding: 1px 6px 2px; }
html[data-density='compact'] .nav-label { font-size: 10.5px; padding: 7px 7px 3px; }
html[data-density='compact'] .nav-label em { font-size: 11px; }
html[data-density='compact'] .nav-no { width: 19px; height: 19px; margin-right: 6px; border-radius: 6px; }
html[data-density='compact'] .nav-item { padding: 4px 8px 4px 22px; border-radius: 6px; font-size: 12px; }
html[data-density='compact'] .nav-item::before { left: 9px; }
html[data-density='compact'] .nav-item.active::before { left: 8px; height: 13px; margin-top: -6.5px; }
html[data-density='compact'] .nav-help { width: 20px; height: 20px; font-size: 11px; }

/* ===== 外观与偏好设置页 ===== */
.pref-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pref-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--xh-border); border-radius: 10px;
  background: #fff; color: var(--xh-text); font-size: 13px; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.pref-chip i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.pref-chip:hover { border-color: var(--xh-green-2); }
.pref-chip.on { border-color: var(--xh-green); background: var(--xh-soft); color: var(--xh-deep); font-weight: var(--xh-fw-semibold); box-shadow: 0 0 0 2px var(--xh-glow); }

/* ===== 文字层级收口 ===== */
.login-brand { font-size: var(--xh-fs-page); font-weight: var(--xh-fw-bold); line-height: var(--xh-lh-tight); }
.login-title { font-size: var(--xh-fs-page); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.login-sub, .login-roles-tip { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-note); }
.login-field label { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-medium); }
.login-mobile-qr .empty, .login-mobile-kicker, .login-mobile-tip, .login-mobile-url, .login-role-group-title, .login-role-cred, .login-role-card em, .login-preview-cap, .lp-crumb, .lp-chip, .login-preview-note { font-size: var(--xh-fs-caption); }
.login-mobile-copy h2, .login-roles h2 { font-size: var(--xh-fs-title); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }

.btn, .chip, .filt-label, .inv-filter label, .form-tabs button, .pref-chip { font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-medium); }
.btn-sm { font-size: var(--xh-fs-meta); }
.entry-label, .entry-card span, .wf-box span, .cal-head, .cal-cell span, .tb-count, .guide-note, .event-sub, .cell-sub, .rel-line, .rel-meta, .import-guide p, .import-file-name, .import-err, .import-result p, .qr-link, .detail-dup-line, .dup-desc, .dup-po, .dup-docs, .dup-cnt { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); }
.entry-card strong, .event-title, .detail-sec, .dup-head strong, .dup-cust, .an-block b { font-size: var(--xh-fs-title); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.wf-box strong, .detail-total { font-size: var(--xh-fs-kpi); line-height: 1.15; font-weight: var(--xh-fw-bold); font-variant-numeric: tabular-nums; }
.cal-month { font-size: var(--xh-fs-dialog); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.cal-cell em { font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); }

.bar-row { font-size: var(--xh-fs-body); line-height: var(--xh-lh-body); }
.bar-row em, .fx-value small, .fx-summary, .an-row, .an-bar-row { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); }
.fx-value strong, .fx-summary strong { font-size: var(--xh-fs-body); font-weight: var(--xh-fw-semibold); font-variant-numeric: tabular-nums; }
.bar-row em, .fx-value, .fx-summary, .an-value, .an-num, .an-ym, .event-time, .detail-v.money, .dup-amt, .dup-docs, .an-code { font-variant-numeric: tabular-nums; }

.detail-field { font-size: var(--xh-fs-body); line-height: var(--xh-lh-body); }
.detail-k { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); color: var(--xh-text-tertiary); }
.detail-v { font-size: var(--xh-fs-body); line-height: var(--xh-lh-body); }
.rel-module, .img-name, .prod-opt span { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-body); }
.rel-card strong, .prod-opt strong { font-size: var(--xh-fs-body); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.guide-line, .state-note, .qr-tip { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-note); }
.an-row, .an-bar-row { font-size: var(--xh-fs-meta); }
.an-code { font-family: var(--xh-font-mono); }
.an-num, .an-value { font-variant-numeric: tabular-nums; }
.dup-tag, .dup-badge, .nav-count { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.dup-amt { font-size: var(--xh-fs-title); font-weight: var(--xh-fw-bold); }

.dashboard-note { font-size: var(--xh-fs-body); line-height: var(--xh-lh-note); white-space: pre-wrap; }
.trace-section-title { font-size: var(--xh-fs-title); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); }
.trace-empty, .data-meta, .help-panel-tip, .print-doc-title { font-size: var(--xh-fs-meta); line-height: var(--xh-lh-body); }
.scan-input { height: 46px; font-size: var(--xh-fs-dialog); line-height: var(--xh-lh-tight); font-variant-numeric: tabular-nums; }
.print-doc-title { color: var(--xh-text-secondary); font-weight: var(--xh-fw-medium); }

html[data-density='compact'] .sider-brand { font-size: var(--xh-fs-body); }
html[data-density='compact'] .sider-search input, html[data-density='compact'] .nav-label, html[data-density='compact'] .nav-label em, html[data-density='compact'] .nav-item, html[data-density='compact'] .nav-help { font-size: var(--xh-fs-meta); }
html[data-density='compact'] .nav-no { font-size: var(--xh-fs-caption); }

/* ---- 经营 Copilot 聊天 ---- */
.copilot-card { display: flex; flex-direction: column; gap: 12px; min-height: 420px; }
.copilot-chat { display: flex; flex-direction: column; gap: 10px; height: 340px; overflow-y: auto; padding: 12px; background: var(--xh-bg); border: 1px solid var(--xh-border); border-radius: var(--xh-radius); }
.copilot-msg { display: flex; flex-direction: column; }
.copilot-msg.user { align-items: flex-end; }
.copilot-msg.assistant { align-items: flex-start; }
.copilot-bubble { max-width: 90%; padding: 9px 12px; border-radius: 12px; font-size: var(--xh-fs-body); line-height: var(--xh-lh-note); white-space: normal; word-break: break-word; }
.copilot-msg.user .copilot-bubble { background: var(--xh-green); color: #fff; border-bottom-right-radius: 3px; }
.copilot-msg.assistant .copilot-bubble { background: var(--xh-panel); border: 1px solid var(--xh-border); border-bottom-left-radius: 3px; color: var(--xh-text); }
.copilot-bubble strong { font-weight: var(--xh-fw-bold); }
.copilot-bubble em { font-style: italic; }
.copilot-bubble code { font-family: var(--xh-font-mono); font-size: 0.92em; background: var(--xh-soft); padding: 1px 4px; border-radius: 4px; }
.copilot-bubble h2, .copilot-bubble h3, .copilot-bubble h4, .copilot-bubble h5, .copilot-bubble h6 { margin: 6px 0 4px; font-weight: var(--xh-fw-semibold); line-height: var(--xh-lh-tight); }
.copilot-bubble h2, .copilot-bubble h3 { font-size: var(--xh-fs-title); }
.copilot-bubble h4, .copilot-bubble h5, .copilot-bubble h6 { font-size: var(--xh-fs-body); }
.copilot-bubble p { margin: 4px 0; }
.copilot-bubble .md-li { margin: 3px 0 3px 12px; }
.copilot-bubble .md-row { margin: 3px 0; }
.copilot-bubble .md-sep { margin: 0 6px; color: var(--xh-muted); }
.copilot-bubble .md-code { display: block; background: var(--xh-soft); border: 1px solid var(--xh-border); border-radius: 6px; padding: 8px 10px; margin: 6px 0; overflow-x: auto; font-family: var(--xh-font-mono); font-size: 0.9em; }
.copilot-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.copilot-input { display: flex; gap: 8px; }
.copilot-field { flex: 1; height: 38px; border: 1px solid var(--xh-border); border-radius: 8px; padding: 0 12px; font-size: var(--xh-fs-body); color: var(--xh-text); background: var(--xh-bg); }
.copilot-field:focus { outline: none; border-color: var(--xh-focus); box-shadow: 0 0 0 3px var(--xh-glow-soft); }
@media (max-width: 640px) { .copilot-chat { height: 60vh; } .copilot-input { flex-direction: column; } }

/* ---- 经营 Copilot 悬浮问答 ---- */
.copilot-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--xh-green); color: #fff; font-size: var(--xh-fs-title); font-weight: var(--xh-fw-bold); cursor: pointer; box-shadow: var(--xh-shadow); z-index: 60; transition: transform .15s ease, box-shadow .15s ease; }
.copilot-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--xh-glow-strong); }
.copilot-panel { position: fixed; right: 24px; bottom: 92px; width: 380px; max-width: calc(100vw - 32px); max-height: 68vh; display: flex; flex-direction: column; gap: 10px; background: var(--xh-panel); border: 1px solid var(--xh-border); border-radius: 14px; box-shadow: var(--xh-shadow); padding: 14px; z-index: 61; }
.copilot-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--xh-fs-title); font-weight: var(--xh-fw-semibold); }
.copilot-chat-mini { height: 46vh; }
@media (max-width: 640px) { .copilot-fab { right: 16px; bottom: 16px; } .copilot-panel { right: 12px; bottom: 82px; } }

/* ---- Copilot 实体链接 + 一键跳转 ---- */
.cp-link { color: var(--xh-green); cursor: pointer; border-bottom: 1px dashed var(--xh-green); font-weight: var(--xh-fw-medium); }
.cp-link:hover { background: var(--xh-soft); border-bottom-style: solid; }
.copilot-goto { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--xh-border); }
.copilot-goto .btn { font-size: var(--xh-fs-body); }

/* ---- 经营分析大屏 ---- */
.ab-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ab-kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--xh-soft-border); border-radius: 10px; background: linear-gradient(145deg, var(--xh-soft-hi), #fff 70%); }
.ab-k { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); color: var(--xh-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-v { font-size: 18px; line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-bold); color: var(--xh-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-mom { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); font-weight: var(--xh-fw-semibold); font-variant-numeric: tabular-nums; }
.ab-mom.up { color: var(--xh-green-2); }
.ab-mom.down { color: var(--xh-red); }
.ab-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.ab-num { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--xh-border); border-radius: 10px; background: #fff; }
.ab-num span { font-size: var(--xh-fs-caption); line-height: var(--xh-lh-tight); color: var(--xh-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-num b { font-size: 16px; line-height: 1.2; font-weight: var(--xh-fw-bold); color: var(--xh-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-figure { min-width: 0; }
.ab-chart { width: 100%; height: 280px; }
.ab-ym { font-size: var(--xh-fs-meta); line-height: 1; color: var(--xh-text-tertiary); font-variant-numeric: tabular-nums; padding: 4px 8px; border: 1px solid var(--xh-soft-border); border-radius: 99px; background: var(--xh-soft-hi); }
.ab-hp { font-size: var(--xh-fs-meta); line-height: 1; font-weight: var(--xh-fw-semibold); padding: 4px 10px; border-radius: 99px; }
.ab-hp.good { color: var(--xh-green-2); background: var(--xh-soft); }
.ab-hp.mid { color: #b45309; background: #fdf3e3; }
.ab-hp.low { color: var(--xh-red); background: #fdeaec; }
.ab-empty { display: flex; align-items: center; justify-content: center; height: 160px; color: var(--xh-text-tertiary); font-size: var(--xh-fs-meta); border: 1px dashed var(--xh-border); border-radius: 8px; background: var(--xh-bg); }
@media (max-width: 720px) {
  .ab-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ab-chart { height: 230px; }
}

/* ---- AI 智能排产 ---- */
.as-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-gantt { position: relative; height: 16px; min-width: 150px; border-radius: 8px; background: var(--xh-border); overflow: hidden; }
.as-gantt > i { position: absolute; top: 0; bottom: 0; border-radius: 8px; }
.as-gantt > i.ok { background: #2f9e6e; }
.as-gantt > i.wait { background: #e8a23d; }
.as-gantt > i.risk { background: #e05555; }
.as-gantt > em { position: absolute; top: -2px; bottom: -2px; right: 0; width: 2px; background: #d43a3a; }
.as-legend { display: inline-flex; flex-wrap: wrap; gap: 12px; font-size: var(--xh-fs-meta); color: var(--xh-text-tertiary); line-height: 1.4; }
.as-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.as-scheme { display: inline-block; margin: 1px 6px 1px 0; padding: 1px 7px; border-radius: 6px; background: var(--xh-soft-hi); border: 1px solid var(--xh-soft-border); font-size: var(--xh-fs-meta); line-height: 1.6; font-variant-numeric: tabular-nums; }
.as-risk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.as-risk-dot.ok { background: #2f9e6e; }
.as-risk-dot.wait { background: #e8a23d; }
.as-risk-dot.risk { background: #e05555; }
.as-srcno { color: var(--xh-deep); font-weight: var(--xh-fw-semibold); cursor: pointer; }
.as-srcno:hover { text-decoration: underline; }
.as-busy { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px; color: var(--xh-text-tertiary); }
/* ---- AI 智能履约 hub ---- */
.af-verdict { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.7; }
.af-verdict.ok { background: #ecf7f1; border: 1px solid #bfe3d2; color: #166534; }
.af-verdict.warn { background: #fdf3e2; border: 1px solid #f0d5a4; color: #92400e; }
.af-verdict.bad { background: #fdeaec; border: 1px solid #f2c0c6; color: #991b1b; }
.af-verdict-badge { flex: none; font-weight: 700; padding: 1px 10px; border-radius: 999px; font-size: 12px; line-height: 1.9; }
.af-verdict.ok .af-verdict-badge { background: #d2eedf; }
.af-verdict.warn .af-verdict-badge { background: #f7e2bb; }
.af-verdict.bad .af-verdict-badge { background: #f5cfd3; }
.af-actions { margin: 8px 0 0; padding-left: 2px; list-style: none; }
.af-actions li { position: relative; padding: 5px 0 5px 20px; color: var(--xh-text); font-size: 13px; line-height: 1.7; }
.af-actions li::before { content: '→'; position: absolute; left: 0; color: var(--xh-deep); font-weight: 700; }


