:root{--ink:#222923;--muted:#777c73;--cream:#fffcf3;--paper:#fffefa;--yellow:#ffd66e;--pink:#f77790;--pink-bg:#ffe8eb;--mint:#dff5e7;--line:#242e2a;--shadow:#d0cab9;--white:#fff;--border:2px solid var(--line);font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink)}
*{box-sizing:border-box}body{margin:0;background:#f0ede6;background-image:radial-gradient(#e8dfbc 0.7px,transparent 0.8px);background-size:26px 26px}button,input,textarea,select{font:inherit}button{cursor:pointer;color:inherit}button:disabled{opacity:.48;cursor:not-allowed}input,select,textarea{min-width:0}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #a4cbd2;outline-offset:2px}.shell{max-width:1020px;min-height:100vh;margin:auto;background:var(--cream);box-shadow:0 0 36px #171b170c;background-image:radial-gradient(ellipse at 50% 20%,#ffe9ba2b 0,transparent 67%),radial-gradient(#f7e8bf70 .75px,transparent .85px);background-size:auto,24px 24px}.topbar{height:88px;display:flex;align-items:center;gap:12px;padding:18px 24px 12px;border-bottom:1px solid #e9e5d5}.brandmark{font-size:34px;background:var(--yellow);border:var(--border);height:50px;width:50px;display:grid;place-items:center;border-radius:13px;transform:rotate(-5deg)}.top-title{flex:1;min-width:0;line-height:1.18}.top-title strong{font-size:25px;letter-spacing:1px}.eyebrow{font-size:10px;font-weight:900;letter-spacing:3px;color:#b38352;margin-bottom:5px}.icon-btn{border:var(--border);border-radius:15px;background:var(--paper);min-height:44px;min-width:44px;font-size:21px;display:grid;place-items:center}.main{padding:24px 24px 118px;min-height:60vh}.bottom-nav{position:sticky;bottom:0;z-index:10;display:flex;background:var(--yellow);padding:9px 10px calc(11px + env(safe-area-inset-bottom));border-top:var(--border);gap:4px}.nav-item{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;flex-direction:column;border:0;background:transparent;border-radius:13px;padding:7px 1px;font-weight:800;font-size:12px;color:#6e6760;min-height:56px}.nav-item.active{background:#fff8da;color:var(--ink);box-shadow:inset 0 0 0 1.5px #e6c25e}.nav-icon{font-size:24px;line-height:1}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:17px;flex-wrap:wrap}.page-heading h1{font-size:25px;margin:0;letter-spacing:-.5px}.subheading{color:var(--muted);font-size:13px;margin:5px 0 0}.actions{display:flex;gap:9px;flex-wrap:wrap}.button{display:inline-flex;justify-content:center;align-items:center;gap:7px;min-height:42px;padding:8px 14px;border:var(--border);border-radius:14px;background:var(--white);font-weight:800;box-shadow:0 3px 0 #e1d9c6;text-decoration:none;line-height:1.2;font-size:14px}.button.primary{background:var(--yellow)}.button.pink{background:var(--pink);color:#fff;border-color:#783d45}.button.soft{background:var(--pink-bg)}.button.small{min-height:34px;font-size:12px;padding:6px 9px;border-width:1.5px;box-shadow:none}.button.text{background:transparent;border:0;box-shadow:none;color:#b65b6f;padding:5px}.button.danger{color:#ba424a}.card{background:var(--paper);border:var(--border);border-radius:19px;padding:18px;box-shadow:0 4px 0 #e8e1d0;margin-bottom:18px}.soft-card{border:1px solid #eedfcb;background:#fff8e9;border-radius:16px;padding:14px}.hero{display:grid;grid-template-columns:1.3fr .7fr;gap:15px;align-items:stretch}.hero-main{background:#fff;min-width:0}.hero-main .eyebrow{letter-spacing:1.6px}.big-amount{font-size:clamp(27px,5vw,40px);font-weight:850;color:#e96881;letter-spacing:-1px;margin:10px 0 5px;overflow-wrap:anywhere}.money-secondary{font-size:13px;color:#807a75}.hero-sum{display:flex;justify-content:space-between;gap:12px;border-top:1px dashed #e1d6c3;margin-top:12px;padding-top:12px;font-size:13px}.small-stat{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:11px;background:var(--mint);text-align:center}.small-stat .number{font-size:26px;font-weight:900}.small-stat .label{font-size:12px;color:#53685b}.section-row{display:flex;align-items:center;justify-content:space-between;gap:9px;margin:22px 0 10px;flex-wrap:wrap}.section-row h2{font-size:19px;margin:0}.select{background:#fff;border:2px solid #e1d8c2;border-radius:12px;padding:9px 10px;min-height:42px;font-weight:700;color:var(--ink);max-width:100%}.input{background:#fff;border:1.5px solid #c8c6bc;border-radius:12px;padding:10px 11px;min-height:43px;width:100%;color:var(--ink)}.field{display:flex;flex-direction:column;gap:6px;margin:0 0 13px;min-width:0}.field label{font-size:12px;font-weight:800;color:#55584f}.field-note{font-size:11px;color:#858077}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}.field-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.filterbar{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:12px 0}.pills{display:flex;gap:6px;flex-wrap:wrap}.pill{font-weight:800;font-size:13px;padding:8px 11px;border:1.5px solid #d7d0bd;border-radius:100px;background:white;min-height:38px}.pill.selected{background:#ffe5ea;border-color:var(--pink);color:#ae425b}.ledger-list{display:flex;flex-direction:column;gap:10px}.datehead{color:#8f7f67;font-size:13px;font-weight:900;margin:14px 0 8px}.transaction{width:100%;display:flex;align-items:center;gap:12px;border:1.5px solid #e1d9c5;background:#fff;border-radius:16px;padding:12px;text-align:left;min-height:75px}.transaction:hover{border-color:#e4af7e}.transaction + .transaction{margin-top:7px}.category-icon{width:44px;height:44px;border:2px solid var(--ink);background:#fff5e0;border-radius:50%;display:grid;place-items:center;font-size:23px;flex-shrink:0}.tx-text{flex:1;min-width:0}.tx-title{font-size:15px;font-weight:850;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-sub{font-size:11.5px;color:var(--muted);margin-top:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-right{text-align:right;min-width:68px}.tx-amount{font-weight:900;font-size:15px;white-space:nowrap}.tx-meta{font-size:11px;color:#ac7c82;margin-top:5px}.merchant-logo{width:26px;height:26px;object-fit:contain;border-radius:6px;vertical-align:middle;background:#fff;border:1px solid #ebe6e0}.merchant-icon{display:inline-grid;place-items:center;width:26px;height:26px;background:#fff1d8;border:1px solid #eee0c8;border-radius:6px;vertical-align:middle;font-weight:850;font-size:11px;color:#a36d43}.empty{text-align:center;border:2px dashed #e3d8c2;background:#fffefc;border-radius:18px;padding:28px 16px;color:#706e65;margin:17px 0}.empty .art{font-size:50px;margin-bottom:9px}.empty strong{display:block;color:#333b35;font-size:16px;margin-bottom:8px}.empty p{font-size:13px;margin:7px 0 14px;line-height:1.6}.quick-actions{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}.summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.summary-tile{background:#fff;border:1.5px solid #e4dac5;border-radius:14px;padding:13px;min-width:0}.summary-tile .value{font-size:18px;font-weight:900;overflow-wrap:anywhere;margin-top:7px}.summary-tile .caption{font-size:11px;color:#908877}.tabs{display:flex;border-radius:13px;background:#f4eee0;padding:4px;gap:4px;max-width:100%;flex-wrap:wrap}.tab{border:0;background:transparent;border-radius:9px;min-height:38px;padding:7px 12px;font-weight:800;font-size:13px;color:#7e7b72}.tab.active{background:#fff;color:#ad5367;box-shadow:0 1px 4px #0000000d}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.calendar-week{font-size:11px;color:#888;text-align:center;padding-bottom:7px}.day{position:relative;min-height:60px;border:1px solid #e7e1d5;border-radius:10px;background:#fff;display:flex;align-items:flex-start;justify-content:center;flex-direction:column;gap:2px;padding:7px 3px;text-align:center}.day span{font-size:12px;font-weight:750;align-self:center}.day small{font-size:10px;color:#df667f;font-weight:800;align-self:center;overflow:hidden;white-space:nowrap;max-width:100%}.day.today{border-color:#e99880}.day.selected{background:#ffe2e6;border-color:var(--pink)}.day.blank{background:transparent;border-color:transparent}.month-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}.month-row strong{font-size:18px}.rank-item{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:10px;align-items:center;margin:12px 0}.rank-text{min-width:0}.rank-name{font-weight:850;font-size:14px}.rank-sub{font-size:12px;color:#8f887d;margin-top:4px}.rank-amount{font-weight:850;font-size:13px}.progress{width:100%;height:7px;background:#f4eee1;border-radius:12px;overflow:hidden;margin-top:6px}.progress>span{display:block;height:100%;border-radius:12px;background:var(--pink)}.chart-bars{height:155px;display:flex;gap:6px;align-items:end;border-bottom:2px solid #ddd4c6;padding:10px 2px 0}.chart-bar{background:#f6aebc;border-radius:5px 5px 0 0;flex:1;min-width:4px;position:relative}.chart-bar:nth-child(3n){background:#ffd773}.chart-bar:hover::after{content:attr(data-label);position:absolute;bottom:100%;left:0;background:#333;color:white;padding:5px;border-radius:4px;font-size:10px;white-space:nowrap;z-index:1}.chart-axis{display:flex;justify-content:space-between;color:#929187;font-size:10px;padding-top:6px}.notice{border:1px solid #e1c8a9;background:#fff8e5;border-radius:13px;padding:12px 13px;color:#795f42;font-size:12px;line-height:1.6;margin:12px 0}.notice.warn{background:#fff0ee;border-color:#efbcb8;color:#965448}.product-card{background:white;border:1.5px solid #e6dbc6;border-radius:15px;margin:9px 0;padding:13px;display:flex;gap:10px;align-items:center}.product-card .details{flex:1;min-width:0}.product-card .primary-line{font-weight:850;font-size:15px}.product-card .secondary-line{font-size:12px;color:#78786f;margin-top:4px;line-height:1.5;overflow-wrap:anywhere}.badge{display:inline-flex;align-items:center;background:#ffe6e8;color:#a74d61;border-radius:8px;padding:3px 7px;font-size:11px;font-weight:850;margin:3px 4px 0 0}.badge.green{background:#e2f4e8;color:#446e56}.badge.gold{background:#fff0ca;color:#8c6c31}.line-list{display:flex;flex-direction:column;gap:8px}.line-row{background:#fffdf6;border:1.5px solid #ddd5be;border-radius:15px;padding:13px}.line-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:850;margin-bottom:12px}.line-row .field{margin-bottom:9px}.line-row .input{padding:8px;font-size:14px}.line-row .field-grid{gap:0 8px}.overlay{position:fixed;z-index:30;inset:0;display:flex;align-items:flex-end;justify-content:center;background:#17241cb5;padding:12px 12px 0}.overlay[hidden]{display:none}.modal{background:var(--cream);width:min(720px,100%);max-height:92vh;overflow:auto;border:2px solid #232a22;border-radius:22px 22px 0 0;box-shadow:0 -10px 50px #1115;padding:18px 18px calc(23px + env(safe-area-inset-bottom))}.modal-head{position:sticky;top:-18px;z-index:1;background:var(--cream);display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1.5px solid #e9ddca;padding:5px 0 13px;margin-bottom:16px}.modal-head h2{margin:0;font-size:20px}.modal-content{min-width:0}.modal-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;border-top:1px dashed #d9ceb8;padding-top:15px;margin-top:17px}.receipt-preview{display:flex;gap:8px;overflow-x:auto;padding:7px 0}.receipt-preview img{width:86px;height:112px;object-fit:cover;border-radius:9px;border:1.5px solid #ddd;background:white}.toggle{display:flex;gap:8px;align-items:center;font-size:13px}.toggle input{width:18px;height:18px;accent-color:#f47690}.rating-actions{display:flex;gap:10px;flex-wrap:wrap}.rating-actions .button[aria-pressed="true"]{background:#ffe0e6;border-color:#ea748d}.product-detail-hero{text-align:center;background:#fff8e6;padding:20px;border-radius:18px;margin-bottom:18px}.product-detail-hero .big-icon{font-size:42px}.product-detail-hero h2{margin:4px 0;font-size:24px}.product-detail-hero p{font-size:12px;color:#7f7974;margin:3px}.split-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:13px 0}.muted{color:var(--muted)}.tiny{font-size:12px}.loading{padding:80px 0;text-align:center;color:#847b6b}.spacer{height:4px}.hr{border:0;border-top:1.5px dashed #e5ddcd;margin:18px 0}.book-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.book-tile{background:#fff;border:2px solid #232923;border-radius:16px;text-align:left;padding:18px;min-height:150px;display:flex;flex-direction:column;justify-content:space-between;gap:12px}.book-emoji{font-size:33px}.book-title{font-size:16px;font-weight:900}.book-meta{font-size:12px;color:#8a8075}.category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.category-circle{border:0;background:transparent;text-align:center;display:flex;align-items:center;flex-direction:column;gap:5px;font-size:12px;font-weight:800}.category-circle .category-icon{width:56px;height:56px;font-size:25px}.table-wrap{overflow-x:auto}.price-table{border-collapse:collapse;width:100%;font-size:12px}.price-table th,.price-table td{border-bottom:1px solid #e9e2d5;text-align:left;padding:11px 8px;white-space:nowrap}.price-table th{color:#888}.no-wrap{white-space:nowrap}.inline-control{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.inline-control>*{min-width:0}.hidden{display:none!important}
@media(min-width:760px){.main{padding:30px 38px 115px}.topbar{padding:22px 38px}.hero{grid-template-columns:2fr 1fr}.category-grid{grid-template-columns:repeat(7,minmax(0,1fr))}.bottom-nav{max-width:1020px;margin:auto}.modal{border-radius:20px;max-height:90vh}.overlay{align-items:center;padding:20px}.book-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:410px){.main{padding:20px 14px 106px}.topbar{padding:14px;height:77px}.page-heading h1{font-size:22px}.hero{grid-template-columns:1.5fr 1fr;gap:9px}.card{padding:13px;border-radius:15px}.hero-main .big-amount{font-size:25px}.small-stat .number{font-size:22px}.summary-grid{gap:6px}.summary-tile{padding:9px}.summary-tile .value{font-size:15px}.field-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.category-grid{gap:6px}.category-circle .category-icon{width:48px;height:48px}.button{padding:8px 10px}.modal{padding:13px 12px 25px}.modal-head{top:-13px}}
.category-share{display:flex;align-items:center;gap:24px;flex-wrap:wrap;justify-content:center}.donut{height:168px;width:168px;border-radius:50%;display:grid;place-items:center;flex-shrink:0}.donut>span{width:102px;height:102px;border-radius:50%;background:#fffefa;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#807569;font-size:12px}.donut strong{color:#202923;font-size:17px}.group-legend{display:grid;gap:10px;flex:1;min-width:165px}.group-legend>div{display:flex;align-items:center;gap:8px;font-size:13px}.group-legend>div span:last-child{margin-left:auto;color:#706c64}.legend-dot{height:11px;width:11px;border-radius:50%;flex-shrink:0}
.toast{position:fixed;bottom:110px;left:50%;transform:translateX(-50%) translateY(14px);background:#25342a;color:white;border-radius:13px;padding:12px 18px;font-size:13px;max-width:min(85vw,480px);z-index:100;opacity:0;pointer-events:none;transition:.2s ease;box-shadow:0 6px 20px #1115;text-align:center}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* 同步入口 */
#sync-open { margin-left:auto; min-width:40px;font-family:inherit; font-size:17px }
.sync-remember{display:flex;gap:8px;align-items:center;font-size:13px;margin:9px 0 15px;cursor:pointer}
.sync-remember input{width:18px;height:18px;accent-color:#bf564a}

/* 2026-10 mobile/stat/book improvements */
.range-label{font-size:18px;line-height:1.35;text-align:center;display:block;flex:1;min-width:0;word-break:break-word}
.stats-range{gap:12px;align-items:center}
.nav-period-btn{flex-shrink:0}
.book-tile-main{display:flex;flex-direction:column;justify-content:space-between;gap:12px;cursor:pointer;flex:1;min-height:0}
.book-actions-inline{display:flex;gap:8px;flex-wrap:wrap}
.book-bulk-bar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:12px 0 16px}
.book-order-row .line-head{align-items:flex-start}
.book-check{display:flex;align-items:center;gap:8px;font-size:13px;margin-bottom:10px}
.book-manage-list{display:flex;flex-direction:column;gap:10px}
.manage-book-row{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:10px;align-items:center}
.book-row-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.drag-handle{border:0;background:transparent;font-size:20px;line-height:1;cursor:grab;padding:4px 6px;color:inherit}
.manage-book-row.drag-over{outline:2px dashed #9aa7aa;outline-offset:2px}
.manage-book-row.dragging{opacity:.6}
.small-select{min-width:0}
@media(max-width:520px){
  .top-title strong,.page-heading h1,.section-row h2,.month-row strong,.modal-head h2,.book-title,.button,.select,.input,textarea,.nav-item,.tab,.pill,.summary-tile .caption,.summary-tile .value,.tx-title,.tx-sub,.tx-amount,.book-meta,.small-stat .label{font-family:"Noto Serif SC","Songti SC","STSong","SimSun","PingFang SC",serif}
  .stats-range{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px}
  .stats-range .nav-period-btn:first-child{justify-self:start}
  .stats-range .nav-period-btn:last-child{justify-self:end}
  .stats-range .range-label{grid-column:1 / -1;order:-1;font-size:17px}
  .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .book-list{grid-template-columns:1fr}
  .book-actions-inline .button{flex:1}
  .book-row-actions{justify-content:flex-start}
}
@media(max-width:410px){
  .stats-range .nav-period-btn{padding:8px 10px;font-size:13px}
  .stats-range .range-label{font-size:16px}
}

/* v1.4.1: visible record edit controls and mobile layout */
.detail-edit-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:8px 0 10px;color:var(--muted);font-size:12px}
.detail-edit-heading .button{white-space:nowrap}
.bulk-actions{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:8px;background:rgba(45,59,66,.65);border:1px solid rgba(163,168,164,.38);padding:12px;border-radius:14px;margin:12px 0}
.bulk-actions .input{min-height:37px;min-width:0;width:100%;max-width:250px}
.bulk-actions .bulk-count{font-size:12px;white-space:nowrap}
.selectable-transaction{display:flex;align-items:center;gap:8px;min-width:0}
.selectable-transaction .transaction{flex:1;min-width:0}
.record-checkbox{flex:0 0 28px;display:flex;align-items:center;justify-content:center;min-height:44px;cursor:pointer}
.record-checkbox input{width:19px;height:19px;accent-color:#46849a}
.build-version{font-size:9px;letter-spacing:.6px;color:#bfb8a9;opacity:.8;margin-left:6px;vertical-align:middle}
@media(max-width:560px){
 .detail-edit-heading{gap:7px}
 .detail-edit-heading .button{font-size:12px;padding:7px 8px}
 .bulk-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .bulk-actions .toggle{font-size:12px}
 .bulk-actions .input{grid-column:1 / -1;max-width:none}
 .bulk-actions .button{white-space:nowrap;font-size:12px;min-width:0}
 .stats-range{grid-template-columns:1fr 1fr!important}
 .stats-range .range-label{grid-column:1/-1!important;font-size:16px;white-space:normal;word-break:normal}
 .stats-range .nav-period-btn{min-width:0;white-space:nowrap}
}

.drag-handle{touch-action:none;-webkit-user-select:none;user-select:none}
