/* 经营订单的业务选择和核算摘要。 */
.fo-page {
  container: finance-orders / inline-size;
  min-width: 0;
}
.fo-page .fo-page-head {
  margin: 0 0 16px;
}
.fo-page .fo-page-head h1 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy-2);
}
.fo-toolbar, .fo-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.fo-toolbar { margin-bottom: 18px; }
.fo-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 16px 22px;
}
.fo-picker {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
}
.fo-picker > span, .fo-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.fo-picker strong, .fo-picker select {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  font-weight: 600;
}
.fo-picker strong {
  display: flex;
  align-items: center;
  min-height: 36px;
  overflow-wrap: anywhere;
}
.fo-picker select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--thead);
  cursor: pointer;
}
.fo-picker select:hover { border-color: var(--brand); }
.fo-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
}
.fo-views a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 44px;
  padding: 8px 10px;
  line-height: 1.35;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.fo-views a:hover, .fo-views a[aria-current] { color: var(--brand); }
.fo-views a[aria-current] { font-weight: 700; }
.fo-views a[aria-current]::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
  content: "";
}
.fo-sheet {
  margin: 0 0 16px;
  padding: 22px 24px;
  color: var(--text);
}
.fo-sheet dl, .fo-sheet dd { margin: 0; }
.fo-sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  margin-bottom: 16px;
}
.fo-sheet-head h2 {
  margin: 0;
  color: var(--navy-2);
  font-size: 20px;
  font-weight: 680;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.fo-number {
  font-family: Consolas, "Microsoft YaHei UI", monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.fo-forecast {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(0, 1.9fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--thead);
}
.fo-result {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  margin: -1px;
  padding: 16px 20px;
  border-radius: 10px;
  color: var(--on-accent);
  background: linear-gradient(112deg, var(--navy-2), var(--brand));
}
.fo-result span, .fo-sheet .fo-estimates dt, .fo-sheet .fo-actual dt { font-size: 13px; }
.fo-result strong {
  font-size: clamp(24px, 3.2cqi, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.fo-estimates, .fo-actual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}
.fo-estimates > div { padding: 12px clamp(12px, 2cqi, 24px); }
.fo-estimates > div + div { border-left: 1px solid var(--line); }
.fo-estimates dt, .fo-actual dt { color: var(--muted); }
.fo-sheet .fo-estimates dd {
  margin-top: 5px;
  font-size: clamp(16px, 2.6cqi, 26px);
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.fo-actual { gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.fo-sheet .fo-actual dd { margin-top: 3px; font-size: 18px; font-weight: 620; overflow-wrap: anywhere; }
.fo-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr) minmax(0, .85fr) minmax(0, 1.4fr);
  gap: 12px 18px;
  padding-top: 16px;
}
.fo-facts dd { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.fo-contracts { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.fo-order-title { margin: -9px 0 15px; color: var(--muted); overflow-wrap: anywhere; }
.fo-sheet .fo-comparison {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}
.fo-comparison :is(th, td) {
  padding: 8px 10px;
  font-size: 14px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  white-space: normal;
}
.fo-comparison th:first-child { width: 28%; text-align: left; }
.fo-comparison thead th { font-size: 12px; color: var(--muted); background: var(--thead); }
.fo-comparison tbody th { font-weight: 500; }
.fo-comparison tr:last-child > * { color: var(--navy-2); font-weight: 700; }
.fo-comparison thead tr:last-child > * { color: var(--muted); font-weight: 500; }
.fo-order-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container finance-orders (max-width: 620px) {
  .fo-pickers { gap: 14px; padding: 14px 16px; }
  .fo-sheet { padding: 16px; }
  .fo-views { justify-content: flex-start; padding: 4px 8px; gap: 2px; }
  .fo-views a { min-height: 36px; padding: 5px 8px; font-size: 13px; }
  .fo-views a[aria-current] { border-radius: 6px; background: var(--accent-soft); }
  .fo-views a[aria-current]::after { display: none; }
  .fo-forecast { grid-template-columns: 1fr; }
  .fo-result { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  .fo-result strong { max-width: 100%; overflow-wrap: anywhere; }
  .fo-estimates > div { padding: 13px 12px; }
  .fo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container finance-orders (max-width: 430px) {
  .fo-pickers { grid-template-columns: 1fr; gap: 10px; }
  .fo-picker { gap: 3px; }
  .fo-picker strong { min-height: 0; }
  .fo-toolbar { margin-bottom: 12px; }
  .fo-sheet-head h2 { font-size: 18px; }
  .fo-sheet .fo-comparison :is(td,th) { padding: 7px 4px; font-size: 12px; }
  .fo-actual { gap: 10px; }
}

/* 业务页签沿用结余页的金额层次；台账表头在窄屏上随每条记录显示。 */
.fo-file > .btn-link { margin-bottom: 14px; }
.fo-work .fo-subtitle {
  color: var(--navy-2);
  font-size: 15px;
  line-height: 1.4;
  margin: 20px 0 10px;
}
.fo-work .fo-sheet-head + .fo-subtitle { margin-top: 0; }
.fo-work .fo-caption, .fo-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0;
}
.fo-caption strong { color: var(--text); font-weight: 600; }
.fo-empty { padding: 12px; background: var(--thead); border-radius: 7px; }
.fo-work p, .fo-work summary { overflow-wrap: anywhere; }
.fo-work .fo-reconcile {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 14px;
}
.fo-reconcile dt { font-size: 12px; color: var(--muted); }
.fo-reconcile dd { font-size: 16px; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.fo-ledger { max-width: 100%; overflow-x: auto; }
.fo-ledger table { width: 100%; min-width: 0; white-space: normal; }
.fo-ledger :is(td, th) { padding: 9px 10px; text-align: left; line-height: 1.45; vertical-align: middle; overflow-wrap: anywhere; }
.fo-ledger th { color: var(--muted); background: var(--thead); font-size: 12px; }
.fo-ledger td { font-size: 13px; }
.fo-ledger .fo-money-col { text-align: right; white-space: nowrap; }
.fo-ledger td.fo-money-col { color: var(--navy-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.fo-page .fo-action {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.fo-work .fo-sheet-head + .fo-action { margin-top: 0; }
.fo-action > summary {
  padding: 10px 14px;
  color: var(--brand);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  cursor: pointer;
}
.fo-action[open] > summary { border-bottom: 1px solid var(--line); }
.fo-action-body { padding: 14px; }
.fo-page .fo-form {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,185px),1fr));
  align-items: end;
  gap: 12px 16px;
  margin: 0;
}
.fo-page .sp-form label, .fo-page :is(select,input,fieldset,details) { min-width: 0; }
.fo-page .fo-dispatch-fields { display: contents; }
.invoice-file-field { min-width: 0; }
.invoice-file-field input { max-width: 100%; }
.invoice-file-field small { display: block; }
.invoice-file-field[hidden], [data-invoice-retry][hidden] { display: none; }
.invoice-add [data-invoice-status]:empty { display: none; }
.fo-page .sp-form :is(input,select) { width: 100%; max-width: 100%; }
.fo-page .sp-form .sp-button { justify-self: start; max-width: 100%; }
.fo-page .fo-form > :is(fieldset,details,.sp-error) { grid-column: 1/-1; }
.fo-page .fo-line { margin: 8px 0; align-items: end; }
.fo-page .fo-form > details > label { margin-top: 8px; }
.fo-three-estimates { grid-template-columns: repeat(3,minmax(0,1fr)); }
.fo-quote-lines summary { cursor: pointer; color: var(--brand); }
.fo-quote-lines dl { margin: 6px 0 0; }
.fo-quote-lines dl > div { display: flex; justify-content: space-between; gap: 2px 10px; flex-wrap: wrap; padding: 4px 0; }
.fo-quote-lines dt { color: var(--muted); }
.fo-quote-lines dd { color: var(--navy-2); font-weight: 600; white-space: nowrap; }
.fo-work #fo-period { margin: 0 0 14px; }
.fo-work #fo-period:last-child { margin-bottom: 0; }
.fo-work .fo-metrics:not(:last-child) { margin-bottom: 8px; }
@container finance-orders (min-width: 880px) {
  .fo-cash-summaries:has(> :nth-child(2)) {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
  }
  .fo-cash-summaries:has(> :nth-child(2)) .fo-forecast { grid-template-columns: minmax(0,1fr); }
  .fo-cash-summaries:has(> :nth-child(2)) .fo-result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .fo-cash-summaries:has(> :nth-child(2)) .fo-estimates dd { font-size: 22px; }
}
@container finance-orders (max-width: 650px) {
  .fo-ledger { overflow: visible; }
  .fo-ledger table, .fo-ledger tbody { display: block; }
  .fo-ledger thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .fo-ledger tbody tr {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }
  .fo-ledger td, .fo-ledger td.fo-money-col {
    display: grid; align-content: start; gap: 3px;
    min-width: 0; padding: 0;
    white-space: normal; text-align: left;
    background: transparent; border: 0;
  }
  .fo-ledger td::before { content: attr(data-label); font-size: 12px; font-weight: 400; color: var(--muted); }
  .fo-ledger td > .fo-cell { min-width: 0; overflow-wrap: anywhere; }
  .fo-ledger td:has(.fo-quote-lines[open]) { grid-column: 1/-1; }
  .fo-page .sp-form.fo-line { display: grid; grid-template-columns: 1fr; }
}
