/* 站点收入账本 v2（独立页面，复用 shop.css 的变量与基础组件） */
.ledger-page{max-width:1400px;margin:auto;padding:26px 44px 40px}
.ledger-top{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:26px;flex-wrap:wrap}
.ledger-top .actions{gap:14px}
.ledger-top .ledger-days{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);font-weight:450}
.ledger-top .ledger-days select{width:auto;min-height:36px;padding:6px 10px}
.ledger-top .ledger-auto{font-size:12px;color:var(--muted)}
.ledger-top a{font-size:13px}
.ledger-page footer{display:flex;justify-content:space-between}
.ledger-page .grid{margin-bottom:18px}
.ledger-page .stat strong{font-size:27px}
.ledger-page .stat.negative strong{color:var(--danger)}
.ledger-page .stat.featured.negative strong{color:#ffd3d3}
.ledger-page .stat small{display:block;line-height:1.7}
.ledger-chart{width:100%;height:auto;display:block;max-height:340px}
.ledger-chart .bar-income{fill:var(--green);opacity:.85}
.ledger-chart .bar-net{fill:#3b7ddd;opacity:.85}
.ledger-chart .bar-net.negative{fill:var(--danger)}
.ledger-chart .cum-line{fill:none;stroke:#1d2c22;stroke-width:2}
.dark .ledger-chart .cum-line{stroke:#e0e9e0}
.ledger-chart .cum-dot{fill:#1d2c22}
.dark .ledger-chart .cum-dot{fill:#e0e9e0}
.ledger-chart .axis{stroke:var(--line);stroke-width:1}
.ledger-chart .zero{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 3}
.ledger-chart .axis-text{font-size:11px;fill:var(--muted)}
.ledger-chart .hover-rect{fill:transparent}
.ledger-chart .hover-rect:hover{fill:#00000010}
.ledger-legend{display:flex;gap:18px;font-size:12px;color:var(--muted);margin-top:10px;flex-wrap:wrap}
.ledger-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.ledger-legend .l-income{background:var(--green)}
.ledger-legend .l-net{background:#3b7ddd}
.ledger-legend .l-neg{background:var(--danger)}
.ledger-legend .l-cum{background:#1d2c22}
.dark .ledger-legend .l-cum{background:#e0e9e0}
.formula-table td.num,.formula-table th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.formula-table tr.total td{font-weight:700;background:var(--soft)}
.formula-table tr.grand td{font-weight:800;background:var(--soft);font-size:13px}
.formula-table td.label{white-space:normal;min-width:260px}
.formula-table td.note{white-space:normal;color:var(--muted);font-size:11px;max-width:420px}
.formula-table .negative{color:var(--danger)}
.daily-table td.num,.daily-table th.num{text-align:right;font-variant-numeric:tabular-nums}
.daily-table tr.today td{background:var(--soft);font-weight:600}
.daily-table .negative{color:var(--danger)}
.ledger-note strong{color:var(--text)}
.ledger-error{padding:40px 20px;text-align:center;border:1px dashed var(--line);border-radius:10px;color:var(--muted)}
.ledger-error a{margin-left:6px}
.ledger-sub{font-size:12px;color:var(--muted);margin:-8px 0 16px}
@media(max-width:720px){.ledger-page{padding:18px 16px 30px}.ledger-page .four{grid-template-columns:repeat(2,minmax(0,1fr))}.ledger-page .stat strong{font-size:22px}.formula-table td.label{min-width:180px}}
.ledger-chart .bar-recharge{fill:#7ea6d9;opacity:.85}
.ledger-chart .bar-sales{fill:#b7c9bd;opacity:.95}
.ledger-legend .l-recharge{background:#7ea6d9}
.ledger-legend .l-sales{background:#b7c9bd}
.formula-table tr.ledger-group td{background:var(--soft);font-weight:650;color:var(--text);padding-top:12px;padding-bottom:12px}
.ledger-form{display:grid;grid-template-columns:180px 170px 1fr auto;gap:12px;align-items:end;margin-bottom:16px}
.ledger-form label{font-size:12px}
.ledger-form button{min-height:42px;white-space:nowrap}
.ledger-page .auth-error{min-height:0;margin:0 0 10px}
.ledger-details{padding:0}
.ledger-details summary{padding:22px 24px;font-size:15px}
.ledger-details .table-wrap{padding:0 24px 24px}
@media(max-width:720px){.ledger-form{grid-template-columns:1fr 1fr}.ledger-form button{grid-column:1/-1}}
.ledger-embedded{padding:0;max-width:none;margin:0}
.ledger-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:14px;flex-wrap:wrap;margin:-8px 0 16px;font-size:12px;color:var(--muted)}
.ledger-toolbar .ledger-days{display:flex;align-items:center;gap:8px;font-weight:450}
.ledger-toolbar select{width:auto;min-height:34px;padding:5px 10px}
.ledger-toolbar button{padding:6px 12px;font-size:12px}
.ledger-toolbar .ledger-auto{font-weight:400}
.ledger-chart .bar-users{fill:#9b7ed9;opacity:.9}
.ledger-chart .bar-buyers{fill:#e0a458;opacity:.9}
.ledger-legend .l-users{background:#9b7ed9}
.ledger-legend .l-buyers{background:#e0a458}
.stat.stat-action{cursor:pointer}
.stat.stat-action:hover{border-color:var(--green)}
.stat.stat-action:focus{outline:2px solid #58a58b;outline-offset:2px}
#ledger-dialog{max-width:min(620px,calc(100vw - 32px))}
#ledger-dialog .kpi-row:first-of-type{padding-top:0}
