/* ============================================================
   老年人能力辅助评估系统 — 前端样式 v5（校园教务同款 · Apple 风浅蓝）
   设计语言：Apple 极简 × 浅天蓝 #4A7BF7 × 柔和白卡
   - 浅灰底 #F5F6FA、纯白卡片、14px 圆角、极淡中性阴影
   - 系统字体栈、胶囊按钮、克制动效
   - 保留全部功能类名与响应式断点
   ============================================================ */
/* 响应式字号：手机端保持原本字号（16px 根 = 原 px 值，不缩放）；平板(768px)及以上随视口丝滑放大 */
html { font-size: 16px; }
@media (min-width: 768px) {
  html { font-size: clamp(16px, 0.55vw + 12.8px, 21px); }
}
:root {
  --bg: #F5F6FA;              /* 浅灰底（模板色） */
  --bg-soft: #F2F3F5;         /* 次级灰底 */
  --surface: #FFFFFF;
  --surface-glass: rgba(255,255,255,.78);
  --ink: #1A1A1A;             /* 主文字（模板色） */
  --ink-2: #4E5969;
  --ink-3: #86909C;           /* 次文字（模板色） */
  --primary: #4A7BF7;          /* 主蓝（模板色） */
  --primary-dark: #3A66D9;
  --primary-soft: #EEF3FF;
  --primary-soft2: #F7FAFF;
  --accent: #FF9F0A;          /* 苹果橙点缀 */
  --accent-soft: #FFF4E0;
  --line: #F0F0F0;            /* 边框（模板色） */
  --danger: #FF3B30;          /* 苹果红 */
  --danger-soft: #FFEBEA;
  --success: #34C759;         /* 苹果绿 */
  --success-soft: #E8F9EE;
  --c1: #4A7BF7; --c2: #74B9FF; --c3: #34C759; --c4: #FF9F0A; --c5: #FF3B30;
  --radius: 14px;             /* 模板卡片圆角 */
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.03), 0 2px 12px rgba(0,0,0,.04);
  --shadow-md: 0 10px 32px rgba(0,0,0,.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 0.875rem; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cdd6e2; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b3bfcf; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录（左右分栏） ---------- */
.login-wrap { min-height: 100vh; display: flex; background: #fff; }
/* 左侧品牌区 */
.login-brand { flex: 1.1; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #4A7BF7 0%, #6EA8FF 55%, #74B9FF 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 56px 36px; }
.brand-deco { position: absolute; border-radius: 50%; background: rgba(255,255,255,.10); }
.brand-deco.d1 { width: 420px; height: 420px; top: -140px; right: -100px; }
.brand-deco.d2 { width: 260px; height: 260px; bottom: -80px; left: -60px; background: rgba(255,255,255,.08); }
.brand-deco.d3 { width: 120px; height: 120px; top: 40%; right: 18%; background: rgba(255,255,255,.12); }
.brand-inner { position: relative; z-index: 2; max-width: 480px; }
.brand-logo { width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; margin-bottom: 28px; }
.login-brand h1 { font-size: 2rem; font-weight: 700; line-height: 1.3;
  letter-spacing: .5px; margin-bottom: 14px; }
.brand-sub { font-size: 0.9375rem; opacity: .85; line-height: 1.7; margin-bottom: 44px; }
.brand-feats { display: flex; flex-direction: column; gap: 18px; }
.feat { display: flex; align-items: center; gap: 12px; font-size: 0.875rem;
  opacity: .95; }
.feat svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .9; }
.brand-foot { position: relative; z-index: 2; font-size: 0.75rem; opacity: .7; }
/* 右侧表单区 */
.login-side { flex: 1; display: flex; align-items: center; justify-content: center;
  background: #fff; padding: 40px 24px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 1.5rem; font-weight: 700; color: var(--ink);
  margin-bottom: 8px; }
.form-sub { font-size: 0.875rem; color: var(--ink-3); margin-bottom: 32px; }
.form-row { display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.8125rem; color: var(--ink-2); margin-bottom: 8px; }
/* 登录：密码显隐切换 + 记住账号 */
.pwd-box { position: relative; }
.pwd-box .ipt { padding-right: 44px; }
.pwd-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--ink-3); line-height: 1; padding: 4px;
  display: flex; align-items: center; justify-content: center; }
.pwd-toggle:hover { color: var(--ink); }
.remember { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ink-2); margin: 0 0 14px; cursor: pointer; user-select: none; }
/* 登录验证码 */
#captcha-box .captcha-refresh { background: none; border: none; cursor: pointer; font-size: 0.75rem;
  color: var(--primary); margin-left: 6px; padding: 2px 6px; vertical-align: middle; border-radius: 6px; }
#captcha-box .captcha-refresh:hover { background: var(--primary-soft); }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-q { min-width: 66px; text-align: center; padding: 11px 10px; border: 1.5px dashed var(--line);
  border-radius: 11px; font-size: 0.9375rem; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); }
