/* 小工具箱之家 · 广东通信/弱电智能化造价软件 */
.xgj-cost {
  --ink: #0b1f33;
  --ink-2: #15324c;
  --panel: #10263c;
  --line: #d5deE8;
  --line-2: #c3cedb;
  --bg: #e7eef4;
  --paper: #ffffff;
  --muted: #5b6b7c;
  --text: #1a2a3a;
  --gold: #b8860b;
  --gold-2: #8d6a0b;
  --accent: #1a5f8a;
  --accent-2: #0e4a6e;
  --ok: #1c6b45;
  --warn-bg: #fff7e6;
  --warn-bd: #e2b65c;
  --warn-tx: #7a4e00;
  --danger: #9b1c1c;
  --row-alt: #f4f7fa;
  --row-hover: #eef5fb;
  --sel: #e8f1f8;
  --shadow: 0 1px 2px rgba(11,31,51,.06), 0 8px 24px rgba(11,31,51,.08);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  box-sizing: border-box;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0 auto 8px;
  max-width: 1480px;
}
.xgj-cost *, .xgj-cost *::before, .xgj-cost *::after { box-sizing: border-box; }
.xgj-cost button, .xgj-cost input, .xgj-cost select, .xgj-cost textarea {
  font-family: inherit;
}
.xgj-cost a { color: var(--accent); }

/* break out of Odoo container a bit */
.s_embed_code_embedded.container:has(.xgj-cost) {
  max-width: 100%;
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

.xgj-cost .topbar {
  background: linear-gradient(180deg, #15324c 0%, #0b1f33 100%);
  color: #f3f6f9;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  border-radius: 10px 10px 0 0;
}
.xgj-cost .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  flex: 1;
}
.xgj-cost .logo {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 8px;
  background: #c9a227;
  color: #0b1f33;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: -0.04em;
}
.xgj-cost .brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.25;
}
.xgj-cost .brand .sub {
  margin: 0;
  font-size: 11px;
  color: #c5d4e2;
  font-weight: 500;
}
.xgj-cost .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.xgj-cost .btn {
  appearance: none;
  border: 1px solid transparent;
  background: #1a5f8a;
  color: #fff;
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 34px;
  line-height: 1.2;
}
.xgj-cost .btn:hover { filter: brightness(1.08); }
.xgj-cost .btn:active { transform: translateY(1px); }
.xgj-cost .btn.ghost {
  background: transparent;
  border-color: #6f879c;
  color: #e8eef4;
}
.xgj-cost .btn.gold {
  background: #c9a227;
  color: #1a1404;
}
.xgj-cost .btn.danger {
  background: transparent;
  border-color: #e8a0a0;
  color: #fecaca;
}
.xgj-cost .btn.sm {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 650;
}
.xgj-cost .btn.light {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-2);
}
.xgj-cost .btn.light:hover { border-color: var(--accent); color: var(--accent); }

.xgj-cost .disclaimer {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-top: 0;
  color: var(--warn-tx);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
}

.xgj-cost .workflow-hint {
  background: #eef6fb;
  border: 1px solid var(--line);
  border-top: 0;
  color: var(--accent-2);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}
.xgj-cost .coeff-bar {
  background: #fffaf0;
  border: 1px solid #e2b65c;
  border-top: 0;
  padding: 8px 12px 10px;
}
.xgj-cost .coeff-title {
  font-size: 13px;
  font-weight: 800;
  color: #7a4e00;
  margin: 0 0 6px;
}
.xgj-cost .coeff-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 10px;
}
.xgj-cost .coeff-bar .fld label {
  font-size: 11px;
  color: #7a4e00;
  font-weight: 700;
}
.xgj-cost .coeff-bar .fld input,
.xgj-cost .coeff-bar .fld select {
  width: 100%;
  border: 1px solid #e2b65c;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.xgj-cost .coeff-bar .fld input:focus,
.xgj-cost .coeff-bar .fld select:focus {
  outline: 2px solid rgba(184,134,11,.35);
  border-color: var(--gold);
}
.xgj-cost .coeff-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: #7a4e00;
  line-height: 1.5;
  font-weight: 500;
}
.xgj-cost .info {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 10px 12px 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 10px;
}
.xgj-cost .fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.xgj-cost .fld.span2 { grid-column: span 2; }
.xgj-cost .fld label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.xgj-cost .fld input, .xgj-cost .fld select, .xgj-cost .lib-search, .xgj-cost .grid input[type="text"],
.xgj-cost .grid input[type="number"], .xgj-cost .grid select, .xgj-cost textarea.feat {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  min-height: 30px;
}
.xgj-cost .fld input:focus, .xgj-cost .lib-search:focus,
.xgj-cost .grid input:focus, .xgj-cost .grid select:focus, .xgj-cost textarea.feat:focus {
  outline: 2px solid #b9d6ea;
  border-color: var(--accent);
}

