.statement-entry { margin: 0 0 18px; }
.tools-dialog .statement-entry { width: 100%; margin: 20px 0 0; }
body.statement-open { overflow: hidden; }
.statement-dialog { width: 1280px; max-width: calc(100% - 32px); height: 92dvh; max-height: 92dvh; border-radius: 18px; overflow: hidden; }
.statement-dialog[open] { display: flex; flex-direction: column; }
.statement-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.statement-heading h2 { font-size: 1.33rem; }
.statement-heading .button { flex-shrink: 0; }
.statement-body { min-height: 0; overflow-y: auto; padding: 22px 24px 32px; overscroll-behavior: contain; }
.statement-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 18px; }
.statement-filters label, .statement-options-body > label { display: grid; gap: 8px; min-width: 0; font-weight: 650; }
.statement-filters input, .statement-filters select, .statement-options input[type="text"] { width: 100%; min-width: 0; max-width: 100%; min-height: 60px; border: 2px solid var(--line); border-radius: 10px; background: white; padding: 10px 12px; font-size: 1rem; }
.statement-period-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 16px; }
.statement-period-actions > span { color: var(--muted); font-size: var(--small); }
.statement-period-actions .text-button { font-size: var(--small); padding: 10px 12px; }
.statement-options { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin-bottom: 18px; background: white; }
.statement-options summary { min-height: 56px; padding: 12px 0; font-weight: 650; }
.statement-options-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 8px 0 20px; }
.statement-options-body .statement-money-option { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; }
.statement-money-option input { width: 26px; height: 26px; flex-shrink: 0; accent-color: var(--ink); }
.statement-help, .statement-scroll-hint { font-size: var(--small); color: var(--muted); margin: 14px 0; }
.statement-notice { color: #784912; background: #fff0d7; border: 1px solid #9a6b2b; border-radius: 10px; padding: 14px 16px; margin: 16px 0; font-size: var(--small); }
.statement-empty { background: white; padding: 36px 20px; border: 1px solid var(--line); border-radius: 12px; text-align: center; margin: 16px 0; }
.statement-scroll { overflow-x: auto; background: #e3e8de; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.statement-paper { width: 100%; min-width: 1100px; padding: 32px; background: white; color: #171d19; box-shadow: 0 4px 16px #19382b14; font-size: 1rem; }
.statement-table { width: 100%; border-collapse: collapse; table-layout: fixed; line-height: 1.5; font-variant-numeric: tabular-nums; }
.statement-table th, .statement-table td { border: 1px solid #647069; padding: 10px 8px; vertical-align: middle; overflow-wrap: anywhere; }
.statement-table th { text-align: center; font-weight: 700; background: #f0f2ee; }
.statement-table .statement-document-heading th { background: white; border: 0; padding: 0 0 22px; }
.statement-document-heading h1 { margin: 0 0 20px; font-size: 1.78rem; letter-spacing: .1em; color: #111; }
.statement-company { font-size: 1.11rem; margin-bottom: 10px; }
.statement-document-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font-size: var(--small); font-weight: 500; text-align: left; }
.statement-document-meta > span { max-width: 100%; overflow-wrap: anywhere; }
.statement-number { text-align: right; }
.statement-table td:first-child { text-align: center; }
.statement-table input { width: 100%; min-width: 0; min-height: 56px; padding: 8px 6px; border: 1px solid #7b907e; border-radius: 5px; background: #fcfff5; font-size: 1rem; color: #171d19; }
.statement-table input[aria-invalid="true"] { border: 2px solid #8b3517; background: #fff0df; }
.statement-table input:not([data-settlement-field="note"]) { text-align: right; }
.statement-totals { border: 1px solid #647069; border-top: 0; padding: 14px 12px; break-inside: avoid; }
.statement-totals-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.statement-total-note, .statement-paper-note { font-size: var(--small); line-height: 1.7; margin-top: 12px; }
.statement-signatures { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; margin-top: 36px; break-inside: avoid; overflow-wrap: anywhere; }
.statement-signatures span { max-width: 100%; }
.statement-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--line); background: white; }
.statement-footer p { font-size: var(--small); color: var(--muted); }
.statement-footer > div { display: flex; gap: 12px; flex-shrink: 0; }
.statement-footer .button { min-height: 60px; }
.statement-print { display: none; }
@media (max-width: 767px) {
  .statement-entry { width: 100%; }
  .statement-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .statement-heading { padding: 12px 16px; gap: 10px; }
  .statement-heading h2 { font-size: 1.22rem; }
  .statement-heading .button { padding: 10px 12px; font-size: var(--small); }
  .statement-body { padding: 18px 16px 28px; }
  .statement-filters, .statement-options-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .statement-options-body .statement-money-option { grid-column: 1; }
  .statement-period-actions { gap: 4px 8px; }
  .statement-period-actions > span { width: 100%; }
  .statement-scroll { padding: 10px; }
  .statement-footer { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .statement-footer > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .statement-footer .button { padding: 12px 8px; }
}
@media (max-height: 600px) {
  .statement-heading { padding-top: 8px; padding-bottom: 8px; }
  .statement-footer { padding-top: 8px; padding-bottom: 8px; }
  .statement-footer p { display: none; }
}
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html:has(body.printing-statement) { font-size: 11pt; background: white; }
  body.printing-statement { margin: 0 !important; min-width: 0; height: auto !important; overflow: visible !important; color: #000; background: white; }
  body.printing-statement > * { display: none !important; }
  body.printing-statement > .statement-print { display: block !important; width: 100%; color: #000; background: white; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 11pt; }
  body.printing-statement dialog::backdrop { display: none; }
  .statement-print .statement-table { font-size: 11pt; }
  .statement-print .statement-table th, .statement-print .statement-table td { border-color: #000; padding: 2.5mm 2mm; background: white; }
  .statement-print thead { display: table-header-group; }
  .statement-print tr { break-inside: avoid; page-break-inside: avoid; }
  .statement-print .statement-document-heading th { border: 0; padding: 0 0 5mm; }
  .statement-print .statement-document-heading h1 { font-size: 20pt; margin-bottom: 4mm; }
  .statement-print .statement-company { font-size: 12pt; }
  .statement-print .statement-document-meta, .statement-print .statement-total-note, .statement-print .statement-paper-note { font-size: 10pt; }
  .statement-print .statement-totals { border-color: #000; padding: 3mm; }
  .statement-print .statement-signatures { margin-top: 9mm; font-size: 11pt; }
}
