/* ════════════════════════════════════════════════════════════════
   湖山社区智慧赋能养老与社区服务平台 · 共享设计系统 v1.0
   现代社区治理 + 温暖养老 + 专业政务数字化
   色板：社区蓝 / 湖水青 / 暖绿 + 米白·浅灰·深灰 + 少量橙色提醒
   ════════════════════════════════════════════════════════════════ */

/* ─── 1. Tokens ─────────────────────────────────────────────── */
:root {
  /* 品牌基础色（全部以 oklch 定义，禁止引入裸 hex） */
  --bg:        oklch(97.2% 0.007 90);   /* 米白 */
  --surface:   oklch(100% 0 0);         /* 卡片/白 */
  --surface-2: oklch(98.2% 0.006 90);   /* 次级底 */
  --fg:        oklch(24% 0.022 252);    /* 深灰蓝 */
  --muted:     oklch(51% 0.02 252);     /* 次要文字 */
  --border:    oklch(90.8% 0.012 232);  /* 发丝线 */

  /* 品牌主色 */
  --accent:      oklch(51% 0.15 258);   /* 社区蓝 */
  --accent-deep: oklch(44% 0.155 258);  /* 蓝-深 */
  --cyan:        oklch(67% 0.115 198);  /* 湖水青 */
  --green:       oklch(59% 0.13 156);   /* 暖绿 · 正常/完成 */
  --orange:      oklch(67% 0.15 55);    /* 橙 · 待处理/关注 */
  --red:         oklch(55% 0.195 25);   /* 红 · 紧急/高风险 */
  --blue:        oklch(55% 0.14 258);   /* 蓝 · 处理中/信息 */

  /* 派生（color-mix 现场推导，不另设 token 库） */
  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --cyan-soft:   color-mix(in oklch, var(--cyan) 14%, transparent);
  --green-soft:  color-mix(in oklch, var(--green) 13%, transparent);
  --orange-soft: color-mix(in oklch, var(--orange) 14%, transparent);
  --red-soft:    color-mix(in oklch, var(--red) 12%, transparent);
  --blue-soft:   color-mix(in oklch, var(--blue) 12%, transparent);
  --fg-soft:     color-mix(in oklch, var(--fg) 5%, transparent);

  /* 渐变（仅用于欢迎卡等品牌高光时刻，克制使用） */
  --grad-brand: linear-gradient(135deg, oklch(48% 0.15 258), oklch(58% 0.12 224));
  --grad-cyan:  linear-gradient(135deg, oklch(60% 0.13 205), oklch(64% 0.12 175));

  /* 字体 */
  --font-display: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei',
               'Noto Sans SC', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Consolas, monospace;

  /* 尺寸 */
  --radius: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px oklch(24% 0.03 258 / 0.06);
  --shadow-md: 0 8px 28px oklch(24% 0.03 258 / 0.1);
  --phone-w: 390px;
  --side-w: 236px;
  --topbar-h: 64px;
  --tabbar-h: 60px;
}

/* ─── 2. Reset & base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* 可聚焦元素必须有清晰 focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 无障碍：尊重系统字号偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── 3. 通用排版 ───────────────────────────────────────────── */
.h1, .h2, .h3 { font-family: var(--font-display); font-weight: 600; }
.h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.16; letter-spacing: -0.01em; }
.h2 { font-size: clamp(22px, 3vw, 30px); line-height: 1.24; }
.h3 { font-size: 18px; line-height: 1.35; }
.lead { font-size: 16px; color: var(--muted); max-width: 56ch; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase; margin: 0 0 14px;
}
.meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

