/* 色彩：冷调纸面 + 深墨色；异常红、偏低蓝只留给化验结果使用 */
:root {
  color-scheme: light;     /* 全站固定浅色（2026-11-16 选定方案 A 清爽青绿），不跟随系统深色模式 */
  --paper: #F3FAF6;
  --surface: #FFFFFF;
  --ink: #1F2D33;
  --muted: #5F6F76;
  --rule: #E1E8E8;
  --accent: #0F766E;
  --accent-ink: #FFFFFF;
  --high: #C62828;   /* 偏高 / 阳性 */
  --low: #1D4ED8;    /* 偏低 */
  --info: #0A6E9E;   /* 提示蓝（手动录入的常用参考范围），比偏低蓝更偏青；不用于化验结果 */
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --radius-sm: 10px;
  --radius-lg: 16px;
  /* 视觉（2026-11-16 选定方向 A 晨光卡片）：浅青底色、柔和阴影、青绿渐变按钮；仍然只用青绿做主色 */
  --accent-2: #13945F;      /* 渐变的亮端（2026-11-21 配色① 青柠极光：偏翠绿） */
  --accent-soft: #DCF5EA;   /* 导航当前页、标签的浅青底 */
  --shadow-sm: 0 1px 2px rgba(16, 42, 40, .05), 0 2px 8px rgba(16, 42, 40, .04);
  --shadow: 0 1px 2px rgba(16, 42, 40, .05), 0 8px 24px rgba(16, 42, 40, .07);
  --shadow-lift: 0 2px 4px rgba(16, 42, 40, .06), 0 14px 32px rgba(16, 42, 40, .10);
  /* 配色① 青柠极光（2026-11-21 用户选定）：页头 深青 → 青绿 → 翠绿 → 青柠，右上角青柠光、左下角薄荷光 */
  --hdr: radial-gradient(360px 140px at 96% -30%, rgba(217, 249, 157, .62), transparent 70%),
         radial-gradient(320px 150px at 8% 140%, rgba(94, 234, 212, .5), transparent 70%),
         linear-gradient(115deg, #053B38 0%, #0D9488 48%, #16A34A 82%, #65A30D 110%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  /* 页面顶部两团很淡的青色光晕，随页面滚走 */
  background-image: radial-gradient(1100px 360px at 88% -80px, #DDF3D8 0, transparent 70%),
                    radial-gradient(800px 300px at -10% -60px, #D9F3EC 0, transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;   /* 2026-11-21：16 → 15px（用户觉得正文太大）；输入框仍是 16px */
  line-height: 1.6;
  /* 化验数值对齐 */
  font-variant-numeric: tabular-nums;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px;
  /* 页头：配色① 青柠极光（--hdr）；文字白色；底边一道细亮线 */
  background: var(--hdr);
  color: #fff;
  box-shadow: 0 6px 20px rgba(5, 59, 56, .28), inset 0 -1px 0 rgba(255, 255, 255, .35);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.brand-logo { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #BEF264, #14B8A6 55%, var(--accent)); box-shadow: 0 3px 8px rgba(15, 118, 110, .3); }
.topbar .brand-logo { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 3px 8px rgba(0, 0, 0, .25); }
.brand-logo svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.member-switcher select {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  max-width: 50vw;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
/* 版权：内容少时也贴在页面最底部（body 纵向排列，main 撑满剩余高度），极小的字，无分割线 */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main.page { flex: 1 0 auto; width: 100%; }
.site-footer { margin: 0; padding: 8px 16px 10px; font-size: 10px; line-height: 1.4; color: var(--muted); text-align: center; }

/* 首页主卡片：白底大圆角，右上角一团浅青光晕 */
.empty {
  position: relative; overflow: hidden;
  margin: 4px 0 24px; padding: 32px 28px;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
}
.empty::after { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, #C9EEE6, transparent 70%); pointer-events: none; }
.empty > * { position: relative; z-index: 1; max-width: 34em; }
@media (max-width: 599px) { .empty { padding: 24px 18px; } }
.empty h1 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 12px;
}
.empty p { color: var(--muted); margin: 0 0 24px; }
.empty .hint { font-size: 14px; margin-top: 10px; }

.btn-primary {
  font: inherit;
  font-weight: 600;
  min-height: 48px;          /* 手机上易点 */
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(15, 118, 110, .28);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(15, 118, 110, .32); }
.btn-primary:active:not(:disabled) { transform: none; box-shadow: 0 3px 8px rgba(15, 118, 110, .25); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.status { padding: 0; }
.status h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 12px; }
.status dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 0;
}
.status dl > div { padding: 16px 18px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.status dt { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent); }
.status dt svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status dd { margin: 2px 0 0; font-size: 30px; font-weight: 700; line-height: 1.3; }
.status dd a { display: inline-block; min-width: 44px; text-decoration: none; }

/* 结果值的通用样式，后续页面使用 */
.val-high { color: var(--high); font-weight: 600; }
.val-low { color: var(--low); font-weight: 600; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* —— 导航 —— */
/* 导航方案 B（2026-11-21）：四个毛玻璃键（上传检查单 / 指标追踪 / 用药记录 / 家庭成员）；当前页白底青字。
   手机上在页头下面一排四格（短名）；其余入口在右上角头像菜单（.user-menu）。 */
.nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color .12s, transform .12s; }
.nav-link:hover { background-color: rgba(255, 255, 255, .22); transform: translateY(-1px); }
.nav-link:active { transform: translateY(1px); }
.nav-link[aria-current="page"] { color: var(--accent); background: #fff; border-color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); font-weight: 700; }
.nav-link:focus-visible { outline-color: #FDE68A; }
.nav-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 759px) {   /* 手机：页头下面一排四个等宽键 */
  .topbar { padding-bottom: 12px; row-gap: 8px; }
  .nav { order: 3; flex: 1 0 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .nav-link { padding: 0 4px; gap: 4px; font-size: 13px; }
}
.text-link { color: var(--accent); font-weight: 600; }

/* —— 指标列表 —— */
.page-title { font-size: clamp(24px, 5vw, 30px); font-weight: 700; letter-spacing: .01em; margin: 8px 0 8px; }
.lede { color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.cat-jump {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  padding: 12px 0 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.cat-jump a { color: var(--muted); text-decoration: none; }
.cat-jump a:hover { color: var(--accent); }

.cat-block { padding-top: 20px; scroll-margin-top: 72px; }
.cat-block h2 {
  font-size: 16px; font-weight: 600; margin: 0 0 8px;
  display: flex; align-items: baseline; gap: 8px;
}
.cat-block .count { font-size: 13px; color: var(--muted); font-weight: 400; }
.item-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-top: 1px solid var(--rule);
}
.item-list li { border-bottom: 1px solid var(--rule); }
.item-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 11px 4px; min-height: 44px;
  color: var(--ink); text-decoration: none;
}
.item-list a:hover .item-name { color: var(--accent); }
.item-abbr { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* —— 指标详情 —— */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 15px; padding: 4px 0 12px; }
.back:hover { color: var(--ink); }
.item-head h1 { font-size: clamp(26px, 6vw, 34px); font-weight: 700; line-height: 1.25; margin: 0 0 8px; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 20px; font-size: 14px; }
.item-meta .item-abbr { font-size: 15px; color: var(--ink); font-weight: 600; }
.tag {
  color: var(--accent); text-decoration: none; background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 999px; padding: 1px 10px;
}
.unit { color: var(--muted); }
.item-desc { font-size: 16px; line-height: 1.75; max-width: 34em; margin: 0 0 28px; }
.muted { color: var(--muted); }

.meaning-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 28px; }
@media (min-width: 640px) { .meaning-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.meaning { padding: 14px 0 14px 16px; border-left: 3px solid var(--rule); }
.meaning h2 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.meaning p { margin: 0; line-height: 1.7; }
.meaning-high { border-left-color: var(--high); }
.meaning-high h2 { color: var(--high); }
.meaning-low { border-left-color: var(--low); }
.meaning-low h2 { color: var(--low); }

/* 指标说明页：如何改善（编号 + 图标）、关联指标。图标颜色只作区分，不用 --high/--low（红蓝表示偏高偏低） */
.guide { margin: 0 0 28px; max-width: 46em; }
.guide h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.guide-steps { list-style: none; margin: 0; padding: 0; counter-reset: gstep; display: grid; gap: 10px; }
.guide-step { counter-increment: gstep; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.guide-icon { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--gc, var(--accent)); background: var(--gb, #E6F2F1); }
.guide-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guide-icon::after { content: counter(gstep); position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600;
  line-height: 20px; text-align: center; }
.guide-body p { margin: 2px 0 0; line-height: 1.7; }
.guide-tag { font-size: 13px; font-weight: 600; color: var(--gc, var(--accent)); }
.guide-diet { --gc: #2E7D32; --gb: #E8F3E8; }
.guide-exercise { --gc: #C2410C; --gb: #FCEDE3; }
.guide-weight { --gc: #7B4BA6; --gb: #F1EAF7; }
.guide-sleep { --gc: #475569; --gb: #ECEFF3; }
.guide-nosmoke { --gc: #92400E; --gb: #F7EEDF; }
.guide-life { --gc: #0F766E; --gb: #E3F1EF; }
.guide-pill { --gc: #0E7490; --gb: #E2F1F4; }
.guide-doctor { --gc: #0F766E; --gb: #DDEFEC; }
.guide-recheck { --gc: #5F6F76; --gb: #EEF2F2; }
.related-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.related-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.related-name { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-weight: 600; color: var(--accent); text-decoration: none; }
.related-name:hover { text-decoration: underline; }
.related-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.related-list p { margin: 2px 0 0; line-height: 1.7; color: var(--ink); }

.aliases h2 { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.aliases p { margin: 0 0 24px; font-size: 15px; }
.disclaimer {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--rule); padding-top: 14px; max-width: 40em;
}

/* —— 页头右侧 —— */
.topbar { flex-wrap: wrap; row-gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-right form { margin: 0; }
.btn-quiet {
  font: inherit; font-size: 15px; color: var(--muted);
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
}
.btn-quiet:hover { color: var(--ink); }
.btn-quiet.danger:hover { color: var(--high); }
a.btn-primary { display: inline-flex; align-items: center; text-decoration: none; }

/* —— 表单 —— */
.auth { max-width: 26rem; padding-top: 16px; }
.auth h1 { font-size: clamp(24px, 5vw, 30px); font-weight: 700; margin: 0 0 8px; }
.form { display: grid; gap: 18px; margin-top: 20px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: 15px; font-weight: 600; padding: 0; }
.field input:not([type="radio"]) {
  font: inherit; font-size: 16px;  /* 16px 防止 iOS 自动放大 */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 46px; width: 100%;
}
.field input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.field small { font-size: 13px; color: var(--muted); }
.field em { font-style: normal; font-size: 13px; color: var(--high); }
.field.has-error input { border-color: var(--high); }
.radio-row { display: flex; gap: 24px; padding: 6px 0; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 16px; min-height: 36px; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.form .btn-primary { justify-self: start; margin-top: 4px; }
.form-error { color: var(--high); margin: 0; }
.auth-switch { color: var(--muted); margin-top: 24px; }
.auth-switch a, .status dd a { color: var(--accent); }

/* —— 成员列表 —— */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 16px; }
.page-head .page-title { margin: 0; }
.notice {
  margin: 0 0 16px; padding: 10px 14px;
  background: var(--surface); border-left: 3px solid var(--accent);
}
.member-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.member-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 2px; border-bottom: 1px solid var(--rule);
}
.member-main { display: grid; gap: 2px; min-width: 0; }
.member-name { font-size: 16px; font-weight: 600; }
.member-meta { font-size: 14px; color: var(--muted); }
.member-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.member-actions a { color: var(--accent); text-decoration: none; font-size: 15px; }
.member-actions form { margin: 0; }
.viewing { color: var(--muted); margin: 0 0 6px; }
.viewing strong { color: var(--ink); }

/* ================= 第 4 步：上传与检查单 ================= */
/* “需要注意”的琥珀色，只用于照片质量提示，不与化验结果的红/蓝混用 */
:root { --warn: #8A5A00; }

.hint { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.form-error { margin-bottom: 16px; }

.btn-secondary {
  font: inherit; font-weight: 600; min-height: 48px; padding: 0 24px;
  border: 1px solid var(--accent); border-radius: 12px;
  background: var(--surface); color: var(--accent); cursor: pointer;
}
/* 文件框藏在按钮里，键盘聚焦时给外层按钮画焦点框 */
.pick { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pick:focus-within, .pick-link:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 拍照 / 从相册选择 / 上传 PDF / 手动录入：桌面一行四个，手机两行两个 */
.pick-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 20px; max-width: 40rem; }
.pick-row[hidden] { display: none; }
.pick-row .pick { padding: 0 12px; text-decoration: none; text-align: center; }
@media (min-width: 600px) { .pick-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 已添加的页面：照片缩略图按页序排列 */
.page-grid {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.page-card {
  display: grid; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-sm); overflow: hidden;
}
.page-card img, .page-noimg {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--rule);
}
.page-noimg { display: grid; place-items: center; padding: 8px; font-size: 13px; color: var(--muted); word-break: break-all; }
.page-cap { display: grid; gap: 6px; padding: 8px; font-size: 14px; font-weight: 600; }
.page-tools { display: flex; gap: 4px; }
.page-tools button {
  flex: 1; font: inherit; font-size: 13px; font-weight: 400; min-height: 36px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 4px; cursor: pointer;
}
.page-tools button:disabled { opacity: 0.35; cursor: default; }
.page-tools button[data-act="del"]:hover { color: var(--high); border-color: var(--high); }

/* 上传后检查 */
.check-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--rule); }
.check-card {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 72px;
}
.check-thumb img {
  display: block; width: 88px; aspect-ratio: 3 / 4; object-fit: cover;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--rule);
}
.has-warning .check-thumb img { border: 2px solid var(--warn); }
.check-body { min-width: 0; }
.check-body h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.warnings { margin: 0 0 8px; padding-left: 1.1em; color: var(--warn); font-size: 15px; }
.warnings a { color: inherit; }
.ok { margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.check-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.check-actions form { margin: 0; }
.pick-form { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 15px; margin: 0; }
.pick-link { position: relative; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; }
.pick-form.busy { opacity: 0.5; pointer-events: none; }
.add-page { margin: 0 0 24px; }
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.action-bar form { margin: 0; }

/* 状态 */
.status-tag {
  font-size: 13px; white-space: nowrap; padding: 2px 10px;
  border: 1px solid var(--rule); border-radius: 999px; color: var(--muted);
}
.status-processing { color: var(--accent); border-color: var(--accent); }
.status-pending_review { color: var(--warn); border-color: var(--warn); }
.status-failed { color: var(--high); border-color: var(--high); }
.status-confirmed { color: var(--ink); }
.notice-error { border-left-color: var(--high); }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }
.notice .action-bar { margin-top: 4px; }

.processing {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px;
  background: var(--surface); border-left: 3px solid var(--accent);
}
.processing-redo { margin-left: auto; white-space: nowrap; }
/* 识别进度条 */
.proc-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.proc-top { display: flex; align-items: center; gap: 10px; }
.proc-label { font-weight: 600; }
.proc-bar { height: 10px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.proc-bar > span { display: block; height: 100%; border-radius: inherit; transition: width 1.8s linear;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.proc-eta { display: flex; justify-content: space-between; margin: 0; font-size: 14px; color: var(--muted); }
.proc-hint { margin: 0; font-size: 13px; color: var(--muted); }
/* 上传时：不知道要多久的滚动条 */
.upload-wait { display: grid; gap: 6px; margin: 12px 0 0; max-width: 32rem; }
.upload-wait[hidden] { display: none; }
.proc-indet > span { width: 35%; animation: proc-slide 1.4s ease-in-out infinite; }
@keyframes proc-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .proc-indet > span { animation: none; width: 100%; opacity: .5; } }
.spinner {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--rule); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 检查单详情：逐页大图 */
.report-sub { margin: -8px 0 16px; font-size: 14px; }
.page-view { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 24px; }
.page-view li { scroll-margin-top: 72px; }
.page-view figure { margin: 0; }
.page-view img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 85vh;  /* 宽高都 auto 才能同时受两个上限约束且不变形 */
  border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface);
}
.page-view figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 6px; font-size: 14px; color: var(--muted); }
.page-view figcaption form { margin: 0; }
.page-view figcaption .btn-quiet { font-size: 14px; color: var(--accent); font-weight: 600; }

/* 检查单列表 */
.report-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.report-list > li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rule); }
.report-row {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 10px 2px;
  color: var(--ink); text-decoration: none;
}
.report-del { margin: 0; flex-shrink: 0; }
.stored-all-title { font-size: 16px; margin: 24px 0 8px; }
.report-row:hover .report-title { color: var(--accent); }
.report-thumb {
  width: 45px; height: 60px; flex-shrink: 0; object-fit: cover;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--rule);
}
.report-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.report-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* OCR 识别文字（第 5 步临时核对用；--warn 表示识别把握低，属于图片质量提示） */

/* 第 6 步：提取结果（临时展示，第 8 步换成正式确认页）。
   red 用 --high 表示“必须核对”，yellow 用 --warn 表示识别质量提示 */
.draft { margin: 0 0 24px; }
.draft h2 { font-size: 17px; margin: 16px 0 8px; }
.draft-meta { display: grid; gap: 6px; margin: 0 0 12px; }
.draft-meta div { display: grid; grid-template-columns: 7em 1fr; gap: 8px; }
.draft-meta dt { color: var(--muted); }
.draft-meta dd { margin: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 8px; position: relative; }  /* 让表内绝对定位的隐藏文字也被裁剪，否则手机上页面被撑宽 */
.draft-table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.draft-table th, .draft-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.draft-table th { color: var(--muted); font-weight: 600; }
.draft-table td.num { font-variant-numeric: tabular-nums; }
.draft-table tr.has-issue td, .draft-table tr.issue-row td { border-bottom: none; }
.draft-table tr.issue-row td { padding-top: 0; white-space: normal; }
.issue { font-size: 14px; }
.issue-red { color: var(--high); font-weight: 600; }
.issue-red::before { content: "！"; }
.issue-yellow { color: var(--warn); }

/* 第 7a 步：匹配上字典的项目链接到说明页；校正前的原文用小字显示 */
.draft-table .item-link { color: var(--accent); font-weight: 600; display: inline-block; padding: 10px 0; }
.draft-table .raw-text { display: block; font-size: 13px; }

/* ================= 手动录入 ================= */
.manual .form > * { min-width: 0; }
.manual-meta { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); max-width: 56rem; }
/* 患者姓名 / 采样日期 / 医院一行三栏：每栏四排（标题、框上方的小字说明、填写框、错误），subgrid 让三个框对齐 */
.manual-meta > .field > span { grid-row: 1; }
.manual-meta > .field > small { grid-row: 2; }
.manual-meta > .field > input, .manual-meta > .field > select { grid-row: 3; }
.manual-meta > .field > em { grid-row: 4; }
@media (min-width: 700px) {
  .manual-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); column-gap: 18px; row-gap: 6px; }
  .manual-meta > .field { grid-row: span 4; grid-template-rows: subgrid; align-content: start; }
}
.field select, .manual-row select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 46px; width: 100%;
}
.manual-h { font-size: 17px; margin: 8px 0 0; }
.manual-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.manual-row {
  display: grid; gap: 10px; padding: 12px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start;
}
.manual-row .field { min-width: 0; }
.manual-row.has-error { border-color: var(--high); }
.manual-row .mr-name { grid-column: 1 / -1; }
.manual-row .mr-del { justify-self: start; align-self: end; min-height: 44px; }
.manual-row .mr-error { grid-column: 1 / -1; font-style: normal; font-size: 13px; color: var(--high); }
@media (min-width: 900px) {
  .manual-row { grid-template-columns: minmax(0, 3fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1fr) auto; align-items: end; }
  .manual-row .mr-name { grid-column: auto; }
  /* 蓝字常用范围单独占下一排（参考范围这一栏起），不把参考范围框顶上去 */
  .manual-row .mr-ref { display: contents; }
  .manual-row .mr-typical { grid-column: 4 / -1; grid-row: 2; margin-top: -10px; }
}
#add-row { justify-self: start; }
.manual-row .mr-ref > label { display: grid; gap: 6px; }
.mr-typical {
  justify-self: start; text-align: left; font: inherit; font-size: 13px; color: var(--info);
  background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer;
}
.mr-typical:not(:disabled) { text-decoration: underline; text-underline-offset: 2px; }
.mr-typical:disabled { cursor: default; }

/* 第 7c 步：按参考范围预判的异常（--high 偏高 / --low 偏低） */
.draft-table .ab { font-weight: 700; margin-left: 2px; }
.draft-table .ab-high, .draft-table .ab-abnormal { color: var(--high); }
.draft-table .ab-low { color: var(--low); }

/* —— 体检报告 PDF：未提取的页 —— */
.skipped-pages { margin: 8px 0 24px; }
.skipped-pages summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.skipped-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.skipped-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 8px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); }
.skipped-list img { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--rule); }
.skipped-list li > div { display: grid; gap: 6px; justify-items: start; }
.skipped-list form { margin: 0; }

/* —— 提取结果按报告上的分组显示小标题 —— */
.draft-table tr.section-row td { font-weight: 600; color: var(--muted); padding-top: 14px; white-space: normal; }

/* —— 分段的参考范围（按人群/年龄/性别）—— */
.draft-table td.ref-cell { white-space: normal; min-width: 12em; max-width: 22em; }
.ref-options { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.ref-options .ref-default { color: var(--ink); font-weight: 600; }

/* ================= 第 8 步：确认页 ================= */
.review-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.review-layout > * { min-width: 0; }
@media (min-width: 1000px) {
  .review-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .review-layout.no-images { grid-template-columns: minmax(0, 1fr); }
  .review-images { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow: auto; }
}
.rv-img-toggle > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.rv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.rv-tabs button { font: inherit; font-size: 14px; min-height: 36px; padding: 0 12px; border: 1px solid var(--rule);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.rv-tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.rv-page { margin: 0; }
.rv-img-wrap { position: relative; line-height: 0; }
.rv-img-wrap img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.rv-hl-layer { position: absolute; inset: 0; pointer-events: none; }
.rv-hl { position: absolute; outline: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 2px; }
.rv-page figcaption { margin-top: 6px; font-size: 14px; line-height: 1.4; }

.rv-meta { display: grid; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); margin: 0 0 18px; }
.rv-meta h2, .rv-needs h2, .rv-abnormal h2 { font-size: 16px; margin: 0; }
.rv-meta-grid { display: grid; gap: 14px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.link-btn { font: inherit; background: none; border: 0; padding: 0 2px; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 32px; }

.rv-needs, .rv-blocking, .rv-abnormal { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--rule); }
.rv-needs ul, .rv-blocking ul, .rv-ab-list { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
.rv-needs li.issue-red a { color: var(--high); font-weight: 600; }
.rv-needs li a { color: var(--ink); }
.rv-needs .rv-needs-list { list-style: none; padding: 0; gap: 0; }
.rv-needs-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 10px 0; border-top: 1px solid var(--rule); }
.rv-needs-list li:first-child { border-top: none; }
.rv-needs-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 14em; }
.rv-needs-text a { font-weight: 600; }
.rv-needs-text span { font-size: 14px; overflow-wrap: anywhere; }
.rv-needs-actions { display: flex; gap: 8px; }
.rv-needs-actions button { min-height: 44px; }
.rv-hint { font-size: 14px; margin: 0; }
.rv-blocking { border-left: 3px solid var(--high); }
.rv-ab-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

.review-table td { vertical-align: top; }
.review-table .rv-name { white-space: normal; min-width: 8em; }
.review-table td.ref-cell { min-width: 8em; }  /* 让最右的“修改 / 撤销修改”列留在表格框里 */
.review-row[data-boxes] { cursor: pointer; }
.review-row.is-active td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* 需要重点核对的行：浅黄高亮 + 左侧黄线（2026-11-16 用户要求，不再用红线 / 棕线；红蓝只留给化验结果） */
:root { --check-bg: #FFF4C2; --check-bar: #E0A800; }
.review-row.needs-check > td { background: var(--check-bg); }
.review-row.needs-check > td:first-child { box-shadow: inset 4px 0 0 var(--check-bar); }
.review-row.needs-check.is-active > td { background: color-mix(in srgb, var(--accent) 12%, var(--check-bg)); }
.rv-why > span { white-space: nowrap; }
.rv-why { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: #8A5A00; font-weight: 600; }
.rv-check-mark { background: var(--check-bg); color: var(--ink); padding: 0 4px; border-radius: 4px; box-shadow: inset 3px 0 0 var(--check-bar); }
.rv-actions { white-space: nowrap; }
.rv-actions .btn-quiet { display: block; }  /* 修改 / 撤销修改 上下排，整列不超出表格框 */
.rv-actions .btn-quiet { color: var(--accent); min-height: 40px; }
.new-item { font-weight: 600; }

.edit-row td { white-space: normal; background: var(--surface); }
.rv-edit { display: grid; gap: 12px; padding: 8px 0; max-width: 48rem; }
.rv-edit h3 { margin: 0; font-size: 16px; }
.rv-grid, .rv-new { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
/* 同一行的框顶端对齐：某一栏下面有说明文字（如单位不能换算的提示）时，其他栏下面留空，不把框往下推 */
.rv-grid { align-items: start; }
.rv-final { margin-top: 20px; }
.rv-final .rv-reocr { margin: 0; display: contents; }
.rv-options label { display: flex; gap: 8px; align-items: center; min-height: 36px; font-size: 15px; }

/* —— 手动录入：项目名称提示 —— */
.mr-name { position: relative; }
.mr-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12); max-height: 18rem; overflow: auto; }
.mr-suggest li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.mr-suggest li:hover, .mr-suggest li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mr-suggest li span { color: var(--muted); font-size: 14px; }
.mr-suggest li small { margin-left: auto; color: var(--muted); }
.mr-hint { color: var(--accent); }

/* ================= 意见反馈：使用反馈 ================= */
.feedback .form { max-width: 40rem; }
.choice-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-set legend { font-size: 15px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.choice-set legend small { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr)); gap: 4px 16px; }
.choice-grid label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; cursor: pointer; }
.choice-grid input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); resize: vertical;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; box-sizing: border-box;
}
.field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.field.has-error textarea { border-color: var(--high); }
/* 作者看到的统计：横向条形图（纯 CSS，条长 = 次数 / 最多那项） */
.fb-h { font-size: 17px; margin: 0 0 10px; }
.fb-charts { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); margin-bottom: 28px; }
@media (min-width: 800px) { .fb-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; } }
.fb-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fb-bars li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 2.5em; align-items: center; gap: 10px; font-size: 14px; }
.fb-bar-label { overflow-wrap: anywhere; }
.fb-bar-track { height: 14px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.fb-bar { display: block; height: 100%; border-radius: 3px; }
.fb-bars-fav .fb-bar { background: var(--accent); }
.fb-bars-imp .fb-bar { background: var(--info); }
.fb-bar-count { text-align: right; font-weight: 600; }
.feedback-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feedback-list li { padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.feedback-list p { margin: 0 0 4px; }
.feedback-list .fb-meta { font-size: 13px; color: var(--muted); }
.feedback-list .fb-message { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }

/* ================= 第 10 步：趋势 ================= */
.trend { margin: 8px 0 28px; }
.trend h2 { font-size: 19px; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.trend-count { font-size: 14px; font-weight: normal; }
.trend-chart { width: 100%; height: 240px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); }
@media (min-width: 700px) { .trend-chart { height: 280px; } }
.trend-compact .trend-chart { height: 200px; }   /* 指标追踪页展开的指标：再矮一点 */
@media (min-width: 700px) { .trend-compact .trend-chart { height: 240px; } }
.trend-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 13px; color: var(--muted); }
.trend-legend li { display: inline-flex; align-items: center; gap: 4px; }
.trend-legend .sw { width: 18px; height: 12px; border-radius: 3px; display: inline-grid; place-items: center; }
.trend-legend .sw-high { background: color-mix(in srgb, var(--high) 22%, transparent); }
.trend-legend .sw-low { background: color-mix(in srgb, var(--low) 22%, transparent); }
.trend-legend .sw-normal { background: color-mix(in srgb, var(--muted) 16%, transparent); }
.trend-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.trend-legend .dot-high { background: var(--high); }
.trend-legend .dot-low { background: var(--low); }
.trend-legend .dot-normal { background: var(--accent); }   /* 与 trend.js 里正常点的颜色（--accent）一致 */
.trend-legend .shape { color: var(--ink); }
.trend-hint { font-size: 13px; margin: 0 0 6px; }
.trend-sub { font-size: 16px; margin: 18px 0 8px; }
.qual-line { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.qual-block { display: grid; justify-items: center; gap: 2px; min-width: 76px; min-height: 44px; padding: 6px 10px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--muted) 14%, transparent); border: 1px solid var(--rule); }
.qual-block .qual-val { font-weight: 700; }
.qual-block .qual-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qual-high, .qual-abnormal { background: color-mix(in srgb, var(--high) 18%, transparent);
  border-color: var(--high); color: var(--high); }
