/* 复用赛事/全局主题令牌；所有内容限制在独立资金面板中。 */
.tfl-host { min-width: 0; max-width: 100%; margin-block: 0 20px; }
.tf-workflow > .tfl-host { margin-top: 12px; }
.tfl-panel {
  --tfl-bg: var(--bg-secondary, #16202e); --tfl-copy: var(--text-primary, #e5edf5);
  --tfl-muted: var(--text-secondary, #a8b8c9); --tfl-line: var(--border-color, #485568);
  --tfl-accent: var(--color-primary, #76b4e9); --tfl-field: var(--bg-primary, #101722);
  color: var(--tfl-copy); background: var(--tfl-bg); border: 1px solid var(--tfl-line); border-radius: 12px;
  min-width: 0; max-width: 100%; font-family: inherit; font-size: 14px; line-height: 1.6;
}
.tfl-panel *, .tfl-panel *::before, .tfl-panel *::after { box-sizing: border-box; min-width: 0; }
.tfl-panel [hidden] { display: none !important; }
.tfl-panel :is(h3,p) { margin: 0; }
.tfl-summary { cursor: pointer; list-style: none; display: flex; gap: 14px; align-items: center; padding: 16px 20px; min-height: 76px; }
.tfl-summary::-webkit-details-marker { display: none; }
.tfl-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; color: var(--tfl-accent); background: color-mix(in srgb, var(--tfl-accent) 12%, transparent); border-radius: 10px; font-size: 23px; }
.tfl-summary-copy { display: grid; gap: 2px; flex: 1; }
.tfl-summary-copy strong { font-size: 17px; font-weight: 700; }
.tfl-summary-copy small, .tfl-summary-action { color: var(--tfl-muted); font-size: 12px; }
.tfl-summary-action::after { content: '⌄'; display: inline-block; margin-left: 10px; }
.tfl-panel[open] .tfl-summary-action::after { transform: rotate(180deg); }
.tfl-panel[open] > .tfl-summary { border-bottom: 1px solid var(--tfl-line); }
.tfl-content { padding: 20px; }
.tfl-notice { padding: 10px 12px; margin-bottom: 16px !important; border: 1px solid var(--tfl-line); border-radius: 6px; background: color-mix(in srgb, var(--tfl-accent) 8%, var(--tfl-bg)); color: var(--tfl-copy); }
.tfl-error { color: #fca5a5; background: #7f1d1d22; border-color: #ef444466; }
.tfl-toolbar, .tfl-actions, .tfl-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tfl-toolbar { justify-content: space-between; gap: 12px 24px; }
.tfl-toolbar > p { flex: 1 1 280px; }
.tfl-muted { color: var(--tfl-muted); font-size: 12px; line-height: 1.7; }
.tfl-panel .tfl-button, .tfl-admin-entry, .tfl-retry { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 9px 13px; border: 1px solid var(--border-color, #485568); border-radius: 7px; background: transparent; color: var(--text-primary, #e5edf5); font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer; text-decoration: none; }
.tfl-panel .tfl-button:hover { background: color-mix(in srgb, var(--tfl-accent) 10%, var(--tfl-bg)); }
.tfl-panel .tfl-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.tfl-panel .tfl-primary:hover { background: #1d4ed8; }
.tfl-panel .tfl-danger { color: #fca5a5; border-color: #ef444466; }
.tfl-panel .tfl-button:disabled { opacity: .5; cursor: default; }
.tfl-panel :is(input,select,textarea,button,summary,a):focus-visible, .tfl-admin-entry:focus-visible { outline: 2px solid var(--tfl-accent, #60a5fa); outline-offset: 3px; }
.tfl-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.tfl-metric { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--tfl-line); border-radius: 8px; }
.tfl-metric > span { color: var(--tfl-muted); font-size: 12px; }
.tfl-metric > strong { font-size: clamp(18px, 2vw, 26px); font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tfl-income { color: #6ee7b7; } .tfl-expense { color: #fdba74; }
.tfl-counts { margin-top: 10px !important; }
.tfl-filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; padding: 16px; border-radius: 8px; background: color-mix(in srgb, var(--tfl-field) 75%, var(--tfl-bg)); border: 1px solid var(--tfl-line); align-items: end; }
.tfl-filters label { display: grid; gap: 5px; flex: 1 1 145px; }
.tfl-filters .tfl-filter-search { flex: 2 1 210px; }
.tfl-panel label > span { font-size: 12px; color: var(--tfl-muted); }
.tfl-panel :is(input,select,textarea) { display: block; border: 1px solid var(--tfl-line); border-radius: 6px; background: var(--tfl-field); color: var(--tfl-copy); font: inherit; font-size: 14px; padding: 9px 11px; min-height: 44px; width: 100%; max-width: 100%; color-scheme: dark; }
.tfl-panel textarea { resize: vertical; }
.tfl-panel :is(input,select,textarea):disabled { opacity: .65; }
.tfl-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--tfl-line); border-radius: 8px; }
.tfl-table { width: 100%; border-collapse: collapse; text-align: left; }
.tfl-table :is(th,td) { padding: 13px 14px; border-bottom: 1px solid var(--tfl-line); vertical-align: top; }
.tfl-table th { font-size: 12px; font-weight: 600; color: var(--tfl-muted); background: color-mix(in srgb, var(--tfl-field) 75%, var(--tfl-bg)); white-space: nowrap; }
.tfl-table td { font-size: 13px; max-width: 340px; overflow-wrap: anywhere; }
.tfl-table td > :is(strong,small) { display: block; }
.tfl-table td > strong { font-weight: 550; }
.tfl-table small { color: var(--tfl-muted); font-size: 11px; margin-top: 3px; }
.tfl-table tr:last-child td { border-bottom: 0; }
.tfl-table .tfl-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tfl-table .tfl-row-actions { min-width: 176px; }
.tfl-row-actions .tfl-button { padding: 5px 8px; margin: 0 4px 4px 0; min-height: 36px; font-size: 12px; }
.tfl-status { display: inline-flex; border-radius: 4px; padding: 1px 6px; font-size: 11px; color: var(--tfl-copy); border: 1px solid var(--tfl-line); white-space: nowrap; }
.tfl-status-voided { color: var(--tfl-muted); }
.tfl-link { display: inline-block; color: var(--tfl-accent); margin-top: 5px; font-size: 12px; text-decoration: underline; }
.tfl-empty { text-align: center; padding: 36px 16px !important; color: var(--tfl-muted); }
.tfl-pagination { justify-content: flex-end; margin-top: 14px; }
.tfl-pagination > span { margin-right: auto; color: var(--tfl-muted); font-size: 12px; }
.tfl-editor, .tfl-history { padding: 20px; margin: 0 0 20px; border: 1px solid var(--tfl-line); border-radius: 8px; background: color-mix(in srgb, var(--tfl-accent) 4%, var(--tfl-bg)); }
.tfl-editor h3, .tfl-history h3 { font-size: 18px; font-weight: 650; margin-bottom: 8px; }
.tfl-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-block: 16px; }
.tfl-form-grid label { display: grid; gap: 6px; }
.tfl-form-grid .tfl-full { grid-column: 1 / -1; }
.tfl-history { margin-top: 24px; margin-bottom: 0; }
.tfl-history-item { padding-block: 14px; border-bottom: 1px solid var(--tfl-line); overflow-wrap: anywhere; }
.tfl-history-item strong { font-size: 14px; }
.tfl-history-item p { margin-top: 5px; }
.tfl-history-item small { display: block; color: var(--tfl-muted); font-size: 11px; margin-top: 5px; }
.tfl-history > .tfl-button { margin-top: 12px; }
.tfl-admin-entry { margin-block: 10px; margin-left: 10px; }
.tfl-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html.light-mode .tfl-panel, html.light .tfl-panel, html[data-theme='light'] .tfl-panel, body.light-mode .tfl-panel {
  --tfl-bg: var(--bg-secondary, #fff); --tfl-copy: var(--text-primary, #172033); --tfl-muted: var(--text-secondary, #526078); --tfl-line: var(--border-color, #d7dee9); --tfl-accent: #2563eb; --tfl-field: var(--bg-primary, #f8fafc);
}
html.light-mode .tfl-panel :is(input,select,textarea), html.light .tfl-panel :is(input,select,textarea), html[data-theme='light'] .tfl-panel :is(input,select,textarea) { color-scheme: light; }
html.light-mode .tfl-income, html.light .tfl-income, html[data-theme='light'] .tfl-income { color: #047857; }
html.light-mode .tfl-expense, html.light .tfl-expense, html[data-theme='light'] .tfl-expense { color: #b45309; }
html.light-mode .tfl-panel :is(.tfl-error,.tfl-danger), html.light .tfl-panel :is(.tfl-error,.tfl-danger), html[data-theme='light'] .tfl-panel :is(.tfl-error,.tfl-danger) { color: #b91c1c; }
@media(max-width: 760px) {
  .tfl-summary { padding: 14px; gap: 10px; } .tfl-content { padding: 14px; }
  .tfl-summary-action { font-size: 11px; } .tfl-metrics { gap: 7px; } .tfl-metric { padding: 12px 9px; }
  .tfl-metric > strong { font-size: 17px; } .tfl-toolbar .tfl-actions { width: 100%; } .tfl-toolbar .tfl-actions > button { flex: 1; }
  .tfl-filters { padding: 12px; gap: 10px; } .tfl-filters label { flex-basis: calc(50% - 10px); }
  .tfl-filters .tfl-filter-search { flex-basis: calc(100% - 84px); }
  .tfl-table-wrap { overflow: visible; border: 0; } .tfl-table, .tfl-table tbody, .tfl-table tr, .tfl-table td { display: block; width: 100%; }
  .tfl-table thead { display: none; } .tfl-table tr { border: 1px solid var(--tfl-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
  .tfl-table td { max-width: none; border: 0; padding: 7px 0 7px 92px; position: relative; min-height: 36px; }
  .tfl-table td::before { content: attr(data-label); position: absolute; left: 0; width: 82px; color: var(--tfl-muted); font-size: 11px; }
  .tfl-table td.tfl-empty { padding: 20px 10px !important; } .tfl-table .tfl-row-actions { min-width: 0; }
  .tfl-row-actions .tfl-button { min-height: 44px; } .tfl-form-grid { grid-template-columns: 1fr; }
  .tfl-editor, .tfl-history { padding: 14px; } .tfl-pagination { gap: 7px; } .tfl-pagination > span { flex: 1 0 100%; }
}