/* ─── 4. 按钮 ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px; font-weight: 500; letter-spacing: 0;
  transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-outline { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }
.btn-danger { background: var(--red); color: var(--surface); border-color: var(--red); }
.btn-danger:hover { background: oklch(48% 0.2 25); }
.btn-success { background: var(--green); color: var(--surface); border-color: var(--green); }
.btn-success:hover { background: oklch(52% 0.14 156); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 52px; font-size: 17px; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger-soft:hover { background: color-mix(in oklch, var(--red) 18%, transparent); }

/* ─── 5. 徽标 / 标签 ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; line-height: 1.4;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green  { color: var(--green);  background: var(--green-soft); }
.badge-blue   { color: var(--blue);   background: var(--blue-soft); }
.badge-orange { color: var(--orange); background: var(--orange-soft); }
.badge-red    { color: var(--red);    background: var(--red-soft); }
.badge-gray   { color: var(--muted);  background: var(--fg-soft); }
.badge-accent { color: var(--accent); background: var(--accent-soft); }
.badge-cyan   { color: oklch(45% 0.13 198); background: var(--cyan-soft); }
.badge-dotless::before { display: none; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--radius-full);
  border: 1px solid var(--border); color: var(--muted);
  font-size: 12px; background: var(--surface);
}

/* ─── 6. 卡片 ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }

/* ─── 7. 输入 ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: oklch(62% 0.015 252); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

/* ─── 8. 表格 ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 14px; text-align: left; color: var(--muted); font-weight: 500;
  font-size: 12px; letter-spacing: .03em; white-space: nowrap;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--fg-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num-col { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table .link { color: var(--accent); font-weight: 500; }
.table .link:hover { text-decoration: underline; }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ─── 9. 标签页 / 分段 ──────────────────────────────────────── */
.tabs { display: flex; gap: 6px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-full); width: fit-content; }
.tab-btn {
  padding: 7px 16px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: all .15s ease; white-space: nowrap;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); font-weight: 600; }
.tab-btn-red.active { color: var(--red); }

/* 下拉筛选 */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── 10. 状态时间线 ────────────────────────────────────────── */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: var(--border); border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 20px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -22px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; border: 3px solid var(--surface);
  background: var(--border); box-shadow: 0 0 0 1px var(--border);
}
.tl-item.done .tl-dot { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.tl-item.active .tl-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-item.danger .tl-dot { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.tl-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.tl-text { font-size: 14px; font-weight: 500; }
.tl-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════
   居民端（手机 App）
   ════════════════════════════════════════════════════════════════ */
.resident {
  background: var(--bg);
  display: flex; justify-content: center;
}

/* 390px 手机容器 */
.phone {
  width: var(--phone-w); min-height: 100vh;
  background: var(--surface);
  position: relative;
  box-shadow: 0 0 0 1px var(--border), 0 24px 64px oklch(24% 0.03 258 / 0.14);
}
/* 桌面侧浮标：返回演示首页 */
.desk-float {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-full);
  background: oklch(100% 0 0 / 0.9); backdrop-filter: blur(8px);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: 13px; color: var(--fg); transition: all .15s ease;
}
.desk-float:hover { border-color: var(--accent); color: var(--accent); }
.desk-float svg { width: 15px; height: 15px; }

/* 状态栏 */
.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 34px; padding: 0 20px;
  font-size: 12px; font-weight: 600; color: var(--fg);
  background: var(--surface);
}
.statusbar svg { width: 15px; height: 15px; }
.sb-icons { display: flex; align-items: center; gap: 6px; }

/* 顶部栏 */
.appbar {
  display: flex; align-items: center; gap: 4px;
  height: 52px; padding: 0 8px;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklch, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.appbar.is-bordered { border-bottom-color: var(--border); }
.appbar-back {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius); color: var(--fg);
}
.appbar-back:hover { background: var(--fg-soft); }
.appbar-back svg { width: 20px; height: 20px; }
.appbar-title { flex: 1; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.appbar-actions { display: flex; align-items: center; gap: 2px; }
.appbar-actions .icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); color: var(--muted); }
.appbar-actions .icon-btn:hover { background: var(--fg-soft); color: var(--fg); }
.appbar-actions .icon-btn svg { width: 20px; height: 20px; }

/* 内容区 */
.app-body { padding: 0 16px 90px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: var(--phone-w); height: var(--tabbar-h);
  display: flex; align-items: stretch;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px;
  transition: color .15s ease;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent); font-weight: 600; }
.tab:hover { color: var(--fg); }

/* 问候区 */
.greet-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; }
.greet-name { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.greet-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.weather-chip {
  display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--cyan-soft); color: oklch(42% 0.12 200);
  font-size: 12px; font-weight: 500; line-height: 1.3;
}
.weather-chip b { font-family: var(--font-mono); font-size: 15px; }

