:root {
  font-family: Inter, "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: #1c2b40; background: #eef2f7; font-size: 14px;
  --nav: #132946; --blue: #245fbd; --border: #dce4ee; --muted: #52647c;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #4184e0; outline-offset: 2px;
}
.top { min-height: 62px; display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; background: var(--nav); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center;
  background: #3877d1; border-radius: 8px; font-size: 16px; }
.account { display: flex; align-items: center; gap: 8px; color: #d8e5f7; }
.account-dot { width: 8px; height: 8px; border-radius: 50%; background: #68d4ad; }
.groups { display: flex; overflow: auto; background: #1c385c; padding: 0 13px; }
.groups button { border: 0; background: none; color: #e3ebf7; padding: 13px 17px;
  white-space: nowrap; border-bottom: 3px solid transparent; }
.groups button[aria-current] { background: #264a75; border-color: #79b3ff; color: #fff; }
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100vh - 110px); }
.side { background: #fbfcfe; border-right: 1px solid var(--border); }
.side-head { padding: 19px 16px 12px; font-weight: 700; color: #2e4764; }
#tree { padding: 0 9px 12px; max-height: calc(100vh - 175px); overflow: auto; }
#tree summary { padding: 9px 8px; cursor: pointer; font-weight: 600; }
.tree-entry { display: block; width: 100%; border: 0; text-align: left; background: transparent;
  color: #314962; padding: 8px 6px 8px 20px; border-radius: 5px; }
.tree-entry:hover, .tree-entry[aria-current] { background: #e4eefc; color: #174a97; }
.tabs { min-height: 47px; display: flex; align-items: end; gap: 3px; overflow: auto;
  padding: 8px 13px 0; background: #e5ebf4; border-bottom: 1px solid var(--border); }
.tab { display: flex; background: #eef2f7; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 5px 5px 0 0; white-space: nowrap; }
.tab.active { background: #fff; color: #194f9e; }
.tab button { border: 0; background: transparent; padding: 9px 11px; color: inherit; }
.tab .close-tab { padding-left: 2px; }
.content { padding: 25px; }
.crumb { color: var(--muted); margin-bottom: 8px; font-size: 12px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 26px; letter-spacing: -.35px; margin-bottom: 9px; }
h2 { font-size: 17px; margin-bottom: 13px; }
.hero { border: 1px solid #cfdff3; border-radius: 10px; padding: 27px; color: #153762;
  background: linear-gradient(105deg, #ffffff, #e8f1ff); margin-bottom: 22px; }
.hero p, .subtle { color: var(--muted); }
.hero p { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { text-align: left; padding: 16px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; color: #24415f; font-weight: 600; min-height: 72px; }
.card:hover { border-color: #85a9d7; background: #f8fbff; }
.card span { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: 12px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.notice { padding: 19px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px; align-items: center; }
.toolbar form { display: flex; gap: 7px; flex-wrap: wrap; }
.btn { border: 1px solid #c8d4e3; background: #fff; color: #24415f; border-radius: 5px; padding: 7px 12px; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
input, select, textarea { color: inherit; background: #fff; border: 1px solid #c8d4e3;
  border-radius: 5px; padding: 7px 9px; min-width: 0; max-width: 100%; }
input[type=search] { width: 235px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid #e5ebf2; white-space: nowrap; }
th { background: #f1f5fa; font-weight: 600; color: #314963; }
td { max-width: 350px; overflow: hidden; text-overflow: ellipsis; }
tr:hover td { background: #f8fbff; }
.blank { padding: 25px; color: var(--muted); }
.pager { padding: 10px 13px; display: flex; align-items: center; gap: 9px; color: var(--muted); }
.status { font-size: 13px; min-height: 1.25em; color: #236144; }
.status.error { color: #a32828; }
.link { color: #1854a7; border: 0; background: none; padding: 0; }
dialog { border: 1px solid #c3d3e7; border-radius: 10px; width: min(925px, 96vw);
  max-height: 90vh; color: inherit; padding: 0; }
dialog::backdrop { background: #13294670; }
.dialog-body { padding: 19px; }
.dialog-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 13px; margin-bottom: 16px; }
.field-grid label { display: grid; gap: 5px; font-size: 13px; }
.req { color: #a32828; }
.editor-actions { display: flex; gap: 8px; justify-content: end; align-items: center; margin-top: 14px; }
.editor-actions .status { flex: 1; }
.line-table input, .line-table select { width: 100%; min-width: 105px; }
.line-table td, .line-table th { padding: 6px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.detail-head h2 { margin: 0; }
@media (max-width: 700px) {
  .shell { grid-template-columns: 145px minmax(0, 1fr); }
  .content { padding: 12px; }
  .groups button { padding-inline: 9px; }
  .top { padding-inline: 12px; }
}.mirror-banner { padding: 9px 14px; background: #fff7e0; border-bottom: 1px solid #f0dca0; color: #7a5a00; font-size: 13px; }
.content > .panel + .panel { margin-top: 16px; }
.content > .btn { margin-bottom: 10px; }

.table-scroll.report-wide table { width: max-content; min-width: 100%; font-size: 13px; }
.table-scroll.report-wide th, .table-scroll.report-wide td { padding: 6px 8px; }
/* 原表网格在屏幕和直接打印中均保留，包括小计/合计。 */
table { border-collapse: collapse; }
th, td { border: 1px solid #000; }
@media print {
  .top, .sidebar, .mirror-banner, .subtle, .btn, .detail-head button, .grid-tools, .screen-only, .toolbar { display: none !important; }
  th, td { border: 1px solid #000 !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .table-scroll { overflow: visible; }
}

/* 2026-11-15 报表网格修复：Excel导入的单元格内联样式会覆盖表格线；表头/编号按钮去掉按钮框 */
.content table:not(.trial table):not(.rd-v2 table) :is(th, td) { border: 1px solid #000 !important; }
.content table:not(.trial table):not(.rd-v2 table) :is(th, td) > button {
  border: 0 !important; background: none !important; box-shadow: none !important; padding: 2px 0 !important;
  font: inherit; color: inherit; text-align: inherit; cursor: pointer; min-height: 0; }
.content table:not(.trial table):not(.rd-v2 table) td > button { color: #1854a7; }
.content table:not(.trial table):not(.rd-v2 table) th > button { font-weight: 600; }

/* 万能查询与配方草稿 */
.vq-input { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.vq-input textarea { width:100%; box-sizing:border-box; font:inherit; padding:8px; }
.vq-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.vq-other-queries > summary { cursor:pointer; }
.vq-other-queries > .vq-actions { margin-top:8px; }
.vq-conv-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.vq-conv-heading h2 { margin:0; }
.vq-conv { border:1px solid #d7dbe2; border-radius:6px; padding:10px; min-height:120px; max-height:320px; overflow:auto; margin-bottom:12px; }
.vq-messages { display:flex; flex-direction:column; gap:6px; }
.vq-msg { padding:8px 10px; border-radius:6px; max-width:90%; }
.vq-msg-user { align-self:flex-end; background:#e8f1ff; }
.vq-msg-sys { align-self:flex-start; background:#f4f6f8; }
.vq-options { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.vq-loading { color:#5b6572; }
.vq-result { border-top:1px dashed #d7dbe2; padding-top:10px; }
.vq-history { border-top:1px solid #d7dbe2; margin-top:12px; padding-top:10px; }
.vq-history summary { cursor:pointer; font-weight:600; }
.vq-history-messages { max-height:320px; overflow:auto; }
.vq-summary { margin-bottom:8px; }
.vq-answer { margin:0 0 12px; padding:10px 12px; background:#f1f7f2; border-left:3px solid #3f8f5f; white-space:pre-wrap; line-height:1.7; }
.vq-summary p { margin:2px 0; }
.vq-density { display:flex; align-items:center; gap:8px; margin:8px 0; }
