/* 临方在线医生工作站样式
   基准屏幕 1024×768，禁止横向溢出
   视觉规则见 .trae/rules/lingfang-ui.md */

:root {
  --ink: #23201B;
  --ink-2: #4A443C;
  --ink-3: #726A5E;
  --ink-4: #A39A8C;
  --paper: #FDFBF7;
  --bg: #F2EFE8;
  --card: #FFFFFF;
  --line: #E2DCD0;
  --line-2: #EDE8DE;
  --gold: #A9793C;
  --gold-deep: #8C6127;
  --gold-solid: #8E6023;
  --gold-light: #E4D6BC;
  --gold-wash: #FAF6EE;
  --ok: #2F6B4A;
  --ok-bg: #EBF3EE;
  --warn: #8A5A12;
  --warn-bg: #FAF2E2;
  --block: #A33A31;
  --block-bg: #FAECEA;
  --info: #3C5E7A;
  --info-bg: #EDF2F6;
  --radius: 8px;
  --radius-ctl: 6px;
  --shadow-sm: 0 1px 2px rgba(35, 32, 27, .05);
  --shadow-lg: 0 12px 32px rgba(35, 32, 27, .18);
}

/* 界面缩放：标准 / 加大 / 特大 */
:root { --ui-scale: 1; }
html.fs-large { --ui-scale: 1.5; }
html.fs-xlarge { --ui-scale: 2; }

* { box-sizing: border-box; }

/* 关键：class 的 display 会覆盖浏览器对 [hidden] 的默认隐藏，这里显式兜底 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--gold-deep); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8D2C6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #C6BEB0; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 载入 ---------------- */
.boot {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--bg);
}
.boot-mark {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  font-size: 24px; font-weight: 600; color: #fff; background: var(--gold-solid);
}
.boot-text { color: var(--ink-3); font-size: 12px; }

/* ---------------- 骨架 ---------------- */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 16px;
  padding: 0 14px; background: var(--card); border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 148px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center;
  font-size: 16px; font-weight: 600; color: #fff; background: var(--gold-solid);
}
.boot-mark img, .brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand-name { font-size: 16px; font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--ink-4); line-height: 1.2; margin-top: 2px; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-item {
  border: 0; background: transparent; cursor: pointer; padding: 7px 10px; border-radius: 6px;
  color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; flex: 0 0 auto;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: var(--gold-wash); color: var(--ink); }
.nav-item.active { background: var(--gold-wash); color: var(--gold-deep); font-weight: 600; box-shadow: inset 0 0 0 1px var(--gold-light); }
/* 分组下拉 */
.nav-group { position: relative; flex: 0 0 auto; }
.nav-parent { position: relative; }
.nav-parent .ic-caret { width: 12px; height: 12px; margin-left: -2px; opacity: .55; transition: transform .16s; }
.nav-group.open .nav-parent .ic-caret { transform: rotate(180deg); }
.nav-group.active > .nav-parent { background: var(--gold-wash); color: var(--gold-deep); font-weight: 600; box-shadow: inset 0 0 0 1px var(--gold-light); }
.nav-drop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 150px; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.10); padding: 5px; display: none;
}
.nav-drop.on { display: block; }
.nav-drop .nav-item { width: 100%; justify-content: flex-start; padding: 8px 10px; }
.nav-group.has-badge > .nav-parent::after {
  content: ''; position: absolute; top: 6px; right: 4px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--block);
}
.nav-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--block); color: #fff;
  font-size: 12px; line-height: 16px; text-align: center; font-style: normal;
}
.ic { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 13px; height: 13px; }
.ic-lg { width: 20px; height: 20px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.org-tag {
  font-size: 12px; color: var(--ink-3); padding: 3px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--gold-wash); max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 1360px) { .org-tag { display: none; } }
