/* 二级页面「更多记录」 */
.back-btn { text-decoration: none; font-size: 2rem; line-height: 1; display: grid; place-items: center; color: var(--ink); }
.m-title { flex: 1; text-align: center; font-size: 1.1rem; margin: 0; }
#tabs { margin-bottom: 12px; }

/* 首页入口九宫格 */
.m-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.m-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 84px;
  border: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); padding: 12px; cursor: pointer; color: var(--ink); text-decoration: none;
}
.m-tile .t-emoji { font-size: 1.5rem; line-height: 1; }
.m-tile .t-name { font-weight: 700; margin-top: 4px; }
.m-tile .t-hint { color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.m-tile.is-alert { box-shadow: 0 0 0 2px #f2b8ae, var(--shadow); }
.m-tile.is-alert .t-hint { color: var(--warn); font-weight: 600; }
/* 分组里单数个入口时，最后一个占满一行 */
.m-grid > .m-tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 64px; }
.m-section-h { font-size: 0.95rem; margin: 18px 0 8px; color: var(--muted); }

/* 卡片 */
.m-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 12px; }
.m-card h3 { margin: 0 0 8px; font-size: 1rem; }
.m-note { margin: 8px 0 0; line-height: 1.55; }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.m-actions .btn { flex: 1 1 auto; min-width: 120px; }
.m-big .label { color: var(--muted); font-size: 0.85rem; }
.m-big .value { font-size: 1.8rem; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.m-big .sub { color: var(--muted); font-size: 0.85rem; white-space: pre-line; }
.m-big.is-danger .value, .m-big.is-high .value { color: var(--warn); }
.m-big.is-ok .value { color: var(--ok); }

/* 提示条 */
.tip { border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; font-size: 0.9rem; line-height: 1.5; }
.tip-danger { background: #c0392b; color: #fff; font-weight: 600; }
.tip-high { background: #fde4e1; color: #8e2a1f; }
.tip-warm { background: #fff1c9; color: #7a5200; }
.tip-low { background: #e5f0ff; color: #1f4f8a; }
.tip-ok { background: #e3f4e8; color: #22603a; }
.tip-info { background: #f6efe9; color: #6b574c; }
.flag.ok { background: #e3f4e8; color: var(--ok); }
.flag.warm { background: #fff1c9; color: #7a5200; }

/* 清单（疫苗/体检/里程碑/复查） */
.plan { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.plan:first-of-type { border-top: 0; }
.plan .p-main { flex: 1; min-width: 0; }
.plan .p-name { font-weight: 600; overflow-wrap: anywhere; }
.plan .p-sub { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.plan .btn { min-height: 38px; padding: 6px 12px; flex: none; }
.plan.is-done .p-name { color: var(--ok); }
.plan.is-overdue .p-sub { color: var(--warn); font-weight: 600; }
.plan.is-due .p-sub, .plan.is-soon .p-sub { color: #9a6a00; font-weight: 600; }
.plan-group { margin: 14px 0 2px; font-size: 0.85rem; color: var(--muted); font-weight: 700; }

/* 进度条 */
.bar { height: 12px; border-radius: 999px; background: #f3e7df; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #7fb7ef, #4a90d9); border-radius: 999px; }

/* 一键按钮组 */
.m-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-quick button {
  border: 0; border-radius: 14px; background: #fff4ee; padding: 10px 4px; min-height: 64px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.85rem; color: var(--ink);
}
.m-quick button .q-emoji { font-size: 1.3rem; }
.m-quick button .q-n { color: var(--muted); font-size: 0.72rem; }
.m-quick.three { grid-template-columns: repeat(3, 1fr); }
.m-quick.five { grid-template-columns: repeat(5, 1fr); }

/* EPDS 问卷 */
.epds-q { margin: 14px 0; }
.epds-q .q { font-weight: 600; margin-bottom: 6px; }
.epds-q .chips { flex-direction: column; align-items: stretch; }
.epds-q .chips button { text-align: left; border-radius: 12px; }

/* 用药计划编辑 */
.plan-edit { display: grid; grid-template-columns: 1fr 1fr 72px 40px; gap: 6px; align-items: center; margin: 6px 0; }
.plan-edit input, .plan-edit select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: #fffdfb; width: 100%; font-size: 0.95rem; }
.plan-edit .icon-btn { min-width: 40px; min-height: 40px; font-size: 1.1rem; }

.chart-box { position: relative; width: 100%; margin-top: 6px; }
.seg { display: flex; gap: 6px; margin-bottom: 8px; }

@media (max-width: 360px) {
  .m-quick { grid-template-columns: repeat(3, 1fr); }
  .m-quick.five { grid-template-columns: repeat(3, 1fr); }
  .plan-edit { grid-template-columns: 1fr 1fr 64px 36px; }
}

/* 动态血糖 */
.cgm-tir { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: #f3e7df; margin-top: 4px; }
.cgm-tir > i { display: block; height: 100%; min-width: 2px; }
.cgm-tir-legend { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.88rem; line-height: 1.7; }
.cgm-preview { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 6px; font-size: 0.92rem; }
.cgm-preview dt { color: var(--muted); }
.cgm-preview dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.cgm-sub { font-size: 0.88rem; margin: 12px 0 2px; color: var(--muted); }
.cgm-sub:first-of-type { margin-top: 2px; }
.cgm-cp { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; margin-top: 6px; }
.cgm-cp th, .cgm-cp td { padding: 7px 4px; border-top: 1px solid var(--line); text-align: left; }
.cgm-cp thead th { color: var(--muted); font-weight: 600; border-top: 0; font-size: 0.8rem; }
.cgm-cp tbody th { font-weight: 500; }
.hm-pick { display: flex; gap: 8px; }
.hm-pick select { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: #fffdfb; font-size: 1rem; }
