/* ==================== 药伴 · 全局样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f2f6f3; --card: #ffffff; --ink: #1c2b24; --muted: #7c8b83;
  --line: #e6ede9; --primary: #16a34a; --primary-d: #0e8c3f; --primary-l: #e7f6ec;
  --accent: #f97316; --danger: #dc2626; --danger-l: #fdeaea; --warn: #b45309; --warn-l: #fdf3e3;
  --blue: #2563eb; --radius: 18px; --radius-s: 12px;
  --shadow: 0 10px 30px rgba(18, 60, 42, .08);
  --shadow-l: 0 18px 50px rgba(18, 60, 42, .16);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .9em; }
.req { color: var(--danger); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
img { max-width: 100%; display: block; }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; padding: 12px 20px; font-size: 1rem; font-weight: 600;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line);
  transition: transform .12s, box-shadow .12s, background .15s; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 6px 16px rgba(22,163,74,.32); }
.btn.primary:hover { background: var(--primary-d); }
.btn.primary:disabled { background: #b9d4c3; border-color: #b9d4c3; box-shadow: none; cursor: not-allowed; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #c9d6cf; background: #f6faf7; }
.btn.ghost.danger { color: var(--danger); border-color: #f3c9c9; }
.btn.ghost.danger:hover { background: var(--danger-l); }
.btn.light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.btn.light:hover { background: rgba(255,255,255,.24); }
.btn.sos { background: var(--danger); color: #fff; border-color: var(--danger); font-size: 1.05rem; box-shadow: 0 6px 18px rgba(220,38,38,.35); }
.btn.mini { padding: 7px 13px; font-size: .88rem; border-radius: 10px; }
.btn.big { padding: 18px 28px; font-size: 1.25rem; border-radius: 16px; }
.btn.huge { padding: 22px 30px; font-size: 1.5rem; border-radius: 20px; width: 100%; }
.btn.block { width: 100%; }
.btn.foot { flex: 1; background: #fff; border-color: transparent; box-shadow: var(--shadow); }
.btn.warn { background: var(--warn-l); color: var(--warn); border-color: #eed9b8; }

/* ---------- 卡片 / 徽章 / 标签 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-title { font-size: 1.25rem; margin-bottom: 8px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.badge.ok { background: var(--primary-l); color: var(--primary-d); }
.badge.warn { background: var(--warn-l); color: var(--warn); }
.badge.bad { background: var(--danger-l); color: var(--danger); }
.badge.soon { background: #e8effb; color: var(--blue); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 999px; background: #eef2f0; font-size: .95rem; border: 1.5px solid transparent; }
.chips .chip.on, .chip.on { background: var(--primary-l); border-color: var(--primary); color: var(--primary-d); font-weight: 600; }
.chip.ok { background: var(--primary-l); color: var(--primary-d); font-weight: 600; }
.chip.bad { background: var(--danger-l); color: var(--danger); font-weight: 600; }
.chip.soon { background: #e8effb; color: var(--blue); font-weight: 600; }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 30, 22, .5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 800;
  animation: fadeIn .18s;
}
.modal-card {
  background: #fff; border-radius: 22px; padding: 26px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-l); animation: popIn .2s;
}
.modal-card h2 { font-size: 1.35rem; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- Toast ---------- */
#toastRoot { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 950; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(28, 43, 36, .92); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: .95rem; box-shadow: var(--shadow-l); opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: rgba(220, 38, 38, .95); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { font-size: .92rem; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.form-wide { grid-column: 1 / -1; }
.block-label { display: block; margin-top: 14px; font-size: .92rem; font-weight: 600; }
.block-label textarea { margin-top: 6px; }
.custom-time-row { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.custom-time-row input { max-width: 160px; }
.palette { display: flex; gap: 10px; margin-top: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform .12s; }
.swatch.on { border-color: var(--ink); transform: scale(1.12); }

/* ---------- 开关 ---------- */
.switch { position: relative; width: 52px; height: 30px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; background: #cfd9d3; border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: left .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { left: 25px; }

/* ==================== 老人端（真正的大字） ==================== */
#view-elder { background: #f7f3ea; min-height: 100vh; padding-bottom: 30px; font-size: 21px; }
html[data-font="large"] #view-elder { font-size: 28px; }
html[data-font="xlarge"] #view-elder { font-size: 36px; }
html[data-contrast="1"] #view-elder { background: #fff; }
html[data-contrast="1"] #view-elder .elder-header { background: #173b28; }
html[data-contrast="1"] #view-elder .card { border: 2px solid #000; }
html[data-contrast="1"] #view-elder .btn { border: 2px solid currentColor; }
html[data-contrast="1"] #view-elder .next-card { background: #173b28; }

.elder-header { background: linear-gradient(135deg, #0f9d58, #0b7a44); color: #fff; border-radius: 0 0 28px 28px; }
.elder-head { max-width: 860px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px 30px; display: flex; justify-content: space-between; align-items: center; gap: 1em; }
.elder-greet { font-size: 1.1em; opacity: .9; }
.elder-clock { font-size: 3em; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.elder-date { font-size: 1.05em; opacity: .9; margin-top: .35em; }
.elder-ring {
  --p: 0%;
  width: 116px; height: 116px; border-radius: 50%; flex: none;
  background: conic-gradient(#ffffff var(--p), rgba(255,255,255,.22) 0);
  display: flex; align-items: center; justify-content: center;
}
.elder-ring-inner { width: 96px; height: 96px; border-radius: 50%; background: rgba(11, 100, 58, .55); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.elder-ring-num { font-size: 1.35em; font-weight: 800; }
.elder-ring-sub { font-size: .72em; opacity: .85; }

.elder-main { max-width: 860px; margin: 0 auto; padding: 18px 14px 140px; }

.next-card { background: linear-gradient(135deg, #0f9d58, #0b7a44); color: #fff; border-radius: 24px; padding: 24px 22px; box-shadow: var(--shadow-l); display: flex; gap: 20px; align-items: center; margin-bottom: 18px; }
.next-left .next-icon { width: 4.6em; height: 4.6em; border-radius: .6em; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 2.2em; flex: none; }
.next-mid { flex: 1; min-width: 0; }
.next-label { font-size: 1em; opacity: .9; }
.next-name { font-size: 1.45em; font-weight: 800; margin: 2px 0; word-break: break-all; line-height: 1.25; }
.next-dose { font-size: 1.1em; opacity: .95; }
.next-time { margin-top: .4em; display: inline-block; background: rgba(255,255,255,.16); padding: .35em .8em; border-radius: 999px; font-size: 1em; }
.next-right .btn { background: #fff; color: #0b7a44; border: none; min-width: 9em; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.next-right .btn:disabled { background: rgba(255,255,255,.32); color: rgba(255,255,255,.92); cursor: not-allowed; box-shadow: none; }
.next-empty { text-align: center; padding: 28px 8px; font-size: 1.4em; font-weight: 700; }
.next-empty .next-time { margin-top: .5em; font-size: 1em; font-weight: 500; opacity: .85; display: block; background: none; padding: 0; }
.pulse-soft { animation: softPulse 1.8s infinite; }
@keyframes softPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* 老人端所有按钮/徽章按字号等比放大 */
#view-elder .btn { font-size: 1em; padding: .85em 1.1em; border-radius: .8em; }
#view-elder .btn.mini { padding: .45em .85em; font-size: .95em; }
#view-elder .btn.big { font-size: 1.1em; padding: .85em 1.2em; }
#view-elder .btn.huge { font-size: 1.15em; padding: 1em 1.4em; }
#view-elder .chip { font-size: .95em; padding: .35em .85em; }
#view-elder .card { border-radius: 20px; padding: 1.2em; margin-bottom: 1em; }
#view-elder .card-title { font-size: 1.25em; margin-bottom: .6em; }

.tline-item { display: grid; grid-template-columns: clamp(84px, 5.2em, 170px) clamp(52px, 3.2em, 110px) 1fr auto; gap: .8em; align-items: center; padding: .85em .3em; border-bottom: 1px dashed var(--line); }
.tline-item:last-child { border-bottom: none; }
.tline-time { font-size: 1.3em; font-weight: 700; font-variant-numeric: tabular-nums; }
.tline-dot { width: 3em; height: 3em; border-radius: .45em; display: flex; align-items: center; justify-content: center; font-size: 1.3em; background: #eef2f0; }
.tline-item.ok .tline-dot { background: var(--primary-l); }
.tline-item.due .tline-dot { background: var(--warn-l); animation: pulse 1.6s infinite; }
.tline-item.bad .tline-dot { background: var(--danger-l); }
.tline-item.soon .tline-dot { background: #e8effb; }
.tline-name { font-weight: 700; font-size: 1.15em; line-height: 1.3; }
.tline-dose { color: var(--muted); font-size: .95em; }
.tline-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(249,115,22,.45); } 50% { box-shadow: 0 0 0 12px rgba(249,115,22,0); } }

.elder-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; gap: .6em; padding: .7em .9em calc(.7em + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); box-shadow: 0 -6px 20px rgba(0,0,0,.06);
}
.elder-footer .btn { font-size: 1.05em; }

/* ---------- 提醒弹层 ---------- */
.reminder-overlay {
  position: fixed; inset: 0; z-index: 900; background: rgba(12, 30, 20, .6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s;
}
.reminder-card {
  background: #fff; border-radius: 28px; padding: 34px 30px; text-align: center; width: 100%; max-width: 460px;
  box-shadow: var(--shadow-l); animation: popIn .25s;
}
.reminder-times { display: inline-block; background: var(--warn-l); color: var(--warn); font-weight: 700; padding: 6px 16px; border-radius: 999px; font-size: .95rem; margin-bottom: 16px; }
.reminder-icon { font-size: 4.2rem; line-height: 1; margin-bottom: 8px; }
.reminder-card h2 { font-size: 1.9rem; margin-bottom: 4px; }
.reminder-dose { font-size: 1.45rem; font-weight: 700; color: var(--primary-d); }
.reminder-time { font-size: 1.15rem; color: var(--muted); margin-bottom: 4px; }
.reminder-hint { color: var(--muted); margin-bottom: 22px; }
.reminder-card .btn.ghost { margin-top: 12px; width: 100%; }

/* ---------- 彩带特效 ---------- */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.fx-bit { position: absolute; bottom: 30%; animation: fxUp 1.5s ease-out forwards; }
@keyframes fxUp { from { opacity: 1; transform: translateY(0) rotate(0deg); } to { opacity: 0; transform: translateY(-260px) rotate(40deg); } }

/* ==================== 亲人端 ==================== */
.family-layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.family-nav {
  background: linear-gradient(180deg, #0d6b3d, #0a5a33); color: #fff; padding: 22px 14px;
  display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh;
}
.family-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-logo { font-size: 2rem; }
.brand-name { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.brand-sub { font-size: .8rem; opacity: .75; }
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px;
  color: rgba(255,255,255,.85); font-size: 1rem; font-weight: 600; text-align: left; transition: background .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.1); }
.nav-btn.active { background: rgba(255,255,255,.18); color: #fff; }
.nav-warn { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #fb7185; box-shadow: 0 0 0 3px rgba(251,113,133,.35); }
.family-nav-foot { margin-top: auto; }

.family-main { padding: 24px 28px 40px; max-width: 1100px; width: 100%; }
.family-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.family-topbar h1 { font-size: 1.6rem; }
.pill { background: #fff; border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.tab { display: none; }
.tab.active { display: block; animation: fadeIn .2s; }

/* 概览 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { --tone: var(--primary); background: #fff; border-left: 4px solid var(--tone); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat.ok { --tone: var(--primary); }
.stat.soon { --tone: var(--blue); }
.stat.due { --tone: var(--accent); }
.stat.bad { --tone: var(--danger); }
.stat-num { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-weight: 600; margin-top: 2px; }
.stat-sub { color: var(--muted); font-size: .82rem; }
.warn-card { border-left: 4px solid var(--accent); }
.warn-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.warn-list li { background: var(--warn-l); padding: 10px 14px; border-radius: 12px; font-size: .95rem; }
.allgood { border-left: 4px solid var(--primary); font-weight: 600; color: var(--primary-d); }

.week-chart { display: flex; gap: 12px; align-items: flex-end; margin-top: 14px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-bar-wrap { height: 118px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.week-bar { width: min(42px, 70%); border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #34c06b, #16a34a); min-height: 4px; transition: height .6s; }
.week-bar.today { background: linear-gradient(180deg, #ff9a3d, #f97316); }
.week-pct { font-size: .82rem; font-weight: 700; color: var(--muted); }
.week-label { font-size: .85rem; color: var(--muted); }
.week-label.today { color: var(--accent); font-weight: 700; }

.med-progress-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.med-progress { display: flex; align-items: center; gap: 14px; }
.med-progress-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: none; }
.med-progress-mid { flex: 1; min-width: 0; }
.med-progress-name { font-weight: 700; margin-bottom: 6px; }
.med-progress-bar { height: 10px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.med-progress-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s; }
.med-progress-side { text-align: right; flex: none; }
.med-progress-num { font-weight: 800; font-size: 1.1rem; }
.med-progress-next { color: var(--muted); font-size: .85rem; }

.activity-list { display: flex; flex-direction: column; margin-top: 12px; }
.activity-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { flex: none; }
.activity-text { flex: 1; font-size: .95rem; }
.activity-time { color: var(--muted); font-size: .82rem; flex: none; }

/* 药品管理 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.med-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.med-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 5px solid var(--mc, var(--primary)); }
.med-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.med-card-icon { width: 50px; height: 50px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex: none; }
.med-card-name { font-weight: 800; font-size: 1.1rem; }
.med-card-purpose { color: var(--muted); font-size: .88rem; }
.med-card-rows { display: flex; flex-direction: column; gap: 7px; }
.med-row { display: flex; gap: 10px; font-size: .93rem; align-items: baseline; }
.med-row > span { color: var(--muted); flex: none; width: 56px; }
.med-row b { font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.med-row em { color: var(--muted); font-style: normal; font-size: .85rem; }
.time-chip { background: #eef2f0; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.med-card-note { margin-top: 10px; background: var(--primary-l); border-radius: 10px; padding: 8px 12px; font-size: .88rem; }
.med-card-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }

/* 设置 */
.setting-rows { display: flex; flex-direction: column; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 2px; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row b { font-size: 1.02rem; }
.setting-actions { display: flex; gap: 10px; align-items: center; }
.setting-actions select, .setting-row select { width: auto; }

/* AI 识别 */
.ocr-hero { background: linear-gradient(120deg, #e7f6ec, #e8effb); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 18px; }
.ocr-hero h3 { font-size: 1.25rem; margin-bottom: 6px; }
.ocr-hero p { font-size: .95rem; color: #4b5b52; }
.ocr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dropzone { border: 2.5px dashed #b8cdbf; border-radius: var(--radius); padding: 44px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; font-weight: 600; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-l); }
.dz-icon { font-size: 2.6rem; margin-bottom: 6px; }
.ocr-preview { position: relative; }
.ocr-preview img { border-radius: var(--radius); max-height: 340px; width: 100%; object-fit: contain; background: #f3f7f4; }
.ocr-preview .btn { position: absolute; top: 10px; right: 10px; background: #fff; }
.ocr-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ocr-thumb { position: relative; width: 108px; height: 108px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line); background: #f3f7f4; flex: none; }
.ocr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ocr-thumb-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.ocr-thumb-del:hover { background: var(--danger); }
.ocr-add { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--muted); cursor: pointer; border-style: dashed; }
.ocr-add:hover { border-color: var(--primary); color: var(--primary); }
.ocr-log { background: #14211a; color: #9fe8b5; font: 12.5px/1.7 ui-monospace, Menlo, Consolas, monospace; border-radius: 12px; padding: 12px 14px; max-height: 190px; overflow-y: auto; margin-top: 14px; white-space: pre-wrap; word-break: break-all; }
.ocr-log-line.error { color: #fb7185; }
.ocr-log-line.progress { color: #ffd166; }
.ocr-raw { margin-top: 14px; background: #f6faf7; border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.ocr-raw pre { white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow: auto; font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .family-layout { display: block; }
  .family-nav { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; z-index: 200; overflow-x: auto; }
  .family-brand { padding: 0; }
  .brand-sub { display: none; }
  .nav-list { flex-direction: row; }
  .nav-btn { padding: 10px 13px; font-size: .92rem; white-space: nowrap; }
  .family-nav-foot { margin: 0; }
  .family-nav-foot .btn { white-space: nowrap; padding: 10px 14px; }
  .family-main { padding: 18px 16px 40px; }
  .ocr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .next-card { flex-direction: column; text-align: center; }
  .next-right { width: 100%; }
  .next-right .btn { width: 100%; min-width: 0; }
  .tline-item { grid-template-columns: clamp(70px, 4.5em, 120px) clamp(46px, 2.8em, 80px) 1fr; }
  .tline-act { grid-column: 2 / -1; justify-content: flex-start; }
  .tline-dot { width: 2.6em; height: 2.6em; }
  .elder-clock { font-size: 2.5em; }
  .elder-ring { width: 100px; height: 100px; }
  .elder-ring-inner { width: 82px; height: 82px; }
}

/* ==================== 启动遮罩 ==================== */
#bootScreen {
  position: fixed; inset: 0; z-index: 2000; background: #f2f6f3;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.boot-inner { font-size: 1.2rem; font-weight: 700; color: var(--primary-d); line-height: 2; }
.boot-inner::after { content: "…"; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ==================== 登录 / 注册 ==================== */
#view-auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0d6b3d, #0a5a33); padding: 20px;
}
.auth-card { background: #fff; border-radius: 24px; padding: 34px 30px; width: 100%; max-width: 400px; box-shadow: var(--shadow-l); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand .brand-logo { font-size: 2.6rem; }
.auth-brand h1 { font-size: 1.7rem; }
.auth-brand p { color: var(--muted); font-size: .9rem; }
.auth-tabs { display: flex; gap: 6px; background: #eef2f0; border-radius: 12px; padding: 5px; margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); transition: all .15s; }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
#authForm { display: flex; flex-direction: column; gap: 14px; }
#authForm label { font-weight: 600; font-size: .92rem; display: flex; flex-direction: column; gap: 6px; }
.auth-error { color: var(--danger); font-size: .88rem; }
.auth-hint { text-align: center; margin-top: 16px; }

/* ==================== 长辈切换器 ==================== */
#elderSwitcher { position: relative; }
.es-btn {
  background: #fff; border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow);
}
.es-caret { font-size: .8rem; color: var(--muted); }
.es-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-l); padding: 8px; width: 270px; z-index: 400; border: 1px solid var(--line);
  animation: popIn .16s;
}
.es-item { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; }
.es-item.active { background: var(--primary-l); }
.es-select { flex: 1; min-width: 0; text-align: left; padding: 8px 10px; border-radius: 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-select:hover { background: #f0f5f2; }
.es-code { color: var(--muted); font-size: .78rem; font-weight: 400; margin-left: 4px; }
.es-icon { width: 34px; height: 34px; border-radius: 8px; font-size: 1rem; flex: none; }
.es-icon:hover { background: #f0f5f2; }
.es-icon.danger:hover { background: var(--danger-l); }
.es-action { width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.es-action:hover { background: #f0f5f2; }
.es-action.danger { color: var(--danger); }
.es-action.danger:hover { background: var(--danger-l); }

/* ==================== AI 讲解 ==================== */
.ai-input-row { display: flex; gap: 10px; margin-top: 12px; }
.ai-input-row input { flex: 1; }
.ai-card h3 .badge { margin-left: 6px; }
.ai-result { margin-top: 16px; background: #f8fbf9; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.ai-loading { color: var(--primary-d); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dots::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
.ai-error { color: var(--danger); font-weight: 600; margin-bottom: 8px; }
.md-h { margin: 14px 0 6px; font-size: 1.05rem; color: var(--primary-d); }
.md-h:first-child { margin-top: 0; }
.md-p { margin: 6px 0; }
.md-ul, .md-ol { margin: 6px 0 6px 22px; }
.md-ul li, .md-ol li { margin: 3px 0; }
.md-quote { border-left: 3px solid var(--accent); background: var(--warn-l); padding: 8px 12px; border-radius: 0 10px 10px 0; color: var(--warn); font-weight: 600; margin: 10px 0; font-size: .92rem; }
.md-p code, .md-ul code { background: #eef2f0; padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ==================== 老人端链接分享 ==================== */
.share-url {
  background: #f0f5f2; border: 1.5px dashed #b8cdbf; border-radius: 10px; padding: 10px 12px;
  word-break: break-all; font-size: .88rem; margin-top: 12px; user-select: all; line-height: 1.5;
}
.qr-wrap { display: flex; justify-content: center; margin: 14px 0 4px; min-height: 44px; }
.qr-wrap img, .qr-wrap canvas { border-radius: 10px; }

/* ==================== 账号身份（v2） ==================== */
.auth-role { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-role-label { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.role-btn { flex: 1; padding: 11px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; transition: all .15s; }
.role-btn.active { border-color: var(--primary); background: var(--primary-l); color: var(--primary-d); }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0 10px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.admin-entry {
  width: 100%; padding: 11px; border-radius: 12px; border: 1.5px dashed #c9d6cf;
  background: #f6faf7; color: var(--muted); font-weight: 600; transition: all .15s;
}
.admin-entry:hover { border-color: var(--primary); color: var(--primary-d); background: var(--primary-l); }
.admin-back { width: 100%; margin-top: 12px; padding: 8px; color: var(--muted); font-weight: 600; }
.admin-back:hover { color: var(--primary-d); }
.session-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--primary-l); border: 1px solid #bfe3cd; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 16px;
}
.session-info { font-size: .92rem; }
.session-actions { display: flex; gap: 8px; }
.auth-ver { margin-top: 14px; text-align: center; font-size: .78rem; color: #9db3a8; }
.info-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.info-row { display: flex; gap: 10px; background: #f6faf7; border-radius: 10px; padding: 8px 12px; font-size: .9rem; align-items: baseline; }
.info-row span { color: var(--muted); flex: none; width: 64px; }
.info-row b { word-break: break-all; }
.bind-code-big {
  font-size: 2.2rem; font-weight: 800; letter-spacing: 10px; text-align: center;
  color: var(--primary-d); background: var(--primary-l); border-radius: 14px;
  padding: 18px; margin: 12px 0; user-select: all;
}

/* ==================== 管理端 ==================== */
.admin-wrap { min-height: 100vh; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 14px 24px; background: #fff; box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.admin-brand { font-weight: 800; font-size: 1.15rem; }
.admin-top-right { display: flex; gap: 10px; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr:hover { background: #f6faf7; }
.price-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.price-row label { font-size: .92rem; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.price-row input { max-width: 180px; }
.ai-key-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
/* 药品照片（家人识别上传 → 老人端显示） */
.med-photos { margin-top: .45em; display: flex; gap: .4em; flex-wrap: wrap; }
.med-photo-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.15); display: block; cursor: pointer; }
.tline-item .med-photo-thumb { width: 44px; height: 44px; }
.ro-photos { display: flex; gap: .5em; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.ro-photos .med-photo-thumb { width: 76px; height: 76px; border-radius: 12px; }

/* ==================== 2026 · 视觉升级 ==================== */
:root {
  --bg: #eef4f0;
  --primary: #10b981;
  --primary-d: #0d9f6e;
  --primary-l: #e5f7ef;
  --accent: #f97316;
  --danger: #ef4444;
  --danger-l: #fdecec;
  --warn: #d97706;
  --warn-l: #fdf3e3;
  --blue: #3b82f6;
  --line: #e3ebe6;
  --ink: #17251e;
  --muted: #7a8a81;
  --radius: 20px;
  --radius-s: 12px;
  --shadow: 0 8px 24px rgba(16, 80, 50, .06), 0 2px 6px rgba(16, 80, 50, .04);
  --shadow-l: 0 20px 50px rgba(16, 80, 50, .14);
}
body {
  background:
    radial-gradient(1100px 480px at 88% -10%, rgba(16, 185, 129, .10), transparent 60%),
    radial-gradient(800px 420px at -8% 8%, rgba(59, 130, 246, .07), transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(16, 185, 129, .25); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c4d4cb; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #a8c2b4; }
::-webkit-scrollbar-track { background: transparent; }

/* 卡片 */
.card {
  background: #fff;
  border: 1px solid rgba(227, 235, 230, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .25s;
}
.card:hover { box-shadow: 0 14px 34px rgba(16, 80, 50, .10); }

/* 按钮 */
.btn { border-radius: 12px; font-weight: 700; letter-spacing: .01em; }
.btn.primary { background: linear-gradient(135deg, #12c98b, #0ea371); border: none; box-shadow: 0 6px 18px rgba(16, 185, 129, .35); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16, 185, 129, .45); }
.btn.ghost:hover { background: #f2f9f5; border-color: #cfe9dc; }
.btn.sos { background: linear-gradient(135deg, #f65b5b, #e11d48); border: none; box-shadow: 0 6px 18px rgba(239, 68, 68, .35); }
.btn.light { background: rgba(255, 255, 255, .12); backdrop-filter: blur(4px); }

/* 输入 */
input, select, textarea { border-radius: 12px; background: #fbfdfc; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(16, 185, 129, .14); }

/* 登录页 */
#view-auth {
  background:
    radial-gradient(700px 420px at 18% 12%, rgba(255, 255, 255, .09), transparent 60%),
    radial-gradient(640px 420px at 92% 88%, rgba(16, 185, 129, .28), transparent 55%),
    linear-gradient(155deg, #0b5c3a, #064e30 55%, #052e1e);
}
.auth-card { border-radius: 28px; padding: 38px 34px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-brand .brand-logo { font-size: 3rem; display: inline-block; animation: brandFloat 3s ease-in-out infinite; }
@keyframes brandFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-tabs { background: #eef2f0; border-radius: 14px; padding: 5px; }
.auth-tab.active { background: linear-gradient(135deg, #12c98b, #0ea371); color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, .35); }
.role-btn.active { background: var(--primary-l); border-color: var(--primary); color: var(--primary-d); }
.admin-entry { border-radius: 14px; }

/* 亲人端侧边栏 */
.family-nav { background: linear-gradient(180deg, #0a4d31, #063524 85%); }
.nav-btn { border-radius: 12px; margin-bottom: 2px; }
.nav-btn.active { background: linear-gradient(90deg, rgba(18, 201, 139, .30), rgba(18, 201, 139, .08)); box-shadow: inset 3px 0 0 #12c98b; }
.nav-btn:hover { background: rgba(255, 255, 255, .08); }
.family-topbar { padding: 20px 0 18px; }
.family-topbar h1 { font-size: 1.75rem; letter-spacing: .01em; }
.pill { background: #fff; border-color: transparent; box-shadow: var(--shadow); }

/* 统计卡片 */
.stat { border: none; border-radius: 18px; background: #fff; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--tone); }
.stat-num { color: var(--tone); }

/* 表格 */
.tbl-wrap { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tbl th { background: #f3f8f5; border-bottom: none; color: #4b6a58; }
.tbl tbody tr:nth-child(even) { background: #fafcfb; }
.tbl tbody tr:hover { background: #f0f8f3; }

/* 图表 */
.week-bar { border-radius: 10px 10px 3px 3px; box-shadow: 0 4px 10px rgba(16, 185, 129, .22); }
.week-bar.today { box-shadow: 0 4px 10px rgba(249, 115, 22, .30); }

/* 药品卡片 */
.med-card { border: none; border-radius: 20px; background: linear-gradient(180deg, #fff, #fbfefc); position: relative; overflow: hidden; }
.med-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--mc, var(--primary)); }
.time-chip { background: #eef4f0; color: #4b6a58; }

/* 弹窗 / 菜单 */
.modal-backdrop { background: rgba(8, 32, 20, .55); backdrop-filter: blur(6px); }
.modal-card { border-radius: 26px; }
.es-menu { border-radius: 18px; }
.es-btn { border-radius: 999px; }
.es-item.active { background: var(--primary-l); }
.reminder-card { border-radius: 32px; box-shadow: 0 30px 90px rgba(0, 0, 0, .3); }
.toast { background: rgba(23, 37, 30, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }

/* 管理端 */
.admin-topbar { background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.admin-brand { letter-spacing: .01em; }

/* AI 识别 / 照片 */
.dropzone { border-radius: 18px; border-width: 2px; }
.photo-item { border-radius: 14px; transition: transform .15s, box-shadow .15s; }
.photo-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.photo-item img { border-radius: 10px; }
.ai-result { border-radius: 16px; }

/* 老人端微调（不动字号体系，只升级质感） */
#view-elder { background: linear-gradient(180deg, #f7faf5, #f1f6f2); }
.elder-header { background: linear-gradient(135deg, #0fae63, #0a8a4b); }
.next-card { background: linear-gradient(135deg, #0fae63, #0a8a4b); box-shadow: 0 16px 40px rgba(10, 110, 60, .32); }
#view-elder .card { box-shadow: 0 8px 22px rgba(16, 80, 50, .07); }
.elder-footer { background: rgba(255, 255, 255, .9); }
.elder-footer .btn.foot { border-radius: .8em; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.photo-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.photo-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; display: block; }
.photo-meta { font-size: .8rem; font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-time { font-size: .72rem; color: var(--muted); margin-bottom: 6px; }

/* ==================== 密码小眼睛 ==================== */
.pw-wrap { position: relative; width: 100%; }
.pw-wrap input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 9px; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .12s;
}
.pw-eye:hover { background: #eef2f0; color: var(--ink); }
.pw-eye:active { transform: translateY(-50%) scale(.92); }

/* 2026 · 健康管理平台界面 */
:root {
  --bg: #f3f7f6; --ink: #18312c; --muted: #586f69;
  --primary: #087e6b; --primary-d: #056653; --primary-l: #e6f5f0;
  --line: #dce8e4; --radius: 16px;
  --shadow: 0 4px 18px rgba(25, 65, 55, .06);
  --shadow-l: 0 20px 50px rgba(17, 52, 44, .16);
}
body { background: var(--bg); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #e6a53a; outline-offset: 3px;
}
.card { border: 1px solid var(--line); box-shadow: var(--shadow); }
.card:hover { box-shadow: var(--shadow); }
.card h3 { font-size: 1.08rem; color: #183c33; }
.btn { min-height: 44px; border-radius: 10px; letter-spacing: 0; }
.btn.mini { min-height: 40px; }
.btn.primary { background: #087e6b; border: 1px solid #087e6b; box-shadow: none; }
.btn.primary:hover { background: #056653; box-shadow: none; }
input, select, textarea { background: #fff; border-color: #cbdcd6; }
input:focus, select:focus, textarea:focus { border-color: #087e6b; box-shadow: 0 0 0 3px rgba(8,126,107,.14); }

/* 亲人端：清晰的导航与信息层级 */
.family-layout { grid-template-columns: 240px minmax(0, 1fr); }
.family-nav { background: #103d34; padding: 28px 16px; }
.family-brand { padding: 0 10px 20px; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand-name { letter-spacing: .08em; }
.brand-sub { color: #c1ddd3; }
.nav-btn { min-height: 48px; color: #d7eae4; }
.nav-btn.active { color: #fff; background: #236456; box-shadow: inset 3px 0 0 #a8e4ce; }
.family-main { max-width: 1440px; padding: 30px 36px 56px; }
.family-topbar { padding: 0 0 22px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.family-topbar h1 { font-size: 1.7rem; letter-spacing: 0; }
.pill { color: #345e52; border: 1px solid var(--line); box-shadow: none; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { border: 1px solid var(--line); padding: 20px; box-shadow: var(--shadow); }
.stat::before { width: 4px; }
.stat-num { font-size: 2rem; letter-spacing: -.03em; }
.stat-label { color: #294b41; margin-top: 8px; }
.stat-sub { margin-top: 4px; }
.med-card { border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.med-card-actions { flex-wrap: wrap; }
.ocr-hero { background: #e5f3ee; border: 1px solid #cfe8dc; }
.tbl th { background: #f1f7f4; color: #45675c; }
.tbl td, .tbl th { padding: 12px 14px; }

/* 管理端 */
.admin-topbar { padding: 18px max(24px, calc((100% - 1320px) / 2)); background: #fff; box-shadow: none; }
.admin-brand { color: #154b3d; font-size: 1.2rem; }
.admin-main { max-width: 1320px; padding: 30px 24px 60px; }
.admin-main > .card { padding: 24px; }
.admin-main .stat-grid { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.tbl-wrap { margin-top: 14px; }

/* 老人端：更醒目的信息和操作，保留字号缩放 */
#view-elder { background: #f1f7f3; }
.elder-header { background: #146c56; border-radius: 0 0 1.2em 1.2em; }
.elder-head { max-width: 960px; }
.elder-main { max-width: 960px; }
.elder-greet, .elder-date { opacity: 1; }
.next-card { background: #0b735b; box-shadow: 0 12px 30px rgba(11,90,70,.18); }
#view-elder .card { border: 1px solid #d1e3da; box-shadow: var(--shadow); }
#view-elder .tline-dose { color: #4b635a; }
.elder-footer { justify-content: center; background: #fff; border-top: 1px solid #d6e5dd; }
.elder-footer .btn { min-height: 2.8em; }
.elder-footer .btn.foot { background: #edf5f0; box-shadow: none; border: 1px solid #d6e5dd; }
html[data-contrast="1"] #view-elder { background: #fff; }
html[data-contrast="1"] #view-elder .elder-header,
html[data-contrast="1"] #view-elder .next-card { background: #173b28; }
html[data-contrast="1"] #view-elder .card { border: 2px solid #000; }
html[data-contrast="1"] #view-elder .btn { border: 2px solid currentColor; }

/* 登录与弹窗 */
#view-auth { background: linear-gradient(145deg, #103d34, #176b56); }
.auth-card { box-shadow: 0 24px 64px rgba(3,35,26,.22); }
.auth-brand .brand-logo { animation: none; }
.auth-tab.active { background: #087e6b; box-shadow: none; }
.modal-card { border-radius: 18px; }
@media (max-width: 900px) {
  .family-layout { display: block; }
  .family-nav { padding: 10px 12px; }
  .family-brand { border: 0; padding: 0; }
  .family-main { padding: 22px 20px 48px; }
}
@media (max-width: 620px) {
  .family-nav { gap: 8px; }
  .family-main { padding: 18px 14px 40px; }
  .family-topbar h1 { font-size: 1.45rem; }
  .stat-grid, .admin-main .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 15px; min-width: 0; }
  .stat-num { font-size: 1.7rem; overflow-wrap: anywhere; }
  .med-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-topbar { padding: 12px 14px; }
  .admin-main { padding: 18px 14px 40px; }
  .admin-main > .card { padding: 18px; }
  .elder-head { padding: calc(20px + env(safe-area-inset-top)) 16px 24px; }
  .elder-main { padding: 16px 12px 20px; }
  .elder-footer { position: static; flex-wrap: wrap; padding: .7em .6em calc(.7em + env(safe-area-inset-bottom)); }
  .elder-footer .btn { flex: 1 1 40%; }
  .elder-footer .btn.sos { flex-basis: 100%; }
  .tline-item { grid-template-columns: minmax(0, 1fr) auto; gap: .35em .5em; }
  .tline-time { grid-column: 1 / -1; }
  .tline-dot { display: none; }
  .tline-act { grid-column: 1 / -1; }
  .tline-name { overflow-wrap: anywhere; }
  .setting-row { flex-wrap: wrap; }
  .modal-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 620px) {
  .next-left .next-icon { width: 2.4em; height: 2.4em; }
  .next-card { gap: .65em; padding: 1em; }
}

/* 健康管理平台 · 清新、从容的日常体验 */
:root { --bg:#f5f8f6; --ink:#193c34; --muted:#627971; --primary:#147d68; --primary-d:#0c6654; --primary-l:#e5f3ed; --line:#e2ebe6; --shadow:0 5px 24px rgba(31,75,59,.055); }
body { background:#f5f8f6; }
.family-layout { grid-template-columns:252px minmax(0,1fr); }
.family-nav { background:#163f35; padding:30px 18px; gap:27px; }
.family-brand { gap:12px; padding:0 10px 26px; }
.family-brand .brand-logo { display:grid; place-items:center; width:44px; height:44px; border-radius:15px; background:#d9efdf; font-size:1.5rem; }
.family-brand .brand-name { font-size:1.35rem; }
.family-brand .brand-sub { color:#bbd9cc; font-size:.68rem; letter-spacing:.06em; opacity:1; margin-top:4px; }
.nav-list { gap:7px; }
.nav-btn { padding:13px 15px; border-radius:12px; font-weight:600; }
.nav-btn.active { background:#2d6958; box-shadow:inset 3px 0 #c6eaca; }
.family-nav-foot .btn { border-radius:12px; }
.family-main { max-width:1480px; padding:34px 42px 64px; }
.family-topbar { align-items:center; border:0; margin:0 0 22px; padding:0; min-height:74px; }
.section-eyebrow { color:#5c927e; font-size:.67rem; font-weight:800; letter-spacing:.16em; }
.family-heading h1 { font-size:1.85rem; margin:3px 0; }
.family-heading p, .admin-heading p { color:var(--muted); font-size:.88rem; }
.family-topbar-right { gap:10px; }
#topBindBtn { white-space: nowrap; font-size: .92rem; padding: .6em 1.1em; }
.pill, .es-btn { background:#fff; border:1px solid #e3ece7; box-shadow:none; }
.overview-intro { position:relative; overflow:hidden; display:flex; justify-content:space-between; align-items:center; min-height:150px; margin-bottom:20px; padding:26px 32px; border-radius:20px; background:#dcefe5; color:#194e3e; }
.overview-intro::after { content:""; position:absolute; right:-28px; bottom:-112px; width:280px; height:280px; border:1px solid rgba(61,128,95,.17); border-radius:50%; box-shadow:0 0 0 36px rgba(255,255,255,.12),0 0 0 72px rgba(255,255,255,.10); }
.overview-kicker { color:#548a70; letter-spacing:.14em; font-size:.67rem; font-weight:800; }
.overview-intro h2 { font-size:1.38rem; margin:7px 0 4px; line-height:1.35; }
.overview-intro p { color:#537568; font-size:.9rem; }
.overview-emblem { position:relative; z-index:1; font-size:4rem; line-height:1; color:#78b69a; margin:0 38px; }
.stat-grid { gap:14px; margin-bottom:18px; }
.stat { padding:19px 20px; border-radius:16px; min-height:120px; }
.stat::before { top:18px; bottom:auto; left:auto; right:18px; width:10px; height:10px; border-radius:50%; opacity:.75; }
.stat-num { color:var(--ink); font-size:2rem; }
.stat-label { font-size:.9rem; margin-top:9px; }
.stat-sub { font-size:.78rem; }
.card { border-radius:17px; }
.allgood { background:#edf7ef; border:1px solid #d9eddd; color:#31684c; }
.overview-panels { display:grid; grid-template-columns:1.15fr 1fr; gap:16px; align-items:start; }
.overview-panels > .card { margin:0; min-width:0; padding:24px; }
.overview-panels > .card:last-child { grid-column:1 / -1; }
.week-chart { margin-top:20px; }
.week-bar { background:linear-gradient(180deg,#8ac9a5,#3b9e76); }
.week-bar.today { background:linear-gradient(180deg,#f4be76,#e99351); }
.med-progress { padding:6px 0; }
.admin-wrap { background:#f5f8f6; }
.admin-topbar { min-height:72px; }
.admin-brand { display:flex; gap:10px; align-items:center; }
.admin-brand-mark { display:grid; place-items:center; width:38px; height:38px; background:#e2f2e9; border-radius:12px; color:#147d68; font-size:1.25rem; }
.admin-brand small { font-size:.82rem; color:#758b81; font-weight:500; margin-left:5px; }
.admin-heading { display:flex; align-items:end; justify-content:space-between; gap:16px; margin:6px 0 24px; }
.admin-heading h1 { font-size:1.8rem; margin:3px 0; }
.admin-status { background:#e6f4ea; color:#347a55; border-radius:99px; padding:7px 12px; font-size:.8rem; white-space:nowrap; }
.admin-status i { display:inline-block; width:7px; height:7px; margin-right:4px; background:#53aa76; border-radius:50%; }
.admin-main > .card { border-radius:17px; }
#view-elder { background:#f4f8f3; }
.elder-header { background:#236c56; }
.next-card { background:#16745b; }
.elder-main .card { background:#fff; }
#view-auth { background:radial-gradient(circle at 20% 18%,#397b65 0,transparent 38%),linear-gradient(145deg,#153e35,#1f6652); }
.auth-card { border-radius:24px; }
@media (max-width:900px) {
 .family-layout { display:block; }
 .family-nav { padding:10px 12px; gap:10px; }
 .family-brand { padding:0; }
 .family-brand .brand-logo { width:36px; height:36px; font-size:1.2rem; border-radius:11px; }
 .family-main { padding:24px 20px 48px; }
}
@media (max-width:620px) {
 .family-main { padding:18px 14px 40px; }
 .family-topbar { gap:12px; }
 .family-heading h1 { font-size:1.5rem; }
 .section-eyebrow { font-size:.62rem; }
 .overview-intro { min-height:125px; padding:20px; }
 .overview-intro h2 { font-size:1.12rem; }
 .overview-intro p { font-size:.82rem; }
 .overview-emblem { font-size:2.8rem; margin:0 5px 0 12px; }
 .overview-panels { grid-template-columns:minmax(0,1fr); }
 .overview-panels > .card:last-child { grid-column:auto; }
 .overview-panels > .card { padding:19px; }
 .stat { min-height:105px; padding:15px; }
 .admin-heading h1 { font-size:1.45rem; }
 .admin-main { padding:18px 14px 40px; }
 .ai-input-row { flex-wrap:wrap; }
 .ai-input-row input { min-width:100%; }
 .auth-card { padding:30px 24px; }
}
.family-topbar-right { display:flex; align-items:center; flex-wrap:wrap; }
@media (max-width:900px) {
 .family-brand, .family-nav-foot, .nav-list { flex-shrink:0; }
 .family-brand .brand-name { white-space:nowrap; }
}

/* 药伴 · 家庭用药手账：纸张、印章与清晰的时间秩序 */
:root { --bg:#f3f0e9; --card:#fffefa; --ink:#202c3b; --muted:#66717c; --line:#deded7; --primary:#294b7c; --primary-d:#1d375e; --primary-l:#e8edf5; --shadow:none; --shadow-l:0 18px 50px rgba(30,39,55,.18); }
body { background:var(--bg); }
::selection { background:#d3deed; }
.card, .card:hover { background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:none; }
.card h3 { color:var(--ink); }
.btn { border-radius:6px; }
.btn.primary, .btn.primary:hover { background:var(--primary); border:1px solid var(--primary); box-shadow:none; }
.btn.primary:hover { background:var(--primary-d); transform:none; }
.btn.sos { background:#a7352b; border:1px solid #a7352b; box-shadow:none; }
input:focus, select:focus, textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px #dce6f2; }
.family-layout { grid-template-columns:230px minmax(0,1fr); }
.family-nav { background:#24374f; padding:30px 16px; gap:28px; }
.family-brand { border-bottom:1px solid #586679; padding:0 9px 24px; }
.family-brand .brand-logo, .admin-brand-mark { font-family:serif; width:43px; height:43px; border:1px solid #f5eee0; border-radius:3px; background:transparent; color:#fff8e8; font-size:1.65rem; font-weight:700; }
.family-brand .brand-name { letter-spacing:.16em; color:#fff8eb; }
.family-brand .brand-sub { color:#c7cfda; font-size:.7rem; letter-spacing:.02em; }
.nav-list { gap:3px; }
.nav-btn { border-radius:3px; color:#d0d9e4; padding:14px 12px; }
.nav-index { font-size:.72rem; font-variant-numeric:tabular-nums; letter-spacing:.08em; color:#9aacc1; margin-right:12px; }
.nav-btn.active { background:#f5f1e7; color:#233d60; box-shadow:none; }
.nav-btn.active .nav-index { color:#526d8e; }
.family-nav-foot .btn { border-radius:4px; }
.family-main { max-width:1480px; padding:36px 44px 64px; }
.family-topbar { border-bottom:1px solid #c9c8bf; margin-bottom:24px; padding-bottom:22px; }
.section-eyebrow { color:#68798d; letter-spacing:.12em; }
.family-heading h1 { color:#202c3b; }
.family-heading p { color:#66717c; }
.overview-intro { position:relative; min-height:155px; padding:24px 30px; margin-bottom:0; border:1px solid #cfd2ce; border-bottom:0; border-radius:8px 8px 0 0; background:#fffefa; color:var(--ink); justify-content:flex-start; gap:25px; }
.overview-intro::after { display:none; }
.overview-date { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:90px; padding-right:25px; border-right:1px solid #d8dad5; color:#294b7c; font-size:.8rem; letter-spacing:.12em; }
.overview-day { font-family:Georgia,serif; font-size:4rem; line-height:1; letter-spacing:-.06em; }
.overview-copy { flex:1; min-width:0; }
.overview-kicker { color:#6e7880; font-size:.78rem; letter-spacing:.05em; }
.overview-intro h2 { margin:8px 0 4px; font-size:1.4rem; }
.overview-intro p { color:#68727a; }
.overview-stamp { border:1px solid #a74d3d; color:#a74d3d; font-family:serif; font-weight:700; line-height:1.1; text-align:center; padding:6px; transform:rotate(-7deg); }
#tab-overview .stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; background:#fffefa; border:1px solid #cfd2ce; border-top:1px solid #e3e3dc; border-radius:0 0 8px 8px; margin-bottom:18px; overflow:hidden; }
#tab-overview .stat { display:flex; flex-direction:column; position:relative; min-height:112px; padding:18px 25px; border:0; border-right:1px solid #e3e3dc; border-radius:0; background:transparent; box-shadow:none; }
#tab-overview .stat:last-child { border-right:0; }
#tab-overview .stat::before { display:none; }
#tab-overview .stat-label { order:-1; margin:0 0 5px; color:#596877; }
#tab-overview .stat-num { font-family:Georgia,serif; font-size:2rem; line-height:1.1; color:#263e5f; }
#tab-overview .stat.bad .stat-num { color:#a7352b; }
#tab-overview .stat-sub { color:#69747d; }
.allgood { background:#e9eee9; color:#365c4f; border-color:#cddbd1; }
.overview-panels { gap:14px; }
.overview-panels > .card { border-radius:8px; }
.week-bar { background:#c3cfdd; }
.week-bar.today { background:#294b7c; }
.admin-wrap { background:var(--bg); }
.admin-topbar { background:#fffefa; border-bottom:1px solid #d8d9d2; }
.admin-brand { color:#24374f; }
.admin-brand-mark { background:#24374f; border-color:#24374f; }
.admin-main > .card, .admin-main .stat { border-radius:8px; }
#view-elder { background:#f2f0e9; }
.elder-header { background:#283f5e; border-radius:0; }
.elder-ring-inner { background:#283f5e; }
.elder-main .card { background:#fffefa; border-radius:8px; }
.next-card { background:#304f78; border-radius:8px; box-shadow:none; }
.next-right .btn { color:#243e62; }
.elder-footer { background:#fffefa; border-color:#d9dbd8; }
.elder-footer .btn.foot { background:#f0f1ee; border-color:#d3d7d5; }
#view-auth { background:#273d5a; }
.auth-card { background:#fffefa; border-radius:8px; box-shadow:0 20px 60px rgba(10,20,35,.22); }
.auth-tab.active { background:#294b7c; }
html[data-contrast="1"] #view-elder .elder-header, html[data-contrast="1"] #view-elder .next-card { background:#17283d; }
html[data-contrast="1"] #view-elder .elder-ring-inner { background:#17283d; }
@media (max-width:900px) {
 .family-layout { display:block; }
 .family-nav { display:grid; grid-template-columns:1fr auto; gap:12px; padding:12px 16px 0; overflow:visible; }
 .family-brand { grid-column:1; grid-row:1; border:0; padding:0; }
 .family-nav-foot { grid-column:2; grid-row:1; }
 .family-nav-foot .btn { min-height:38px; padding:8px 12px; }
 .nav-list { grid-column:1 / -1; grid-row:2; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
 .nav-btn { justify-content:center; text-align:center; padding:10px 4px; min-height:44px; font-size:.9rem; }
 .nav-index { display:none; }
 .family-main { padding:24px 20px 48px; }
}
@media (max-width:620px) {
 .family-main { padding:20px 14px 40px; }
 .family-topbar { padding-bottom:16px; }
 .overview-intro { padding:20px 16px; min-height:130px; gap:15px; }
 .overview-date { min-width:65px; padding-right:14px; }
 .overview-day { font-size:3rem; }
 .overview-intro h2 { font-size:1.12rem; }
 .overview-stamp { font-size:.75rem; }
 #tab-overview .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 #tab-overview .stat { min-height:96px; padding:14px 16px; border-bottom:1px solid #e3e3dc; }
 #tab-overview .stat:nth-child(2) { border-right:0; }
 #tab-overview .stat:nth-child(n+3) { border-bottom:0; }
 .overview-panels { grid-template-columns:minmax(0,1fr); }
 .overview-panels > .card:last-child { grid-column:auto; }
 .elder-head { flex-wrap:wrap; }
}

/* 药伴 · 关怀新版：仅调整呈现，不改变数据与交互 */
:root {
  --bg:#f3f7f3; --card:#fff; --ink:#173e35; --muted:#667e74;
  --line:#dce9df; --primary:#176e56; --primary-d:#105642; --primary-l:#e5f3e9;
  --accent:#e58965; --shadow:0 8px 28px rgba(26,75,53,.055);
  --shadow-l:0 20px 60px rgba(21,63,45,.16);
}
body { background:var(--bg); }
::selection { background:#cce9d4; }
.card, .card:hover { background:var(--card); border:1px solid var(--line); border-radius:20px; box-shadow:var(--shadow); }
.btn { border-radius:12px; }
.btn.primary, .btn.primary:hover { background:var(--primary); border-color:var(--primary); box-shadow:none; }
.btn.primary:hover { background:var(--primary-d); }
.btn.sos { background:#b93d34; border-color:#b93d34; }
input, select, textarea { border-color:#d7e5dc; border-radius:12px; }
input:focus, select:focus, textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px #d8eee1; }
button:focus-visible, a:focus-visible { outline:3px solid #e59b71; outline-offset:3px; }
.family-layout { grid-template-columns:246px minmax(0,1fr); }
.family-nav { background:#164d3f; padding:32px 17px; gap:32px; }
.family-brand { border-bottom:1px solid rgba(255,255,255,.16); padding:0 8px 26px; }
.family-brand .brand-logo, .admin-brand-mark { width:47px; height:47px; border:0; border-radius:15px; background:#d9f0df; color:#155d49; font-family:inherit; font-size:1.45rem; }
.family-brand .brand-name { letter-spacing:.08em; color:#fff; }
.family-brand .brand-sub { color:#c4ded0; letter-spacing:0; }
.nav-list { gap:8px; }
.nav-btn { border-radius:12px; color:#d8e9de; padding:14px 13px; }
.nav-btn:hover { background:rgba(255,255,255,.1); }
.nav-btn.active { background:#e4f3e7; color:#164d3f; box-shadow:none; }
.nav-btn.active .nav-index { color:#3c7d64; }
.nav-index { color:#a8d0b9; }
.family-nav-foot .btn { border-radius:12px; }
.family-main { padding:34px 40px 60px; }
.family-topbar { border:0; padding:0 0 25px; margin-bottom:0; }
.family-heading h1 { color:var(--ink); font-size:1.85rem; }
.family-heading p { color:var(--muted); }
.section-eyebrow { color:#6d9a84; letter-spacing:.1em; }
.pill, .es-btn { border-color:var(--line); }
.overview-intro { min-height:170px; border:0; border-radius:22px 22px 0 0; background:#dcefe2; padding:27px 32px; gap:26px; }
.overview-date { border-color:#b8dac3; color:#176e56; }
.overview-day { font-family:inherit; font-weight:750; letter-spacing:-.04em; }
.overview-kicker, .overview-intro p { color:#537c67; }
.overview-intro h2 { color:#164d3f; }
.overview-stamp { border:0; border-radius:50%; background:#c8e5d0; color:#37765a; font-family:inherit; font-size:.8rem; width:60px; height:60px; display:grid; place-items:center; transform:none; line-height:1.3; }
#tab-overview .stat-grid { border:1px solid var(--line); border-top:0; border-radius:0 0 22px 22px; overflow:hidden; background:#fff; box-shadow:var(--shadow); }
#tab-overview .stat { padding:21px 24px; min-height:115px; border-color:#e8f0ea; }
#tab-overview .stat-label { color:var(--muted); }
#tab-overview .stat-num { font-family:inherit; color:#176e56; }
#tab-overview .stat.bad .stat-num { color:#ba4e40; }
.allgood { background:#e9f5eb; border-color:#d3ebd8; color:#286549; }
.overview-panels { gap:16px; }
.overview-panels > .card, .admin-main > .card { border-radius:20px; }
.week-bar { background:#bcdcca; }
.week-bar.today { background:#1d8062; }
.med-card { border-radius:20px; border:1px solid var(--line); border-top:5px solid var(--mc,var(--primary)); box-shadow:var(--shadow); }
.ocr-hero { background:#e3f2e8; border-radius:20px; }
.dropzone { border-radius:18px; background:#f8fbf8; }
.modal-card { border-radius:22px; }
.admin-wrap { background:var(--bg); }
.admin-topbar { background:#fff; border-color:var(--line); }
.admin-brand { color:#164d3f; }
.admin-brand-mark { width:38px; height:38px; font-size:1.2rem; }
.admin-main .stat { border-radius:16px; border-color:var(--line); }
#view-elder { background:#f2f8f2; }
.elder-header { background:#176b53; border-radius:0 0 1.3em 1.3em; }
.elder-ring-inner { background:#176b53; }
#view-elder .card { border:1px solid #d7e9dc; border-radius:1em; box-shadow:var(--shadow); }
.next-card { background:#1a795e; border-radius:1em; box-shadow:0 .4em 1.2em rgba(26,90,61,.13); }
.next-right .btn { color:#145c46; }
.elder-footer { background:#fff; border-color:#d8e9dc; }
.elder-footer .btn.foot { background:#edf6ef; border-color:#d5e8d9; }
html[data-contrast="1"] #view-elder .elder-header, html[data-contrast="1"] #view-elder .next-card { background:#173b28; }
html[data-contrast="1"] #view-elder .elder-ring-inner { background:#173b28; }
html[data-contrast="1"] #view-elder .card { border:2px solid #000; }
#view-auth { background:radial-gradient(circle at 15% 20%,#d0ead4 0,transparent 38%),linear-gradient(135deg,#edf7ed,#e0f0e6); padding:32px 20px; }
.auth-card { max-width:440px; border:1px solid #d9eade; border-radius:24px; background:#fff; padding:36px; box-shadow:0 24px 70px rgba(31,93,60,.12); }
.auth-brand .brand-logo { display:inline-grid; place-items:center; width:64px; height:64px; border-radius:20px; background:#e6f5e9; font-size:2.1rem; }
.auth-brand h1 { color:#174d3d; margin-top:8px; }
.auth-tabs { background:#edf5ee; }
.auth-tab.active { background:#176e56; color:#fff; }
.admin-entry { border-radius:12px; }
#bootScreen { background:#f2f8f2; color:#176e56; }
@media (max-width:900px) {
 .family-layout { display:block; }
 .family-nav { padding:13px 16px 0; gap:12px; }
 .family-brand { padding:0; }
 .family-brand .brand-logo { width:38px; height:38px; border-radius:12px; }
 .nav-list { gap:4px; }
 .nav-btn { border-radius:10px 10px 0 0; }
 .family-main { padding:24px 20px 48px; }
}
@media (max-width:620px) {
 .family-main { padding:20px 14px 40px; }
 .family-topbar { padding:0 0 20px; }
 .overview-intro { min-height:130px; padding:20px 17px; gap:15px; }
 .overview-date { min-width:65px; padding-right:14px; }
 .overview-stamp { width:48px; height:48px; flex:none; font-size:.7rem; }
 #tab-overview .stat { min-height:96px; padding:15px 17px; }
 .auth-card { padding:28px 22px; }
 .elder-head { flex-wrap:wrap; }
}

/* 健康问答 */
.health-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}.health-header h2{margin:3px 0 6px;font-size:1.6rem}.health-header p{margin:0;color:var(--muted)}.health-eyebrow{font-size:.72rem;letter-spacing:.14em;font-weight:700;color:var(--primary)}
.health-notice,.health-privacy{padding:12px 16px;border-radius:12px;margin-bottom:12px;line-height:1.6;font-size:.9rem}.health-notice{background:#fff4e1;color:#76500c}.health-privacy{background:#edf6f4;color:#315b51}.health-chat-card{background:var(--card,#fff);border:1px solid var(--line,#e4e9e7);border-radius:18px;overflow:hidden}.health-messages{height:min(48vh,480px);min-height:260px;overflow:auto;padding:24px;display:flex;flex-direction:column;gap:16px}.health-welcome{margin:auto;text-align:center;color:var(--muted);max-width:430px;line-height:1.7}.health-welcome strong{display:block;color:var(--text);font-size:1.2rem}.health-message{max-width:min(85%,700px);padding:14px 16px;border-radius:15px;line-height:1.7;overflow-wrap:anywhere}.health-message.from-user{align-self:flex-end;background:#e5f3ef}.health-message.from-ai{align-self:flex-start;background:#f5f7f6}.health-message-label{font-size:.78rem;font-weight:700;color:#527367;margin-bottom:4px}.health-message-body p{margin:.35em 0}.health-message-body ul,.health-message-body ol{padding-left:1.5em}.health-error{color:#b42318;padding:0 20px}.health-error:not(:empty){padding:8px 20px}.health-composer{padding:16px 20px 20px;border-top:1px solid var(--line,#e4e9e7)}.health-input-label{display:block;font-weight:600;margin-bottom:8px}.health-composer textarea{width:100%;resize:vertical;min-height:72px}.health-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px}.health-actions span{font-size:.8rem;color:var(--muted)}@media(max-width:600px){.health-header{align-items:center}.health-messages{padding:16px;min-height:240px}.health-message{max-width:94%}.health-actions{align-items:flex-end}}
.feedback-item{padding:14px 0;border-bottom:1px solid var(--line,#e4e9e7);overflow-wrap:anywhere}.feedback-item:last-child{border-bottom:0}.feedback-item p{margin:8px 0;white-space:normal}#feedbackText{display:block;width:100%;margin-top:8px;resize:vertical}
.health-layout{display:grid;grid-template-columns:minmax(190px,245px) minmax(0,1fr);gap:14px;align-items:stretch}.health-history-panel{background:#fff;border:1px solid var(--line,#e4e9e7);border-radius:18px;padding:16px;min-width:0}.health-history-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.health-search-label{display:block;margin:12px 0 5px;font-size:.82rem;color:var(--muted)}#healthSearch{width:100%}.health-history-list{display:flex;flex-direction:column;gap:6px;max-height:390px;overflow:auto;margin-top:12px}.health-history-item{display:flex;flex-direction:column;gap:3px;width:100%;text-align:left;border:1px solid transparent;background:transparent;border-radius:10px;padding:10px;cursor:pointer;overflow-wrap:anywhere}.health-history-item:hover,.health-history-item.active{background:#edf6f0;border-color:#cde4d4}.health-history-item small,.health-history-empty{color:var(--muted);font-size:.8rem}.health-history-empty{padding:10px}.health-current-title{padding:14px 20px;border-bottom:1px solid var(--line,#e4e9e7);font-weight:700;overflow-wrap:anywhere}@media(max-width:700px){.health-layout{grid-template-columns:1fr}.health-history-list{max-height:180px}.health-history-panel{padding:12px}}

.health-history-row{display:flex;align-items:center;gap:4px;min-width:0}.health-history-row .health-history-item{flex:1;min-width:0}.health-history-delete{border:0;background:transparent;color:#a23d3d;font-size:.78rem;padding:8px 5px;cursor:pointer}.health-history-delete:disabled{opacity:.5;cursor:default}

/* 金融模块入口 */
.finance-entry{position:fixed;right:22px;bottom:calc(24px + env(safe-area-inset-bottom));z-index:220;display:flex;align-items:center;gap:8px;padding:13px 19px;border-radius:16px;background:#214e40;color:#fff;text-decoration:none;font-size:15px;font-weight:650;box-shadow:0 8px 26px #103c3233;border:1px solid #ffffff40}.finance-entry:hover{background:#316c56}.finance-entry:focus-visible{outline:3px solid #efb658;outline-offset:4px}.finance-entry span{font-size:22px;line-height:1}body:has(#view-elder:not(.hidden)) .finance-entry{bottom:calc(112px + env(safe-area-inset-bottom))}@media(max-width:600px){.finance-entry{right:14px;padding:11px 14px;font-size:14px;border-radius:14px}body:has(#view-elder:not(.hidden)) .finance-entry{bottom:calc(108px + env(safe-area-inset-bottom))}}