/* 欢迎卡 */
.welcome-card {
  position: relative; overflow: hidden;
  margin-top: 16px; padding: 22px 20px;
  border-radius: var(--radius-lg);
  background: var(--grad-brand);
  color: var(--surface);
  box-shadow: 0 12px 32px color-mix(in oklch, var(--accent) 30%, transparent);
}
.welcome-card::after {
  content: ''; position: absolute; right: -28px; top: -34px; width: 150px; height: 150px;
  border-radius: 50%; background: color-mix(in oklch, var(--cyan) 35%, transparent);
}
.welcome-card .wc-eyebrow { font-size: 13px; opacity: .9; letter-spacing: .05em; }
.welcome-card .wc-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin-top: 6px; line-height: 1.25; }
.welcome-card .wc-sub { font-size: 13px; opacity: .92; margin-top: 8px; }
.welcome-card .wc-mark { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; display: grid; place-items: center; background: oklch(100% 0 0 / 0.16); border-radius: 14px; }
.welcome-card .wc-mark svg { width: 22px; height: 22px; }

/* 区块标题 */
.sect-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.sect-title h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.sect-title .more { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.sect-title .more:hover { color: var(--accent); }
.sect-title .more svg { width: 14px; height: 14px; }

/* 核心服务 2×2 */
.core-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.core-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px; min-height: 104px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
  text-align: left;
}
.core-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in oklch, var(--accent) 30%, var(--border)); }
.core-btn:active { transform: translateY(0); }
.core-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.core-icon svg { width: 22px; height: 22px; }
.core-label { font-size: 16px; font-weight: 600; }
.core-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.core-btn.danger { border-color: color-mix(in oklch, var(--red) 28%, var(--border)); }
.core-btn.danger .core-icon { background: var(--red-soft); color: var(--red); }
.core-btn.danger .core-label { color: var(--red); }
.core-btn.cyan .core-icon { background: var(--cyan-soft); color: oklch(45% 0.12 200); }

/* 快捷服务 */
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; transition: all .15s ease;
}
.quick-btn svg { width: 20px; height: 20px; color: var(--accent); }
.quick-btn:hover { background: var(--accent-soft); color: var(--accent); }
.quick-btn:active { transform: scale(.96); }

/* 关怀卡片 */
.care-card { display: flex; gap: 14px; padding: 16px; }
.care-date {
  flex: none; width: 52px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--cyan-soft); color: oklch(42% 0.12 200); border-radius: 14px;
  line-height: 1.1;
}
.care-date .d { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.care-date .m { font-size: 12px; }
.care-main { flex: 1; min-width: 0; }
.care-title { font-size: 15px; font-weight: 600; }
.care-line { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.care-line svg { width: 14px; height: 14px; flex: none; }
.care-cta { margin-top: 10px; }

/* 通知/消息列表 */
.msg-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.msg-item:last-child { border-bottom: 0; }
.msg-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.msg-icon svg { width: 19px; height: 19px; }
.msg-icon.blue { background: var(--blue-soft); color: var(--blue); }
.msg-icon.green { background: var(--green-soft); color: var(--green); }
.msg-icon.orange { background: var(--orange-soft); color: var(--orange); }
.msg-icon.red { background: var(--red-soft); color: var(--red); }
.msg-title { font-size: 14px; font-weight: 500; }
.msg-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.msg-time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); flex: none; }

/* 列表行 */
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.list-item .ic svg { width: 19px; height: 19px; }
.list-item .ic.green { background: var(--green-soft); color: var(--green); }
.list-item .ic.orange { background: var(--orange-soft); color: var(--orange); }
.list-item .ic.red { background: var(--red-soft); color: var(--red); }
.list-item .ic.cyan { background: var(--cyan-soft); color: oklch(45% 0.12 200); }
.list-item .li-label { font-size: 15px; font-weight: 500; }
.list-item .li-desc { font-size: 13px; color: var(--muted); margin-top: 1px; }
.list-item .chev { color: var(--muted); flex: none; }
.list-item .chev svg { width: 16px; height: 16px; }

/* 分类选择卡 */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-size: 14px; font-weight: 500;
  transition: all .15s ease; text-align: left;
}
.cat-card .cc-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--fg-soft); color: var(--muted); }
.cat-card .cc-ic svg { width: 16px; height: 16px; }
.cat-card:hover { border-color: color-mix(in oklch, var(--accent) 40%, var(--border)); }
.cat-card.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cat-card.selected .cc-ic { background: var(--accent); color: var(--surface); }
.cat-card.three { grid-column: span 2; }

