/* 苹果原生工作台 · 今日接诊 · 样式
 * 规则：系统字体；正文 ≥15px；一个强调色（苹果蓝，只用于主按钮、选中、链接）；
 * 圆角 8 / 12 / 16 三级；阴影 3 级；留白 8 的倍数；毛玻璃只在导航层（侧栏、工具栏、手机底栏）。
 */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #5b5e66;      /* 次要文字：白底 6.5:1，#f5f5f7 底 6.0:1 */
  --line: #e3e3e8;
  --line-strong: #c8c8ce;
  --fill: #ececf0;
  --accent: #0a66d8;      /* 苹果蓝：白字 5.4:1 */
  --accent-hover: #0858bd;
  --accent-soft: #e8f1fc; /* 选中浅底：蓝字 4.7:1 */
  --nav-glass: rgba(242, 242, 245, 0.82);
  --bar-glass: rgba(255, 255, 255, 0.82);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --sh-2: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --sh-3: 0 16px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --focus: 0 0 0 3px rgba(10, 102, 216, 0.45);
  --dur: 160ms;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overflow: clip;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.muted { color: var(--text-2); }

/* ---------- 文字层级 ---------- */
.title-xl { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.2; margin: 0; }
.title-l { font-size: 24px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.25; margin: 0; }
.title-m { font-size: 19px; font-weight: 600; margin: 0; }
.title-s { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.eyebrow { font-size: 13px; color: var(--text-2); margin: 0 0 4px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }
.meta { font-size: 13px; color: var(--text-2); }
.src { display: block; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.body-l { font-size: 17px; margin: 0; }
p { margin: 0 0 8px; }

/* ---------- 框架 ---------- */
.stage { height: 100vh; overflow: hidden; overflow: clip; }
.app {
  position: relative;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
}

/* 侧栏：导航层，可轻度毛玻璃 */
.sidebar {
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--nav-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px; min-height: 64px; }
.sb-logo { width: 32px; height: 32px; border-radius: var(--r-s); background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.sb-brand-text strong { font-size: 15px; }
.sb-brand-text span { font-size: 13px; color: var(--text-2); }
.icon-btn.sb-close { display: none; margin-left: auto; }
.sb-groups { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.sb-group { margin-top: 8px; }
.sb-group-head { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 8px 12px 4px; display: flex; align-items: center; justify-content: space-between; }
.sb-group-head.fold { width: 100%; min-height: 44px; border: 0; background: none; border-radius: var(--r-s); padding: 0 12px; text-align: left; }
.sb-group-head.fold:hover { background: rgba(0, 0, 0, 0.04); }
.sb-list { list-style: none; margin: 0; padding: 0; }
.sb-item {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  border: 0; border-radius: var(--r-s);
  background: transparent; text-align: left; font-size: 15px;
  transition: background-color var(--dur) ease;
}
.sb-item:hover { background: rgba(0, 0, 0, 0.05); }
.sb-item .ic { color: var(--text-2); }
.sb-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-item.on .ic { color: var(--accent); }
.sb-count { margin-left: auto; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sb-item.on .sb-count { color: var(--accent); }
.sb-foot { position: relative; border-top: 1px solid var(--line); padding: 8px; }
.sb-me { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: var(--r-s); text-align: left; }
.sb-me:hover { background: rgba(0, 0, 0, 0.05); }
.sb-me-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sb-me-text span { font-size: 13px; color: var(--text-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-weight: 600; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 19px; }
.popover { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-3); padding: 16px; z-index: 40; }
.pop-title { font-weight: 600; margin-bottom: 8px; }
.pop-note { font-size: 13px; color: var(--text-2); margin: 8px 0 0; }
.radio-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }

.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }

/* 工具栏：导航层，可轻度毛玻璃 */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 24px; flex: none;
  background: var(--bar-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.icon-btn.tb-menu { display: none; }
.tb-crumb { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-tag { font-size: 13px; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.tb-spacer { flex: 1; }
.tb-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: var(--fill); border-radius: var(--r-s); color: var(--text-2); width: 240px; }
.tb-search input { border: 0; background: transparent; outline: none; width: 100%; min-height: 36px; color: var(--text); }
.tb-search:focus-within { box-shadow: var(--focus); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-s); color: var(--text); }
.icon-btn:hover { background: rgba(0, 0, 0, 0.05); }

.content-row { flex: 1; display: flex; min-height: 0; }
.main-scroll { flex: 1; overflow-y: auto; padding: 24px 32px 32px; min-width: 0; }
.view { max-width: 1120px; margin: 0 auto; }

/* ---------- 控件 ---------- */
.btn {
  min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color var(--dur) ease, border-color var(--dur) ease;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn.secondary:hover { background: #f7f7f9; }
.btn.plain { background: none; color: var(--accent); padding: 0 8px; }
.btn:disabled { background: #f2f2f4; border-color: var(--line); color: #8a8d94; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.actions .meta { margin-left: 4px; }

.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg-btn { min-height: 40px; min-width: 88px; padding: 0 16px; border: 0; border-radius: var(--r-s); background: transparent; font-size: 15px; color: var(--text); }
.seg-btn.on { background: var(--surface); box-shadow: var(--sh-1); font-weight: 600; }
.seg-full { display: flex; }
.seg-full .seg-btn { flex: 1; }

.pill { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.pill.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }

.tag { font-size: 13px; color: var(--text-2); background: var(--fill); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.badge { font-size: 13px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.b-neutral { background: var(--fill); color: #3a3c42; }
.b-attn { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.b-done { background: var(--fill); color: var(--text); }
.b-done::before { content: "✓ "; }
.b-strong { background: var(--text); color: #fff; }
.ai-label { font-size: 13px; font-weight: 500; color: #3a3c42; border: 1px dashed #8e8e93; border-radius: 6px; padding: 0 6px; margin-left: 8px; white-space: nowrap; }

/* ---------- 首页 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 24px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); }
.stat { padding: 12px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat dt { font-size: 13px; color: var(--text-2); }
.stat dd { margin: 0; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

.split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.pane { min-width: 0; }
.list-pane { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.queue-full { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.queue-peek { display: none; }
.search-field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--fill); color: var(--text-2); }
.search-field input { border: 0; outline: none; background: transparent; width: 100%; min-height: 44px; color: var(--text); font-size: 15px; }
.search-field:focus-within { box-shadow: var(--focus); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.list-count { font-size: 13px; color: var(--text-2); margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  width: 100%; min-height: 64px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; text-align: left;
  transition: background-color var(--dur) ease;
}
.rows li + li .row { margin-top: 2px; }
.row:hover { background: #f5f5f7; }
.row.on { background: var(--accent-soft); }
.row.on strong { color: var(--accent); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.row-title strong { font-size: 16px; }
.row-sub { font-size: 14px; color: var(--text-2); }
.new-tag { color: var(--accent); font-weight: 600; }
.empty { color: var(--text-2); padding: 16px 4px; margin: 0; }
.todos { border-top: 1px solid var(--line); padding-top: 16px; }
.rows.plain .todo { display: flex; flex-direction: column; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.rows.plain .todo:last-child { border-bottom: 0; }

.focus { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: 24px; }
.who { display: flex; align-items: center; gap: 16px; margin: 8px 0 16px; }
.who-text { flex: 1; min-width: 0; }
.who-text .meta { margin: 4px 0 0; }
.allergy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 12px 16px; background: #f6f6f8; border-left: 3px solid var(--text); border-radius: 0 var(--r-s) var(--r-s) 0; }
.allergy-k { font-size: 13px; font-weight: 600; color: var(--text-2); }
.allergy-v { font-size: 17px; font-weight: 700; }
.allergy .src { margin: 0; }
.section { margin-top: 20px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.inline-expand { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.qa { margin: 0; }
.qa dt { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.qa dd { margin: 2px 0 0; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--text-2); font-size: 14px; }
.kv dd { margin: 0; }

.ai-cards { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-card { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); padding: 16px 20px; }
.ai-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-card-head .badge { margin-left: auto; }
.ai-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: #3a3c42; }
.ai-card .actions { margin-top: 8px; }

/* ---------- 接诊页 ---------- */
/* 吸顶只留一条紧凑患者条：姓名＋简要信息＋过敏史；返回/切换患者那一行不吸顶 */
.enc-head { position: sticky; top: -24px; z-index: 5; background: var(--bg); padding: 34px 0 10px; margin-top: -24px; display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.enc-id { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.enc-head .allergy { flex: 1; min-width: 280px; padding: 8px 12px; }
.enc-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px 0 4px; border: 0; background: none; color: var(--accent); font-size: 15px; border-radius: var(--r-s); }
.back-link:hover { background: rgba(10, 102, 216, 0.06); }
.switch-pt { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.switch-pt select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 15px; color: var(--text); }
.enc-head .who { margin: 8px 0 12px; }
.progress { display: grid; grid-template-columns: repeat(6, 1fr); margin: 4px 0 16px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); }
.progress div { padding: 10px 16px; border-left: 1px solid var(--line); }
.progress div:first-child { border-left: 0; }
.progress dt { font-size: 13px; color: var(--text-2); }
.progress dd { margin: 0; font-size: 15px; font-weight: 600; }
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 24px; margin-top: 16px; max-width: 860px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head .badge { margin-left: auto; }
.field { margin-top: 16px; }
.field label { display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  font-size: 15px; line-height: 1.5; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: #6e7178; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--focus); }
.field input[readonly], .field textarea[readonly] { background: #f7f7f9; }
.diffs { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.diff-grid { display: flex; flex-direction: column; }
.diff-row { display: grid; grid-template-columns: 72px 1fr 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.diff-row.hd { font-size: 13px; color: var(--text-2); font-weight: 600; }
.choice { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 0 12px; text-align: left; font-size: 15px; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.signed { margin-top: 12px; font-weight: 500; }
.block-reason { margin: 0; }
.lines { width: 100%; border-collapse: collapse; }
.lines th, .lines td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: top; }
.lines td { text-align: right; font-variant-numeric: tabular-nums; }
.lines .src { display: inline; margin-left: 8px; }
.lines .total th, .lines .total td { font-weight: 600; border-bottom: 0; }
.task-meta { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.task-meta summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--text-2); font-size: 14px; }
.task-meta dl { display: grid; grid-template-columns: 88px 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 14px; }
.task-meta dt { color: var(--text-2); }
.task-meta dd { margin: 0; }
.wheel { display: flex; flex-direction: column; max-height: 176px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-m); scroll-snap-type: y mandatory; }
.slot { min-height: 44px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; padding: 0 16px; scroll-snap-align: start; }
.slot.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.finish { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 860px; margin: 24px 0 8px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check input { width: 20px; height: 20px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---------- 检查器（实底） ---------- */
.inspector { width: 340px; flex: none; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.insp-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.insp-body { overflow-y: auto; padding: 8px 20px 24px; }
.insp-sec { padding: 12px 0; border-bottom: 1px solid var(--line); }

/* ---------- AI 语音工作台输入区 ---------- */
.dock { flex: none; padding: 8px 24px 16px; background: linear-gradient(to bottom, rgba(245, 245, 247, 0), var(--bg) 24px); }
.dock-inner { max-width: 760px; margin: 0 auto; }
.dock-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chips { flex: 1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; white-space: nowrap; color: var(--text); }
.chip:hover { border-color: var(--line-strong); }
.status-wrap { position: relative; flex: none; }
.status-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: transparent; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.status-btn:hover { background: rgba(0, 0, 0, 0.05); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #a1a1a6; flex: none; }
.dot.live { background: var(--accent); box-shadow: 0 0 0 4px rgba(10, 102, 216, 0.18); }
.dot.busy { background: var(--accent); }
.dot.fail { background: var(--text); }
.status-panel {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  width: 420px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-3);
  padding: 8px 20px 16px; z-index: 30;
}
.status-panel section { padding: 12px 0; border-bottom: 1px solid var(--line); }
.status-panel section:last-child { border-bottom: 0; }
.status-panel .actions { margin-top: 8px; }
.vsteps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.vsteps li { font-size: 13px; padding: 2px 8px; border-radius: 6px; color: var(--text-2); background: #f5f5f7; }
.vsteps li.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.transcript { margin-top: 8px; }
.input-bar {
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 6px;
  background: var(--surface); border-radius: 28px; box-shadow: var(--sh-2);
}
.input-bar:focus-within { box-shadow: var(--sh-2), var(--focus); }
.mic, .send { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); transition: background-color var(--dur) ease; }
.mic.live { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.mic.off { background: var(--fill); color: #6e7178; }
.send:disabled { background: var(--fill); color: #8a8d94; cursor: not-allowed; }
.dock-context { font-size: 14px; color: var(--text-2); white-space: nowrap; padding-left: 4px; }
.dock-context strong { color: var(--text); font-weight: 600; }
#ai-input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; font-size: 16px; padding: 0 8px; }
#ai-input::placeholder { color: #6e7178; }

/* ---------- 弹出面板与提示 ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); z-index: 60; }
.sheet {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 32px));
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-3);
  padding: 24px; z-index: 61;
}
.sheet h2 { font-size: 19px; margin: 0 0 12px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); background: rgba(29, 29, 31, 0.92); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 70; max-width: 90%; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); z-index: 25; }
.tabbar { display: none; }

/* ---------- 手机布局（窄窗口或 ?w=390 预览） ---------- */
.is-mobile .app { grid-template-columns: minmax(0, 1fr); }
.is-mobile .sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: 288px; transform: translateX(-100%); transition: transform var(--dur) ease; box-shadow: var(--sh-3); }
.is-mobile .app.drawer-open .sidebar { transform: none; }
.is-mobile .icon-btn.sb-close { display: grid; }
.is-mobile .main-col { grid-column: 1; }
.is-mobile .icon-btn.tb-menu { display: grid; margin-left: -8px; }
.is-mobile .toolbar { padding: 0 12px; height: 52px; gap: 4px; }
.is-mobile .tb-search { display: none; }
.is-mobile .tb-insp { padding: 0 12px; font-size: 14px; }
.is-mobile .main-scroll { padding: 16px 16px 16px; }
.is-mobile .split { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.is-mobile .tb-crumb { flex: 1; }
.is-mobile .tb-spacer { display: none; }
.is-mobile .page-head { flex-direction: column; align-items: stretch; }
.is-mobile .page-head .seg { align-self: flex-start; }
.is-mobile .stats { grid-template-columns: repeat(4, 1fr); }
.is-mobile .stat { padding: 8px 10px; }
.is-mobile .stat dd { font-size: 20px; }
.is-mobile .list-pane { padding: 12px; }
.is-mobile .focus, .is-mobile .card { padding: 16px; }
.is-mobile .who { gap: 12px; }
.is-mobile .progress { grid-template-columns: repeat(3, 1fr); }
.is-mobile .progress div { border-left: 0; border-top: 1px solid var(--line); }
.is-mobile .progress div:nth-child(-n+3) { border-top: 0; }
.is-mobile .progress div { padding: 8px 10px; }
.is-mobile .enc-head { top: -16px; padding: 24px 0 8px; margin-top: -16px; gap: 6px; }
.is-mobile .enc-nav { margin-bottom: 16px; }
.is-mobile .enc-head .allergy { min-width: 0; flex-basis: 100%; padding: 6px 10px; }
.is-mobile .enc-head .allergy .src { display: none; }
.is-mobile .enc-ver { display: none; }
.is-mobile .allergy { padding: 8px 12px; }
.is-mobile .enc-nav { flex-wrap: wrap; }
.is-mobile .switch-pt span { display: none; }
.is-mobile .diff-row { grid-template-columns: 56px 1fr 1fr; }
.is-mobile .finish { flex-direction: column; align-items: stretch; }
.is-mobile .dock { padding: 4px 12px 8px; }
.is-mobile .dock-top { flex-wrap: wrap; }
.is-mobile .ctx-more { display: none; }
.is-mobile .ctx-label { display: none; }
.is-mobile .insp-long { display: none; }
.insp-short { display: none; }
.is-mobile .insp-short { display: inline; }
.detail-pane .todos { margin-top: 16px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); padding: 16px 20px; border-top: 0; }
.is-mobile .status-panel { position: fixed; left: 8px; right: 8px; width: auto; bottom: 120px; }
.is-mobile .inspector { position: absolute; inset: 0; width: auto; z-index: 50; }
.is-mobile .tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr); flex: none;
  border-top: 1px solid var(--line);
  background: var(--bar-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 4px 4px 8px;
}
.tab { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; border-radius: 10px; font-size: 12px; color: var(--text-2); }
.tab span { font-size: 12px; }
.tab.on { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.is-mobile .sheet { top: auto; bottom: 0; left: 0; transform: none; width: 100%; border-radius: var(--r-l) var(--r-l) 0 0; }
.is-mobile .toast { bottom: 150px; }

/* 手机预览画框（?w=390） */
.phone-preview body { background: #d8d8dd; }
.phone-preview .stage { display: flex; align-items: center; justify-content: center; height: 100vh; overflow: hidden; }
.phone-preview .app { width: 390px; height: 844px; flex: none; border-radius: 32px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); transform-origin: center center; }
/* 让画框内的「固定」元素相对画框定位 */
.phone-preview .is-mobile .status-panel, .phone-preview .status-panel { position: absolute; }


/* ---------- 范围定稿版补充：六组侧栏、首页 AI 语音工作台中心、六步卡片 ---------- */
.mini-stats { display: flex; gap: 20px; margin: 0; }
.mini-stats div { display: flex; flex-direction: column; align-items: flex-end; }
.mini-stats dt { font-size: 13px; color: var(--text-2); }
.mini-stats dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.head-right { display: flex; align-items: flex-end; gap: 24px; }
.filter-row { flex-wrap: nowrap; }
.pill { padding: 0 14px; white-space: nowrap; }

/* 首页无选中患者：右侧是 AI 语音工作台（输入区移到中心） */
.hero { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: 28px 32px 24px; }
.hero .eyebrow { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.hero-sub { color: var(--text-2); margin: 8px 0 20px; max-width: 560px; }
.hero-slot .dock { padding: 0; background: none; }
.hero-slot .dock-inner { max-width: none; }
.hero .todos { margin-top: 16px; }
.hero-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 12px 16px; background: var(--bg); border-radius: var(--r-m); }
.hero-next > span { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.hero-next strong { font-size: 17px; }
.app.hero-mode .dock-home { display: none; }
.hero-slot .status-panel { bottom: auto; top: calc(100% + 8px); }

/* AI 工作卡 */
.ai-card { border-left: 3px solid var(--accent); }
.said { font-size: 14px; color: var(--text-2); margin: 0 0 4px; }
.ai-card .ai-label { margin-left: 0; display: inline-block; margin-bottom: 8px; }
.more-cards { align-self: flex-start; min-height: 44px; }
.brief, .receipt { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.brief dt, .receipt dt { font-size: 13px; color: var(--text-2); }
.brief dd, .receipt dd { margin: 2px 0 0; font-size: 16px; font-weight: 500; }
.brief .src, .receipt .src { font-weight: 400; margin-top: 2px; }
.receipt { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-pane .ai-cards { margin: 0 0 16px; }
.detail-pane > .back-link { margin-bottom: 8px; }
.edit-label { font-size: 13px; font-weight: 500; color: var(--text); background: var(--fill); border-radius: 6px; padding: 0 6px; margin-left: 8px; white-space: nowrap; }
.own-label { font-size: 13px; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.transcript-line { background: #f6f6f8; border-radius: var(--r-s); padding: 10px 12px; margin: 0 0 4px; }
.transcript-line .label { display: block; margin: 0 0 2px; }
.diffs { margin: 8px 0 4px; padding-top: 8px; border-top: 0; }
.placeholder { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 24px; max-width: 760px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-2); }

/* 演示步骤（轻引导） */
.demo-wrap { position: relative; }
.tb-demo { min-height: 36px; padding: 0 12px; font-size: 14px; }
.demo-panel { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); width: 320px; }
.demo-list { list-style: none; margin: 0; padding: 0; }
.demo-item { width: 100%; min-height: 44px; text-align: left; border: 0; background: none; border-radius: var(--r-s); padding: 0 12px; font-size: 15px; }
.demo-item:hover { background: rgba(0, 0, 0, 0.05); }
.demo-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tb-insp { min-height: 36px; padding: 0 12px; font-size: 14px; }

.is-mobile .demo-wrap { display: none; }
.is-mobile .sim-tag { font-size: 12px; padding: 0 6px; }
.is-mobile .head-right { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
.is-mobile .mini-stats { justify-content: space-between; }
.is-mobile .mini-stats div { align-items: flex-start; }
.is-mobile .page-head .title-xl { font-size: 26px; }
.is-mobile .hero { padding: 16px; }
.is-mobile .hero .title-l { font-size: 20px; }
.is-mobile .hero-sub { font-size: 14px; margin: 4px 0 12px; }
.is-mobile .hero .todos { margin-top: 12px; }
.is-mobile .hero-next { margin-top: 12px; padding: 8px 12px; }
.is-mobile .brief, .is-mobile .receipt { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.is-mobile .ai-card { padding: 14px 16px; }
.is-mobile .ai-card-head { gap: 4px 8px; }
.is-mobile .ai-card-head .badge { margin-left: 0; }
.is-mobile .status-btn { padding: 0 8px; }
.is-mobile .filter-row { overflow-x: auto; }
.is-mobile .tb-crumb { font-size: 15px; }

.card { max-width: none; }
.finish { max-width: none; }
.card.compact { display: flex; align-items: center; gap: 16px; padding: 16px 24px; }
.compact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.compact-main .signed { margin: 0; }
.compact-main .meta { margin: 0; }
.rec-body.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.rec-side .diffs { margin-top: 12px; }
.rec-fields .field:first-child { margin-top: 0; }
.rec-fields .field { margin-top: 12px; }
.diff-row { padding: 2px 0; }
.top-actions { margin: 0 0 8px; }
.enc-nav { margin-bottom: 24px; }
.rx-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.rx-row .field { margin-top: 0; }
.rx-row .actions { margin-top: 0; flex-wrap: nowrap; }
.is-mobile .rx-row { grid-template-columns: minmax(0, 1fr); }
.is-mobile .rx-row .actions { flex-wrap: wrap; }
.brief { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.is-mobile .rec-body.two { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.is-mobile .card.compact { padding: 12px 16px; flex-wrap: wrap; }


/* ---------- 默认布局 B：AI 整页居中（无参 / ?layout=center|b；16:25 定） ---------- */
.app.layout-center .center-split {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.app.layout-center .center-split.is-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
}
.app.layout-center .list-pane.narrow {
  padding: 12px;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.app.layout-center .list-pane.narrow .queue-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 4px;
}
.app.layout-center .list-pane.narrow.is-collapsed .queue-toolbar { display: none; }
.app.layout-center .queue-toolbar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.app.layout-center .queue-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.app.layout-center .queue-toggle:hover { background: rgba(0, 0, 0, 0.06); }
.app.layout-center .queue-peek {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.app.layout-center .list-pane.narrow.is-collapsed .queue-peek { display: flex; }
.app.layout-center .list-pane.narrow.is-collapsed #queue-full,
.app.layout-center .list-pane.narrow.is-collapsed .queue-full { display: none !important; }
.app.layout-center .peek-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.app.layout-center .peek-avatar:hover { background: var(--accent-soft); color: var(--accent); }
.app.layout-center .queue-full {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.app.layout-center .list-pane.narrow .seg-full { font-size: 13px; }
.app.layout-center .list-pane.narrow .row { min-height: 56px; padding: 8px 10px; }
.app.layout-center .list-pane.narrow .row-title strong { font-size: 15px; }
.app.layout-center .list-pane.narrow .row .tag { font-size: 12px; }

/* 居中主区：AI 语音工作台占主内容区中心 */
.app.layout-center .hero-center {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 40px 28px;
  box-sizing: border-box;
}
.app.layout-center .hero-center .hero-sub { max-width: 560px; margin-left: auto; margin-right: auto; text-align: center; }
.app.layout-center .hero-center .eyebrow,
.app.layout-center .hero-center .title-l { text-align: center; justify-content: center; }
.app.layout-center .hero-center .title-l { font-size: 28px; }
.app.layout-center .hero-center .hero-slot { max-width: 560px; margin: 0 auto; }
.app.layout-center .hero-center .hero-next { max-width: 560px; margin-left: auto; margin-right: auto; }
.app.layout-center .hero-center .todos { max-width: 560px; margin-left: auto; margin-right: auto; }

/* 手机整页居中：AI 居中，队列在上方可收窄条 */
.app.layout-center .center-home-mobile {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.app.layout-center .queue-strip {
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.app.layout-center .queue-strip-bar {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.app.layout-center .queue-strip-bar > span {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.app.layout-center .queue-strip-body {
  border-top: 1px solid var(--line);
  padding: 4px 8px 8px;
  max-height: 220px;
  overflow: auto;
}
.app.layout-center .queue-strip-body.hidden { display: none; }
.app.layout-center .strip-rows { list-style: none; margin: 0; padding: 0; }
.app.layout-center .strip-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.app.layout-center .strip-row:hover { background: #f5f5f7; }
.app.layout-center .strip-row strong { font-size: 15px; }
.app.layout-center .avatar.sm {
  width: 28px; height: 28px; font-size: 13px;
  border-radius: 50%; background: var(--fill);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex: none;
}
.app.layout-center .center-home-mobile .hero-center {
  padding: 20px 16px 16px;
  max-width: none;
}
.app.layout-center .center-home-mobile .hero-center .hero-sub,
.app.layout-center .center-home-mobile .hero-center .eyebrow,
.app.layout-center .center-home-mobile .hero-center .title-l { text-align: left; justify-content: flex-start; }
.app.layout-center .center-home-mobile .hero-center .title-l { font-size: 22px; }
.app.layout-center .center-home-mobile .hero-center .hero-slot,
.app.layout-center .center-home-mobile .hero-center .hero-next,
.app.layout-center .center-home-mobile .hero-center .todos { max-width: none; margin-left: 0; margin-right: 0; }

/* 对照 A（右侧大卡）：?layout=a|queue|side */
.hero-split { /* 对照 A：左队列 + 右 AI 大卡 */ }

/* ---------- 尊重减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}

/* ---------- 暗色（基础适配，未逐屏校对） ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e; --surface: #2c2c2e; --text: #f5f5f7; --text-2: #b0b3ba;
    --line: #3a3a3c; --line-strong: #545458; --fill: #3a3a3c;
    --accent: #0a66d8; --accent-hover: #0b72f0; --accent-soft: #15345a;
    --nav-glass: rgba(36, 36, 38, 0.82); --bar-glass: rgba(36, 36, 38, 0.82);
    color-scheme: dark;
  }
  .accent-soft-text, .sb-item.on, .row.on strong, .pill.on, .choice.on, .slot.on, .vsteps li.on, .tab.on, .new-tag, .btn.plain, .back-link { color: #8cc0ff; }
  .sb-item.on .ic, .sb-item.on .sb-count { color: #8cc0ff; }
  .mic, .send { color: #8cc0ff; }
  .allergy { background: #333336; border-left-color: var(--text); }
  .b-neutral, .ai-tag, .ai-label { color: #d6d8dd; }
  .b-strong { background: #f5f5f7; color: #1c1c1e; }
  .btn:disabled { background: #333336; color: #8e9097; }
  .sb-logo { background: #f5f5f7; color: #1c1c1e; }
  .vsteps li { background: #333336; }
  .field input[readonly], .field textarea[readonly] { background: #333336; }
  .phone-preview body { background: #000; }
}

/* ---------- 补缺口（15:28 定 A 后）：高风险差异摘要＋保存失败原处重试 ---------- */
.diff-sum { display: none; flex-basis: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.is-mobile .diff-sum { display: block; }
.diff-sum.has-todo { border-left: 3px solid var(--text); }
.diff-sum-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; background: none; text-align: left; font-size: 15px; color: var(--text); border-radius: 12px; }
.diff-sum-title { font-weight: 600; flex: 1 1 auto; }
.diff-sum-warn { font-weight: 700; }
.diff-sum-count { font-size: 14px; color: var(--text-2); }
.diff-sum-chev { color: var(--accent); font-size: 14px; margin-left: auto; }
.diff-sum-list { list-style: none; margin: 0; padding: 0 12px 8px; border-top: 1px solid var(--line); }
.diff-sum-item { display: grid; grid-template-columns: 52px 1fr; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.diff-sum-item:last-child { border-bottom: 0; }
.diff-sum-kind { font-size: 13px; color: var(--text-2); font-weight: 600; }
.diff-sum-val { font-size: 15px; font-weight: 600; }
.diff-sum-item.todo .diff-sum-val { font-weight: 700; }
.diff-sum-opts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff-sum-opts .choice { min-height: 44px; }
.save-fail { flex-basis: 100%; border: 1px solid var(--line-strong); border-left: 3px solid var(--text); border-radius: 12px; padding: 12px 14px; background: var(--surface-2, #f7f7f9); }
.save-fail-title { margin: 0; font-weight: 700; font-size: 15px; }
.save-fail .meta { margin: 4px 0 0; }
.save-fail .actions { margin-top: 10px; }
.demo-fail-title { margin-top: 12px; }
.demo-fail { display: flex; flex-wrap: wrap; gap: 6px; }
@media (prefers-color-scheme: dark) {
  .save-fail { background: rgba(255,255,255,0.04); }
}
.save-fail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.save-fail-title .badge { font-weight: 600; }
/* 电脑端：失败提示单行排布，重试在右侧，少占高度 */
html:not(.is-mobile) .save-fail { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; padding: 10px 14px; }
html:not(.is-mobile) .save-fail .actions { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
