*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;background:#f5f6f7;color:#222;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif;font-size:16px;-webkit-text-size-adjust:100%}
.hidden{display:none!important}
.muted{color:#888}.small{font-size:13px}
.err{color:#d33;min-height:1.2em;margin:8px 0 0}
input,select{font:inherit;width:100%;padding:12px;border:1px solid #ddd;border-radius:10px;background:#fff;min-height:48px;-webkit-appearance:none;appearance:none}
label{display:block;font-size:14px;color:#666;margin:10px 0}
label input{margin-top:4px;color:#222}
.btn{display:inline-block;text-align:center;text-decoration:none;font:inherit;padding:12px 16px;min-height:48px;border-radius:10px;border:1px solid #d8dcdf;background:#fff;color:#222;cursor:pointer;line-height:24px}
.btn.block{display:block;width:100%;margin-top:10px}
.btn.primary{background:#1aa172;border-color:#1aa172;color:#fff}
.btn.danger{color:#d33;border-color:#f0c4c4}
.btn.big{font-size:18px;min-height:54px}
.btn.small{min-height:40px;padding:8px 12px;font-size:14px}
.screen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.login-box{width:100%;max-width:340px;text-align:center}
.login-box .logo{width:64px;height:64px;border-radius:18px;background:#1aa172;color:#fff;font-size:32px;line-height:64px;margin:0 auto}
.login-box input{text-align:center;font-size:22px;letter-spacing:2px;margin-top:8px}
.topbar{position:sticky;top:0;z-index:5;background:#e8f3ef;padding:14px 16px;font-weight:600;font-size:17px;text-align:center}
main{padding:12px 14px calc(84px + env(safe-area-inset-bottom))}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:10;display:flex;background:#fff;border-top:1px solid #e5e5e5;padding-bottom:env(safe-area-inset-bottom)}
.tabbar button{flex:1;border:0;background:none;font:inherit;font-size:12px;color:#777;padding:6px 0 8px;min-height:58px}
.tabbar .ic{display:block;font-size:22px;line-height:26px}
.tabbar button.on{color:#1aa172}
.seg{display:flex;background:#e9ecee;border-radius:10px;padding:3px;margin:4px 0 12px}
.seg button{flex:1;border:0;background:none;font:inherit;padding:10px;border-radius:8px;min-height:44px;color:#555}
.seg button.on{background:#fff;color:#111;font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
#type-seg button.on[data-type="支出"]{color:#e05a2a}
#type-seg button.on[data-type="收入"]{color:#1aa172}
.amount-wrap{display:flex;align-items:center;background:#fff;border-radius:12px;padding:6px 14px;border:1px solid #ddd}
.amount-wrap .cur{font-size:28px;color:#999;margin-right:6px}
.amount-wrap input{border:0;font-size:40px;font-weight:600;padding:8px 0;min-height:64px}
.amount-wrap input:focus{outline:none}
.label{font-size:14px;color:#666;margin:14px 0 6px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips button{font:inherit;font-size:15px;border:1px solid #dcdfe2;background:#fff;border-radius:20px;padding:8px 14px;min-height:42px;color:#333}
.chips button.on{background:#1aa172;border-color:#1aa172;color:#fff}
.chips.sub{margin-top:8px}
.chips.sub button{font-size:14px;min-height:38px;padding:6px 12px;background:#f3f6f5}
.chips.sub button.on{background:#d9f1e7;color:#0d7a53;border-color:#9fd9c1}
.row2{display:flex;gap:10px}.row2>*{flex:1}
.month-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:600}
.totals{display:flex;gap:8px;margin-bottom:12px}
.totals div{flex:1;background:#fff;border-radius:12px;padding:10px;text-align:center}
.totals b{display:block;font-size:17px;margin-top:2px}
.inc{color:#1aa172}.exp{color:#e05a2a}
.day{margin-bottom:12px;background:#fff;border-radius:12px;overflow:hidden}
.day-h{display:flex;justify-content:space-between;padding:10px 14px;background:#fafbfb;font-size:13px;color:#777;border-bottom:1px solid #f0f0f0}
.item{display:flex;align-items:center;padding:12px 14px;border-bottom:1px solid #f3f3f3;min-height:58px;cursor:pointer}
.item:last-child{border-bottom:0}
.item .l{flex:1;min-width:0}
.item .t{font-size:16px}
.item .s{font-size:12px;color:#999;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item .a{font-size:17px;font-weight:600;margin-left:10px;white-space:nowrap}
.empty{text-align:center;color:#999;padding:40px 0}
.bar-row{background:#fff;border-radius:12px;padding:12px 14px;margin-bottom:8px}
.bar-top{display:flex;justify-content:space-between;font-size:15px}
.bar{height:10px;background:#eef1f2;border-radius:5px;margin-top:8px;overflow:hidden}
.bar i{display:block;height:100%;background:#1aa172;border-radius:5px}
.bar.exp i{background:#f08a5d}
.subs{font-size:12px;color:#888;margin-top:6px;line-height:1.6}
.card{background:#fff;border-radius:12px;padding:14px;margin-bottom:12px}
.card h3{margin:0 0 10px;font-size:16px}
.cat-item{border-bottom:1px solid #f0f0f0;padding:10px 0}
.cat-item .n{display:flex;justify-content:space-between;align-items:center;font-weight:600}
.cat-item .sublist{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.tag{display:inline-flex;align-items:center;background:#f1f3f4;border-radius:14px;padding:4px 4px 4px 10px;font-size:14px}
.tag button,.mini{border:0;background:none;color:#999;font:inherit;font-size:14px;padding:4px 8px;min-height:32px}
.mini{color:#1aa172}
.addrow{display:flex;gap:8px;margin-top:10px}.addrow input{flex:1}.addrow .btn{flex:none}
.toast{position:fixed;left:50%;top:40%;transform:translateX(-50%);background:rgba(0,0,0,.78);color:#fff;padding:12px 20px;border-radius:10px;z-index:50;font-size:15px;max-width:80%;text-align:center}

#type-seg button.on[data-type="转账"]{color:#2f6fd6}
.tr{color:#2f6fd6}
select{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;padding-right:36px}
label.check{display:flex;align-items:center;gap:8px;min-height:44px;margin:6px 0}
label.check input{width:22px;height:22px;min-height:0;margin:0;-webkit-appearance:checkbox;appearance:auto}
.net{text-align:center}
.net b{display:block;font-size:30px;margin:4px 0}
.acct{display:flex;align-items:center;background:#fff;border-radius:12px;padding:14px;margin-bottom:8px;min-height:64px;cursor:pointer}
.acct .ic{width:40px;height:40px;border-radius:12px;background:#e8f3ef;color:#1aa172;text-align:center;line-height:40px;font-size:16px;margin-right:12px;flex:none}
.acct .l{flex:1;min-width:0}.acct .n{font-size:16px}.acct .t{font-size:12px;color:#999}
.acct b{font-size:18px;white-space:nowrap}
.acct.archived{opacity:.55}
.neg{color:#e05a2a}
.acct-head{text-align:center}
.acct-head .ad-name{font-size:18px;font-weight:600;margin-top:2px}
.acct-head b{display:block;font-size:28px;margin:6px 0}
#acct-back{margin-bottom:10px}

.acct-sec{margin:0 0 16px}
.acct-sec-h{display:flex;justify-content:space-between;align-items:baseline;padding:2px 4px 8px;font-size:14px;color:#666;font-weight:600}
.acct-sec-h b{font-size:16px;color:#222}
.acct .ic.debt{background:#fdeeee;color:#e05a2a}
.overpay{color:#1aa172}