.xgj-cost .workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 268px;
  gap: 0;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--bg);
  min-height: 640px;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
.xgj-cost .left, .xgj-cost .right, .xgj-cost .main {
  background: var(--paper);
  min-width: 0;
}
.xgj-cost .left { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.xgj-cost .right { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.xgj-cost .pane-h {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  background: #f0f4f8;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.04em;
}
.xgj-cost .tree { padding: 6px 6px 10px; }
.xgj-cost .tree-item, .xgj-cost .lib-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.xgj-cost .tree-item:hover, .xgj-cost .lib-item:hover { background: var(--row-hover); }
.xgj-cost .tree-item.active { background: var(--sel); color: var(--accent-2); font-weight: 750; }
.xgj-cost .tree-item .n, .xgj-cost .amt {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.xgj-cost .tree-item.active .n { color: var(--accent); }

.xgj-cost .lib-box { border-top: 1px solid var(--line); flex: 1; display: flex; flex-direction: column; min-height: 220px; }
.xgj-cost .lib-tools { padding: 8px; }
.xgj-cost .lib-list { overflow: auto; flex: 1; padding: 0 6px 10px; max-height: 420px; }
.xgj-cost .lib-item { flex-direction: column; align-items: flex-start; border: 1px solid transparent; margin-bottom: 4px; }
.xgj-cost .lib-item b { font-size: 12.5px; }
.xgj-cost .lib-item span { font-size: 11px; color: var(--muted); }
.xgj-cost .lib-item .tag { font-size: 10px; background: #eef3f8; border-radius: 999px; padding: 0 6px; color: #35506a; }

.xgj-cost .main { display: flex; flex-direction: column; }
.xgj-cost .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #f0f4f8;
  border-bottom: 1px solid var(--line);
}
.xgj-cost .tab {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #3c5164;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.xgj-cost .tab:hover { color: var(--accent); }
.xgj-cost .tab.active { color: var(--ink); border-bottom-color: var(--gold); background: #fff; }

.xgj-cost .main-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.xgj-cost .hint { font-size: 12px; color: var(--muted); margin-left: auto; }

.xgj-cost .grid-wrap { overflow: auto; flex: 1; max-height: 620px; }
.xgj-cost table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 1080px;
}
.xgj-cost table.grid th {
  position: sticky; top: 0; z-index: 2;
  background: #15324c;
  color: #f4f7fb;
  font-weight: 700;
  text-align: left;
  padding: 7px 6px;
  white-space: nowrap;
}
.xgj-cost table.grid td {
  border-bottom: 1px solid #e4ebf2;
  padding: 4px 5px;
  vertical-align: middle;
}
.xgj-cost table.grid tbody tr:nth-child(even) { background: var(--row-alt); }
.xgj-cost table.grid tbody tr:hover { background: var(--row-hover); }
.xgj-cost table.grid tbody tr.sys-row td {
  background: #e8eef5;
  font-weight: 800;
  color: var(--ink);
  padding: 7px 6px;
}
.xgj-cost table.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xgj-cost table.grid input.qty, .xgj-cost table.grid input.rate {
  width: 84px;
  text-align: right;
  padding: 3px 5px;
  min-height: 28px;
}
.xgj-cost table.grid th.fill-h { background: #8d6a0b; }
.xgj-cost table.grid th.auto-h { background: #0e4a6e; }
.xgj-cost table.grid th .sub { display: block; font-weight: 500; font-size: 10px; opacity: .9; }
.xgj-cost table.grid td.fill-cell { background: #fff8e8; }
.xgj-cost table.grid td.auto-cell { color: #15324c; }
.xgj-cost table.grid input.fill {
  background: #fffdf6;
  border-color: #e2b65c;
  font-weight: 650;
}
.xgj-cost table.grid .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: #3a4d60; }
.xgj-cost table.grid .ops { white-space: nowrap; }
.xgj-cost table.grid .ops button {
  border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; padding: 2px 4px;
}
.xgj-cost table.grid .ops button.del { color: var(--danger); }
.xgj-cost tr.expand td { background: #f7fafc !important; }
.xgj-cost .compose {
  display: grid;
  grid-template-columns: 1.3fr repeat(6, minmax(70px, .7fr));
  gap: 8px;
  padding: 4px 0;
}
.xgj-cost .compose label { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.xgj-cost textarea.feat { min-height: 58px; resize: vertical; }

.xgj-cost .totals { padding: 8px 10px 14px; }
.xgj-cost .t-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed #e0e7ee;
}
.xgj-cost .t-row span { color: var(--muted); }
.xgj-cost .t-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.xgj-cost .t-row.grand {
  border-bottom: 0;
  background: #132a42;
  color: #fff;
  margin: 8px -10px 0;
  padding: 12px 12px;
  border-radius: 8px;
  align-items: baseline;
}
.xgj-cost .t-row.grand span { color: #c9d7e4; font-weight: 700; }
.xgj-cost .t-row.grand b { color: #f3d27a; font-size: 18px; }
.xgj-cost .t-note { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.xgj-cost .badge-ex {
  display: inline-block;
  background: #fff3d6;
  color: #7a4e00;
  border: 1px solid #e2b65c;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 4px;
  vertical-align: middle;
}

.xgj-cost .sheet { padding: 12px 14px 20px; overflow: auto; }
.xgj-cost .sheet h3 { margin: 0 0 8px; font-size: 16px; }
.xgj-cost .sheet p, .xgj-cost .sheet li { font-size: 13px; color: #2a3b4c; }
.xgj-cost .sheet ol, .xgj-cost .sheet ul { padding-left: 18px; }
.xgj-cost .src a { word-break: break-all; }
.xgj-cost .fee-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.xgj-cost .fee-table th, .xgj-cost .fee-table td { border: 1px solid var(--line); padding: 6px 8px; }
.xgj-cost .fee-table th { background: #f0f4f8; text-align: left; }
.xgj-cost .fee-table input[type="number"] { width: 90px; text-align: right; }
.xgj-cost .status {
  font-size: 12px;
  color: var(--ok);
  min-height: 18px;
}

.xgj-cost .print-only { display: none; }

@media (max-width: 1100px) {
  .xgj-cost .workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .xgj-cost .right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .xgj-cost .info { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xgj-cost .coeff-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .xgj-cost .topbar { padding: 10px; }
  .xgj-cost .brand h1 { font-size: 15px; }
  .xgj-cost .workspace { grid-template-columns: 1fr; min-height: 0; }
  .xgj-cost .left { border-right: 0; border-bottom: 1px solid var(--line); }
  .xgj-cost .lib-list { max-height: 220px; }
  .xgj-cost .info { grid-template-columns: 1fr 1fr; }
  .xgj-cost .coeff-fields { grid-template-columns: 1fr 1fr; }
  .xgj-cost .fld.span2 { grid-column: span 2; }
  .xgj-cost .grid-wrap { max-height: 70vh; }
  .xgj-cost table.grid { min-width: 980px; }
  .xgj-cost .hint { margin-left: 0; width: 100%; }
  .xgj-cost .compose { grid-template-columns: 1fr 1fr; }
}

@media print {
  body * { visibility: hidden; }
  .xgj-cost, .xgj-cost .print-root, .xgj-cost .print-root * { visibility: visible; }
  .xgj-cost .topbar, .xgj-cost .toolbar, .xgj-cost .left, .xgj-cost .tabs,
  .xgj-cost .main-tools, .xgj-cost .ops, .xgj-cost .btn, .xgj-cost .lib-box {
    display: none !important;
  }
  .xgj-cost { background: #fff; max-width: none; }
  .xgj-cost .print-only { display: block; }
  .xgj-cost .workspace { display: block; border: 0; }
  .xgj-cost .right, .xgj-cost .main { border: 0; }
  .xgj-cost .grid-wrap, .xgj-cost .lib-list, .xgj-cost .sheet { max-height: none; overflow: visible; }
  .xgj-cost table.grid { min-width: 0; }
  .xgj-cost table.grid th { position: static; background: #15324c !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
