:root {
  --ink: #1a2332;
  --muted: #5b6575;
  --paper: #f5f8fc;
  --line: #d7e2ef;
  --green: #1a5fb4;
  --light: #e8f1fb;
  --gold: #0b5cab;
  --red: #a23c32;
  --white: #fff;
  --shadow: 0 12px 36px #173b330a;
  font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
a {
  color: var(--green);
  text-decoration: none;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 13px;
  background: white;
  color: var(--ink);
  font-weight: 600;
}
button:hover {
  background: var(--light);
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.primary:hover {
  background: #0b5cab;
}
button.danger {
  color: var(--red);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd7ce;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
}
input[aria-invalid='true'] {
  border-color: var(--red);
}
textarea {
  resize: vertical;
  min-height: 76px;
}
input[type='file'] {
  min-height: auto;
}
.topbar {
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(26, 95, 180, 0.06);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.brand {
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 18px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand-link .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  padding: 1px;
  flex-shrink: 0;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.4px;
  opacity: 0.72;
  margin-top: 3px;
  color: var(--muted);
}
.topbar nav {
  display: flex;
  gap: 8px 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topbar a {
  color: #5b6575;
  font-size: 14px;
  font-weight: 560;
  padding: 8px 6px;
  border-radius: 8px;
}
.topbar a:hover { color: #1a5fb4; background: #e8f1fb; }
.topbar a.nav-cta {
  color: #fff;
  background: #1a5fb4;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 650;
}
.topbar a.nav-cta:hover { background: #0b5cab; color: #fff; }
.badge {
  font-size: 11px;
  border: 1px solid #b8c9de; color: #1a5fb4; background: #e8f1fb;
  padding: 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .topbar { padding: 12px 16px; flex-direction: column; align-items: flex-start; }
  .topbar nav { width: 100%; }
  .brand small { letter-spacing: 0; }
}
.shell {
  max-width: 1580px;
  margin: auto;
  padding: 24px 28px 48px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin: 0 0 22px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 6px;
}
.intro h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0 0 8px;
}
.intro p {
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.panel h2 {
  font-size: 15px;
  margin: 0 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel h3 {
  font-size: 13px;
  margin: 20px 0 10px;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.section-mark {
  font-size: 10px;
  color: var(--green);
  letter-spacing: 1px;
}
.stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fields.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
label input,
label textarea,
label select {
  margin-top: 6px;
}
.full {
  grid-column: 1/-1;
}
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 6px;
}
.note {
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: #faf6ec;
  line-height: 1.7;
  font-size: 12px;
  color: #70552f;
  border-radius: 3px;
}
.note.green {
  border-color: var(--green);
  background: var(--light);
  color: var(--ink);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
}
.kpi .label {
  font-size: 11px;
  color: var(--muted);
}
.kpi .value {
  font-family: 'Segoe UI', sans-serif;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.7px;
  margin: 6px 0;
}
.kpi .unit {
  font-size: 11px;
  color: var(--muted);
}
.kpi.emphasis {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.kpi.emphasis .label,
.kpi.emphasis .unit {
  color: #c0d4c7;
}
.table-wrap {
  overflow: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th {
  text-align: left;
  color: var(--muted);
  background: #f6f8f4;
  font-weight: 500;
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 8px;
  border-bottom: 1px solid #e8ede7;
  vertical-align: top;
}
td input,
td select {
  padding: 7px;
  min-height: 34px;
  font-size: 12px;
  margin: 0;
}
td.num,
th.num {
  text-align: right;
}
.quote-table {
  min-width: 840px;
}
.quote-table th:nth-child(1) {
  width: 10%;
}
.quote-table th:nth-child(2) {
  width: 21%;
}
.quote-table th:nth-child(3) {
  width: 18%;
}
.quote-table th:nth-child(4) {
  width: 7%;
}
.quote-table th:nth-child(5) {
  width: 9%;
}
.quote-table th:nth-child(6) {
  width: 12%;
}
.quote-table th:nth-child(7) {
  width: 8%;
}
.row-remove {
  padding: 6px 8px;
  border: 0;
  color: var(--red);
  font-weight: 400;
}
.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 12px;
}
.totals {
  display: grid;
  gap: 10px;
}
.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf0ec;
}
.total-line strong {
  text-align: right;
}
.project-list {
  display: grid;
  gap: 7px;
}
.project-card {
  text-align: left;
  display: block;
  width: 100%;
  padding: 12px;
}
.project-card b {
  display: block;
  overflow-wrap: anywhere;
}
.project-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.empty {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 7px;
}
.alert {
  display: none;
  margin-bottom: 16px;
  border: 1px solid #edc2bd;
  background: #fff4f1;
  color: var(--red);
  padding: 12px 16px;
  border-radius: 7px;
  line-height: 1.8;
}
.alert.show {
  display: block;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 9px;
  padding: 13px 20px;
  max-width: 90vw;
  z-index: 10;
  box-shadow: 0 8px 30px #0003;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.status:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.footer {
  margin-top: 22px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.drawing-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}
.drawing-area {
  background: #f6f8f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}
.drawing-area svg {
  width: 100%;
  height: auto;
  min-width: 520px;
  display: block;
}
.drawing-panel {
  padding: 12px;
}
.drawing-area .drawing-text {
  font-family: 'Microsoft YaHei', sans-serif;
}
.drawing-layout .fields {
  grid-template-columns: 1fr 1fr;
}
.drawing-layout .panel h2 {
  margin-bottom: 12px;
}
.result-list {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 12px 4px;
  color: var(--muted);
}
.result-list strong {
  color: var(--ink);
}
.wide-button {
  width: 100%;
  margin-top: 9px;
}
.source-tag {
  font-size: 10px;
  background: var(--light);
  color: var(--green);
  padding: 4px 6px;
  border-radius: 4px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.check input {
  width: 16px;
  min-height: 16px;
  margin-top: 1px;
}
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.upload-label {
  display: inline-flex;
  border: 1px solid var(--line);
  padding: 10px 13px;
  border-radius: 7px;
  background: white;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
}
.upload-label input {
  display: none;
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .fields,
  .fields.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .drawing-layout {
    grid-template-columns: 265px minmax(0, 1fr);
  }
  .intro {
    flex-direction: column;
    gap: 14px;
  }
  .intro h1 {
    font-size: 25px;
  }
}
@media (max-width: 720px) {
  .topbar {
    padding: 16px;
    align-items: flex-start;
  }
  .topbar nav {
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
  }
  .shell {
    padding: 18px 12px 36px;
  }
  .workspace,
  .drawing-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .panel {
    padding: 16px;
  }
  .fields,
  .fields.two,
  .fields.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    padding: 14px;
  }
  .kpi .value {
    font-size: 23px;
  }
  .intro h1 {
    font-size: 23px;
  }
  .drawing-area svg {
    min-width: 500px;
  }
  .actions button,
  .actions .upload-label {
    font-size: 12px;
    padding: 9px 10px;
  }
  .comparison {
    grid-template-columns: 1fr;
  }
  .table-tools {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media print {
  .topbar,
  .sidebar,
  .actions,
  .footer,
  .table-tools {
    display: none;
  }
  .shell {
    padding: 0;
  }
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
  .drawing-layout {
    display: block;
  }
  .drawing-layout > aside {
    display: none;
  }
  .drawing-area {
    border: 0;
  }
  .drawing-area svg {
    min-width: 0;
  }
  .note {
    break-inside: avoid;
  }
}

.quote-table select {
  min-width: 70px;
}
.archive-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.archive-tools label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.archive-tools input[type='search'] {
  min-width: 0;
  width: 100%;
}
.archive-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.archive-actions button,
.archive-actions .upload-label {
  font-size: 12px;
  padding: 8px 10px;
}
.archive-card {
  border: 1px solid #d5e1d8;
  border-radius: 9px;
  padding: 12px;
  background: #fff;
}
.archive-card b,
.archive-card small {
  display: block;
  overflow-wrap: anywhere;
}
.archive-card small {
  color: #63756b;
  margin: 6px 0 10px;
  font-size: 11px;
}
.diff-dialog {
  width: min(960px, 94vw);
  max-height: 88vh;
  padding: 26px;
  border: 1px solid #c6d8ca;
  border-radius: 16px;
  color: #18392f;
}
.diff-dialog::backdrop {
  background: rgba(16, 41, 33, 0.52);
}
.diff-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.diff-heading h2 {
  margin: 0;
}
.diff-dialog table {
  table-layout: fixed;
}
.diff-dialog td,
.diff-dialog th {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.compare-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.compare-kpis > div {
  padding: 14px;
  border-radius: 10px;
  background: #edf3ee;
}
.compare-kpis p {
  margin: 7px 0 0;
}
.compare-kpis small {
  color: #63756b;
}
@media (max-width: 720px) {
  .diff-dialog {
    padding: 16px;
  }
  .compare-kpis {
    grid-template-columns: 1fr;
  }
}

/* Customer free edition extras */
.topbar nav a { margin-right: 10px; }
@media (max-width: 720px) {
  #lead > div[style*="grid-template-columns"] {
    display: block !important;
  }
  #lead img { margin-bottom: 12px; }
}

/* —— 浅色版：顶栏按钮与官网统一（玻璃绿） —— */
.topbar .brand, .topbar .brand-link { font-family: "Bahnschrift","DIN Alternate","Microsoft YaHei",sans-serif; }
.topbar .brand small { font-family: "Microsoft YaHei","PingFang SC",sans-serif; }
.topbar a:hover { color: #15222c; background: #ebf1ef; }
.topbar a.nav-cta { color: #fff; background: #0f6a54; border-radius: 6px; }
.topbar a.nav-cta:hover { color: #fff; background: #0a5544; }
.topbar .badge { color: #0f6a54; background: #e2efea; border-color: rgba(15,106,84,.24); }
:root { --green: #0f6a54; --gold: #0a5544; --light: #e2efea; }
button.primary:hover { background: #0a5544; }
