:root{color-scheme:light;--bg:#edf2ec;--paper:#fffefa;--ink:#172b23;--soft:#4d6358;--green:#205843;--line:#d5e0d6;--lime:#e5efcc;--warn:#923c27;font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.55}
.top{background:var(--paper);border-bottom:1px solid var(--line)}
.top-inner,.shell{max-width:1220px;margin:auto;padding-inline:clamp(16px,4vw,48px)}
.top-inner{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{color:inherit;text-decoration:none;font-size:clamp(16px,3vw,20px);font-weight:750;display:flex;align-items:center;gap:10px}
.brand-mark{background:var(--green);color:white;display:grid;place-items:center;width:37px;height:37px;border-radius:12px;font-size:32px;line-height:1}
.shell{padding-top:32px;padding-bottom:48px}
.overview{display:flex;justify-content:space-between;align-items:end;gap:12px;margin:0 0 22px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(29px,5vw,45px);letter-spacing:-.05em;line-height:1.18}
h2{font-size:22px;letter-spacing:-.025em}
h3{font-size:16px}
.muted,small{color:var(--soft)}
.overview p{margin-top:7px}
.layout{display:grid;grid-template-columns: minmax(270px,.72fr) minmax(0,1.35fr);gap:20px;align-items:start}
.column{display:grid;gap:16px}
.card{background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:clamp(15px,3vw,23px)}
.capture{background:#1c4d3b;color:white;border:0}
.capture .muted{color:#dbe9de}
.capture h2{margin-bottom:5px}
.capture-actions{display:grid;gap:9px;margin-top:18px}
.row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.spread{justify-content:space-between}
.stack{display:grid;gap:12px}
.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.week-head{margin-bottom:13px}
button,.button,input,select{font:inherit}
button,.button{min-height:44px;padding:8px 13px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--paper);font-weight:650;cursor:pointer;text-align:center; text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
button:hover,.button:hover{border-color:var(--green)}
button:disabled{opacity:.55;cursor:default}
button.primary,.button.primary{background:var(--green);color:white;border-color:var(--green)}
.capture .primary{background:var(--lime);color:#183627;border-color:var(--lime);font-size:18px;min-height:52px}
.capture .secondary{background:transparent;color:white;border-color:#729285}
.capture .secondary:hover{border-color:white}
.quiet{background:transparent}
.danger{color:var(--warn)}
label.field{display:grid;gap:5px;font-weight:600;min-width:0}
input:not([type=file]),select{min-height:44px;min-width:0;max-width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink)}
label.field input,label.field select{width:100%}
input[aria-invalid=true]{border:2px solid #a34a28;background:#fff7e6}
:focus-visible{outline:3px solid #36745a;outline-offset:3px}
.habit-card p,.week-head p{margin-top:4px}
.habit-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:13px 0}
.habit-buttons button{justify-content:space-between;gap:5px;padding-inline:9px;min-height:50px}
.habit-buttons button.logged{background:#edf4e5}
.week-actions{margin-top:12px}
.day{border-top:1px solid var(--line);padding:11px 0}
.day:last-child{padding-bottom:0}
.day summary{cursor:pointer;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:700}
.day summary::after{content:"＋";color:var(--green)}
.day[open] summary::after{content:"−"}
.day-meta{margin-left:auto;font-weight:400;text-align:right}
.periods{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.period{border:1px solid var(--line);border-radius:12px;padding:9px;background:#f8faf5}
.reading{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:6px;border-top:1px solid var(--line);min-height:44px}
.reading strong{font-variant-numeric:tabular-nums;white-space:nowrap}
.reading button{padding-inline:7px;font-size:13px;min-width:44px}
.habit-line{display:flex;flex-wrap:wrap;gap:4px 12px;color:var(--soft);margin-top:8px;font-size:13px}
.empty{padding:10px 0;color:var(--soft)}
.setup{max-width:510px;margin:32px auto}
.toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);width:max-content;max-width:90vw;background:#142e23;color:white;border-radius:12px;padding:12px 17px;z-index:5;box-shadow:0 5px 25px #0003}
dialog{max-width:540px;width:calc(100% - 24px);max-height:calc(100% - 24px);border:1px solid var(--line);border-radius:18px;padding:21px;background:var(--paper);color:var(--ink)}
dialog::backdrop{background:#142c22a0}
.dialog-head{margin-bottom:12px}
.photo{width:100%;height:min(24vh,175px);object-fit:contain;background:#edf2ec;border-radius:10px}
.share-list{max-height:200px;overflow:auto}
.check{min-height:44px;display:flex;align-items:center;gap:8px}.check input{width:20px;height:20px}.live-photos{margin-top:16px}
.cpap-list{max-height:60vh;overflow:auto}
.cpap-photo{display:block;width:100%;max-height:60vh;object-fit:contain;background:#edf2ec;border-radius:10px}
.error{color:var(--warn)}
.read-only{max-width:850px;margin:auto}
@media(max-width:760px){.layout{grid-template-columns:1fr}.shell{padding-top:21px}.top-inner{min-height:62px}.overview{align-items:center}.overview label{max-width:42%}}
@media(max-width:455px){.periods{grid-template-columns:1fr}.top .quiet{font-size:13px;padding:6px 8px}.overview{align-items:end}.reading{grid-template-columns:56px 1fr auto}}
