/* Shared YuanLoop palette; form layout stays in the existing application. */
:root {
  --ink: #123f3c;
  --text: #40514e;
  --muted: #6c7d77;
  --line: #dce4df;
  --soft-line: #e8eae3;
  --paper: #fffefa;
  --canvas: #f7f3ec;
  --green: #123f3c;
  --green-deep: #0e3532;
  --green-soft: #edf2ec;
  --soft: #edf2ec;
  --gold: #a45f38;
  --gold-soft: #fbf0e4;
  --danger: #8b3833;
  --shadow: 0 8px 24px rgba(18, 63, 60, .04);
  --radius: 10px;
  --ui-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
body { color: var(--ink); background: var(--canvas); font-family: var(--ui-font); -webkit-font-smoothing: antialiased; }
::selection { background: #e9d7c6; color: var(--ink); }
.app-header { background: rgba(255, 254, 250, .96); border-color: var(--line); }
.header-inner { min-height: 72px; gap: 20px; }
.brand { gap: 10px; }
.brand-mark { display: block; width: 34px; height: 34px; border-radius: 0; background: none; box-shadow: none; object-fit: contain; }
.brand-title { font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.btn { border-radius: 7px; background: var(--paper); font-size: 13px; font-weight: 500; transition: background-color .18s, border-color .18s, color .18s, transform .18s; }
.btn:hover:not(:disabled) { border-color: #95aaa5; background: #f4f5ed; transform: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--green); border-color: var(--green); }
.btn.primary:hover:not(:disabled) { background: var(--green-deep); border-color: var(--green-deep); }
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
.page { margin: 24px auto 48px; }
.workspace { margin-top: 0; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.main-column { gap: 16px; }
.sidebar { top: 96px; gap: 12px; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: none; }
.card-head { align-items: center; margin-bottom: 20px; gap: 12px; }
.section-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.section-label { color: var(--gold); font-size: 11px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.field label, .mini-field label { color: var(--text); font-weight: 500; margin-bottom: 7px; }
input, select, textarea { border-radius: 6px; border-color: var(--line); background: #fbfaf6; }
input:hover, select:hover, textarea:hover { border-color: #95aaa5; }
input[type="checkbox"] { accent-color: var(--green); }
.application-grid input { min-height: 40px; font-variant-numeric: tabular-nums; }
.field-grid.application-grid { grid-template-columns: minmax(155px, 1.2fr) minmax(205px, 2.1fr) minmax(82px, .85fr) minmax(82px, .85fr) 140px; gap: 12px; }
.invoice-dropzone { margin: 0; min-height: 124px; padding: 24px; justify-content: space-between; gap: 16px; border: 1px dashed #95aaa5; border-radius: 8px; background: #f4f6ef; }
.invoice-dropzone:hover { border-color: var(--green); background: #edf2ec; }
.invoice-entry-copy { display: grid; gap: 7px; min-width: 0; }
.invoice-entry-copy strong { font-size: 16px; font-weight: 600; }
.invoice-entry-copy span { color: var(--muted); font-size: 12px; }
.invoice-dropzone > .btn { flex: 0 0 auto; border-color: #c1cec5; }
.invoice-dropzone:focus-visible, .invoice-dropzone.dragover { outline: 2px solid var(--gold); outline-offset: 3px; background: #edf2ec; }
.expense-list { grid-template-columns: minmax(0, 1fr); }
.expense-list:not(:empty) { margin-bottom: 16px; }
.expense-item { min-width: 0; background: #fbfaf6; border-color: var(--line); border-radius: 8px; }
.item-number { background: var(--green-soft); color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.electronic-summary { padding: 7px 0; gap: 10px; }
.electronic-summary .invoice-description { font-weight: 500; }
.electronic-summary > strong { font-variant-numeric: tabular-nums; }
.recognition-badge { background: var(--green-soft); color: var(--green); font-size: 11px; }
.recognition-badge.review { background: var(--gold-soft); color: var(--gold); }
.add-item-bottom { border: 0; min-height: 40px; color: var(--green); font-size: 13px; background: #f4f5ef; }
.add-item-bottom span { font-size: 17px; }
.invoice-help { margin-top: 14px; color: var(--muted); font-size: 12px; }
.invoice-help summary { width: fit-content; cursor: pointer; }
.invoice-help p { max-width: 65em; margin: 10px 0 0; line-height: 1.75; }
#recognitionStatus:empty { display: none; }
#recognitionStatus:not(:empty) { margin: 12px 0 0; font-size: 12px; }
.notice { background: var(--gold-soft); border-color: #c59977; color: #795234; border-radius: 4px; }
.processing-card { padding: 0 22px; }
.processing-card .details-stack { border: 0; }
#approvalDetails > summary { min-height: 68px; padding: 16px 0; gap: 12px; }
.details-stack summary span:first-child { align-items: center; gap: 12px; }
#approvalDetails .section-heading > strong { font-size: 16px; font-weight: 600; }
#approvalDetails .section-heading small { font-size: 11px; color: var(--muted); font-weight: 400; }
.signature-offline-note { flex: 1 1 auto; border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; font-weight: 400; text-align: right; }
.details-action { color: var(--green); font-size: 12px; font-weight: 500; }
.summary-card { padding: 0; }
.summary-top { padding: 26px 24px 0; color: var(--ink); background: transparent; }
.summary-top .eyebrow { color: var(--muted); font-size: 12px; letter-spacing: 0; }
.money { margin-top: 12px; font-size: 36px; font-weight: 600; letter-spacing: -.03em; }
.money-words { min-height: 0; margin-top: 9px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.summary-stats { margin-top: 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { display: flex; align-items: baseline; gap: 12px; border: 0; padding: 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 20px; }
.stat span { color: var(--muted); font-size: 11px; }
.stat strong { font-size: 16px; font-weight: 600; }
.summary-body { padding: 20px 24px 24px; }
.check-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 18px; }
.check-item { gap: 5px; font-size: 11px; color: var(--muted); }
.check-dot { width: 16px; height: 16px; flex-shrink: 0; background: #f0f1e9; color: var(--muted); }
.check-item.ok { color: var(--green); }
.compact-declaration { padding: 0; margin-bottom: 22px; border: 0; border-radius: 0; background: none; align-items: flex-start; gap: 9px; }
.compact-declaration input { width: 16px; min-height: 16px; height: 16px; margin: 1px 0 0; }
.compact-declaration strong { font-size: 11px; font-weight: 500; color: var(--text); }
.summary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.summary-actions .btn { min-height: 40px; padding: 8px 6px; font-size: 12px; }
.summary-actions > :not(#validateButton):not(#previewClaimButton) { grid-column: 1 / -1; }
.summary-actions .primary { min-height: 44px; margin-top: 4px; font-size: 13px; }
#shareClaimButton { border-color: transparent; background: #f4f5ef; color: var(--text); }
.info-card { padding: 16px 20px; background: transparent; border-color: transparent; }
.info-card .save-indicator { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.save-indicator::before { width: 5px; height: 5px; flex-shrink: 0; background: #8caaa0; }
.info-card #invoiceCheckStatus { margin: 7px 0 12px; color: var(--muted); font-size: 11px; }
.storage-details { border-top: 1px solid var(--line); padding-top: 12px; font-size: 12px; }
.storage-details > summary { display: flex; justify-content: space-between; gap: 12px; color: var(--text); cursor: pointer; list-style: none; }
.storage-details > summary::-webkit-details-marker { display: none; }
.storage-details[open] > summary .details-action { font-size: 0; }
.storage-details[open] > summary .details-action::after { content: "收起"; font-size: 12px; }
.info-card .storage-details p { margin-top: 12px; font-size: 12px; line-height: 1.7; }
.storage-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.console-menu { background: var(--paper); border-radius: 8px; }
.console-menu a, .console-menu button { color: var(--ink); font-size: 13px; }
.console-menu a:hover, .console-menu button:hover { background: var(--green-soft); color: var(--green); }
.console-identity { color: var(--muted); }
.pdf-dialog { background: var(--paper); color: var(--ink); border-color: var(--line); border-radius: 10px; }
.pdf-dialog .claim-preview-header { background: var(--paper); }
.pdf-dialog p { color: var(--text); }
.pdf-file, .approval-row { background: #f4f5ef; }
/* The management views share the palette, typography and compact controls. */
body:has(#workspace) .app-header { padding-block: 19px; }
body:has(#workspace) main { max-width: 1504px; }
body:has(#workspace) .eyebrow { color: var(--gold); }
body:has(#workspace) h1 { font-size: 26px; font-weight: 600; }
body:has(#workspace) .panel { background: var(--paper); border-radius: 10px; }
body:has(#workspace) th { background: #f4f5ef; }
body:has(#workspace) tbody tr:hover { background: #f8f7f0; }
body:has(#workspace) .tab.active { background: var(--paper); box-shadow: none; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: minmax(280px, .7fr) 1fr; }
}
@media (max-width: 900px) {
  .field-grid.application-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .header-inner { min-height: 64px; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-title { font-size: 16px; }
  .toolbar { gap: 6px; }
  .toolbar .btn { min-height: 36px; padding: 6px 10px; }
  .toolbar .btn-label { display: inline; }
  .page { margin-top: 16px; }
  .card { padding: 18px; }
  .card-head { margin-bottom: 18px; }
  .field-grid.application-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .application-grid .company-field { grid-column: 1 / -1; grid-row: 2; }
  .application-grid .field:first-child { grid-column: 1 / -1; }
  .application-grid .field:last-child { grid-column: 1 / -1; }
  .invoice-dropzone { padding: 20px 18px; min-height: 144px; }
  .invoice-entry-copy { width: 100%; }
  .invoice-entry-copy strong { font-size: 15px; }
  .processing-card { padding-block: 0; }
  #approvalDetails > summary { min-height: 64px; }
  .signature-offline-note { font-size: 11px; }
  .sidebar { grid-template-columns: 1fr; }
  .summary-card { padding: 0; }
  .summary-top { padding: 22px 22px 0; }
  .summary-body { padding: 18px 22px 22px; }
  .info-card { padding: 6px 12px 18px; }
}
@media (max-width: 420px) {
  .toolbar { width: 100%; justify-content: space-between; }
  .toolbar .btn { flex: 1; padding-inline: 8px; }
  .toolbar .console-wrap { flex: 1; }
  .toolbar .console-wrap > .btn { width: 100%; }
  .toolbar .btn-label { font-size: 12px; }
  #approvalDetails > summary { gap: 8px; }
  .signature-offline-note { flex-basis: 100%; order: 3; text-align: left; padding-left: 28px; }
  #approvalDetails .details-action { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@media (max-width: 760px) {
  .expense-dates label { flex-wrap: wrap; gap: 4px; }
  .expense-dates label, .date-mode { white-space: nowrap; }
  .expense-dates .optional { display: none; }
}
@media (max-width: 360px) {
  .toolbar .btn { white-space: nowrap; font-size: 12px; padding-inline: 5px; }
  .toolbar #openButton, .toolbar #saveButton { font-size: 0; }
  .toolbar .btn-label { font-size: 12px; }
  .has-date-range .expense-dates { grid-template-columns: 1fr; }
}

.brand-title { margin: 0; line-height: 1.3; }