/* 上传框 */
.upload-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 100px; border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--muted); font-size: 13px;
  transition: all .15s ease;
}
.upload-box svg { width: 26px; height: 26px; }
.upload-box:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.photo-strip { display: flex; gap: 8px; margin-top: 8px; }
.photo-thumb { width: 64px; height: 64px; border-radius: var(--radius); background: var(--fg-soft); display: grid; place-items: center; color: var(--muted); overflow: hidden; position: relative; }
.photo-thumb svg { width: 22px; height: 22px; }

/* 语音输入 */
.mic-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 500;
  transition: all .15s ease;
}
.mic-btn svg { width: 19px; height: 19px; }
.mic-btn.recording { background: var(--red); color: var(--surface); animation: pulse 1.2s ease infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }

/* 地址卡 */
.address-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.address-card .ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--cyan-soft); color: oklch(45% 0.12 200); }
.address-card .ic svg { width: 19px; height: 19px; }
.address-edit { color: var(--accent); font-size: 13px; flex: none; }

/* 成功反馈页 */
.success-screen { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 8px 20px; }
.success-icon { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); margin-bottom: 18px; animation: pop .4s cubic-bezier(.34,1.56,.64,1); }
.success-icon svg { width: 42px; height: 42px; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.success-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.success-desc { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.order-number {
  display: inline-block; margin-top: 14px; padding: 8px 18px;
  background: var(--fg-soft); border-radius: var(--radius); font-family: var(--font-mono);
  font-size: 16px; font-weight: 600; letter-spacing: .02em; color: var(--fg);
}
.success-note { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.success-note svg { width: 15px; height: 15px; }

/* 空状态 */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 0; color: var(--muted); font-size: 13px; }
.empty svg { width: 40px; height: 40px; opacity: .4; }

/* 骨架屏 */
.skeleton {
  position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, oklch(100% 0 0 / 0.6), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* 聊天 */
.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-end; }
.chat-msg .avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.chat-msg.me { flex-direction: row-reverse; }
.chat-msg.me .avatar { background: var(--green-soft); color: var(--green); }
.chat-bubble {
  max-width: 76%; padding: 11px 14px; border-radius: 16px;
  font-size: 15px; line-height: 1.55; position: relative;
  background: var(--surface-2); border: 1px solid var(--border);
}
.chat-msg.me .chat-bubble { background: var(--accent); color: var(--surface); border-color: var(--accent); border-bottom-right-radius: 5px; }
.chat-msg:not(.me) .chat-bubble { border-bottom-left-radius: 5px; }
.chat-bubble .cb-time { display: block; font-family: var(--font-mono); font-size: 10px; opacity: .65; margin-top: 6px; text-align: right; }
.chat-msg.risk .chat-bubble { background: var(--red-soft); border-color: color-mix(in oklch, var(--red) 40%, var(--border)); color: var(--fg); }
.chat-msg.risk .chat-bubble b { color: var(--red); }
.chat-options { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 46px; }
.chip-btn {
  padding: 9px 16px; border-radius: var(--radius-full); border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); font-size: 14px; font-weight: 500;
  transition: all .15s ease;
}
.chip-btn:hover { background: var(--accent); color: var(--surface); }
.chip-btn:active { transform: scale(.97); }
.chip-btn.danger { border-color: var(--red); color: var(--red); }
.chip-btn.danger:hover { background: var(--red); color: var(--surface); }
.chat-input {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 0;
  position: sticky; bottom: 0; background: var(--surface);
}
.chat-input .input { flex: 1; min-height: 44px; border-radius: var(--radius-full); padding-left: 16px; }
.chat-send { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--surface); display: grid; place-items: center; }
.chat-send svg { width: 20px; height: 20px; }
.chat-send:hover { background: var(--accent-deep); }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 6px 2px; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* 求助 */
.sos-big {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: 260px; border-radius: var(--radius-lg);
  background: var(--red-soft); border: 2px solid color-mix(in oklch, var(--red) 35%, transparent);
  color: var(--red);
}
.sos-big svg { width: 64px; height: 64px; animation: sos-pulse 1.6s ease infinite; }
@keyframes sos-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .85; } }
.sos-big .sb-label { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.sos-big .sb-sub { font-size: 14px; opacity: .85; }
.sos-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-size: 15px; font-weight: 500; text-align: left;
  transition: all .15s ease;
}
.sos-option svg { flex: none; width: 22px; height: 22px; color: var(--red); }
.sos-option:hover { border-color: var(--red); }
.sos-option.selected { border-color: var(--red); background: var(--red-soft); }
.sos-option .so-desc { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.contact-chips { display: flex; flex-direction: column; gap: 10px; }

/* 进度状态 */
.progress-card { padding: 20px; text-align: center; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; text-align: left; }
.progress-steps .ps { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.progress-steps .ps.done { color: var(--fg); }
.progress-steps .ps svg { width: 18px; height: 18px; flex: none; }
.progress-steps .ps.done svg { color: var(--green); }

/* 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: oklch(20% 0.02 258 / 0.45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: var(--radius-lg); padding: 24px 22px;
  box-shadow: var(--shadow-md); text-align: center;
  animation: slide-up .25s cubic-bezier(.34,1.4,.64,1);
}
@keyframes slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.modal-desc { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.6; text-align: left; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.modal-actions .btn { width: 100%; }

/* Toast */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 10px 18px; border-radius: var(--radius-full);
  background: var(--fg); color: var(--surface); font-size: 14px;
  box-shadow: var(--shadow-md); animation: toast-in .25s ease;
  display: inline-flex; align-items: center; gap: 8px; max-width: 80vw;
}
.toast svg { width: 16px; height: 16px; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes toast-in { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 分段（服务类型） */
.seg { display: flex; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 4px; }
.seg button { padding: 7px 16px; border-radius: var(--radius-full); font-size: 13px; color: var(--muted); font-weight: 500; }
.seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); font-weight: 600; }

/* 长辈模式 */
.resident.elder .phone { font-size: 19px; }
.resident.elder .core-btn { min-height: 128px; }
.resident.elder .core-label { font-size: 19px; }
.resident.elder .core-sub { font-size: 14px; }
.resident.elder .core-icon { width: 52px; height: 52px; }
.resident.elder .core-icon svg { width: 28px; height: 28px; }
.resident.elder .btn { min-height: 54px; font-size: 17px; }
.resident.elder .tab { font-size: 13px; }
.resident.elder .tab svg { width: 26px; height: 26px; }
.resident.elder .greet-name { font-size: 25px; }
.resident.elder .quick-btn { font-size: 14px; }
.resident.elder .quick-btn svg { width: 24px; height: 24px; }
.resident.elder .welcome-card .wc-title { font-size: 28px; }
.resident.elder .msg-title, .resident.elder .li-label, .resident.elder .chat-bubble { font-size: 16px; }
.resident.elder .appbar-title { font-size: 19px; }
.resident.elder .sect-title h3 { font-size: 18px; }

/* 演示模式横幅（旧版已退役，由统一引导条 .demo-guide 接管） */
.demo-banner { display: none !important; }

/* 统一演示引导条 */
.demo-guide {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 14px; margin: 12px 0;
  background: color-mix(in oklch, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 26%, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.demo-guide .dg-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-guide .dg-dots { display: flex; gap: 4px; }
.demo-guide .dg-dots i { width: 14px; height: 4px; border-radius: 999px; background: var(--border); }
.demo-guide .dg-dots i.on { background: var(--accent); }
.demo-guide .dg-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px;
  background: var(--accent); color: var(--surface);
  font-size: 12px; font-weight: 600;
}
.demo-guide .dg-chip svg { width: 13px; height: 13px; }
.demo-guide .dg-cur { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.demo-guide .dg-title { font-size: 14px; font-weight: 600; }
.demo-guide .dg-desc { font-size: 12px; color: var(--muted); flex: 1; min-width: 140px; }
.demo-guide .dg-actions { display: flex; gap: 8px; margin-left: auto; }
.demo-guide .dg-ports { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--border); padding-top: 8px; }
.demo-guide .dg-port {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 500;
  transition: all .15s ease;
}
.demo-guide .dg-port:hover { border-color: var(--accent); color: var(--accent); }
.demo-guide .dg-port.on { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.demo-guide .dg-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; transition: all .15s ease;
}
.demo-guide .dg-btn svg { width: 13px; height: 13px; }
.demo-guide .dg-btn.primary { background: var(--accent); color: var(--surface); }
.demo-guide .dg-btn.primary:hover { background: var(--accent-deep); }
.demo-guide .dg-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.demo-guide .dg-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 560px) {
  .demo-guide .dg-desc { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   管理后台（桌面 Dashboard）
   ════════════════════════════════════════════════════════════════ */
.admin { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }

/* 侧边栏 */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 30;
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side-logo .logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad-brand); color: var(--surface); display: grid; place-items: center; flex: none; }
.side-logo .logo-mark svg { width: 21px; height: 21px; }
.side-logo .logo-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.25; }
.side-logo .logo-sub { font-size: 11px; color: var(--muted); }
.side-group { padding: 8px 14px 4px; font-size: 11px; color: var(--muted); letter-spacing: .06em; font-family: var(--font-mono); text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 16px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: all .13s ease; position: relative;
}
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link:hover { background: var(--fg-soft); color: var(--fg); }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link.active::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-link .side-badge { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--red); color: var(--surface); font-weight: 600; }
.side-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--topbar-h); padding: 0 24px;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.topbar-meta svg { width: 15px; height: 15px; }
.admin-avatar { display: flex; align-items: center; gap: 9px; }
.admin-avatar .avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad-brand); color: var(--surface); font-size: 13px; font-weight: 600;
}
.admin-avatar .name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.admin-avatar .role { font-size: 11px; color: var(--muted); }

