This commit is contained in:
2026-07-19 19:45:32 +08:00
parent b68bfc6287
commit bbfc055c21
12 changed files with 910 additions and 431 deletions
+68 -5
View File
@@ -1,3 +1,5 @@
import Link from "next/link";
import { MedicationForm, MemoForm, TaskActions, TaskForm } from "@/components/family-guard-actions";
import { PanelShell } from "@/components/panel-shell";
import { requireFamilyWorkspace } from "@/lib/family-page";
@@ -6,10 +8,71 @@ import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
export const dynamic = "force-dynamic";
export default async function CarePage({ searchParams }: PageProps<"/care">) {
const caregiver = await requireCaregiverSession("/care"); const workspace = await requireFamilyWorkspace(caregiver.id); const tab = String((await searchParams).tab || "tasks"); const uuid = workspace.elderProfile.elderDevice.deviceUuid;
return <PanelShell currentPath="/care" title="共同照护" description="家人分工、老人确认、结果共享" caregiverLabel={getCaregiverDisplayName(caregiver)}>
<div className="segment"><a className={tab === "tasks" ? "active" : ""} href="/care?tab=tasks">任务</a><a className={tab === "medications" ? "active" : ""} href="/care?tab=medications">用药</a><a className={tab === "memos" ? "active" : ""} href="/care?tab=memos">备忘</a></div>
{tab === "medications" ? <><MedicationForm deviceUuid={uuid} /><section><div className="section-title"><h2>用药计划</h2><span>仅提醒与记录,不替代医嘱</span></div><div className="card">{workspace.medicationPlans.length ? workspace.medicationPlans.map((plan) => <article className="timeline-item" key={plan.id}><div className="timeline-top">{plan.name}<span className="tag">{plan.active ? "进行中" : "已暂停"}</span></div><p className="timeline-body">每次 {plan.dosage} · {JSON.parse(plan.timesJson).join("、")}{plan.instructions ? ` · ${plan.instructions}` : ""}</p><p className="row-meta">信息来源:{plan.source === "PRESCRIPTION" ? "医生处方" : plan.source === "PACKAGE_LABEL" ? "药盒标签" : "家属录入"}</p></article>) : <div className="empty">还没有用药计划。</div>}</div></section></> : tab === "memos" ? <><MemoForm deviceUuid={uuid} /><section><div className="section-title"><h2>家庭备忘录</h2></div><div className="card">{workspace.memos.length ? workspace.memos.map((memo) => <article className="timeline-item" key={memo.id}><div className="timeline-top">{memo.title}<span className="tag">{memo.priority === "PINNED" ? "长期置顶" : memo.priority === "IMPORTANT" ? "重要" : "普通"}</span></div><p className="timeline-body">{memo.content}</p><p className="row-meta">{memo.visibility === "FAMILY_ONLY" ? "仅家人可见" : "可由数字人告诉长辈"}</p></article>) : <div className="empty">还没有家庭备忘。</div>}</div></section></> : <><TaskForm deviceUuid={uuid} /><section><div className="section-title"><h2>照护交接</h2></div><div className="card">{workspace.tasks.length ? workspace.tasks.map((task) => <article className="timeline-item" key={task.id}><div className="timeline-top">{task.title}<span className="timeline-time">{task.dueAt ? formatDateTime(task.dueAt) : "未设期限"}</span></div><p className="timeline-body">{task.description || "等待家人认领"}</p><p className="row-meta">{task.assignedTo ? `负责人:${task.assignedTo.nickname || task.assignedTo.username || "家人"}` : "尚未认领"}</p><TaskActions taskId={task.id} status={task.status} /></article>) : <div className="empty">还没有照护任务。</div>}</div></section></>}
</PanelShell>;
const caregiver = await requireCaregiverSession("/care");
const workspace = await requireFamilyWorkspace(caregiver.id);
const tab = String((await searchParams).tab || "tasks");
const deviceUuid = workspace.elderProfile.elderDevice.deviceUuid;
return (
<PanelShell currentPath="/care" title="共同照护" description="家人分工、老人确认、结果共享" caregiverLabel={getCaregiverDisplayName(caregiver)} caregiverId={caregiver.id}>
<div className="segment">
<Link className={tab === "tasks" ? "active" : ""} href="/care?tab=tasks">任务</Link>
<Link className={tab === "medications" ? "active" : ""} href="/care?tab=medications">用药</Link>
<Link className={tab === "memos" ? "active" : ""} href="/care?tab=memos">备忘</Link>
</div>
{tab === "medications" ? (
<>
<MedicationForm deviceUuid={deviceUuid} />
<section>
<div className="section-title"><h2>用药计划</h2><span>仅提醒与记录,不替代医嘱</span></div>
<div className="card">
{workspace.medicationPlans.length ? workspace.medicationPlans.map((plan) => (
<article className="timeline-item" key={plan.id}>
<div className="timeline-top strong">{plan.name}<span className="tag">{plan.active ? "进行中" : "已暂停"}</span></div>
<p className="timeline-body">每次 {plan.dosage} · {JSON.parse(plan.timesJson).join("、")}{plan.instructions ? ` · ${plan.instructions}` : ""}</p>
<p className="row-meta">信息来源:{plan.source === "PRESCRIPTION" ? "医生处方" : plan.source === "PACKAGE_LABEL" ? "药盒标签" : "家属录入"}</p>
</article>
)) : <div className="empty">还没有用药计划。</div>}
</div>
</section>
</>
) : tab === "memos" ? (
<>
<MemoForm deviceUuid={deviceUuid} />
<section>
<div className="section-title"><h2>家庭备忘录</h2></div>
<div className="card">
{workspace.memos.length ? workspace.memos.map((memo) => (
<article className="timeline-item" key={memo.id}>
<div className="timeline-top strong">{memo.title}<span className="tag">{memo.priority === "PINNED" ? "长期置顶" : memo.priority === "IMPORTANT" ? "重要" : "普通"}</span></div>
<p className="timeline-body">{memo.content}</p>
<p className="row-meta">{memo.visibility === "FAMILY_ONLY" ? "仅家人可见" : "可由数字人告诉长辈"}</p>
</article>
)) : <div className="empty">还没有家庭备忘。</div>}
</div>
</section>
</>
) : (
<>
<TaskForm deviceUuid={deviceUuid} />
<section>
<div className="section-title"><h2>照护交接</h2><span>认领后全家可见</span></div>
<div className="card">
{workspace.tasks.length ? workspace.tasks.map((task) => (
<article className="timeline-item" key={task.id}>
<div className="timeline-top strong">{task.title}<span className="timeline-time">{task.dueAt ? formatDateTime(task.dueAt) : "未设期限"}</span></div>
<p className="timeline-body">{task.description || "等待家人认领"}</p>
<p className="row-meta">{task.assignedTo ? `负责人:${task.assignedTo.nickname || task.assignedTo.username || "家人"}` : "尚未认领"}</p>
<TaskActions taskId={task.id} status={task.status} />
</article>
)) : <div className="empty">还没有照护任务。</div>}
</div>
</section>
</>
)}
</PanelShell>
);
}
+63 -3
View File
@@ -1,8 +1,68 @@
import { ChevronRight, Heart, MessageCircle, MessagesSquare } from "lucide-react";
import Link from "next/link";
import { BookHeart, MessageCircle, MessagesSquare } from "lucide-react";
import { PanelShell } from "@/components/panel-shell";
import { requireFamilyWorkspace as getFamilyWorkspace } from "@/lib/family-page";
import { getCaregiverMessages } from "@/lib/caregiver-panel";
import { requireFamilyWorkspace } from "@/lib/family-page";
import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
export default async function CompanionPage() { const caregiver = await requireCaregiverSession("/companion"); const workspace = await getFamilyWorkspace(caregiver.id); return <PanelShell currentPath="/companion" title="温暖陪伴" description="留言、回忆和每一次认真回应" caregiverLabel={getCaregiverDisplayName(caregiver)}><div className="card"><Link className="list-row" href="/messages"><MessageCircle /><span className="row-main"><span className="row-title">双向留言</span><span className="row-meta">家人问候由数字人口播,长辈口述实时送达</span></span></Link><Link className="list-row" href="/activity"><MessagesSquare /><span className="row-main"><span className="row-title">陪伴动态</span><span className="row-meta">查看数字人对话和智能服务记录</span></span></Link><div className="list-row"><BookHeart /><span className="row-main"><span className="row-title">家庭记忆册</span><span className="row-meta">数据结构已预留,作为下一阶段增强功能</span></span></div></div><section className="card card-pad"><h2 style={{ marginTop: 0 }}>本周家庭连接</h2><p className="timeline-body">家庭发布了 {workspace.posts.length} 条动态,留下 {workspace.memos.length} 条共同记忆与备忘。</p></section></PanelShell>; }
export const dynamic = "force-dynamic";
export default async function CompanionPage() {
const caregiver = await requireCaregiverSession("/companion");
const [workspace, messageOverview] = await Promise.all([
requireFamilyWorkspace(caregiver.id),
getCaregiverMessages(caregiver.id),
]);
return (
<PanelShell
currentPath="/companion"
title="温暖陪伴"
description="留言、回忆和每一次认真回应"
caregiverLabel={getCaregiverDisplayName(caregiver)}
unreadCount={messageOverview.unreadIncomingCount}
>
<section className="card">
<Link className="list-row feature-row" href="/messages">
<span className="feature-icon"><MessageCircle size={19} strokeWidth={1.8} /></span>
<span className="row-main">
<span className="row-title">双向留言</span>
<span className="row-meta">家人问候由数字人口播,长辈口述实时送达</span>
</span>
<span style={{ display: "flex", alignItems: "center", gap: 6 }}>
{messageOverview.unreadIncomingCount > 0 ? <span className="count-badge">{messageOverview.unreadIncomingCount}</span> : null}
<ChevronRight className="chevron" size={16} strokeWidth={2} />
</span>
</Link>
<Link className="list-row feature-row" href="/activity">
<span className="feature-icon olive"><MessagesSquare size={19} strokeWidth={1.8} /></span>
<span className="row-main">
<span className="row-title">陪伴动态</span>
<span className="row-meta">查看数字人对话和智能服务记录</span>
</span>
<ChevronRight className="chevron" size={16} strokeWidth={2} />
</Link>
<div className="list-row feature-row feature-disabled">
<span className="feature-icon muted"><Heart size={19} strokeWidth={1.8} /></span>
<span className="row-main">
<span className="row-title">家庭记忆册</span>
<span className="row-meta">收藏长辈的语音与照片故事</span>
</span>
<span className="member-role">即将上线</span>
</div>
</section>
<section>
<div className="section-title"><h2>本周家庭连接</h2></div>
<div className="stats" style={{ gridTemplateColumns: "repeat(3, 1fr)" }}>
<div className="stat accent"><strong>{workspace.posts.length}</strong><span>家庭动态</span></div>
<div className="stat"><strong>{workspace.memos.length}</strong><span>共同备忘</span></div>
<div className="stat"><strong>{messageOverview.messages.length}</strong><span>留言往来</span></div>
</div>
<p className="muted-note" style={{ margin: "10px 2px 0" }}>数字人每天会把家人的问候念给长辈听,长辈的回应会同步到留言板。</p>
</section>
</PanelShell>
);
}
+67 -8
View File
@@ -6,13 +6,72 @@ import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
export const dynamic = "force-dynamic";
const roleLabel = { ADMIN: "管理员", CAREGIVER: "照护成员", CARING: "关怀成员" } as const;
const avatarStyles = [
{ background: "rgba(192,90,30,.1)", color: "var(--accent)" },
{ background: "rgba(101,118,90,.12)", color: "var(--olive)" },
{ background: "rgba(33,30,26,.06)", color: "var(--muted)" },
];
export default async function FamilyPage() {
const caregiver = await requireCaregiverSession("/family"); const workspace = await requireFamilyWorkspace(caregiver.id); const deviceUuid = workspace.elderProfile.elderDevice.deviceUuid;
const roleLabel = { ADMIN: "管理员", CAREGIVER: "照护成员", CARING: "关怀成员" } as const;
return <PanelShell currentPath="/family" title={workspace.name} description={`${workspace.memberships.length} 位家人共同参与`} caregiverLabel={getCaregiverDisplayName(caregiver)}>
<FamilyPostForm deviceUuid={deviceUuid} />
<section><div className="section-title"><h2>家庭动态</h2></div><div className="card">{workspace.posts.length ? workspace.posts.map((post) => <article key={post.id} className="timeline-item"><div className="timeline-top">{post.elderAuthored ? `${workspace.elderProfile.preferredName}通过安智伴说` : post.author?.nickname || post.author?.username || "家里人"}<span className="timeline-time">{formatDateTime(post.createdAt)}</span></div><p className="timeline-body">{post.content}</p><span className="tag">{post.visibility === "FAMILY_ONLY" ? "仅家人" : post.visibility === "ELDER_ONLY" ? "只给长辈" : "全家可见"}</span></article>) : <div className="empty">发出第一条家庭动态,让关心流动起来。</div>}</div></section>
<section><div className="section-title"><h2>家庭成员</h2></div><div className="card">{workspace.memberships.map((member) => <div key={member.id} className="list-row"><span className="avatar">{(member.caregiver.nickname || member.caregiver.username || "家").slice(-1)}</span><span className="row-main"><span className="row-title">{member.caregiver.nickname || member.caregiver.username || "家庭成员"}{member.relationLabel ? ` · ${member.relationLabel}` : ""}</span><span className="row-meta">{roleLabel[member.role]}{member.dutyOrder ? ` · 值守顺序 ${member.dutyOrder}` : ""}</span></span></div>)}</div></section>
<section><div className="section-title"><h2>邀请家人</h2><span>链接 24 小时有效</span></div><InviteMemberForm deviceUuid={deviceUuid} /></section>
</PanelShell>;
const caregiver = await requireCaregiverSession("/family");
const workspace = await requireFamilyWorkspace(caregiver.id);
const deviceUuid = workspace.elderProfile.elderDevice.deviceUuid;
return (
<PanelShell
currentPath="/family"
title={workspace.name}
description={`${workspace.memberships.length} 位家人共同参与`}
caregiverLabel={getCaregiverDisplayName(caregiver)}
caregiverId={caregiver.id}
>
<FamilyPostForm deviceUuid={deviceUuid} />
<section>
<div className="section-title"><h2>家庭动态</h2></div>
<div className="card">
{workspace.posts.length ? workspace.posts.map((post) => (
<article key={post.id} className="timeline-item">
<div className="timeline-top">
{post.elderAuthored ? `${workspace.elderProfile.preferredName}通过安智伴说` : post.author?.nickname || post.author?.username || "家里人"}
<span className="timeline-time">{formatDateTime(post.createdAt)}</span>
</div>
<p className="timeline-body">{post.content}</p>
<span className="tag" style={{ marginTop: 8 }}>
{post.visibility === "FAMILY_ONLY" ? "仅家人" : post.visibility === "ELDER_ONLY" ? "只给长辈" : "全家可见"}
</span>
</article>
)) : <div className="empty">发出第一条家庭动态,让关心流动起来。</div>}
</div>
</section>
<section>
<div className="section-title"><h2>家庭成员</h2></div>
<div className="card">
{workspace.memberships.map((member, index) => {
const name = member.caregiver.nickname || member.caregiver.username || "家庭成员";
return (
<div key={member.id} className="list-row" style={{ alignItems: "center" }}>
<span className="member-avatar" style={avatarStyles[index % avatarStyles.length]}>{name.slice(-1)}</span>
<span className="row-main">
<span className="row-title">{name}</span>
<span className="row-meta">
{member.relationLabel || "家人"}{member.dutyOrder ? ` · 值守顺序 ${member.dutyOrder}` : ""}
</span>
</span>
<span className="member-role">{roleLabel[member.role]}</span>
</div>
);
})}
</div>
</section>
<section>
<div className="section-title"><h2>邀请家人</h2><span>链接 24 小时有效</span></div>
<InviteMemberForm deviceUuid={deviceUuid} />
</section>
</PanelShell>
);
}
+159 -82
View File
@@ -1,19 +1,19 @@
@import "tailwindcss";
:root {
--canvas: #e9e7e3;
--paper: #f4f3f1;
--canvas: #e7e4df;
--paper: #f5f4f2;
--surface: #ffffff;
--surface-soft: #faf9f8;
--ink: #201d1a;
--ink: #211e1a;
--ink-soft: #3d3833;
--muted: #8a857e;
--muted-light: #b3aea6;
--line: rgba(32, 29, 26, 0.08);
--line-strong: rgba(32, 29, 26, 0.14);
--muted: #8b857c;
--muted-light: #b5afa6;
--line: rgba(33, 30, 26, 0.08);
--line-strong: rgba(33, 30, 26, 0.15);
--accent: #c05a1e;
--accent-hover: #96431a;
--accent-soft: rgba(192, 90, 30, 0.1);
--accent-soft: rgba(192, 90, 30, 0.09);
--copper: var(--accent);
--copper-deep: var(--accent-hover);
--paper-soft: var(--surface-soft);
@@ -23,7 +23,7 @@
--danger: #b4482c;
--radius-sm: 8px;
--radius-md: 10px;
--radius-lg: 12px;
--radius-lg: 14px;
--font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
--font-display: var(--font-body);
}
@@ -40,6 +40,7 @@ body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
textarea { resize: none; }
*::-webkit-scrollbar { display: none; }
::selection { background: rgba(192, 90, 30, 0.18); }
@@ -52,81 +53,157 @@ textarea { resize: none; }
margin: 0 auto;
overflow: hidden;
background: var(--paper);
box-shadow: 0 0 0 1px rgba(32,29,26,.03);
box-shadow: 0 0 0 1px rgba(33, 30, 26, .03);
}
.app-content { min-height: 100dvh; padding: 14px 14px 84px; }
.app-content.detail { padding-top: 0; padding-bottom: 24px; }
.app-stack { display: flex; flex-direction: column; gap: 12px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:2px 2px 0; }
.page-heading h1 { margin:0; font-size:20px; line-height:1.35; font-weight:700; letter-spacing:.01em; }
.page-heading p { margin:3px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.avatar { display:flex; width:34px; height:34px; flex:none; align-items:center; justify-content:center; border:0; border-radius:50%; background:var(--ink); color:var(--paper); font-size:14px; font-weight:600; }
.detail-header { position:sticky; top:0; z-index:5; display:flex; min-height:54px; align-items:center; gap:6px; padding:10px 0; background:rgba(244,243,241,.96); backdrop-filter:blur(10px); }
.detail-header h1 { margin:0; flex:1; font-size:16px; font-weight:700; }
.back-button { display:flex; width:30px; height:30px; align-items:center; justify-content:center; border:0; background:transparent; color:var(--ink); }
.card { overflow:hidden; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); }
.card-pad { padding:13px 14px; }
.list-row { display:flex; width:100%; align-items:flex-start; gap:10px; padding:11px 14px; border:0; border-top:1px solid var(--line); background:transparent; color:var(--ink); text-align:left; }
.list-row:first-child { border-top:0; }
.list-row:hover { background:var(--surface-soft); }
.row-main { flex:1; min-width:0; }
.row-title { display:block; color:var(--ink); font-size:14px; line-height:1.5; font-weight:600; }
.row-meta { display:flex; align-items:center; gap:6px; margin-top:4px; color:var(--muted); font-size:12px; line-height:1.45; }
.dot { width:7px; height:7px; flex:none; margin-top:6px; border-radius:50%; background:var(--accent); }
.dot.online { background:var(--success); }
.dot.offline { background:#c7c2ba; }
.tag { display:inline-flex; align-items:center; border-radius:4px; padding:1px 5px; background:var(--accent-soft); color:var(--accent); font-size:10px; font-weight:600; }
.section-title { display:flex; align-items:baseline; justify-content:space-between; padding:0 2px 8px; }
.section-title h2 { margin:0; font-size:14px; font-weight:700; }
.section-title a { color:var(--accent); font-size:13px; font-weight:500; }
.stats { display:grid; overflow:hidden; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); }
.stat { padding:11px 4px; text-align:center; }
.stat + .stat { border-left:1px solid var(--line); }
.stat strong { display:block; font-size:20px; line-height:1.2; font-weight:700; }
.stat:first-child strong, .stat.accent strong { color:var(--accent); }
.stat span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.button-row { display:flex; gap:10px; }
.btn { display:inline-flex; min-height:40px; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line-strong); border-radius:var(--radius-md); padding:0 14px; background:var(--surface); color:var(--ink); font-size:13.5px; font-weight:600; }
.btn:hover { background:var(--surface-soft); }
.btn.primary { border-color:var(--accent); background:var(--accent); color:#fff; }
.btn.primary:hover { background:var(--accent-hover); }
.btn.dark { border-color:var(--ink); background:var(--ink); color:#fff; }
.btn.small { min-height:32px; border-radius:8px; padding:0 12px; font-size:13px; }
.btn.block { width:100%; }
.segment { display:flex; padding:2px; border-radius:9px; background:rgba(32,29,26,.06); }
.segment a, .segment button { flex:1; height:30px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:13px; font-weight:600; text-align:center; line-height:30px; }
.segment .active { background:#fff; color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.06); }
.field { width:100%; height:44px; border:1px solid rgba(32,29,26,.12); border-radius:10px; padding:0 13px; outline:0; background:#fff; color:var(--ink); font-size:14px; }
.field:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
textarea.field { height:auto; min-height:84px; padding:9px 11px; line-height:1.5; background:var(--surface-soft); }
.empty { padding:34px 20px; color:var(--muted); text-align:center; font-size:13px; line-height:1.7; }
.muted-note { margin:0; color:var(--muted-light); font-size:11.5px; line-height:1.6; }
.bottom-nav { position:fixed; z-index:20; right:0; bottom:0; left:0; display:grid; grid-template-columns:repeat(4,1fr); width:100%; max-width:430px; margin:0 auto; padding:6px 0 calc(10px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(255,255,255,.96); backdrop-filter:blur(10px); }
.nav-item { position:relative; display:flex; flex-direction:column; align-items:center; gap:3px; padding:4px 0; color:var(--muted); font-size:10px; font-weight:600; }
.nav-item.active { color:var(--accent); }
.nav-badge { position:absolute; top:0; left:calc(50% + 6px); min-width:16px; height:16px; border-radius:8px; padding:0 4px; background:var(--accent); color:#fff; font-size:10px; line-height:16px; text-align:center; }
.device-icon { display:flex; width:40px; height:40px; flex:none; align-items:center; justify-content:center; border-radius:10px; background:rgba(192,90,30,.08); color:var(--accent); }
.timeline-item { padding:11px 14px; border-top:1px solid var(--line); }
.timeline-item:first-child { border-top:0; }
.timeline-top { display:flex; align-items:baseline; gap:8px; color:var(--muted); font-size:12px; font-weight:600; }
.timeline-time { margin-left:auto; color:var(--muted-light); font-size:11.5px; font-weight:400; white-space:nowrap; }
.timeline-body { margin:4px 0 0; color:var(--ink-soft); font-size:13.5px; line-height:1.55; }
.settings-controls > * { border:1px solid var(--line)!important; border-radius:12px!important; background:#fff!important; padding:14px!important; box-shadow:none!important; }
.settings-controls h2, .settings-controls h3 { font-family:var(--font-body)!important; font-size:15px!important; line-height:1.45!important; }
.settings-controls p { font-size:12px!important; line-height:1.65!important; }
.device-manage summary { list-style:none; }
.device-manage[open] summary { margin-bottom:10px; }
.device-manage > :not(summary) { border:1px solid var(--line)!important; border-radius:12px!important; background:#fff!important; padding:14px!important; box-shadow:none!important; }
.scan-panel > div { border:0!important; border-radius:0!important; background:transparent!important; padding:0!important; box-shadow:none!important; }
.scan-panel > div > p:first-child, .scan-panel > div > h2, .scan-panel > div > h2 + p { display:none!important; }
.scan-panel video { border-radius:14px; }
.app-content { min-height: 100dvh; padding: 22px 18px 110px; }
.app-content.detail { padding-top: 0; padding-bottom: 28px; }
.app-stack { display: flex; flex-direction: column; gap: 18px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.page-heading h1 { margin: 0; font-size: 21px; line-height: 1.35; font-weight: 700; letter-spacing: .01em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.avatar { display: flex; width: 36px; height: 36px; flex: none; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; }
.detail-header { position: sticky; top: 0; z-index: 5; display: flex; min-height: 58px; align-items: center; gap: 7px; padding: 11px 0; background: rgba(245, 244, 242, .96); backdrop-filter: blur(10px); }
.detail-header h1 { margin: 0; flex: 1; font-size: 16px; font-weight: 700; }
.back-button { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--ink); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }
@keyframes route-progress-slide { 0%{transform:translateX(-140%)} 100%{transform:translateX(240%)} }
.route-progress-bar { animation:route-progress-slide 1.15s ease-in-out infinite; background:var(--accent)!important; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card-pad { padding: 15px 16px; }
.list-row { display: flex; width: 100%; align-items: flex-start; gap: 11px; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--surface-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; color: var(--ink); font-size: 14px; line-height: 1.5; font-weight: 600; }
.row-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dot { width: 7px; height: 7px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.dot.online { background: var(--success); animation: pulse 2.4s ease-in-out infinite; }
.dot.offline { background: #c7c2ba; }
.tag { display: inline-flex; align-items: center; border-radius: 5px; padding: 2px 7px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.tag.success { background: rgba(63, 157, 99, .1); color: var(--success); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px 9px; }
.section-title h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section-title > span { color: var(--muted-light); font-size: 12px; }
.section-title a { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.stats { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.stat { padding: 13px 4px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { display: block; font-size: 21px; line-height: 1.2; font-weight: 700; }
.stat:first-child strong, .stat.accent strong { color: var(--accent); }
.stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.button-row { display: flex; gap: 8px; }
.btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 0 13px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface-soft); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn.dark { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn.small { min-height: 32px; border-radius: 8px; padding: 0 13px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.muted { color: var(--muted); }
.segment { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(33, 30, 26, .06); }
.segment a, .segment button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; line-height: 34px; }
.segment .active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.field-label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.field { width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 13px; outline: 0; background: #fff; color: var(--ink); font-size: 14px; }
.field::placeholder { color: var(--muted-light); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { height: auto; min-height: 78px; padding: 11px 13px; line-height: 1.6; background: var(--surface-soft); }
select.field {
appearance: none;
padding-right: 34px;
cursor: pointer;
background-color: #fff;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238b857c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
background-position: right 11px center;
background-repeat: no-repeat;
}
.form-stack { display: flex; flex-direction: column; gap: 10px; }
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grid.action { grid-template-columns: minmax(0, 1fr) 110px; }
.form-grid.publish { grid-template-columns: minmax(0, 1fr) 96px; }
.form-grid.memo-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 82px; }
.form-notice { margin: 9px 0 0; color: var(--success); font-size: 12px; line-height: 1.5; }
.elder-status { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.elder-status-main { display: flex; align-items: center; gap: 12px; padding: 15px 16px; }
.elder-avatar { display: flex; width: 46px; height: 46px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: rgba(101, 118, 90, .12); color: var(--olive); font-size: 18px; font-weight: 700; }
.elder-name { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; }
.online-label { font-size: 12px; font-weight: 600; }
.elder-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.checkin-action { border-top: 1px solid var(--line); padding: 12px 16px 14px; }
.checkin-action .form-notice { text-align: center; }
.timeline-item { padding: 13px 16px; border-top: 1px solid var(--line); }
.timeline-item:first-child { border-top: 0; }
.timeline-top { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.timeline-top.strong { color: var(--ink); font-size: 13.5px; font-weight: 700; }
.timeline-time { margin-left: auto; color: var(--muted-light); font-size: 11.5px; font-weight: 400; white-space: nowrap; }
.timeline-body { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.timeline-item > .row-meta { margin-top: 5px; }
.timeline-item > .button-row { margin-top: 10px; }
.alert-title { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13.5px; font-weight: 700; }
.alert-title.red { color: #b33a2b; }
.member-avatar { display: flex; width: 36px; height: 36px; flex: none; align-items: center; justify-content: center; border-radius: 50%; font-size: 14px; font-weight: 700; }
.member-role { flex: none; border-radius: 5px; padding: 2px 7px; background: rgba(33, 30, 26, .05); color: var(--muted); font-size: 11px; font-weight: 600; }
.feature-row { align-items: center; gap: 12px; padding: 14px 16px; }
.feature-icon { display: flex; width: 40px; height: 40px; flex: none; align-items: center; justify-content: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.feature-icon.olive { background: rgba(101, 118, 90, .1); color: var(--olive); }
.feature-icon.muted { background: rgba(33, 30, 26, .05); color: var(--muted); }
.feature-disabled { opacity: .55; }
.chevron { flex: none; color: var(--muted-light); }
.count-badge { min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.settings-profile { display: flex; align-items: center; gap: 13px; padding: 16px; }
.settings-profile .avatar { width: 48px; height: 48px; font-size: 18px; }
.settings-row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 13px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.settings-row:first-child { border-top: 0; }
.settings-row:hover { background: var(--surface-soft); }
.settings-icon { display: flex; width: 36px; height: 36px; flex: none; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.settings-icon.olive { background: rgba(101, 118, 90, .1); color: var(--olive); }
.settings-icon.muted { background: rgba(33, 30, 26, .05); color: var(--muted); }
.toggle { width: 46px; height: 27px; flex: none; position: relative; border: 0; border-radius: 14px; background: rgba(33, 30, 26, .18); transition: background .2s; }
.toggle.on { background: var(--success); }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: left .2s; }
.toggle.on .toggle-knob { left: 22px; }
.empty { padding: 34px 20px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.7; }
.muted-note { margin: 0; color: var(--muted-light); font-size: 11.5px; line-height: 1.6; }
.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 430px; margin: 0 auto; padding: 8px 4px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.nav-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 0; color: #9a948b; font-size: 10.5px; font-weight: 600; }
.nav-item.active { color: var(--accent); }
.nav-badge { position: absolute; top: 1px; left: calc(50% + 7px); min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.device-icon { display: flex; width: 40px; height: 40px; flex: none; align-items: center; justify-content: center; border-radius: 10px; background: rgba(192, 90, 30, .08); color: var(--accent); }
.settings-controls > * { border: 1px solid var(--line) !important; border-radius: 14px !important; background: #fff !important; padding: 15px 16px !important; box-shadow: none !important; }
.settings-controls h2, .settings-controls h3 { font-family: var(--font-body) !important; font-size: 15px !important; line-height: 1.45 !important; }
.settings-controls p { font-size: 12px !important; line-height: 1.65 !important; }
.device-manage summary { list-style: none; }
.device-manage[open] summary { margin-bottom: 10px; }
.device-manage > :not(summary) { border: 1px solid var(--line) !important; border-radius: 14px !important; background: #fff !important; padding: 15px 16px !important; box-shadow: none !important; }
.scan-panel > div { border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.scan-panel > div > p:first-child, .scan-panel > div > h2, .scan-panel > div > h2 + p { display: none !important; }
.scan-panel video { border-radius: 14px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes route-progress-slide { 0% { transform: translateX(-140%); } 100% { transform: translateX(240%); } }
.route-progress-bar { animation: route-progress-slide 1.15s ease-in-out infinite; background: var(--accent) !important; }
@media (max-width: 390px) {
.form-grid.memo-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grid.memo-actions .btn { grid-column: 1 / -1; }
.stats .stat strong { font-size: 19px; }
}
@media (min-width: 700px) {
.app-frame { min-height:calc(100dvh - 32px); margin:16px auto; border-radius:18px; box-shadow:0 18px 60px rgba(32,29,26,.12); }
.app-content { min-height:calc(100dvh - 32px); }
.bottom-nav { bottom:16px; border-radius:0 0 18px 18px; }
.app-frame { min-height: calc(100dvh - 72px); margin: 36px auto; border-radius: 30px; box-shadow: 0 24px 70px rgba(33, 30, 26, .16), 0 0 0 1px rgba(33, 30, 26, .05); }
.app-content { min-height: calc(100dvh - 72px); }
.bottom-nav { bottom: 36px; border-radius: 0 0 30px 30px; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
+88 -12
View File
@@ -1,4 +1,5 @@
import { AlertTriangle, CheckCircle2, HeartPulse, PhoneCall } from "lucide-react";
import { AlertActions, CheckInButton } from "@/components/family-guard-actions";
import { PanelShell } from "@/components/panel-shell";
import { requireFamilyWorkspace } from "@/lib/family-page";
@@ -7,17 +8,92 @@ import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
export const dynamic = "force-dynamic";
export default async function GuardPage() {
const caregiver = await requireCaregiverSession("/guard"); const workspace = await requireFamilyWorkspace(caregiver.id);
const openAlerts = workspace.alerts.filter((a) => a.status === "OPEN" || a.status === "ACKNOWLEDGED");
const todayDoses = workspace.medicationPlans.flatMap((p) => p.doses).filter((d) => d.scheduledFor.toDateString() === new Date().toDateString());
const doneDoses = todayDoses.filter((d) => d.status === "TAKEN").length;
const openTasks = workspace.tasks.filter((t) => t.status !== "COMPLETED" && t.status !== "CANCELLED");
const pendingCheckIns = workspace.checkIns.filter((c) => c.status === "PENDING");
return <PanelShell currentPath="/guard" title="家庭守护" description={`${workspace.elderProfile.preferredName} · 风险线索不是医疗诊断`} caregiverLabel={getCaregiverDisplayName(caregiver)}>
<section className="stats" style={{ gridTemplateColumns: "repeat(4,1fr)" }}><div className="stat accent"><strong>{openAlerts.length}</strong><span>待处理提醒</span></div><div className="stat"><strong>{doneDoses}/{todayDoses.length}</strong><span>今日用药</span></div><div className="stat"><strong>{openTasks.length}</strong><span>照护事项</span></div><div className="stat"><strong>{pendingCheckIns.length}</strong><span>待报平安</span></div></section>
<CheckInButton deviceUuid={workspace.elderProfile.elderDevice.deviceUuid} />
<section><div className="section-title"><h2>风险提醒</h2><span>人工确认后再处置</span></div><div className="card">{workspace.alerts.length ? workspace.alerts.map((alert) => <article id={`alert-${alert.id}`} key={alert.id} className="timeline-item"><div className="timeline-top"><span style={{ color: alert.level === "RED" ? "#b33a2b" : "var(--accent)" }}><AlertTriangle size={15} style={{ verticalAlign: -3, marginRight: 5 }} />{alert.title}</span><span className="timeline-time">{formatDateTime(alert.createdAt)}</span></div><p className="timeline-body">{alert.summary}</p><p className="row-meta">{alert.claimedBy ? `已由 ${alert.claimedBy.nickname || alert.claimedBy.username || "家人"} 接手` : "尚未认领"}</p><AlertActions alertId={alert.id} status={alert.status} /></article>) : <div className="empty"><CheckCircle2 size={26} /><br />当前没有待处理的风险提醒</div>}</div></section>
<section><div className="section-title"><h2>今日状态</h2></div><div className="card"><div className="timeline-item"><div className="timeline-top"><HeartPulse size={15} />设备最近在线<span className="timeline-time">{formatDateTime(workspace.elderProfile.elderDevice.lastSeenAt)}</span></div><p className="timeline-body">仅根据终端在线和主动交互记录展示,不代表生命体征状态。</p></div><div className="timeline-item"><div className="timeline-top"><PhoneCall size={15} />家庭值守</div><p className="timeline-body">{workspace.memberships.filter((m) => m.emergencyPush).map((m) => m.caregiver.nickname || m.caregiver.username || "家人").join("、") || "尚未设置"}</p></div></div></section>
</PanelShell>;
const caregiver = await requireCaregiverSession("/guard");
const workspace = await requireFamilyWorkspace(caregiver.id);
const elder = workspace.elderProfile;
const device = elder.elderDevice;
const lastSeenAt = device.lastSeenAt;
const isOnline = Boolean(lastSeenAt);
const openAlerts = workspace.alerts.filter((alert) => alert.status === "OPEN" || alert.status === "ACKNOWLEDGED");
const today = new Date().toDateString();
const todayDoses = workspace.medicationPlans.flatMap((plan) => plan.doses).filter((dose) => dose.scheduledFor.toDateString() === today);
const doneDoses = todayDoses.filter((dose) => dose.status === "TAKEN").length;
const openTasks = workspace.tasks.filter((task) => task.status !== "COMPLETED" && task.status !== "CANCELLED");
const pendingCheckIns = workspace.checkIns.filter((checkIn) => checkIn.status === "PENDING");
const dutyNames = workspace.memberships
.filter((membership) => membership.emergencyPush)
.map((membership) => membership.caregiver.nickname || membership.caregiver.username || "家人");
return (
<PanelShell
currentPath="/guard"
title="家庭守护"
description={`${elder.preferredName} · 风险线索不是医疗诊断`}
caregiverLabel={getCaregiverDisplayName(caregiver)}
caregiverId={caregiver.id}
>
<section className="elder-status">
<div className="elder-status-main">
<span className="elder-avatar">{elder.preferredName.slice(0, 1)}</span>
<span className="row-main">
<span className="elder-name">
{elder.preferredName}
<span className={`dot ${isOnline ? "online" : "offline"}`} style={{ marginTop: 0 }} />
<span className="online-label" style={{ color: isOnline ? "var(--success)" : "var(--muted-light)" }}>
{isOnline ? "在线" : "离线"}
</span>
</span>
<span className="elder-meta">
{isOnline ? `最近与数字人互动 · ${device.displayName || "长辈终端"}` : `最近在线:${formatDateTime(lastSeenAt)} · ${device.displayName || "长辈终端"}`}
</span>
</span>
</div>
<CheckInButton deviceUuid={device.deviceUuid} />
</section>
<section className="stats" style={{ gridTemplateColumns: "repeat(4, 1fr)" }}>
<div className="stat accent"><strong>{openAlerts.length}</strong><span>待处理提醒</span></div>
<div className="stat"><strong>{doneDoses}/{todayDoses.length}</strong><span>今日用药</span></div>
<div className="stat"><strong>{openTasks.length}</strong><span>照护事项</span></div>
<div className="stat"><strong>{pendingCheckIns.length}</strong><span>待报平安</span></div>
</section>
<section>
<div className="section-title"><h2>风险提醒</h2><span>人工确认后再处置</span></div>
<div className="card">
{workspace.alerts.length ? workspace.alerts.map((alert) => (
<article id={`alert-${alert.id}`} key={alert.id} className="timeline-item">
<div className="timeline-top">
<span className={`alert-title${alert.level === "RED" ? " red" : ""}`}>
<AlertTriangle size={15} strokeWidth={2} />{alert.title}
</span>
<span className="timeline-time">{formatDateTime(alert.createdAt)}</span>
</div>
<p className="timeline-body">{alert.summary}</p>
<p className="row-meta">{alert.claimedBy ? `已由 ${alert.claimedBy.nickname || alert.claimedBy.username || "家人"} 接手` : "尚未认领"}</p>
<AlertActions alertId={alert.id} status={alert.status} />
</article>
)) : (
<div className="empty"><CheckCircle2 size={26} /><br />当前没有待处理的风险提醒</div>
)}
</div>
</section>
<section>
<div className="section-title"><h2>今日状态</h2></div>
<div className="card">
<article className="timeline-item">
<div className="timeline-top"><HeartPulse size={15} />设备最近在线<span className="timeline-time">{formatDateTime(lastSeenAt)}</span></div>
<p className="timeline-body">仅根据终端在线和主动交互记录展示,不代表生命体征状态。</p>
</article>
<article className="timeline-item">
<div className="timeline-top"><PhoneCall size={15} />家庭值守</div>
<p className="timeline-body">{dutyNames.length ? `${dutyNames.join("、")}已开启紧急推送` : "尚未设置家庭值守"}</p>
</article>
</div>
</section>
</PanelShell>
);
}
+1 -1
View File
@@ -31,7 +31,7 @@ export const metadata: Metadata = {
};
export const viewport: Viewport = {
themeColor: "#F4F3F1",
themeColor: "#F5F4F2",
};
export default function RootLayout({
+15 -8
View File
@@ -1,6 +1,7 @@
import { ChevronRight } from "lucide-react";
import { PanelShell } from "@/components/panel-shell";
import { PwaControls } from "@/components/pwa-controls";
import { PushTestPanel } from "@/components/push-test-panel";
import { getCaregiverSettingsOverview } from "@/lib/caregiver-panel";
import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
@@ -13,17 +14,23 @@ export default async function SettingsPage() {
const name = getCaregiverDisplayName(caregiver);
return (
<PanelShell currentPath="/settings" title="我的" caregiverLabel={name}>
<section className="card card-pad" style={{ display: "flex", alignItems: "center", gap: 12 }}>
<span className="avatar" style={{ width: 44, height: 44, fontSize: 17 }}>{name.slice(-1)}</span>
<span className="row-main"><strong style={{ display: "block", fontSize: 15 }}>{name}</strong><span className="row-meta">已绑定 {overview.deviceCount} 台设备 · {overview.pushSubscriptionCount} 台设备已开启提醒</span></span>
<PanelShell currentPath="/settings" title="我的" description="账号、通知与设备" caregiverLabel={name} caregiverId={caregiver.id}>
<section className="card settings-profile">
<span className="avatar">{name.slice(-1)}</span>
<span className="row-main">
<strong style={{ display: "block", fontSize: 15.5 }}>{name}</strong>
<span className="row-meta">已绑定 {overview.deviceCount} 台设备 · {overview.pushSubscriptionCount} 台设备已开启提醒</span>
</span>
<ChevronRight className="chevron" size={16} strokeWidth={2} />
</section>
<div className="settings-controls"><PwaControls /></div>
<div className="settings-controls"><PushTestPanel initialSubscriptionCount={overview.pushSubscriptionCount} deviceCount={overview.deviceCount} /></div>
<section>
<div className="section-title"><h2>通知与设备</h2></div>
<PwaControls deviceCount={overview.deviceCount} />
</section>
<form action="/api/account/logout" method="post" className="card">
<button type="submit" className="list-row" style={{ justifyContent: "center", color: "var(--danger)", fontWeight: 500 }}>退出登录</button>
<button type="submit" className="settings-row" style={{ justifyContent: "center", color: "var(--danger)", fontSize: 14, fontWeight: 600 }}>退出登录</button>
</form>
<p className="muted-note" style={{ textAlign: "center" }}>安智伴 · AI 数字人陪护 · 家属端 v2</p>
</PanelShell>