:root{--bg:#F4F6FB;--card:#fff;--ink:#0F172A;--sub:#5B6475;--line:#E3E8F0;--soft:#F0F2F7;--blue:#2152E0;--blue2:#163BA8;--blueSoft:#E8EEFD;--up:#C2410C;--down:#1D4ED8;--ok:#166534;--okBg:#DCFCE7;--warn:#9A3412;--warnBg:#FFF4E5;--amber:#F59E0B;--t1:#1E40AF;--t2:#60A5FA;--t3:#F59E0B;--t4:#64748B;--t5:#94A3B8;--t6:#7C3AED;--bad:#B91C1C;--badBg:#FEE2E2}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.4 -apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang TC","Noto Sans TC","Microsoft JhengHei",sans-serif;font-variant-numeric:tabular-nums}
a{color:var(--blue);text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
main{max-width:640px;margin:0 auto;padding:12px 16px calc(96px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px;padding-top:calc(12px + env(safe-area-inset-top))}
.row{display:flex;align-items:center;gap:8px}
.between{display:flex;align-items:center;justify-content:space-between;gap:8px}
.wrap{flex-wrap:wrap}
.grow{flex:1;min-width:0}
.h1{font-size:20px;font-weight:700}
.h2{font-size:15px;font-weight:700}
.muted{color:var(--sub)}
.small{font-size:12px}
.s13{font-size:13px}
.b{font-weight:700}
.right{text-align:right}
.card{background:var(--card);border-radius:16px;padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.card.flat{gap:0}
.hero{background:var(--blue);color:#fff;border-radius:20px;padding:18px;display:flex;flex-direction:column;gap:10px}
.hero .big{font-size:38px;font-weight:700;letter-spacing:-.5px}
.chip{display:inline-block;padding:6px 10px;border-radius:10px;font-size:13px}
.hero .chip{background:rgba(255,255,255,.18)}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tile{background:var(--card);border-radius:16px;padding:12px 14px;display:flex;flex-direction:column;gap:3px;color:var(--ink);border:0;text-align:left;cursor:pointer}
.tile .v{font-size:22px;font-weight:700}
.tile.warn{background:var(--warnBg)}
.badge{display:inline-block;padding:3px 8px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap}
.badge.ok{background:var(--okBg);color:var(--ok)}
.badge.warn{background:var(--warnBg);color:var(--warn)}
.badge.bad{background:var(--badBg);color:var(--bad)}
.badge.info{background:#E0F2FE;color:#075985}
.btn{height:44px;padding:0 16px;border:0;border-radius:12px;background:var(--blue);color:#fff;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;white-space:nowrap}
.btn.dark{background:var(--ink)}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid #D6DCE8}
.btn.danger{background:#fff;color:var(--bad);border:1px solid #F5C2C2}
.btn.sm{height:36px;padding:0 12px;font-size:13px;border-radius:10px}
.btn[disabled]{opacity:.45}
.seg{display:inline-flex;padding:3px;border-radius:12px;background:var(--line)}
.seg button{height:36px;padding:0 14px;border:0;border-radius:9px;background:transparent;color:var(--sub);font-weight:500;cursor:pointer}
.seg button.on{background:#fff;color:var(--ink);font-weight:700}
.pills{display:flex;gap:6px;flex-wrap:wrap}
.pill{height:36px;padding:0 12px;border-radius:18px;border:1px solid #D6DCE8;background:#fff;font-size:13px;cursor:pointer;white-space:nowrap}
.pill.on{background:var(--blue);border-color:var(--blue);color:#fff}
select.pill{appearance:none;-webkit-appearance:none;padding-right:26px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235B6475' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center}
select.pill.on{background-color:var(--blue);color:#fff}
.field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--sub)}
.field input,.field select,.field textarea,input.in,select.in{height:44px;border:1px solid #D6DCE8;border-radius:10px;padding:0 12px;font-size:16px;background:#fff;color:var(--ink);width:100%}
.field textarea{height:auto;padding:10px 12px;min-height:80px}
.check{display:flex;align-items:center;gap:8px;min-height:44px;font-size:14px}
.check input{width:20px;height:20px;accent-color:var(--blue)}
.list-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;border-bottom:1px solid var(--soft);font-size:14px}
.list-row:last-child{border-bottom:0}
.bar{height:6px;border-radius:3px;background:#E8ECF5}
.bar>div{height:6px;border-radius:3px;background:var(--blue)}
.stack{display:flex;height:14px;border-radius:7px;overflow:hidden;background:#E8ECF5}
.dot{width:10px;height:10px;border-radius:3px;display:inline-block;flex-shrink:0}
.up{color:var(--up)}.down{color:var(--down)}
.cat-row{display:flex;flex-direction:column;gap:6px;cursor:pointer}
.tbl{display:grid;gap:4px;font-size:13px}
.tbl .hd{font-size:12px;color:var(--sub);padding-bottom:4px;border-bottom:1px solid var(--line)}
.tbl .r{padding:5px 0;border-bottom:1px solid var(--soft)}
.chart{position:relative;display:flex;align-items:flex-end;gap:6px;border-bottom:1px solid #D6DCE8}
.chart .col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;height:100%;min-width:0}
.chart .lbl{font-size:10px;color:var(--sub);white-space:nowrap}
.chart .b{width:100%;border-radius:5px 5px 0 0;background:var(--blue)}
.chart .b.part{background:var(--blueSoft);border:2px dashed var(--blue);border-bottom:0}
.chart .b.cat{background:var(--amber)}
.chart .avg{position:absolute;left:0;right:0;border-top:2px dashed var(--up)}
.xlabels{display:flex;gap:6px}.xlabels div{flex:1;text-align:center;font-size:11px;color:var(--sub)}
.day{font-size:13px;font-weight:600;color:var(--sub);padding:0 4px}
.txn{display:flex;gap:10px;padding:12px 14px;border:0;border-bottom:1px solid var(--soft);background:transparent;text-align:left;width:100%;cursor:pointer;color:var(--ink);align-items:stretch}
.txn:last-child{border-bottom:0}
.txn .tb{width:4px;border-radius:2px;flex-shrink:0}
.txn .m{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.txn .amt{font-size:15px;font-weight:700;white-space:nowrap}
.txn.sel{background:var(--blueSoft)}
.empty{text-align:center;padding:28px 16px;color:var(--sub)}
.drop{border:2px dashed #A9B6D3;border-radius:16px;background:#fff;padding:16px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.drop.over{background:var(--blueSoft)}
.job{border:2px solid transparent}
.job.need{border-color:var(--amber)}
.job.bad{border-color:#F5C2C2}
.prev{max-height:360px;overflow:auto;border-top:1px solid var(--line)}
.prev table{width:100%;border-collapse:collapse;font-size:12px}
.prev td{padding:6px 4px;border-bottom:1px solid var(--soft);vertical-align:top}
.prev td:nth-child(2){white-space:nowrap}
.prev tr.off td{opacity:.4;text-decoration:line-through}
.tiers{display:flex;gap:6px}
.tiers button{flex:1;height:40px;border:1px solid #D6DCE8;border-radius:10px;background:#fff;font-size:13px;cursor:pointer}
.tiers button.on{border:2px solid var(--amber);background:var(--warnBg);font-weight:700}
#tabs{position:fixed;left:0;right:0;bottom:0;height:calc(64px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:#fff;border-top:1px solid var(--line);z-index:10}
#tabs a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:12px;color:var(--sub)}
#tabs a.on{color:var(--blue);font-weight:700}
#tabs svg{width:22px;height:22px}
.batchbar{position:fixed;left:0;right:0;bottom:calc(64px + env(safe-area-inset-bottom));background:var(--ink);color:#fff;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;z-index:11}
.overlay{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:#fff;width:100%;max-width:640px;max-height:88vh;overflow:auto;border-radius:20px 20px 0 0;padding:16px 16px calc(20px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}
.hidden{display:none!important}
#toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:12px;font-size:14px;z-index:30;opacity:0;transition:opacity .2s;pointer-events:none;max-width:90vw}
#toast.on{opacity:1}
.banner{background:var(--warnBg);color:var(--warn);border-radius:14px;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px}
.month-sel{height:44px;padding:0 30px 0 12px;border:1px solid #D6DCE8;border-radius:12px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230F172A' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;font-size:18px;font-weight:700;appearance:none;-webkit-appearance:none}
.mono{font-family:ui-monospace,Menlo,monospace;font-size:12px;white-space:pre-wrap;word-break:break-all}
