/* style.css — 物资精准装载核算系统 */
:root {
  --bg: #f4f7fb; --panel: #ffffff; --ink: #1c2b3a; --muted: #5c6f84;
  --rule: #d9e2ec; --accent: #15497e; --accent2: #2f6fb3; --accentbg: #eaf1f8;
}
* { box-sizing: border-box; }
[v-cloak] { display: none; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #0f3462, #1a4f8b); color: #fff; padding: 10px 24px; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 40px; height: 40px; border-radius: 9px; background: #fff2; display: flex;
  align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
  border: 1px solid #fff4; }
.title { font-size: 17px; font-weight: 700; }
.sub { font-size: 12px; opacity: .75; }
.tabs button { background: none; border: none; color: #dce7f3; padding: 10px 14px;
  font-size: 14px; cursor: pointer; border-radius: 6px; }
.tabs button.active { background: #ffffff22; color: #fff; font-weight: 600; }
.kb-link { margin-left: 10px; color: #dce7f3; text-decoration: none; font-size: 13px;
  border: 1px solid #ffffff33; padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
.kb-link:hover { background: #ffffff1a; color: #fff; }

.content { max-width: 1320px; margin: 18px auto; padding: 0 20px; }
section > * + * { margin-top: 12px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: #166534; }

button { border: 1px solid var(--rule); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
button:hover { border-color: var(--accent2); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent2); }
button.primary:disabled { opacity: .6; cursor: wait; }
button.link { border: none; background: none; color: var(--accent2); padding: 2px 4px; }
button.link.danger { color: #b91c1c; }
.file-btn { border: 1px solid var(--rule); background: #fff; padding: 7px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px; display: inline-block; }
.file-btn:hover { border-color: var(--accent2); color: var(--accent); }

input, select { border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px;
  font-size: 13px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--accent2); }

table.grid { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; font-size: 13px; }
table.grid th { background: var(--accentbg); color: var(--accent); text-align: left;
  padding: 9px 10px; white-space: nowrap; }
table.grid td { border-top: 1px solid var(--rule); padding: 8px 10px; vertical-align: middle; }
table.grid tr:hover td { background: #f7fafd; }
tr.disabled td { opacity: .55; }
td.empty { text-align: center; color: var(--muted); padding: 28px; }
.pill { display: inline-block; border-radius: 10px; padding: 1px 9px; font-size: 12px;
  background: var(--accentbg); color: var(--accent); }
.p-done { background: #dcebdd; color: #166534; }
.p-run { background: #fde8d7; color: #b45309; }
.p-fail { background: #fde2e2; color: #b91c1c; }
.p-heavy { background: #e2e8f0; color: #334155; }

.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; color: var(--accent); }
.task-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
@media (max-width: 980px) { .task-layout { grid-template-columns: 1fr; } }

.form-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.form-row.top { align-items: flex-start; }
.form-row > label { width: 80px; color: var(--muted); flex-shrink: 0; }
.form-row > *:last-child { flex: 1; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row.right { justify-content: flex-end; }
.pick-row { display: flex; gap: 6px; margin-bottom: 6px; }
.pick-row select { flex: 1; }
.pick-row .qty { width: 80px; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; gap: 6px; align-items: center; }
.msg { border-radius: 6px; padding: 9px 12px; font-size: 13px; }
.msg.ok { background: #e5f3e8; color: #166534; }
.msg.warn { background: #fdf0e0; color: #b45309; }

.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 18px;
  text-align: center; min-width: 96px; }
.stat b { display: block; font-size: 20px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }
.plan-actions { display: flex; gap: 8px; }
.callout { border-left: 4px solid var(--accent2); background: #eef4fa; border-radius: 0 6px 6px 0;
  padding: 9px 13px; font-size: 13px; }
.callout.warn { border-left-color: #b45309; background: #fdf6ec; }

.plan-layout { display: grid; grid-template-columns: 1fr 330px; gap: 14px; }
@media (max-width: 1100px) { .plan-layout { grid-template-columns: 1fr; } }
.viewer-panel { background: #fff; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.viewer-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; flex-wrap: wrap; }
#viewer3d { width: 100%; height: 560px; }
#viewer3d canvas { display: block; cursor: grab; }
.side-panel { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.side-panel h3 { margin: 6px 0 8px; font-size: 14px; color: var(--accent); }
.chk { border: 1px solid var(--rule); border-left-width: 4px; border-radius: 6px;
  padding: 7px 10px; margin-bottom: 7px; font-size: 12.5px; }
.chk.ok { border-left-color: #16a34a; }
.chk.bad { border-left-color: #dc2626; background: #fdf2f2; }
.chk.na { border-left-color: #94a3b8; background: #f8fafc; }
.chk span { color: var(--muted); }
.detail-list { max-height: 300px; overflow-y: auto; }
.detail-item { padding: 6px 8px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.detail-item:hover { background: var(--accentbg); }
.detail-item.hl { background: #fff3cd; }
.detail-item b { display: block; font-size: 13px; }
.detail-item span { font-size: 12px; color: var(--muted); }

.cell-input { padding: 4px 8px; width: 110px; }
.w160 { width: 170px !important; }
.empty-block { text-align: center; color: var(--muted); padding: 80px 0; background: #fff;
  border: 1px dashed var(--rule); border-radius: 10px; }

.mask { position: fixed; inset: 0; background: #0f223955; display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.dialog { background: #fff; border-radius: 12px; padding: 18px 22px; width: 460px;
  max-height: 86vh; overflow-y: auto; }
.dialog h3 { margin: 0 0 10px; color: var(--accent); }
.dialog .form-row > label { width: 170px; font-size: 13px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

/* ---- 新增：类别图例 / 禁配矩阵 / 版本管理 / 配置 / 日志 ---- */
.cat-legend { display: flex; gap: 14px; align-items: center; padding: 0 12px 8px; flex-wrap: wrap; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; cursor: pointer;
  user-select: none; background: #fff; }
.legend-chip.off { opacity: .42; }
.legend-chip i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.ver-badge { align-self: center; background: var(--accentbg); color: var(--accent);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; }
.rule-ver-panel { margin-bottom: 12px; }
.rule-ver-panel .toolbar h3 { margin: 0; }
.grid.compact td, .grid.compact th { padding: 5px 8px; font-size: 12.5px; }
.grid tr.highlight td { background: #eef6ff; }
.matrix-panel { margin-top: 14px; }
.matrix-panel .toolbar h3 { margin: 0; }
.matrix-wrap { overflow: auto; }
table.matrix { border-collapse: collapse; margin-top: 6px; }
table.matrix th, table.matrix td { border: 1px solid var(--rule); padding: 4px 6px;
  font-size: 11.5px; text-align: center; white-space: nowrap; }
table.matrix td.deny { background: #fdecec; }
table.matrix input { margin: 0; }
.dialog.wide { width: 760px; }
.compare-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.compare-head label { color: var(--muted); font-size: 13px; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 980px) { .config-grid { grid-template-columns: 1fr; } }
.info-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 2; }
.info-list code { background: #eef3f9; padding: 1px 5px; border-radius: 4px; }
pre.code { background: #0f2239; color: #d7e5f4; border-radius: 8px; padding: 12px;
  font-size: 12px; overflow: auto; line-height: 1.65; }
.log-file { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 12px; }
.log-lines { max-height: 520px; margin: 8px 0 0; white-space: pre-wrap; word-break: break-all; }
.mt { margin-top: 16px; }
