/* CareDock — 手机页与管理后台共用的视觉规范（12-02 改，和底座配网页一致）
   方向：黑白为主、大圆角、卡片无描边；按钮和选中态用黑色，数字大而清楚。
   主题色（深绿）只用在必要处：核对通过、成功；黄、红只用在需要留意和停下的结果。
   橙、蓝只用来对应底座的左键、右键。 */

:root {
  /* 颜色 */
  --bg: #F2F2F2;
  --surface: #FFFFFF;
  --surface-2: #F6F6F6;
  --line: #ECECEC;
  --line-strong: #DADADA;
  --ink: #111111;
  --ink-2: #4A4A4A;
  --ink-3: #7A7A7A;
  --brand: #111111;      /* 按钮、开关、选中态：黑 */
  --brand-strong: #000000;
  --brand-soft: #F0F0F0;
  --accent: #0E6E6B;     /* 主题色 = 图标的青绿（docs/logo），只用在必要处 */
  --accent-soft: #E2F0EF;
  --ok: #0E6E6B;
  --ok-bg: #E2F0EF;
  --ok-line: #BFDEDB;
  --warn: #855600;
  --warn-bg: #FBF0D8;
  --warn-line: #EED6A2;
  --stop: #A4251D;
  --stop-bg: #FBE7E4;
  --stop-line: #F0C3BD;
  --key-orange: #CF7424;
  --key-blue: #2E68AE;
  --focus: #111111;

  /* 字体与字号 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-num: 34px;
  --fs-num-lg: 44px;
  --lh: 1.55;

  /* 间距 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;

  /* 圆角与阴影 */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --shadow-1: none;
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, .16);

  --tabbar-h: 64px;
  --content-w: 640px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- 品牌 ---------- */
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; flex: none; display: block; }
.brand-name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0; }
.brand-name span { font-weight: 500; color: var(--accent); }  /* 按 logo 定稿：Dock 用青绿 */
.brand-sub { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: .02em; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(242, 242, 242, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-in {
  max-width: var(--content-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); min-height: 56px;
}

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.conn.on .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.conn.off .dot { background: var(--line-strong); }

/* ---------- 版面 ---------- */
.page { max-width: var(--content-w); margin: 0 auto; padding: calc(var(--s8) + env(safe-area-inset-top)) var(--s4) calc(var(--tabbar-h) + var(--s8) + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: var(--s2) 0 var(--s6); }
.page-title { font-size: 28px; font-weight: 600; line-height: 1.2; }
.page-desc { color: var(--ink-3); font-size: var(--fs-sm); margin-top: var(--s2); }
.page-eyebrow { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: 2px; }
/* 底座在线状态：一个圆点 + 一句话，跟在页标题下面 */
.conn-line { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); flex-wrap: wrap; }
.conn-line .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.conn-line.on .dot { background: var(--ok); }
.conn-line.off .dot { background: var(--warn); }
.conn-line.off { color: var(--warn); }
.conn-line .cm { display: inline-flex; align-items: center; gap: 6px; }
.conn-line .sub { color: var(--ink-3); margin-left: 4px; }
.dev-id { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-3); }
.section { margin-top: var(--s8); }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s3); gap: var(--s3); }
.section-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.section-note { font-size: var(--fs-sm); color: var(--ink-3); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: var(--s3); }
.card-pad { padding: var(--s5); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line);
}
.card-title { font-size: var(--fs-lg); font-weight: 600; display: flex; align-items: center; gap: var(--s2); }
.card-meta { font-size: var(--fs-sm); color: var(--ink-3); }

.keydot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.keydot.k0 { background: var(--key-orange); }
.keydot.k1 { background: var(--key-blue); }

