/* 拍立记设计语言（2026-11-27 改版）：纯白底 / 晴空蓝 / 图表＋数据块
   首页＝图表区＋一条条记录数据块（日期为主信息）；状态用平放标签，不用小票/印章/编号。 */
:root {
  --paper: #ffffff; /* 纯白底（Henry 2026-11-27 定，暖纸底显脏已弃） */
  --slip: #ffffff;
  --ink: #1d1d1a;
  --ink2: #55534a;
  --faint: #716c5e;
  --line: #dde3e7;
  --dash: #d5dce1;
  --brand: #42a5f5; /* 主题色：晴空蓝（Henry 2026-11-27 定，病人不喜欢红） */
  --brand-dark: #1976d2;
  --amber: #b45309;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
main { max-width: 560px; margin: 0 auto; padding: 6px 16px 48px; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 顶栏 ---------- */
.topbar {
  /* 顶部固定块：品牌栏＋筛选层是一个整体，整块吸顶，层间零相对滑动（Henry 2026-11-27 定） */
  position: sticky; top: 0; z-index: 40; background: var(--paper);
  max-width: 560px; margin: 0 auto;
  padding: env(safe-area-inset-top) 0 0;
}
.brandbar { height: 52px; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; border-bottom: 0.5px solid #d3d9de; }
.brand { font-size: 19px; font-weight: 900; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.brand .tile-img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand .tile { background: var(--brand); color: #fff; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.link-btn { background: none; border: none; color: var(--faint); font-size: 13.5px; cursor: pointer; padding: 8px 2px; }

/* ---------- 卡片（通用容器） ---------- */
.card {
  position: relative; background: var(--slip); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-top: 10px;
  box-shadow: 0 1px 2px rgba(38,50,56,.05);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .18em; color: var(--faint); font-weight: 700; }

/* ---------- 首页图表区 ---------- */
.sheet-divider { border-top: 0.5px solid #d3d9de; margin: 16px 0 12px; }
.form-subtitle { font-size: 13px; font-weight: 700; color: var(--faint); margin-bottom: 10px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 0.5px solid #e3e8ec; }
.prow:last-child { border-bottom: none; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pname { font-size: 15.5px; font-weight: 700; }
.pmeta { font-size: 12px; color: var(--faint); }
.pmeta.warn { color: #d6191b; }
.pact { display: flex; gap: 8px; flex: none; }
.pbtn { border: 1px solid #dbe2e8; background: #fff; color: var(--brand-dark); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.pbtn.danger { color: #d6191b; border-color: #f0d4d1; }
.pbtn.danger-solid { background: #d6191b; border-color: #d6191b; color: #fff; }
.tt-glu { background: #d9eefd; color: #1976d2; }
.tt-bp { background: #e4e0fb; color: #5a4bd1; }
.tt-food { background: #fce9d2; color: #a35b00; }
.tt-weight { background: #dcf0ec; color: #14705f; }
.tt-lab { background: #e3e7fb; color: #3949ab; }
.feed-head { margin: 12px 0 10px; }
.feed-filter { display: flex; background: #eef2f5; border-radius: 11px; padding: 3px; }
.feed-filter button { flex: 1; border: none; background: none; font-size: 14px; font-weight: 600; color: #5f7183; padding: 7px 0; border-radius: 8px; cursor: pointer; }
.feed-filter button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 4px rgba(20,40,60,.18); }
.deck { overflow: hidden; margin: 12px -16px 0; }
.deck-track { display: flex; gap: 8px; padding: 0 25px; transition: transform .32s ease; will-change: transform; }
.ccard { flex: none; width: calc(100vw - 50px); max-width: 510px; border: 1px solid #e6ebee; border-radius: 14px; padding: 12px 14px 13px; background: #fff; }
.ccard .chart-head { margin-top: 0; }
.ccard .chart-box { border: none; padding: 0; margin-top: 6px; }
.ccard-empty { padding: 36px 0 32px; text-align: center; color: var(--faint); font-size: 13.5px; }
.chart-ind { display: flex; justify-content: center; gap: 0; width: fit-content; margin: 12px auto 0; background: #eef2f5; border-radius: 999px; padding: 3px; }
.chart-ind span { font-size: 14.5px; color: #5f7183; font-weight: 600; cursor: pointer; padding: 7px 27px; border-radius: 999px; }
.chart-ind span.on { background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 1px 4px rgba(20,40,60,.18); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 14px; }
.chart-title { font-size: 15px; font-weight: 800; padding-top: 6px; }
.chart-title span { color: var(--faint); font-weight: 600; font-size: 12px; margin-left: 6px; letter-spacing: .06em; }
.chart-detail-link { font-size: 13.5px; color: var(--brand-dark); font-weight: 600; cursor: pointer; padding-top: 8px; white-space: nowrap; }
.chart-box { margin-top: 10px; border: 1px solid #e6ebee; border-radius: 10px; padding: 6px 4px 2px;
  background: repeating-linear-gradient(0deg, transparent 0 20px, #eef3f7 20px 21px), repeating-linear-gradient(90deg, transparent 0 20px, #eef3f7 20px 21px), #fff; }
.ccard-canvas { width: 100%; height: 190px; display: block; }
.chart-stats { display: flex; margin-top: 13px; justify-content: space-between; container-type: inline-size; }
.chart-stats > div { flex: 1 1 0; min-width: 0; text-align: center; }
.feed-filter .fcount { font-size: 12px; color: #8a97a3; font-weight: 600; }
.chart-stats .n { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-stats .l { font-size: 11px; color: var(--faint); margin-top: 2px; letter-spacing: .06em; white-space: nowrap; }
/* 区格制（2026-11-28 Henry 定，替 F15 断点降字号）：四格等分空间，数值/标签在本格内按容器宽缩放、
   封顶标准字号——系统放大字号时在本格内适配，永不挤占邻格、永不撑出卡片。
   标定：最宽串「152 / 98」宽 = 3.61×字号（实测，iOS 字体估 3.9），格宽 = 容器/4 → 系数上限 6.9，取 6.2 留余量；
   最宽标签「近7天平均」宽 = 4.86×字号（iOS 估 5.3）→ 上限 5.1，取 4.7。.ccard 前缀提优先级，压过字号放大覆写。 */
.ccard .chart-stats .n { font-size: clamp(10px, 6.2cqw, 17px); }
.ccard .chart-stats .l { font-size: clamp(8px, 4.7cqw, 11px); }

/* ---------- 状态签（正常/偏高，平放不用印章） ---------- */
.tag { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
/* 旧浅底状态签（.tag.ok/.hi/.low）已随 2026-11-28 记录卡改版删除：全站唯一消费者 recordItemHtml 恒用 .tag.solid 实色块 */

/* ---------- 确认页标题行 ---------- */

/* ---------- 对象胶囊 ---------- */
.pchip { padding: 8px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 700; background: #fff; color: var(--ink2); border: 1.5px solid var(--line); cursor: pointer; }
.pchip.on { background: rgba(66,165,245,.10); color: var(--brand-dark); border-color: var(--brand); }

/* ---------- 按钮 ---------- */
.primary-btn { display: block; width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 13px; padding: 15px; font-size: 17px; font-weight: 800; letter-spacing: .1em; margin-top: 12px; cursor: pointer; box-shadow: 0 8px 18px rgba(66,165,245,.22); }
.note-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.nchip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink2); font-size: 13px; font-weight: 600; cursor: pointer; }
.nchip.on { border-color: var(--brand); color: var(--brand-dark); background: #eef6fd; }
.note-input-field { margin-top: 8px; }
.save-row { display: flex; gap: 10px; margin-top: 12px; position: sticky; bottom: 10px; z-index: 5; }
.save-row .primary-btn { flex: none; width: calc((100% - 10px) * 2 / 3); margin-top: 0; }
.save-row .discard-btn { flex: none; width: calc((100% - 10px) / 3); margin-top: 0; }
.save-row.solo .primary-btn { width: 100%; }
.primary-btn:disabled { opacity: .55; }
.discard-btn { display: block; width: 100%; background: none; border: 1.5px solid var(--line); color: var(--ink2); border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 700; margin-top: 12px; cursor: pointer; }
.danger-btn { display: block; width: 100%; background: none; border: 1.5px solid #e5b4b0; color: #d6191b; border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 700; margin-top: 12px; cursor: pointer; }
.danger-btn.armed { background: #d6191b; color: #fff; border-color: #d6191b; }
.mini-btn { display: inline-block; background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 11px 16px; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.mini-btn.ghost { background: #fff; color: var(--ink2); border: 1px solid var(--line); }
.mini-btn:disabled { opacity: .55; cursor: default; }
h1 { font-size: 21px; font-weight: 800; margin: 8px 0 4px; }
h2 { font-size: 11px; letter-spacing: .24em; color: var(--faint); margin: 24px 2px 2px; font-weight: 700; }
.hint { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.hint.center { text-align: center; margin-top: 14px; }
.error { color: #d6191b; font-size: 14px; min-height: 20px; margin-top: 8px; }
.error:empty { display: none; }
.status { font-size: 14px; color: var(--ink2); text-align: center; min-height: 18px; }
.row { display: flex; gap: 10px; align-items: center; }

/* ---------- 登录 ---------- */
.big-input { width: 100%; font-family: var(--mono); font-size: 18px; padding: 14px; border: 1.5px solid #dbe2e8; border-radius: 10px; background: #fff; margin-top: 14px; letter-spacing: .06em; }
.big-input:focus { outline: 2px solid var(--brand); border-color: transparent; }

/* ---------- 记录卡（左类型色柱＋中数值＋右日期/状态，2026-11-28 Henry 手稿定稿） ---------- */
.list { margin-top: 14px; }
.item { position: relative; background: var(--slip); border: 1.5px solid var(--line); border-radius: 12px; padding: 0; margin-top: 9px; display: flex; align-items: stretch; gap: 0; cursor: pointer; box-shadow: 0 1px 2px rgba(38,50,56,.05); overflow: hidden; transition: background-color .3s ease, box-shadow .3s ease; }
/* 保存后定位高亮（审计 F4）：品牌蓝浅底＋描边圈，2 秒后由 JS 摘掉 class 自己淡出 */
.item.just-saved { background: #eef6fd; box-shadow: 0 0 0 2px var(--brand); }
.item.t-glu { border-color: #42a5f5; }
.item.t-bp { border-color: #7c6bd9; }
.item.t-food { border-color: #f0a840; }
.item.t-weight { border-color: #3aa08c; }
.item.t-lab { border-color: #5c6bc0; }
.item .b-val .v.ellipsis { overflow: hidden; text-overflow: ellipsis; }
.i-spine { flex: 0 0 58px; position: relative; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; letter-spacing: .14em; }
.item .b-val { flex: 1; min-width: 0; align-self: center; padding: 13px 4px 13px 12px; }
.item .b-val .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .b-val .v .u { font-size: 12px; color: var(--faint); font-weight: 600; }
.item .b-val .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.i-right { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 11px 10px 11px 6px; flex: 0 0 auto; }
.i-when { text-align: right; font-size: 12.5px; font-weight: 600; color: var(--faint); line-height: 1.55; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag.solid { border-radius: 6px; padding: 4px 11px; }
.tag.solid.ok { background: #e3f1e7; color: rgb(30,120,70); }
.tag.solid.hi { background: #fbe9e7; color: #d6191b; }
.tag.solid.low { background: #faf0dc; color: #b45309; }
/* 饮食信息块（不是状态、无达标概念）：与色柱同一套橙系浅底深字 */
.tag.solid.st-food { background: #fce9d2; color: #a35b00; }
@media (max-width: 389px) {
  .i-spine { flex-basis: 54px; }
  .i-when { font-size: 11.5px; }
  .i-right { padding-right: 8px; }
  .item .b-val { padding-left: 10px; }
  .item .b-val .v .u { font-size: 11px; }
}
@media (max-width: 359px) {
  .i-spine { flex-basis: 42px; writing-mode: vertical-rl; }
  .item .b-val { padding-right: 2px; }
  .item .b-val .v { font-size: 20px; }
  .i-right { padding-left: 2px; }
}
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink2); background: #eef2f5; border-radius: 5px; padding: 2px 6px; margin-left: 7px; vertical-align: 3px; }
.badge.warn-badge { color: var(--amber); background: #faf0dc; }
.empty-box { background: var(--slip); border: 1.5px dashed var(--dash); border-radius: 12px; padding: 22px 18px; font-size: 15px; line-height: 1.7; color: var(--ink2); margin-top: 14px; text-align: center; }

/* ---------- 分段控件 ---------- */
.seg { display: flex; background: #eef2f5; border-radius: 11px; padding: 3px; margin: 8px 0; }
.seg-btn { flex: 1; border: none; background: none; padding: 8px 4px; font-size: 15px; font-weight: 600; color: var(--ink2); border-radius: 8px; cursor: pointer; }
.seg-btn.on { background: var(--slip); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(20,40,60,.15); }
.seg.small .seg-btn { font-size: 14px; padding: 7px 4px; }

/* ---------- 确认页 ---------- */
.big-field { display: block; margin-top: 9px; font-size: 13px; letter-spacing: .14em; color: var(--faint); font-weight: 700; position: relative; }
.big-field input { width: 100%; font-family: var(--mono); font-size: 32px; font-weight: 700; padding: 5px 44px 5px 2px; border: none; border-bottom: 2px solid var(--dash); background: transparent; color: var(--ink); margin-top: 1px; font-variant-numeric: tabular-nums; }
.big-field input:focus { outline: none; border-bottom-color: var(--brand); }
.conf-warn { font-size: 13px; color: #b45309; background: #fdf6e3; border-radius: 8px; padding: 8px 10px; margin-top: 10px; line-height: 1.5; }
.big-field input.warn { border-bottom-color: var(--amber); background: #fdf6e3; }
.big-field .unit { position: absolute; right: 2px; bottom: 11px; font-size: 12.5px; color: var(--faint); letter-spacing: .03em; }
.unit-select { position: absolute; right: 0; bottom: 10px; font-size: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.small-field { display: block; font-size: 13px; letter-spacing: .1em; color: var(--faint); font-weight: 700; margin-top: 9px; }
.small-field input { display: block; width: 100%; min-width: 0; height: 46px; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 5px; color: var(--ink); text-align: left; }
.small-field input[type="datetime-local"] { -webkit-appearance: none; appearance: none; max-width: 100%; display: flex; align-items: center; }
.small-field input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.chips-label { font-size: 13px; color: var(--faint); font-weight: 700; letter-spacing: .1em; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 17px; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--ink2); }
.chip.on { background: rgba(66,165,245,.10); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.more-fields { margin-top: 12px; border-top: 1px solid #e3e8ec; padding-top: 4px; }
/* 确认页·饮食：菜品行（菜名＋碳水＋删除）与总碳水行 */
#dish-list { margin-top: 12px; }
.dish-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dish-row .dish-name { flex: 1; min-width: 0; height: 46px; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.dish-row .dish-carbs { width: 74px; height: 46px; font-size: 16px; font-family: var(--mono); padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.dish-row .dish-unit { font-size: 12px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.dish-row .dish-del { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink2); font-size: 14px; cursor: pointer; }
#btn-add-dish { margin-top: 12px; }
.lab-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lab-row .lab-name { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.lab-row .lab-value { width: 92px; height: 46px; font-size: 16px; font-family: var(--mono); padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.lab-row .lab-unit { font-size: 12px; color: var(--faint); font-weight: 600; white-space: nowrap; min-width: 40px; }
.lab-row .lab-del { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink2); font-size: 14px; cursor: pointer; }
.lab-add-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.lab-add-select { flex: 1; min-width: 0; height: 46px; font-size: 15px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.lab-add-row .mini-btn:disabled, .lab-add-select:disabled { opacity: .45; }
.food-total { margin-top: 14px; font-size: 15px; color: var(--ink2); }
.food-total b { font-family: var(--mono); font-size: 19px; color: var(--ink); }
.food-total .food-est { font-size: 12.5px; color: var(--faint); margin-left: 6px; }
/* 医生页·饮食清单行 */
.meal-line { display: flex; gap: 10px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid #e3e8ec; line-height: 1.55; }
.meal-line .ml-when { flex: none; color: var(--faint); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.meal-line .ml-slot { flex: none; font-weight: 700; }
.meal-line .ml-dishes { flex: 1; min-width: 0; color: var(--ink2); }
.meal-line .ml-carbs { flex: none; font-family: var(--mono); font-weight: 700; }
.error-panel { background: #fdf3f2; border: 1px solid #f0c6c2; border-radius: 12px; padding: 15px; margin-top: 12px; font-size: 14.5px; line-height: 1.65; }
.error-panel .row { margin-top: 10px; }
.error-panel .hint { margin-top: 10px; font-size: 12.5px; }

/* ---------- 趋势 ---------- */
.chart-card { padding-bottom: 8px; }
#chart-canvas { width: 100%; height: 210px; display: block; margin-top: 10px; border: 1px solid #e6ebee; border-radius: 6px;
  background: repeating-linear-gradient(0deg, transparent 0 20px, #eef3f7 20px 21px), repeating-linear-gradient(90deg, transparent 0 20px, #eef3f7 20px 21px), var(--slip); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); padding: 10px 2px 4px; }
.chart-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.stat-grid .cell { background: var(--slip); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; box-shadow: 0 1px 2px rgba(20,40,60,.06); }
.stat-grid .k { font-size: 11px; letter-spacing: .16em; color: var(--faint); font-weight: 700; }
.stat-grid .v { font-family: var(--mono); font-size: 21px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.trend-text { font-size: 14.5px; line-height: 1.7; color: var(--ink2); background: var(--slip); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; margin-top: 12px; box-shadow: 0 1px 2px rgba(20,40,60,.06); }

/* ---------- 就诊小结 ---------- */
.doctor-card h3 { font-size: 18px; font-weight: 900; letter-spacing: .04em; }
.doctor-card .meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); line-height: 1.8; margin-top: 7px; letter-spacing: .02em; }
.doctor-card h4 { font-size: 12px; letter-spacing: .24em; color: var(--ink); font-weight: 800; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin: 20px 0 4px; display: flex; justify-content: space-between; }
.doctor-card h4 span { color: var(--faint); letter-spacing: .03em; font-weight: 600; font-family: var(--mono); font-size: 11.5px; }
.doctor-card table { width: 100%; border-collapse: collapse; }
.doctor-card td { padding: 9px 0; font-size: 14.5px; border-bottom: 1px solid #e3e8ec; }
.doctor-card td:last-child { text-align: right; font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.doctor-card td:first-child { color: var(--ink2); }
.doctor-card .trend { font-size: 13.5px; line-height: 1.7; color: var(--ink2); background: #f2f6f9; border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.doctor-card .foot { font-size: 11.5px; color: var(--faint); line-height: 1.75; border-top: 1px solid #e3e8ec; margin-top: 18px; padding-top: 11px; }
.kpi-row { display: flex; border-top: 1px solid #e3e8ec; border-bottom: 1px solid #e3e8ec; padding: 11px 0; margin-top: 13px; }
.kpi-row > div { flex: 1; text-align: center; }
.kpi-row .n { font-family: var(--mono); font-size: 19px; font-weight: 700; }
.kpi-row .l { font-size: 10.5px; color: var(--faint); letter-spacing: .14em; margin-top: 2px; font-weight: 700; }

/* ---------- 加载 ---------- */
.loading-mask { position: fixed; inset: 0; background: rgba(255,255,255,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 50; font-size: 15px; color: var(--ink2); }
.spinner { width: 38px; height: 38px; border: 3.5px solid var(--dash); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 首页框架：双层筛选钉顶 ---------- */
.top-actions { display: flex; align-items: center; gap: 16px; }
.summary-entry { font-size: 14.5px; font-weight: 600; color: var(--brand-dark); cursor: pointer; white-space: nowrap; }
/* 筛选层＝顶部固定块第二层：上下留白等距 11px、总高 106px、底部发丝线 */
.filters { padding: 11px 16px; background: #fff; position: relative; }
.filters::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; border-bottom: 0.5px solid #d3d9de; }
/* 筛选区范围规定（2026-11-27 定）：只装两行、总高恒定 106px、行内横滑不换行，为将来吸顶预留 */
.filters .pchip, .filters .chip { height: 38px; display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; flex: none; }
.personrow { display: flex; align-items: center; gap: 8px; }
.bigname { font-size: 26px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; flex: none; }
.add-role-text { flex: none; background: none; border: none; color: var(--brand-dark); font-size: 13.5px; font-weight: 600; padding: 4px 2px; cursor: pointer; white-space: nowrap; }
.circles { display: flex; gap: 8px; flex: 1; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
.circles .pmini:first-child { margin-left: auto; }
.circles::-webkit-scrollbar { display: none; }
.pmini { height: 34px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink2); font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; padding: 0 13px; flex: none; cursor: pointer; white-space: nowrap; }
.chips-inline { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips-inline::-webkit-scrollbar { display: none; }
#view-home { padding-bottom: 28px; }
.feed-more { text-align: center; color: var(--faint); font-size: 12px; letter-spacing: .3em; padding: 18px 0 6px; }

/* ---------- 拍照记录按钮（页面流内全宽条，图名行下方；2026-11-28 Henry 定 A 案，原底部悬浮药丸已废） ---------- */
.photo-bar { width: 100%; height: 54px; margin: 14px 0 2px;
  background: var(--brand); color: #fff; border: none; border-radius: 14px;
  font-size: 17px; font-weight: 800; letter-spacing: .12em; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(30,90,150,.22); display: flex; align-items: center; justify-content: center; gap: 9px; }
.fab-cam { display: block; flex: none; }
.photo-bar:active { background: var(--brand-dark); }

/* ---------- 草稿恢复横条（图卡区下方、拍照条上方；审计 F3） ---------- */
/* 品牌蓝系浅底：底 #eef6fd 与边 #d9eefd 都是站内既有值（备注签选中底/血糖色柱浅底），不新造色 */
.draft-banner { width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #eef6fd; border: 1px solid #d9eefd; color: var(--brand-dark);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 700; cursor: pointer; text-align: left; }
.draft-banner .db-arrow { font-size: 17px; font-weight: 800; flex: none; }
.draft-banner:active { background: #d9eefd; }

/* ---------- 保存反馈 toast（审计 F4，全站单例，约 2.5 秒自动消失） ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70;
  background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 600; line-height: 1.45;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(20,40,60,.25);
  max-width: calc(100vw - 32px); text-align: center; }
/* 撤销条在场时 toast 抬高一格，两者不叠 */
.toast.above-undo { bottom: calc(86px + env(safe-area-inset-bottom)); }

/* ---------- 删除撤销条（审计 F6：每条待删一根、可叠放、各带自己的撤销按钮、停留 6 秒） ---------- */
.undo-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 65;
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.undo-bar-item { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 14px; white-space: nowrap;
  font-size: 14.5px; font-weight: 600; padding: 8px 8px 8px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(20,40,60,.25); max-width: calc(100vw - 32px); }
.undo-bar-item button { background: var(--brand); color: #fff; border: none; border-radius: 999px; padding: 8px 16px; font-size: 14.5px; font-weight: 700; cursor: pointer; flex: none; }
.undo-bar-item button:active { background: var(--brand-dark); }

/* ---------- 拍照来源菜单（自己的两项：拍照 / 从相册选） ---------- */
.picker-mask { position: fixed; inset: 0; background: rgba(38,50,56,.38); z-index: 60; display: flex; align-items: flex-end; }
.picker-sheet { background: #fff; width: 100%; border-radius: 20px 20px 0 0; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); animation: sheet-up .18s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.picker-row { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: none; border-bottom: 0.5px solid #e3e8ec; padding: 15px 6px; font-size: 17px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.picker-hero { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; background: none; border: none; border-bottom: 0.5px solid #e3e8ec; padding: 18px 6px 16px; cursor: pointer; }
.hero-circle { width: 78px; height: 78px; border-radius: 50%; background: #42A5F5; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(66,165,245,.35); }
.picker-hero:active .hero-circle { transform: scale(.96); }
.hero-label { font-size: 17px; font-weight: 700; color: #1976d2; }
.picker-cancel { display: block; width: 100%; margin-top: 10px; background: #f2f6f9; border: none; border-radius: 12px; padding: 13px; font-size: 16px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.form-sheet { padding: 18px 18px calc(12px + env(safe-area-inset-bottom)); }
.sheet-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.picker-album, .picker-manual { display: block; flex: none; }

/* ---------- 确认页归属行（先拍后认领） ---------- */
.attr-row { display: flex; align-items: center; gap: 8px; background: rgba(66,165,245,.08); border: 1.5px solid var(--brand); border-radius: 10px; padding: 9px 13px; margin-top: 2px; }
.attr-text { font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.attr-btn { margin-left: auto; background: none; border: none; color: var(--brand-dark); font-size: 13.5px; font-weight: 700; cursor: pointer; padding: 4px 2px; white-space: nowrap; }
.attr-profiles { margin-top: 10px; }