/* 内容区 */
.content { padding: 22px 24px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-intro { margin-bottom: 20px; }
.page-intro h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.page-intro p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 指标卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { padding: 18px; position: relative; overflow: hidden; }
.stat-card .sc-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; }
.stat-card .sc-ic svg { width: 19px; height: 19px; }
.stat-card .sc-num { font-family: var(--font-mono); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.stat-card .sc-label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat-card .sc-trend { position: absolute; top: 18px; right: 16px; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.stat-card .sc-trend svg { width: 13px; height: 13px; }
.stat-card .sc-trend.up { color: var(--green); }
.stat-card .sc-trend.down { color: var(--orange); }
.stat-card .sc-trend.flat { color: var(--muted); }

/* 网格组合 */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.7fr; gap: 14px; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 20px; }

/* 重点关注列表 */
.focus-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.focus-item:last-child { border-bottom: 0; }
.focus-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); font-size: 15px; font-weight: 600; }
.focus-item .fi-name { font-size: 15px; font-weight: 600; }
.focus-item .fi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.focus-item .fi-reason { font-size: 13px; color: var(--fg); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.focus-item .fi-reason svg { width: 14px; height: 14px; flex: none; }
.focus-item .fi-reason.risk { color: var(--red); }
.focus-item .fi-time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); flex: none; }
.focus-item .fi-actions { margin-top: 8px; display: flex; gap: 8px; }
.focus-item .fi-tag { margin-top: 6px; display: flex; gap: 6px; }

