/* ============================================================
   兜住 · 高保真原型样式
   设计基准：750rpx 设计稿 → 390px 手机（1rpx ≈ 0.52px）
   ============================================================ */

:root {
  /* 品牌 */
  --brand-500: #dd6136;
  --brand-600: #c24f28;
  --brand-50: #fdeee7;
  --brand-grad: linear-gradient(145deg, #e8713f, #cf5229);

  /* 状态 */
  --s-pending-fg: #8a8078;
  --s-pending-bg: #f3efe9;
  --s-reminded-fg: #2f6fd0;
  --s-reminded-bg: #eaf1fc;
  --s-accepted-fg: #c98a1e;
  --s-accepted-bg: #fdf3df;
  --s-done-fg: #3d8b78;
  --s-done-bg: #e8f4f0;
  --s-overdue-fg: #c04a38;
  --s-overdue-bg: #fbeceb;
  --s-skipped-fg: #9a9189;
  --s-skipped-bg: #f3efe9;

  /* 中性 */
  --ink-900: #241f1b;
  --ink-700: #4a423b;
  --ink-500: #8a8078;
  --ink-300: #b6aca2;
  --line: #ece5db;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #fdfbf8;

  /* 尺寸 */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow-1: 0 1px 2px rgba(36, 31, 27, 0.04), 0 2px 8px rgba(36, 31, 27, 0.04);
  --shadow-2: 0 2px 6px rgba(36, 31, 27, 0.05), 0 12px 32px rgba(36, 31, 27, 0.1);
  --shadow-3: 0 24px 60px rgba(36, 31, 27, 0.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: #e9e5de;
  display: flex;
  min-height: 100vh;
}

/* ============================ 桌面：原型工作台 ============================ */

.proto-panel {
  width: 300px;
  flex: none;
  padding: 26px 22px;
  background: #fffdfa;
  border-right: 1px solid #ded8cf;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.proto-brand { display: flex; align-items: center; gap: 10px; }
.proto-logo {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(221, 97, 54, 0.28);
}
.proto-brand strong { display: block; font-size: 17px; letter-spacing: 0.08em; }
.proto-brand em { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-500); }

.proto-nav { display: flex; flex-direction: column; gap: 3px; }
.proto-nav button {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: none; border-radius: 9px;
  background: transparent; color: var(--ink-700);
  font-family: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.proto-nav button:hover { background: #f5efe7; }
.proto-nav button.is-active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.proto-nav .nav-idx {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 11px;
  background: #efe9e1; color: var(--ink-500);
}
.proto-nav button.is-active .nav-idx { background: #fff; color: var(--brand-600); }

.proto-note, .proto-legend {
  font-size: 12px; color: var(--ink-500);
  border-top: 1px solid #eee7de; padding-top: 14px;
}
.proto-note b, .proto-legend b { display: block; color: var(--ink-700); font-size: 12.5px; margin-bottom: 7px; }
.proto-note ul { margin: 0; padding-left: 15px; }
.proto-note li { margin-bottom: 3px; line-height: 1.55; }
.legend-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.legend-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.dot.s-pending { background: var(--s-pending-fg); }
.dot.s-reminded { background: var(--s-reminded-fg); }
.dot.s-accepted { background: var(--s-accepted-fg); }
.dot.s-done { background: var(--s-done-fg); }
.dot.s-overdue { background: var(--s-overdue-fg); }
.dot.s-skipped { background: var(--s-skipped-fg); }

.proto-stage { flex: 1; display: grid; place-items: center; padding: 30px 20px; }

.device {
  width: 390px; height: 844px; flex: none;
  border-radius: 46px; background: #17130f; padding: 11px;
  box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255,255,255,.06);
  position: relative;
}
.screen {
  width: 100%; height: 100%; border-radius: 36px; overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column; position: relative;
}

.statusbar {
  height: 46px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px 0 30px; font-size: 13px; font-weight: 600;
  color: var(--ink-900); letter-spacing: 0.02em;
  background: var(--bg);
  position: relative; z-index: 5;
}
.sb-right { display: flex; align-items: center; gap: 5px; }
.sb-battery {
  width: 22px; height: 11px; border-radius: 3px; border: 1.2px solid currentColor;
  position: relative; opacity: .9;
}
.sb-battery::after {
  content: ''; position: absolute; inset: 1.4px; right: 6px;
  background: currentColor; border-radius: 1px;
}

.app { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

.proto-toggle { display: none; }

/* ============================ 页面骨架 ============================ */

.page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 0; }

/* 通用导航栏 */
.navbar {
  flex: none; height: 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: var(--bg);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.navbar.is-scrolled { border-bottom-color: var(--line); }
.navbar h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.navbar .spacer { flex: 1; }
.nav-back {
  width: 32px; height: 32px; margin-left: -8px; border: none; background: none;
  display: grid; place-items: center; color: var(--ink-700); cursor: pointer; border-radius: 9px;
}
.nav-back:active { background: #f0eae2; }
.icon-btn {
  width: 34px; height: 34px; border: none; border-radius: 11px;
  background: var(--surface); box-shadow: var(--shadow-1);
  display: grid; place-items: center; color: var(--ink-700); cursor: pointer;
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-brand { background: var(--brand-grad); color: #fff; box-shadow: 0 5px 14px rgba(207,82,41,.28); }

/* 顶部：日期 + 孩子切换 */
.today-head { padding: 2px 16px 0; }
.big-date { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.big-date .d-main { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.big-date .d-sub { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.child-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: inherit; font-size: 12.5px; color: var(--ink-700); cursor: pointer; flex: none;
  box-shadow: var(--shadow-1);
}
.chip-caret { font-style: normal; font-size: 9px; color: var(--ink-300); margin-left: 1px; }
.child-avatar {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 600; color: #fff; background: #e9a23b; flex: none;
}
.child-avatar.av-all { background: linear-gradient(135deg, #c9a06a, #a9835a); font-size: 9px; }

/* 卡片上的孩子标记（「全部孩子」视图下显示） */
.child-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-700); }
.child-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, #ccc); flex: none; }

/* 孩子管理 */
.child-card {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.child-av-big {
  width: 44px; height: 44px; border-radius: 14px; color: #fff; flex: none;
  display: grid; place-items: center; font-size: 16px; font-weight: 600;
}
.child-info { flex: 1; min-width: 0; }
.child-info b { display: block; font-size: 15px; line-height: 1.3; }
.child-info > span { display: block; font-size: 11.5px; color: var(--ink-500); }
.child-info .child-stat { margin-top: 3px; color: var(--ink-700); }
.privacy-tip {
  margin: 18px 26px 26px; font-size: 11.5px; color: var(--ink-500);
  line-height: 1.7; text-align: center;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }

/* 概览条 */
.overview {
  margin: 12px 16px 4px; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform .12s;
}
.overview:active { transform: scale(.99); }
.ov-top { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--ink-500); }
.ov-top b { color: var(--ink-900); font-size: 15px; font-variant-numeric: tabular-nums; }
.ov-top .warn { margin-left: auto; color: var(--s-overdue-fg); font-weight: 600; display: flex; align-items: center; gap: 3px; }
.ov-bar { margin-top: 7px; height: 5px; border-radius: 99px; background: #f0eae2; overflow: hidden; }
.ov-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #46a08a, #3d8b78); transition: width .5s cubic-bezier(.2,.9,.3,1); }

/* ============================ 时间轴 & 卡片 ============================ */

.timeline { padding: 6px 16px 20px; }

.tl-row {
  display: grid; grid-template-columns: 44px 14px 1fr;
  column-gap: 4px; align-items: stretch;
  animation: rowIn .28s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }

.tl-time {
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink-500); text-align: right; padding-top: 15px; line-height: 1;
}
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before {
  content: ''; width: 2px; background: var(--line); border-radius: 2px;
  position: absolute; top: 0; bottom: 0;
}
.tl-row:first-child .tl-rail::before { top: 19px; }
.tl-row:last-child .tl-rail::before { bottom: calc(100% - 20px); }
.tl-dot {
  position: absolute; top: 15px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line); z-index: 1;
}

.tl-card-wrap { padding-bottom: 11px; min-width: 0; }

/* 卡片 */
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--r-lg); padding: 11px 12px 11px 13px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .12s ease, opacity .25s;
}
.card:active { transform: scale(.985); }

.card.s-pending { border-left-color: #d8d1c7; }
.card.s-reminded { border-left-color: var(--s-reminded-fg); background: #fff; }
.card.s-accepted { border-left-color: var(--s-accepted-fg); background: #fffdf7; }
.card.s-done      { border-left-color: var(--s-done-fg);      background: #fdfefd; }
.card.s-overdue   { border-left-color: var(--s-overdue-fg);   background: #fffbfa; }
.card.s-skipped   { border-left-color: #ddd6cd; background: #fdfcfb; }

.card-head { display: flex; align-items: flex-start; gap: 8px; }
.card-title {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card.s-done .card-title, .card.s-skipped .card-title {
  color: var(--ink-500); text-decoration: line-through; text-decoration-thickness: 1.5px;
}
.card.s-overdue .card-title { color: var(--ink-900); }

.pill {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.pill svg { width: 9px; height: 9px; }
.pill.p-pending { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.pill.p-reminded { background: var(--s-reminded-bg); color: var(--s-reminded-fg); }
.pill.p-accepted { background: var(--s-accepted-bg); color: var(--s-accepted-fg); }
.pill.p-done { background: var(--s-done-bg); color: var(--s-done-fg); }
.pill.p-overdue { background: var(--s-overdue-bg); color: var(--s-overdue-fg); }
.pill.p-skipped { background: var(--s-skipped-bg); color: var(--s-skipped-fg); }

.card-sub {
  margin: 5px 0 0; font-size: 12px; color: var(--ink-500); line-height: 1.5;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.card-sub .sep { color: #ddd3c7; }
.card-sub b { font-weight: 600; color: var(--ink-700); }
.tag-bring {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 5px; background: var(--brand-50); color: #b1502a;
  font-size: 11px; font-weight: 500;
}

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.member { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-500); }
.av {
  width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 9.5px; font-weight: 600; color: #fff; font-style: normal; flex: none;
  line-height: 1;
}
.av.mama { background: #e2765a; }
.av.baba { background: #5b7fa8; }
.av.waipo { background: #8a9c6b; }

/* 按钮 */
.btn {
  border: none; font-family: inherit; cursor: pointer;
  border-radius: 9px; font-weight: 600; letter-spacing: 0.03em;
  transition: transform .12s, opacity .15s, background .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.btn:active { transform: scale(.96); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; min-height: 32px; }
.btn-md { padding: 11px 18px; font-size: 14px; min-height: 42px; }
.btn-lg { padding: 15px 20px; font-size: 15px; min-height: 52px; width: 100%; }

.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 12px rgba(207,82,41,.24); }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink-700); border: 1px solid var(--line); }
.btn-soft { background: var(--brand-50); color: var(--brand-600); }
.btn-danger { background: #fff5f3; color: var(--s-overdue-fg); border: 1px solid #f3d9d5; }
.btn-flat { background: transparent; color: var(--ink-500); }

/* 折叠 */
.collapse-bar {
  margin: 2px 16px 16px; padding: 10px; text-align: center;
  border-radius: var(--r-md); border: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-500); background: transparent;
  cursor: pointer; width: calc(100% - 32px); font-family: inherit;
}

/* ============================ 分组（待我办） ============================ */

.group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 16px 16px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-500);
  letter-spacing: 0.04em;
}
.group-head .cnt { color: var(--ink-300); font-weight: 500; }
.group-head.warn { color: var(--s-overdue-fg); }

/* ============================ TabBar ============================ */

.tabbar {
  flex: none; height: 62px; display: flex; align-items: stretch;
  background: rgba(255, 253, 250, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: 4px;
}
.tabbar button {
  flex: 1; border: none; background: none; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-300); font-size: 10px; font-weight: 500; position: relative;
  transition: color .15s;
}
.tabbar button.is-active { color: var(--brand-500); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar .badge {
  position: absolute; top: 7px; left: 50%; margin-left: 5px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
  background: var(--s-overdue-fg); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; border: 1.5px solid #fffdfa;
}

/* ============================ 列表行（事项库/我的） ============================ */

.list-sec { padding: 0 16px; }
.sec-title {
  padding: 18px 4px 8px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-500); letter-spacing: 0.04em;
}
.tpl-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 8px; box-shadow: var(--shadow-1);
}
.tpl-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 15px; background: var(--brand-50);
}
.tpl-main { flex: 1; min-width: 0; }
.tpl-main b { display: block; font-size: 14px; font-weight: 600; }
.tpl-main span { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.tpl-row.is-paused { opacity: .55; }

.profile-card {
  margin: 14px 16px 0; padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-1); display: flex; align-items: center; gap: 12px;
}
.profile-av {
  width: 46px; height: 46px; border-radius: 16px; background: var(--brand-grad);
  color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 600; flex: none;
}
.profile-card b { display: block; font-size: 16px; }
.profile-card span { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }

.menu { margin: 14px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.menu-row {
  display: flex; align-items: center; gap: 11px; padding: 13px 14px;
  font-size: 14px; color: var(--ink-700); cursor: pointer;
  border-bottom: 1px solid #f5f0e9;
}
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: var(--surface-2); }
.menu-row .mi { width: 20px; text-align: center; font-size: 15px; }
.menu-row .mv { margin-left: auto; font-size: 12px; color: var(--ink-300); display: flex; align-items: center; gap: 6px; }
.menu-row .chev { color: #d6cec3; font-size: 15px; }

/* ============================ 表单（新建事项） ============================ */

.form { padding: 4px 16px 120px; }
.field { margin-bottom: 20px; }
.field-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ink-500);
  letter-spacing: 0.04em; margin-bottom: 8px;
}
.field-label .req { color: var(--brand-500); margin-left: 2px; }
.input {
  width: 100%; padding: 12px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2);
  font-family: inherit; font-size: 15px; color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--ink-300); }
.input:focus { outline: none; border-color: #e9a98e; background: #fff; box-shadow: 0 0 0 3px rgba(221,97,54,.09); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-700); font-family: inherit;
  font-size: 12.5px; cursor: pointer; transition: all .15s;
}
.chip:active { transform: scale(.96); }
.chip.is-on { background: var(--brand-50); border-color: #f0b89f; color: var(--brand-600); font-weight: 600; }

.week-row { display: flex; gap: 6px; margin-top: 10px; }
.wd {
  flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-700); font-family: inherit;
  font-size: 12.5px; cursor: pointer;
}
.wd.is-on { background: var(--brand-50); border-color: #f0b89f; color: var(--brand-600); font-weight: 700; }

.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.member-pick { display: flex; gap: 8px; }
.member-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); font-family: inherit; font-size: 12px; color: var(--ink-700);
  cursor: pointer; transition: all .15s;
}
.member-opt .av { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; display: grid; place-items: center; color: #fff; font-weight: 600; }
.member-opt.is-on { border-color: #f0b89f; background: var(--brand-50); color: var(--brand-600); font-weight: 600; }

.more-toggle {
  display: flex; align-items: center; gap: 5px; width: 100%;
  padding: 11px 0; border: none; background: none; font-family: inherit;
  font-size: 13px; color: var(--ink-500); cursor: pointer;
}
.more-toggle .chev { transition: transform .2s; }
.more-toggle.is-open .chev { transform: rotate(90deg); }

/* 底部固定操作条 */
.actionbar {
  flex: none; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,253,250,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); display: flex; gap: 9px;
}

/* ============================ 详情 ============================ */

.detail-hero { padding: 6px 16px 14px; }
.detail-hero h2 { margin: 6px 0 4px; font-size: 22px; font-weight: 700; line-height: 1.3; }
.detail-meta { font-size: 13px; color: var(--ink-500); line-height: 1.7; }

.kv { margin: 0 16px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.kv-row { display: flex; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #f5f0e9; font-size: 13px; align-items: flex-start; }
.kv-row:last-child { border-bottom: none; }
.kv-k { flex: none; width: 62px; color: var(--ink-500); font-size: 12.5px; }
.kv-v { flex: 1; color: var(--ink-900); }

.trace { margin: 0 16px; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.trace-item { display: flex; gap: 9px; padding: 6px 0; font-size: 12.5px; color: var(--ink-700); position: relative; }
.trace-dot { width: 7px; height: 7px; border-radius: 50%; background: #d9d1c7; margin-top: 5px; flex: none; }
.trace-item.is-last .trace-dot { background: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50); }
.trace-time { color: var(--ink-300); font-variant-numeric: tabular-nums; flex: none; width: 40px; }

/* ============================ 对账 ============================ */

.ring-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 16px 4px; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { transform: rotate(-90deg); }
.ring-txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-txt b { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ring-txt span { font-size: 10.5px; color: var(--ink-500); display: block; margin-top: -2px; }
.ring-cap { margin-top: 6px; font-size: 13px; color: var(--ink-700); }
.ring-cap b { color: var(--s-done-fg); }

.rep-group { margin: 16px 16px 0; }
.rep-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.rep-head.ok { color: var(--s-done-fg); }
.rep-head.wait { color: var(--s-accepted-fg); }
.rep-head.warn { color: var(--s-overdue-fg); }
.rep-row {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 7px; font-size: 13px; box-shadow: var(--shadow-1);
}
.rep-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-row .who { font-size: 11.5px; color: var(--ink-500); flex: none; }

.segmented {
  display: flex; gap: 3px; padding: 3px; background: #f1ebe3; border-radius: 10px;
  margin: 12px 16px 0;
}
.segmented button {
  flex: 1; padding: 6px; border: none; border-radius: 8px; background: transparent;
  font-family: inherit; font-size: 12.5px; color: var(--ink-500); cursor: pointer;
}
.segmented button.is-on { background: #fff; color: var(--ink-900); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ============================ H5 确认页 ============================ */

.h5 { background: #fff; height: 100%; display: flex; flex-direction: column; }
.h5-top { padding: 16px 22px 0; display: flex; align-items: center; justify-content: space-between; }
.h5-brand { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-900); letter-spacing: .06em; }
.h5-brand i { width: 18px; height: 18px; border-radius: 6px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 10px; }
.h5-clock { font-size: 13px; color: var(--ink-500); font-variant-numeric: tabular-nums; }

.h5-main { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; padding: 12vh 22px 0; }
.h5-lead { font-size: 15px; color: var(--s-reminded-fg); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.h5-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: #fffdfa; }
.h5-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; line-height: 1.25; }
.h5-card .when { font-size: 16px; color: var(--ink-700); font-variant-numeric: tabular-nums; }
.h5-card .where { font-size: 15px; color: var(--ink-500); margin-top: 3px; }
.h5-bring {
  margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: var(--brand-50);
  font-size: 15px; color: #a9461f; line-height: 1.5;
}
.h5-bring b { font-weight: 700; }

.h5-actions { padding: 22px 22px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.h5-actions .btn-lg { min-height: 56px; border-radius: 14px; font-size: 17px; }
.h5-actions .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.h5-actions .row2 .btn { min-height: 52px; border-radius: 14px; font-size: 15px; }
.h5-foot { text-align: center; font-size: 11.5px; color: var(--ink-300); padding-bottom: 6px; }

/* ============================ 浮层 ============================ */

.sheet-mask {
  position: fixed; inset: 0; background: rgba(36,31,27,.42);
  backdrop-filter: blur(2px); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 82vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: slideUp .26s cubic-bezier(.2,.9,.3,1);
  box-shadow: 0 -10px 40px rgba(0,0,0,.12);
}
@keyframes slideUp { from { transform: translateY(100%); } }
.sheet h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; text-align: center; }
.sheet-item {
  display: flex; align-items: center; gap: 11px; padding: 14px 12px;
  border-radius: var(--r-md); font-size: 15px; cursor: pointer; background: var(--surface-2);
  margin-bottom: 8px; border: 1px solid var(--line);
}
.sheet-item:active { background: #f5efe7; }
.sheet-item .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: #fff; box-shadow: var(--shadow-1); }
.sheet-item small { display: block; font-size: 11.5px; color: var(--ink-500); font-weight: 400; }
.sheet-cancel {
  width: 100%; padding: 13px; border-radius: var(--r-md); border: none;
  background: #f3eee8; font-family: inherit; font-size: 15px; color: var(--ink-700);
  cursor: pointer; margin-top: 4px;
}

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(36,31,27,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 60; animation: toastIn .22s cubic-bezier(.2,.9,.3,1);
  white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast .ok { color: #6fd3b6; margin-right: 5px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ============================ 移动端：真机观感 ============================ */

@media (max-width: 900px) {
  body { display: block; background: var(--bg); }
  .proto-panel { display: none; }
  .proto-stage { display: block; padding: 0; }
  .device { width: 100%; height: 100dvh; border-radius: 0; padding: 0; background: var(--bg); box-shadow: none; }
  .screen { border-radius: 0; height: 100dvh; }
  .statusbar { display: none; }
  .app { padding-top: env(safe-area-inset-top); }
  .proto-toggle {
    display: block; position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 70; padding: 9px 14px; border-radius: 999px; border: none;
    background: rgba(36,31,27,.86); color: #fff; font-family: inherit; font-size: 12.5px;
    box-shadow: 0 6px 20px rgba(0,0,0,.22); backdrop-filter: blur(8px);
  }
  .proto-sheet {
    position: fixed; inset: 0; z-index: 80; background: rgba(36,31,27,.45);
    display: flex; align-items: flex-end; padding: 14px;
  }
  .proto-sheet .sheet { border-radius: 18px; max-height: 70dvh; overflow-y: auto; }

  .proto-clean .proto-toggle { display: none !important; }
}

/* ============================================================
   H5 应用宿主（在原型样式基础上覆盖）
   ============================================================ */

html, body { height: 100%; }

body {
  display: block;
  background: #ece7e0;
  min-height: 100dvh;
  margin: 0;
}

#root {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px rgba(36, 31, 27, 0.08);
}

#app { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

@media (max-width: 600px) {
  #root { max-width: 100%; box-shadow: none; }
  body { background: var(--bg); }
}

/* 登录 */
.login {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
}
.login-brand { text-align: center; margin-bottom: 34px; }
.login-mark {
  width: 62px; height: 62px; border-radius: 20px; margin: 0 auto 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #e8713f, #cf5229);
  box-shadow: 0 10px 26px rgba(207, 82, 41, 0.3);
}
.login-brand h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: 0.12em; }
.login-brand p { margin: 0; font-size: 13px; color: var(--ink-500); }
.login-label { font-size: 12.5px; color: var(--ink-500); margin: 0 0 10px; text-align: center; }
.login-list { display: flex; flex-direction: column; gap: 10px; }
.login-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 15px 16px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); font-family: inherit; font-size: 15px; color: var(--ink-900);
  cursor: pointer; box-shadow: var(--shadow-1); transition: transform .12s;
}
.login-item:active { transform: scale(.98); }
.login-item .av { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.login-item small { display: block; font-size: 11.5px; color: var(--ink-500); font-weight: 400; }
.login-foot { margin-top: 26px; text-align: center; font-size: 11.5px; color: var(--ink-300); line-height: 1.8; }

/* 顶部日期条上的小操作 */
.head-actions { display: flex; align-items: center; gap: 8px; }
.date-nav {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-1); overflow: hidden;
}
.date-nav button {
  border: none; background: none; font-family: inherit; font-size: 12px;
  color: var(--ink-500); padding: 6px 9px; cursor: pointer;
}
.date-nav button:active { background: #f5efe7; }
.date-nav .dnow { font-weight: 600; color: var(--ink-900); padding: 6px 4px; font-size: 12px; }

/* 空状态小按钮 */
.mini-cta {
  margin-top: 12px; padding: 9px 18px; border-radius: 999px; border: 1px solid #f0b89f;
  background: var(--brand-50); color: var(--brand-600); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
}

/* 加载 */
.skeleton { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sk {
  height: 84px; border-radius: var(--r-lg);
  background: linear-gradient(90deg, #f2ede6 25%, #f8f4ef 37%, #f2ede6 63%);
  background-size: 400% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 待我办底部条留白 */
.pad-bottom { height: 16px; }

/* 今日页悬浮新建按钮 */
.fab {
  position: absolute;
  right: 18px;
  bottom: 84px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #e8713f, #cf5229);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(207, 82, 41, 0.36);
  cursor: pointer;
  z-index: 20;
  transition: transform 0.12s;
}
.fab:active { transform: scale(0.94); }

/* 事项库分组切换 */
.segbar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
.segbar .seg {
  flex: 1;
  padding: 9px 0;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.segbar .seg.is-on {
  background: #fbeee7;
  border-color: #e8996f;
  color: #cf5229;
  font-weight: 600;
}

/* 「孩子自己做」标记 */
.tag-kid {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: #4f7d6b;
  background: #e8f1ec;
  border-radius: 5px;
  padding: 1px 4px;
  margin-left: 3px;
  vertical-align: 1px;
}
