:root {
  color-scheme: light;
  --paper: #f3f5ef;
  --surface: #fff;
  --ink: #142922;
  --muted: #53665c;
  --line: #d9dfd5;
  --dark: #102924;
  --lime: #d2f578;
  --gold: var(--lime);
  --accent: #276244;
  --danger: #a03830;
  --radius: 17px;
  font: 16px/1.5 "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #4d8153; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); letter-spacing: -.045em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { line-height: 1.65; overflow-wrap: anywhere; }
.skip-link { position: fixed; top: -70px; left: 16px; z-index: 90; background: white; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
.startup-retry { text-align: center; }
.startup-retry p { margin-bottom: 10px; }
.startup-retry.delayed { animation: show-startup-retry 0s 4s backwards; }
@keyframes show-startup-retry { from { visibility: hidden; } to { visibility: visible; } }
.masthead { background: var(--dark); color: #fff; }
.top-inner { max-width: 1192px; margin: auto; min-height: 68px; padding: 0 32px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; min-width: 0; font-size: 1.22rem; font-weight: 800; white-space: nowrap; }
.brand-image { width: 38px; height: 38px; object-fit: cover; border-radius: 9px; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-nav:empty, .bottom-nav:empty { display: none; }
.nav-account { max-width: 16ch; color: #dfebd8; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { width: min(100%, 1192px); margin-inline: auto; padding: 28px 32px 48px; min-width: 0; }
.btn, .action-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px;
  border: 1px solid #c8d4c9; border-radius: 10px; background: white; color: var(--ink); font-size: .94rem; font-weight: 650; line-height: 1.45;
}
.btn:hover, .action-link:hover { border-color: #78947d; }
.btn.primary, .action-link.primary, .btn.gold { background: var(--lime); color: #17291b; border-color: var(--lime); }
.btn.primary:hover, .action-link.primary:hover, .btn.gold:hover { background: #c2e961; border-color: #c2e961; }
.top-actions .btn { min-height: 38px; padding: 6px 14px; }
.page-heading { margin-bottom: 22px; }
.page-heading p { margin-top: 6px; color: var(--muted); }
.back, .text-link, .auth-switch a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.back { display: inline-block; margin-bottom: 12px; }
.panel { min-width: 0; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.meta, .muted, .empty, .loading { color: var(--muted); }
.meta, .field small, .helper { font-size: .875rem; }
.field small, .helper { color: var(--muted); line-height: 1.5; font-weight: 400; }
.empty, .loading { padding: 32px 12px; text-align: center; }
.status { overflow-wrap: anywhere; color: var(--danger); font-size: .9rem; }
.status:empty { display: none; }
.money, .display-money { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.positive { color: #196642; }
.form-stack, label.field { display: grid; }
.form-stack { gap: 18px; }
label.field { gap: 7px; min-width: 0; font-weight: 650; font-size: .94rem; }
input, textarea, select {
  width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #c6d3c8; border-radius: 10px;
  background: #fbfcf9; color: var(--ink); line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: #64746b; }
input:focus, textarea:focus { border-color: #497f56; }
textarea { resize: vertical; }
.tabs, .inline-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tab { min-height: 43px; padding: 8px 17px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .94rem; font-weight: 650; }
.tab.active { background: var(--dark); color: #fff; }
.auth-box {
  display: grid; grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr); width: min(100%, 760px); margin: clamp(12px, 6vh, 64px) auto;
  padding: 0; border-radius: 22px; border: 1px solid var(--line); overflow: hidden; background: white; box-shadow: 0 14px 46px #152d2010;
}
.auth-art {
  background-color: #102924; background-image: url("/assets/draw-studio.webp");
  background-size: auto 100%; background-position: 78% center;
}
.auth-content { padding: clamp(24px, 4vw, 44px); }
.auth-symbol, .menu-icon, .ledger-empty svg {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #e6efd9; color: #315b3b;
}
.auth-symbol { margin-bottom: 14px; }
.auth-box h1 { font-size: clamp(1.65rem, 3vw, 2.15rem); }
.auth-box .intro { margin-top: 8px; color: var(--muted); }
.auth-box .form-stack { margin-top: 24px; }
.auth-box .btn.primary { min-height: 47px; }
.auth-switch { margin-top: 18px; color: var(--muted); font-size: .94rem; }
.personal-page { max-width: 820px; margin: 0 auto; }
.account-banner, .ledger-panel .section-title { background: var(--dark); color: #fff; }
.account-banner {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(22px, 4vw, 34px);
  border-radius: 20px; background: linear-gradient(112deg, #102924, #264637); 
}
.account-banner::after {
  content: ""; position: absolute; z-index: -1; right: -65px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; border: 1px solid #d2f57838; box-shadow: 0 0 0 14px #d2f5780b, 0 0 0 30px #d2f57809, 0 0 0 60px #d2f57807;
}
.profile-name { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; min-width: 0; overflow-wrap: anywhere; }
.profile-initial { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 750; }
.account-banner p, .ledger-panel .section-title h2 { color: #d9e7d7; font-size: .94rem; font-weight: 550; }
.display-money, .ledger-panel .section-title .money { color: var(--lime); font: 680 clamp(2rem, 5vw, 3rem)/1.24 Arial, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.account-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px),1fr)); gap: 12px; margin-top: 16px; }
.menu-item { display: flex; gap: 13px; align-items: center; padding: 21px 18px; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 15px; }
.menu-item:hover { border-color: #8da58c; background: #fcfdf9; }
.menu-icon { flex: none; }
.menu-item strong, .menu-item small { display: block; }
.menu-item small { color: var(--muted); margin-top: 3px; font-size: .85rem; }
.account-footer { margin-top: 19px; }
.ledger-panel { padding: 0 20px 16px; overflow: hidden; }
.ledger-panel .section-title { margin: 0 -20px 18px; padding: 21px 22px; }
.ledger-panel .section-title h2 { margin: 0; }
.ledger-panel .tabs { display: inline-flex; padding: 3px; margin-bottom: 10px; border-radius: 11px; background: #edf2e9; }
.record { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 1px; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record > div { min-width: 0; }
.record .right { text-align: right; font-variant-numeric: tabular-nums; }
.record p { margin-top: 4px; font-size: .82rem; color: var(--muted); }
.record strong { overflow-wrap: anywhere; font-size: .97rem; }
.record > .money { text-align: right; }
.ledger-empty { display: grid; justify-items: center; gap: 12px; padding-block: 36px; }
.ledger-empty svg { padding: 11px; box-sizing: content-box; width: 21px; height: 21px; }
.ledger-panel [data-ledger-page] { display: block; margin: 12px auto 0; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom,0px)); transform: translateX(-50%); width: max-content; max-width: min(90vw,480px); padding: 10px 16px; border-radius: 10px; background: #112920; color: #fff; box-shadow: 0 8px 20px #14251f26; }
.toast:empty { display: none; }
.admin .toast { bottom: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 680px) {
  .top-inner { min-height: 58px; gap: 10px; padding-inline: 16px; }
  main { padding: 18px 15px 28px; }
  .page-heading { margin-bottom: 15px; }
  .auth-box { display: block; max-width: 460px; margin: 8px auto; }
  .auth-art { height: clamp(64px, 13vh, 104px); background-size: cover; background-position: center 54%; }
  .auth-content { padding: 20px; }
  .auth-symbol { display: none; }
  .auth-box .form-stack { margin-top: 18px; }
  .ledger-panel { padding-inline: 14px; }
  .ledger-panel .section-title { margin-inline: -14px; padding-inline: 16px; }
  .record { gap: 9px; }
}
@media (max-height: 500px) {
  .auth-box { margin-block: 2px; }
  .auth-art { display: none; }
  .auth-box { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}