/* ---------- 状态读数（首页） ---------- */
.readout-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); padding: var(--s4) var(--s5); align-items: center; }
.readout-row + .readout-row { border-top: 1px solid var(--line); }
.readout-drug { font-size: var(--fs-md); font-weight: 600; }
.readout-ing { font-size: var(--fs-sm); color: var(--ink-3); }
.readout-side { text-align: right; }
.readout-label { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: .02em; }
.readout-value { font-size: var(--fs-num); font-weight: 600; line-height: 1.1; }
.readout-value.ok-value { color: var(--ink); font-size: 24px; white-space: nowrap; }
.readout-ing span + span { margin-left: 10px; }
.sep { margin-left: 8px; }
.readout-value.ok-value svg { width: .78em; height: .78em; color: var(--ok); margin-right: 6px; vertical-align: -.06em; }
.readout-value .pre { font-size: var(--fs-md); font-weight: 600; margin-right: 4px; color: var(--ink-2); }
.readout-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: var(--fs-sm); color: var(--ink-2); }
.readout-foot span { white-space: nowrap; }
.readout-foot b { font-weight: 600; color: var(--ink); }

/* ---------- 首页：每位用药人一张卡片（D42） ----------
   手机竖屏上下排列，宽度 640 px 以上左右并排；左键的人在前。
   颜色只用左侧一条细边对应底座的左键（橙）、右键（蓝），其余黑白。 */
.people { display: grid; gap: var(--s3); align-items: start; }
.people > .card + .card { margin-top: 0; }
@media (min-width: 640px) { .people.two { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.person { position: relative; overflow: hidden; }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5) var(--s2); }
.person-name { font-size: var(--fs-xl); font-weight: 600; display: flex; align-items: baseline; gap: var(--s2); }
.person-w { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); }
/* 键帽标签：对应底座上的左键、右键，颜色只在圆点上 */
.keycap { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--line-strong); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.keycap .keydot { width: 8px; height: 8px; }
.person-key { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.person.idle { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.person.idle .person-head { padding: var(--s3) var(--s5); }
.person.idle .person-name { font-size: var(--fs-md); color: var(--ink-3); }

.person .drug { font-size: var(--fs-md); font-weight: 600; }
.person .meta { display: flex; flex-wrap: wrap; gap: 2px var(--s3); font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; }
.person .meta span { white-space: nowrap; }
.person .meta b { font-weight: 600; color: var(--ink-2); }

.waitrow { padding: var(--s2) var(--s5) var(--s5); }
.waitrow-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.waitrow-time { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin: 2px 0 var(--s2); }
.waitrow-time .t { font-size: var(--fs-num-lg); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
.waitrow-time .pre { font-size: var(--fs-lg); font-weight: 600; margin-right: 6px; letter-spacing: 0; color: var(--ink-2); }
.waitrow-time .left { font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); }

.okrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s5); }
.person-head + .okrow { padding-top: var(--s2); }
.waitrow + .okrow, .okrow + .okrow, .okrow + .waitrow, .waitrow + .waitrow { border-top: 1px solid var(--line); }
.okrow + .waitrow, .waitrow + .waitrow { padding-top: var(--s4); }
.okrow:last-child { padding-bottom: var(--s4); }
.okrow-side { text-align: right; }
.okv { font-size: var(--fs-xl); font-weight: 600; white-space: nowrap; line-height: 1.2; }
.okv svg { width: .8em; height: .8em; color: var(--ok); margin-right: 5px; vertical-align: -.05em; }