.qual-low { background: color-mix(in srgb, var(--low) 18%, transparent); border-color: var(--low); color: var(--low); }
.trend-table { margin-top: 16px; }
.trend-table > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.trend-table .text-link { display: inline-block; padding: 10px 0; }

.trends-head { display: block; }
.trends-profile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; margin: 0 0 4px; color: var(--muted); }
.trends-profile > span:not(:last-of-type)::after { content: "·"; margin: 0 8px; color: var(--rule); }
.trends-profile .text-link { margin-left: 12px; }
.trk-explain { margin: 0 0 8px; font-size: 14px; }
.trk-explain .text-link { color: #C2410C; }  /* 橙色（用户选定）；对白底对比度约 5:1 */
.trends-head h1 { margin-bottom: 4px; }
.trends-filter { margin: 0; }
.trends-filter .check-label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
  font-size: 16px; }
.trends-filter input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

/* 指标追踪：类别 → 指标 → 趋势图 + 历次结果 */
.trk-cat { margin: 0 0 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.trk-cat > summary { cursor: pointer; min-height: 48px; padding: 8px 14px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 4px 12px; }
.trk-cat-name { font-weight: 700; font-size: 17px; }
.trk-items { list-style: none; margin: 0; padding: 0 14px 8px; }
.trk-items > li { border-top: 1px solid var(--rule); }
.trk-item > summary { cursor: pointer; min-height: 48px; padding: 8px 0; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
.trk-name { font-weight: 600; color: var(--accent); }
.trk-latest { text-align: right; white-space: nowrap; }
.trk-meta { grid-column: 1 / -1; font-size: 13px; }
@media (min-width: 700px) {
  .trk-item > summary { grid-template-columns: minmax(0, 1fr) auto 14em; }
  .trk-meta { grid-column: auto; text-align: right; }
}
.trk-body { padding: 4px 0 16px; }
.trk-more { margin: 8px 0 0; font-size: 14px; }
.trend-compact { margin: 0; }
.trend-compact .trend-table { margin-top: 12px; }
.val-high, .val-abnormal { color: var(--high); font-weight: 700; }
.val-low { color: var(--low); font-weight: 700; }
.trk-cat > summary, .trk-item > summary { list-style: none; }
.trk-cat > summary::-webkit-details-marker, .trk-item > summary::-webkit-details-marker { display: none; }
.trk-cat > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.trk-cat[open] > summary::before { transform: rotate(90deg); }
.trk-name::before { content: "▸"; display: inline-block; margin-right: 6px; color: var(--muted); transition: transform .15s; }
.trk-item[open] .trk-name::before { transform: rotate(90deg); }

/* 核对页：“请核对以下项目”表 + 修改框（2026-11-16） */
.rv-edit .rv-current { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rv-edit .rv-target { position: relative; }
.rv-edit .mr-suggest { position: static; margin-top: 4px; }   /* 表格在可横向滚动的框里，浮层会被裁掉，改成跟在输入框下面 */
.rv-edit .mr-typical { justify-self: start; }
/* 手机上表格比屏幕宽：修改框固定在可见宽度内，不用横向拖动 */
.review-table .edit-row > td { white-space: normal; }
.review-table .edit-row .rv-edit { position: sticky; left: 0; max-width: calc(100vw - 48px); }
/* 核对页单位列表（自制下拉：自己新增的单位右侧有编辑、删除） */
.unit-pick { position: relative; }
.unit-btn { width: 100%; min-height: 44px; padding: 0 36px 0 12px; font: inherit; font-size: 16px; text-align: left;
  color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; position: relative; }
.unit-btn::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.unit-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.unit-list { margin: 4px 0 0; padding: 4px 0; list-style: none;  /* 在页面里展开（不用浮层），不会被表格框裁掉 */
  max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(31, 45, 51, .12); }
.unit-list [role=option] { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px;
  padding: 0 12px; font-size: 16px; cursor: pointer; }
.unit-list [role=option]:hover { background: var(--paper); }
.unit-list [role=option][aria-selected=true] { color: var(--accent); font-weight: 600; }
.unit-list .unit-group { height: 0; margin: 4px 0; border-top: 1px solid var(--rule); }  /* 分隔线，不写字 */
.unit-list .unit-group[data-group=dict] { display: none; }
.unit-list .unit-new { color: var(--accent); border-top: 1px solid var(--rule); }
.unit-acts { display: flex; gap: 4px; flex-shrink: 0; }
.unit-acts .btn-quiet { min-height: 36px; padding: 0 8px; font-size: 14px; font-weight: 400; }
.rv-newunit { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 8px; }
.rv-newunit legend { font-weight: 600; padding: 0 4px; }
.rv-newunit[hidden] { display: none; }
/* 新单位框打开时，修改框其余部分先收起，保存或取消后再回来 */
.rv-edit.nu-open > :not(.rv-newunit):not(h3) { display: none; }
.rv-nu-error { color: var(--high); font-style: normal; font-size: 14px; }
.rv-hits { border-left: 3px solid var(--accent); background: var(--paper); padding: 8px 12px; }
.rv-hits p { margin: 0 0 6px; }
.rv-patient { display: grid; gap: 6px; }
.rv-new-member { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rv-new-member select { font: inherit; font-size: 16px; min-height: 44px; }
.rv-new-sex { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.rv-new-sex select { min-width: 6em; padding: 0 8px; }
.rv-lead { margin: 0 0 8px; font-weight: 600; }
.ref-options.ref-options-only { margin: 0; font-size: 14px; }

/* 成员表单：身高、体重并排 */
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 两栏高度不同时（一栏下面有提示小字）输入框仍然上下对齐，提示在框下面 */
.field-pair > .field { align-content: start; }
.bmi-live:empty { display: none; }
.bmi-live, .bmi-note { margin: -8px 0 0; font-size: 14px; }

/* 右上角：欢迎语（原来的成员切换框移到了指标追踪页） */
.welcome { font-size: 14px; color: rgba(255, 255, 255, .85); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trends-member { margin: 0 0 8px; }
.trends-member label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.trends-member select { min-height: 44px; font-size: 16px; }

/* ================= 全站视觉：方向 A 晨光卡片（2026-11-16） =================
   内容块统一成白底圆角卡片 + 柔和阴影（不要细边框）；表头浅青底。 */
.trk-cat, .rv-meta, .rv-needs, .rv-blocking, .rv-abnormal, .guide-step, .manual-row, .feedback-list li,
.page-card, .skipped-list li, .notice, .processing {
  border-color: transparent; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.manual-row.has-error { border-color: var(--high); }
.notice, .processing { border-left: 4px solid var(--accent); }
.notice-error, .rv-blocking { border-left: 4px solid var(--high); }
.trend-chart { border-color: transparent; border-radius: 14px; box-shadow: var(--shadow-sm); }
.trk-cat { margin-bottom: 12px; transition: box-shadow .15s; }
.trk-cat:hover, .trk-cat[open] { box-shadow: var(--shadow-lift); }
.trk-cat > summary { min-height: 56px; padding: 10px 18px; }
.trk-items { padding: 0 18px 10px; }
.trk-cat > summary::before, .trk-name::before { color: var(--accent); }
/* 列表：整块白卡片，行之间细线 */
.report-list, .member-list, .item-list, .related-list {
  border-top: 0; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 2px 16px;
}
.report-list > li:last-child, .member-list li:last-child, .related-list li:last-child { border-bottom: 0; }
.item-list { padding: 2px 12px; column-gap: 20px; }
.report-thumb { border-radius: 8px; border-color: transparent; box-shadow: 0 1px 4px rgba(16, 42, 40, .15); }
/* 表格：表头浅青底、圆角 */
.draft-table th { background: #F0F7F6; border-bottom: 0; font-size: 13px; letter-spacing: .02em; }
.draft-table thead th:first-child { border-radius: 10px 0 0 10px; }
.draft-table thead th:last-child { border-radius: 0 10px 10px 0; }
/* 表单：输入框圆角，聚焦时浅青光圈 */
.field input:not([type="radio"]), .field select, .field textarea, .manual-row select, .unit-btn, .trends-member select {
  border-radius: 10px;
}
.field input:not([type="radio"]):focus, .field textarea:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .18);
}
.auth { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 28px 24px; margin-top: 8px; }
@media (max-width: 599px) { .auth { padding: 22px 16px; } }
.meaning { background: var(--surface); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; box-shadow: var(--shadow-sm); padding-right: 16px; }
@media (max-width: 639px) { .meaning { margin-bottom: 12px; } }
.qual-block { border-radius: 12px; }

/* ================= 欢迎页 /welcome（2026-11-16） ================= */
.wl-hero { position: relative; overflow: hidden; margin: 4px 0 24px; padding: 20px 20px 18px;
  background: linear-gradient(160deg, #FFFFFF 40%, #E6F5F1); border-radius: 24px; box-shadow: var(--shadow); }
.wl-hero::after { content: ""; position: absolute; right: -90px; top: -90px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, #C9EEE6, transparent 70%); pointer-events: none; }
.wl-hero > * { position: relative; z-index: 1; }
/* 第一个框：全部居中。2026-11-21 精简：标题 + 一句灰色标语 + 一张图（.wl-pic-c，在文件末尾） */
.wl-hero { text-align: center; }
.wl-hero h1 { font-size: clamp(22px, 5vw, 26px); line-height: 1.3; font-weight: 800; margin: 0 0 4px; }
/* 四步（2026-11-21 精简）：小格子，手机 2×2，电脑一排四个；每格整格可点 */
.wl-steps-wrap h2 { font-size: 16px; margin: 0 0 10px; }
.wl-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .wl-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
.wl-steps li { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.wl-steps li:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.wl-step { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; color: inherit; text-decoration: none; border-radius: inherit; }
.wl-step b { display: block; font-size: 14px; line-height: 1.35; }
.wl-step small { display: block; font-size: 12px; line-height: 1.35; color: var(--muted); }
.wl-ic { position: relative; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); }
.wl-ic::after { content: attr(data-n); position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.wl-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 599px) { .wl-hero { padding: 24px 18px 22px; } }
.site-footer a { color: inherit; margin-left: 10px; }
.site-footer a { display: inline-block; padding: 12px 4px; }

/* 登录 / 注册后的欢迎特效（static/welcome.js） */
.wl-burst { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  background: rgba(247, 250, 250, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: wl-fade-in .3s ease-out both; transition: opacity .4s; }
.wl-burst.is-out { opacity: 0; }
.wl-burst canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wl-burst-card { position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 36px; margin: 0 16px;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lift); text-align: center;
  animation: wl-pop .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.wl-burst-logo { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 6px; }
.wl-burst-logo svg { width: 32px; height: 32px; }
.wl-burst-title { margin: 0; font-size: clamp(22px, 5vw, 28px); font-weight: 800; }
.wl-burst-sub { margin: 0; color: var(--muted); }
.wl-burst.is-calm, .wl-burst.is-calm .wl-burst-card { animation-name: wl-fade-in; }
@keyframes wl-fade-in { from { opacity: 0; } }
@keyframes wl-pop { from { opacity: 0; transform: scale(.6) translateY(16px); } }

/* 深青页头里的右侧：欢迎语、退出、登录 */
.topbar .btn-quiet { color: #fff; min-height: 36px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; }
.topbar .btn-quiet:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.topbar-right > .nav-link { flex-direction: row; min-height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px;
  background: none; border: 1px solid rgba(255, 255, 255, .4); box-shadow: none; transform: none; }
.topbar-right > .nav-link::before { display: none; }
.topbar-right > .nav-link:hover { background: rgba(255, 255, 255, .14); box-shadow: none; transform: none; }
/* 没登录时右上角：注册（白底实心，更醒目）在登录左边（2026-11-21） */
.topbar-right > .nav-cta { background: #fff; color: var(--accent); border-color: #fff; font-weight: 700; }
.topbar-right > .nav-cta:hover { background: #F0FDF4; }
/* 头像菜单（2026-11-21，导航方案 B）：圆形首字头像 + 用户名 + ▾；点开是白色下拉卡片 */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer;
  list-style: none; font-size: 14px; color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.user-btn::-webkit-details-marker { display: none; }
.user-btn:hover, .user-menu[open] .user-btn { background: rgba(255, 255, 255, .26); }
.user-ava { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--accent); font-weight: 800; font-size: 15px; }
.user-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.user-menu[open] .user-caret { transform: rotate(180deg); }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 190px; padding: 6px;
  background: #fff; border-radius: 14px; box-shadow: 0 14px 36px rgba(5, 59, 56, .25); color: var(--ink); }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.user-pop a:hover, .user-pop button:hover { background: var(--accent-soft); color: var(--accent); }
.user-pop a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.user-pop svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-pop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--rule); }
@media (max-width: 759px) { .user-name { max-width: 6em; } }
/* 没登录时导航只有“指标说明”一项：不要拉满整行 */
@media (max-width: 759px) { .nav:has(> .nav-link:only-child) { grid-auto-columns: minmax(0, 33%); } }
/* 已上传检查单页：提示可以点指标名称看趋势 */
.stored-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--accent); }
.stored-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rv-ab-list .item-link { color: var(--accent); font-weight: 600; }  /* 不用浏览器默认的蓝色链接（蓝色表示偏低） */

/* 删除确认框（static/danger.js）：红框、大字，比浏览器自带的确认框醒目；红色这里表示危险操作 */
.danger-dialog { padding: 0; border: 0; background: transparent; max-width: min(420px, calc(100vw - 32px)); width: 100%; }
.danger-dialog::backdrop { background: rgba(31, 45, 51, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.danger-box { display: grid; justify-items: center; gap: 8px; padding: 26px 22px 22px; text-align: center;
  background: #fff; border: 3px solid var(--high); border-radius: 20px; box-shadow: 0 18px 40px rgba(198, 40, 40, .25); }
.danger-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #FDECEC; color: var(--high); }
.danger-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.danger-title { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--high); line-height: 1.35; }
.danger-note { margin: 0; font-size: 17px; color: var(--ink); }
.danger-actions { display: flex; gap: 12px; width: 100%; margin-top: 12px; }
.danger-actions > * { flex: 1; font-size: 17px; }
.btn-danger { font: inherit; font-size: 17px; font-weight: 700; min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px;
  color: #fff; background: linear-gradient(135deg, #E53935, var(--high)); box-shadow: 0 6px 16px rgba(198, 40, 40, .3); cursor: pointer; }
.btn-danger:hover { filter: brightness(1.05); }
.danger-dialog.is-final .danger-box { background: #FFF7F7; }

/* ===== 健康助手（/assistant）：像聊天应用一样，中间一栏 + 底部输入框 ===== */
.nav-short { display: none; }
@media (max-width: 759px) {   /* 手机导航六个按键：长名字换成短名（长名字仍给读屏软件） */
  .nav-link .nav-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-link .nav-short { display: inline; }
}
.as-wrap { max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 240px); }
.as-top { display: flex; justify-content: flex-end; align-items: flex-start; gap: 8px; margin: 4px 0 8px; }
.as-top-btn { display: inline-flex; align-items: center; font-size: 14px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); text-decoration: none; }
/* 历史：输入框左边第二个图标，向上弹出 */
.as-hist { flex: none; }
.as-hist > summary { list-style: none; }
.as-hist > summary::-webkit-details-marker { display: none; }
.as-hist[open] > summary { background: var(--accent-soft); color: var(--accent); }
.as-hist-panel { position: absolute; left: 8px; bottom: calc(100% + 8px); z-index: 7; width: min(340px, calc(100vw - 48px)); max-height: 55vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); padding: 8px; }
.as-hist-panel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.as-hist-panel li { display: flex; align-items: center; gap: 4px; }
.as-hist-panel li a { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-hist-panel li a span { display: block; font-size: 12px; color: var(--muted); }
.as-hist-panel li a:hover { background: #F0F7F6; }
.as-hist-panel li a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.as-hist-panel li > button { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; border-radius: var(--radius-sm); }
.as-hist-panel li > button:hover { color: var(--high); }
.as-hist-empty { margin: 8px 10px; color: var(--muted); font-size: 14px; }

.as-hello { text-align: center; margin: 20px 0 22px; }
.as-hello-face { display: block; width: 84px; height: 84px; margin: 0 auto 6px; filter: drop-shadow(0 8px 14px rgba(15, 118, 110, .25)); }
.as-hello h1 { font-size: clamp(24px, 5vw, 30px); margin: 0 0 6px; }
.as-hello p { color: var(--muted); margin: 0; }
.as-cards { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
.as-cards button { text-align: left; font: inherit; color: var(--ink); border: 0; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 14px 16px; cursor: pointer; display: grid; gap: 4px; transition: transform .15s, box-shadow .15s; min-height: 44px; }
.as-cards button:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.as-cards b { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.as-cards b svg { width: 22px; height: 22px; flex: none; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.as-cards span { font-size: 14px; color: var(--muted); }
@media (max-width: 479px) { .as-cards { gap: 10px; } .as-cards button { padding: 12px; } .as-cards span { font-size: 13px; } }

.as-msgs { display: grid; gap: 14px; align-content: start; flex: 1; padding-bottom: 16px; }
.as-alert { border-radius: 14px; background: #FDECEC; border: 1px solid #F3B4B4; color: #8E1B1B; padding: 12px 14px 12px 44px; position: relative; font-size: 15px; }
.as-alert::before { content: "!"; position: absolute; left: 12px; top: 13px; width: 22px; height: 22px; border-radius: 50%; background: var(--high); color: #fff;
  font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.as-alert b { display: block; font-size: 16px; color: var(--high); }
.as-err { border-radius: 14px; background: #FFF7E6; border: 1px solid #F5D28A; padding: 10px 14px; font-size: 15px; }
.bub-user { justify-self: end; max-width: 85%; background: var(--accent-soft); border-radius: 18px 18px 6px 18px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub-att { justify-self: end; font-size: 13px; color: var(--accent); display: flex; align-items: center; gap: 6px; margin-bottom: -8px; }
.bub-att svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.bub-bot { overflow-wrap: anywhere; }
.bub-bot .md > :first-child { margin-top: 0; }
.bub-bot h3 { font-size: 16px; margin: 14px 0 4px; }
.bub-bot p { margin: 0 0 8px; }
.bub-bot ul, .bub-bot ol { margin: 4px 0 8px; padding-left: 1.3em; }
.bub-bot li { margin: 3px 0; }
.bub-bot a { color: var(--accent); }
.bub-bot .hi { color: var(--high); font-weight: 600; }
.bub-bot .lo { color: var(--low); font-weight: 600; }
.bub-foot { margin-top: 4px; font-size: 12px; color: var(--muted); }
.as-wait { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.as-wait .dots { display: inline-flex; gap: 4px; }
.as-wait .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: as-dot 1.2s infinite ease-in-out; }
.as-wait .dots i:nth-child(2) { animation-delay: .15s; }
.as-wait .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes as-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .as-wait .dots i, .as-think .dots i { animation: none; opacity: .6; } }
/* 模型思考中（第一个字出来前）：估算的进度条 */
.as-think { display: grid; gap: 8px; max-width: 22rem; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.as-think-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; }
.as-think-top b { color: var(--accent); }
.as-think-sec { color: var(--muted); font-size: 13px; }
.as-think .dots { display: inline-flex; gap: 4px; }
.as-think .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: as-dot 1.2s infinite ease-in-out; }
.as-think .dots i:nth-child(2) { animation-delay: .15s; }
.as-think .dots i:nth-child(3) { animation-delay: .3s; }
.as-bar { height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.as-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .25s linear;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #5EEAD4); background-size: 200% 100%; animation: as-shine 1.6s linear infinite; }
@keyframes as-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .as-bar > i { animation: none; transition: none; } }

.as-compose { position: sticky; bottom: 0; z-index: 5; padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(247, 250, 250, 0), var(--paper) 22%); }
.as-formerr { margin: 0 0 8px; color: var(--high); font-size: 14px; }
.as-box { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 24px; box-shadow: var(--shadow); padding: 5px; }
.as-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15), var(--shadow); }
.as-row { display: flex; align-items: flex-end; gap: 2px; min-width: 0; }
.as-box textarea { flex: 1; min-width: 0; display: block; border: 0; outline: 0; resize: none; font: inherit; font-size: 16px; line-height: 22px;
  height: 40px; min-height: 40px; max-height: 160px; background: transparent; padding: 9px 6px; color: var(--ink); }
.as-ico, .as-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.as-ico { border: 0; background: none; color: var(--muted); }
.as-ico:hover { background: #F0F7F6; color: var(--accent); }
.as-ico:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.as-ico svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.as-plus[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.as-chip { display: flex; width: max-content; max-width: calc(100% - 8px); align-items: center; gap: 2px; min-height: 30px; margin: 2px 4px 4px; padding: 0 2px 0 10px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; min-width: 0; }
.as-chip[hidden] { display: none; }
.as-chip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-chip button { width: 30px; height: 30px; border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 18px; border-radius: 50%; flex: none; }
.as-send { border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm); }
.as-send:disabled { opacity: .5; cursor: default; }
.as-send svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.as-note { font-size: 11px; color: var(--muted); text-align: center; margin: 4px 0 0; }
/* 回答输出时页面不跟着滚：下面还有新内容时，输入框上方出现这个按钮 */
.as-more { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.as-more[hidden] { display: none; }
.as-pop { position: absolute; left: 8px; bottom: calc(100% + 8px); width: min(360px, calc(100vw - 48px)); background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift); padding: 14px; z-index: 7; }
.as-pop[hidden] { display: none; }
.as-pop h2 { margin: 0 0 6px; font-size: 15px; }
.as-pop .lbl { font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.as-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.as-opts label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 14px; cursor: pointer; }
.as-opts label small { color: var(--muted); font-size: 12px; }
.as-opts input { position: absolute; opacity: 0; pointer-events: none; }
.as-opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.as-opts label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.as-pop .chk { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; margin-top: 4px; }
.as-pop .chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.as-pop-msg { margin: 4px 0 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.as-pop-msg.is-err { color: var(--high); }
.as-pop .btn-primary { width: 100%; justify-content: center; margin-top: 8px; }
.as-pop .btn-primary:disabled { opacity: .5; cursor: default; transform: none; }
/* 代用户操作的待确认卡片（assistant.js renderCard）：像一条对话，没有输入框；点“确认”才保存 */
.as-action { max-width: 34rem; border-radius: 18px 18px 18px 6px; background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--accent-soft); padding: 12px 14px; }
.as-action.is-draft { border-color: rgba(15, 118, 110, .35); }
.as-action.is-replaced { display: none; }
.as-action.is-cancelled { opacity: .7; }
.as-action p { margin: 0 0 6px; }
.as-act-list { margin: 0 0 6px; padding-left: 1.2em; }
.as-act-list li { margin: 2px 0; font-weight: 600; }
.as-act-note { font-size: 13px; color: var(--muted); }
.as-act-err { color: var(--high); font-size: 14px; }
.as-act-sum { margin: 0 !important; font-size: 14px; }
.as-act-sum a { color: var(--accent); font-weight: 600; }
.as-act-btns { display: flex; gap: 8px; margin-top: 8px; }
.as-act-btns .btn-primary { min-height: 40px; }
.as-act-btns button:disabled { opacity: .5; }
.is-embed .as-action { padding: 10px 12px; font-size: 14px; }

/* 小窗（其他页面右下角的 iframe，/assistant?embed=1）：没有页头页脚，铺满小窗 */
body.is-embed { background-image: none; }
body.is-embed .page { max-width: none; width: 100%; box-sizing: border-box; }
.as-wrap.is-embed { min-height: calc(100vh - 6px); min-height: calc(100dvh - 6px); }
.as-wrap.is-embed .as-top { margin: 0 0 6px; }
.as-wrap.is-embed .as-top-btn { min-height: 36px; font-size: 13px; }
body.is-embed { font-size: 14px; }
body.is-embed .page { padding: 6px 8px 0; }
.is-embed .bub-user, .is-embed .bub-bot, .is-embed .as-alert, .is-embed .as-err { font-size: 14px; line-height: 1.6; }
.is-embed .bub-bot h3 { font-size: 15px; margin: 10px 0 2px; }
.is-embed .as-msgs { gap: 10px; }
.is-embed .bub-foot, .is-embed .as-note { font-size: 11px; }
.is-embed .as-box { padding: 3px; border-radius: 20px; }
.is-embed .as-ico, .is-embed .as-send { width: 36px; height: 36px; }
.is-embed .as-box textarea { height: 36px; min-height: 36px; padding: 7px 4px; max-height: 120px; }   /* 仍是 16px：iPhone 输入框小于 16px 会自动放大页面 */
.is-embed .as-think { padding: 8px 10px; }
.is-embed .as-think-top { font-size: 13px; }
.is-embed .as-start-mini { margin: 4px 0 10px; padding: 8px 10px; gap: 8px; }
.is-embed .as-start-mini .as-hello-face { width: 40px; height: 40px; }
.is-embed .as-start-mini p { font-size: 13px; }
.is-embed .as-start-mini b { font-size: 14px; }
.is-embed .as-pop, .is-embed .as-hist-panel { width: calc(100vw - 30px); left: 4px; max-height: 70vh; overflow: auto; }
.as-start-mini { display: flex; align-items: center; gap: 12px; margin: 10px 2px 16px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.as-start-mini .as-hello-face { width: 52px; height: 52px; margin: 0; flex: none; }
.as-start-mini p { margin: 0; font-size: 14px; color: var(--muted); }
.as-start-mini b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }

/* “医迹AI”形象：眨眼、天线小灯跳动；右下角入口另外加左右张望、蝴蝶结摆动 */
.ai-face { overflow: visible; }
.ai-face .ai-eyes { transform-box: fill-box; transform-origin: center; animation: ai-blink 4.5s infinite; }
.ai-face .ai-antenna-dot { transform-box: fill-box; transform-origin: center; animation: ai-pulse 1.6s infinite ease-in-out; }
.ai-face .ai-bow { transform-box: fill-box; transform-origin: center; }
.as-hello-face { animation: ai-bob 3.2s infinite ease-in-out; }
@keyframes ai-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes ai-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .7; } }
@keyframes ai-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* 每页右下角的入口（助手页本身不显示）：浮得更高、会歪头，外面一圈旋转的彩色光环，旁边闪小星星 */
.ai-buddy { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 66px; height: 66px;
  display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFFFFF 0, #F0FBF9 60%, #D9F3EE 100%);
  box-shadow: 0 10px 24px rgba(16, 42, 40, .22), 0 0 22px rgba(20, 163, 148, .35);
  animation: ai-float 4.2s infinite ease-in-out; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ai-buddy[hidden] { display: none; }
.ai-buddy::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent-2); opacity: 0;
  animation: ai-ring 2.8s infinite ease-out; pointer-events: none; }
.ai-halo { position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, #14A394, #5EEAD4, #F9A8D4, #FDE68A, #5EEAD4, #14A394);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  animation: ai-spin 3.5s linear infinite; }
.ai-buddy .ai-face { position: relative; width: 54px; height: 54px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.ai-buddy .ai-eyes { animation: ai-look 6s infinite; }
.ai-buddy .ai-bow { animation: ai-wiggle 2.4s infinite ease-in-out; }
.ai-buddy:hover .ai-face, .ai-buddy:focus-visible .ai-face { transform: scale(1.14) rotate(-8deg); }
.ai-buddy:hover { animation: ai-hop .6s ease-out; }
.ai-buddy:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.ai-spark { position: absolute; width: 10px; height: 10px; pointer-events: none; opacity: 0;
  background: #FDE68A; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: ai-twinkle 2.6s infinite ease-in-out; }
.ai-spark:nth-of-type(1) { left: -6px; top: 2px; }
.ai-spark:nth-of-type(2) { right: -4px; top: -8px; width: 8px; height: 8px; background: #5EEAD4; animation-delay: .9s; }
.ai-spark:nth-of-type(3) { right: -9px; bottom: 10px; width: 7px; height: 7px; background: #F9A8D4; animation-delay: 1.7s; }
.ai-buddy-tip { position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%); white-space: nowrap; pointer-events: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  box-shadow: var(--shadow); opacity: 0; transition: opacity .18s, transform .18s; }
.ai-buddy-tip::after { content: ""; position: absolute; left: 100%; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left-color: var(--accent-2); }
.ai-buddy:hover .ai-buddy-tip, .ai-buddy:focus-visible .ai-buddy-tip { opacity: 1; transform: translate(0, -50%); }
@keyframes ai-float { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-12px) rotate(-7deg); }
  50% { transform: translateY(-4px) rotate(0); } 75% { transform: translateY(-10px) rotate(6deg); } }
@keyframes ai-hop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-16px) scale(1.06, .94); } 70% { transform: translateY(0) scale(.96, 1.04); } 100% { transform: none; } }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-ring { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
@keyframes ai-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 45% { opacity: 1; transform: scale(1.1) rotate(45deg); } 70% { opacity: 0; transform: scale(.4) rotate(90deg); } }
@keyframes ai-look { 0%, 18%, 100% { transform: translateX(0) scaleY(1); } 24%, 36% { transform: translateX(-2px) scaleY(1); }
  42%, 54% { transform: translateX(2px) scaleY(1); } 60%, 88% { transform: translateX(0) scaleY(1); } 91% { transform: scaleY(.1); } 94% { transform: scaleY(1); } }
@keyframes ai-wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-22deg); } 80% { transform: rotate(16deg); } 90% { transform: rotate(-8deg); } }
/* 页面最底部留出小人的位置，最后的按钮可以滚到它上面，不被挡住 */
@media (max-width: 899px) { body:has(> .ai-buddy) .site-footer { padding-bottom: 84px; } }
@media (max-width: 599px) { .ai-buddy { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 58px; height: 58px; } .ai-buddy .ai-face { width: 48px; height: 48px; } }

/* 对话小窗（static/ai_panel.js）：电脑上在右下角，手机上几乎占满屏幕 */
/* 约占屏幕 1/8：宽约 1/4、高约 1/2 */
.ai-panel { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: clamp(300px, 25vw, 380px); height: clamp(380px, 50vh, 500px); max-height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--paper);
  box-shadow: 0 24px 60px rgba(16, 42, 40, .32), 0 0 0 1px rgba(15, 118, 110, .12);
  transform-origin: 100% 100%; opacity: 0; transform: translateY(16px) scale(.94); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.ai-panel[hidden] { display: none; }
.ai-panel.is-open { opacity: 1; transform: none; }
.ai-panel-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; color: #fff;
  background: var(--hdr); }
.ai-panel-head b { flex: 1; font-size: 14px; letter-spacing: .04em; }
.ai-panel-face { width: 28px; height: 28px; flex: none; padding: 2px; border-radius: 50%; background: #fff; }
.ai-panel-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.ai-panel-btn:hover { background: rgba(255, 255, 255, .24); }
.ai-panel-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.ai-panel-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ai-panel iframe { flex: 1; width: 100%; border: 0; background: var(--paper); }
@media (max-width: 599px) {
  .ai-panel { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; height: 55vh; height: 55dvh; min-height: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-buddy, .ai-buddy:hover, .ai-buddy::before, .ai-halo, .ai-spark, .as-hello-face, .ai-face .ai-eyes, .ai-face .ai-antenna-dot, .ai-buddy .ai-bow { animation: none; }
  .ai-spark { display: none; }
  .ai-panel, .ai-buddy .ai-face { transition: none; }
}

/* 测试环境（BENCH_MODE=1）：顶部提示条和准确率统计页 /bench */
.bench-banner { background: #FFF4C2; color: #5C4400; text-align: center; font-size: 14px; padding: 6px 16px; }
.bench-banner a { color: #5C4400; font-weight: 600; }
.bench-h { font-size: 18px; margin: 24px 0 10px; }
.bench-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bench-stat { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.bench-stat-v { font-size: 24px; font-weight: 700; color: var(--accent); }
.bench-stat-l { font-size: 14px; color: var(--ink); }
.bench-stat-n { font-size: 12px; color: var(--muted); }
.bench-reasons { list-style: none; padding: 0; margin: 0; max-width: 560px; }
.bench-reasons li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.bench-bad { color: #B45309; }
.bench-export { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* 核对页原图缩放（替换了放大镜）：滚轮 / ＋－ / 双指捏合，放大后拖动 */
.rv-img-wrap { overflow: clip; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.rv-img-wrap.is-zoomed { touch-action: none; cursor: grab; }
.rv-img-wrap.is-dragging { cursor: grabbing; }
.rv-zoom-stage { position: relative; transform-origin: 0 0; will-change: transform; }
/* 控件在图片外：右边竖条（上下移动）、下面横条（左右移动）、再下面缩放条；没放大时拖动条变淡 */
.rv-zoom-frame { display: grid; grid-template-columns: minmax(0, 1fr) 22px; column-gap: 4px; row-gap: 2px; align-items: start; }
.rv-pan { margin: 0; accent-color: var(--accent); cursor: pointer; }
.rv-pan:disabled, .rv-zoom-range:disabled { opacity: .35; cursor: default; }
.rv-pan-x { grid-column: 1; width: 100%; height: 22px; }
.rv-pan-y { grid-column: 2; grid-row: 1; width: 22px; writing-mode: vertical-lr; direction: ltr; }
.rv-zoom-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; padding-right: 26px; }
.rv-zoom-bar button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--accent); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
.rv-zoom-bar .rv-zoom-reset { width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; }
.rv-zoom-bar button:disabled { opacity: .4; cursor: default; }
.rv-zoom-range { flex: 1 1 60px; min-width: 60px; max-width: 220px; margin: 0; accent-color: var(--accent); }
.rv-zoom-bar .text-link { margin-left: auto; font-size: 14px; }
/* 保存后滚回的那一行：短暂闪一下（青绿色，不用红/蓝） */
@keyframes rv-flash { 0% { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); } 100% { background: transparent; box-shadow: none; } }
.review-row.rv-flash > td { animation: rv-flash 1.8s ease-out; }
.rv-nu-note { display: block; margin-top: 4px; font-size: 13px; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .review-row.rv-flash > td { animation: none; } }

/* 核对页：采样日期必填（没识别到时高亮），确认提交旁的报错 */
.rv-date.is-required input { border-color: var(--check-bar, #E0A800); background: var(--check-bg, #FFF4C2); box-shadow: 0 0 0 3px rgba(224, 168, 0, .25); }
.rv-req { font-size: 12px; font-weight: 700; color: #8A5A00; background: var(--check-bg, #FFF4C2); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.rv-req-note { color: #8A5A00; }
.rv-final-error { flex-basis: 100%; text-align: right; margin: 4px 0 0; }
.item-ai-note { font-size: 13px; color: var(--muted); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 6px 10px; margin: -4px 0 12px; }

/* 收藏星标（我的收藏）：金色，不用 --high/--low 的红蓝；触控区 44px */
.fav-form { display: inline-flex; margin: 0; }
.fav-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--muted); box-shadow: none; }
.fav-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav-btn:hover { background: #FFF4C2; color: #A16207; }
.fav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fav-btn.is-on { color: #A16207; }
.fav-btn.is-on svg { fill: #F2B705; }
.fav-form-text .fav-btn { width: auto; padding: 0 14px 0 10px; border: 1px solid var(--rule); background: var(--surface); font-size: 15px; color: var(--ink); }
.fav-form-text .fav-btn.is-on { border-color: #E0A800; background: #FFF8DB; color: #8A5A00; }
.fav-form-text .fav-btn.is-on svg { stroke: #A16207; }
.item-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-title .fav-form { flex: none; margin-top: 2px; }
.trk-row { display: flex; align-items: flex-start; gap: 4px; }
.trk-row > .trk-item { flex: 1; min-width: 0; }
.trk-row > .fav-form { flex: none; margin-top: 2px; }
.draft-table th.fav-col, .draft-table td.fav-col { width: 44px; padding: 0 2px; text-align: center;
  position: sticky; right: 0; background: var(--surface); }  /* 手机上表格横向滚动时，星标仍在右边看得到 */
.draft-table thead th.fav-col { background: #F0F7F6; }
.rv-ab-list li .fav-form { align-self: center; margin: -10px 0; }
.trk-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.trk-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px; }
.trk-tab svg { width: 18px; height: 18px; fill: none; stroke: #A16207; stroke-width: 1.8; stroke-linejoin: round; }
.trk-tab[aria-current="true"], .trk-tab:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.trk-tab[aria-current="true"] svg, .trk-tab:has(input:checked) svg { fill: #F2B705; stroke: #F2B705; }
label.trk-tab { cursor: pointer; }
label.trk-tab input { width: 18px; height: 18px; margin: 0; accent-color: #fff; }
label.trk-tab:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.trk-waiting { margin-top: 12px; }

/* ================= 用药记录 / 健康事件（2026-11-19） ================= */
/* 事件小旗的颜色：紫色 = 用药，灰蓝 = 其他事件。红/蓝只给化验值，青绿是正常点和主色，所以都不用 */
:root { --event-med: #7C3AED; --event-other: #475569; }
.med-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.med-head-actions a { text-decoration: none; display: inline-flex; align-items: center; }
/* 💊 = 用药（列表、卡片、小标签、趋势图都用它）；停药 = 💊 上加一道紫色斜杠 */
.pill-ico { position: relative; display: inline-block; line-height: 1; font-style: normal;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.pill-stop::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; margin-top: -1px;
  background: var(--event-med); border-radius: 2px; box-shadow: 0 0 0 1px var(--surface); transform: rotate(45deg); }  /* 和 💊 本身的斜向交叉 */
.med-section { margin: 0 0 24px; }
.med-section h2 { font-size: 18px; margin: 0 0 8px; }
.med-actions { flex-wrap: wrap; justify-content: flex-end; }
.med-form { max-width: 32rem; }
.med-form .trk-tabs { margin: 4px 0 16px; }
.med-dose { display: grid; grid-template-columns: 1fr 7em; gap: 8px; }
.med-kinds { flex-wrap: wrap; gap: 6px 20px; }
@media (max-width: 520px) { .member-list li:has(.med-actions) { flex-direction: column; align-items: stretch; } }
/* 确认提交后的“在用药吗？”卡片 */
.med-prompt { position: relative; margin: 0 0 20px; padding: 16px 18px; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border-left: 4px solid var(--event-med); }
.med-prompt h2 { font-size: 18px; margin: 0 36px 4px 0; display: flex; align-items: center; gap: 4px; }
.med-prompt .mp-sub { margin: 0 0 10px; font-size: 14px; }
.mp-q { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.mp-x { position: absolute; top: 6px; right: 6px; margin: 0; }
.mp-close { width: 44px; height: 44px; border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; border-radius: 50%; }
.mp-close:hover { background: var(--accent-soft); }
.mp-note { margin: 0 0 6px; color: var(--accent); font-size: 15px; }
.mp-ask { list-style: none; margin: 0 0 10px; padding: 0; }
.mp-ask li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule); }
.mp-btns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.mp-btns form { margin: 0; }
.mp-small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.med-prompt summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
.med-prompt summary::-webkit-details-marker { display: none; }
.mp-btns:has(.mp-stop[open]) { flex-basis: 100%; }
.mp-stop[open] { flex-basis: 100%; }
.mp-form { display: grid; gap: 10px; margin: 10px 0 4px; max-width: 26rem; }
.mp-form .btn-primary { justify-self: start; }
.mp-add { margin: 6px 0 4px; }
.mp-done { display: flex; align-items: center; gap: 16px; margin: 8px 0 0; }
/* 趋势图图例：用药/事件小旗 */
.trend-legend .flag { width: 9px; height: 14px; stroke-width: 1.5; }
.trend-legend .flag-event { fill: var(--event-other); stroke: var(--event-other); }
.trend-legend .pill-ico { font-size: 13px; margin-right: 3px; }
.trend-marks-toggle label { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; cursor: pointer; }
.trend-marks-toggle small { font-size: 11px; color: var(--muted); }
.trend-marks-toggle .flag { margin-right: 2px; }
.trend-marks-toggle input { accent-color: var(--event-med); width: 16px; height: 16px; }
/* 指标追踪：正在用药 = 一排 💊 小标签，右边“＋ 添加 / 全部记录” */
.trends-meds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; padding: 8px 12px;
  background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); font-size: 15px; }
.tm-label { font-weight: 600; color: var(--ink); }
.tm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--event-med) 9%, var(--surface)); color: var(--event-med); font-weight: 600; }
.tm-chip small { font-weight: normal; font-size: 13px; color: var(--muted); }
.tm-none { color: var(--muted); }
.tm-actions { display: flex; gap: 6px; margin-left: auto; }
.tm-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--accent); text-decoration: none; font-size: 14px; white-space: nowrap; }
.tm-btn:hover { background: var(--accent-soft); }
.trk-explain { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.trk-explain .trk-add-event { color: var(--event-med); }

/* ===== 开场动画（2026-11-21，static/splash.js）：全屏浅底，先出“医迹”和标语，再画“健康足迹之路”、一个个脚印走过去（约 3 秒） ===== */
.splash-screen { display: none; }
html.splash .splash-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 6px;
  padding: 24px; text-align: center; cursor: pointer;
  background: radial-gradient(500px 300px at 85% 10%, #ECFCCB, transparent 70%), radial-gradient(500px 320px at 10% 95%, #CCFBF1, transparent 70%), #F3FAF6;
  transition: opacity .4s; }
html.splash body { overflow: hidden; }
.splash-screen.is-out { opacity: 0; }
.splash-road { width: min(420px, 86vw); height: auto; overflow: visible; }
.splash-name { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: .08em; color: var(--ink); opacity: 0; }
.splash-motto { margin: 0 0 18px; font-size: 14px; color: var(--muted); opacity: 0; }
.sp-band { stroke-dasharray: 420; stroke-dashoffset: 420; }
.sp-path { opacity: 0; }
.sp-foot { fill: #0F766E; opacity: 0; }   /* 只淡入，不缩放（缩放会和 SVG 的 rotate 叠在一起，脚印跑偏） */
.sp-dot, .sp-logo { opacity: 0; transform-box: fill-box; transform-origin: center; }
.is-go .sp-band { animation: sp-draw 1.1s .9s ease-out forwards; }
.is-go .sp-path { animation: sp-show .4s .9s forwards; }
.is-go .sp-foot { animation: sp-step .3s var(--d) ease-out forwards; }
.is-go .sp-dot { animation: sp-pop .35s var(--d) cubic-bezier(.2, 1.6, .4, 1) forwards; }
.is-go .sp-logo { animation: sp-pop .5s 2.15s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.is-go .splash-name { animation: sp-rise .5s .1s ease-out forwards; }
.is-go .splash-motto { animation: sp-rise .5s .4s ease-out forwards; }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-show { to { opacity: 1; } }
@keyframes sp-step { to { opacity: .8; } }
@keyframes sp-pop { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
@keyframes sp-rise { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

/* 关于页封面图（2026-11-21）：检查单 → 手机里的趋势曲线 */
.wl-motto2 { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.wl-pic-c { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto 6px; }

/* 核对页修改框：指标类别（2026-11-21） */
.rv-cat { max-width: 22em; }
.rv-cat select { width: 100%; }
.rv-cat > label { font-size: 15px; font-weight: 600; }
.rv-cat .rv-cat-fixed { margin: 0; padding: 10px 0; color: var(--ink); }
