:root {
  color-scheme: light;
  --ink: #202e27;
  --muted: #5b6b60;
  --paper: #f7f9f5;
  --line: #dfe5dd;
  --green: #255a43;
  --serif: "STSong", "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #7aa685; outline-offset: 3px; }
button:disabled { opacity: .5; cursor: default; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { border-bottom: 1px solid var(--line); background: #fff; }
.bar-inner, .page { width: min(100% - 64px, 1060px); margin-inline: auto; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.16rem; font-weight: 750; letter-spacing: .055em; }
.brand-icon { display: grid; place-items: center; width: 37px; height: 37px; background: var(--green); border-radius: 11px; }
.brand-icon i { width: 19px; height: 23px; position: relative; border: 1.6px solid #e4efce; border-radius: 2px; background: linear-gradient(90deg, transparent 3px, #e4efce 3px 4.5px, transparent 4.5px); }
.brand-icon i::before, .brand-icon i::after { content: ""; position: absolute; left: 7px; width: 7px; top: 6px; height: 1.5px; background: #e4efce; }
.brand-icon i::after { top: 11px; width: 5px; }
.primary, .secondary, .plain, .filter, .danger { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 640; }
.primary { background: var(--green); color: white; }
.primary:hover:enabled { background: #194831; }
.secondary { background: white; border-color: #ccd7cd; }
.secondary:hover:enabled, .step:hover:enabled { background: #eef4ed; }
.small { font-size: .89rem; min-height: 38px; padding-inline: 14px; }
.export-icon { position: relative; width: 15px; height: 15px; background: linear-gradient(currentColor, currentColor) center 0 / 1.5px 8px no-repeat; }
.export-icon::before { content: ""; position: absolute; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); left: 4px; top: 3px; }
.export-icon::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; border: 1.5px solid; border-top: 0; border-radius: 0 0 2px 2px; }
.page { padding: 38px 0 72px; }
.page-title, .action-line, .panel-title, .form-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); font-family: var(--serif); font-weight: 700; letter-spacing: .035em; }
.page-title { margin-bottom: 23px; }
.month-controls { display: flex; align-items: center; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.step { border: 0; background: transparent; border-radius: 10px; width: 38px; height: 40px; display: grid; place-items: center; }
.step::before { content: ""; width: 7px; height: 7px; border: solid #536458; border-width: 0 1.6px 1.6px 0; transform: rotate(135deg); }
.step.after::before { transform: rotate(-45deg); }
#month { background: transparent; border: 0; height: 40px; padding: 0 2px; min-width: 0; font-size: .9rem; font-weight: 600; text-align: center; }
#month::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
.overview { isolation: isolate; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; border: 1px solid #24583f; border-radius: 19px; min-height: 218px; background-color: #275b44; background-image: radial-gradient(ellipse at 91% 95%, #426a4e 0, transparent 55%), linear-gradient(100deg, #204d38, #2e5f45); color: #fff; }
.overview::after { content: ""; position: absolute; inset: 0 0 0 44%; z-index: -1; background-image: linear-gradient(90deg, #d1e8ba0d 1px, transparent 1px), linear-gradient(#d1e8ba0d 1px, transparent 1px); background-size: 25px 25px; mask-image: linear-gradient(90deg, transparent, #000 65%); }
.overview-content { position: relative; z-index: 1; padding: 27px 33px; min-width: 0; }
.overview h2 { font-weight: 540; font-size: .96rem; letter-spacing: .045em; color: #e1ecdc; }
.hero-total { margin-top: 8px; font-size: clamp(2rem, 5.7vw, 3.65rem); line-height: 1.16; font-family: "Inter", "Arial", sans-serif; font-weight: 580; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metrics { display: flex; gap: 23px; margin-top: 25px; }
.metrics > div + div { border-left: 1px solid #b9d0bc55; padding-left: 23px; }
.metrics dt { font-size: .83rem; color: #d6e4d3; }
.metrics dd { margin-top: 4px; font-size: 1.16rem; line-height: 1.25; font-weight: 600; }
.metrics dd small { font-size: .81rem; margin-left: 5px; font-weight: 430; }
.art { flex: 0 0 242px; height: 180px; margin-right: 6%; position: relative; z-index: 0; transform: rotate(-10deg); }
.book-cover, .book-sheet { position: absolute; left: 39px; top: 15px; width: 132px; height: 151px; border-radius: 5px 12px 10px 4px; transform: skewY(-3deg); }
.book-cover { top: 22px; left: 43px; background: #9ca981; border: 2px solid #b3bb9c; box-shadow: 3px 7px 0 #12362442; }
.book-sheet { border: 1.5px solid #d8dfbf; background: repeating-linear-gradient(0deg, transparent 0 15px, #59785d28 15px 16px), linear-gradient(90deg, #8da081 0 7px, #b4c3a2 7px 21px, #9dae90 21px 22px, #c8d3b3 22px); box-shadow: 1px 3px 0 #e0e4ca, 2px 5px 0 #9da78c; }
.rings { position: absolute; left: -7px; top: 12px; width: 16px; height: 120px; background: repeating-linear-gradient(180deg, #48654d 0 4px, #dbe2c8 4px 6px, transparent 6px 18px); border-radius: 2px; }
.page-rule { position: absolute; top: 43px; left: 37px; height: 2px; width: 64px; background: #759271; border-radius: 3px; }
.r2 { top: 59px; width: 48px; } .r3 { top: 75px; width: 58px; }
.bookmark { position: absolute; right: 15px; top: -1px; width: 16px; height: 34px; background: #d8a867; clip-path: polygon(0 0,100% 0,100% 100%,50% 80%,0 100%); }
.pencil { position: absolute; top: 49px; left: 178px; width: 10px; height: 111px; border-radius: 3px 3px 0 0; transform: rotate(30deg); background: linear-gradient(0deg, transparent 0 calc(100% - 12px), #e8ddc1 calc(100% - 12px) calc(100% - 7px), #dbac78 calc(100% - 7px)), linear-gradient(90deg, #c39658 0 32%, #e2be81 32% 68%, #c49d67 68%); box-shadow: 2px 1px 0 #203d3333; }
.pencil::after { content: ""; position: absolute; top: 100%; width: 100%; height: 14px; background: linear-gradient(#dbcfb0 72%, #384b40 72%); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.action-line { margin: 20px 0; }
.status-wrap { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.plain { padding: 0 8px; background: transparent; color: var(--green); text-decoration: underline; }
.action-line .primary { flex-shrink: 0; }
.plus { width: 16px; height: 16px; background: linear-gradient(currentColor, currentColor) center / 14px 1.7px no-repeat, linear-gradient(currentColor, currentColor) center / 1.7px 14px no-repeat; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; min-width: 0; overflow: hidden; }
.panel-title { padding: 19px 23px; border-bottom: 1px solid #e8ece6; min-height: 66px; }
.panel-title h2 { display: flex; gap: 10px; align-items: center; font-weight: 670; font-size: 1.08rem; }
.list-sign, .chart-sign { display: inline-block; height: 18px; width: 18px; position: relative; color: #438161; }
.list-sign { background: repeating-linear-gradient(0deg, currentColor 0 2px, transparent 2px 5px) left 4px top 3px/13px 12px no-repeat, repeating-linear-gradient(0deg, currentColor 0 2px, transparent 2px 5px) left 0 top 3px/2px 12px no-repeat; }
.chart-sign { border-radius: 50%; background: conic-gradient(from 0deg, #9dba9d 0 90deg, transparent 90deg 101deg, currentColor 101deg 352deg, transparent 352deg); }
.filter { min-height: 32px; padding: 2px 9px; background: #eff4eb; color: var(--green); font-size: .83rem; }
.detail-tools { display: flex; gap: 8px; align-items: center; }
.jump { display: none; font-size: .88rem; font-weight: 550; color: var(--green); text-underline-offset: 3px; }
#categories-heading { scroll-margin-top: 16px; }
.empty-state { display: flex; min-height: 185px; padding: 30px 20px; align-items: center; justify-content: center; text-align: center; flex-direction: column; gap: 8px; color: var(--muted); }
.empty-state::before { content: ""; width: 28px; height: 33px; margin-bottom: 4px; border: 1.5px solid #aabcae; border-radius: 4px; box-shadow: -4px 3px 0 #eef3ec; background: repeating-linear-gradient(#b9c7b8 0 1px,transparent 1px 6px) center/14px 13px no-repeat, #fafcf9; transform: rotate(-6deg); }
.categories .empty-state::before { border: 0; border-radius: 0; transform: none; box-shadow: none; background: linear-gradient(#d9e2d4,#d9e2d4) 0 bottom/7px 12px no-repeat, linear-gradient(#a9bea8,#a9bea8) center bottom/7px 25px no-repeat, linear-gradient(#cad8c5,#cad8c5) right bottom/7px 19px no-repeat; }
.empty-state strong { font-size: .98rem; font-weight: 550; color: #4d5d50; }
.empty-state span { font-size: .88rem; line-height: 1.6; }
.entries, .categories { min-width: 0; }
.day-heading, .day-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .86rem; font-weight: 570; color: var(--muted); padding: 10px 23px; background: #f7f9f5; }
.entry-row { display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #edf0eb; background: white; text-align: left; width: 100%; padding: 15px 23px; }
.entry-row:last-child { border-bottom: 0; }
.entry-row:hover, .category-row:hover { background: #f8faf6; }
.entry-symbol, .entry-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eef3eb; color: var(--category-color, var(--green)); flex-shrink: 0; }
.entry-main { display: grid; min-width: 0; flex: 1; gap: 4px; }
.entry-main strong { font-size: .97rem; font-weight: 570; overflow-wrap: anywhere; }
.entry-main small { font-size: .82rem; color: var(--muted); }
.entry-main small { overflow-wrap: anywhere; }
.entry-amount { flex-shrink: 0; font-weight: 620; font-size: 1rem; }
.category-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; width: 100%; padding: 15px 22px; background: white; border: 0; text-align: left; }
.category-row[aria-pressed="true"] { background: #eff5eb; }
.category-name { font-size: .94rem; font-weight: 550; }
.category-sum { font-size: .94rem; font-weight: 610; }
.category-track { display: block; grid-column: 1 / -1; height: 5px; overflow: hidden; background: #edf1ea; border-radius: 9px; }
.category-track i { height: 100%; display: block; border-radius: inherit; background: var(--category-color, #558969); }
dialog { border-radius: 18px; border: 1px solid var(--line); padding: 0; width: min(440px, calc(100% - 28px)); max-height: calc(100dvh - 24px); color: var(--ink); box-shadow: 0 16px 70px #0c301d29; }
dialog::backdrop { background: #14281da3; }
#entry-form { padding: 25px; }
.form-header { margin-bottom: 24px; }
.form-header h2 { font-size: 1.45rem; font-family: var(--serif); }
.close { border: 0; border-radius: 50%; width: 40px; height: 40px; position: relative; background: #f1f4ee; }
.close::before, .close::after { content: ""; position: absolute; top: 50%; left: 50%; width: 15px; height: 1.5px; background: var(--muted); transform: translate(-50%, -50%) rotate(45deg); }
.close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.field { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .92rem; font-weight: 560; }
.field span { color: var(--muted); font-size: .82rem; font-weight: 400; }
#entry-form input, #entry-form select { width: 100%; min-width: 0; border-radius: 8px; border: 1px solid #ccd5ca; min-height: 45px; background-color: #fff; padding: 10px 12px; font-size: 1rem; }
#entry-form select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #627361 50%),linear-gradient(135deg,#627361 50%,transparent 50%); background-position: calc(100% - 16px) center,calc(100% - 11px) center; background-size: 5px 5px; background-repeat: no-repeat; }
.amount-wrap { position: relative; }
.amount-wrap span { position: absolute; inset: 50% auto auto 14px; transform: translateY(-50%); font-size: 1.34rem; font-weight: 500; color: var(--green); }
#entry-form #amount { font-size: 1.7rem; padding: 12px 12px 12px 37px; font-weight: 600; background: #fafcf8; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 18px 0; }
.form-error { color: #94392f; font-size: .9rem; margin-top: 14px; }
.form-error:empty { display: none; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 25px; }
.form-actions .primary { flex: 1; }
.danger { border: 1px solid #ead8d3; color: #913c32; background: #fffaf8; }
@media(max-width:740px) {
  .bar-inner,.page { width: calc(100% - 34px); }
  .bar-inner { min-height: 64px; }
  .page { padding-top: 25px; }
  .page-title { margin-bottom: 16px; }
  .overview { min-height: 190px; border-radius: 15px; }
  .overview-content { padding: 22px; }
  .art { flex-basis: 152px; margin-right: 2%; transform: scale(.8) rotate(-10deg); transform-origin: center; }
  .panel-grid { grid-template-columns: 1fr; gap: 16px; }
  .jump { display: inline-flex; align-items: center; min-height: 40px; }
  .panel-title, .entry-row { padding-inline: 18px; }
  .day-heading, .day-title { padding-inline: 18px; }
  .action-line { margin: 15px 0; }
  .small { min-height: 42px; }
}
@media(max-width:480px) {
  h1 { font-size: 1.66rem; }
  .brand { font-size: 1.06rem; }
  .brand-icon { width: 33px; height: 33px; border-radius: 9px; }
  .step { width: 29px; height: 42px; }
  #month { font-size: .85rem; max-width: 139px; }
  .overview { min-height: 180px; }
  .overview-content { padding: 20px; max-width: 100%; }
  .art { position: absolute; width: 220px; right: -65px; top: -11px; transform: scale(.55) rotate(-9deg); opacity: .83; pointer-events: none; }
  .hero-total { font-size: clamp(1.85rem,9vw,2.6rem); }
  .metrics { gap: 16px; margin-top: 21px; }
  .metrics > div + div { padding-left: 16px; }
  .empty-state { min-height: 140px; padding: 20px; }
  #entry-form { padding: 20px; }
}
@media(max-width:365px) {
  .page-title { align-items: flex-start; flex-direction: column; }
  .art { opacity: .28; right: -77px; }
}
.auth-page { width: min(100% - 32px, 460px); margin: clamp(28px, 7vh, 78px) auto 40px; }
.auth-card { background: white; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 14px 48px #2447320d; }
.auth-cover { position: relative; display: flex; align-items: center; padding: 26px 30px; min-height: 112px; gap: 14px; overflow: hidden; color: #fff; background-color: #275b44; background-image: linear-gradient(110deg,#204c38 34%,transparent), repeating-linear-gradient(90deg,transparent 0 23px,#c8dcb612 23px 24px), repeating-linear-gradient(0deg,transparent 0 23px,#c8dcb612 23px 24px); }
.auth-cover h1 { position: relative; z-index: 1; font-size: clamp(1.55rem, 4vw, 1.95rem); }
.auth-illustration { width: 115px; position: absolute; right: 0; top: 0; bottom: 0; pointer-events: none; }
.auth-illustration .art { width: 230px; height: 180px; position: absolute; top: 4px; left: 0; margin: 0; opacity: .92; transform: scale(.57) rotate(-11deg); transform-origin: top left; }
.auth-body { padding: 24px 30px 28px; }
#auth-description { color: var(--muted); line-height: 1.7; font-size: .95rem; }
#access-form { margin-top: 23px; }
#access-form .field { margin-top: 16px; }
#access-form input:not([type=checkbox]) { display: block; width: 100%; min-height: 46px; font-size: 1rem; background: #fbfcfa; padding: 10px 12px; border: 1px solid #c6d1c6; border-radius: 9px; }
#access-submit { width: 100%; }
.remember-device { display: flex; align-items: center; gap: 9px; min-height: 44px; margin: 8px 0 14px; color: var(--muted); font-size: .9rem; }
.remember-device input { accent-color: var(--green); width: 17px; height: 17px; margin: 0; }
#retry-access { margin-top: 18px; }
.member-tools { display: flex; align-items: center; gap: 9px; }
.member-menu { position: relative; }
.member-menu summary { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 10px; border-radius: 8px; font-weight: 600; font-size: .9rem; list-style: none; cursor: pointer; }
.member-menu summary::-webkit-details-marker { display: none; }
.member-menu summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.member-menu[open] summary, .member-menu summary:hover { background: #eff4ed; }
.member-popover { position: absolute; z-index: 5; right: 0; top: calc(100% + 7px); width: min(245px, calc(100vw - 36px)); display: grid; padding: 18px; gap: 8px; border: 1px solid var(--line); background: white; box-shadow: 0 8px 26px #1e43241a; border-radius: 12px; }
.member-caption, #share-status { color: var(--muted); font-size: .88rem; line-height: 1.5; }
#member-name, #share-status { overflow-wrap: anywhere; }
#member-name { margin-bottom: 6px; }
#share-field { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: .88rem; }
#share-url { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); -webkit-user-select: text; user-select: text; }
#share-status:empty { display: none; }
@media(max-width:480px) {
  .auth-body { padding: 23px 22px 24px; }
  .auth-cover { padding-left: 22px; min-height: 100px; }
  .member-tools { gap: 3px; }
}
