/* base.css —— 基座层：数值全部来自 spec/css/tokens-meas.json（浏览器实测，src=meas）
   规则只用 html body 前缀压权重，最后加载，只盖不删 */
html body {
  margin: 0;
  font: 12px/1.5 Arial, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Helvetica, sans-serif;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 外壳 ---------- */
html body .fx-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

html body .fx-topbar {
  height: 34px; flex: 0 0 34px; display: flex; align-items: center; gap: 14px;
  padding: 0 12px; background: #f5f5f5; border-bottom: 1px solid #cccccc;
}
html body .fx-brand { font-size: 13px; font-weight: 700; color: #1b3a5c; letter-spacing: .3px; }
html body .fx-brand span { font-weight: 400; color: #8a94a6; font-size: 12px; margin-left: 6px; }
html body .fx-topbar .fx-spacer { flex: 1; }
html body .fx-chip {
  font-size: 11px; padding: 2px 8px; border: 1px solid #d6dae0; border-radius: 10px;
  background: #fff; color: #4a5058;
}
html body .fx-chip b { color: #1a5fb4; font-weight: 600; }

html body .fx-body { flex: 1; display: flex; min-height: 0; }

/* ---------- 左树 ---------- */
html body .fx-side {
  width: 226px; flex: 0 0 226px; border-right: 1px solid #e3e6ea; background: #fafbfc;
  display: flex; flex-direction: column; min-height: 0;
}
html body .fx-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 6px; border-bottom: 1px solid #e3e6ea; }
html body .fx-tabs::-webkit-scrollbar { display: none; }
html body .fx-tab {
  flex: 0 0 auto; font-size: 12px; padding: 3px 7px; border: 1px solid transparent; border-radius: 3px;
  color: #333; background: transparent; cursor: pointer;
}
html body .fx-tab:hover { background: #eef4fd; }
html body .fx-tab.on { background: #1a5fb4; border-color: #1a5fb4; color: #fff; }

html body .fx-tree { flex: 1; overflow: auto; padding: 4px 0 20px; }
html body .fx-node {
  display: flex; align-items: center; gap: 4px; padding: 3px 8px; cursor: pointer;
  font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid transparent;
}
html body .fx-node:hover { background: #eef4fd; }
html body .fx-node.on { background: #e2edfb; border-left-color: #1a5fb4; color: #1a5fb4; }
html body .fx-node .fx-caret { width: 10px; color: #9aa3ad; font-size: 10px; }
html body .fx-node .fx-dot { width: 5px; height: 5px; border-radius: 50%; background: #c6ccd4; }
html body .fx-node.leaf .fx-dot { background: #1a5fb4; }
html body .fx-node .fx-mut { color: #a6adb6; font-size: 11px; margin-left: auto; }

/* ---------- 主区 ---------- */
html body .fx-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* 工具栏：实测 .tb-item 30px / 12px / #333 */
html body .fx-toolbar {
  height: 30px; flex: 0 0 30px; display: flex; align-items: center; gap: 1px;
  padding: 0 6px; border-bottom: 1px solid #cccccc; background: #fafafa;
  overflow-x: auto; overflow-y: hidden;
}
html body .fx-tb {
  height: 30px; line-height: 30px; padding: 0 9px; font-size: 12px; color: #333;
  background: transparent; border: 0; cursor: pointer; white-space: nowrap;
}
html body .fx-tb:hover { background: #e8f1fc; }
html body .fx-tb:disabled { color: #b6bcc4; cursor: default; background: transparent; }
html body .fx-tb-sep { width: 1px; height: 16px; background: #d9dde2; margin: 0 4px; }

/* 条件条 */
html body .fx-cond {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 7px 10px; border-bottom: 1px solid #e3e6ea; background: #fff; font-size: 12px;
}
html body .fx-cond label { color: #4a5058; }
html body .fx-cond input, html body .fx-cond select {
  height: 24px; padding: 0 6px; border: 1px solid #a7a7a7; border-radius: 2px;
  font-size: 12px; color: #000; background: #fff; outline: none;
}
html body .fx-cond input:focus, html body .fx-cond select:focus { border-color: #1a5fb4; }

/* 网格：实测 th 13px/#000/400/#e8e8e8，td 13px 线 #cccccc */
html body .fx-gridwrap { flex: 1; overflow: auto; min-height: 0; padding: 0; }
html body table.fx-grid { border-collapse: collapse; width: 100%; font-size: 13px; }
html body table.fx-grid thead th {
  position: sticky; top: 0; z-index: 2;
  height: 28px; padding: 0 5px; font-size: 13px; font-weight: 400; color: #000;
  background: #e8e8e8; border-right: 1px solid #d5d5d5; border-bottom: 1px solid #cccccc;
  text-align: center; white-space: nowrap;
}
html body table.fx-grid tbody td {
  height: 25px; padding: 0 5px; font-size: 13px; color: #000;
  border-right: 1px solid #e2e2e2; border-bottom: 1px solid #cccccc; white-space: nowrap;
}
html body table.fx-grid tbody tr:nth-child(even) td { background: #fbfcfd; }
html body table.fx-grid tbody tr:hover td { background: #fef6cb; }
html body table.fx-grid tbody tr.total td {
  font-size: 14px; font-weight: 700; color: #333; background: #f5f5f5;
  border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc;
}
html body .fx-empty { padding: 26px 10px; text-align: center; color: #9aa3ad; font-size: 12px; }

/* 录单页字段网格：录入框实测 24px / 边框 #a7a7a7 */
html body .fx-form { padding: 12px 14px; overflow: auto; }
html body .fx-form h3 {
  font-size: 12px; font-weight: 700; color: #1b3a5c; margin: 14px 0 8px;
  padding-bottom: 5px; border-bottom: 1px solid #e3e6ea;
}
html body .fx-form h3:first-child { margin-top: 0; }
html body .fx-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px 16px; }
html body .fx-f { display: flex; align-items: center; gap: 6px; }
html body .fx-f > span { flex: 0 0 88px; text-align: right; color: #4a5058; font-size: 12px; }
html body .fx-f > span.req:before { content: "*"; color: #d0021b; margin-right: 2px; }
html body .fx-f input, html body .fx-f select {
  flex: 1; min-width: 0; height: 24px; padding: 0 6px; font-size: 12px;
  border: 1px solid #a7a7a7; border-radius: 2px; background: #fff; color: #000; outline: none;
}
html body .fx-f input:focus { border-color: #1a5fb4; }
html body .fx-f input.ro { background: #e6e6e6; color: #555; }

/* 概览卡 */
html body .fx-over { padding: 16px 18px; overflow: auto; }
html body .fx-over h2 { font-size: 14px; margin: 0 0 4px; color: #1b3a5c; }
html body .fx-over p.sub { font-size: 12px; color: #8a94a6; margin: 0 0 16px; }
html body .fx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
html body .fx-card { border: 1px solid #e3e6ea; border-radius: 6px; padding: 10px 12px; background: #fff; }
html body .fx-card .n { font-size: 20px; font-weight: 700; color: #1a5fb4; letter-spacing: -.4px; }
html body .fx-card .l { font-size: 11.5px; color: #8a94a6; margin-top: 2px; }
html body .fx-note {
  margin-top: 16px; padding: 10px 12px; border-left: 3px solid #1a5fb4; background: #f4f8fe;
  font-size: 12px; color: #4a5058; line-height: 1.8;
}
html body .fx-note b { color: #1b3a5c; }

html body .fx-status {
  height: 24px; flex: 0 0 24px; display: flex; align-items: center; gap: 14px;
  padding: 0 10px; border-top: 1px solid #e3e6ea; background: #fafbfc;
  font-size: 11px; color: #8a94a6;
}
html body .fx-err { margin: 10px; padding: 10px 12px; border: 1px solid #f0c4c4; background: #fdeeee; color: #b4232c; font-size: 12px; border-radius: 4px; }
