:root {
  --bg: #f4f6fb; --panel: #fff; --ink: #1c2333; --sub: #6b7280;
  --primary: #2563eb; --primary-d: #1d4ed8; --ok: #059669; --warn: #d97706;
  --danger: #dc2626; --line: #e5e9f2;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
header { background: linear-gradient(120deg, #1e3a8a, #2563eb 60%, #3b82f6); color: #fff; padding: 18px 28px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo { font-size: 34px; }
header h1 { font-size: 21px; letter-spacing: 1px; }
header p { font-size: 12px; opacity: .85; margin-top: 2px; }
.header-right .pill { background: rgba(255,255,255,.18); padding: 5px 13px; border-radius: 999px; font-size: 12px; margin-left: 8px; }
nav { background: #fff; padding: 0 24px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.tab { border: none; background: none; padding: 14px 18px; font-size: 14px; cursor: pointer; color: var(--sub); border-bottom: 3px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
main { padding: 22px 24px 60px; max-width: 1400px; margin: 0 auto; }
.tabpane { display: none; }
.tabpane.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--panel); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(20,40,90,.07); border: 1px solid var(--line); }
.card .num { font-size: 26px; font-weight: 700; color: var(--primary); margin: 4px 0; }
.card .lbl { color: var(--sub); font-size: 12px; }
.card .foot { font-size: 11px; color: var(--ok); }
.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border-radius: 12px; padding: 16px 18px; border: 1px solid var(--line); margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar label { color: var(--sub); font-size: 13px; }
select, input[type="month"], input[type="text"], input[type="number"] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; margin-left: 5px; }
.btn { padding: 8px 15px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-d); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.mini { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.hint { color: var(--sub); font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--sub); font-weight: 600; padding: 9px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
tr:hover td { background: #f8faff; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag.blue { background: #e0ecff; color: #1d4ed8; }
.tag.green { background: #d9f2e6; color: #047857; }
.tag.orange { background: #fdf0dc; color: #b45309; }
.tag.red { background: #fde2e2; color: #b91c1c; }
.tag.gray { background: #eef1f6; color: #64748b; }
.tag.purple { background: #ede4ff; color: #6d28d9; }
.money { font-variant-numeric: tabular-nums; text-align: right; }
.pos { color: var(--ok); } .neg { color: var(--danger); }
.empty { color: var(--sub); text-align: center; padding: 30px; }
.bar-wrap { background: #eef1f6; border-radius: 999px; height: 10px; overflow: hidden; margin: 8px 0 4px; }
.bar { height: 100%; background: linear-gradient(90deg, #2563eb, #22c55e); border-radius: 999px; }
.kv { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv b { font-variant-numeric: tabular-nums; }
#toast { position: fixed; right: 24px; bottom: 24px; background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity .25s, transform .25s; transform: translateY(10px); pointer-events: none; max-width: 380px; }
#toast.show { opacity: .95; transform: translateY(0); }
.hidden { display: none !important; }
.legend { font-size: 12px; color: var(--sub); margin-top: 10px; line-height: 1.8; }
