/* 结算台（财务2）样式。只用台账已有的变量（--panel/--line/--ink/--ink-soft/--brand…），随主题走。 */
.f3 .f3-sec { font-weight: 700; font-size: 13px; color: var(--ink-soft); margin: 8px 0 6px; letter-spacing: .02em; }
.f3 .f3-acts { gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.f3 .f3-acts .btn, .f3 .f3-acts a.btn { text-decoration: none; }
.f3 .panel { margin-bottom: 12px; }
.f3 .num, .f3 th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.f3 .neg { color: #b7322c; }
.f3 .warn-t { color: #b3771e; font-weight: 700; }
.f3 .f3-void { opacity: .5; text-decoration: line-through; }
.f3 .f3-total td { font-weight: 700; border-top: 2px solid var(--line); }
.f3 .table-wrap { overflow-x: auto; }
.f3 .f3-tbl th { white-space: nowrap; }
.f3 .f3-th-in { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.f3 .f3-th-out { background: color-mix(in srgb, #1f6f6b 10%, transparent); }
.f3 .f3-out { font-weight: 600; }
.f3 .f3-draft td { color: var(--ink-soft); }
.f3 .f3-hl td, .f3 p.f3-hl, .f3 tr.f3-hl td { background: color-mix(in srgb, #e0a24e 25%, transparent); }
.f3 .f3-hl-cell { outline: 2px solid #b7322c; }
.f3 .f3-acts td { white-space: nowrap; }
.f3 td.f3-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.f3 td.f3-acts .btn.mini + .btn.mini { margin-left: 0 !important; }

/* 状态条 */
.f3 .f3-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px; border-radius: 10px; overflow: hidden; }
.f3 .f3-step { padding: 10px 12px; border-right: 1px solid var(--line); border-top: 3px solid transparent; }
.f3 .f3-step:last-child { border-right: 0; }
.f3 .f3-step.ok { border-top-color: #2e7d4f; }
.f3 .f3-step.warn { border-top-color: #b3771e; }
.f3 .f3-step.bad { border-top-color: #b7322c; }
.f3 .f3-step-h { font-weight: 700; font-size: 13px; }
.f3 .f3-step-d { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* KPI */
.f3 .f3-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.f3 .f3-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 140px; }
.f3 .f3-kpi-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.f3 .f3-kpi-l { font-size: 12px; color: var(--ink-soft); }

/* 缺什么 */
.f3 .f3-issue { padding: 4px 0; font-size: 13px; }
.f3 .f3-issue.error { color: #b7322c; }
.f3 .f3-issue.warn { color: #b3771e; }
.f3 .f3-issue.info { color: var(--ink-soft); }

/* chips */
.f3 .f3-chip { display: inline-block; font-size: 11.5px; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--panel-soft, #eef2ee); color: var(--ink-soft); white-space: nowrap; vertical-align: .1em; }
.f3 .f3-chip.ok { background: #ddefe3; color: #2e7d4f; }
.f3 .f3-chip.warn { background: #f7ebd6; color: #b3771e; }
.f3 .f3-chip.bad { background: #f6e3e1; color: #b7322c; }
.f3 .f3-chip.muted { opacity: .8; }
.f3 .f3-chip.link { cursor: pointer; border-bottom: 1px dashed currentColor; }
html[data-theme="dark"] .f3 .f3-chip.ok { background: #1e3428; color: #6fcf97; }
html[data-theme="dark"] .f3 .f3-chip.warn { background: #3a2e1a; color: #e0a24e; }
html[data-theme="dark"] .f3 .f3-chip.bad { background: #3a2523; color: #e26a62; }

/* 分录 */
.f3 .f3-row-click { cursor: pointer; }
.f3 .f3-entries { display: grid; gap: 6px; padding: 6px 0; }
.f3 .f3-entry { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.f3 .f3-entry.reversed { opacity: .6; }
.f3 .f3-entry-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.f3 .f3-amt { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: auto; }
.f3 .f3-entry-t { font-size: 13px; margin-top: 4px; line-height: 1.6; }
.f3 .f3-entry-s { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.f3 .f3-explain { max-width: 520px; white-space: normal; }

/* 12 个月 */
.f3 .f3-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.f3 .f3-month { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; background: var(--panel); }
.f3 .f3-month.cur { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.f3 .f3-month.locked { border-left: 3px solid #2e7d4f; }
.f3 .f3-month.run { border-left: 3px solid #b3771e; }
.f3 .f3-month-p { font-size: 12px; color: var(--ink-soft); }
.f3 .f3-month-v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 规则表 */
.f3 .f3-rules { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .f3 .f3-rules { grid-template-columns: 1fr; } }
.f3 .f3-rules-nav { border-right: 1px solid var(--line); padding-right: 10px; }
.f3 .f3-rules-item { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.f3 .f3-rules-item:hover { background: var(--panel-soft, #eef2ee); }
.f3 .f3-rules-item.on { background: var(--brand); color: var(--brand-ink); }
.f3 .f3-rules-item.on .mini { color: inherit; opacity: .85; }
.f3 .f3-short { font-family: ui-monospace, Consolas, monospace; font-size: 11px; opacity: .7; }
.f3 .f3-cnt { margin-left: auto; white-space: nowrap; }
.f3 .f3-rules-main { min-width: 0; }

/* 表单 */
.f3-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.f3-form .f3-form-sec { grid-column: 1 / -1; font-weight: 700; font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
.f3-form .f3-field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.f3-form .f3-field.f3-wide { grid-column: 1 / -1; }
.f3-form .f3-field > span { color: var(--ink-soft); font-size: 12px; }
.f3-form .f3-range { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; }
.f3-form .f3-range label { white-space: nowrap; display: flex; gap: 3px; align-items: center; }
.f3-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.f3-grid2 .f3-field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.f3-grid2 .f3-field > span { color: var(--ink-soft); font-size: 12px; }
.f3-check { display: flex; gap: 6px; align-items: flex-start; padding: 4px 0; font-size: 13px; }
.f3-facts .table-wrap { overflow-x: auto; max-height: 55vh; overflow-y: auto; }
.f3-facts .tbl input.input, .f3-facts .tbl select.input { min-width: 110px; padding: 4px 6px; }

/* 文档 */
.f3 .f3-doc { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 14px; }
@media (max-width: 1000px) { .f3 .f3-doc { grid-template-columns: 1fr; } }
.f3 .f3-doc-text { max-height: 75vh; overflow: auto; font-size: 13.5px; line-height: 1.7; }
.f3 .f3-doc-text p { margin: 0 0 6px; }
.f3 .f3-bid { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: var(--ink-soft); margin-right: 6px; opacity: .7; white-space: nowrap; }
.f3 .f3-doctbl { border-collapse: collapse; margin: 6px 0 10px; width: 100%; font-size: 12.5px; }
.f3 .f3-doctbl td { border: 1px solid var(--line); padding: 3px 6px; vertical-align: top; }
.f3 .f3-doc-side .panel { margin-bottom: 10px; }
.f3 .f3-doc-side .input { width: 100%; margin: 4px 0; }
.f3 .f3-prow { border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; }
.f3 .f3-prow.bad { opacity: .75; }
.f3 .f3-quote { display: inline-block; max-width: 100%; }
.f3 .f3-contrib { padding: 4px 0; font-size: 12.5px; cursor: pointer; border-top: 1px solid var(--line); }

/* ── 三页签改版：月度表网格 / 折叠区 ── */
.f3-fold { padding: 0; overflow: hidden; }
.f3-fold-head { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; font: inherit; font-weight: 600; cursor: pointer; color: inherit; }
.f3-fold-head:hover { background: rgba(127, 127, 127, .08); }
.f3-fold-body { padding: 0 12px 12px; }
.f3-sheet th, .f3-sheet td { white-space: nowrap; }
.f3-sheet .f3-col-aside { background: rgba(127, 127, 127, .07); color: #6b7280; }
.f3-sheet .f3-col-total { font-weight: 700; }
.f3-sheet .f3-cell-click { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.f3-sheet .f3-cell-click:hover { background: rgba(37, 99, 235, .10); }
.f3-sheet tr.f3-total td { border-top: 2px solid rgba(127, 127, 127, .35); font-weight: 700; }

/* ── 逐单明细 / 说明页 ── */
.f3-viewsel { margin: 4px 0 10px; }
.f3-help-sec { margin-bottom: 12px; }
.f3-help-sec p { margin: 0 0 8px; line-height: 1.75; }
.f3-help-row { display: grid; gap: 2px 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.f3-help-row:first-of-type { border-top: 0; }
@media (min-width: 720px) { .f3-help-row { grid-template-columns: 12rem 1fr; } }
.f3-help-q { font-weight: 600; }
.f3-help-a { color: var(--ink-soft); line-height: 1.7; }
.f3-calcbox { border-left: 3px solid var(--brand, #2563eb); background: rgba(127,127,127,.06); padding: 10px 14px; margin: 6px 0 10px; line-height: 1.9; }
.f3-calcbox .f3-calc-sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; font-weight: 700; }

/* 核对与追溯：金额优先，原文和处理记录按需展开。 */
.f3-review-clause,.f3-review-change { padding: 12px; margin: 8px 0; border: 1px solid var(--border, #dce3eb); border-radius: 8px; }
.f3-review-clause .f3-quote { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; max-height: 160px; overflow: auto; }
.f3-entry-detail summary,.f3-issue summary,.f3-proposal summary { cursor: pointer; padding: 8px 0; font-size: 13px; }
.f3-review-change .btn { margin-top: 8px; }

.f3-business-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; margin:12px 0; }
.f3-business-grid>div { padding:10px; background:var(--bg, #f7f9fc); border-radius:8px; overflow-wrap:anywhere; }
.f3-review-clause .f3-quote { display:block; }
