/* ===== reset & tokens ===== */
:root{
  --sidebar:#1e5639;
  --sidebar-dark:#16402a;
  --accent:#3a8c5d;
  --accent-light:#e8f5ee;
  --accent-warm:#f5a623;
  --bg:#f6f4ef;
  --card:#ffffff;
  --text:#2c2c2c;
  --text-2:#666666;
  --text-3:#999999;
  --border:#e8e6e1;
  --shadow:0 4px 16px rgba(30,86,57,.08);
  --radius:16px;
  --radius-sm:10px;
  --gap:16px;
  --sidebar-w:210px;
  --topbar-h:72px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{height:100%;margin:0;font-family:var(--font);background:var(--bg);color:var(--text);}
button{font-family:inherit;cursor:pointer;border:none;background:none;}
input,select,textarea{font-family:inherit;font-size:15px;}

/* ===== layout ===== */
.app{display:flex;height:100vh;width:100vw;overflow:hidden;}
.sidebar{
  width:var(--sidebar-w);flex:none;background:var(--sidebar);color:#e8f3ec;
  display:flex;flex-direction:column;transition:transform .25s ease;
}
.brand{display:flex;align-items:center;gap:10px;padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.08);}
.brand-icon{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.12);display:grid;place-items:center;font-size:18px;}
.brand-text{font-size:17px;font-weight:700;letter-spacing:.5px;}
.nav-list{flex:1;overflow-y:auto;padding:10px 12px;display:flex;flex-direction:column;gap:4px;}
.nav-btn{
  display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:var(--radius-sm);
  color:rgba(255,255,255,.82);font-size:14px;text-align:left;transition:background .15s,color .15s;
}
.nav-btn:hover{background:rgba(255,255,255,.08);}
.nav-btn.on{background:rgba(255,255,255,.14);color:#fff;font-weight:600;box-shadow:inset 3px 0 0 #a8e6bf;}
.nav-icon{font-size:18px;width:24px;text-align:center;}
.nav-label{white-space:nowrap;}
.nav-bottom{padding:10px 12px;border-top:1px solid rgba(255,255,255,.08);}

.main{flex:1;display:flex;flex-direction:column;min-width:0;}
.topbar{
  height:var(--topbar-h);flex:none;background:var(--card);border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:16px;
}
.top-left{display:flex;align-items:center;gap:16px;}
.menu-toggle{display:none;width:36px;height:36px;border-radius:50%;font-size:20px;color:var(--text);background:var(--bg);}
.date-block{line-height:1.25;}
.date-main{font-size:18px;font-weight:700;color:var(--text);}
.date-sub{font-size:13px;color:var(--text-2);margin-top:2px;}
.baby-chip{display:flex;align-items:center;gap:10px;background:var(--accent-light);padding:6px 12px;border-radius:999px;}
.baby-avatar{width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;font-weight:700;display:grid;place-items:center;font-size:15px;}
.baby-name{font-weight:700;font-size:15px;}
.baby-age{font-size:12px;color:var(--text-2);}

.content{flex:1;overflow-y:auto;padding:24px;scroll-behavior:smooth;}
.view{display:none;animation:fade .2s ease;}
.view.on{display:block;}
@keyframes fade{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}

.section-title{font-size:16px;font-weight:700;margin:24px 0 12px;color:var(--text);}
.section-title:first-child{margin-top:0;}

/* ===== overview hero ===== */
.hero-card{
  background:linear-gradient(135deg,var(--accent) 0%,#2e7a52 100%);color:#fff;border-radius:var(--radius);
  padding:22px 24px;display:flex;justify-content:space-between;align-items:center;box-shadow:var(--shadow);
}
.hero-days{font-size:52px;font-weight:800;line-height:1;}
.hero-age{font-size:15px;opacity:.92;margin-top:6px;}
.hero-birth{font-size:13px;opacity:.78;margin-top:4px;}
.hero-right{text-align:right;}
.hero-stat-num{font-size:28px;font-weight:700;}
.hero-stat-lbl{display:block;font-size:13px;opacity:.8;margin-top:2px;}
.hero-goal{margin-top:10px;font-size:13px;opacity:.9;background:rgba(255,255,255,.12);padding:5px 10px;border-radius:999px;display:inline-block;}
.hero-stat-num.warn{color:#ffd34d;}

/* ===== reminder banner ===== */
.reminder-banner{display:flex;flex-direction:column;gap:8px;margin-bottom:4px;}
.reminder-item{
  display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius-sm);font-size:14px;font-weight:600;
  border-left:4px solid transparent;
}
.reminder-item.r-feed{background:#fff4e0;border-left-color:var(--accent-warm);color:#9a6712;}
.reminder-item.r-vac{background:#fde8e8;border-left-color:#e06c75;color:#a23b43;}
.reminder-item.r-out{background:#e8f5ee;border-left-color:var(--accent);color:#2e7a52;}
.reminder-ok{Background:#e8f5ee;color:#2e7a52;padding:11px 14px;border-radius:var(--radius-sm);font-size:14px;font-weight:600;text-align:center;}

.quick-bar{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px 0;}
.quick-btn{
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 6px;
  display:flex;flex-direction:column;align-items:center;gap:6px;transition:transform .12s,box-shadow .12s;
}
.quick-btn:active{transform:scale(.97);}
.quick-btn:hover{box-shadow:var(--shadow);}
.qb-icon{font-size:26px;}
.qb-text{font-size:13px;font-weight:600;color:var(--text);}
.quick-btn.feed{border-bottom:3px solid #e8a87c;}
.quick-btn.diaper{border-bottom:3px solid #7ec8e3;}
.quick-btn.supplement{border-bottom:3px solid #a8d8ea;}
.quick-btn.care{border-bottom:3px solid #c8b6e2;}

/* ===== stat grid ===== */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.stat-card{
  background:var(--card);border-radius:var(--radius);padding:16px 10px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.03);
}
.sc-icon{font-size:26px;margin-bottom:6px;}
.sc-num{font-size:28px;font-weight:800;color:var(--text);line-height:1;}
.sc-lbl{font-size:12px;color:var(--text-2);margin-top:4px;}
.stat-card.feed .sc-num{color:#d48843;}
.stat-card.milk .sc-num{color:#5a9bd5;}
.stat-card.poo .sc-num{color:#8c6b4a;}
.stat-card.pee .sc-num{color:#5a9bd5;}

.substats{display:flex;gap:16px;flex-wrap:wrap;margin:16px 0 6px;}
.sub-row{display:flex;align-items:center;gap:6px;background:var(--card);padding:8px 12px;border-radius:999px;font-size:13px;color:var(--text-2);}
.sub-dot{width:8px;height:8px;border-radius:50%;}
.sub-dot.ad{background:#f5a623;}
.sub-dot.d3{background:#4a90e2;}
.sub-dot.out{background:#3a8c5d;}

/* ===== timeline ===== */
.timeline{display:flex;flex-direction:column;gap:10px;}
.tl-item{
  background:var(--card);border-radius:var(--radius-sm);padding:12px 14px;display:flex;align-items:flex-start;gap:12px;
  border-left:3px solid transparent;
}
.tl-item.feed{border-left-color:#e8a87c;}
.tl-item.diaper{border-left-color:#7ec8e3;}
.tl-item.supplement{border-left-color:#a8d8ea;}
.tl-item.care{border-left-color:#c8b6e2;}
.tl-item.outdoor{border-left-color:#3a8c5d;}
.tl-icon{width:34px;height:34px;border-radius:50%;background:var(--bg);display:grid;place-items:center;font-size:17px;flex:none;}
.tl-body{flex:1;min-width:0;}
.tl-title{font-weight:700;font-size:14px;}
.tl-desc{font-size:13px;color:var(--text-2);margin-top:2px;}
.tl-time{font-size:12px;color:var(--text-3);white-space:nowrap;flex:none;}
.tl-del{font-size:12px;color:#c75450;margin-left:8px;padding:2px 6px;border-radius:4px;}
.tl-del:hover{background:#fdeaea;}
.empty{text-align:center;color:var(--text-3);padding:36px 10px;font-size:14px;background:var(--card);border-radius:var(--radius);}

/* ===== panels ===== */
.panel{background:var(--card);border-radius:var(--radius);padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.03);}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:12px;}
.panel-head h2{font-size:18px;margin:0;}
.dpnav{display:flex;align-items:center;gap:8px;}
.dpnav button{width:28px;height:28px;border-radius:50%;background:var(--bg);color:var(--text);font-size:16px;}
.dpnav span{font-size:14px;color:var(--text-2);min-width:48px;text-align:center;}
.today-line{font-size:14px;color:var(--text-2);margin-bottom:14px;padding:10px 12px;background:var(--accent-light);border-radius:var(--radius-sm);}

/* ===== click cards ===== */
.click-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px;}
.click-grid.two{grid-template-columns:repeat(2,1fr);}
.click-card{
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 8px;
  display:flex;flex-direction:column;align-items:center;gap:6px;transition:all .12s;
}
.click-card:active{transform:scale(.97);}
.click-card.pee{border-bottom:3px solid #7ec8e3;}
.click-card.poo{border-bottom:3px solid #8c6b4a;}
.click-card.both{border-bottom:3px solid #5a9bd5;}
.click-card.ad{border-bottom:3px solid #f5a623;}
.click-card.d3{border-bottom:3px solid #4a90e2;}
.cc-icon{font-size:28px;}
.click-card span:nth-of-type(2){font-weight:700;font-size:14px;}
.click-card small{font-size:12px;color:var(--text-2);}

.care-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px;}
.care-btn{
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 6px;
  display:flex;flex-direction:column;align-items:center;gap:5px;
}
.care-btn span:first-child{font-size:24px;}
.care-btn span:nth-child(2){font-size:13px;font-weight:600;}
.care-btn small{font-size:12px;color:var(--text-2);}
.care-btn:active{transform:scale(.97);}

.routine-card{
  background:linear-gradient(135deg,#e8f5ee,#f6f4ef);border-radius:var(--radius);padding:18px;margin-bottom:18px;
  display:flex;flex-direction:column;gap:6px;border:1px solid var(--border);
}
.routine-title{font-size:13px;color:var(--text-2);}
.routine-time{font-size:22px;font-weight:800;color:var(--accent);}
.routine-status{font-size:13px;color:var(--text-2);}

/* ===== chart ===== */
.chart-wrap{background:var(--card);border-radius:var(--radius);padding:16px;border:1px solid var(--border);margin-bottom:18px;}
.chart-title{font-size:13px;color:var(--text-2);margin-bottom:8px;}
.chart{width:100%;height:180px;display:block;}
.chart line{stroke:var(--border);stroke-width:1;}
.chart polyline{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;}
.chart circle{fill:var(--accent);}

.growth-list{display:flex;flex-direction:column;gap:8px;}
.growth-item{background:var(--bg);border-radius:var(--radius-sm);padding:10px 12px;display:flex;justify-content:space-between;font-size:14px;}

/* ===== vaccine ===== */
.vaccine-list{display:flex;flex-direction:column;gap:10px;}
.vaccine-item{
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 14px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.vaccine-item.done{opacity:.65;background:#f8f9f8;}
.vaccine-info{flex:1;}
.vaccine-name{font-weight:700;font-size:14px;}
.vaccine-date{font-size:12px;color:var(--text-2);margin-top:2px;}
.vaccine-tag{font-size:11px;padding:3px 8px;border-radius:999px;white-space:nowrap;}
.vaccine-tag.soon{background:#fdeaea;color:#c75450;}
.vaccine-tag.future{background:var(--accent-light);color:var(--accent);}
.vaccine-tag.done{background:#e8f5ee;color:#3a8c5d;}

/* ===== album & memo ===== */
.album-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;}
.album-placeholder{
  aspect-ratio:1;border-radius:var(--radius);border:2px dashed var(--border);
  display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--text-3);gap:6px;font-size:13px;
}
.album-item{position:relative;border-radius:var(--radius);overflow:hidden;background:var(--card);box-shadow:0 2px 8px rgba(0,0,0,.05);}
.album-item img{width:100%;aspect-ratio:1;object-fit:cover;display:block;}
.album-cap{font-size:12px;color:var(--text-2);padding:6px 8px;}
.album-del{
  position:absolute;top:6px;right:6px;width:24px;height:24px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;font-size:13px;
  display:grid;place-items:center;opacity:0;transition:opacity .15s;
}
.album-item:hover .album-del{opacity:1;}
.memo-area{
  width:100%;min-height:120px;border:1px solid var(--border);border-radius:var(--radius);padding:12px;resize:vertical;background:var(--bg);
}
.memo-history{margin-top:18px;display:flex;flex-direction:column;gap:10px;}
.memo-item{background:var(--bg);border-radius:var(--radius-sm);padding:10px 12px;font-size:14px;}
.memo-date{font-size:11px;color:var(--text-3);margin-bottom:4px;}

/* ===== form ===== */
.form{display:flex;flex-direction:column;gap:14px;max-width:520px;}
.form label{display:flex;flex-direction:column;gap:6px;font-size:14px;color:var(--text-2);}
.form input,.form select,.form textarea{
  padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);color:var(--text);
}
.btn-primary{
  background:var(--accent);color:#fff;border-radius:var(--radius-sm);padding:10px 16px;font-weight:600;font-size:14px;transition:background .15s;
}
.btn-primary:hover{background:#2f754f;}
.btn-primary.full{width:100%;}
.btn-ghost{
  background:var(--bg);color:var(--text-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 16px;font-size:14px;
}
.btn-ghost:hover{background:var(--border);}
.btn-ghost.full{width:100%;}
.btn-danger{
  background:#fff;color:#e06c75;border:1px solid #f3c2c6;border-radius:var(--radius-sm);padding:10px 16px;font-size:14px;margin-top:4px;
}
.btn-danger:hover{background:#fdeaea;}
.btn-danger.full{width:100%;}

/* ===== sheet ===== */
.sheet-overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:opacity .2s;z-index:90;}
.sheet-overlay.on{opacity:1;pointer-events:auto;}
.sheet{
  position:fixed;left:50%;bottom:0;transform:translate(-50%,100%);width:min(560px,94vw);max-height:82vh;
  background:var(--card);border-radius:var(--radius) var(--radius) 0 0;padding:18px 20px 24px;z-index:100;
  display:flex;flex-direction:column;transition:transform .25s ease;box-shadow:0 -4px 24px rgba(0,0,0,.12);
}
.sheet.on{transform:translate(-50%,0);}
.sheet-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;}
.sheet-head h3{margin:0;font-size:17px;}
.sheet-close{width:32px;height:32px;border-radius:50%;background:var(--bg);font-size:16px;color:var(--text-2);}
.sheet-body{flex:1;overflow-y:auto;}
.sheet-foot{margin-top:14px;}
.sheet-row{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.sheet-row label{font-size:13px;color:var(--text-2);}
.sheet-row input,.sheet-row select,.sheet-row textarea{
  padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);width:100%;
}
.sheet-row textarea{min-height:70px;resize:vertical;}
.type-pills{display:flex;gap:8px;flex-wrap:wrap;}
.type-pill{
  padding:8px 14px;border:1px solid var(--border);border-radius:999px;font-size:13px;background:var(--card);color:var(--text);
}
.type-pill.on{background:var(--accent);color:#fff;border-color:var(--accent);}

/* ===== fab ===== */
.fab{
  position:fixed;right:20px;bottom:20px;width:54px;height:54px;border-radius:50%;
  background:var(--accent);color:#fff;font-size:28px;box-shadow:0 4px 14px rgba(30,86,57,.35);z-index:50;display:none;
}
.fab:active{transform:scale(.95);}

/* ===== responsive: mobile ===== */
@media (max-width:820px){
  .app{position:relative;}
  .sidebar{position:absolute;left:0;top:0;bottom:0;z-index:80;transform:translateX(-100%);}
  .sidebar.open{transform:translateX(0);}
  .menu-toggle{display:grid;place-items:center;}
  .topbar{padding:0 16px;}
  .content{padding:16px;padding-bottom:90px;}
  .nav-label{font-size:13px;}
  .stat-grid{grid-template-columns:repeat(2,1fr);}
  .quick-bar{grid-template-columns:repeat(4,1fr);gap:8px;}
  .quick-btn{padding:12px 2px;}
  .click-grid{grid-template-columns:repeat(2,1fr);}
  .care-grid{grid-template-columns:repeat(2,1fr);}
  .hero-card{flex-direction:column;align-items:flex-start;gap:14px;}
  .hero-right{text-align:left;width:100%;}
  .fab{display:flex;align-items:center;justify-content:center;}
}

@media (max-width:480px){
  .hero-days{font-size:42px;}
  .stat-grid{grid-template-columns:repeat(2,1fr);}
  .quick-bar{grid-template-columns:repeat(2,1fr);}
  .substats{flex-direction:column;gap:8px;}
}

/* ===== sync status ===== */
.sync-status{font-size:12px;color:var(--text-3);margin:6px 2px 0;line-height:1.5;}