/* 实时动态 */
.feed-item { display: flex; gap: 12px; padding: 10px 0; }
.feed-item .fi-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; box-shadow: 0 0 0 3px var(--accent-soft); }
.feed-item .fi-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); flex: none; width: 46px; }
.feed-item .fi-text { font-size: 13.5px; color: var(--fg); }

/* 工单表格列缩略 */
.wo-type { display: inline-flex; align-items: center; gap: 6px; }
.wo-type svg { width: 15px; height: 15px; color: var(--muted); }

/* 详情三栏 */
.detail-3col { display: grid; grid-template-columns: 280px 1fr 300px; gap: 14px; align-items: start; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--muted); flex: none; }
.kv-row .v { font-weight: 500; text-align: right; }
.kv-row .v.num { font-family: var(--font-mono); }
.sect-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--font-mono); margin-bottom: 10px; }

/* AI 辅助面板 */
.ai-panel { background: var(--surface); border: 1px solid color-mix(in oklch, var(--cyan) 30%, var(--border)); border-radius: var(--radius-lg); overflow: hidden; }
.ai-panel .ai-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--cyan-soft); color: oklch(42% 0.12 200); font-weight: 600; font-size: 13.5px; }
.ai-panel .ai-head svg { width: 17px; height: 17px; }
.ai-panel .ai-body { padding: 16px; }
.ai-row { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.ai-row:last-child { border-bottom: 0; }
.ai-row .k { color: var(--muted); flex: none; min-width: 76px; }
.ai-row .v { font-weight: 500; }
.ai-conf { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; color: var(--green); font-weight: 600; }
.ai-conf svg { width: 13px; height: 13px; }
.ai-note { margin-top: 12px; padding: 12px; background: var(--fg-soft); border-radius: 10px; font-size: 13px; line-height: 1.6; color: var(--fg); border-left: 3px solid var(--cyan); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* 老人卡片 */
.elder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.elder-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.elder-card .ec-head { display: flex; align-items: center; gap: 12px; }
.elder-card .ec-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.elder-card .ec-name { font-size: 16px; font-weight: 600; }
.elder-card .ec-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.elder-card .ec-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.elder-card .ec-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.elder-card .ec-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.elder-card .ec-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.elder-card .ec-status.ok::before { background: var(--green); }
.elder-card .ec-status.watch::before { background: var(--orange); }
.elder-card .ec-status.alert::before { background: var(--red); }
.elder-card .ec-status.ok { color: var(--green); }
.elder-card .ec-status.watch { color: var(--orange); }
.elder-card .ec-status.alert { color: var(--red); }

/* 老人档案 */
.profile-hero { display: flex; align-items: center; gap: 18px; padding: 22px; }
.profile-hero .ph-avatar { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 600; background: var(--grad-brand); color: var(--surface); }
.profile-hero .ph-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.profile-hero .ph-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.profile-hero .ph-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.profile-hero .ph-actions { margin-left: auto; display: flex; gap: 8px; }

/* 分区网格 */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.detail-grid .card { display: flex; flex-direction: column; }
.info-block h4 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 8px; }

/* 设备卡片 */
.device-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.device-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.device-card .dc-head { display: flex; align-items: center; justify-content: space-between; }
.device-card .dc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--cyan-soft); color: oklch(45% 0.12 200); display: grid; place-items: center; }
.device-card .dc-ic svg { width: 20px; height: 20px; }
.device-card .dc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.device-card .dc-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.device-card .dc-status.on { color: var(--green); }
.device-card .dc-status.on::before { background: var(--green); }
.device-card .dc-status.off { color: var(--muted); }
.device-card .dc-status.off::before { background: var(--muted); }
.device-card .dc-name { font-size: 15px; font-weight: 600; }
.device-card .dc-sub { font-size: 12px; color: var(--muted); }

