:root{color-scheme:light;--ink:#263e55;--muted:#5b748a;--blue:#2d66a6;--line:#e0ebf4;--paper:#edf6fc;font:15px/1.45 "PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--paper)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100dvh;background:linear-gradient(#e3f2fd,#f6fafd 420px)}
button,input,select,textarea{font:inherit}
button{border:0;color:inherit;background:#edf5fc;border-radius:12px;padding:0 12px;min-height:44px;cursor:pointer;transition:background .18s,transform .18s}
button:active{transform:scale(.96)}
button:disabled{opacity:.48}
:focus-visible{outline:2px solid #4a8ad1;outline-offset:2px}
.primary{background:#2d66a6;color:white;font-weight:650}
.quiet{background:transparent;color:var(--muted)}
header,main{width:min(100%,620px);margin:auto;padding-inline:16px}
header{height:64px;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:9px;font-size:17px;font-weight:750}
.brand b{display:grid;place-items:center;width:34px;height:34px;border-radius:12px;background:white;color:#407ab5;font-size:23px;line-height:1}
header .quiet{font-size:13px}
main{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
nav{position:fixed;z-index:2;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,620px);display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:6px 12px calc(7px + env(safe-area-inset-bottom));border-top:1px solid #e0ebf4;background:#fafeffff;box-shadow:0 -6px 22px #3049630b}
nav button{display:grid;justify-items:center;align-content:center;gap:3px;min-height:50px;padding:3px;font-size:11px;white-space:nowrap;background:transparent;color:var(--muted)}
nav svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
nav [aria-current]{color:#245caa;background:#e6f2ff;font-weight:750}
.card{background:white;border:1px solid var(--line);border-radius:19px;padding:14px;margin-bottom:10px}
.bar,.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
h2,.bar h2,.sheet-head h2{font-size:17px;margin:0}
.card>h2{margin-bottom:12px}
.month-bar{flex-wrap:wrap}
.month-bar h2,.date-bar h2{white-space:nowrap}
.month-controls{display:flex;align-items:center;gap:3px}
.month-controls button{padding:0 9px;min-width:32px;white-space:nowrap;background:#f0f7fd;font-size:13px}
.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;margin-top:8px;text-align:center;touch-action:pan-y}
.weekday{font-size:11px;color:var(--muted);padding:5px 0}
.day{padding:3px 0 0;min-height:44px;border-radius:12px;display:grid;grid-template-rows:1fr 14px;place-items:center;background:transparent;font-size:14px;font-variant-numeric:tabular-nums}
.day.today{box-shadow:inset 0 0 0 1px #a9ccea}
.day.selected{background:#dceeff;color:#1b538d;font-weight:750}
.day-marks{display:flex;gap:1px;align-items:center;font-size:10px}
.day-marks i{width:4px;height:4px;border-radius:50%;background:#4d87be}
.calendar-key{text-align:right;margin:5px 1px 0;color:var(--muted);font-size:10px}
.calendar-key span{color:#4d87be}
.day-detail{background:transparent;border:0;padding:4px 0;margin:0}
.date-bar{flex-wrap:wrap}
.date-bar button{padding:0 10px;font-size:13px}
.actions{display:flex;gap:6px;flex-wrap:wrap}
.entry h3{margin:8px 0;overflow-wrap:anywhere}
.entry p{white-space:pre-wrap;overflow-wrap:anywhere}
.entry img{display:block;width:100%;max-height:340px;object-fit:contain;border-radius:12px;margin:10px 0;background:#eef6fd}
.muted{color:var(--muted);font-size:13px}
.badge{padding:4px 9px;background:#eaf4ff;color:#285c91;font-size:11px;border-radius:20px}
small{font-size:11px;color:var(--muted)}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.balance{background:#edf6ff;padding:12px;border-radius:13px}
.balance strong{display:block;font-size:24px}
.lock{display:grid;min-height:100dvh;place-items:center;padding:20px}
.gate{width:min(100%,340px);text-align:center;background:white;border:1px solid var(--line);border-radius:22px;padding:26px 20px}
.gate h1{font-size:21px;margin:0 0 15px}
.gate button,.gate input,#save{width:100%;margin-top:8px}
.gate input{text-align:center;letter-spacing:.3em}
dialog{width:min(calc(100% - 14px),460px);max-height:90dvh;border:1px solid var(--line);border-radius:21px;padding:16px;color:var(--ink)}
dialog[open]{animation:sheet .2s ease-out both}
dialog::backdrop{background:#17314f60}
@keyframes sheet{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:520px){dialog{margin:auto auto max(5px,env(safe-area-inset-bottom))}}
label,legend{font-size:13px;font-weight:650}
form>label,details label{display:block;margin:10px 0}
input,textarea{width:100%;min-width:0;padding:10px;border:1px solid #d7e6f3;border-radius:10px;background:#f7fbff;color:var(--ink);min-height:44px}
label>input,label>textarea{margin-top:4px}
fieldset{min-width:0;border:0;padding:0;margin:9px 0}
legend{padding:0}
.choices{display:flex;flex-wrap:wrap;gap:5px;margin-top:4px}
.choices label{position:relative;cursor:pointer}
.choices input{position:absolute;inset:0;opacity:0;margin:0;height:100%;cursor:pointer}
.choices span{display:flex;align-items:center;min-height:44px;padding:0 9px;border-radius:10px;background:#f1f7fc;border:1px solid transparent}
.choices input:checked+span{color:#1f568d;background:#e0efff;border-color:#b3d1ef}
.choices input:focus-visible+span{outline:2px solid #4a8ad1}
.editor-meta{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.editor-meta details{margin:9px 0}
.editor-meta summary{min-height:44px;display:list-item;padding:11px 10px;border-radius:10px;background:#f1f7fc;color:var(--muted);cursor:pointer;font-size:13px}
#login-error,#form-error{color:#9d3655;font-size:13px}
#toast{position:fixed;z-index:3;bottom:calc(77px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:#263e55;color:white;border-radius:12px;padding:11px;width:max-content;max-width:90vw}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.day{position:relative;min-height:57px;grid-template-rows:20px 24px;align-content:center}
.day-marks{gap:0;justify-content:center;line-height:1}
.mood-mark{display:block;font-size:clamp(14px,4vw,19px);line-height:1.2}
.day>i{position:absolute;right:5px;top:7px;width:4px;height:4px;border-radius:50%;background:#4d87be}
.mood-sticker{display:inline-block;width:23px;height:23px;vertical-align:middle;flex:none}
.mood-mark .mood-sticker{width:clamp(16px,4.8vw,23px);height:auto;display:block}
.day-marks .mood-mark+.mood-mark{margin-left:-2px}
.day:has(.mood-mark)>span:first-child{font-size:12px}
#mood-field .choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
#mood-field .choices span{gap:5px;justify-content:center;padding:0 3px;white-space:nowrap}
.entry h3 .mood-sticker{margin-right:5px}
.section-intro{padding:9px 0 15px;align-items:center}
.section-intro p{margin:4px 0 0;color:var(--muted);font-size:13px}
.section-intro button{flex:none}
.list-title{font-size:13px;color:var(--muted);margin:18px 2px 7px}
.entry p{line-height:1.65}
.calendar-board{margin-inline:-12px;padding:12px 5px 8px;border-radius:19px}
.calendar-board .month-bar{padding-inline:9px}
.calendar-board .grid{gap:1px;margin-top:10px}
.calendar-board .day{min-width:0;min-height:72px;padding:3px 1px;grid-template-columns:minmax(0,1fr);grid-template-rows:17px 27px 15px;align-content:center;border-radius:10px;background:#f5faff}
.calendar-board .day.selected{background:#d9edff}
.calendar-board .day-marks{width:100%;min-width:0}
.calendar-board .mood-sticker{width:min(24px,5.6vw)}
.day-preview{width:100%;min-width:0;padding:0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#426489}