/* 添加到主屏幕：一行提示 */
.a2hs-card { padding: var(--s5); }
.a2hs-top { display: flex; align-items: center; gap: var(--s3); }
.a2hs-card .grow { flex: 1; min-width: 0; }
.a2hs-card .t { font-weight: 600; }
.a2hs-card .d { font-size: var(--fs-sm); color: var(--ink-3); }
.a2hs-icon { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.a2hs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
.a2hs-actions .btn { min-height: 44px; }
.a2hs-actions.one { grid-template-columns: 1fr; }

/* 添加到主屏幕：分步引导，箭头指向浏览器自己的按钮 */
.coach { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .62); display: flex; align-items: center; justify-content: center; padding: var(--s5); }
.coach.to-bc, .coach.to-br, .coach.to-bl { align-items: flex-end; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.coach.to-tr, .coach.to-tl { align-items: flex-start; padding-top: calc(84px + env(safe-area-inset-top)); }
.coach-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); width: 100%; max-width: 400px; padding: var(--s5) var(--s6) var(--s6); }
.coach-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.coach-step { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }
.coach-x { width: 36px; height: 36px; margin-right: -10px; border: 0; background: none; border-radius: 50%; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.coach-x svg { width: 16px; height: 16px; }
.coach-x:hover { background: var(--surface-2); }
.coach h3 { font-size: var(--fs-xl); font-weight: 600; }
.coach p { color: var(--ink-2); margin-top: var(--s2); }
.coach .actions { margin-top: var(--s5); }
.coach-arrow { position: fixed; color: #fff; width: 40px; height: 54px; pointer-events: none; animation: nudge 1.2s ease-in-out infinite; }
.coach-arrow svg { width: 100%; height: 100%; display: block; }
.to-bc .coach-arrow { left: calc(50% - 20px); bottom: calc(8px + env(safe-area-inset-bottom)); }
.to-br .coach-arrow { right: 18px; bottom: calc(8px + env(safe-area-inset-bottom)); }
.to-bl .coach-arrow { left: 18px; bottom: calc(8px + env(safe-area-inset-bottom)); }
.to-tr .coach-arrow { right: 14px; top: calc(8px + env(safe-area-inset-top)); --flip: 180deg; }
.to-tl .coach-arrow { left: 14px; top: calc(8px + env(safe-area-inset-top)); --flip: 180deg; }
@keyframes nudge { 0%, 100% { transform: rotate(var(--flip, 0deg)) translateY(-6px); } 50% { transform: rotate(var(--flip, 0deg)) translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .coach-arrow { animation: none; transform: rotate(var(--flip, 0deg)); } }

/* 示意图：系统菜单的样子，只用来说明，不能点 */
.mock { margin-top: var(--s4); border-radius: var(--r-md); background: var(--surface-2); padding: var(--s2); font-size: var(--fs-sm); pointer-events: none; }
.mock .mrow { display: flex; align-items: center; justify-content: space-between; padding: 9px var(--s3); color: var(--ink-3); }
.mock .mrow + .mrow { border-top: 1px solid var(--line); }
.mock .mi { width: 16px; height: 16px; border-radius: 4px; background: var(--line-strong); }
.mock .mrow.hit { background: var(--surface); color: var(--ink); font-weight: 600; border-radius: var(--r-sm); box-shadow: 0 0 0 2px var(--ink); border-top: 0; }
.mock .mi.plus { background: none; border: 1.6px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.mock .mi.plus svg { width: 11px; height: 11px; }
.mock.confirm .mbar { display: flex; justify-content: space-between; align-items: center; padding: var(--s2) var(--s3); color: var(--ink-3); }
.mock.confirm .mbar b { color: var(--ink); font-weight: 600; }
.mock.confirm .hit-txt { color: var(--ink); font-weight: 600; padding: 2px 10px; border-radius: var(--r-pill); box-shadow: 0 0 0 2px var(--ink); }
.mock .mapp { display: flex; align-items: center; gap: var(--s3); background: var(--surface); border-radius: var(--r-sm); padding: var(--s3); margin-top: var(--s1); }
.mock .mscroll { font-size: var(--fs-xs); color: var(--ink-3); text-align: center; padding: 2px 0 6px; }
.mock .mscroll::after { content: " ↓"; }
.mock .mtoggle { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: var(--r-sm); padding: var(--s3); margin-top: var(--s1); color: var(--ink); }
.mock .mswitch { width: 36px; height: 22px; border-radius: 11px; background: #34C759; position: relative; }
.mock .mswitch::after { content: ""; position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.mock .mapp img { width: 44px; height: 44px; border-radius: 10px; }
.mock .mname { font-size: var(--fs-md); color: var(--ink); font-weight: 600; }

/* ---------- 结果标记：颜色 + 图标 + 文字 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 6px; border-radius: 8px;
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; white-space: nowrap;
  border: 0;
}
.badge svg { width: 13px; height: 13px; flex: none; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.stop { color: var(--stop); background: var(--stop-bg); border-color: var(--stop-line); }
.badge.neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.badge.lg { font-size: var(--fs-md); padding: 5px 12px 5px 10px; }
.badge.lg svg { width: 16px; height: 16px; }

/* ---------- 记录列表：时间在左，取药量在右，是最显眼的数字 ---------- */
.rec { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 0 var(--s3); padding: var(--s4) var(--s5); align-items: center; }
.rec + .rec { border-top: 1px solid var(--line); }
.rec-time { font-size: var(--fs-md); font-weight: 500; color: var(--ink-2); line-height: 1.2; }
.rec-time.small { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); line-height: 1.5; }
.rec-main { min-width: 0; }
.rec-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rec-title .who { font-weight: 600; white-space: nowrap; }
.rec-drug { color: var(--ink-3); font-size: var(--fs-sm); margin-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-sub { display: flex; flex-wrap: wrap; gap: 2px var(--s3); margin-top: 2px; }
.rec-side { text-align: right; }
.rec-fig { font-size: 24px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.rec-fig small { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 400; }
.rec-note { font-size: var(--fs-sm); color: var(--ink-3); }
.rec-title .who.unassigned { font-weight: 500; color: var(--ink-2); }
.list-end { width: 100%; text-align: center; font-size: var(--fs-sm); color: var(--ink-3); }
.st-text { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.st-text svg { width: 13px; height: 13px; flex: none; }
.st-text.ok { color: var(--ok); }
.st-text.warn { color: var(--warn); }
.st-text.stop { color: var(--stop); }
.st-text.neutral { color: var(--ink-3); }
.rec.void .rec-time, .rec.void .rec-title .who, .rec.void .rec-fig { color: var(--ink-3); }
.rec.void .rec-title .who { text-decoration: line-through; text-decoration-color: var(--line-strong); }
/* 记录页：每天一个小标题 + 一张卡片 */
.day + .day { margin-top: var(--s6); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 0 var(--s1) var(--s2); }
.day-title { display: flex; align-items: baseline; gap: var(--s2); }
.day-title .d { font-size: var(--fs-lg); font-weight: 600; }
.day-title .w { font-size: var(--fs-sm); color: var(--ink-3); }
.day-count { font-size: var(--fs-sm); color: var(--ink-3); }
.rec-empty { padding: var(--s5); color: var(--ink-3); font-size: var(--fs-sm); }
.rec-more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 var(--s5); border: 0; border-top: 1px solid var(--line); background: none; border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: var(--fs-md); font-weight: 500; color: var(--ink-2); cursor: pointer; }
.rec-more svg { width: 18px; height: 18px; color: var(--ink-3); }
.rec-more:hover { background: var(--surface-2); color: var(--ink); }
.rec-more.help-link { border-top: 0; border-radius: var(--r-lg); text-decoration: none; }

/* ---------- 空状态 / 加载 / 错误 ---------- */
.empty { text-align: center; padding: var(--s10) var(--s6); }
.empty-icon { width: 44px; height: 44px; margin: 0 auto var(--s3); color: var(--line-strong); }
.empty-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); }
.empty-desc { font-size: var(--fs-sm); color: var(--ink-3); margin-top: var(--s1); }
.empty .btn { margin-top: var(--s4); }

.skel { background: linear-gradient(90deg, #E9E9E9 0, #F3F3F3 40%, #E9E9E9 80%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; border-radius: var(--r-sm); }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-line { height: 14px; margin: 10px 0; }
.skel-title { height: 28px; width: 40%; margin: 12px 0 24px; }
.w45 { width: 45%; } .w50 { width: 50%; } .w65 { width: 65%; } .w75 { width: 75%; } .w80 { width: 80%; }

.banner {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--r-md); font-size: var(--fs-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  margin-bottom: var(--s4);
}
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #5E3E00; }
.banner.stop { background: var(--stop-bg); border-color: var(--stop-line); color: #7A1B15; }
.banner.info { background: var(--surface); border-color: var(--line); color: var(--ink); }
.banner .grow { flex: 1; }
.banner b { font-weight: 600; }
.banner .link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 50px; padding: 0 var(--s5); border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: var(--fs-md); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { color: var(--stop); border-color: var(--stop-line); }
.btn.danger:hover { background: var(--stop-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { min-height: 38px; padding: 0 var(--s3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; gap: var(--s3); justify-content: flex-end; flex-wrap: wrap; }
.actions.stretch > .btn { flex: 1; }

/* ---------- 表单 ---------- */
.field { display: block; }
.field + .field { margin-top: var(--s4); }
.field-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-hint { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 6px; }
.field-error { font-size: var(--fs-sm); color: var(--stop); margin-top: 6px; font-weight: 500; }
.account-card { max-width: 480px; display: grid; gap: var(--s4); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input, .select {
  width: 100%; min-height: 48px; padding: 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  font-size: 16px; /* 不小于 16px，避免 iOS 自动放大 */
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input:hover, .select:hover { border-color: #C4C4C4; }
.input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px #E6E6E6; }
.input.invalid { border-color: var(--stop); box-shadow: 0 0 0 3px var(--stop-bg); }
.input-wrap .unit { position: absolute; right: var(--s4); color: var(--ink-3); font-size: var(--fs-md); pointer-events: none; }
.input-wrap .input { padding-right: 56px; }
.input.num-input { font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--fs-lg); }
.input::placeholder { color: #A3A3A3; font-weight: 400; font-size: 16px; }
.select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2346514D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.grid-2 > .field + .field { margin-top: 0; }

/* 开关 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 48px; }
.switch-row .t { font-weight: 600; }
.switch-row .d { font-size: var(--fs-xs); color: var(--ink-3); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--line-strong); transition: background-color .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 键值表（药品说明） */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s4); margin: var(--s5) 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: var(--fs-xs); color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.divider { height: 1px; background: var(--line); margin: var(--s5) 0; border: 0; }

/* ---------- 药瓶页：每格一张"药签"卡片 ----------
   药名是标题（点一下即可更换），三项要点一行，每人的用量是最大的数字。 */
.slot { padding: var(--s5); }
.slot + .slot { margin-top: var(--s4); }
.form-err { margin: var(--s4) 0 0; }
.slot-head { display: flex; align-items: center; gap: var(--s2); color: var(--ink-3); font-size: var(--fs-sm); }
.slot-glyph { width: 30px; height: 18px; color: var(--ink); flex: none; }
.slot-name { color: var(--ink); font-weight: 600; }
.slot-drug { margin-top: var(--s3); }
.title-select-wrap { position: relative; display: flex; width: 100%; }
.title-select {
  -webkit-appearance: none; appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--ink);
  padding: 0 32px 0 0; margin: 0; width: 100%; border-radius: 8px;
}
.title-select-wrap::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); pointer-events: none;
}
.title-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.empty-slot .title-select { color: var(--ink-3); }
.slot-sub { display: flex; flex-wrap: wrap; gap: 0 var(--s3); font-size: var(--fs-md); color: var(--ink-2); margin-top: 2px; }
.empty-slot .slot-sub { color: var(--ink-3); font-size: var(--fs-sm); margin-bottom: var(--s3); }
.slot-ref { margin-top: var(--s4); background: var(--surface-2); border-radius: 14px; padding: var(--s3) 0; }
.slot-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact { padding: 0 var(--s3); min-width: 0; }
.fact + .fact { border-left: 1px solid var(--line-strong); }
.fact .k { font-size: var(--fs-xs); color: var(--ink-3); }
.fact .v { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); margin-top: 2px; white-space: nowrap; }
.slot-notes { display: flex; flex-wrap: wrap; gap: 0 var(--s4); margin: var(--s3) var(--s3) 0; padding-top: var(--s3); border-top: 1px solid var(--line-strong); font-size: var(--fs-sm); color: var(--ink-2); }
.slot-doses { margin-top: var(--s5); }
.slot-doses .dose-block:last-child { padding-bottom: var(--s2); }
.sub-label { font-size: var(--fs-sm); color: var(--ink-3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }

.dose-block { padding: var(--s4) 0; }
.dose-block + .dose-block { border-top: 1px solid var(--line); }
.dose-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: var(--s3); align-items: baseline; }
.dose-grid .dose-val { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.dose-grid .link-btn { grid-column: 1; justify-self: start; margin-top: 2px; padding: 2px 0; display: inline-flex; align-items: center; gap: 4px; font-weight: 400; color: var(--ink-3); text-decoration: none; }
.dose-grid .link-btn svg { width: 14px; height: 14px; }
.dose-grid .link-btn:hover { color: var(--ink); }
.dose-who { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.dose-who .keydot { align-self: center; }
.dose-who .n { font-size: var(--fs-lg); font-weight: 600; }
.dose-who .w { color: var(--ink-3); font-size: var(--fs-sm); }
.dose-val { text-align: right; }
.dose-val .v { font-size: 28px; font-weight: 600; line-height: 1.15; white-space: nowrap; letter-spacing: -0.01em; }
.dose-val .v small { display: block; font-size: var(--fs-sm); color: var(--ink-3); font-weight: 400; }
.dose-val .l { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.dose-val.warn .v { color: var(--warn); font-size: var(--fs-xl); }
.dose-block .rx { margin-top: var(--s3); }
.link-btn { background: none; border: 0; padding: 4px 0; margin-top: var(--s2); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }
.link-btn.quiet { margin: 0; text-decoration: none; color: var(--ink-3); }

/* 保存：通栏，贴在标签栏上方 */
.save-bar { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s3)); margin-top: var(--s6); z-index: 5; }
.save-bar .btn { width: 100%; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
@media (min-width: 960px) { body.has-side .save-bar { bottom: var(--s6); } }

/* ---------- 用药人页 ---------- */
.person-form { position: relative; overflow: hidden; padding: var(--s4) var(--s5) var(--s5); }
.person-form + .person-form { margin-top: var(--s4); }
.pf-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.pf-key { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-3); }
.pf-body { margin-top: var(--s3); }
.person-form.solo { padding-top: var(--s5); }
.person-form.solo .pf-body { margin-top: 0; }
.grid-name-w { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s3); }
.grid-name-w .field + .field { margin-top: 0; }
.person-form .grid-name-w .input:not(.num-input) { font-size: var(--fs-lg); font-weight: 600; }
.pf-switch { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); min-height: 44px; }
.page-note { font-size: var(--fs-sm); color: var(--ink-3); margin: var(--s3) var(--s1) 0; }
.btn.dashed { border-style: dashed; background: transparent; color: var(--ink-2); }

/* ---------- 底部标签栏（手机）/ 侧栏（桌面） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-in { max-width: var(--content-w); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar-h); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; cursor: pointer; color: var(--ink-3);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--brand); }
.tab .pip { position: absolute; }

/* ---------- 弹窗与提示 ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; padding: var(--s4); }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); width: 100%; max-width: 440px; padding: var(--s6); margin-bottom: env(safe-area-inset-bottom); }
.modal h3 { font-size: var(--fs-xl); font-weight: 600; margin-bottom: var(--s2); }
.modal .modal-body { color: var(--ink-2); font-size: var(--fs-md); }
.modal .modal-body ul { margin: var(--s3) 0 0; padding-left: 1.2em; }
.modal .modal-body li + li { margin-top: var(--s1); }
.modal .actions { margin-top: var(--s6); }
@media (min-width: 600px) { .modal-back { align-items: center; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-2);
  transition: opacity .2s, transform .2s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--stop); }
.toast svg { width: 16px; height: 16px; }

/* ---------- 引导 ---------- */
.guide { max-width: 560px; margin: 0 auto; padding: calc(var(--s8) + env(safe-area-inset-top)) var(--s4) calc(var(--s12) + env(safe-area-inset-bottom)); }
.guide-logo { width: 48px; height: 48px; border-radius: 12px; display: block; margin-bottom: var(--s5); }
.guide-head { margin-top: 0; }
.guide-note { color: var(--ink-2); }
.guide-bar { bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }
.guide-bar.two { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s3); }
.guide-bar.two .btn { width: 100%; }
.guide-bar.two .btn:not(.primary) { box-shadow: none; }
.conn-line.wait { color: var(--ink-2); }
.conn-line.wait .dot { background: var(--ink); }
.conn-line.wait.off { color: var(--warn); }
.conn-line.wait.off .dot { background: var(--warn); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
.guide-hero { text-align: left; margin-bottom: var(--s6); }
.guide-hero .eyebrow { font-size: var(--fs-sm); color: var(--brand); font-weight: 600; letter-spacing: .04em; }
.guide-hero h1 { font-size: 28px; font-weight: 600; margin-top: var(--s2); line-height: 1.3; }
.guide-hero p { color: var(--ink-2); margin-top: var(--s2); }
.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps-list li { counter-increment: st; display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); padding: var(--s4) var(--s5); }
.steps-list li + li { border-top: 1px solid var(--line); }
.steps-list li::before {
  content: counter(st); width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: var(--fs-sm);
}
.steps-list .t { font-weight: 600; }
.steps-list .d { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.ssid { display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--ink); }
.waiting { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); padding: var(--s4) var(--s5); font-size: var(--fs-sm); color: var(--ink-2); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-bottom: var(--s6); }
.stepper .st { height: 4px; border-radius: 2px; background: var(--line-strong); }
.stepper .st.on { background: var(--ink); }

.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; margin-bottom: var(--s4); }
.done-mark svg { width: 28px; height: 28px; }

/* ---------- 桌面 ---------- */
@media (min-width: 960px) {
  :root { --content-w: 760px; }
  body.has-side .topbar { display: none; }
  body.has-side .tabbar {
    top: 0; bottom: 0; right: auto; width: 240px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--surface); padding: var(--s6) var(--s4);
  }
  body.has-side .tabbar-in { display: flex; flex-direction: column; height: 100%; gap: var(--s1); max-width: none; }
  body.has-side .tab { flex-direction: row; justify-content: flex-start; gap: var(--s3); padding: 10px var(--s3); border-radius: var(--r-sm); font-size: var(--fs-md); letter-spacing: .02em; }
  body.has-side .tab:hover { background: var(--surface-2); }
  body.has-side .tab[aria-current="page"] { background: var(--brand-soft); }
  body.has-side .side-brand { display: flex !important; }
  body.has-side .side-foot { display: block !important; }
  body.has-side main { margin-left: 240px; }
  body.has-side .page { padding: var(--s10) var(--s8) var(--s12); }
  body.has-side .page-head .conn-line.on .cm { display: none; }  /* 桌面侧栏底部已显示在线；离线仍在标题下提醒 */
  body.has-side .page-head .conn-line.on .sub { margin-left: 0; }
  .toast { bottom: 32px; }
  body.has-side .toast { left: calc(50% + 120px); }
}
.side-brand { display: none !important; padding: 0 var(--s3) var(--s6); }
.side-foot { display: none !important; margin-top: auto; }
.side-dev { background: var(--surface-2); border-radius: 14px; padding: var(--s3) var(--s4); }
.side-dev-name { font-weight: 600; margin-bottom: 2px; }
.side-dev-sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.page-head-conn { display: none !important; }

/* ---------- 简单页 ---------- */
.plain { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s6); }
.plain-card { max-width: 460px; width: 100%; }
.plain-card h1 { font-size: 28px; font-weight: 600; line-height: 1.3; }
.plain-card p { color: var(--ink-2); margin-top: var(--s3); }
.plain-card .foot { margin-top: var(--s10); font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- 首页落地页：居中一列，域名压在底部 ---------- */
.landing { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; padding: var(--s6); text-align: center; }
.landing-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 6vh; }
.landing-logo { width: 72px; height: 72px; border-radius: 18px; display: block; }
.landing h1 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin-top: var(--s5); }
.landing-main p { color: var(--ink-2); margin-top: var(--s3); }
.landing-foot { font-size: var(--fs-xs); color: var(--ink-3); }
.landing-help { margin-top: var(--s5); color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }

/* ---------- 管理后台：和手机页桌面版同一套外框 ---------- */
.admin { --content-w: 1120px; }
.admin-side { position: fixed; top: 0; bottom: 0; left: 0; width: 240px; background: var(--surface); border-right: 1px solid var(--line); padding: var(--s6) var(--s4); display: flex; flex-direction: column; gap: var(--s1); z-index: 10; }
.admin-brand { padding: 0 var(--s3) var(--s6); }
.admin-sub { font-size: var(--fs-sm); color: var(--ink-3); margin: var(--s1) 0 0 36px; }
.admin-nav { display: flex; flex-direction: column; gap: var(--s1); }
.admin-nav button, .admin-logout { display: flex; align-items: center; gap: var(--s3); background: none; border: 0; padding: 10px var(--s3); border-radius: var(--r-sm); font-size: var(--fs-md); font-weight: 500; color: var(--ink-2); cursor: pointer; text-align: left; }
.admin-nav button svg, .admin-logout svg { width: 20px; height: 20px; color: var(--ink-3); }
.admin-nav button:hover, .admin-logout:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav button[aria-current="page"] { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.admin-nav button[aria-current="page"] svg { color: var(--ink); }
.admin-logout { margin-top: auto; color: var(--ink-3); }
.admin-main { margin-left: 240px; }
.admin .page { max-width: 1120px; padding: var(--s10) var(--s8) var(--s12); }
.ver-text { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.ver-text .num { color: var(--ink); font-weight: 600; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
.conn-line.idle .dot { background: var(--line-strong); }
.conn-line.idle { color: var(--ink-3); }
@media (max-width: 760px) {
  .admin-side { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; padding: var(--s3) var(--s4); }
  .admin-brand { padding: 0 var(--s3) 0 0; }
  .admin-sub { display: none; }
  .admin-nav { flex-direction: row; }
  .admin-logout { margin: 0 0 0 auto; }
  .admin-logout svg { display: none; }
  .admin-main { margin-left: 0; }
  .admin .page { padding: var(--s6) var(--s4) var(--s10); }
}

.table-wrap { overflow-x: auto; position: relative; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.tbl th { text-align: left; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child { border-top-left-radius: var(--r-lg); }
.tbl th:last-child { border-top-right-radius: var(--r-lg); }
.tbl td { padding: var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover td { background: #FAFAFA; }
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-sm); color: var(--ink-2); }
.tag { display: inline-block; white-space: nowrap; font-size: var(--fs-sm); font-weight: 500; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }

.editor { margin-top: var(--s6); }
.editor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.editor-grid .span2 { grid-column: span 2; }
.editor-grid .field + .field { margin-top: 0; }
.editor-sec { padding: var(--s5) var(--s6); }
.editor-sec + .editor-sec { border-top: 1px solid var(--line); }
.editor-sec h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--s4); }
.editor-sec h3 .muted { font-weight: 400; font-size: var(--fs-sm); margin-left: var(--s2); }
.bands .input { min-height: 40px; border-radius: var(--r-sm); font-variant-numeric: tabular-nums; }
.bands td { padding: var(--s2) var(--s2); }
.bands th { padding: var(--s2); background: none; border-radius: 0 !important; }
.check-row { display: flex; align-items: center; gap: var(--s2); min-height: 48px; cursor: pointer; font-weight: 600; }
.check-row input { width: 18px; height: 18px; accent-color: var(--ink); }
.editor-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s6); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s6); }
.login .card { width: 100%; max-width: 400px; padding: var(--s8); }
.login h1 { font-size: 28px; }
.login .brand { margin-bottom: var(--s6); }
.login h1 { font-size: var(--fs-xl); font-weight: 600; margin-bottom: var(--s1); }
.login p.muted { font-size: var(--fs-sm); margin-bottom: var(--s6); }
.login .btn { margin-top: var(--s5); }

@media (max-width: 760px) {
  .editor-grid { grid-template-columns: 1fr 1fr; }
  .admin .topbar-in { padding: var(--s3) var(--s4); flex-wrap: wrap; }
  .admin .page { padding: var(--s5) var(--s4) var(--s10); }
  .admin-left { gap: var(--s3); }
  .editor-sec { padding: var(--s4); }
}
.check-switch { min-height: 48px; gap: var(--s4); justify-content: flex-start; font-weight: 600; cursor: pointer; }
.muted-btn { color: var(--ink-3); }
.muted-btn:hover { color: var(--stop); }
.input:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
/* 用量确认：使用说明书用量 / 改用医嘱用量 */
.dose-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.dose-acts:empty { display: none; }
.dose-acts .link-btn { margin: 0; padding: 2px 0; display: inline-flex; align-items: center; gap: 4px; font-weight: 400; color: var(--ink-3); text-decoration: none; }
.dose-acts .link-btn svg { width: 14px; height: 14px; }
.dose-acts .link-btn:hover { color: var(--ink); }