/* 告警卡 */
.alert-card { padding: 18px; border-left: 4px solid var(--orange); }
.alert-card.level-watch { border-left-color: var(--orange); }
.alert-card.level-high { border-left-color: var(--red); background: linear-gradient(0deg, var(--red-soft), var(--surface)); }
.alert-card .ac-head { display: flex; align-items: center; gap: 10px; }
.alert-card .ac-title { font-size: 15px; font-weight: 600; }
.alert-card .ac-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-left: auto; }
.alert-card .ac-desc { font-size: 13.5px; color: var(--fg); margin-top: 8px; line-height: 1.6; }
.alert-card .ac-desc b { color: var(--red); }
.alert-card .ac-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 图表 */
.chart-box { position: relative; width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend-item .sw { width: 10px; height: 10px; border-radius: 3px; }
.kpi-block { display: flex; flex-direction: column; align-items: center; padding: 18px; text-align: center; }
.kpi-block .kpi-num { font-family: var(--font-mono); font-size: 34px; font-weight: 600; line-height: 1.1; color: var(--accent); }
.kpi-block .kpi-label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.kpi-block .kpi-sub { font-size: 12px; margin-top: 4px; }

/* 进度条 */
.progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar .pb-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s ease; }
.progress-bar .pb-fill.green { background: var(--green); }
.progress-bar .pb-fill.orange { background: var(--orange); }

