:root{--bg:#fff;--ink:#17211f;--muted:#62716e;--subtle:#8b9995;--line:#dfe8e5;--surface:#f7fbfa;--surface-strong:#eef8f5;--mint:#61b7a6;--mint-dark:#2f8374;--coral:#f26f5e;--coral-dark:#c94a3a;--wake:#f2b95e;--poop:#d69b2d;--poop-dark:#946519;--pee:#5da8dd;--pee-dark:#2e6f9f;--danger:#c2413b;--shadow:0 14px 30px #1c393414;--font:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;color:var(--ink);background:var(--bg);font-family:var(--font);font-synthesis:none;letter-spacing:0;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{box-sizing:border-box}html{background:var(--bg);min-height:100%}body{background:linear-gradient(180deg, #eef8f5cc, transparent 260px), var(--bg);min-width:320px;min-height:100svh;margin:0}button,input{font:inherit}button{cursor:pointer;border:0}button:focus-visible,input:focus-visible{outline-offset:3px;outline:3px solid #61b7a659}h1,h2,p{margin:0}#root{min-height:100svh}.app-shell{width:min(100%,760px);min-height:100svh;margin:0 auto;padding:20px 18px 104px}.app-header{justify-content:space-between;align-items:center;gap:16px;padding:6px 0 18px;display:flex}.brand{align-items:center;gap:12px;min-width:0;display:flex}.brand img{width:48px;height:48px;box-shadow:var(--shadow);border-radius:8px}.brand h1{font-size:24px;font-weight:760;line-height:1.1}.brand p{max-width:220px;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.35;overflow:hidden}.app-header time{color:var(--ink);flex:none;font-size:22px;font-weight:760;line-height:1}.status-strip{border:1px solid var(--line);background:var(--line);box-shadow:var(--shadow);border-radius:8px;grid-template-columns:1.2fr 1fr;gap:1px;margin-bottom:18px;display:grid;overflow:hidden}.status-strip>div{background:#ffffffeb;min-width:0;padding:16px}.status-strip span,.metric span,.insight-row span,.event-row span,.backup-panel p,.quick-action small,.insight-row small{color:var(--muted);font-size:12px;line-height:1.35}.status-strip strong{color:var(--ink);margin-top:4px;font-size:22px;font-weight:760;line-height:1.15;display:block}.status-strip.sleeping{background:#61b7a661;border-color:#61b7a68c}.screen{flex-direction:column;gap:14px;display:flex}.action-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.quick-action{min-height:128px;color:var(--ink);text-align:left;border:1px solid #0000;border-radius:8px;flex-direction:column;justify-content:space-between;align-items:flex-start;gap:12px;padding:18px;transition:transform .16s,box-shadow .16s,border-color .16s;display:flex}.quick-action:hover{box-shadow:var(--shadow);transform:translateY(-1px)}.quick-action svg{flex:none}.quick-action span{font-size:30px;font-weight:800;line-height:1;display:block}.quick-action.sleep{background:var(--surface-strong);color:var(--mint-dark)}.quick-action.sleep.is-active{background:#e4f5f0;border-color:#2f837452}.quick-action.feed{color:var(--coral-dark);background:#fff0ed}.quick-action.feed.is-active{background:#ffe7e2;border-color:#c94a3a47}.quick-action.poop{color:var(--poop-dark);background:#fff6e5}.quick-action.pee{color:var(--pee-dark);background:#edf7ff}.split-card{padding:0;overflow:hidden}.split-card-header{flex:auto;grid-template-columns:auto 1fr;align-items:center;gap:6px 10px;width:100%;padding:13px 16px 8px;display:grid}.split-card-header small{grid-column:1/-1}.split-buttons{border-top:1px solid #17211f14;grid-template-columns:1fr 1fr;width:100%;display:grid}.split-buttons button{color:currentColor;background:#ffffff73;min-height:42px;font-size:15px;font-weight:780}.split-buttons button+button{border-left:1px solid #17211f14}.split-buttons button:disabled{cursor:not-allowed;opacity:.42}.split-buttons button:not(:disabled):active{background:#ffffffb8}.metric-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.metric{border:1px solid var(--line);background:#fffffff0;border-radius:8px;min-width:0;padding:12px}.metric strong{overflow-wrap:anywhere;color:var(--ink);margin-top:6px;font-size:18px;font-weight:780;line-height:1.15;display:block}.timeline-panel,.chart-panel,.event-list,.backup-panel{border:1px solid var(--line);box-shadow:var(--shadow);background:#fffffff0;border-radius:8px;padding:16px}.section-title{color:var(--mint-dark);flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:14px;display:flex}.section-title h2{color:var(--ink);margin-right:auto;font-size:16px;font-weight:760;line-height:1.2}.timeline-legend{color:var(--muted);flex-wrap:wrap;justify-content:flex-end;gap:8px;font-size:11px;line-height:1;display:flex}.timeline-legend span{align-items:center;gap:4px;display:inline-flex}.timeline-legend i{border-radius:999px;width:8px;height:8px}.timeline-legend .legend-sleep{background:var(--mint);border-radius:4px;width:15px}.timeline-legend .legend-feed{background:var(--coral)}.timeline-legend .legend-poop{background:var(--poop)}.timeline-legend .legend-pee{background:var(--pee)}.timeline{flex-direction:column;gap:8px;display:flex}.timeline-track{border:1px solid var(--line);background:repeating-linear-gradient(90deg, #61b7a61f 0, #61b7a61f 1px, transparent 1px, transparent 25%), var(--surface);border-radius:8px;height:42px;position:relative;overflow:hidden}.sleep-segment{background:#61b7a6c7;border-radius:6px;min-width:5px;position:absolute;top:8px;bottom:8px}.sleep-segment.active{background:var(--mint-dark)}.feed-segment{background:#f26f5eb3;border-radius:999px;min-width:5px;position:absolute;top:14px;bottom:14px}.feed-segment.active{background:var(--coral-dark)}.event-marker{border:2px solid #fff;border-radius:999px;width:12px;height:12px;position:absolute;transform:translate(-50%,-50%)}.feed-marker{background:var(--coral);top:50%;box-shadow:0 0 0 2px #f26f5e33}.poop-marker{background:var(--poop);top:34%;box-shadow:0 0 0 2px #d69b2d2e}.pee-marker{background:var(--pee);top:66%;box-shadow:0 0 0 2px #5da8dd2e}.timeline-scale{color:var(--subtle);justify-content:space-between;font-size:11px;display:flex}.insight-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.insight-row article{border:1px solid var(--line);background:var(--surface);border-radius:8px;min-width:0;padding:14px}.insight-row strong{margin:6px 0 2px;font-size:20px;line-height:1.15;display:block}.event-list{flex-direction:column;gap:10px;display:flex}.event-row{align-items:center;gap:10px;min-height:50px;display:flex}.event-icon{border-radius:8px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:inline-flex}.event-icon.sleep{background:var(--surface-strong);color:var(--mint-dark)}.event-icon.feed{color:var(--coral-dark);background:#fff0ed}.event-icon.poop{color:var(--poop-dark);background:#fff6e5}.event-icon.pee{color:var(--pee-dark);background:#edf7ff}.event-icon.wake{color:#9b6715;background:#fff7e8}.event-row strong,.event-row span{display:block}.event-row strong{color:var(--ink);font-size:15px;line-height:1.2}.event-row>div{flex:auto;min-width:0}.event-row-actions{flex:none;align-items:center;gap:6px;display:inline-flex}.edit-event-button,.delete-event-button{border-radius:8px;flex:none;justify-content:center;align-items:center;width:36px;height:36px;display:inline-flex}.edit-event-button{background:var(--surface-strong);color:var(--mint-dark)}.delete-event-button{color:var(--danger);background:#fff2f1}.modal-backdrop{z-index:40;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#17211f73;justify-content:center;align-items:flex-end;padding:16px;display:flex;position:fixed;inset:0}.modal-content{border:1px solid var(--line);width:min(100%,460px);box-shadow:var(--shadow);background:#fff;border-radius:16px;flex-direction:column;gap:18px;padding:20px;display:flex}.modal-header{align-items:center;gap:10px;display:flex}.modal-header strong{color:var(--ink);font-size:16px;font-weight:760;display:block}.modal-header span{color:var(--muted);font-size:12px}.time-preview{background:var(--surface);border-radius:12px;flex-direction:column;align-items:center;gap:2px;padding:14px;display:flex}.time-preview>span{color:var(--muted);font-size:12px}.time-preview strong{color:var(--mint-dark);letter-spacing:1px;font-size:36px;font-weight:800;line-height:1}.time-preview small{color:var(--muted);font-size:12px}.time-slider{appearance:none;background:0 0;width:100%;height:32px;margin:0;padding:0}.time-slider:focus{outline:none}.time-slider::-webkit-slider-runnable-track{background:linear-gradient(90deg, var(--surface-strong), var(--mint) 50%, var(--surface-strong));border-radius:999px;height:6px}.time-slider::-moz-range-track{background:linear-gradient(90deg, var(--surface-strong), var(--mint) 50%, var(--surface-strong));border-radius:999px;height:6px}.time-slider::-webkit-slider-thumb{appearance:none;background:var(--mint-dark);cursor:pointer;border:3px solid #fff;border-radius:999px;width:26px;height:26px;margin-top:-10px;box-shadow:0 4px 10px #2f837459}.time-slider::-moz-range-thumb{background:var(--mint-dark);cursor:pointer;border:3px solid #fff;border-radius:999px;width:26px;height:26px;box-shadow:0 4px 10px #2f837459}.time-slider-scale{color:var(--subtle);justify-content:space-between;margin-top:-6px;font-size:11px;display:flex}.modal-actions{grid-template-columns:1fr 1fr;gap:8px;display:grid}.modal-actions button{border:1px solid var(--line);border-radius:8px;min-height:44px;font-size:14px;font-weight:720}.modal-cancel{background:var(--surface);color:var(--ink)}.modal-save{border-color:var(--mint-dark);background:var(--mint-dark);color:#fff}.date-toolbar{border:1px solid var(--line);background:#fffffff0;border-radius:8px;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.date-toolbar label{color:var(--ink);align-items:center;gap:8px;font-size:14px;font-weight:720;display:flex}.date-toolbar input{border:1px solid var(--line);min-height:40px;color:var(--ink);background:#fff;border-radius:8px;padding:0 10px}.chart-panel{min-height:292px}.recharts-default-tooltip{box-shadow:var(--shadow);border:1px solid var(--line)!important;border-radius:8px!important}.backup-panel{flex-direction:column;gap:14px;display:flex}.backup-panel .section-title{margin-bottom:0}.backup-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.backup-actions button,.danger-button{border:1px solid var(--line);background:var(--surface);min-height:44px;color:var(--ink);border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:0 12px;font-size:13px;font-weight:720;display:inline-flex}.danger-button{width:100%;color:var(--danger);background:#fff2f1;border-color:#c2413b3d}.metric-grid.compact{grid-template-columns:repeat(auto-fit,minmax(96px,1fr))}.empty-state{border:1px dashed var(--line);min-height:120px;color:var(--muted);text-align:center;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:18px;display:flex}.empty-state strong{color:var(--ink);font-size:15px}.empty-state span{max-width:260px;font-size:13px;line-height:1.45}.bottom-tabs{z-index:20;width:min(100%,760px);padding:8px 14px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--line);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);background:#ffffffe6;grid-template-columns:repeat(3,minmax(0,1fr));margin:0 auto;display:grid;position:fixed;bottom:0;left:0;right:0}.bottom-tabs button{min-height:52px;color:var(--muted);background:0 0;border-radius:8px;justify-content:center;align-items:center;gap:6px;font-size:13px;font-weight:720;display:inline-flex}.bottom-tabs button.active{background:var(--surface-strong);color:var(--mint-dark)}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (width<=620px){.app-shell{padding:16px 12px 98px}.brand p{max-width:180px}.app-header time{font-size:20px}.status-strip,.action-grid,.insight-row{grid-template-columns:1fr 1fr}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-action{min-height:122px;padding:16px}.quick-action span{font-size:28px}.backup-actions{grid-template-columns:1fr}}@media (width<=380px){.brand h1{font-size:21px}.brand p,.app-header time{display:none}.quick-action span{font-size:25px}.status-strip strong{font-size:19px}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