.ipt { width: 100%; padding: 10px 14px; border: 1.5px solid #E5E6EB; border-radius: 8px;
  font-size: 0.875rem; background: #fff; color: var(--ink); transition: all .15s ease; }
.ipt:hover { border-color: #C9CDD4; }
.ipt:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,123,247,.12); }
/* 文本超出省略号（仅文本输入框；select 不适用） */
input.ipt { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
select.ipt { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
  linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.btn { padding: 8px 18px; border: none; border-radius: 8px; background: var(--bg-soft);
  cursor: pointer; font-size: 0.875rem; color: var(--ink); transition: all .15s ease; font-weight: 500; }
.btn:hover { background: #E8EBF0; color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(74,123,247,.25); }
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(74,123,247,.32); }
.btn.block { width: 100%; padding: 12px; font-size: 0.9375rem; }
.btn.sm { padding: 5px 12px; font-size: 0.8125rem; border-radius: 6px; }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.danger:hover { background: #FFE0DE; color: var(--danger); }
.btn.loading { pointer-events: none; opacity: .8; }
.btn .spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes rot { to { transform: rotate(360deg); } }
.err { color: var(--danger); font-size: 0.8125rem; margin-top: 10px; text-align: center; min-height: 18px; }

/* 登录页专属：按钮更稳重（非胶囊），输入框更高 */
.login-box .btn.block { padding: 13px; font-size: 0.9375rem;
  border-radius: 10px; height: 46px; letter-spacing: 4px; font-weight: 500;
  margin-top: 8px; }
.login-box .ipt { padding: 12px 14px; border-radius: 10px; border-width: 1.5px; }
.login-box .field label { font-size: 0.8125rem; color: var(--ink); font-weight: 500; }

/* 小屏：隐藏左侧品牌区，只留表单 */
@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-side { flex: 1; }
}

/* ---------- 主布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: var(--surface); color: var(--ink-2); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20;
  border-right: 1px solid var(--line); }
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; color: var(--ink);
  border-bottom: 1px solid var(--line); }
.sidebar .brand .logo { width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1rem;
  box-shadow: 0 2px 8px rgba(74,123,247,.3); }
.sidebar .brand .t { font-size: 0.875rem; font-weight: 600; letter-spacing: .2px; }
.sidebar .brand .s { font-size: 0.625rem; color: var(--ink-3); }
.sidebar nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  margin-bottom: 2px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: 0.875rem;
  transition: all .15s ease; }
.nav-item svg { width: 18px; height: 18px; opacity: .65; }
.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav-item.active svg { opacity: 1; }
.sidebar .foot { padding: 15px 20px; font-size: 0.6875rem; color: var(--ink-3);
  border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 15;
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--surface-glass); }
.topbar .title { font-size: 1rem; font-weight: 600; color: var(--ink); }
.topbar .crumb { font-size: 0.75rem; color: var(--ink-3); margin-top: 2px; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2);
  transition: all .15s ease; position: relative; font-size: 15px; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft2); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid #fff; }
/* 顶部铃铛 → 通知下拉面板 */
.notify-wrap { position: relative; }
.notify-drop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  width: 300px; max-height: 400px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.notify-drop .n-head { padding: 12px 14px; font-size: 0.8125rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--bg-soft); }
.notify-drop .n-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  font-size: 0.8125rem; color: var(--ink-2); cursor: pointer; border-bottom: 1px solid var(--bg-soft); }
.notify-drop .n-item:last-child { border-bottom: none; }
.notify-drop .n-item:hover { background: var(--primary-soft2); }
.notify-drop .n-item b { color: var(--ink); font-weight: 600; margin-left: auto; white-space: nowrap; }
.notify-drop .n-item .n-sub { font-size: 0.6875rem; color: var(--ink-3); }
.notify-drop .n-empty { padding: 20px; text-align: center; font-size: 0.75rem; color: var(--ink-3); }
.userbox { display: flex; align-items: center; gap: 11px; padding-left: 12px; border-left: 1px solid var(--line); }
.userbox .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 650; }
.userbox .meta .uname { font-size: 0.8125rem; color: var(--ink-2); font-weight: 500; }
.userbox .meta .role { font-size: 0.6875rem; color: var(--primary); }

/* ---------- 个人中心下拉面板 ---------- */
.userbox { position: relative; }
.profile-drop { position: absolute; right: 0; top: calc(100% + 10px); width: 340px;
  background: var(--surface); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
  border: 1px solid var(--line); overflow: hidden; z-index: 70;
  opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none; transition: all .18s ease; }
.profile-drop.open { opacity: 1; transform: none; pointer-events: auto; }
.profile-drop .pd-head { display: flex; align-items: center; gap: 13px; padding: 16px 18px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-soft2));
  border-bottom: 1px solid var(--line); }