/* SVG 图表 */
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-line.cyan { stroke: var(--cyan); }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart-bar { fill: var(--accent); transition: fill .2s ease; }
.chart-bar:hover { fill: var(--accent-deep); }
.chart-bar.cyan { fill: var(--cyan); }
.chart-bar.green { fill: var(--green); }
.chart-area { stroke: none; fill: color-mix(in oklch, var(--accent) 22%, transparent); }
.chart-area.cyan { fill: color-mix(in oklch, var(--cyan) 22%, transparent); }
.chart-label { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.chart-title-label { fill: var(--fg); font-family: var(--font-body); font-size: 12px; font-weight: 600; }

/* 社区老人分布地图（真实区位 · 无锡市滨湖区蠡园街道湖山社区） */
.community-map { width: 100%; height: auto; display: block; }
.map-bg { fill: oklch(97.5% 0.007 210); }
.map-graticule { stroke: oklch(94% 0.006 215); stroke-width: 1; }
.map-water { fill: color-mix(in oklch, var(--cyan) 30%, var(--surface)); }
.map-water-line { stroke: color-mix(in oklch, var(--cyan) 42%, var(--border)); stroke-width: 1.5; fill: none; }
.map-mountain { fill: color-mix(in oklch, var(--green) 16%, var(--surface)); }
.map-zone-a { fill: color-mix(in oklch, var(--orange) 6%, var(--surface)); stroke: color-mix(in oklch, var(--orange) 32%, var(--border)); stroke-width: 1.5; }
.map-zone-b { fill: color-mix(in oklch, var(--accent) 5%, var(--surface)); stroke: color-mix(in oklch, var(--accent) 30%, var(--border)); stroke-width: 1.5; }
.map-zone-other { fill: oklch(96.8% 0.005 220); stroke: var(--border); stroke-width: 1.5; }
.map-zone-label { fill: var(--muted); font-size: 13px; font-family: var(--font-display); font-weight: 600; }
.map-road-hw { fill: oklch(97.8% 0.006 230); stroke: oklch(90.5% 0.014 240); stroke-width: 1; }
.map-road-center { stroke: color-mix(in oklch, var(--muted) 38%, transparent); stroke-width: 1.5; stroke-dasharray: 7 7; }
.map-road-label { fill: color-mix(in oklch, var(--muted) 88%, var(--fg)); font-size: 11px; font-family: var(--font-body); letter-spacing: .06em; }
.map-label { fill: color-mix(in oklch, var(--cyan) 75%, var(--muted)); font-size: 15px; font-family: var(--font-display); font-weight: 600; letter-spacing: .1em; }
.map-bus { fill: var(--surface); stroke: var(--orange); stroke-width: 1.5; }
.map-bus-label { fill: var(--orange); font-size: 10px; font-family: var(--font-mono); font-weight: 700; }
.map-building { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.map-building-label { fill: var(--muted); font-size: 11px; font-family: var(--font-body); font-weight: 600; }
.map-center-ring { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.map-center-dot { fill: var(--accent); }
.map-center-label { fill: var(--accent); font-size: 12px; font-family: var(--font-body); font-weight: 600; }
.map-marker { cursor: pointer; }
.map-marker .core { fill: var(--cyan); stroke: var(--surface); stroke-width: 2; transform-box: fill-box; transform-origin: center; transition: transform .15s ease; }
.map-marker.focus .core { fill: var(--red); }
.map-marker .halo { fill: color-mix(in oklch, var(--cyan) 20%, transparent); }
.map-marker.focus .halo { fill: color-mix(in oklch, var(--red) 22%, transparent); }
.map-marker .pulse { fill: none; stroke: var(--cyan); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: map-pulse 2.6s ease-out infinite; }
.map-marker.focus .pulse { stroke: var(--red); }
.map-marker:hover .core { transform: scale(1.45); }
.map-marker:hover .halo { opacity: .9; }
@keyframes map-pulse { 0% { transform: scale(.5); opacity: .85; } 70% { transform: scale(2.3); opacity: 0; } 100% { transform: scale(2.3); opacity: 0; } }
.map-compass { stroke: var(--muted); stroke-width: 1.2; fill: none; }
.map-compass-n { fill: var(--red); font-size: 14px; font-family: var(--font-display); font-weight: 700; }
.map-scale { stroke: var(--muted); stroke-width: 1.5; }
.map-scale-label { fill: var(--muted); font-size: 10px; font-family: var(--font-mono); }
.map-note { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-note svg { width: 14px; height: 14px; flex: none; }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; }

/* 模拟数据标注 */
.demo-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--orange-soft); color: var(--orange); }
.demo-tag svg { width: 12px; height: 12px; }

/* 系统接入 */
.integration-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.integration-row:last-child { border-bottom: 0; }
.integration-row .ig-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.integration-row .ig-ic svg { width: 20px; height: 20px; }
.integration-row .ig-name { font-size: 15px; font-weight: 600; }
.integration-row .ig-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.integration-row .ig-status { margin-left: auto; }

/* ─── 响应式 ─────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .elder-grid { grid-template-columns: repeat(2, 1fr); }
  .device-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-3col { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-2col, .grid-3col, .grid-2-1, .grid-1-2, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stat-grid, .elder-grid, .device-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 48px; }
}

/* 手机容器在小屏全宽 */
@media (max-width: 480px) {
  .phone { width: 100%; box-shadow: none; min-height: 100dvh; }
  .tabbar { width: 100%; }
  .desk-float { display: none; }
  .statusbar { display: none; }
}
