/* 家属端：微信里点开的一条链接，手机宽度优先。
   一个老人、一页从上到下：今天怎么样 → 今晚安排 → 护理记录 → 探视时间 → 回执 → 待确认 → 当班的人。
   语气克制：没记录就写没记录，不替系统承诺它没做过的事。 */

.f-page {
  flex: 1 1 auto;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  color: var(--ink);
}
@media (min-width: 520px) {
  .f-page { box-shadow: 0 0 0 1px var(--line); }
}

/* ── 顶部一条，说明这是哪里 ── */
.f-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--clay-soft);
  border-bottom: 1px solid var(--line);
  color: var(--clay-deep);
}
.f-bar b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 4px;
}
.f-bar span {
  font-size: 13px;
  letter-spacing: 1px;
}

.f-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 14px 36px;
  padding: 14px 14px calc(36px + env(safe-area-inset-bottom));
}

/* ── 姓名与日期 ── */
.f-head {
  padding: 4px 2px 0;
}
.f-name {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.3;
}
.f-meta {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

/* ── 卡片与标签 ── */
.f-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
}
.f-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--clay);
}
.f-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
  word-break: break-word;
}
.f-none {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}
.f-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.f-center {
  padding: 60px 0;
  text-align: center;
}

/* ── 护理记录时间线 ── */
.f-tl {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}
.f-tl-i {
  display: grid;
  grid-template-columns: 8px 42px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px dashed var(--line-2);
}
.f-tl-i:first-child {
  border-top: 0;
  padding-top: 2px;
}
.f-tl-dot {
  width: 7px;
  height: 7px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--clay);
}
.f-k-meal .f-tl-dot { background: var(--amber); }
.f-k-vital .f-tl-dot { background: var(--blue); }
.f-k-rest .f-tl-dot { background: var(--faint); }
.f-k-act .f-tl-dot { background: var(--clay); }
.f-k-talk .f-tl-dot { background: var(--clay-deep); }
.f-tl-t {
  padding-top: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.f-tl-x {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  word-break: break-word;
}
.f-k-talk .f-tl-x {
  color: var(--clay-deep);
}

/* ── 探视时间 ── */
.f-visit {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .5px;
}
.f-flag {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--amber-s);
  color: var(--amber);
  font-size: 13.5px;
  line-height: 1.6;
}
.f-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── 按钮 ── */
.f-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--clay);
  border-radius: 9px;
  background: var(--clay);
  color: #FFF6EE;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
.f-btn:active {
  background: var(--clay-deep);
  border-color: var(--clay-deep);
}
.f-btn:focus-visible {
  outline: 3px solid var(--clay-deep);
  outline-offset: 2px;
}
.f-btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.f-btn-ghost:active {
  background: var(--paper-2);
  border-color: var(--line);
}
.f-btn-quiet {
  min-height: 38px;
  background: rgba(255, 253, 248, .6);
  color: var(--clay-deep);
  border-color: #D9BEAC;
}

/* ── 回执 ── */
.f-readback {
  border: 1px solid #E7CDB8;
  border-radius: 14px;
  background: var(--clay-soft);
  color: var(--clay-deep);
  padding: 14px 16px;
}
.f-readback-x {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.75;
  word-break: break-word;
}
.f-readback .f-btn-quiet {
  margin-top: 10px;
}

/* ── 待确认 ── */
.f-pend {
  background: #FFFBF0;
  border-color: #E6D3AF;
}
.f-pend .f-kicker {
  color: var(--amber);
}
.f-quote {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  word-break: break-word;
}
.f-conflict {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
}
.f-pend-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.f-pend-actions .f-btn {
  flex: 1;
}

/* ── 当班的人 ── */
.f-staff {
  display: flex;
  align-items: center;
  gap: 12px;
}
.f-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clay-soft);
  color: var(--clay-deep);
  font-size: 19px;
  font-weight: 600;
}
.f-staff-info {
  min-width: 0;
}
.f-staff-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.f-staff-meta {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* ── 页脚 ── */
.f-foot {
  margin: 2px 4px 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ── 空状态 ── */
.f-empty {
  margin-top: 44px;
  text-align: center;
}
.f-empty h1 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.4;
}
.f-empty p {
  margin: 0 auto;
  max-width: 20em;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}
.f-empty .f-btn {
  margin-top: 16px;
}

/* ── 底部弹层：改探视时间 ── */
.f-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(42, 35, 29, .42);
  animation: f-fade .14s ease-out;
}
.f-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 61;
  width: min(480px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 12px 18px 18px;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  animation: f-rise .18s ease-out;
}
.f-sheet-bar {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 3px;
  background: var(--line);
}
.f-sheet-title {
  margin: 0 0 4px;
  font-size: 19px;
  line-height: 1.4;
}
.f-sheet-sub {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.f-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
.f-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 54px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
.f-opt:active {
  border-color: var(--clay);
}
.f-opt:focus-visible {
  outline: 3px solid var(--clay-deep);
  outline-offset: 2px;
}
.f-opt.is-cur {
  background: var(--clay-soft);
  border-color: #D9BEAC;
  color: var(--clay-deep);
  font-weight: 600;
}
.f-opt-cur {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--clay);
}
.f-sheet-form {
  margin-top: 16px;
}
.f-sheet-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.f-sheet-row {
  display: flex;
  gap: 8px;
}
.f-sheet-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  outline: none;
}
.f-sheet-input:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(158, 91, 55, .12);
}
.f-sheet-row .f-btn {
  min-height: 46px;
}
.f-sheet-cancel {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
}
.f-sheet-cancel:active {
  color: var(--ink);
}

@keyframes f-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes f-rise {
  from { transform: translateX(-50%) translateY(16px); opacity: .5; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .f-scrim,
  .f-sheet { animation: none; }
}
