*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;background:#f3f5f4;color:#222;font-family:-apple-system,"PingFang SC","HarmonyOS Sans SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;font-size:16px;min-height:100%;-webkit-text-size-adjust:100%}
html{background:#2E7D6B}
body{background:#f3f5f4;min-height:100dvh;overscroll-behavior-y:none}
button{font:inherit;border:0;background:none;color:inherit;cursor:pointer}
input{font:inherit}
.top{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;background:#2E7D6B;color:#fff;padding:6px 8px;padding-top:calc(6px + constant(safe-area-inset-top));padding-top:calc(6px + env(safe-area-inset-top));padding-left:calc(8px + constant(safe-area-inset-left));padding-left:calc(8px + env(safe-area-inset-left));padding-right:calc(8px + constant(safe-area-inset-right));padding-right:calc(8px + env(safe-area-inset-right))}
.mbtn{width:52px;height:48px;font-size:30px;color:#fff;border-radius:24px}
.mbtn:active{background:rgba(255,255,255,.15)}
.mtitle{font-size:19px;font-weight:600;padding:10px 16px}
.summary{display:flex;background:#2E7D6B;color:#fff;padding:4px 8px 18px}
.summary div{flex:1;text-align:center}
.summary .lbl{display:block;font-size:13px;opacity:.85;margin-bottom:4px}
.summary b{font-size:19px;font-weight:600}
main{padding:10px 10px 150px;padding:10px 10px calc(150px + constant(safe-area-inset-bottom));padding:10px 10px calc(150px + env(safe-area-inset-bottom))}
.tab{display:none}.tab.active{display:block}
.day{background:#fff;border-radius:12px;margin-bottom:10px;overflow:hidden}
.dayHead{display:flex;justify-content:space-between;padding:10px 14px;font-size:14px;color:#666;background:#fafafa;border-bottom:1px solid #eee}
.rec{display:flex;align-items:center;padding:12px 14px;min-height:60px;border-bottom:1px solid #f2f2f2}
.rec:last-child{border-bottom:0}
.rec:active{background:#f0f7f5}
.ico{width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;flex-shrink:0;margin-right:12px}
.rinfo{flex:1;min-width:0}
.rcat{font-size:16px}
.rnote{font-size:13px;color:#999;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ramt{font-size:17px;font-weight:600;margin-left:8px}
.ramt.exp{color:#222}.ramt.inc{color:#2E7D6B}
.empty{text-align:center;color:#999;padding:60px 20px;line-height:1.8}
.fab{position:fixed;right:20px;right:max(20px, env(safe-area-inset-right));bottom:84px;bottom:calc(84px + constant(safe-area-inset-bottom));bottom:calc(84px + env(safe-area-inset-bottom));width:64px;height:64px;border-radius:32px;background:#2E7D6B;color:#fff;font-size:34px;box-shadow:0 4px 12px rgba(0,0,0,.25);z-index:6}
.fab:active{transform:scale(.95)}
.bottom{position:fixed;left:0;right:0;bottom:0;display:flex;background:#fff;border-top:1px solid #e5e5e5;z-index:6;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left);padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}
.bottom button{flex:1;min-width:0;height:62px;font-size:12px;color:#888;display:flex;flex-direction:column;align-items:center;justify-content:center}
.bottom button i{font-style:normal;font-size:22px;line-height:1.1}
.bottom button.on{color:#2E7D6B;font-weight:600}
.card{background:#fff;border-radius:12px;padding:14px;margin-bottom:10px;position:relative}
.card h3{margin:0 0 12px;font-size:17px}
#pie{width:100%;max-width:300px;display:block;margin:0 auto}
.pieCenter{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;pointer-events:none;font-size:14px;color:#666}
.pieCenter b{display:block;font-size:20px;color:#222}
.bar{margin:10px 0}
.barTop{display:flex;justify-content:space-between;font-size:15px;margin-bottom:5px}
.barTop small{color:#999;margin-left:6px}
.barTrack{height:12px;background:#eef1f0;border-radius:6px;overflow:hidden}
.barFill{height:100%;border-radius:6px}
.seg{display:flex;background:#e9eeec;border-radius:10px;padding:3px;margin-bottom:10px}
.seg button{flex:1;height:40px;border-radius:8px;color:#555}
.seg button.on{background:#fff;color:#2E7D6B;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.1)}
.seg.small{margin:0;width:150px}
.seg.small button{height:34px}
.catList{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.chip{display:flex;align-items:center;background:#f2f4f3;border-radius:20px;padding:0 4px 0 14px;height:40px}
.chip button{width:34px;height:34px;color:#c33;font-size:18px}
.row{display:flex;align-items:center;gap:10px;margin:8px 0}
.row label{width:44px;color:#666}
.row input{flex:1;height:48px;border:1px solid #ddd;border-radius:10px;padding:0 12px;background:#fff;min-width:0}
.btn{height:48px;padding:0 18px;border-radius:10px;background:#2E7D6B;color:#fff;font-size:16px}
.btn:active{opacity:.85}
.btn.block{display:block;width:100%;margin:8px 0}
.btn.light{background:#e6f2ee;color:#2E7D6B}
.btn.danger{background:#fdecec;color:#c33}
.hint{font-size:13px;color:#888;line-height:1.7;margin:8px 0 0}
.mask{position:fixed;inset:0;background:rgba(0,0,0,.35);display:none;z-index:10}
.mask.show{display:block}
.sheet{position:fixed;left:0;right:0;bottom:0;background:#fff;border-radius:16px 16px 0 0;padding:10px 14px 20px;padding:10px 14px calc(20px + constant(safe-area-inset-bottom));padding:10px 14px calc(20px + env(safe-area-inset-bottom));z-index:11;transform:translateY(105%);transition:transform .2s ease;max-height:92vh;max-height:92dvh;overflow-y:auto}
.sheet.show{transform:none}
.sheetHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.link{height:44px;padding:0 10px;color:#666;font-size:16px}
.link.strong{color:#2E7D6B;font-weight:600}
.amountRow{display:flex;align-items:center;border-bottom:2px solid #2E7D6B;margin:6px 0 12px}
.amountRow span{font-size:28px;color:#2E7D6B;margin-right:6px}
.amountRow input{flex:1;border:0;outline:0;font-size:34px;height:60px;min-width:0;background:transparent}
.catGrid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:8px}
.catGrid button{height:64px;border-radius:10px;background:#f4f6f5;font-size:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px}
.catGrid button .ico{width:30px;height:30px;font-size:13px;margin:0 0 3px}
.catGrid button.on{background:#e0f0eb;outline:2px solid #2E7D6B}
.dialog{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;align-items:center;justify-content:center;z-index:20}
.dialog.show{display:flex}
.dbox{background:#fff;border-radius:14px;width:84%;max-width:360px;padding:20px 18px 12px}
.dbox p{margin:0 0 16px;line-height:1.6;white-space:pre-line}
.dbtns{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.dbtns button{height:44px;padding:0 16px;border-radius:10px;background:#f0f0f0}
.dbtns button.primary{background:#2E7D6B;color:#fff}
.dbtns button.warn{background:#c33;color:#fff}
.toast{position:fixed;left:50%;bottom:160px;bottom:calc(160px + constant(safe-area-inset-bottom));bottom:calc(160px + env(safe-area-inset-bottom));transform:translateX(-50%);background:rgba(0,0,0,.78);color:#fff;padding:10px 18px;border-radius:20px;font-size:14px;display:none;z-index:30;max-width:80%;text-align:center}
.toast.show{display:block}
.filePick{position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;overflow:hidden}
.alerts{display:none;position:sticky;top:60px;top:calc(60px + constant(safe-area-inset-top));top:calc(60px + env(safe-area-inset-top));z-index:4;background:#fdecec;border:1px solid #f3b4b4;border-radius:12px;padding:12px 14px;margin-bottom:10px;box-shadow:0 4px 14px rgba(180,40,40,.12)}
.alerts.show{display:block}
.alerts p{margin:0 0 8px;color:#c33;font-weight:700;font-size:16px;line-height:1.45}
.alerts p:last-child{margin-bottom:0}
.bRow{margin:0 0 4px}
.bLabel{font-size:16px;font-weight:600}
.bLabel small{display:block;font-weight:400;color:#888;font-size:12px;margin-top:2px}
.bStat{font-size:13px;color:#666;margin:0 0 12px;line-height:1.5}
.bStat.over{color:#c33;font-weight:700}
.unit{color:#666;flex:none}
.catBudget{border-top:1px solid #eee;padding-top:12px;margin-top:4px}
.catBudget:first-child{border-top:0;padding-top:0}
.bActions{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.bActions .btn{height:40px;padding:0 12px;font-size:14px}