@media (max-width: 1200px) {
  .nav-item { padding: 7px 7px; font-size: 12.5px; gap: 5px; }
  .nav-item .ic { width: 14px; height: 14px; }
  .brand { min-width: 120px; }
}
.user-box { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-wash); color: var(--gold-deep); font-size: 12px; font-weight: 600;
  border: 1px solid var(--gold-light);
}
/* 人物头像：品牌线描插画 */
.av { background: var(--gold-wash); color: var(--gold-deep); overflow: hidden; }
.av svg { width: 100%; height: 100%; display: block; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-role { font-size: 12px; color: var(--ink-4); line-height: 1.3; }

.view { flex: 1; min-height: 0; overflow: auto; }
.view.ws { overflow: hidden; display: flex; flex-direction: column; }

/* ---------------- 通用 ---------------- */
.page { padding: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--line-2); margin: 10px 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line-2);
}
.card-hd h3 { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.card-hd h3::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--gold);
}
.card-bd { padding: 12px; }
.card-bd.tight { padding: 8px; }
.card-bd.flush { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 13px; border-radius: var(--radius-ctl); border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  font-size: 13px; transition: all .15s;
}
.btn:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-wash); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--gold-solid); border-color: var(--gold-solid); color: #fff; }
.btn.primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--block); border-color: #E4C6C2; }
.btn.danger:hover { background: var(--block-bg); border-color: var(--block); color: var(--block); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.lg { height: 36px; padding: 0 20px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 30px; padding: 0; }
.btn.icon.sm { width: 26px; }
/* 语音输入：录音中 */
.voice-btn.on { background: var(--block-bg); border-color: var(--block); color: var(--block); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; background: var(--gold-wash); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 12px; white-space: nowrap;
}
.chip.gold { background: var(--gold-wash); border-color: var(--gold-light); color: var(--gold-deep); }
.chip.ok { background: var(--ok-bg); border-color: #CFE0D7; color: var(--ok); }
.chip.warn { background: var(--warn-bg); border-color: #EADBBC; color: var(--warn); }
.chip.block { background: var(--block-bg); border-color: #E4C6C2; color: var(--block); }
.chip.info { background: var(--info-bg); border-color: #D2DDE6; color: var(--info); }

.status {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; border: 1px solid transparent; white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-waiting { background: #F2F2F0; color: #6E6A63; border-color: #E3E1DC; }
.st-in_progress { background: var(--gold-wash); color: var(--gold-deep); border-color: var(--gold-light); }
.st-pending_review { background: var(--warn-bg); color: var(--warn); border-color: #EADBBC; }
.st-pending_fulfill { background: #F2EFF5; color: #61527C; border-color: #DCD5E6; }
.st-completed, .st-approved { background: var(--ok-bg); color: var(--ok); border-color: #CFE0D7; }
.st-rejected, .st-cancelled { background: var(--block-bg); color: var(--block); border-color: #E4C6C2; }
.st-in_production { background: var(--info-bg); color: var(--info); border-color: #D2DDE6; }
.st-shipping { background: var(--info-bg); color: var(--info); border-color: #D2DDE6; }
.st-draft { background: #F4F2EE; color: var(--ink-3); border-color: #E5E1D9; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input {
  height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-ctl);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
textarea.input { height: auto; padding: 7px 9px; resize: vertical; min-height: 54px; line-height: 1.5; }
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169, 121, 60, .12); }
.input::placeholder { color: var(--ink-4); }
select.input {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A39A8C'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 24px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ---------------- 首页 ---------------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 12px; padding: 14px; }
.greet { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.greet h1 { font-size: 20px; font-weight: 600; }
.greet p { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.greet .date { text-align: right; font-size: 12px; color: var(--ink-4); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px;
}
.kpi-label { font-size: 12px; color: var(--ink-3); }
.kpi-value { font-family: "DIN Alternate", "Bahnschrift", Arial, sans-serif; font-size: 24px; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.kpi-value small { font-size: 12px; font-weight: 400; color: var(--ink-4); margin-left: 3px; }
.kpi.accent { border-color: var(--gold-light); }
.kpi.accent .kpi-value { color: var(--gold-deep); }

.trend { display: flex; align-items: flex-end; gap: 8px; height: 96px; padding: 6px 2px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; max-width: 34px; border-radius: 4px 4px 2px 2px; background: var(--gold); min-height: 3px; position: relative; transition: height .3s; }
.trend-bar.today { background: var(--gold-solid); }
.trend-bar span { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--ink-3); }
.trend-x { font-size: 12px; color: var(--ink-4); }

.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; transition: background .14s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--gold-wash); }
.list-row .name { font-weight: 600; font-size: 13px; }
.list-row .meta { font-size: 12px; color: var(--ink-3); }
.avatar-sm {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--gold-wash); color: var(--gold-deep); font-size: 12px; border: 1px solid var(--line);
}

.device-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.device-row:last-child { border-bottom: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: 0 0 auto; }
.dot.online { background: var(--ok); }
.dot.offline { background: var(--ink-4); }
.dot.busy { background: var(--warn); }
.dot.maintenance { background: var(--block); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3);
  padding: 7px 10px; background: #FAF8F3; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.table tbody tr { cursor: pointer; transition: background .14s; }
.table tbody tr:hover { background: var(--gold-wash); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-family: "DIN Alternate", "Bahnschrift", Arial, sans-serif; }
.table.compact td { padding: 6px 10px; }

.empty { padding: 26px 12px; text-align: center; color: var(--ink-4); font-size: 13px; }
.empty .btn { font-size: 12px; }
.empty-art { display: block; width: 128px; height: auto; margin: 0 auto 10px; opacity: .9; }

/* ---------------- 接诊工作区 ---------------- */
.ws-head {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px;
  padding: 8px 14px 9px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.ws-row1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-patient { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-patient .avatar-lg {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--gold-wash); border: 1px solid var(--gold-light);
  color: var(--gold-deep); font-size: 16px; font-weight: 600;
}
.ws-patient h2 { font-size: 16px; display: flex; align-items: center; gap: 7px; }
.ws-meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; margin-top: 2px; }
.ws-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* 主诉条：主诉 + 修改 + 专家分身选择器 */
.ws-subject {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--radius-ctl);
  background: #FCFAF5;
}
.ws-subject:hover { border-color: var(--line-2); background: #FBF7EF; }
.ws-subject-lb {
  flex: 0 0 auto; font-size: 11px; color: var(--ink-3); letter-spacing: .5px;
  padding-right: 8px; border-right: 1px solid var(--line);
}
.ws-subject-tx {
  flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-subject-tx.is-empty { color: var(--ink-4); }
.ws-subject-edit {
  flex: 0 0 auto; font-size: 12px; color: var(--gold-deep); cursor: pointer; text-decoration: underline;
}
.ws-expert {
  flex: 0 0 auto; display: flex; align-items: center;
  padding-left: 10px; border-left: 1px solid var(--line);
}
.expert-chip {
  border: 1px solid var(--line); background: #FCFAF5; border-radius: 999px;
  padding: 2px 9px 2px 3px; height: 28px; cursor: pointer; font: inherit; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.expert-chip:hover { border-color: var(--gold); background: var(--gold-wash); }
.expert-chip-lb { font-size: 11px; color: var(--ink-4); }
.expert-chip-nm { font-size: 12px; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expert-chip-act { font-size: 11px; color: var(--gold-deep); }

.exp-av {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden; background: var(--gold-wash); color: var(--gold-deep);
}
.exp-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ws-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr) 400px; gap: 8px; padding: 8px 10px 0; }
.ws-col { min-height: 0; display: flex; flex-direction: column; }
.ws-col > .card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ws-col > .card > .card-bd { flex: 1; min-height: 0; overflow: auto; }
.ws-col .card-hd { padding: 8px 10px; }
.ws-col .card-hd h3 { font-size: 13px; }

.ws-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -1px 2px rgba(35, 32, 27, .05); z-index: 5;
}
.ws-foot .summary { font-size: 12px; color: var(--ink-3); display: flex; gap: 14px; }
.ws-foot .summary b { color: var(--ink); font-family: "DIN Alternate", Arial, sans-serif; font-size: 14px; }

.pane-tabs { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); background: var(--paper); }
.pane-tab {
  border: 0; background: transparent; padding: 4px 9px; border-radius: var(--radius-ctl); font-size: 12px;
  color: var(--ink-3); cursor: pointer;
}
.pane-tab.active { background: #fff; color: var(--gold-deep); box-shadow: var(--shadow-sm); font-weight: 600; }

.mini-section { border-bottom: 1px dashed var(--line-2); padding: 9px 10px; }
.mini-section:last-child { border-bottom: 0; }
.mini-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-title span:first-child { font-size: 13px; font-weight: 600; color: var(--ink); }
.mini-title .sub { font-size: 12px; color: var(--ink-4); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.form-grid .input { height: 27px; font-size: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.collect-warn {
  display: flex; gap: 6px; align-items: flex-start; padding: 6px 8px; margin: 8px 10px 0;
  background: var(--warn-bg); border: 1px solid #EADBBC; border-radius: var(--radius-ctl);
  font-size: 12px; color: var(--warn);
}

/* 方证参考 */
.sy-list { display: flex; flex-direction: column; gap: 7px; padding: 9px; min-height: 0; }
/* 列表子项不参与 flex 收缩：否则内容超出一屏时次选行会被压成细条（行内 overflow:hidden 会裁掉文字） */
.sy-list > * { flex: none; }
.sy-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px; background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.sy-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow-sm); }
.sy-card.top { border-color: var(--gold); }
.sy-head { display: flex; align-items: center; gap: 7px; }
.sy-name { font-size: 14px; font-weight: 600; }
.sy-tabs { display: flex; gap: 2px; padding: 0 1px; margin-bottom: -1px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.sy-tabs::-webkit-scrollbar { display: none; }
.sy-tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 6px 6px 7px; font-family: inherit;
  font-size: 12.5px; color: var(--ink-3); cursor: pointer;
  flex: 0 0 auto; white-space: nowrap;
}
.sy-tab i { font-style: normal; margin-left: 3px; font-size: 11px; color: var(--ink-4); }
.sy-tab:hover { color: var(--ink-2); }
.sy-tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.sy-tab.on i { color: var(--gold-deep); }
.ai-sub {
  margin: 12px 2px 0; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.ai-sub:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sy-why {
  margin-top: 7px; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: var(--radius-ctl);
  background: var(--gold-wash); font-size: 12px; line-height: 1.6; color: var(--ink-2);
}
.sy-why .k { display: block; margin-bottom: 2px; font-size: 12px; color: var(--ink-3); }
.sy-why.pending { color: var(--ink-3); background: transparent; border-style: dashed; }
.sy-match { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.sy-match b { font-family: "DIN Alternate", Arial, sans-serif; font-size: 14px; color: var(--gold-deep); }
.sy-hit { font-size: 12px; color: var(--ink-2); margin: 6px 0 4px; line-height: 1.5; }
.sy-hit .k { color: var(--ink-4); }
.sy-basis { font-size: 12px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sy-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.sy-foot .btn + .btn { margin-left: auto; }
.sy-kb {
  position: relative; margin-top: 7px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: var(--radius-ctl); background: var(--paper); font-size: 12px; line-height: 1.6;
  display: grid; grid-template-columns: 34px 1fr; gap: 2px 6px;
}
.sy-kb .k { color: var(--ink-4); }
.sy-kb .v { color: var(--ink-2); }
.sy-kb.miss { display: block; color: var(--ink-3); border-style: dashed; background: transparent; }
.sy-kb-flag { position: absolute; top: -8px; right: 8px; }
.disclaimer {
  margin: 0 9px 9px; padding: 6px 9px; border-radius: var(--radius-ctl); font-size: 12px; line-height: 1.5;
  color: var(--ink-3); background: var(--gold-wash); border: 1px solid var(--line);
}

/* ===== 中栏：选症状 / 辨证结果 双视图 ===== */
.ws-body.fd-min { grid-template-columns: 44px minmax(0, 1fr) 400px; }
/* 四诊采集整块隐藏：辨证推荐 + 临方开具两栏 */
.ws-body.fd-hidden { grid-template-columns: minmax(0, 1fr) 400px; }
.fd-mini-btn {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center;
  gap: 9px; padding: 12px 0; cursor: pointer; font-family: inherit; font-size: 12px;
  letter-spacing: 2px; color: var(--ink-3); background: #FCFAF5;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.fd-mini-btn:hover { color: var(--ink); border-color: var(--gold-light); }
.fd-mini-btn em { font-style: normal; font-size: 13px; letter-spacing: 0; }
.fd-mini-btn span { writing-mode: vertical-rl; }
/* 未绑定采集设备：不可展开 */
.fd-mini-btn.is-locked { color: var(--ink-4); background: #F7F4EC; cursor: not-allowed; }
.fd-mini-btn.is-locked:hover { color: var(--ink-4); border-color: var(--line); }
.fd-mini-hint { font-style: normal; font-size: 10px; letter-spacing: 1px; color: var(--ink-4); writing-mode: vertical-rl; }

.mid-col > .card { overflow: hidden; }
.mid-bar { flex: none; padding: 7px 10px 6px; background: #FCFAF5; border-bottom: 1px solid var(--line); }
.mid-bar .mini-title { margin-bottom: 4px; }
.mid-bar .ai-picked { margin: 0; max-height: 58px; overflow: auto; }
.mid-clear { color: var(--ink-4); cursor: pointer; text-decoration: underline; }
.mid-clear:hover { color: var(--block); }

.mid-tabs {
  flex: none; display: flex; gap: 2px; padding: 5px 8px 0;
  border-bottom: 1px solid var(--line); background: #fff;
}
.mid-tabs button {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 5px 10px 6px; font-family: inherit; font-size: 13px;
  color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.mid-tabs button:hover { color: var(--ink-2); }
.mid-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }
.mid-tabs .badge {
  font-style: normal; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--gold-solid); color: #fff; font-size: 11px; line-height: 16px; text-align: center;
}
.mid-tabs button:not(.on) .badge { background: var(--gold-wash); color: var(--gold-deep); }

.mid-body { flex: 1; min-height: 0; display: flex; }
.mid-pane { display: none; flex: 1; min-width: 0; min-height: 0; flex-direction: column; }
.mid-pane.on { display: flex; }
.mid-body .pane-sym .ai-sym {
  flex: 1; min-height: 0; max-height: none; overflow: auto;
  border-top: 0; border-bottom: 0;
}
.sym-search { flex: none; padding: 8px 10px 0; }
.sym-fd { flex: none; padding: 5px 10px 0; }
.mid-cta {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-top: 1px solid var(--line); background: #FCFAF5;
}
.pane-res .sy-list { flex: 1; min-height: 0; overflow: auto; padding: 9px 10px 12px; }
.pane-res .sy-tabs { margin-bottom: 8px; }

/* 结论卡 */
.sy-top {
  border: 1px solid var(--gold); border-radius: var(--radius); background: #fff;
  padding: 10px 11px; box-shadow: var(--shadow-sm);
}
.sy-top.used { border-color: var(--ok); background: #FCFDFB; }
.sy-top-hd { display: flex; align-items: flex-start; gap: 10px; }
.sy-top .sy-name { font-size: 16px; }
.sy-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.sy-tags .chip { height: 19px; font-size: 12px; }
.sy-meter { flex: none; width: 62px; text-align: right; }
.sy-meter b { font-family: "DIN Alternate", Arial, sans-serif; font-size: 18px; color: var(--gold-deep); }
.sy-meter i { font-style: normal; font-size: 12px; color: var(--ink-4); }
.sy-meter-bar { display: block; height: 3px; margin-top: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.sy-meter-bar i { display: block; height: 100%; background: var(--gold-solid); }
.sy-top .sy-hit { margin: 8px 0 0; }
.sy-hit .chip { height: 19px; font-size: 12px; margin-left: 3px; }
.sy-top .sy-basis { margin-top: 6px; }
.sy-tiaowen {
  margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--line-2);
  font-size: 12px; line-height: 1.6; color: var(--ink-3);
}
.sy-tiaowen .k { margin-right: 6px; color: var(--ink-4); }

/* 辨证推理链 */
.sy-reason {
  margin-top: 8px; padding: 8px 10px 9px; border: 1px dashed var(--gold-light);
  border-radius: 8px; background: #FFFDF7;
}
.sy-reason-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 11px; color: var(--ink-4); }
.sy-reason-hd .k { font-size: 12px; font-weight: 600; color: var(--gold-deep); }
.sy-steps { list-style: none; margin: 0; padding: 0; }
.sy-step { display: flex; gap: 8px; position: relative; padding-bottom: 8px; }
.sy-step:last-child { padding-bottom: 0; }
.sy-step:not(:last-child)::before {
  content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px;
  background: var(--gold-light);
}
.sy-step-i {
  flex: 0 0 auto; width: 17px; height: 17px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center; font-size: 10px; font-weight: 600;
  background: var(--gold-wash); border: 1px solid var(--gold-light); color: var(--gold-deep);
}
.sy-step-b { min-width: 0; font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.sy-step-b b { margin-right: 5px; font-weight: 600; color: var(--ink); }
.sy-reason-sum {
  margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.5; color: var(--ink);
}
.sy-reason-sum .k { margin-right: 5px; font-weight: 600; color: var(--gold-deep); }

/* 次选方证 */
.sy-sub {
  display: flex; align-items: center; gap: 6px; margin: 12px 1px 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.sy-sub i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--ink-4); }
.sy-row {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  margin-bottom: 6px; overflow: hidden;
}
.sy-row.open { border-color: var(--gold-light); background: #FFFDF8; }
.sy-row-hd { display: flex; align-items: center; gap: 6px; padding: 7px 9px; cursor: pointer; user-select: none; }
.sy-row-hd:hover { background: var(--gold-wash); }
.sy-row-name { font-size: 13px; font-weight: 600; }
.sy-row-hit { padding: 0 9px 7px 25px; font-size: 12px; color: var(--ink-3); cursor: pointer; }
.sy-row-hit:hover { color: var(--ink-2); }
.sy-row.open .ai-caret { color: var(--gold-deep); }
.sy-row-bd { padding: 0 9px 9px; border-top: 1px dashed var(--line-2); }
.sy-row-bd .sy-basis { margin-top: 7px; -webkit-line-clamp: unset; }

/* 证据折叠 */
.ev-sec {
  margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; overflow: hidden;
}
.ev-h {
  display: flex; align-items: center; gap: 6px; padding: 8px 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.ev-h:hover { background: var(--gold-wash); }
.ev-h .sub { font-size: 12px; font-weight: 400; color: var(--ink-4); }
.ev-h i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--ink-4); }
.ev-bd { padding: 0 9px 9px; border-top: 1px dashed var(--line-2); }
.ev-bd .sy-card { margin-top: 8px; }

/* 结果四态 */
.ai-state {
  padding: 30px 16px; text-align: center; background: #fff;
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.ai-state-t { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ai-state-d { margin: 5px auto 10px; max-width: 300px; font-size: 12px; line-height: 1.6; color: var(--ink-4); }
.ai-state.busy .ai-state-t::after { content: '…'; }
.ai-state.err { border-color: #E4C6C2; }
.ai-state.err .ai-state-t { color: var(--block); }

.rx-form { padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
/* 临方开具：剂数/天数/快递费/煎药费/诊金 一行五列 */
.field-row.rx-price-row {
  margin-top: 6px; align-items: end;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.rx-price-row .field, .rx-price-row .input { min-width: 0; }
html.fs-large .field-row.rx-price-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.fs-xlarge .field-row.rx-price-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg { display: flex; background: #F2EFE8; border-radius: var(--radius-ctl); padding: 2px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 4px 2px; border-radius: var(--radius-ctl);
  font-size: 12px; color: var(--ink-3); cursor: pointer; white-space: nowrap;
}
.seg button.active { background: #fff; color: var(--gold-deep); font-weight: 600; box-shadow: var(--shadow-sm); }

.herb-search { position: relative; }
.herb-drop {
  position: absolute; left: 0; right: 0; top: 34px; z-index: 30; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 230px; overflow: auto;
}
.herb-opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.herb-opt:last-child { border-bottom: 0; }
.herb-opt:hover, .herb-opt.active { background: var(--gold-wash); }
.herb-opt .hn { font-weight: 600; font-size: 13px; }
.herb-opt .hc { font-size: 12px; color: var(--ink-4); }
.herb-opt .hp { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.herb-opt .tox { color: var(--block); }

.rx-items { flex: 1; min-height: 0; overflow: auto; }
.rx-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px dashed var(--line-2);
}
.rx-item:hover { background: var(--paper); }
.rx-item .idx { width: 16px; font-size: 12px; color: var(--ink-4); font-family: "DIN Alternate", Arial, sans-serif; }
.rx-item .hn { flex: 1; min-width: 0; font-size: 13px; }
.rx-item .fn {
  flex: 0 0 auto; max-width: 84px; height: 22px; padding: 0 6px; border: 1px dashed var(--line);
  background: transparent; border-radius: 4px; font-size: 11px; color: var(--ink-4); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rx-item .fn:hover { border-color: var(--gold); color: var(--gold-deep); }
.rx-item .fn.has { border-style: solid; border-color: var(--gold-light); background: var(--gold-wash); color: var(--gold-deep); }
.rx-item .fn:disabled { cursor: default; opacity: .6; }
.rx-item .dose-input {
  width: 58px; height: 25px; text-align: right; padding: 0 5px; border: 1px solid var(--line);
  border-radius: var(--radius-ctl); font-family: "DIN Alternate", Arial, sans-serif; font-size: 13px;
}
.rx-item .unit { font-size: 12px; color: var(--ink-4); width: 14px; }
.rx-item .sub { width: 58px; text-align: right; font-size: 12px; color: var(--ink-3); font-family: "DIN Alternate", Arial, sans-serif; }
.rx-item .del { width: 22px; height: 22px; border: 0; background: transparent; color: var(--ink-4); cursor: pointer; border-radius: 4px; }
.rx-item .del:hover { background: var(--block-bg); color: var(--block); }
.rx-empty { padding: 24px 10px; text-align: center; color: var(--ink-4); font-size: 12px; }
.rx-total {
  border-top: 1px solid var(--line); padding: 7px 10px; background: var(--paper);
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3);
}
.rx-total b { font-family: "DIN Alternate", Arial, sans-serif; font-size: 16px; color: var(--gold-deep); }

/* 审方 */
.review-layout { display: grid; grid-template-columns: 274px minmax(0, 1fr); gap: 10px; padding: 12px; height: 100%; }
.review-list { overflow: auto; }
.rv-item { padding: 9px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; border-left: 3px solid transparent; }
.rv-item:hover { background: var(--gold-wash); }
.rv-item.active { background: var(--gold-wash); border-left-color: var(--gold); }
.rv-item .t { display: flex; align-items: center; gap: 6px; }
.rv-item .t b { font-size: 13px; }
.rv-item .m { font-size: 12px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 8px; }

.check-list { display: flex; flex-direction: column; gap: 5px; }
.check-row { display: flex; gap: 8px; padding: 7px 9px; border-radius: var(--radius-ctl); border: 1px solid var(--line-2); background: var(--paper); }
.check-row.pass { background: #FBFDFB; }
.check-row.warn { background: var(--warn-bg); border-color: #EADBBC; }
.check-row.block { background: var(--block-bg); border-color: #E4C6C2; }
.check-ico {
  width: 17px; height: 17px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 12px; color: #fff; background: var(--ok); margin-top: 1px;
}
.check-row.warn .check-ico { background: var(--warn); }
.check-row.block .check-ico { background: var(--block); }
.check-name { font-size: 12px; font-weight: 600; }
.check-msg { font-size: 12px; color: var(--ink-3); margin-top: 1px; line-height: 1.5; }
.check-row.block .check-msg { color: var(--block); }
.check-row.warn .check-msg { color: var(--warn); }

.rx-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rx-preview-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-4); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.rx-preview-table td { padding: 4px 6px; border-bottom: 1px dashed var(--line-2); }
.rx-preview-table .r { text-align: right; font-family: "DIN Alternate", Arial, sans-serif; }

/* 履约 */
.fulfill { height: 100%; display: flex; flex-direction: column; }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 12px; overflow: hidden; }
.board-col { display: flex; flex-direction: column; min-height: 0; background: #EFECE4; border: 1px solid var(--line); border-radius: var(--radius); }
.board-hd { padding: 8px 10px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.board-hd b { font-size: 13px; }
.board-hd .cnt { margin-left: auto; font-family: "DIN Alternate", Arial, sans-serif; font-size: 12px; color: var(--ink-3); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.board-body { flex: 1; min-height: 0; overflow: auto; padding: 7px; display: flex; flex-direction: column; gap: 7px; }
.fc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 9px; box-shadow: var(--shadow-sm); }
.fc:hover { border-color: var(--gold-light); }
.fc .fc-top { display: flex; align-items: center; gap: 6px; }
.fc .fc-top b { font-size: 13px; }
.fc .fc-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 7px; flex-wrap: wrap; }
.fc .fc-amt { font-family: "DIN Alternate", Arial, sans-serif; color: var(--gold-deep); font-size: 13px; margin-left: auto; }
.fc .fc-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.fc .fc-foot .btn { margin-left: auto; }
.progress { display: flex; gap: 3px; margin-top: 6px; }
.progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--line-2); }
.progress i.on { background: var(--gold); }
.progress i.done { background: var(--ok); }

/* 设置 */
.settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px; align-items: start; }
.settings .full { grid-column: 1 / -1; }

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(35, 32, 27, .38); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 520px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column;
  animation: rise .2s cubic-bezier(.2, .8, .3, 1); border: 1px solid var(--line);
}
@keyframes rise { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal.wide { width: 720px; }
.modal.xl { width: 1060px; }
.modal.slim { width: 420px; }

/* 专家选择大弹窗 */
.exp-lead { font-size: 13px; color: var(--ink-4); line-height: 1.7; margin-bottom: 12px; }
.exp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.exp-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #FFFEFB;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.exp-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-wash); }
.exp-kind {
  margin-left: auto; align-self: flex-start; flex: none;
  font-size: 10.5px; line-height: 1.5; padding: 2px 7px; border-radius: 999px;
  background: var(--gold-wash); color: var(--gold-deep); white-space: nowrap;
}
.exp-card.out { border-color: #D3E4DE; }
.exp-card.out.on { border-color: #2F7A70; box-shadow: 0 0 0 2px rgba(47, 122, 112, .12); }
.exp-card.out .exp-card-sec b,
.exp-card.out .exp-intro-lb,
.exp-card.out .exp-more { color: #2C6E64; }
.exp-card.out .exp-tag { background: #EAF3F0; color: #2C6E64; }
.exp-card.out .exp-kind { background: #E6F1EE; color: #2C6E64; }
.exp-card-hd { display: flex; align-items: center; gap: 10px; }
.exp-card-id { min-width: 0; flex: 1; }
.exp-card-nm { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.exp-card-tt { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.exp-card-sec b {
  display: block; font-size: 11px; font-weight: 600; color: var(--gold-deep);
  letter-spacing: .04em; margin-bottom: 3px;
}
.exp-card-sec p { font-size: 12.5px; line-height: 1.75; color: var(--ink); margin: 0; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.exp-tag { font-size: 11.5px; padding: 2px 7px; border-radius: 999px; background: var(--gold-wash); color: var(--gold-deep); }
.exp-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.exp-card-intro-wrap { border-top: 1px dashed var(--line); padding-top: 8px; }
.exp-intro-lb { font-size: 11px; font-weight: 600; color: var(--gold-deep); letter-spacing: .04em; margin-bottom: 3px; }
.exp-card-intro {
  font-size: 11.5px; color: var(--ink-4); line-height: 1.6;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
.exp-card-intro.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.exp-more {
  margin-top: 4px; padding: 0; border: 0; background: transparent;
  font-size: 11.5px; color: var(--gold-deep); cursor: pointer;
}
.exp-more:hover { text-decoration: underline; }
.exp-card-ft { margin-top: auto; }
@media (max-width: 980px) {
  .exp-grid, .exp-grid.four { grid-template-columns: 1fr; }
}
.modal-hd { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-hd h3 { font-size: 16px; }
.modal-hd .x { margin-left: auto; border: 0; background: transparent; font-size: 18px; color: var(--ink-4); cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-ctl); }
.modal-hd .x:hover { background: var(--gold-wash); color: var(--ink); }
.modal-bd { padding: 14px 16px; overflow: auto; }
.modal-ft { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }

/* A5 处方笺（竖版传统笺，参考纸质处方样式） */
.a5-wrap { padding: 12px; background: #E7E2D6; border-radius: var(--radius); overflow: auto; }
.a5-wrap .a5 { max-width: 430px; margin: 0 auto; }
.a5 {
  width: 100%; aspect-ratio: 148 / 210; background: #FBF7EC; color: #241F18;
  padding: 16px 18px 12px; border: 1px solid #C9BFA9;
  box-shadow: 0 1px 3px rgba(35, 32, 27, .10);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  font-family: "KaiTi", "STKaiti", "Songti SC", "SimSun", serif;
}
.a5::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid #D9CEB8;
  pointer-events: none;
}
/* 标题区：诊所名，顶部居中 */
.a5-head {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  padding-bottom: 6px; border-bottom: 1px solid #D9CEB8;
}
.a5-org { font-size: 18px; font-weight: 700; letter-spacing: 3px; text-indent: 3px; line-height: 1.25; text-align: center; }
.a5-patient {
  position: relative; z-index: 1; margin: 8px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; font-size: 11px;
}
.a5-f { display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid #D9CEB8; padding-bottom: 2px; min-height: 17px; }
.a5-f .k { flex: 0 0 auto; color: #6B6152; }
.a5-f .v { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 主诉可能较长：整行显示，最多两行 */
.a5-f-cc .v {
  white-space: normal; text-overflow: clip; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.a5-f-wide { grid-column: 1 / -1; }
.a5-rp { flex: 1; min-height: 0; display: flex; gap: 8px; margin-top: 8px; position: relative; z-index: 1; }
.a5-rp-mark { font-size: 17px; font-weight: 700; font-style: italic; line-height: 1; }
.a5-herbs { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 12px; align-content: start; font-size: 11.5px; }
.a5-herb { display: flex; align-items: baseline; gap: 3px; border-bottom: 1px dotted #E2D8C4; padding-bottom: 1px; min-width: 0; }
.a5-herb-n { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a5-herb-fn { font-style: normal; font-size: 9.5px; color: #8C6127; }
.a5-herb-d { margin-left: auto; font-family: "DIN Alternate", Arial, sans-serif; font-size: 10.5px; white-space: nowrap; }
.a5-usage { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; border-top: 1px solid #D9CEB8; padding-top: 5px; margin-top: 6px; position: relative; z-index: 1; }
.a5-sign { display: flex; gap: 26px; font-size: 11px; margin-top: 7px; position: relative; z-index: 1; }
.a5-sign span { flex: 1; border-bottom: 1px solid #D9CEB8; padding-bottom: 2px; }
.a5-fees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 14px; font-size: 10.5px; border-top: 1px solid #D9CEB8; margin-top: 7px; padding-top: 5px; position: relative; z-index: 1; }
.a5-fee { display: flex; justify-content: space-between; gap: 6px; }
.a5-fee b { font-family: "DIN Alternate", Arial, sans-serif; font-weight: 600; }
.a5-fee-total { grid-column: 1 / -1; justify-content: flex-end; gap: 14px; border-top: 1px dotted #D9CEB8; margin-top: 2px; padding-top: 3px; color: #8C6127; font-weight: 700; }
.a5-note { font-size: 9.5px; color: #7A7162; margin-top: 5px; position: relative; z-index: 1; }

/* toast */
.toast-root { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(35, 32, 27, .94); color: #fff; padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease;
  display: flex; align-items: center; gap: 7px; max-width: 560px;
}
.toast.err { background: rgba(140, 48, 40, .96); }
.toast.ok { background: rgba(40, 88, 62, .96); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 64px;
  padding: 24px;
  background: radial-gradient(900px 520px at 50% 12%, #FBF7EF 0, var(--bg) 64%);
}
.login-art { width: clamp(280px, 32vw, 400px); flex: 0 0 auto; }
.login-art img { width: 100%; height: auto; display: block; }
@media (max-width: 1080px) { .login-wrap { gap: 36px; } }
@media (max-width: 900px) {
  .login-wrap { gap: 0; }
  .login-art { display: none; }
  .login-panel { width: min(420px, 100%); }
  .sdz-detail, .sdz-result, .sdz-ask { grid-template-columns: minmax(0, 1fr); }
  .sdz-ask-side { position: static; }
}
@media (max-width: 780px) {
  .login-wrap { flex-direction: column; gap: 20px; padding: 28px 24px; }
  .login-art { width: 210px; }
}
.login-panel {
  width: 360px; max-width: 100%; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 32px 28px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 36px; height: 36px; font-size: 18px; }
.login-panel h2 { font-size: 20px; font-weight: 600; }
.login-panel .sub { font-size: 13px; color: var(--ink-3); margin: 6px 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .input { height: 36px; }
.login-err { font-size: 12px; color: var(--block); min-height: 16px; }

/* 工具 */
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.scroll-y { overflow-y: auto; }
.spacer { flex: 1; }
.pill-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.pill-tabs button {
  border: 1px solid transparent; background: transparent; border-radius: 999px; padding: 4px 11px;
  font-size: 12px; color: var(--ink-3); cursor: pointer;
}
.pill-tabs button:hover { background: var(--gold-wash); }
.pill-tabs button.active { background: #fff; border-color: var(--gold-light); color: var(--gold-deep); font-weight: 600; }
.pill-tabs .cnt { font-family: "DIN Alternate", Arial, sans-serif; margin-left: 2px; color: var(--ink-4); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; padding: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: flex; gap: 8px; font-size: 12px; padding: 3px 0; }
.kv .k { color: var(--ink-4); min-width: 62px; }
.kv .v { color: var(--ink); }

.timeline { display: flex; flex-direction: column; gap: 0; padding-left: 4px; }
.tl-item { display: flex; gap: 9px; padding-bottom: 9px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 5px; top: 13px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--gold-light); background: #fff; flex: 0 0 auto; margin-top: 3px; z-index: 1; }
.tl-item:first-child .tl-dot { border-color: var(--gold); background: var(--gold); }
.tl-t { font-size: 12px; font-weight: 600; }
.tl-m { font-size: 12px; color: var(--ink-3); }

/* 方证参考 */
.ai-picked { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; margin: 2px 0 6px; }
.ai-picked .chip { height: 21px; }
.ai-sym {
  flex: 0 0 auto; max-height: 208px; overflow: auto;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  background: var(--paper);
}
.ai-cat { border-bottom: 1px dashed var(--line-2); }
.ai-cat:last-child { border-bottom: 0; }
.ai-cat-h {
  display: flex; align-items: center; gap: 6px; padding: 6px 9px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.ai-cat-h:hover { background: var(--gold-wash); }
.ai-cat-h .sub { font-size: 12px; color: var(--ink-4); font-weight: 400; }
.ai-caret { width: 10px; font-size: 12px; color: var(--ink-4); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 9px 8px; }
.ai-chips .chip { cursor: pointer; }
.chip.on { background: var(--gold-solid); border-color: var(--gold-solid); color: #fff; font-weight: 600; }
.chip.on:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.chip .x {
  font-style: normal; margin-left: 2px; opacity: .7; cursor: pointer;
  font-size: 12px; line-height: 1;
}
.chip .x:hover { opacity: 1; }
.chip.miss { height: 18px; padding: 0 5px; font-size: 12px; }
.patent-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 9px;
  border-bottom: 1px dashed var(--line-2); font-size: 12px;
}
.patent-row:hover { background: var(--paper); }
.patent-row .pn { font-weight: 600; font-size: 13px; }

/* 专家分身 */
.expert-brief {
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 8px 10px; margin: 8px 0;
  background: linear-gradient(180deg, #FCFAF5, #FFFFFF);
}
.expert-brief .chip { margin-left: 0; }

/* 本院协定方 */
.ai-sub i { font-style: normal; font-weight: 400; margin-left: 6px; font-size: 12px; color: var(--ink-4); }
.agr-card {
  border: 1px solid var(--gold-light); border-radius: var(--radius); padding: 9px 10px;
  background: var(--gold-wash); transition: border-color .16s, box-shadow .16s;
}
.agr-card:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.agr-card .sy-head .chip { margin-left: auto; }
.agr-meta {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px;
  font-size: 12px; color: var(--ink-3);
}
.agr-meta span { white-space: nowrap; }
.agr-fj { margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--line); }
.agr-fj-lb { font-size: 11px; font-weight: 600; color: var(--gold-deep); letter-spacing: .04em; margin-bottom: 2px; }
.agr-fj-tx {
  font-size: 12px; color: var(--ink-3); line-height: 1.6;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.agr-fj-tx.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.agr-fj-more {
  margin-top: 3px; padding: 0; border: 0; background: transparent;
  font-size: 11.5px; color: var(--gold-deep); cursor: pointer;
}
.agr-fj-more:hover { text-decoration: underline; }
.rx-item .src { font-size: 12px; color: var(--ink-4); margin-left: 4px; }

/* 多分身会诊 */
.modal.xl { width: 1040px; }
.panel-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.panel-pick-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px;
  background: #FCFAF5; cursor: pointer;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.panel-pick-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow-sm); }
.panel-pick-card.on { border-color: var(--gold); background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold); }
.panel-pick-hd { display: flex; align-items: center; gap: 8px; }
.panel-pick-hd .grow, .panel-card-hd .grow { flex: 1; min-width: 0; }
.panel-check { color: var(--gold); font-weight: 700; }
.panel-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--gold-wash);
  color: var(--gold-deep); border: 1px solid var(--gold-light);
}
.panel-syms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.panel-syms .k { font-size: 12px; color: var(--ink-4); margin-right: 2px; }
.panel-grid { display: grid; gap: 10px; margin-top: 10px; }
.panel-grid.cols2 { grid-template-columns: repeat(2, 1fr); }
.panel-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.panel-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #FFFEFB;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.panel-card-hd { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.panel-spec { font-size: 12px; color: var(--gold); }
.panel-row { display: flex; gap: 8px; font-size: 13px; line-height: 1.55; }
.panel-row .k { flex: none; width: 32px; color: var(--ink-4); font-size: 12px; }
.panel-row .v { flex: 1; min-width: 0; color: var(--ink); }
.panel-fang {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 8px;
  border-radius: 6px; background: var(--gold-wash); border: 1px solid var(--gold-light);
}
.panel-fang .k { font-size: 12px; color: var(--ink-4); }
.panel-fang b { font-size: 15px; color: var(--gold-deep); }
.panel-stance {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
  background: #F7F4EC; border-radius: 6px; padding: 6px 8px;
}
.panel-agr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.panel-risk { font-size: 12px; color: var(--block); line-height: 1.55; }
.panel-foot { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.panel-foot .btn { width: 100%; }
.panel-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 10px; font-size: 11px; flex: none;
}
.panel-tag.ok { color: var(--ok); background: var(--ok-bg); }
.panel-tag.warn { color: var(--warn); background: var(--warn-bg); }
.panel-tag.block { color: var(--block); background: var(--block-bg); }
.panel-sec { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.panel-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.panel-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.panel-list.risk { color: var(--block); }
.panel-dv { border-left: 2px solid var(--warn); padding: 2px 0 2px 10px; margin-bottom: 8px; }
.panel-dv-pt { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.panel-dv-row { font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }
.panel-dv-row .who { color: var(--gold-deep); margin-right: 6px; }
.panel-wait { padding: 42px 0; text-align: center; }
.panel-wait-t { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.panel-err {
  border: 1px solid var(--block); background: var(--block-bg); color: var(--block);
  border-radius: var(--radius); padding: 8px 10px; font-size: 13px; margin-bottom: 10px;
}
@media (max-width: 900px) {
  .modal.xl { width: 96vw; }
  .panel-grid.cols2, .panel-grid.cols3 { grid-template-columns: 1fr; }
}

/* ---------------- 业务扩展（biz.js） ---------------- */
.modal.lg { width: 780px; }

.bz-hd {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.bz-hd-l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.bz-hd-l h2 { font-size: 20px; font-weight: 600; }
.bz-hd-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bz-sub { color: var(--ink-3); font-size: 12px; }
.bz-sub2 { display: block; color: var(--ink-4); font-size: 12px; margin-top: 1px; }
.bz-name { font-weight: 600; }
.bz-muted { color: var(--ink-4); }
.bz-card-r { font-size: 12px; color: var(--ink-3); }

.bz-kpis { margin-bottom: 12px; }
.bz-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: 12px; align-items: start;
}
.bz-cols > div { min-width: 0; }
.bz-scroll { overflow-x: auto; }
.bz-acts { display: flex; gap: 6px; flex-wrap: wrap; }

.bz-qno {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 6px; border-radius: var(--radius-ctl);
  background: var(--gold-wash); border: 1px solid var(--gold-light);
  color: var(--gold-deep); font-weight: 600;
  font-family: "DIN Alternate", "Bahnschrift", Arial, sans-serif;
}

.bz-tabs { margin-bottom: 10px; width: fit-content; }
/* 业务卡片：内容统一留白，表格/列表保持通栏，避免输入框与文字贴边 */
.bz-card .card-bd.flush { padding: 12px; }
.bz-card .card-bd.flush > .bz-scroll,
.bz-card .card-bd.flush > .empty,
.bz-card .card-bd.flush > .bz-notice { margin-left: -12px; margin-right: -12px; }
input.bz-date { width: 148px; }
.bz-form { display: block; }
.bz-filter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.bz-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bz-row .input { width: auto; flex: 1 1 160px; min-width: 120px; }
.bz-inline.input { width: auto; }

.bz-info {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
  background: var(--gold-wash); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.bz-h4 {
  font-size: 13px; color: var(--ink-2); margin: 14px 0 6px;
  display: flex; align-items: center; gap: 6px;
}
.bz-h4::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--gold-light); }

.bz-tip {
  margin-top: 10px; padding: 7px 9px; font-size: 12px; line-height: 1.5;
  color: var(--ink-4); background: var(--gold-wash);
  border: 1px solid var(--line); border-radius: var(--radius-ctl);
}

.bz-sum-list { display: flex; flex-direction: column; }
.bz-sum-list > div {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 2px; font-size: 13px; border-bottom: 1px dashed var(--line-2);
}
.bz-sum-list > div:last-child { border-bottom: 0; }

.bz-notice { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.bz-notice:last-child { border-bottom: 0; }
.bz-notice.unread { background: var(--gold-wash); cursor: pointer; }
.bz-notice.unread:hover { background: #F7F1E5; }
.bz-notice-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px;
}
.bz-notice-bd { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }

@media (max-width: 1100px) {
  .bz-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 四诊采集：设备图片 / 舌象四项 / 五脏偏态 / 21 题 ===== */
.fd-media { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fd-thumb { position: relative; display: flex; align-items: center; justify-content: center; height: 66px; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; text-decoration: none; }
.fd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fd-thumb em { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 10px; line-height: 15px; text-align: center; color: #fff; background: rgba(0,0,0,.45); }
.fd-thumb.empty { border-style: dashed; background: #FAF8F3; }
.fd-thumb.empty span { font-size: 11px; color: var(--ink-4); margin-bottom: 12px; }
.fd-thumb.empty em { color: var(--ink-4); background: transparent; }
.fd-q-list { display: flex; flex-direction: column; gap: 3px; max-height: 268px; overflow: auto; padding-right: 2px; margin-top: 4px; }
.fd-q { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.35; }
.fd-q-no { flex: none; width: 16px; text-align: right; font-size: 11px; color: var(--ink-4); }
.fd-q-text { flex: 1; }
.fd-q select { flex: none; width: 50px; height: 23px; font-size: 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.fd-wz-row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 4px; }
.fd-wz-name { flex: none; width: 30px; }
.fd-wz-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.fd-wz-bar i { display: block; height: 100%; border-radius: 3px; }
.fd-wz-val { flex: none; min-width: 52px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ==================== 智能问诊 ==================== */
.ct-intro { font-size: 12px; color: var(--ink-3); line-height: 1.7; margin-bottom: 10px; }
.ct-alert { margin-bottom: 10px; padding: 8px 10px; border-radius: 7px; background: #FDF3E7; border: 1px solid #F0D3AE; color: #8A5A16; font-size: 12px; line-height: 1.6; }
.ct-known { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.ct-known .k { font-size: 11px; color: var(--ink-4); }
.ct-group { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px 10px; margin-bottom: 10px; background: #fff; }
.ct-dim { font-size: 12px; font-weight: 600; color: var(--gold); margin-bottom: 2px; }
.ct-q { padding: 8px 0 2px; }
.ct-q + .ct-q { border-top: 1px dashed var(--line-2); }
.ct-q-t { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.ct-q-t em { font-style: normal; font-size: 11px; color: var(--ink-4); margin-left: 6px; }
.ct-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-opt { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; color: var(--ink-2); cursor: pointer; line-height: 1.6; }
.ct-opt:hover { border-color: var(--gold); color: var(--gold); }
.ct-opt.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.ct-opt.ct-unknown { border-style: dashed; color: var(--ink-4); }
.ct-opt.ct-unknown.on { background: var(--ink-4); border-color: var(--ink-4); color: #fff; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
.ct-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: #F6F1E4; color: var(--ink-2); font-size: 12px; }
.ct-chip b { cursor: pointer; color: var(--ink-4); font-weight: 400; font-size: 13px; line-height: 1; }
.ct-chip b:hover { color: #B23B2E; }
.ct-neg { margin-top: 6px; font-size: 11px; color: var(--ink-4); }
.ct-cands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ==========================================================================
   特色门诊（专病专科）—— 独立入口，诊所招牌调性：墨底、铜金、宣纸
   ========================================================================== */
.sdz { padding-bottom: 28px; }
.sdz .kicker, .sdz-kicker {
  font-size: 11px; letter-spacing: .16em; color: var(--gold-deep);
  text-transform: uppercase; margin-bottom: 6px;
}
.sdz-nav { position: relative; }
.sdz-nav::after {
  content: ""; position: absolute; right: 6px; top: 8px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
}

/* 招牌 */
.sdz-hero {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 26px 30px; margin-bottom: 18px; border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(1100px 260px at 88% -30%, rgba(169, 121, 60, .38), transparent 62%),
    linear-gradient(135deg, #2A251E 0%, #37302A 52%, #241F19 100%);
  color: #F6F1E7;
  box-shadow: 0 10px 26px rgba(35, 32, 27, .22);
}
.sdz-hero::after {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(224, 198, 150, .26);
  border-radius: 8px; pointer-events: none;
}
.sdz-hero-main { display: flex; align-items: flex-start; gap: 18px; position: relative; z-index: 1; }
.sdz-seal {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 6px;
  border: 2px solid rgba(233, 205, 158, .75); color: #E9CD9E;
  display: grid; place-items: center; font-size: 27px; font-weight: 600;
  font-family: "Songti SC", "SimSun", serif; transform: rotate(-3deg);
  background: rgba(233, 205, 158, .06); letter-spacing: 0;
}
.sdz-hero-txt h1 {
  margin: 0 0 6px; font-size: 21px; font-weight: 600; letter-spacing: .04em;
  font-family: "Songti SC", "SimSun", serif; color: #FBF6EC;
}
.sdz-hero-txt p { margin: 0; font-size: 12.5px; line-height: 1.7; color: rgba(246, 241, 231, .72); max-width: 560px; }
.sdz-hero .sdz-kicker { color: #D9BE8E; }
.sdz-hero-side {
  position: relative; z-index: 1; text-align: center; padding-left: 22px;
  border-left: 1px solid rgba(233, 205, 158, .22);
}
.sdz-hero-num {
  display: block; font-size: 40px; line-height: 1; font-weight: 300;
  font-family: "Songti SC", "SimSun", serif; color: #E9CD9E;
}
.sdz-hero-side em { font-style: normal; font-size: 11px; letter-spacing: .16em; color: rgba(246, 241, 231, .6); }

/* 专病卡 */
.sdz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px; }
.sdz-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; text-align: left;
  padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: inherit; font: inherit; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
  overflow: hidden;
}
.sdz-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--gold), rgba(169, 121, 60, .18));
}
.sdz-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(35, 32, 27, .12); border-color: var(--gold-light); }
.sdz-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sdz-card-name {
  font-size: 18px; font-weight: 600; letter-spacing: .03em;
  font-family: "Songti SC", "SimSun", serif; color: var(--ink);
}
.sdz-card-wm { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.sdz-card-no {
  font-size: 13px; letter-spacing: .08em; color: var(--gold-light);
  font-family: "Songti SC", "SimSun", serif;
}
.sdz-card-intro {
  font-size: 12.5px; line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px;
}
.sdz-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.sdz-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 11px; border-top: 1px dashed var(--line-2); margin-top: auto;
}
.sdz-expert { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.sdz-expert img, .sdz-expert > span {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--gold-wash); overflow: hidden;
  border: 1px solid var(--gold-light); color: var(--gold-deep); font-size: 13px;
}
.sdz-expert-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1 1 auto; }
.sdz-expert-txt b, .sdz-expert-txt span { overflow: hidden; text-overflow: ellipsis; }
.sdz-expert-txt b { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sdz-expert-txt span {
  font-size: 11px; color: var(--ink-4); line-height: 1.35; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sdz-go { font-size: 12px; color: var(--gold-deep); white-space: nowrap; flex: 0 0 auto; }
.sdz-go em { font-style: normal; margin-left: 3px; transition: margin .16s; }
.sdz-card:hover .sdz-go em { margin-left: 7px; }

/* 返回 / 步骤条 */
.sdz-back {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px;
  padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12.5px; cursor: pointer;
}
.sdz-back:hover { color: var(--gold-deep); }
.sdz-steps { display: flex; align-items: center; gap: 0; margin-bottom: 16px; }
.sdz-step { display: flex; align-items: center; gap: 7px; color: var(--ink-4); font-size: 12px; }
.sdz-step b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); font-size: 11px; font-weight: 500;
}
.sdz-step.on { color: var(--ink); }
.sdz-step.on b { background: var(--gold-solid); border-color: var(--gold-solid); color: #fff; }
.sdz-step.done { color: var(--gold-deep); }
.sdz-step.done b { border-color: var(--gold-light); color: var(--gold-deep); background: var(--gold-wash); }
.sdz-step-line { flex: 1 1 26px; height: 1px; background: var(--line); margin: 0 12px; max-width: 60px; }

/* 专病详情 */
.sdz-detail { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 16px; align-items: start; }
.sdz-detail-main { padding: 22px 24px; }
.sdz-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sdz-detail-head h1 {
  margin: 0; font-size: 24px; font-weight: 600; letter-spacing: .04em;
  font-family: "Songti SC", "SimSun", serif;
}
.sdz-intro { margin: 0 0 16px; font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.sdz-indication { margin-bottom: 14px; line-height: 1.7; }
.sdz-warn {
  border: 1px solid #E9CFA5; background: var(--warn-bg); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 16px; color: var(--warn);
}
.sdz-warn b { display: block; font-size: 12.5px; margin-bottom: 6px; }
.sdz-warn ul { margin: 0; padding-left: 17px; }
.sdz-warn li { font-size: 12.5px; line-height: 1.75; }
.sdz-route {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: var(--gold-wash); border-radius: 8px; border: 1px solid var(--gold-light);
  font-size: 12.5px; color: var(--ink-2);
}
.sdz-route b { color: var(--gold-deep); font-weight: 600; white-space: nowrap; }
.sdz-detail-side { display: flex; flex-direction: column; gap: 12px; }
.sdz-expert-card { padding: 20px 18px; text-align: center; }
.sdz-expert-avatar img, .sdz-expert-avatar > span {
  width: 70px; height: 70px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px;
  display: grid; place-items: center; background: var(--gold-wash); overflow: hidden;
  border: 2px solid var(--gold-light); color: var(--gold-deep);
  font-size: 26px; font-family: "Songti SC", "SimSun", serif;
}
.sdz-expert-name { font-size: 16px; font-weight: 600; font-family: "Songti SC", "SimSun", serif; }
.sdz-expert-title { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.sdz-expert-spec { font-size: 12px; color: var(--ink-2); margin-top: 8px; line-height: 1.65; }
.sdz-expert-intro {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.75; margin: 8px 0 0; text-align: left;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sdz-expert-tag {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2);
  font-size: 11px; letter-spacing: .1em; color: var(--gold-deep);
}
.sdz-start { height: 42px; font-size: 14px; }

/* 问诊 */
.sdz-ask { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.sdz-ask-main { display: flex; flex-direction: column; gap: 10px; }
.sdz-q { padding: 14px 16px 15px; }
.sdz-q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.sdz-q-no {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  background: var(--gold-wash); color: var(--gold-deep); font-size: 11px; font-weight: 600;
}
.sdz-q-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; flex: 1 1 auto; }
.sdz-q-req, .sdz-q-opt, .sdz-q-multi {
  font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}
.sdz-q-req { color: var(--block); background: var(--block-bg); }
.sdz-q-opt { color: var(--ink-4); background: var(--bg); }
.sdz-q-multi { color: var(--info); background: var(--info-bg); }
.sdz-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.sdz-opt {
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: all .13s; line-height: 1.4;
}
.sdz-opt:hover { border-color: var(--gold-light); background: var(--gold-wash); color: var(--gold-deep); }
.sdz-opt.on {
  background: var(--gold-solid); border-color: var(--gold-solid); color: #fff;
  box-shadow: 0 2px 8px rgba(142, 96, 35, .25);
}
.sdz-ask-side { position: sticky; top: 0; }
.sdz-progress { padding: 16px; }
.sdz-progress-top { display: flex; align-items: baseline; gap: 5px; margin-bottom: 8px; }
.sdz-progress-top b { font-size: 26px; font-weight: 300; color: var(--gold-deep); font-family: "Songti SC", "SimSun", serif; }
.sdz-progress-top span { font-size: 12px; color: var(--ink-3); }
.sdz-bar { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; margin-bottom: 14px; }
.sdz-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); transition: width .2s; }
.sdz-side-warn {
  font-size: 11.5px; line-height: 1.7; color: var(--warn); background: var(--warn-bg);
  border-radius: 6px; padding: 9px 10px; margin-bottom: 12px;
}
.sdz-side-warn b { display: block; margin-bottom: 3px; font-size: 11.5px; }
.sdz-judge-btn { height: 40px; margin-bottom: 8px; }

/* 结果 */
.sdz-ambiguous {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; font-size: 12.5px;
  background: var(--info-bg); color: var(--info); border: 1px solid #CFDEE9;
}
.sdz-result { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 16px; align-items: start; }
.sdz-result-main { display: flex; flex-direction: column; gap: 12px; }
.sdz-syn { padding: 20px 22px; }
.sdz-syn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sdz-syn-head h2 {
  margin: 0; font-size: 23px; font-weight: 600; letter-spacing: .04em;
  font-family: "Songti SC", "SimSun", serif;
}
.sdz-match { font-size: 11px; padding: 3px 9px; border-radius: 12px; white-space: nowrap; }
.sdz-match.hi { color: var(--ok); background: var(--ok-bg); }
.sdz-match.mid { color: var(--gold-deep); background: var(--gold-wash); }
.sdz-match.low { color: var(--ink-3); background: var(--bg); }
.sdz-syn-bar { height: 3px; background: var(--line-2); border-radius: 2px; margin: 13px 0 16px; overflow: hidden; }
.sdz-syn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); }
.sdz-syn-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.sdz-syn-meta > div { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.65; }
.sdz-syn-meta.sdz-meta-1 { grid-template-columns: 1fr; gap: 8px; }
.sdz-syn-meta.sdz-meta-1 b { flex: 0 0 56px; }
.sdz-syn-meta b { color: var(--ink-4); font-weight: 400; flex: 0 0 54px; }
.sdz-hits { margin-top: 16px; padding-top: 13px; border-top: 1px dashed var(--line-2); }
.sdz-hits > b { font-size: 11.5px; color: var(--gold-deep); letter-spacing: .06em; }
.sdz-hit { display: flex; gap: 10px; font-size: 12px; line-height: 1.7; color: var(--ink-2); margin-top: 3px; }
.sdz-hit span { color: var(--ink-3); flex: 0 0 46%; }
.sdz-hit em { font-style: normal; }
.sdz-ext { padding: 16px 20px; }
.sdz-ext p { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.sdz-compose { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.sdz-redflag { background: var(--warn-bg); color: var(--warn); border-color: #E7CFC0; }
.sdz-result-side { display: flex; flex-direction: column; gap: 12px; }
.sdz-fang-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.sdz-fang-name {
  font-size: 18px; font-weight: 600; font-family: "Songti SC", "SimSun", serif; color: var(--ink); line-height: 1.4;
}
.sdz-fang-alt { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.sdz-fee { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.sdz-fee label { font-size: 12px; color: var(--ink-3); flex: 0 0 auto; }
.sdz-fee .input { height: 30px; padding: 0 8px; font-size: 13px; text-align: right; max-width: 110px; }
.sdz-others { padding: 16px 18px; }
.sdz-other {
  display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px;
  padding: 8px 2px; background: none; border: 0; border-bottom: 1px dashed var(--line-2);
  font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; text-align: left;
}
.sdz-other:last-child { border-bottom: 0; }
.sdz-other:hover { color: var(--gold-deep); }
.sdz-other em { font-style: normal; font-size: 11px; color: var(--ink-4); white-space: nowrap; }

/* 方剂弹窗 */
.sdz-modal .modal-body, .sdz-modal { max-height: 76vh; }
.sdz-fang-detail h3 {
  margin: 0 0 12px; font-size: 19px; font-family: "Songti SC", "SimSun", serif; font-weight: 600;
}
.sdz-fang-row { font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.sdz-fang-row b { color: var(--ink-4); font-weight: 400; margin-right: 8px; }
.sdz-fang-detail .table { margin-top: 12px; }
.sdz-fang-jie { margin-top: 14px; font-size: 12px; line-height: 1.8; color: var(--ink-2); }
.sdz-fang-jie b { display: block; color: var(--gold-deep); margin-bottom: 4px; }
.sdz-fang-jie p { margin: 0; }
.sdz-warn-inline { margin-top: 10px; font-size: 11.5px; color: var(--block); }

/* 就诊选择 */
.sdz-visit-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.sdz-visit {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card);
  font: inherit; cursor: pointer; text-align: left; transition: all .13s;
}
.sdz-visit:hover { border-color: var(--gold); background: var(--gold-wash); }
.sdz-visit-name { font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.sdz-visit-meta { font-size: 11.5px; color: var(--ink-3); flex: 0 0 auto; }
.sdz-visit-time { font-size: 11.5px; color: var(--ink-4); flex: 1 1 auto; text-align: right; }
.sdz-visit.on { border-color: var(--gold); background: var(--gold-wash); }

/* 当前患者条 */
.sdz-visitbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--bg);
}
.sdz-visitbar.on { border-style: solid; border-color: var(--gold-light); background: var(--gold-wash); }
.sdz-vb-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink-3); color: #fff; font-size: 13px;
  font-family: "Songti SC", "SimSun", serif;
}
.sdz-visitbar.on .sdz-vb-ico { background: var(--gold-solid); }
.sdz-vb-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.sdz-vb-main b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.sdz-vb-main > span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdz-visitbar .btn { flex: 0 0 auto; }

@media (max-width: 1100px) {
  .sdz-detail, .sdz-result { grid-template-columns: minmax(0, 1fr) 260px; }
  .sdz-ask { grid-template-columns: minmax(0, 1fr) 232px; }
  .sdz-syn-meta { grid-template-columns: 1fr; }
}

/* ---------- 触屏 / 平板适配 ---------- */
@supports (height: 100dvh) {
  .boot, .app { height: 100dvh; }
  .login-wrap { min-height: 100dvh; }
}

@media (pointer: coarse) {
  html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: contain; }
  body { touch-action: manipulation; overscroll-behavior-y: contain; }
  * { -webkit-tap-highlight-color: transparent; }
  .btn, .nav-item, .seg-btn, .tab { -webkit-user-select: none; user-select: none; }
  .btn { height: 38px; padding: 0 15px; font-size: 13.5px; }
  .btn.sm { height: 32px; padding: 0 11px; }
  .btn.icon, .btn.icon.sm { width: 36px; }
  .input, select.input, textarea.input { height: 38px; font-size: 16px; }
  textarea.input { padding: 8px 10px; }
  .table td, .table th { padding: 10px; }
  .view, .modal-bd, .rx-items, .nav-drop,
  .ws-col > .card > .card-bd { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .btn, .card, .nav-item, .table tbody tr { transition: none; }
  .btn:active, .nav-item:active { background: var(--gold-wash); }
  .modal { max-height: 90dvh; }
  .modal-bd { overscroll-behavior: contain; }
  .modal-ft { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 1280px) {
  .ws-body { grid-template-columns: 272px minmax(0, 1fr) 352px; }
  .ws-body.fd-min { grid-template-columns: 44px minmax(0, 1fr) 352px; }
  .ws-body.fd-hidden { grid-template-columns: minmax(0, 1fr) 352px; }
}

@media (max-width: 1120px) {
  .ws-body { grid-template-columns: 240px minmax(0, 1fr) 320px; gap: 6px; padding: 6px 8px 0; }
  .ws-body.fd-min { grid-template-columns: 40px minmax(0, 1fr) 320px; }
  .ws-body.fd-hidden { grid-template-columns: minmax(0, 1fr) 320px; }
  .modal.xl { width: 94vw; }
  .modal.wide { width: 88vw; }
  .home { grid-template-columns: minmax(0, 1fr) 264px; }
}

@media (orientation: portrait) and (max-width: 1000px) {
  .app::after {
    content: "建议横屏使用：开方区更宽，操作更顺手";
    position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%);
    background: rgba(40, 36, 30, .88); color: #fff; font-size: 12px; line-height: 1;
    padding: 8px 14px; border-radius: 999px; pointer-events: none; z-index: 200;
    white-space: nowrap;
  }
  .ws-body, .ws-body.fd-min, .ws-body.fd-hidden { grid-template-columns: minmax(0, 1fr); grid-auto-rows: min-content; overflow: auto; }
  .ws-body > .ws-col { height: auto; max-height: none; }
  .ws-body > .ws-col > .card { height: auto; }
  .home { grid-template-columns: minmax(0, 1fr); }
}

/* A5 处方笺打印：仅输出预览弹窗中的处方笺 */
@media print {
  /* 页边距为 0：Chromium 系浏览器不再绘制页眉页脚，版心留白由处方笺自身居中控制 */
  @page { size: A4 portrait; margin: 0; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#modal-root) { display: none !important; }
  #modal-root { display: block !important; }
  #modal-root .mask {
    display: block !important; position: static !important; inset: auto !important;
    padding: 0 !important; background: none !important; animation: none !important;
  }
  #modal-root .modal { display: none !important; }
  #modal-root .modal.print-a5 {
    display: block !important; width: auto !important; max-width: none !important; max-height: none !important;
    border: 0 !important; box-shadow: none !important; background: #fff !important; animation: none !important;
  }
  #modal-root .modal.print-a5 .modal-hd,
  #modal-root .modal.print-a5 .modal-ft { display: none !important; }
  #modal-root .modal.print-a5 .modal-bd {
    padding: 0 !important; overflow: visible !important; max-height: none !important;
  }
  #modal-root .modal.print-a5 .modal-bd > .tiny { display: none !important; }
  #modal-root .modal.print-a5 .a5-wrap {
    padding: 0 !important; background: none !important; border-radius: 0 !important; overflow: visible !important;
    max-width: none !important;
  }
  #modal-root .modal.print-a5 .a5 {
    width: 140mm !important; max-width: none !important; height: auto !important;
    /* A4 内容区 210×297：放大 1.38 后约 193.2×274.1，左右各留 8.4mm、上留 11.4mm */
    margin: 11.4mm 0 0 8.4mm !important;
    aspect-ratio: 148 / 210 !important; min-height: 0 !important;
    border: 0 !important; box-shadow: none !important;
    padding: 10px 14px 8px !important; overflow: hidden !important;
    transform: scale(1.38); transform-origin: top left;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  /* 打印时不受界面缩放影响 */
  :root, html.fs-large, html.fs-xlarge { --ui-scale: 1 !important; }
  #root.app, #modal-root .modal, #toast-root .toast { zoom: 1 !important; }
  #root.app { width: auto !important; height: auto !important; }
}

/* ---------------- 界面缩放（标准 / 加大 / 特大） ---------------- */
.fs-switch {
  display: flex; align-items: center; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; background: var(--paper); flex: 0 0 auto;
}
.fs-opt {
  border: 0; background: transparent; color: var(--ink-3); font-size: 12px;
  padding: 4px 8px; cursor: pointer; white-space: nowrap;
}
.fs-opt + .fs-opt { border-left: 1px solid var(--line); }
.fs-opt:hover { background: var(--gold-wash); color: var(--ink); }
.fs-opt.active { background: var(--gold-solid); color: #fff; }

#root.app {
  zoom: var(--ui-scale);
  width: 100%;
  height: calc(100vh / var(--ui-scale));
}
/* 登录页不跟随界面缩放 */
#root.app.login-mode { zoom: 1; height: 100vh; }
#modal-root .modal {
  zoom: var(--ui-scale);
  max-width: calc((100vw - 32px) / var(--ui-scale));
  max-height: calc((100vh - 32px) / var(--ui-scale));
}
#toast-root .toast { zoom: var(--ui-scale); }

/* 放大后有效画布变窄：收紧顶栏、导航可横向滚动 */
html.fs-large .org-tag,
html.fs-xlarge .org-tag { display: none; }
html.fs-large .brand-sub,
html.fs-xlarge .brand-sub { display: none; }
html.fs-large .nav,
html.fs-xlarge .nav { overflow-x: auto; scrollbar-width: thin; }
html.fs-xlarge .user-box > div:last-child { display: none; }
html.fs-large .topbar,
html.fs-xlarge .topbar { gap: 10px; }
html.fs-xlarge .topbar-right { gap: 6px; }

/* 缩放后的实际内容宽度自适应
   由 app.js 按 innerWidth / 缩放倍率 计算并打 lay-* 类，
   不依赖容器查询，兼容旧版浏览器 */
html.lay-md .ws-body { grid-template-columns: 240px minmax(0, 1fr) 320px; gap: 6px; padding: 6px 8px 0; }
html.lay-md .ws-body.fd-min { grid-template-columns: 40px minmax(0, 1fr) 320px; }
html.lay-md .ws-body.fd-hidden { grid-template-columns: minmax(0, 1fr) 320px; }
html.lay-md .home { grid-template-columns: minmax(0, 1fr) 264px; }

html.lay-sm .home { grid-template-columns: minmax(0, 1fr); }
/* 接诊页：中间区域滚动，底部统计栏固定 */
html.lay-sm .view.ws { overflow: hidden; }
html.lay-sm .ws-body,
html.lay-sm .ws-body.fd-min,
html.lay-sm .ws-body.fd-hidden {
  flex: 1 1 auto; min-height: 0; overflow: auto; grid-auto-rows: min-content;
}
html.lay-sm .ws-body > .ws-col { height: auto; max-height: none; min-height: 0; }
html.lay-sm .ws-body > .ws-col > .card { flex: 0 0 auto; height: auto; max-height: none; overflow: visible; }
html.lay-sm .ws-body > .ws-col > .card > .card-bd { flex: 0 0 auto; overflow: visible; }
/* 辨证推荐：取消内部定高滚动，改为随页面展开 */
html.lay-sm .mid-col > .card { overflow: visible; }
html.lay-sm .mid-body { flex: 0 0 auto; display: block; }
html.lay-sm .mid-pane.on { display: block; }
html.lay-sm .mid-body .pane-sym .ai-sym { flex: none; max-height: none; overflow: visible; }
html.lay-sm .pane-res .sy-list { flex: none; overflow: visible; }
html.lay-sm .mid-bar .ai-picked { max-height: 160px; overflow: auto; }
/* 临方开具：药味列表随页面展开 */
html.lay-sm .rx-items { flex: 0 0 auto; overflow: visible; }
html.lay-sm .exp-grid, html.lay-sm .exp-grid.four { grid-template-columns: 1fr; }
html.lay-sm .panel-grid.cols2, html.lay-sm .panel-grid.cols3 { grid-template-columns: 1fr; }

html.lay-xs .field-row.three { grid-template-columns: 1fr 1fr; }
html.lay-xs .ws-row1 { flex-wrap: wrap; }
html.lay-xs .page, html.lay-xs .home { padding: 10px; }

html.lay-xxs .field-row, html.lay-xxs .field-row.three { grid-template-columns: minmax(0, 1fr); }

/* 放大模式：三栏一行，中间区域滚动，底部「药味/剂数/合计/提交审方」固定在最下方 */
html.fs-large .ws-body,
html.fs-xlarge .ws-body {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  grid-template-columns: minmax(160px, 24%) minmax(0, 1fr) minmax(200px, 30%);
}
html.fs-large .ws-body.fd-min,
html.fs-xlarge .ws-body.fd-min {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  grid-template-columns: 40px minmax(0, 1fr) minmax(200px, 30%);
}
html.fs-large .ws-body.fd-hidden,
html.fs-xlarge .ws-body.fd-hidden {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 30%);
}
html.fs-large .ws-body > .ws-col,
html.fs-xlarge .ws-body > .ws-col { height: auto; max-height: none; min-height: 0; }
html.fs-large .ws-body > .ws-col > .card,
html.fs-xlarge .ws-body > .ws-col > .card { flex: 0 0 auto; height: auto; max-height: none; overflow: visible; }
html.fs-large .ws-body > .ws-col > .card > .card-bd,
html.fs-xlarge .ws-body > .ws-col > .card > .card-bd { flex: 0 0 auto; overflow: visible; }
html.fs-large .mid-col > .card,
html.fs-xlarge .mid-col > .card { overflow: visible; }
html.fs-large .mid-body,
html.fs-xlarge .mid-body { flex: 0 0 auto; display: block; }
html.fs-large .mid-pane.on,
html.fs-xlarge .mid-pane.on { display: block; }
html.fs-large .mid-body .pane-sym .ai-sym,
html.fs-xlarge .mid-body .pane-sym .ai-sym { flex: none; max-height: none; overflow: visible; }
html.fs-large .pane-res .sy-list,
html.fs-xlarge .pane-res .sy-list { flex: none; overflow: visible; }
html.fs-large .rx-items,
html.fs-xlarge .rx-items { flex: 0 0 auto; overflow: visible; }

/* 放大模式：药味行改两行，名称独占一行完整显示，控件在第二行 */
html.fs-large .rx-item,
html.fs-xlarge .rx-item { flex-wrap: wrap; align-items: flex-start; row-gap: 4px; }
html.fs-large .rx-item .hn,
html.fs-xlarge .rx-item .hn {
  flex: 1 1 calc(100% - 22px);
  white-space: normal; overflow: visible; text-overflow: clip;
  word-break: break-word; line-height: 1.45;
}
html.fs-large .rx-item .fn,
html.fs-xlarge .rx-item .fn { margin-left: 22px; }