.profile-drop .pd-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.1875rem; font-weight: 600; }
.profile-drop .pd-meta .pd-name { font-size: 1rem; font-weight: 650; color: var(--ink); }
.profile-drop .pd-meta .pd-role { font-size: 0.75rem; color: var(--primary); margin-top: 2px; }
.profile-drop .pd-info { padding: 12px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.profile-drop .pd-row { display: flex; align-items: baseline; gap: 6px; font-size: 0.8125rem; flex-wrap: nowrap; }
.profile-drop .pd-row .pd-k { color: var(--ink-3); flex-shrink: 0; font-size: 0.75rem; white-space: nowrap; }
.profile-drop .pd-row .pd-v { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-drop .pd-section { padding: 0 18px 12px; }
.profile-drop .pd-label { font-size: 0.75rem; color: var(--ink-3); margin-bottom: 7px; }
.profile-drop .pd-edit { display: flex; gap: 8px; }
.profile-drop .pd-edit .ipt { padding: 9px 12px; font-size: 0.8125rem; }
.profile-drop .pd-actions { padding: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.profile-drop .pd-actions .more-item { display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 8px; border: none; background: none; border-radius: 9px; cursor: pointer;
  font-size: 0.875rem; color: var(--ink); transition: all .15s ease; text-align: center; }
.profile-drop .pd-actions .more-item:hover { background: var(--bg-soft); }
.profile-drop .pd-actions .more-item.danger { color: var(--danger); }
.profile-drop .pd-actions .more-item.danger:hover { background: var(--danger-soft); }
.profile-drop .pd-activity-title { padding: 11px 18px 0; font-size: 0.75rem; color: var(--ink-3); }
.profile-drop .pd-activity { max-height: 190px; overflow-y: auto; padding: 6px 18px 12px; font-size: 0.75rem; }
.profile-drop .pd-activity .act-item { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed var(--line); color: var(--ink-2); }
.profile-drop .pd-activity .act-item:last-child { border-bottom: none; }
.profile-drop .pd-activity .act-item .act-tag { font-size: 0.6875rem; padding: 2px 7px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.profile-drop .pd-activity .act-item .act-time { margin-left: auto; color: var(--ink-3); flex-shrink: 0; }
.profile-drop .n-empty { padding: 14px 0; text-align: center; color: var(--ink-3); }
.content { padding: 24px 28px; max-width: 1440px; width: 100%; margin: 0 auto; min-height: calc(100vh - 140px); }

/* ---------- 通用 ---------- */
.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 1.25rem; font-weight: 600; color: var(--ink); letter-spacing: -.2px; }
.page-head p { color: var(--ink-3); font-size: 0.8125rem; margin-top: 4px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow); transition: box-shadow .2s ease; min-height: 200px; }
/* 电脑端（769px 以上）：增大卡片高度和内边距 */
@media (min-width: 769px) {
  .card { padding: 28px 32px; min-height: 320px; }
  #view-dash .chart-box { flex: 1; min-height: 560px; }
  #view-stats .chart-box { min-height: 320px; }
  .o-card { padding: 32px 32px; min-height: 150px; gap: 24px; }
  .table th, .table td { padding: 18px 24px; font-size: 0.9375rem; }
  .dash-col-chart .chart-box#dash-level { min-height: 480px; }
  .dash-col-chart .chart-box#dash-feature { min-height: 480px; }
}
/* 隐藏头像（电脑端和手机端都隐藏） */
.e-avatar { display: none; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.card-title { font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px; }
/* 详情弹窗：信息字段清爽卡片（标签左 + 值右，横排） */
.ed-field { background: var(--bg-soft); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px; }
.ed-field .ed-k { font-size: 0.75rem; color: var(--ink-3); flex-shrink: 0; }
.ed-field .ed-v { font-size: 0.875rem; color: var(--ink); font-weight: 500; min-width: 0;
  overflow-wrap: anywhere; }
.ed-modal .m-body { padding: 20px 24px; }
.ed-modal .card-title { color: var(--ink-2); font-size: 0.875rem; }
/* 评估详情：顶部信息按行分行（老人/时间、总分/国标、模型/确认） */
#rd-head { display: flex; flex-direction: column; gap: 8px; }
#rd-head .row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  font-size: 0.8125rem; color: var(--ink-2); }
#rd-head .row b { color: var(--ink); font-weight: 600; }
#rd-head .row b.hl { color: var(--primary-dark); }
#rd-head .row .tag { vertical-align: middle; }
.card-title::before { content:""; width: 3px; height: 15px; border-radius: 3px; background: var(--primary); }
.chart-box { height: 400px; }
.card > .chart-box { margin: 0 -2px; }
.chart-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 0.8125rem; text-align: center; }
.chart-empty span { font-size: 0.6875rem; opacity: .8; margin-top: 4px; }
/* 使用帮助 */
.help-body { font-size: 0.8125rem; }
.help-role { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help-role-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg-soft); }
.hr-t { font-weight: 600; color: var(--ink); margin-bottom: 8px; font-size: 0.8125rem;
  padding-left: 9px; border-left: 3px solid var(--line); }
.hr-t.hr-t-user { border-left-color: #1f9d55; }
.hr-t.hr-t-admin { border-left-color: #722ED1; }
.hr-t.hr-t-note { border-left-color: var(--primary); }
.help-role-card ol, .help-tips ul { padding-left: 18px; margin: 0; }
.help-role-card li, .help-tips li { color: var(--ink-2); line-height: 1.9; }
.hr-goal { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line);
  color: var(--primary-dark); font-size: 0.75rem; }
.help-tips { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
/* 图表卡内边距优化 */
.card.chart-card { padding: 20px 20px 16px; }

/* 概览卡片（桌面固定 4 列，平板 2 列，手机 2 列→1 列） */
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
/* 工作台：图表 + 待办 左右两栏（桌面）。左右各占 50%（1fr:1fr），min-width:0 防止右列内容撑宽挤压左列 */
.dash-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin: 16px 0 0; align-items: stretch; }
.dash-main > * { min-width: 0; }
.dash-main .card { height: 100%; }
/* 工作台：内容撑满视口高度，避免底部留白 */
#view-dash { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
#view-dash .dash-main { flex: 1; }
#view-dash .dash-main .card { height: 100%; display: flex; flex-direction: column; }
#view-dash .chart-box { flex: 1; min-height: 320px; }
.o-card { background: var(--surface); border-radius: var(--radius); padding: 24px 24px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; min-height: 100px;
  transition: transform .15s ease, box-shadow .2s ease; }
.o-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.o-card .ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; }
.o-card .ico svg { width: 22px; height: 22px; }
.o-card.blue .ico { background: var(--primary-soft); color: var(--primary); }
.o-card.gold .ico { background: var(--accent-soft); color: #d18a1a; }
.o-card .num { font-size: 1.75rem; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -.3px; }
.o-card .lbl { color: var(--ink-2); font-size: 0.875rem; margin-top: 6px; }
.o-card .sub { color: var(--ink-3); font-size: 0.75rem; margin-top: 4px; }

/* 工具栏 */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
  gap: 12px; flex-wrap: wrap; }
.toolbar .search { display: flex; gap: 8px; align-items: center; }
.toolbar .ipt { width: 420px; }
.toolbar select.ipt { width: 160px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 16px; text-align: left; font-size: 0.875rem; }
.table th { color: var(--ink-3); font-weight: 500; font-size: min(0.75rem, 13px); border-bottom: 1px solid var(--line);
  letter-spacing: .3px; white-space: nowrap; background: #FAFBFC; text-transform: uppercase; }
.table th:first-child { border-radius: 8px 0 0 0; }
.table th:last-child { border-radius: 0 8px 0 0; }
.table td { border-bottom: 1px solid #F2F3F5; color: var(--ink); }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #F7F9FC; }
.table tbody tr:last-child td { border-bottom: none; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; }
.tag.lv0 { background: #E8F9EE; color: #1D8A4E; }
.tag.lv1 { background: #F0FAE0; color: #6B9E2E; }
.tag.lv2 { background: #FFF7E0; color: #B8860B; }
.tag.lv3 { background: #FFF0E0; color: #D17A2A; }
.tag.lv4 { background: #FFE5E5; color: #FF3B30; }
.tag.warn { background: #fff3d9; color: #b9842e; border: 1px solid #eccf8a; }
.ops { white-space: nowrap; }
.ops .btn { margin-left: 6px; }
.ops .btn { opacity: .92; }
.ops .btn:hover { opacity: 1; }

/* 分页 */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 18px 4px 0; }
.pager .info { color: var(--ink-3); font-size: 0.75rem; margin-right: 10px; }
.pager button { min-width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; color: var(--ink-2); font-size: 0.8125rem; transition: all .15s; }
.pager button:hover:not(:disabled):not(.on) { color: var(--primary); border-color: var(--primary); }
.pager button.on { background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(74,123,247,.26); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
/* 分页：一排横排（页码 + 跳转+确认），超宽时自动换行 */
.pager .pg-stack { display: flex; flex-direction: row; align-items: center; gap: 26px;
  flex-wrap: wrap; justify-content: center; width: 100%; }
.pager .pg-pages { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: center; }
.pager .pg-jump { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 0.75rem; }
.pager .pg-jump input { width: 48px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  text-align: center; font-size: 0.8125rem; }
.pager .pg-jump input:focus { outline: none; border-color: var(--primary); }
.pager .pg-jump button { min-width: 52px; height: 34px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 0.75rem; cursor: pointer; }
.pager .pg-jump button:hover { background: var(--primary-dark); }
/* 手机端紧凑分页：默认隐藏，手机端显示（上一页 下一页 页码 确定） */
.pager .pg-mobile { display: none; }
@media (max-width: 768px) {
  .pager .pg-pages { display: none; }
  .pager .pg-jump { display: none; }
  .pager .pg-mobile { display: flex; align-items: center; gap: 6px; justify-content: center; }
  .pager .pg-mobile button { min-width: 62px; height: 34px; border: 1px solid var(--line);
    border-radius: 8px; background: #fff; color: var(--ink); font-size: 0.75rem; cursor: pointer; }
  .pager .pg-mobile button:disabled { opacity: .4; cursor: not-allowed; }
  .pager .pg-mobile .pg-cur { font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap;
    display: flex; align-items: center; gap: 3px; }
  .pager .pg-mobile .pg-inp { width: 42px; height: 30px; border: 1px solid var(--line);
    border-radius: 6px; text-align: center; font-size: 0.8125rem; padding: 0; }
  .pager .pg-mobile .pg-inp:focus { outline: none; border-color: var(--primary); }
  .pager .pg-mobile .pg-ok { background: var(--primary); color: #fff; border: none; min-width: 50px; }
  .pager .pg-mobile .pg-ok:hover { background: var(--primary-dark); }
}

/* 评估问卷（按国标维度分组） */
.search-sel { position: relative; }
.search-sel .search-sel-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px;
  max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.search-sel-item { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 14px; font-size: 0.8125rem; cursor: pointer; }
.search-sel-item:hover { background: var(--primary-soft2); }
.search-sel-item b { color: var(--ink); font-weight: 600; }
.search-sel-item span { color: var(--ink-3); font-size: 0.75rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.search-sel-empty { padding: 12px 14px; font-size: 0.75rem; color: var(--ink-3); text-align: center; }
/* 评估问卷进度条：吸附在顶栏下方，避免滚动时被顶栏遮挡 */
.q-prog-stick { position: sticky; top: 56px; z-index: 5; }
/* 评估对象提示条：未选老人时警示，选定后确认 */
.q-ebanner { padding: 10px 14px; border-radius: 10px; font-size: 0.8125rem; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; }
.q-ebanner.ok { background: #eaf7ef; color: #1f9d55; border: 1px solid #cdeede; }
@media (min-width: 992px) { .q-prog-stick { top: 62px; } }

.q-group { margin-bottom: 18px; }
.q-group:last-child { margin-bottom: 0; }
.q-group-title { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600;
  color: var(--primary-dark); padding: 11px 14px; background: var(--primary-soft);
  border-radius: 10px; margin-bottom: 4px; }
.q-group-title span { font-size: 0.6875rem; color: var(--ink-3); font-weight: 400; }
.q-group-title .q-hint { font-size: 0.6875rem; font-style: normal; color: var(--ink-3); font-weight: 400;
  margin-left: auto; }
.q-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px;
  border-bottom: 1px solid var(--bg-soft); transition: .15s; }
.q-item:last-child { border-bottom: none; }
.q-item:hover { background: var(--primary-soft2); }
/* 提交时定位未答条目：短暂红色脉冲高亮 */
.q-item.q-miss { animation: qMiss 1.3s ease 2; border-radius: 10px; }
@keyframes qMiss { 0%,100% { box-shadow: 0 0 0 0 rgba(235,57,66,0); }
  50% { box-shadow: 0 0 0 3px rgba(235,57,66,.55); } }
.q-item .name { font-weight: 500; }
.q-item .dim { font-size: 0.6875rem; color: var(--ink-3); margin-top: 3px; }
.q-item .opts { display: flex; gap: 6px; flex-wrap: wrap; }
.q-item .opt { padding: 8px 20px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 0.875rem; color: var(--ink-2); transition: all .15s; background: var(--bg-soft); }
.q-item .opt:hover { background: #E8EBF0; color: var(--ink); }
.q-item .opt.sel { background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(74,123,247,.25); }

/* 结果卡 */
.result-box { margin-top: 20px; padding: 22px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--primary-soft2), #fff); border: 1px solid var(--primary-soft);
  animation: fadeUp .3s ease; }
.result-box .big { font-size: 1.4375rem; font-weight: 750; color: var(--primary-dark); margin: 8px 0; }
.proba-bar { display: flex; gap: 3px; height: 18px; border-radius: 6px; overflow: hidden; margin: 12px 0; }
.proba-bar .seg { transition: .3s; }
.proba-txt { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.75rem; color: var(--ink-2); margin-bottom: 14px; }
.review { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 图表 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
/* 人机协同摘要卡片 */
#st-consist-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.consist-card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 3px; }
.consist-card .cc-k { font-size: 0.75rem; color: var(--ink-3); }
.consist-card .cc-v { font-size: 1.25rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.chart-box { height: 400px; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.42); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn .18s ease; }
/* 确认删除等确认弹窗始终置顶，避免被档案详情等其它弹窗遮挡 */
#confirm-mask { z-index: 200; }
/* 确认弹窗：居中、简洁、警示图标 */
.confirm-modal { text-align: center; padding: 28px 28px 24px; }
.confirm-modal .confirm-x { position: absolute; top: 12px; right: 12px; }
.confirm-modal .confirm-title { font-size: 1.25rem; font-weight: 700; color: var(--danger); }
.confirm-modal .confirm-text { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.6; margin: 12px auto 24px; max-width: 250px; }
.confirm-modal .confirm-actions { display: flex; gap: 12px; justify-content: center; }
.confirm-modal .confirm-actions .btn { min-width: 108px; }
/* 内容超高时：遮罩可滚动、弹窗从顶部排布，保证关闭按钮与底部可达 */
.modal-mask { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-mask.align-top { align-items: flex-start; padding: 24px 0; }
.modal-mask.align-top .modal { margin: auto; }
.modal { width: 500px; max-width: 92vw; background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-md); animation: pop .22s ease;
  max-height: 90vh; display: flex; flex-direction: column; }
.modal .m-head { padding: 20px 24px 12px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); }
.modal .m-head h3 { font-size: 1rem; color: var(--ink); font-weight: 600; }
.modal .m-close { cursor: pointer; color: var(--ink-3); font-size: 1.375rem; border: none; background: none;
  width: 32px; height: 32px; border-radius: 8px; transition: .15s; }
.modal .m-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal .m-body { padding: 18px 24px; overflow-y: auto; min-height: 0; flex: 1; }
.modal .m-foot { padding: 0 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.modal .m-foot .btn:first-child { margin-right: auto; }
/* 评估详情弹窗：桌面横向加宽 + 条目"名称：得分"一行 */
#modal-rd .m-body { padding: 20px 26px; }
.rd-item-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 36px; }
.rd-item { display: flex; align-items: baseline; gap: 3px; min-width: 0; font-size: 0.75rem; color: var(--ink-2); }
.rd-item .ri-name { white-space: nowrap; }
.rd-item .ri-score { color: var(--primary-dark); font-weight: 650; white-space: nowrap; }
@media (min-width: 992px) {
  #modal-rd .modal { width: 920px !important; max-width: 94vw !important; }
}
@media (max-width: 991px) {
  #modal-rd .modal { width: 92vw; max-width: 720px; }
  .rd-item-grid { grid-template-columns: repeat(3, 1fr); gap: 14px 24px; }
}
@media (max-width: 767px) {
  .rd-item-grid { grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 表单行内提示 */
.f-tip { color: var(--danger); font-size: 0.75rem; margin-top: 4px; display: none; }
.f-field.bad .ipt { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,71,87,.12); }
.f-field.bad .f-tip { display: block; }

/* Toast */
.toast-wrap { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { padding: 14px 24px; border-radius: 12px; color: #fff; font-size: 0.9375rem; box-shadow: var(--shadow-md);
  animation: slideIn .25s ease; min-width: 320px; max-width: 90vw; display: flex; align-items: center; gap: 10px; }
.toast .t-ico { width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0; }
.toast.success { background: linear-gradient(135deg, #27a468, #1f8a57); }
.toast.error { background: linear-gradient(135deg, #ff5a69, #e64452); }
.toast.info { background: linear-gradient(135deg, #3a78ff, #2560e0); }
@keyframes slideIn { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 空状态 */
.empty { text-align: center; color: var(--ink-3); padding: 42px 0; font-size: 0.8125rem; }
.empty .e-btn { margin-top: 14px; }

/* 视图切换过渡动画 */
.view { animation: viewIn .25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; } }

/* 待办事项 Tab 卡片 */
.todo-tab-card { padding: 18px 20px; }
.tab-bar { display: flex; gap: 8px; margin-bottom: 14px; background: var(--bg-soft);
  padding: 4px; border-radius: 12px; }
.tab-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 6px; border: none; border-radius: 9px; background: transparent; cursor: pointer;
  font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); transition: all .18s ease; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 980px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 0.6875rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; }
.tab-btn.active .tab-badge { background: var(--primary); color: #fff; }
.tab-pane { display: none; animation: viewIn .2s ease; }
.tab-pane.active { display: block; }

/* ---------- 待办分页控件（每页 8 条：上一页 / 下一页） ---------- */
.todo-tab-card .pager { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.todo-tab-card .pager .pg-btn { padding: 7px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--primary); font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  transition: all .15s ease; }
.todo-tab-card .pager .pg-btn:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.todo-tab-card .pager .pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.todo-tab-card .pager .pg-info { font-size: 0.75rem; color: var(--ink-3); }
/* 待办列表不使用内部滚动，完整展示当前页，剩余靠上一页/下一页翻页查看 */
.todo-tab-card .todo-body { max-height: none; overflow: visible; }
.todo-tab-card .todo-list { max-height: none; overflow: visible; }

/* 待办卡片条目（清晰两行结构：姓名+天数 上，标签+说明 下） */
.todo-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-item { padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.75); cursor: pointer;
  border: 1px solid rgba(255,255,255,.95); box-shadow: 0 1px 3px rgba(0,0,0,.03); transition: .15s; }
.todo-item:hover { background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.todo-item .t-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.todo-item .t-top .name { font-weight: 600; font-size: 0.875rem; color: #1A1A1A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-item .t-top .days { font-weight: 700; font-size: 0.8125rem; color: #f0901a; flex-shrink: 0; }
.todo-item .t-top .days.down { color: #ff4757; }
.todo-item .t-top .days.neutral { color: var(--ink-2); font-weight: 600; font-size: 0.75rem; }
.todo-item .t-top .sub { font-size: 0.75rem; color: var(--ink-3); flex-shrink: 0; }
.todo-item .t-top .days.overdue { color: #ff4757; }
.todo-item .t-top .days.soon { color: #f0901a; font-weight: 700; }
.todo-item .t-tags { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.todo-item .t-tags .sub { font-size: 0.6875rem; color: var(--ink-3); }
.tag.info-soft { background: var(--primary-soft); color: var(--primary-dark); }

/* ============================================================
   移动端 / 平板 响应式适配（v4）
   断点：平板 ≤991px，手机 ≤767px，超小屏 ≤400px
   ============================================================ */
.menu-btn { display: none; }
.menu-mask { display: none; }

/* ---------- 平板（≤991px） ---------- */
@media (max-width: 991px) {
  .sidebar { width: 200px; }
  .content { padding: 18px 20px; }
  .topbar { padding: 0 16px; }
  .overview { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .chart-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .q-item .name { font-size: 0.8125rem; }
  /* 折叠屏内屏展开 / 平板竖屏：指标卡与工作台图表更紧凑和谐 */
  .o-card { padding: 16px; gap: 12px; }
  .o-card .num { font-size: 1.625rem; }
  .o-card .ico { width: 44px; height: 44px; border-radius: 12px; }
  .dash-main { grid-template-columns: 1fr; gap: 14px; }
  .dash-col-chart .chart-box { min-height: 250px; }
  .toolbar .ipt { width: 240px; }
  .toolbar select.ipt { width: 140px; }
}

/* ---------- 手机（≤767px） ---------- */
@media (max-width: 767px) {
  /* 顶栏：显示汉堡按钮 */
  .menu-btn { display: inline-flex; }
  /* 个人中心弹窗：手机端缩小宽度，减少占用 */
  .profile-drop { width: 280px; right: -10px; }
  .profile-drop .pd-activity { max-height: 120px; }
  .profile-drop .pd-info { grid-template-columns: 1fr; }
  .profile-drop .pd-row:nth-child(2) { grid-column: 1 / -1; }
  /* Toast 提示：手机端顶部居中，避免被顶栏挡住 */
  .toast-wrap { top: 16px; }
  .toast { min-width: auto; width: auto; max-width: 90vw; padding: 12px 20px; font-size: 0.875rem; }
  .topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .topbar .title { font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .crumb { display: none; }
  .topbar { height: 56px; padding: 0 12px; }
  .topbar .right { gap: 6px; }
  .userbox { gap: 6px; padding-left: 8px; }
  .userbox .meta { display: none; }
  .userbox .avatar { width: 30px; height: 30px; }
  .userbox .btn.sm { padding: 5px 10px; font-size: 0.75rem; }
  .userbox > #btn-pwd, .userbox > #btn-logout { display: none; }   /* 手机端收进个人中心下拉面板操作 */
  .icon-btn { width: 32px; height: 32px; }

  /* 侧边栏 → 抽屉式（用 left 定位） */
  .sidebar { position: fixed; top: 0; left: -260px; height: 100vh; z-index: 90; width: 250px;
    transition: left .26s cubic-bezier(.4,0,.2,1); box-shadow: none; }
  .sidebar.open { left: 0; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
  .layout { display: block; }

  /* 遮罩 */
  .menu-mask { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 80; opacity: 0; pointer-events: none; transition: opacity .26s ease; }
  .menu-mask.show { opacity: 1; pointer-events: auto; }

  /* 内容区铺满 */
  .main { width: 100%; }
  .content { padding: 14px 12px; }

  /* 概览卡 → 2 列紧凑矮卡（图标左 + 数字标签右，占屏小更简洁） */
  .overview { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .o-card { aspect-ratio: auto; flex-direction: row; justify-content: flex-start;
    align-items: center; gap: 10px; padding: 12px; border-radius: 14px; text-align: left; }
  .o-card .ico { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; }
  .o-card .ico svg { width: 20px; height: 20px; }
  .o-card .meta { min-width: 0; flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start; }
  .o-card .num { font-size: 1.375rem; line-height: 1.05; }
  .o-card .lbl { font-size: 0.7188rem; margin-top: 3px; white-space: normal;
    line-height: 1.25; }

  /* 图表 → 单列（工作台等常规页） */
  .chart-grid { grid-template-columns: 1fr; gap: 14px; }
  .help-role { grid-template-columns: 1fr; gap: 12px; }
  .chart-box { height: 240px; }
  .card { padding: 16px 14px; border-radius: 16px; }
  .card-title { font-size: 0.875rem; margin-bottom: 14px; }

  /* 统计可视化页：手机上图表单列完整显示 */
  #view-stats .chart-grid { grid-template-columns: 1fr; gap: 12px; }
  #view-stats .chart-box { height: 240px; }
  #view-stats .card { padding: 12px 10px; }
  #view-stats .card-title { font-size: 0.75rem; margin-bottom: 6px; }
  #view-stats #st-consist-summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* 工作台：图表 + 待办 → 单列堆叠 */
  .dash-main { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  /* 统计页一致性区域 → 单列堆叠 */
  .consist-row { grid-template-columns: 1fr; gap: 12px; }
  #st-consist-summary { grid-template-columns: repeat(2, 1fr); }

  /* 工具栏 → 纵向堆叠 */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  /* 搜索：单个全能框 + 查询按钮右侧同排 */
  .toolbar .search { display: flex; gap: 8px; align-items: center; }
  .toolbar .search .ipt { width: 100%; min-width: 0; padding: 9px 12px; flex: 1; }
  .toolbar .search .btn { min-width: 0; padding: 9px 18px; flex: 0 0 auto; height: 38px;
    display: inline-flex; align-items: center; justify-content: center; }
  /* 工具按钮：新增/批量导入/导出CSV 一行3个 */
  .toolbar .tool-ops { display: flex; gap: 8px; }
  .toolbar .tool-ops .btn { flex: 1; min-width: 0; padding: 9px 8px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; }
  /* 筛选下拉与按钮同排均分填充（flex-basis 归零确保铺满） */
  .toolbar .tool-ops .ipt { flex: 1 1 0; min-width: 0; width: 100%; padding: 9px 10px;
    height: 38px; font-size: 0.75rem; }

  /* 表格 → 手机端卡片式 */
  .card:has(.table) { overflow-x: visible; padding: 10px; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table tbody tr { display: block; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; margin: 0 0 10px; padding: 4px 14px; box-shadow: var(--shadow); }
  .table tbody tr:last-child { margin-bottom: 0; }
  .table td { display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--bg-soft); padding: 9px 2px; font-size: 0.8125rem;
    white-space: normal; text-align: right; }
  .table td:last-child { border-bottom: none; }
  .table td::before { content: attr(data-label); color: var(--ink-3); font-size: 0.75rem;
    font-weight: 500; margin-right: 14px; flex-shrink: 0; }
  .table td.ops { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap;
    text-align: left; }
  .table td.ops::before { content: none; }
  .table td.ops .btn { margin-left: 0; }
  /* 手机端操作按钮：2×2 整齐网格，更清晰 */
  .table td.ops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .table td.ops .btn.sm { text-align: center; justify-content: center; width: 100%; }
  .table td.ops .btn.sm.primary { grid-column: span 1; }
  .table tbody tr:hover { background: #fff; }

  /* 老人档案页：横条列表 → 左信息右按钮 */
  #view-elderly .table tbody { display: grid; grid-template-columns: 1fr; gap: 12px; }
  #view-elderly .table tbody tr { margin: 0; padding: 16px 18px; border-radius: 14px;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; }
  /* 隐藏次要字段 */
  #view-elderly .table td[data-label="ID"] { display: none; }
  #view-elderly .table td[data-label="性别"] { display: none; }
  #view-elderly .table td[data-label="出生日期"] { display: none; }
  #view-elderly .table td[data-label="联系电话"] { display: none; }
  /* 姓名行 */
  #view-elderly .table td[data-label="姓名"] { grid-column: 1; grid-row: 1;
    justify-content: flex-start; padding: 2px 0; font-size: 1.0625rem; font-weight: 650;
    color: var(--ink); border-bottom: none; }
  #view-elderly .table td[data-label="姓名"]::before { display: none; }
  /* 社区行 */
  #view-elderly .table td[data-label="所属社区"] { grid-column: 1; grid-row: 2;
    justify-content: flex-start; border-bottom: none; padding: 2px 0; font-size: 0.75rem;
    color: var(--ink-3); }
  #view-elderly .table td[data-label="所属社区"]::before { content: "社区：" !important;
    color: var(--ink-3) !important; font-size: 0.75rem !important; margin-right: 0 !important; }
  /* 评级标签行 */
  #view-elderly .table td[data-label="当前等级"] { grid-column: 1; grid-row: 3;
    justify-content: flex-start; border-bottom: none; padding: 4px 0; gap: 4px;
    flex-wrap: wrap; min-width: 0; }
  #view-elderly .table td[data-label="当前等级"]::before { content: "评级：" !important;
    color: var(--ink-3) !important; font-size: 0.75rem !important; margin-right: 0 !important;
    flex-shrink: 0 !important; }
  #view-elderly .table td[data-label="当前等级"] .tag { font-size: 0.75rem; padding: 2px 8px;
    white-space: nowrap; }
  /* 时间行 */
  #view-elderly .table td[data-label="评估情况"] { grid-column: 1; grid-row: 4;
    flex-direction: row; flex-wrap: wrap; justify-content: flex-start; border-bottom: none;
    padding: 2px 0; gap: 2px 6px; align-items: center; font-size: 0.75rem; color: var(--ink-3); }
  #view-elderly .table td[data-label="评估情况"]::before { display: none; }
  /* 操作按钮：右侧竖向 */
  #view-elderly .table td.ops { grid-column: 2; grid-row: 1 / 5;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
    gap: 8px; margin: 0; padding: 0; border-top: none; }
  #view-elderly .table td.ops .btn.sm { display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; font-size: 0.75rem; border-radius: 8px; width: auto; min-width: 64px; }
  #view-elderly .table td.ops .btn.sm::before { content: none; }
  #view-elderly .table td.ops .btn[data-act="assess"] { font-weight: 600; }

  /* 评估记录页：横条列表 → 左信息右按钮 */
  #view-records .table tbody { display: grid; grid-template-columns: 1fr; gap: 12px; }
  #view-records .table tbody tr { margin: 0; padding: 16px 18px; border-radius: 14px;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; }
  /* 隐藏次要字段 */
  #view-records .table td[data-label="ID"] { display: none; }
  #view-records .table td[data-label="模型参考"] { display: none; }
  #view-records .table td[data-label="确认等级"] { display: none; }
  #view-records .table td[data-label="总分"] { display: none; }
  /* 第一行：姓名 */
  #view-records .table td[data-label="老人"] { grid-column: 1; grid-row: 1;
    justify-content: flex-start; padding: 2px 0; font-size: 1rem; font-weight: 650;
    color: var(--ink); border-bottom: none; margin-right: 8px; }
  #view-records .table td[data-label="老人"]::before { display: none; }
  /* 第二行：国标等级 */
  #view-records .table td[data-label="国标等级"] { grid-column: 1; grid-row: 2;
    justify-content: flex-start; border-bottom: none; padding: 4px 0; }
  #view-records .table td[data-label="国标等级"]::before { content: "国标：" !important;
    color: var(--ink-3) !important; font-size: 0.75rem !important; margin-right: 0 !important; }
  #view-records .table td[data-label="国标等级"] .tag { font-size: 0.75rem; padding: 3px 8px; }
  /* 第三行：评估时间 */
  #view-records .table td[data-label="评估时间"] { grid-column: 1; grid-row: 3;
    justify-content: flex-start; flex-direction: row; border-bottom: none; padding: 2px 0;
    font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; }
  #view-records .table td[data-label="评估时间"]::before { display: none; }
  /* 右侧：状态标签 + 详情按钮 */
  #view-records .table td[data-label="状态"] { grid-column: 2; grid-row: 1;
    justify-content: flex-end; border-bottom: none; padding: 2px 0; }
  #view-records .table td[data-label="状态"]::before { display: none; }
  #view-records .table td[data-label="状态"] .tag { font-size: 0.75rem; padding: 2px 8px; }
  #view-records .table td.ops { grid-column: 2; grid-row: 2 / 4;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
    gap: 6px; margin: 0; padding: 0; border-top: none; }
  #view-records .table td.ops .btn.sm { display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 14px; font-size: 0.75rem; border-radius: 8px; width: auto; min-width: 60px; }
  #view-records .table td.ops .btn.sm::before { content: none; }

  /* 系统日志页：卡片式 → 一排 1 个（日志较长），第一行操作人+操作，下面对象/详情/时间 */
  #view-audit .table tbody { display: grid; grid-template-columns: 1fr; gap: 10px; }
  #view-audit .table tbody tr { margin: 0; padding: 12px; border-radius: 16px;
    display: grid; grid-template-columns: 1fr auto; align-items: center; }
  #view-audit .table td[data-label="ID"] { display: none; }
  #view-audit .table td[data-label="操作人"] { grid-column: 1; grid-row: 1;
    justify-content: flex-start; padding: 2px 0; font-size: 0.9375rem; font-weight: 600;
    color: var(--ink); border-bottom: none; }
  #view-audit .table td[data-label="操作人"]::before { display: none; }
  #view-audit .table td[data-label="操作"] { grid-column: 2; grid-row: 1;
    justify-content: flex-end; border-bottom: none; padding: 2px 0; }
  #view-audit .table td[data-label="操作"]::before { display: none; }
  #view-audit .table td[data-label="操作"] .tag { font-size: 0.75rem; padding: 2px 8px; }
  #view-audit .table td[data-label="对象"] { grid-column: 1 / -1; grid-row: 2;
    justify-content: flex-start; border-bottom: none; padding: 3px 0; }
  #view-audit .table td[data-label="对象"]::before { content: "对象"; color: var(--ink-3);
    font-size: 0.75rem; margin-right: 8px; }
  #view-audit .table td[data-label="详情"] { grid-column: 1 / -1; grid-row: 3;
    justify-content: flex-start; border-bottom: none; padding: 3px 0; font-size: 0.8125rem;
    color: var(--ink-2); text-align: left; }
  #view-audit .table td[data-label="详情"]::before { content: "详情"; color: var(--ink-3);
    font-size: 0.75rem; margin-right: 8px; flex: 0 0 auto; }
  #view-audit .table td[data-label="时间"] { grid-column: 1 / -1; grid-row: 4;
    justify-content: flex-start; border-bottom: none; padding: 2px 0; font-size: 0.75rem;
    color: var(--ink-3); }
  #view-audit .table td[data-label="时间"]::before { content: none; }

  /* 账号管理页：卡片式 → 一排 2 个，第一行账号+角色，下面姓名与操作 */
  #view-accounts .table tbody { display: grid; grid-template-columns: 1fr; gap: 12px; }
  #view-accounts .table tbody tr { margin: 0; padding: 16px 18px; border-radius: 14px;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; }
  #view-accounts .table td[data-label="ID"] { display: none; }
  #view-accounts .table td[data-label="创建时间"] { display: none; }
  /* 第一行：登录账号 + 角色标签 */
  #view-accounts .table td[data-label="登录账号"] { grid-column: 1; grid-row: 1;
    justify-content: flex-start; padding: 2px 0; font-size: 1rem; font-weight: 650;
    color: var(--ink); border-bottom: none; }
  #view-accounts .table td[data-label="登录账号"]::before { display: none; }
  #view-accounts .table td[data-label="角色"] { grid-column: 2; grid-row: 1;
    justify-content: flex-end; border-bottom: none; padding: 2px 0; }
  #view-accounts .table td[data-label="角色"]::before { display: none; }
  #view-accounts .table td[data-label="角色"] .tag { font-size: 0.75rem; padding: 2px 8px; }
  /* 第二行：姓名 + 删除按钮 */
  #view-accounts .table td[data-label="姓名"] { grid-column: 1; grid-row: 2;
    justify-content: flex-start; border-bottom: none; padding: 3px 0; font-size: 0.75rem;
    color: var(--ink-2); }
  #view-accounts .table td[data-label="姓名"]::before { content: "姓名：" !important;
    color: var(--ink-3) !important; font-size: 0.75rem !important; margin-right: 0 !important; }
  /* 操作按钮：右侧第二行 */
  #view-accounts .table td.ops { grid-column: 2; grid-row: 2;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
    gap: 6px; margin: 0; padding: 0; border-top: none; }
  #view-accounts .table td.ops .btn.sm { display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 14px; font-size: 0.75rem; border-radius: 8px; }
  #view-accounts .table td.ops .btn.sm::before { content: none; }


  /* 问卷选项 → 按钮固定宽度自然换行 */
  .q-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .q-item .opts { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .q-item .opts.opts-2 { grid-template-columns: repeat(2, 1fr); }
  .q-item .opts.opts-3 { grid-template-columns: repeat(3, 1fr); }
  .q-item .opts.opts-4 { grid-template-columns: repeat(4, 1fr); }
  .q-item .opt { text-align: center; padding: 9px 4px; white-space: nowrap;
    display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff; }
  .q-item .opt b { font-size: 0.9375rem; font-weight: 650; line-height: 1; }
  .q-item .opt i { font-size: 0.75rem; font-style: normal; color: var(--ink-3); }
  .q-item .opt.has-lbl { padding: 7px 2px; }
  .q-item .opt:hover { background: var(--primary-soft2); border-color: var(--primary-soft); }
  .q-item .opt.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
  .q-item .opt.sel i { color: rgba(255,255,255,.85); }

  /* 人工复核控件 → 撑满全宽 */
  .review { flex-direction: column; align-items: stretch; gap: 8px; }
  .review .ipt { width: 100% !important; }
  .review .ipt { width: 100% !important; }
  .review .btn { width: 100%; }

  /* 模态框 → 全宽 */
  .modal { width: 94vw !important; max-width: 94vw; border-radius: 16px; }
  .modal .m-body { padding: 14px 16px; }
  .modal .m-foot { padding: 0 16px 16px; flex-wrap: wrap; }
  .modal .m-head { padding: 16px 16px 10px; }
  #modal-mask .m-body > div[style*="grid"] { grid-template-columns: 1fr; }
  /* 档案详情基本信息保持 2 列，仅收紧间距（消除右侧空白） */
  #modal-ed #ed-info { grid-template-columns: 1fr 1fr; gap: 8px; }
  #f-address[style*="span"] { grid-column: auto !important; }

  /* 统计：人机协同摘要 → 2 列 */
  #st-consist-summary { grid-template-columns: repeat(2, 1fr) !important; }

  /* 登录卡 → 窄屏适应 */
  .login-wrap { padding: 16px; }

  /* 分页 → 紧凑 */
  .pager { flex-wrap: wrap; justify-content: center; }

  /* 结果卡概率条文本换行 */
  .proba-txt { gap: 8px; }
  .result-box .big { font-size: 1.1875rem; }

  /* 侧边栏品牌区微调 */
  .sidebar .brand { padding: 18px 16px; }
  .sidebar .foot { padding: 12px 16px; }
}

/* ---------- 超小屏（≤400px，含折叠屏竖折闭合） ---------- */
@media (max-width: 400px) {
  .topbar .right .icon-btn:first-child { display: none; }
  .userbox { border-left: none; }
  /* 超小屏：图表高度降低，减少纵向占用 */
  .chart-box, #view-stats .chart-box { height: 210px; }
  .card { padding: 14px 12px; }
  /* 超小屏指标卡：两列仍可读，收紧间距 */
  .overview { gap: 10px; }
  .o-card { padding: 12px; gap: 9px; }
  .o-card .ico { width: 34px; height: 34px; border-radius: 10px; }
  .o-card .num { font-size: 1.25rem; }
  .o-card .lbl { font-size: 0.75rem; }
}
/* 折叠屏内屏展开 / 小平板横竖屏（约 600-860px）专项：工作台图表高度稳定 */
@media (min-width: 600px) and (max-width: 860px) {
  .dash-col-chart .chart-box { min-height: 230px; }
  .overview { gap: 12px; }
}
/* 超小屏（≤360px，折叠屏闭合 / 极小屏）：4 指标卡单列，避免两列拥挤 */
@media (max-width: 360px) {
  .overview { grid-template-columns: 1fr; gap: 10px; }
  .o-card { padding: 13px 16px; }
}
/* 超窄屏（≤340px）：老人档案精简卡片回退为 1 列 */
@media (max-width: 340px) {
  #view-elderly .table tbody { grid-template-columns: 1fr; }
}

/* ---------- 桌面增强（≥992px） ---------- */
@media (min-width: 992px) {
  /* 老人档案表格：隐藏低频列（ID/性别），减少拥挤，聚焦关键信息 */
  #view-elderly .table th:nth-child(1),
  #view-elderly .table td:nth-child(1) { display: none; }
  #view-elderly .table th:nth-child(3),
  #view-elderly .table td:nth-child(3) { display: none; }
  /* 表格斑马纹，提升长列表可读性 */
  .table tbody tr:nth-child(even) { background: #fafbfe; }
  .table tbody tr:hover { background: var(--primary-soft2); }
  /* 模态框：桌面放宽，详情类信息更舒展 */
  .modal { width: 600px; }
  /* 个人中心面板：桌面加宽，容纳更多内容 */
  .profile-drop { width: 360px; }
  .profile-drop .pd-activity { max-height: 140px; }
  /* 能力评估问卷：名称固定宽 + 选项紧跟排满，消除中间大空白 */
  .q-item { gap: 16px; justify-content: flex-start; padding: 14px 16px; }
  .q-item .name { flex: 0 0 190px; }
  .q-item .opts { flex: 1; flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }

  /* 统计可视化：4 个主图固定 2×2 网格，消除"3+1 留白" */
  #view-stats .chart-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  /* 统计页：一致性摘要卡与各等级一致率图左右并排，充分利用横向空间 */
  #view-stats .consist-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: stretch; }
  #view-stats .consist-row .card { height: 100%; display: flex; flex-direction: column; }
  /* 统计页一致性摘要卡：4 指标 2×2 排列，更饱满 */
  #st-consist-summary { grid-template-columns: repeat(2, 1fr); gap: 14px; flex: 1; align-content: center; }
  .consist-card { padding: 24px 18px; min-height: 100px; }

  /* 表格：列宽更紧凑铺满，减少右侧留白；操作列固定不收缩 */
  .table { table-layout: auto; }
  .table td.ops { white-space: nowrap; }
  /* 老人档案表格：评估情况列占满剩余空间，减少右侧留白 */
  #view-elderly .table th:nth-child(8),
  #view-elderly .table td:nth-child(8) { width: 26%; }
  /* 系统日志：详情列撑满剩余空间，减少右侧空白 */
  #view-audit .table th:nth-child(5),
  #view-audit .table td:nth-child(5) { width: 32%; }

  /* 工作台左侧卡片：饼图 + 模型特征重要性两图纵向排布；左列纵向 flex 填满右列高度，饼图自适应拉伸，保证左右两列卡片底部对齐（仅桌面端） */
  .dash-col-chart { align-self: stretch; display: flex; }
  .dash-col-chart .card { height: 100%; width: 100%; flex: 1 1 auto; display: flex; flex-direction: column; }
  .dash-col-chart .chart-box { width: 100%; }
  .dash-col-chart .chart-box#dash-level { flex: 1 1 50%; height: auto; min-height: 320px; }
  .dash-col-chart .chart-box#dash-feature { flex: 1 1 50%; min-height: 320px; }
  /* 第二个子标题（模型特征重要性）上方留出间距 */
  .dash-col-chart .card-title.sub-title { margin-top: 6px; }
}
