:root{--paper:#fff5f8;--ink:#654152;--muted:#9c7184;--rose:#b2537f;--line:#f0dce5;--soft:#fce6ef;--white:#fffdfd;--serif:"Songti SC","STSong","Noto Serif CJK SC",serif;--sans:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:13px}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer;border:0;background:transparent}button:disabled{opacity:.4;cursor:not-allowed}button,input,select,textarea{outline-offset:3px}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #c86f9c}input,select,textarea{background:transparent;border:1px solid transparent;border-radius:5px;min-width:0}input:hover,select:hover,textarea:hover{border-color:#efd0df}input:focus,select:focus,textarea:focus{background:#fff;border-color:#d992b2}input[type=checkbox]{accent-color:var(--rose);width:16px;height:16px;cursor:pointer}.masthead{padding:20px 38px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:var(--white)}.brand{display:flex;gap:11px;align-items:center;text-decoration:none;color:var(--ink);font-family:var(--serif);font-weight:700;font-size:20px;letter-spacing:1px}.brand-mark{font-size:38px;line-height:1;color:var(--rose)}.brand small{display:block;font-family:var(--sans);font-size:9px;letter-spacing:2.4px;margin-top:5px;font-weight:500;color:var(--muted)}.header-right{display:flex;gap:25px;align-items:center}.family-tag{color:#946c7d;font-size:12px}.quiet{color:#956a7d;border-left:1px solid var(--line);padding-left:24px}main{max-width:1540px;margin:auto;padding:25px 38px 0}.day-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--rose);margin:0 0 8px}h1{font-family:var(--serif);font-size:30px;letter-spacing:1px;margin:0;font-weight:600}.muted{color:#946c7d;margin:8px 0 0;font-size:12px}.day-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}.date-switch{display:flex;border:1px solid #edcfde;border-radius:8px;background:var(--white);align-items:center;padding:5px}.date-switch button{font-size:25px;padding:0 10px;line-height:30px}.date-switch input{padding:6px 8px;font-size:14px}.outline{border:1px solid #edcfde;padding:10px 14px;border-radius:7px;background:var(--white)}.save-state{width:100%;text-align:right;min-height:18px;font-size:11px;color:#a35e7e}.save-state.error{color:#b84938}.save-state #retry{color:#a74734;text-decoration:underline;margin-left:8px}.summary{display:grid;grid-template-columns:repeat(4,1fr);background:var(--soft);border:1px solid #f3d0e0;border-radius:12px;margin-bottom:15px;padding:18px 0}.summary>div{padding:0 25px;border-right:1px solid #efc5d8}.summary>div:last-child{border:0}.summary span{font-size:11px;color:#95526f}.summary strong{display:block;font-family:var(--serif);font-size:30px;line-height:1.4;font-weight:600;margin-top:5px}.summary strong small{font:12px var(--sans);color:#9a6680}.summary strong i{font-size:20px;font-style:normal;color:#c08ca5}.summary p{margin:4px 0 0;font-size:10px;color:#a8758c}.summary .food-summary{font:600 19px var(--serif);padding-top:9px;line-height:1.5;min-height:47px;overflow-wrap:anywhere}.daily-state{display:flex;align-items:center;flex-wrap:wrap;gap:9px 15px;padding:12px 16px;border:1px solid var(--line);border-radius:9px;background:var(--white);margin-bottom:18px}.state-label{font-weight:600;margin-right:5px}.daily-state label{display:flex;align-items:center;gap:6px;font-size:11px;color:#936779}.daily-state input{width:64px;padding:6px 3px;color:var(--ink)}.daily-state select{padding:6px 3px;color:var(--ink)}.state-divider{width:1px;height:25px;background:var(--line)}.record-grid{display:grid;grid-template-columns:minmax(0,1.13fr) minmax(0,1fr);gap:16px}.panel{background:var(--white);border:1px solid var(--line);border-radius:10px;overflow:hidden;min-width:0}.panel-heading{display:flex;justify-content:space-between;align-items:center;padding:14px 17px 12px;border-bottom:1px solid var(--line)}h2{font-size:14px;letter-spacing:.3px;margin:0;font-weight:600}.section-icon{font-size:19px;color:#b76d94;margin-right:8px;vertical-align:-1px}.add{color:var(--rose);font-size:11px;padding:6px 8px;background:#fce8f1;border-radius:6px}.add:hover{background:#f7d7e7}.subtle{font-size:10px;color:#a77990}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;table-layout:fixed}th{font-size:10px;font-weight:500;color:#9b6d82;text-align:left;background:#fff7fa;padding:10px 6px;border-bottom:1px solid #f5e3eb}th:first-child,td:first-child{padding-left:16px}td{padding:5px 4px;border-bottom:1px solid #f7e8ee;height:40px}td input:not([type=checkbox]),td select{width:100%;padding:5px 3px;font-size:11px;height:30px}td input[type=time]{padding-left:0;padding-right:0;font-size:10px}td input[type=time]::-webkit-calendar-picker-indicator{width:10px;margin:0;padding:0}td:last-child,th:last-child{width:29px}td .remove{font-size:18px;color:#c793aa;border-radius:4px;width:23px}td .remove:hover{color:#b84938;background:#fbede7}.empty td{text-align:center;height:70px;color:#b5899d;font-size:11px;padding:15px}.panel-foot{font-size:10px;color:#a6788f;margin:9px 17px 12px}.feeding th:nth-child(1){width:83px}.feeding th:nth-child(2){width:82px}.feeding th:nth-child(3),.feeding th:nth-child(4){width:70px}.feeding th:nth-child(5){width:65px}.sleep th:nth-child(1),.sleep th:nth-child(2){width:83px}.sleep th:nth-child(3){width:42px}.sleep th:nth-child(4){width:70px}.duration{font-size:10px;color:#9f6483;white-space:nowrap}.diaper th:nth-child(1),.food th:nth-child(1),.supplement th:nth-child(1),.training th:nth-child(1),.care th:nth-child(1){width:83px}.diaper th:nth-child(2){width:80px}.diaper th:nth-child(3),.diaper th:nth-child(4){width:65px}.food th:nth-child(3){width:70px}.food th:nth-child(4){width:66px}.supplement th:nth-child(2){width:100px}.supplement th:nth-child(3){width:85px}.care-checks{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;padding:18px}.care-checks label{display:flex;align-items:center;gap:7px;color:#935a77;font-size:12px}.vaccine-heading{display:flex;align-items:center;justify-content:space-between;padding:0 17px 10px}.vaccine-heading h3{font-size:11px;font-weight:500;margin:0;color:#a3788e}.training th:nth-child(2){width:105px}.training th:nth-child(4){width:70px}.training th:nth-child(5){width:43px}.notes textarea{width:calc(100% - 24px);margin:12px;height:94px;resize:vertical;line-height:1.8;padding:8px 6px;font-size:12px}.notes textarea::placeholder{color:#b995a6}footer{display:flex;justify-content:space-between;padding:23px 0;color:#ad8699;font-size:10px}.login-shell{min-height:100vh;display:grid;place-items:center;background:radial-gradient(ellipse at 25% 20%,#f8d9e8,transparent 55%),var(--paper)}.login-card{width:420px;padding:42px;background:var(--white);border:1px solid var(--line);border-radius:18px;box-shadow:0 20px 80px #aa4b780f}.flower{display:block;font-size:45px;color:var(--rose);margin-bottom:25px}.login-card h1{font-size:32px;line-height:1.5;margin:12px 0}.login-desc{color:#a2728b;margin:16px 0 30px}.login-card label{display:block;font-size:12px;margin-bottom:8px}.login-card input{border:1px solid #ebc7d9;background:#fff6fa;padding:12px;width:100%;margin-bottom:12px}.primary{background:var(--rose);color:#fff;padding:13px 17px;border-radius:6px;width:100%;text-align:left}.primary span{float:right}#login-error{color:#b84938;min-height:20px;font-size:12px}.login-foot{font-size:10px;color:#ad8297;border-top:1px solid var(--line);padding-top:18px;margin-bottom:0}dialog{border:1px solid var(--line);border-radius:12px;padding:25px;max-width:400px;box-shadow:0 20px 70px #8c365d25}dialog::backdrop{background:#69344f55}dialog p{color:#a77a90;font-size:12px;margin:16px 0 25px}.dialog-actions{display:flex;gap:10px;justify-content:flex-end}.danger{background:#a34b3b;color:#fff;padding:10px 14px;border-radius:7px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}.row-saving{background:#fff1f7}.row-error{background:#fff1ec}@media(max-width:1100px){main{padding:22px 20px 0}.masthead{padding:18px 20px}.record-grid{grid-template-columns:1fr}.summary>div{padding:0 15px}.daily-state{gap:7px 10px}}@media(max-width:600px){main{padding:18px 12px 0}.masthead{padding:15px 12px}.brand{font-size:17px}.family-tag{display:none}.day-heading{align-items:flex-start;flex-direction:column}h1{font-size:25px}.day-controls{justify-content:flex-start;width:100%}.save-state{text-align:left}.summary{grid-template-columns:1fr 1fr;row-gap:18px}.summary>div:nth-child(2){border:0}.summary strong{font-size:26px}.state-divider{display:none}.table-wrap table{min-width:510px}.care .table-wrap table{min-width:380px}.care-checks{grid-template-columns:1fr 1fr}.subtle{font-size:9px}footer{gap:15px;flex-direction:column}.login-card{width:calc(100% - 32px);padding:30px}}
@media(min-width:1101px){.masthead{padding:12px 38px}.brand{font-size:18px}.brand-mark{font-size:32px}main{padding-top:18px}.day-heading{margin-bottom:15px}.day-heading h1{font-size:27px}.day-heading .eyebrow{margin-bottom:5px}.day-heading .muted{margin-top:5px}.summary{padding:12px 0;margin-bottom:12px}.summary strong{font-size:27px;margin-top:3px}.summary .food-summary{min-height:39px;padding-top:6px}.daily-state{padding:8px 16px;margin-bottom:13px}.daily-state input,.daily-state select{padding-top:4px;padding-bottom:4px}.record-grid{gap:12px}.panel-heading{padding:10px 15px 9px}th{padding-top:8px;padding-bottom:8px}.empty td{height:52px}.panel-foot{margin-top:7px;margin-bottom:9px}.care-checks{padding:12px 17px;gap:10px}.vaccine-heading{padding-bottom:6px}.notes textarea{height:70px;margin-top:7px;margin-bottom:7px}footer{padding:16px 0}}
.save-state #discard{color:#9d647e;text-decoration:underline;margin-left:8px}
#decision-message{white-space:pre-wrap;max-height:45vh;overflow:auto;line-height:1.8}#decision-confirm{width:auto}

/* A rose-and-pearl growth book for our little princess. */
body{background:radial-gradient(ellipse at 6% 0%,#fce1ed99,transparent 42%),var(--paper)}
.masthead{background:linear-gradient(110deg,#fffdfd,#fff0f6)}
.brand-mark{font-family:var(--serif);color:#b2537f}
.summary{background:linear-gradient(110deg,#fde5ef,#fff0f7);box-shadow:0 3px 16px #b85b8307}
.panel{box-shadow:0 2px 12px #ae587908}
.panel-heading{background:linear-gradient(100deg,#fffafd,#fff3f8)}
.teeth-label{flex:1;min-width:200px;max-width:290px}
.daily-state .teeth-label input{width:auto;min-width:100px;flex:1}
.growth-hint{font-size:10px;color:#a77990;margin-left:auto}
.login-shell{background:radial-gradient(ellipse at 25% 20%,#f8d9e8,transparent 55%),radial-gradient(ellipse at 85% 90%,#ffe5f0,transparent 50%),var(--paper)}
.login-card{position:relative;border-top:4px solid #e9a9c6}
@media(max-width:600px){.growth-hint{width:100%;margin-left:0}.teeth-label{max-width:none}}

#share-dialog{width:min(560px,92vw);max-height:90vh;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--paper);overflow:auto}#share-preview{display:block;width:100%;height:auto;border-radius:12px}#share-download{text-decoration:none;display:inline-flex;align-items:center}

.drag-handle{color:#bc7798;font-size:23px;cursor:grab;padding:0 6px;vertical-align:middle;user-select:none}.drag-handle:active{cursor:grabbing}.panel.dragging,.note-entry.dragging{opacity:.45}.note-entry{display:flex;align-items:flex-start;gap:6px;margin:12px}.notes .note-entry textarea{flex:1;min-width:0;width:auto;margin:0;height:82px;border:1px solid var(--line);background:#fff8fb;border-radius:8px;padding:10px}.note-entry .remove{color:#bc7798;font-size:24px;padding:3px 6px}.notes #add-note{margin:0 14px 14px}.note-handle{margin-top:6px}.notes #note-entries:empty::before{content:'写一条，再记一条卷卷的小日常。';display:block;padding:20px;color:var(--muted);font-size:12px}

/* Finger and Pencil handles: only this area takes over the drag gesture. */
.drag-handle{touch-action:none;-webkit-user-select:none;-webkit-touch-callout:none;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px}
.drag-handle:hover{background:#fce6ef}.drop-target{outline:3px dashed #d27b9f;outline-offset:-5px;background:#fff1f8}.dragging{opacity:.6!important;box-shadow:0 5px 24px #b2537f26}
button,a,input,select,textarea{-webkit-tap-highlight-color:#f7cee3}
@media(pointer:coarse){
 button,.add,.quiet,.outline,.primary,#share-download{min-height:44px}input:not([type=checkbox]),select,textarea{font-size:16px}
 td input:not([type=checkbox]),td select{font-size:16px;height:44px}td input[type=time]{font-size:16px}
 td .remove{width:44px;height:44px}td:last-child,th:last-child{width:48px}
 input[type=checkbox]{width:24px;height:24px}.care-checks label{min-height:44px;font-size:14px}
 .daily-state input,.daily-state select{min-height:44px;font-size:16px}
 .notes .note-entry textarea{font-size:16px;min-height:105px}.note-entry .remove{min-width:44px;min-height:44px}
}
/* Tablet portrait uses the full page width; landscape retains two columns. */
@media(min-width:701px) and (max-width:1100px){
 main{padding-left:24px;padding-right:24px}.day-heading{align-items:flex-start}.day-controls{max-width:420px}
 .panel-heading h2{font-size:16px}.panel-heading{padding:8px 14px}.notes .note-entry textarea{font-size:16px;min-height:105px}
 .table-wrap{overscroll-behavior-x:contain}.daily-state label{font-size:13px}.summary span{font-size:13px}
}
/* Phone: each record is a small editable card, with no sideways table scrolling. */
@media(max-width:700px){
 body{font-size:14px}main{padding:18px max(12px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-bottom))}
 .masthead{padding:14px max(14px,env(safe-area-inset-left));gap:12px}.family-tag{display:none}.header-right{gap:0}.quiet{padding:0 10px;min-height:44px}
 .day-heading{display:block}.day-heading h1{font-size:27px}.day-controls{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:16px;width:100%;max-width:none}
 .date-switch{justify-content:space-between;width:100%;padding:0}.date-switch button{min-width:44px;min-height:44px;padding:0}.date-switch input{width:100%;min-height:44px;font-size:16px;padding:6px 0}
 #today{min-width:64px}#export-png{grid-column:1/-1;background:#fce3ef;border-color:#edbfd4;color:#a04773;font-size:15px;min-height:46px}.save-state{grid-column:1/-1;text-align:left;font-size:12px}
 .summary{grid-template-columns:1fr 1fr;padding:15px 0;row-gap:18px}.summary>div{padding:0 13px}.summary>div:nth-child(2){border:0}.summary span{font-size:12px}.summary p{font-size:11px;line-height:1.5}.summary strong{font-size:27px}
 .daily-state{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px}.state-label,.growth-hint,.teeth-label{grid-column:1/-1}.state-divider{display:none}.daily-state label{display:flex;flex-wrap:wrap;gap:5px;font-size:13px}.daily-state input,.daily-state select{flex:1;width:70px;min-height:44px;font-size:16px;border-color:var(--line);background:#fff8fb;padding:7px}.daily-state .teeth-label{min-width:0;max-width:none}.growth-hint{margin:0;font-size:11px}
 .record-grid{grid-template-columns:1fr;gap:16px}.panel{border-radius:16px}.panel-heading{padding:7px 10px;gap:6px}.panel-heading h2{display:flex;align-items:center;font-size:15px;letter-spacing:0;white-space:nowrap}.section-icon{margin-right:5px}.add{min-height:44px;padding:8px 10px;font-size:13px}.subtle{display:none}
 .table-wrap{overflow:visible}.table-wrap table,.care .table-wrap table{display:block;min-width:0;width:100%}.table-wrap thead{display:none}.table-wrap tbody{display:block;padding:4px 12px 12px}
 .table-wrap tr[data-row]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;background:#fff7fb;border:1px solid #f1d8e4;border-radius:12px;padding:12px;margin-top:10px}
 .table-wrap td{display:block;border:0;padding:0!important;width:auto!important;height:auto;min-width:0}.table-wrap td[data-label]::before{content:attr(data-label);display:block;color:#9a6c82;font-size:12px;margin-bottom:5px}
 .table-wrap td[data-cell=note],.table-wrap td[data-cell=reaction],.table-wrap td[data-cell=item],.table-wrap td[data-cell=food],.table-wrap td[data-cell=name]{grid-column:1/-1}
 .table-wrap td input:not([type=checkbox]),.table-wrap td select{font-size:16px;height:44px;width:100%;background:#fff;border:1px solid #eed5e1;padding:8px;border-radius:8px}.table-wrap td input[type=time]{font-size:16px;padding:8px;min-width:0}.table-wrap td input[type=time]::-webkit-calendar-picker-indicator{width:16px}
 .table-wrap td input[type=checkbox]{width:25px;height:25px;margin:8px}.table-wrap td.duration{font-size:16px;padding-top:0!important}.table-wrap td:last-child{grid-column:1/-1;text-align:right;border-top:1px dashed #edcdda;padding-top:7px!important}.table-wrap td .remove{width:44px;height:44px;border:1px solid #f0cedd;border-radius:9px;color:#ad607f;background:#fff;font-size:24px}
 .table-wrap tr.empty{display:block}.table-wrap .empty td{display:block;text-align:center;padding:22px 10px!important;font-size:13px}.panel-foot{font-size:12px;line-height:1.7}.care-checks{grid-template-columns:1fr 1fr;padding:12px;gap:8px}.care-checks label{min-height:44px;font-size:14px}.care-checks input{width:25px;height:25px}.vaccine-heading{padding:7px 12px}.vaccine-heading h3{font-size:14px}
 .note-entry{gap:4px;margin:12px 8px}.notes .note-entry textarea{font-size:16px;min-height:116px;line-height:1.7;padding:10px}.note-entry .remove{min-width:44px;min-height:44px}.note-handle{padding:0;min-width:36px;margin:0}.notes #add-note{margin:0 12px 14px}
 .login-card{width:calc(100% - 28px);padding:28px}.login-card input{font-size:16px;min-height:48px}.primary,.outline{min-height:44px}footer{font-size:11px;line-height:1.6;flex-direction:column;gap:10px}
 #share-dialog{width:calc(100% - 20px);max-height:90dvh;padding:14px}#share-dialog .dialog-actions{position:sticky;top:0;background:var(--paper);padding-bottom:10px}dialog{max-width:calc(100% - 24px)}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
