:root{--bg: #f5f7fb;--surface: #ffffff;--surface-muted: #f1f5f9;--text: #0f172a;--text-secondary: #475569;--text-muted: #94a3b8;--border: rgba(15, 23, 42, .08);--primary: #2563eb;--primary-soft: #eff6ff;--expense: #e11d48;--expense-soft: #fff1f2;--income: #059669;--income-soft: #ecfdf5;--radius-sm: 10px;--radius-md: 16px;--radius-lg: 22px;--shadow-sm: 0 2px 10px rgba(15, 23, 42, .04);--shadow-md: 0 10px 30px rgba(15, 23, 42, .08);--safe-top: env(safe-area-inset-top, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px)}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;overscroll-behavior-y:none}button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}button{cursor:pointer;border:none;background:none;padding:0}.num{font-variant-numeric:tabular-nums}.app-shell{min-height:100dvh;max-width:640px;margin:0 auto;display:flex;flex-direction:column;padding-bottom:calc(82px + var(--safe-bottom))}.topbar{position:sticky;top:0;z-index:20;padding:calc(12px + var(--safe-top)) 16px 12px;background:#f5f7fbe0;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);display:flex;align-items:center;justify-content:space-between;gap:12px}.topbar-title{font-size:18px;font-weight:700;letter-spacing:-.02em;display:flex;align-items:center;gap:8px}.user-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 10px 5px 6px;background:var(--surface);border:1px solid var(--border);border-radius:999px;font-size:13px;font-weight:600;box-shadow:var(--shadow-sm)}.avatar-dot{width:22px;height:22px;border-radius:50%;color:#fff;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.avatar-dot.sm{width:18px;height:18px;font-size:10px}.avatar-dot.lg{width:40px;height:40px;font-size:16px}.main-content{padding:4px 16px 20px;display:flex;flex-direction:column;gap:14px}.hero-card{background:linear-gradient(135deg,#0f172a,#1e293b 55%,#1e3a8a);color:#fff;border-radius:var(--radius-lg);padding:18px 18px 16px;box-shadow:0 12px 28px #0f172a2e}.hero-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}.month-nav{display:inline-flex;align-items:center;gap:4px;background:#ffffff1f;border-radius:999px;padding:3px 6px}.month-nav button{color:#ffffffe6;width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.month-nav button:active{background:#ffffff2e}.month-label{font-size:13px;font-weight:600;padding:0 6px;min-width:82px;text-align:center}.hero-all-btn{font-size:12px;font-weight:600;color:#ffffffd9;background:#ffffff1f;padding:6px 12px;border-radius:999px}.hero-all-btn.active{background:#fff;color:#0f172a}.hero-net-label{font-size:12px;color:#ffffffad;margin-bottom:4px}.hero-net-value{font-size:30px;font-weight:700;letter-spacing:-.02em;margin-bottom:16px}.hero-split{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hero-stat{background:#ffffff17;border-radius:12px;padding:10px 12px}.hero-stat-label{font-size:11px;color:#ffffffad;display:flex;align-items:center;gap:5px;margin-bottom:4px}.hero-stat-value{font-size:17px;font-weight:700}.dot-income{width:7px;height:7px;border-radius:50%;background:#34d399}.dot-expense{width:7px;height:7px;border-radius:50%;background:#fb7185}.search-row{display:flex;gap:8px}.search-box{flex:1;display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:0 12px;height:40px;box-shadow:var(--shadow-sm)}.search-box input{flex:1;border:none;outline:none;background:transparent;font-size:14px;min-width:0}.filter-strip{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}.filter-strip::-webkit-scrollbar{display:none}.chip{flex-shrink:0;display:inline-flex;align-items:center;gap:5px;padding:7px 12px;border-radius:999px;font-size:13px;font-weight:500;background:var(--surface);color:var(--text-secondary);border:1px solid var(--border);transition:all .15s ease}.chip.active{background:var(--text);color:#fff;border-color:var(--text)}.chip.expense.active{background:var(--expense);border-color:var(--expense)}.chip.income.active{background:var(--income);border-color:var(--income)}.filter-select{flex-shrink:0;height:34px;padding:0 10px;border-radius:999px;font-size:13px;font-weight:500;background:var(--surface);color:var(--text-secondary);border:1px solid var(--border);outline:none}.day-group{display:flex;flex-direction:column;gap:8px}.day-header{display:flex;align-items:center;justify-content:space-between;padding:4px 4px 0;font-size:12px;font-weight:600;color:var(--text-secondary)}.day-totals{display:flex;gap:10px;font-weight:500;color:var(--text-muted)}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm)}.tx-list{overflow:hidden}.tx-item{width:100%;text-align:left;padding:13px 14px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border);transition:background .12s ease}.tx-item:last-child{border-bottom:none}.tx-item:active{background:#f8fafc}.tx-item.voided{opacity:.55}.tx-item.voided .tx-reason{text-decoration:line-through}.tx-badge-icon{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:13px;font-weight:700}.tx-badge-icon.expense{background:var(--expense-soft);color:var(--expense)}.tx-badge-icon.income{background:var(--income-soft);color:var(--income)}.tx-body{flex:1;min-width:0}.tx-reason{font-size:15px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:5px}.tx-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;color:var(--text-secondary)}.tag{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:11px;font-weight:600;background:var(--surface-muted);color:var(--text-secondary)}.recorder-tag{display:inline-flex;align-items:center;gap:4px;padding:2px 7px 2px 4px;border-radius:999px;font-size:11px;font-weight:600;background:#f1f5f9;color:var(--text)}.color-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.tx-right{text-align:right;flex-shrink:0}.tx-amount{font-size:16px;font-weight:700;letter-spacing:-.01em}.tx-amount.expense{color:var(--expense)}.tx-amount.income{color:var(--income)}.tx-cat{font-size:11px;color:var(--text-muted);margin-top:3px}.empty-box{text-align:center;padding:46px 20px;color:var(--text-muted)}.empty-box p{margin:10px 0 0;font-size:14px}.bottom-nav{position:fixed;left:50%;transform:translate(-50%);bottom:0;width:100%;max-width:640px;z-index:30;background:#fffffff0;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-top:1px solid var(--border);padding:6px 12px calc(8px + var(--safe-bottom));display:grid;grid-template-columns:1fr 1fr auto 1fr;align-items:center;gap:4px}.nav-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px 4px;border-radius:12px;font-size:11px;font-weight:600;color:var(--text-muted)}.nav-btn.active{color:var(--primary)}.fab-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:44px;padding:0 18px;border-radius:999px;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;font-size:14px;font-weight:700;box-shadow:0 6px 18px #2563eb59;transition:transform .12s ease}.fab-add:active{transform:scale(.96)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#0f172a7a;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:flex-end;justify-content:center;animation:fadeIn .15s ease}@media(min-width:640px){.modal-backdrop{align-items:center;padding:20px}}.sheet{width:100%;max-width:560px;max-height:92dvh;background:var(--surface);border-radius:22px 22px 0 0;display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--shadow-md);animation:slideUp .2s cubic-bezier(.22,1,.36,1)}@media(min-width:640px){.sheet{border-radius:22px}}.sheet-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border)}.sheet-title{font-size:16px;font-weight:700}.icon-btn{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--text-secondary);background:var(--surface-muted)}.sheet-body{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:14px}.sheet-footer{padding:12px 16px calc(14px + var(--safe-bottom));border-top:1px solid var(--border);display:flex;gap:10px;background:var(--surface)}.seg-control{display:grid;grid-template-columns:1fr 1fr;gap:6px;background:var(--surface-muted);padding:4px;border-radius:14px}.seg-btn{height:40px;border-radius:10px;font-size:15px;font-weight:700;color:var(--text-secondary);transition:all .15s ease}.seg-btn.active.expense{background:var(--expense);color:#fff;box-shadow:0 3px 10px #e11d4847}.seg-btn.active.income{background:var(--income);color:#fff;box-shadow:0 3px 10px #05966947}.amount-input-wrap{display:flex;align-items:center;gap:8px;background:var(--surface-muted);border:2px solid transparent;border-radius:16px;padding:12px 16px;transition:border-color .15s ease,background .15s ease}.amount-input-wrap:focus-within{background:#fff;border-color:var(--primary)}.amount-currency{font-size:26px;font-weight:700;color:var(--text-secondary)}.amount-input{flex:1;border:none;outline:none;background:transparent;font-size:32px;font-weight:700;width:100%;min-width:0}.field{display:flex;flex-direction:column;gap:6px}.field-label{font-size:12px;font-weight:600;color:var(--text-secondary);display:flex;align-items:center;justify-content:space-between}.input,.textarea,.select{width:100%;border:1px solid var(--border);border-radius:12px;padding:10px 12px;background:#f8fafc;outline:none;font-size:15px;transition:border-color .15s ease,background .15s ease}.input:focus,.textarea:focus,.select:focus{background:#fff;border-color:var(--primary)}.textarea{resize:vertical;min-height:68px}.field-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.pill-grid{display:flex;flex-wrap:wrap;gap:7px}.pill-btn{padding:7px 12px;border-radius:10px;font-size:13px;font-weight:500;background:var(--surface-muted);color:var(--text-secondary);border:1px solid transparent;display:inline-flex;align-items:center;gap:5px}.pill-btn.active{background:var(--primary-soft);color:var(--primary);border-color:#2563eb59;font-weight:600}.btn{height:44px;min-height:44px;flex-shrink:0;border-radius:12px;padding:0 16px;font-size:15px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:opacity .15s ease,transform .1s ease}.btn:disabled{opacity:.55;cursor:not-allowed}.btn:active:not(:disabled){transform:scale(.98)}.btn-primary{background:var(--primary);color:#fff}.btn-expense{background:var(--expense);color:#fff}.btn-income{background:var(--income);color:#fff}.sheet-footer .btn-primary,.sheet-footer .btn-expense,.sheet-footer .btn-income{flex:1}.btn-secondary{background:var(--surface-muted);color:var(--text)}.btn-danger-soft{background:var(--expense-soft);color:var(--expense)}.upload-area{display:flex;align-items:center;gap:12px}.upload-trigger{display:inline-flex;align-items:center;gap:6px;padding:9px 14px;border-radius:12px;border:1px dashed #cbd5e1;background:#f8fafc;font-size:13px;font-weight:600;color:var(--text-secondary)}.thumb-wrap{position:relative;width:64px;height:64px;border-radius:10px;overflow:hidden;border:1px solid var(--border)}.thumb-wrap img{width:100%;height:100%;object-fit:cover}.thumb-remove{position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;background:#0f172ab8;color:#fff;display:flex;align-items:center;justify-content:center}.detail-hero{text-align:center;padding:12px 0 6px}.detail-amount{font-size:32px;font-weight:800;margin:6px 0 4px}.detail-amount.expense{color:var(--expense)}.detail-amount.income{color:var(--income)}.detail-rows{border-radius:14px;background:#f8fafc;padding:4px 14px}.detail-row{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:10px 0;border-bottom:1px solid var(--border);font-size:14px}.detail-row:last-child{border-bottom:none}.detail-key{color:var(--text-secondary);flex-shrink:0}.detail-val{text-align:right;font-weight:600;word-break:break-word}.receipt-full{width:100%;max-height:280px;object-fit:contain;border-radius:12px;background:#0f172a;cursor:zoom-in}.section-card{padding:16px}.section-title{font-size:15px;font-weight:700;margin:0 0 12px;display:flex;align-items:center;justify-content:space-between}.stat-row{display:flex;flex-direction:column;gap:6px;padding:10px 0;border-bottom:1px solid var(--border)}.stat-row:last-child{border-bottom:none;padding-bottom:0}.stat-row-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.bar-track{height:7px;border-radius:999px;background:var(--surface-muted);overflow:hidden}.bar-fill{height:100%;border-radius:999px;transition:width .3s ease}.trend-bars{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;align-items:end;height:120px;padding-top:12px}.trend-col{display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end}.trend-pair{display:flex;align-items:flex-end;gap:3px;height:86px}.trend-bar{width:10px;border-radius:4px 4px 2px 2px;min-height:3px}.trend-bar.income{background:var(--income)}.trend-bar.expense{background:var(--expense)}.trend-label{font-size:11px;color:var(--text-muted)}.auth-page{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px 16px;background:linear-gradient(160deg,#0f172a,#1e293b 48%,#f5f7fb 48.2%)}.auth-card{width:100%;max-width:420px;background:var(--surface);border-radius:24px;padding:24px 20px;box-shadow:0 20px 50px #0f172a29}.auth-brand{text-align:center;margin-bottom:20px}.auth-logo{width:56px;height:56px;border-radius:16px;margin:0 auto 10px;display:block}.auth-brand h1{margin:0;font-size:21px;font-weight:800}.auth-brand p{margin:6px 0 0;font-size:13px;color:var(--text-secondary)}.swatch-row{display:flex;gap:8px;flex-wrap:wrap}.swatch{width:28px;height:28px;border-radius:50%;border:2px solid transparent}.swatch.active{border-color:var(--text);transform:scale(1.1)}.error-banner{background:var(--expense-soft);color:var(--expense);font-size:13px;font-weight:600;padding:10px 12px;border-radius:12px}.toast{position:fixed;top:calc(16px + var(--safe-top));left:50%;transform:translate(-50%);z-index:80;background:#0f172aeb;color:#fff;padding:10px 18px;border-radius:999px;font-size:13px;font-weight:600;box-shadow:var(--shadow-md);animation:fadeIn .15s ease}.lightbox{position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;background:#000000eb;display:flex;align-items:center;justify-content:center;padding:16px}.lightbox img{max-width:100%;max-height:92dvh;object-fit:contain;border-radius:8px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{transform:translateY(28px);opacity:.7}to{transform:translateY(0);opacity:1}}
