:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1b2e26;
  background: #f3f5f0;
  --muted: #53665c;
  --border: #dce4dc;
  --green: #226248;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; min-height: 44px; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #68a784; outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.0625rem; }
h3 { margin-top: 1.3rem; font-size: 1rem; }
.app { width: min(100%, 580px); margin: auto; padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(6rem + env(safe-area-inset-bottom)); }
.top, .brand, .section-title, .dialog-title { display: flex; align-items: center; gap: .65rem; }
.top, .section-title, .dialog-title { justify-content: space-between; }
.top { margin-bottom: 1.05rem; }
.brand img { border-radius: 12px; }
.secondary { border: 1px solid var(--border); border-radius: 12px; padding: .55rem .95rem; background: #fff; color: var(--green); font-weight: 650; }
.overview { padding: .75rem 1.2rem 1.15rem; border-radius: 24px; background: #173d31; color: white; }
.month-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.month-nav button { border: 0; border-radius: 13px; background: rgba(255,255,255,.1); color: white; font-size: 1.5rem; }
.balance { margin: 1.45rem 0 1.2rem; }
.balance span, .totals span { display: block; color: #cce4d7; font-size: .875rem; }
.balance small { font-size: .8125rem; margin-left: .35rem; }
.balance strong { display: block; margin-top: .15rem; font-size: clamp(1.65rem, 8vw, 3rem); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding-top: .95rem; border-top: 1px solid #ffffff36; }
.totals strong { display: block; margin-top: .25rem; overflow-wrap: anywhere; }
.card { margin-top: .9rem; padding: .95rem 1rem; border: 1px solid var(--border); border-radius: 20px; background: #fff; }
.section-title { margin-bottom: .55rem; }
.section-title span, .muted, .empty { color: var(--muted); font-size: .875rem; }
.empty { padding: .65rem 0; }
.category-row { margin: .75rem 0 .3rem; }
.category-label { display: flex; align-items: center; justify-content: space-between; gap: .7rem; font-size: .875rem; }
.track { height: 6px; background: #e5efe8; border-radius: 999px; margin-top: .45rem; overflow: hidden; }
.fill { height: 100%; background: #438364; border-radius: inherit; }
.record { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, auto); align-items: center; gap: .7rem; width: 100%; padding: .7rem 0; text-align: left; color: inherit; background: transparent; border: 0; }
.record + .record { border-top: 1px solid #e8eee9; }
.badge { display: grid; place-items: center; height: 36px; border-radius: 11px; background: #edf0e6; font-size: .875rem; }
.badge.income { background: #daf0e4; }
.record-info { display: grid; gap: .25rem; overflow-wrap: anywhere; }
.amount { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.amount.income { color: var(--green); }
.action-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; padding: .65rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: #f3f5f0; border-top: 1px solid var(--border); }
.primary { border: 0; border-radius: 14px; padding: .85rem 1rem; background: var(--green); color: white; font-weight: 700; }
.action-bar .primary { width: min(100%, 548px); }
.status { color: var(--green); margin-top: .75rem; font-size: .875rem; }
dialog { width: min(calc(100% - 2rem), 460px); max-height: calc(100% - 2rem); border: 1px solid var(--border); border-radius: 22px; padding: 1.1rem; color: inherit; background: #fff; box-shadow: 0 18px 64px #153d3140; }
dialog::backdrop { background: #12272080; }
.dialog-title { margin-bottom: 1rem; }
dialog label { display: block; min-width: 0; font-weight: 650; font-size: .875rem; }
dialog input:not([type=radio]), select { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: .4rem; padding: .55rem .65rem; border: 1px solid #b8c8bd; border-radius: 10px; color: inherit; background-color: #fbfcfa; font-size: 1rem; }
select { appearance: none; padding-right: 1.65rem; background-image: linear-gradient(45deg, transparent 50%, #53665c 50%), linear-gradient(135deg, #53665c 50%, transparent 50%); background-position: calc(100% - 13px) center, calc(100% - 8px) center; background-size: 5px 5px; background-repeat: no-repeat; }
dialog .muted { margin-top: .6rem; line-height: 1.55; }
#entry-form { display: grid; gap: .8rem; }
#entry-form .dialog-title { margin-bottom: 0; }
.form-grid, .type-switch, .backup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.type-switch { border: 0; margin: 0; padding: .25rem; background: #eef3ee; border-radius: 12px; }
.sr-only, .type-switch input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.type-switch span { display: grid; place-items: center; min-height: 44px; border-radius: 9px; cursor: pointer; }
.type-switch input:checked + span { color: var(--green); background: white; box-shadow: 0 1px 4px #1a3c2320; }
.type-switch input:focus-visible + span { outline: 3px solid #68a784; }
.backup-actions { margin-top: .8rem; }
.danger { background: #fff; border: 1px solid #eccfcb; border-radius: 12px; color: #a1352b; }
.error { font-size: .875rem; color: #a1352b; }
.filters label, .tag-field legend { font-size: .875rem; font-weight: 650; }
.tag-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.tag-field legend { margin-bottom: .3rem; padding: 0; }
.tag-field legend .muted { margin-left: .3rem; font-weight: 400; }
.tag-options { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-chip, .text-button { border: 0; border-radius: 10px; color: var(--green); font-weight: 650; font-size: .875rem; }
.tag-chip { background: #edf3ed; padding: .45rem .7rem; overflow-wrap: anywhere; }
.tag-chip[aria-pressed=true] { background: #226248; color: #fff; }
.text-button { background: transparent; padding: .25rem .45rem; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .45rem; }
.inline-form input:not([type=radio]) { margin: 0; }
.tag-result { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; padding: .35rem 0; }
.tag-result[aria-pressed=true] { color: var(--green); font-weight: 700; }
.tag-result + .tag-result, .filter-total { border-top: 1px solid var(--border); }
.filter-total { margin-top: .4rem; padding-top: .6rem; font-size: .875rem; font-weight: 650; }
.record-tags { color: var(--green); font-size: .875rem; }
:root {--green:#803966;--border:#e2cddb;--muted:#77536c;color:#542b4b;background:#fff;font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
.illustrated {width:min(100%,480px);margin:auto;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
.period,.detail-nav {display:flex;align-items:center;justify-content:space-between;gap:12px}
.period {padding:0 6%;color:#763662}.period button {background:none;border:0;color:inherit;font-size:1.7rem;min-width:44px}
.canvas {position:relative;aspect-ratio:1179/2556;background:white url('./home.webp') center/100% 100% no-repeat;container-type:inline-size}
.canvas button {position:absolute;border:0;background:transparent;color:#712957;min-height:0;padding:0;text-align:left;-webkit-tap-highlight-color:#b66eaa40}
.canvas button:focus-visible {outline-offset:-3px;border-radius:12px}
.figure.girl {left:3%;top:5%;width:46%;height:30%;z-index:2}
.figure.robot {right:2%;bottom:6%;width:29%;height:24%;z-index:2;clip-path:polygon(30% 0,100% 0,100% 100%,0 100%,0 75%,30% 55%)}
.summary-box {left:10%;top:36.8%;width:35%;height:25%;display:flex;flex-direction:column;justify-content:space-evenly}
.summary-box small {font-size:3.6cqw}.summary-box strong {font-size:clamp(16px,6.9cqw,36px);overflow-wrap:anywhere;line-height:1.05}
#hero-lines {display:grid;gap:1.1cqw;font-size:3.25cqw;font-weight:650;overflow-wrap:anywhere}
.tile {font-weight:750;font-variant-numeric:tabular-nums}.canvas .tile.expense {left:53.4%;width:41%;height:7.6%;top:calc(10.55% + var(--row)*8.78%);display:flex;align-items:center;justify-content:space-between;gap:1%;padding:0 3%;font-size:4cqw}
.canvas .tile.income {left:calc(6% + var(--col)*33.9%);top:calc(66.85% + var(--row)*13.15%);width:31%;height:11.5%;padding:0 3%;display:flex;flex-direction:column;justify-content:center;gap:1.9cqw;font-size:4.4cqw;color:#912635}
.canvas .tile.dark {color:white}.tile b {font-size:.9em;overflow-wrap:anywhere;min-width:0}.tile span {flex-shrink:0}
#extra-tiles {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 4% 12px}#extra-tiles .tile {display:flex;justify-content:space-between;border:0;border-radius:12px;padding:12px;background:#f6eaf3;color:#723566}#extra-tiles .income {background:#fcebdc;color:#902b36}
.detail-nav {margin-bottom:1rem}.app .brand {display:none}.app .top {justify-content:flex-end}.overview {background:#774669}.card,dialog {border-color:#e6d4e1}.action-bar {background:#fcf7fb}.fill,.tag-chip[aria-pressed=true] {background:#945787}.track,.tag-chip,.type-switch {background:#f4eaf2}.badge.income {background:#fce8d9}.amount.income {color:#973446}.badge.expense {background:#efdfeb}
:root {background:#f8f2f5}
.canvas {background-color:#f8f2f5}
.canvas .tile,#extra-tiles .tile {border-radius:4cqw;box-shadow:0 .8cqw 1.2cqw -.5cqw #56284445,inset 0 1px 1px #ffffff60;background-image:linear-gradient(155deg,#ffffff12,transparent 55%,#52213e09)}
#extra-tiles .tile {border-radius:14px;box-shadow:0 3px 8px #56284424}
.canvas .tile:active {box-shadow:inset 0 2px 5px #54244336}
body[data-detail=income],body[data-detail=expense] {min-height:100vh}
body[data-detail=income] {background:#fff5eb;color:#702832;--green:#963644;--border:#e7cabb;--muted:#865c55}
body[data-detail=income] .card,body[data-detail=income] dialog {background:#fffbf6;border-color:#ebcebd}
body[data-detail=income] .action-bar {background:#fff3e9}
body[data-detail=income] .badge {background:#f8dfcb;color:#922e38}
body[data-detail=income] .record + .record {border-color:#f0dace}
body[data-detail=income] .secondary {background:#fff9f2}
body[data-detail=income] .type-switch {background:#f7e2d5}
body[data-detail=income] .detail-nav h1 {color:#982e3e}
body[data-detail=expense] {background:#f7f0f6}
body:is([data-detail=income],[data-detail=expense]) .app .top {display:none}
#record-filter:not(:empty) {margin:.65rem 0;color:var(--muted);font-size:.875rem}
#editor.robot-entry {--green:#932e40;--border:#e7c6b6;--muted:#825950;color:#702c36;background:#fff8ef;border-color:var(--border);box-shadow:0 16px 56px #57282c40}
#editor.robot-entry::backdrop {background:#44272c66}
#editor.robot-entry .type-switch,#editor.robot-entry .tag-chip {background:#f6dfcf}
#editor.robot-entry .type-switch input:checked + span,#editor.robot-entry .tag-chip[aria-pressed=true] {color:white;background:#932e40}
#editor.robot-entry input:not([type=radio]),#editor.robot-entry select,#editor.robot-entry .secondary {background-color:#fffbf5;border-color:#dcbcae}
#editor.robot-entry :focus-visible,#editor.robot-entry .type-switch input:focus-visible + span {outline-color:#b45561}
#backup-text {width:100%;min-height:9rem;margin:.4rem 0 .7rem;padding:.6rem;border:1px solid var(--border);border-radius:10px;background:#fff;color:inherit;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical;-webkit-user-select:text;user-select:text}
