:root {
  --primary: #0d7a70;
  --primary-dark: #095e56;
  --primary-light: #e6f4f1;
  --bg: #f4f7f9;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #7b8794;
  --muted-strong: #5a6672;
  --disabled: #7d8a96;
  --border: #e3e9ee;
  --green: #178a5b;
  --green-bg: #e7f7ef;
  --red: #c0392b;
  --red-bg: #fdecea;
  --amber: #a56a00;
  --amber-bg: #fff4e0;
  --blue: #1a5fb4;
  --blue-bg: #e8f1fd;
  --gray: #6b7684;
  --gray-bg: #eef1f4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 42, 67, 0.04), 0 6px 20px rgba(16, 42, 67, 0.05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 232px;
  flex: 0 0 232px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: #fff;
  border-right: 1px solid var(--border);
  transition: width 0.1s ease, padding 0.1s ease;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand-mark {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #0f8b7e, #0a5c54);
  color: #fff; font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 14px rgba(13, 122, 112, 0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: 0.5px; }
.brand-text span { font-size: 9.5px; color: #9aa7b3; letter-spacing: 1.6px; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #4d5c6b;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.85; }
.nav-item:hover { background: #f3f8f7; color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.nav-item.active svg { opacity: 1; }

.sidebar-foot {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: #9aa7b3;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.sidebar-overlay { display: none; }

/* ---------- Collapsed sidebar（业务页图标栏，悬停展开） ---------- */
body.sidebar-collapsed .sidebar { width: 72px; flex-basis: 72px; padding: 20px 10px 16px; }
body.sidebar-collapsed .main { margin-left: 72px; }
body.sidebar-collapsed .brand { justify-content: center; padding: 2px 0 18px; gap: 0; }
body.sidebar-collapsed .brand-text { width: 0; opacity: 0; overflow: hidden; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; gap: 0; }
body.sidebar-collapsed .nav-item span { width: 0; opacity: 0; overflow: hidden; white-space: nowrap; }
body.sidebar-collapsed .sidebar-foot { display: none; }
body.sidebar-collapsed .sidebar:hover,
body.sidebar-collapsed .sidebar:focus-within {
  width: 232px; padding: 20px 14px 16px;
  box-shadow: 12px 0 28px rgba(12, 30, 40, 0.12);
}
body.sidebar-collapsed .sidebar:hover .brand { justify-content: flex-start; padding: 2px 8px 22px; gap: 11px; }
body.sidebar-collapsed .sidebar:hover .brand-text { width: auto; opacity: 1; }
body.sidebar-collapsed .sidebar:hover .nav-item { justify-content: flex-start; padding: 10px 12px; gap: 11px; }
body.sidebar-collapsed .sidebar:hover .nav-item span { width: auto; opacity: 1; }
body.sidebar-collapsed .sidebar:hover .sidebar-foot { display: flex; }
.brand-text, .nav-item span { transition: opacity 0.1s ease; }

/* ---------- Document workspace（左侧文档列表常驻） ---------- */
.doc-workspace { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 14px; align-items: start; }
.doc-main { min-width: 0; }
.doc-list {
  position: sticky; top: 84px;
  max-height: calc(100vh - 104px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.doc-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted);
}
.doc-list-head b { font-size: 12px; font-weight: 600; color: var(--text); }
.doc-list-nav { overflow-y: auto; padding: 4px; }
.doc-list-item { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 7px; }
.doc-list-item:hover { background: #f3f8f7; }
.doc-list-item.active { background: var(--primary-light); }
.doc-list-code { font-family: "Consolas", monospace; font-size: 10.5px; color: var(--muted); }
.doc-list-title { font-size: 12.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-list-item.active .doc-list-code { color: var(--primary-dark); }
.doc-list-item.active .doc-list-title { color: var(--primary-dark); font-weight: 600; }


/* ---------- Main / Topbar ---------- */
.main { flex: 1; min-width: 0; margin-left: 232px; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  min-height: 68px;
  padding: 10px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.page-heading { display: flex; flex-direction: column; min-width: 0; }
.page-kicker { font-size: 10.5px; letter-spacing: 1.4px; color: #9aa7b3; text-transform: uppercase; }
.page-heading h1 { font-size: 19px; font-weight: 700; letter-spacing: 0.3px; margin-top: 1px; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary-dark);
  font-weight: 700; font-size: 14px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta small { font-size: 11px; color: var(--muted); }
.top-link { font-size: 12.5px; color: var(--muted); }
.top-link:hover { color: var(--primary); }

.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 40px; }
.content > .card { margin-bottom: 14px; }
.content > .card:last-child { margin-bottom: 0; }

.icon-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: all 0.16s ease;
  background: transparent; color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 12px rgba(13, 122, 112, 0.18); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border); color: #4d5c6b; }
.btn-ghost:hover { background: #f8fbfc; border-color: #c9d6dd; color: var(--primary-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 5px 12px rgba(192, 57, 43, 0.18); }
.btn-danger:hover { background: #a53125; border-color: #a53125; color: #fff; }
.btn-danger-ghost { background: #fff; border-color: #f0d3cf; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn:disabled { opacity: 0.55; box-shadow: none; cursor: not-allowed; }
.btn-light { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.34); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }
.btn-block { width: 100%; height: 44px; font-size: 14px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }

.inline-form { display: inline-flex; margin: 0; }

/* ---------- Cards / layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-title { font-size: 16px; margin-bottom: 6px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 13px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.table-card { padding: 0; overflow: hidden; }
.setting-tabs { flex-wrap: wrap; gap: 8px; }

/* 试剂模块：预警条 / 工具栏链接 / 申请单入库行 */
.alert-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.alert-strip .badge { text-decoration: none; cursor: pointer; }
.toolbar-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inbound-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inbound-form input {
  padding: 5px 8px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
}
.inbound-form input[type="number"] { width: 96px; }
.inbound-form input[type="text"] { width: 150px; }
.inbound-form input[type="date"] { width: 142px; }
.inbound-form select.inbound-select {
  padding: 5px 6px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
  max-width: 118px;
}
/* 入库登记 · 试剂验证列：新批号提醒 / new 标识 / 关联验证单 */
.col-validation { min-width: 170px; }
.col-validation select.inbound-select {
  display: block; width: 100%; min-width: 160px; max-width: none; margin-top: 4px;
}
.lot-check { display: flex; flex-direction: column; gap: 3px; }
.lot-new-flag {
  display: inline-block; flex: none;
  background: #b45309; color: #fff;
  font-size: 10px; font-weight: 600; line-height: 1;
  padding: 3px 6px; border-radius: 999px;
}
.lot-warn {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  font-size: 12px; color: #92400e;
  background: #fef3c7; border: 1px solid #fcd34d; border-radius: 7px;
  padding: 5px 7px;
}
.lot-warn-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-items-table select, .req-items-table input {
  width: 100%; padding: 6px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
}

/* 批次明细展开行 */
.batch-row > td { background: #f7fafc; padding: 4px 10px 10px; }
.batch-table { margin: 0; }
.batch-table th, .batch-table td { padding: 5px 8px; font-size: 12.5px; }
.batch-depleted td { color: #9aa5b1; }
.batch-toggle { padding: 0 6px; line-height: 1.4; }

/* 出库弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 30, 45, 0.42);
  display: flex; align-items: center; justify-content: center;
}
/* hidden 属性的默认 display:none 会被上面的 display:flex 覆盖，需显式恢复 */
.modal-mask[hidden] { display: none; }
.modal-card {
  width: 380px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 18px 48px rgba(15, 40, 60, 0.25);
}
.modal-card.wide { width: 760px; max-height: calc(100vh - 60px); overflow-y: auto; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.modal-head h3 { font-size: 15px; margin: 0; }
.modal-close {
  border: none; background: transparent; font-size: 18px; line-height: 1;
  color: #7b8a97; cursor: pointer; padding: 4px 8px; border-radius: 7px;
}
.modal-close:hover { background: #f1f4f7; color: var(--text); }
.modal-body { display: grid; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.field-link { font-size: 11.5px; font-weight: 400; margin-left: 4px; }
.modal-info {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  margin: 0 0 12px; padding: 10px 12px;
  background: #f6f9fb; border: 1px solid var(--border); border-radius: 10px;
}
.modal-info div { display: flex; gap: 6px; font-size: 12.5px; }
.modal-info dt { color: #7b8a97; }
.modal-info dd { margin: 0; color: var(--text); }

/* 基础字典弹窗：三个字段自适应横排，宽度不足时自动折行 */
.dict-modal-card { width: 640px; max-width: calc(100vw - 32px); }
.dict-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
}
.dict-modal-error {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: #fdecec; border: 1px solid #f5c2c0; color: #b3261e;
  font-size: 12.5px;
}
.dict-modal-error[hidden] { display: none; }

/* 基础字典检索：方法学等长列表按名称即时过滤 */
.dict-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dict-search .input { max-width: 300px; }
.dict-search .muted { font-size: 12.5px; }

/* 批量导入说明：要点列表 + 折叠的字典取值 */
.import-tips {
  margin: 8px 0 4px; padding-left: 18px;
  color: #5b6670; font-size: 12.8px; line-height: 1.85;
}
.import-dicts { margin: 6px 0 4px; font-size: 12.8px; }
.import-dicts summary {
  cursor: pointer; color: #1a73a8; font-size: 12.8px;
  padding: 4px 0; user-select: none;
}
.import-dicts p { margin: 4px 0 0; }

/* 回收站清空确认弹窗 */
.purge-warning {
  margin: 0 0 6px; padding: 10px 12px; border-radius: 9px;
  background: #fdecec; border: 1px solid #f5c2c0; color: #8a1c15;
  font-size: 13px;
}
.purge-warning strong { color: #b3261e; }

/* 可搜索试剂选择器 */
.picker { position: relative; }
/* 申请明细表：固定列宽 + 不裁剪下拉面板（overflow-x:auto 会连带裁剪 overflow-y） */
.req-items-wrap { overflow: visible; }
.req-items-table { table-layout: fixed; width: 100%; }
.req-items-table td { vertical-align: top; }
.req-items-table .req-stock { padding-top: 12px; }
.picker-panel {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0;
  width: 100%; min-width: 300px;
  max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 10px 24px rgba(15, 40, 60, 0.12);
}
.picker-item {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 7px 10px; cursor: pointer; font-size: 13px; color: inherit;
}
.picker-item:hover { background: #eef4f7; }
.picker-sub { display: block; font-size: 11.5px; color: #7b8a97; margin-top: 1px; }
.picker-empty { padding: 10px; font-size: 12.5px; color: #8a97a5; }
.picker-more { padding: 6px 10px; font-size: 11.5px; border-top: 1px dashed var(--border); }

/* 模块内左侧二级菜单 */
.module-layout { display: flex; gap: 14px; align-items: flex-start; }
.subnav {
  width: 152px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; position: sticky; top: 76px;
}
.subnav-item {
  display: block; padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--text);
}
.subnav-item:hover { background: var(--primary-light); color: var(--primary); }
.subnav-item.active { background: var(--primary); color: #fff; }
.subnav-sub { margin: 2px 0 8px 12px; border-left: 2px solid var(--border); }
.subnav-sub a {
  display: block; padding: 5px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--muted);
}
.subnav-sub a:hover, .subnav-sub a.active { color: var(--primary); background: var(--primary-light); }
.module-main { flex: 1; min-width: 0; }

.export-form { display: flex; gap: 6px; align-items: center; }
.export-form select { width: 86px; }

/* 入库进度条 */
.progress {
  width: 100px; height: 6px; margin-top: 4px;
  background: #edf1f5; border-radius: 3px; overflow: hidden;
}
.progress span { display: block; height: 100%; background: var(--primary); }

@media (max-width: 960px) {
  .module-layout { flex-direction: column; }
  .subnav { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .subnav-sub { display: none; }
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filters .input { width: auto; height: 36px; padding: 0 12px; }
.filters .search { width: 290px; }
.toolbar > .muted { max-width: 640px; font-size: 12.5px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #5b6b7a; white-space: nowrap; }
.check input { accent-color: var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.table thead th {
  padding: 11px 14px;
  background: #f7fafb;
  border-bottom: 1px solid var(--border);
  color: #7b8794;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid #eef2f5; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfdfe; }
.table tbody tr.row-active { background: #eef5fb; }
.table tbody tr.row-active td { font-weight: 600; }
.split .table td { padding: 7px 10px; }
.table-link { color: var(--text); font-weight: 600; }
.table-link:hover { color: var(--primary); }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mono { font-family: "Consolas", "JetBrains Mono", monospace; font-size: 12.5px; color: #41505f; }

/* 试剂统计图表 */
.btn-group { display: inline-flex; gap: 4px; }
.chart-legend { display: inline-flex; gap: 12px; align-items: center; font-size: 12px; color: #52616f; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.chart-wrap { padding: 8px 6px 4px; }
.flow-chart { width: 100%; height: auto; max-height: 300px; display: block; }
.chart-tick { font-size: 10px; fill: #8a97a5; }
.chart-x { display: flex; justify-content: space-between; padding: 4px 20px 6px 38px; font-size: 11px; color: #8a97a5; }
.col-num { text-align: right; font-variant-numeric: tabular-nums; }
/* 显示顺序列：窄列居中，等宽数字 */
.col-order { width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.table thead th.col-order, .table tbody td.col-order { text-align: center; }
/* 表头默认左对齐（.table thead th），数字列表头需显式右对齐，否则与数值错位 */
.table thead th.col-num,
.table tbody td.col-num,
.table tfoot td.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table thead th.col-key,
.table tbody td.col-key,
.table tfoot td.col-key { text-align: left; }

/* 统计页：筛选条件栅格 + 图表类型切换 */
.toolbar-grid { justify-content: flex-start; gap: 10px 16px; margin-bottom: 12px; }
.toolbar-grid .field-inline {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
}
.toolbar-grid .field-inline > span {
  font-size: 12px; color: #5b6b7a; white-space: nowrap;
}
.toolbar-grid .input { width: auto; height: 34px; padding: 0 10px; }
.toolbar-grid select.input { min-width: 132px; max-width: 210px; }
.toolbar-grid input[type="date"] { width: 148px; }
.toolbar-split {
  justify-content: flex-start; gap: 12px; margin-bottom: 0;
  padding-top: 12px; border-top: 1px dashed var(--border);
}
.toolbar-split .toolbar-links { margin-left: auto; }
.stats-table { min-width: 700px; }
.stats-table tbody td.col-num { color: #41505f; }
.table tfoot td { border-top: 2px solid #d8dee5; background: #f7f9fa; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; white-space: nowrap; }
.row-actions form { margin: 0; }
/* 库存页批号验证状态列：徽标 + 快捷操作纵向排列 */
.batch-verify { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* 批量申请：明细区标题内的模板工具条 */
.tpl-bar { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; vertical-align: middle; flex-wrap: wrap; }
.tpl-bar .tpl-select { height: 30px; }

/* 物资目录「批量申请」提示条 */
.cart-tip {
  display: block; margin-bottom: 14px; padding: 10px 14px;
  border: 1px solid #d3e3f8; border-radius: 10px;
  background: var(--blue-bg); color: #1f4f7d; font-size: 12.5px; line-height: 1.7;
}

/* 申请清单浮动入口（物资模块各页右下角） */
.cart-fab {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
}
.cart-fab[hidden] { display: none; }
.cart-fab:hover { filter: brightness(1.05); color: #fff; }
.cart-fab b { background: rgba(255, 255, 255, 0.28); border-radius: 999px; padding: 1px 9px; }
/* 有清单时给页面留出底部空间，避免浮动入口盖住表格最后一行的操作按钮 */
body.has-cart .content { padding-bottom: 96px; }

/* 申请清单抽屉 */
.cart-sheet { width: 440px; max-width: calc(100vw - 32px); }
.cart-head-sum { margin-left: auto; margin-right: 8px; font-size: 12.5px; }
.cart-empty { margin: 0; padding: 26px 8px; text-align: center; color: var(--muted-strong); font-size: 13px; line-height: 1.8; }
.cart-empty[hidden] { display: none; }
.cart-lines { display: grid; gap: 8px; min-width: 0; }
.cart-line {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.cart-line-info { flex: 1 1 auto; min-width: 0; }
.cart-line-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-line-sub { font-size: 11.5px; color: var(--muted-strong); line-height: 1.6; }
.cart-qty-box { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.cart-step {
  width: 30px; height: 32px; border: 0; background: #f2f6f7; color: #40505f;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.cart-step:hover { background: #e6eef0; color: var(--primary); }
.cart-qty {
  width: 58px; height: 32px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text); background: #fff;
  -moz-appearance: textfield;
}
.cart-qty::-webkit-outer-spin-button, .cart-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-del {
  flex: 0 0 auto; border: 0; background: transparent; padding: 6px 4px;
  font-size: 12px; color: var(--muted-strong); cursor: pointer;
}
.cart-del:hover { color: var(--red); }
.cart-foot { justify-content: space-between; }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }
@media (max-width: 640px) {
  /* 手机端：清单项两行布局（物资一行、数量与删除一行），按钮放大到可点面积 */
  .cart-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); padding: 9px 14px; font-size: 13px; }
  .cart-line { flex-wrap: wrap; row-gap: 8px; padding: 10px; }
  .cart-line-info { flex: 1 1 100%; }
  .cart-line-name { white-space: normal; font-size: 13.5px; }
  .cart-qty-box { margin-right: auto; }
  .cart-step { width: 38px; height: 38px; font-size: 16px; }
  .cart-qty { width: 68px; height: 38px; font-size: 14px; }
  .cart-del { padding: 8px 6px; font-size: 12.5px; }
  .cart-empty { padding: 18px 6px; font-size: 12.5px; }
  .cart-foot .btn { min-height: 44px; }
}
.text-danger { color: var(--red); }

/* 页内分区标签（题库工作台等） */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #4d5c6b;
  background: #eef3f5; text-decoration: none; white-space: nowrap;
}
.tab:hover { background: #e2eef0; color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 3px 8px rgba(13, 122, 114, 0.28); }
.text-success { color: var(--green); }
.text-muted { color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* 文档状态自定义显示方式：实心 / 描边（浅色底为默认） */
.badge-style-solid { color: #fff; }
.badge-style-solid.badge-green { background: var(--green); }
.badge-style-solid.badge-amber { background: var(--amber); }
.badge-style-solid.badge-red { background: var(--red); }
.badge-style-solid.badge-blue { background: var(--blue); }
.badge-style-solid.badge-gray { background: var(--gray); }
.badge-style-outline { background: transparent; }
.badge-style-outline.badge-green { border: 1px solid var(--green); color: var(--green); }
.badge-style-outline.badge-amber { border: 1px solid var(--amber); color: var(--amber); }
.badge-style-outline.badge-red { border: 1px solid var(--red); color: var(--red); }
.badge-style-outline.badge-blue { border: 1px solid var(--blue); color: var(--blue); }
.badge-style-outline.badge-gray { border: 1px solid var(--gray); color: var(--gray); }

/* ---------- Forms ---------- */
.form-card { max-width: 1000px; }
.form-card.narrow { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.field.span-2 { grid-column: span 2; }
.form-card.dense .form-section-title:not(:first-child) { margin-top: 20px; }
.form-card.dense .form-section-title { padding-bottom: 8px; margin-bottom: 12px; }
.form-card.dense .form-actions { margin-top: 16px; padding-top: 12px; }
.form-card.dense .check-options { display: flex; gap: 12px 16px; flex-wrap: wrap; padding: 4px 0; }
.form-card.dense .check-options label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; font-weight: 600; color: #5b6b7a; }
.field em { color: var(--red); font-style: normal; }

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.field textarea { resize: vertical; min-height: 66px; }
textarea.settings-textarea {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.field input[type="file"] { padding: 8px 10px; background: #fbfdff; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 122, 112, 0.12);
}
.filters .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 122, 112, 0.1); }
.hint { font-size: 12px; color: var(--muted); margin: 0; }

/* 版本号：版次字母 / 修改次数（A/0） */
.version-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.version-picker { display: inline-flex; align-items: center; gap: 6px; }
.version-picker select { width: 78px; text-align: center; }
.version-picker input { width: 86px; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.version-slash { color: var(--muted); font-size: 15px; line-height: 1; }
.version-actions { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.version-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
.version-opt input[type="radio"] { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.version-note { width: 210px; padding: 6px 9px; font-size: 12.5px; }
.version-preview { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.version-preview b {
  margin-left: 4px; padding: 2px 8px; border-radius: 6px;
  background: #eef7f5; color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; font-weight: 600;
}
@media (max-width: 640px) {
  .version-note { width: 100%; }
}

/* 文档修改说明（版本管理/版本详情） */
.change-cell { min-width: 240px; max-width: 420px; }
.change-line { display: flex; gap: 6px; font-size: 12.5px; line-height: 1.6; color: var(--text); }
.change-line + .change-line { margin-top: 4px; }
.change-line > span:last-child { min-width: 0; word-break: break-word; }
.change-tag {
  flex: 0 0 auto; height: 18px; padding: 0 5px; border-radius: 4px;
  background: #eef7f5; color: var(--primary-dark);
  font-size: 11px; line-height: 18px;
}
.change-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.change-note-edit { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.change-note-edit > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary-dark);
}
.change-note-edit[open] > summary { margin-bottom: 14px; }
.extract-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.extract-row .hint { margin: 0; }

.form-section-title {
  padding-bottom: 10px;
  margin: 0 0 16px;
  border-bottom: 1px dashed var(--border);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.form-section-title:not(:first-child) { margin-top: 30px; }
.form-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.spacer { flex: 1; }
.readonly-value { padding: 9px 12px; border: 1px dashed var(--border); border-radius: 9px; background: #f6f9fb; font-family: "Consolas", monospace; font-size: 13px; }

.file-current {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: #f8fbfc;
  font-size: 13px;
}
.file-current svg { color: var(--primary); flex: 0 0 auto; }
.file-current .top-link { margin-left: auto; }

/* ---------- Empty / flash ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 34px 20px;
  color: var(--muted); font-size: 13px;
}
.empty.compact { padding: 22px 16px; gap: 4px; }
.empty p { margin: 0; }
.empty svg { color: #c5d1da; }

.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.flash.is-hiding { opacity: 0; transform: translateY(-4px); }
.flash-success { background: var(--green-bg); border-color: #c8ebd8; color: #126b48; }
.flash-error { background: var(--red-bg); border-color: #f5cfc9; color: #a92f22; }
.flash-info { background: var(--blue-bg); border-color: #d3e3f8; color: var(--blue); }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 26px 28px;
  border-radius: 16px;
  background: linear-gradient(120deg, #0b6b63, #0f8b7e 55%, #31a79a);
  color: #fff;
  box-shadow: 0 14px 30px rgba(13, 110, 100, 0.22);
  margin-bottom: 18px;
}
.hero::before,
.hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.hero::before { width: 240px; height: 240px; right: -70px; top: -110px; }
.hero::after { width: 160px; height: 160px; right: 130px; bottom: -100px; background: rgba(255, 255, 255, 0.07); }
.hero-date { font-size: 12px; letter-spacing: 0.8px; color: rgba(255, 255, 255, 0.75); }
.hero h2 { font-size: 23px; margin: 5px 0 7px; }
.hero-sub { max-width: 640px; font-size: 13px; color: rgba(255, 255, 255, 0.82); }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-shrink: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 42, 67, 0.1); color: var(--text); }
.stat-icon {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
}
.stat-icon svg { width: 22px; height: 22px; }
.accent-green .stat-icon { background: var(--green-bg); color: var(--green); }
.accent-teal .stat-icon { background: var(--primary-light); color: var(--primary); }
.accent-blue .stat-icon { background: var(--blue-bg); color: var(--blue); }
.accent-amber .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-body { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; min-width: 0; }
.stat-label { width: 100%; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat-body strong { font-size: 25px; line-height: 1.1; font-weight: 700; }
.stat-unit { font-size: 12px; color: var(--muted); }
/* 紧凑统计卡：小比例一行展示（台账 / 工作台通用） */
.stat-grid.compact { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
.stat-grid.compact .stat-card { padding: 10px 12px; gap: 10px; border-radius: 11px; }
.stat-grid.compact .stat-icon { width: 32px; height: 32px; border-radius: 9px; }
.stat-grid.compact .stat-icon svg { width: 16px; height: 16px; }
.stat-grid.compact .stat-label { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-grid.compact .stat-body strong { font-size: 17px; }
.stat-grid.compact .stat-unit { font-size: 11px; }
.accent-red .stat-icon { background: var(--red-bg, #fdecec); color: var(--red, #c0392b); }

.alert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.alert-card { padding: 18px 20px; }
.alert-card .card-head { margin-bottom: 4px; padding-bottom: 11px; }
.alert-list { display: flex; flex-direction: column; }
.alert-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed #edf1f4;
  color: var(--text);
}
.alert-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.alert-row:hover .alert-main strong { color: var(--primary); }
.alert-main { display: flex; flex-direction: column; min-width: 0; }
.alert-main strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-main .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row .badge { flex: 0 0 auto; }

/* 主页分区标题（待办任务 / 资源概览） */
.section-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 2px 0 10px; }
.section-title:not(:first-child) { margin-top: 22px; }
.task-grid { margin-bottom: 0; }

/* ---------- Detail pages ---------- */
.detail-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.detail-head h2 { font-size: 22px; margin: 2px 0 2px; }
.detail-head .muted { font-size: 13px; }
.back-link { display: inline-block; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.back-link:hover { color: var(--primary); }
.detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-actions form { margin: 0; }
.archive-body { display: flex; gap: 20px; align-items: flex-start; }
.archive-body .info-grid { flex: 1; }
.archive-image img { max-width: 200px; max-height: 160px; border-radius: 8px; border: 1px solid var(--border, #e5e9ee); object-fit: cover; }

.stock-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, #fff, #f3fbf8);
}
.stock-main { display: flex; flex-direction: column; gap: 2px; }
.stock-value { font-size: 34px; font-weight: 700; line-height: 1.2; color: var(--primary); }
.stock-value.is-low { color: var(--red); }
.stock-unit { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.stock-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stock-meta {
  display: flex; gap: 10px 26px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: #4d5c6b;
}
.stock-meta span { display: inline-flex; align-items: center; gap: 6px; }
.stock-meta em { font-style: normal; color: var(--muted); }

/* 试剂验证（新批号放行验证） */
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.summary-item {
  display: flex; flex-direction: column; gap: 2px;
  background: #f7fafc; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.summary-item .label { font-size: 12px; color: var(--muted); }
.summary-item strong { font-size: 20px; line-height: 1.25; font-weight: 700; }
.summary-item .unit { font-size: 12px; color: var(--muted); }
.summary-flags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.validation-block { margin-bottom: 14px; }
.validation-block:last-child { margin-bottom: 0; }
.validation-block h4 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.text-pre { white-space: pre-line; margin: 0; font-size: 13px; line-height: 1.75; color: #33424f; }
.validation-live {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-top: 10px; padding: 10px 12px;
  background: #f6f9fb; border: 1px solid var(--border); border-radius: 9px;
  font-size: 12.5px; color: #4d5c6b;
}
.validation-live strong { font-size: 14px; color: var(--text); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 22px; }
.info-grid > div { min-width: 0; }
.info-grid .wide { grid-column: 1 / -1; }
.info-grid dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.info-grid dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.info-grid.dense { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
.info-grid.dense dt { font-size: 10.5px; margin-bottom: 1px; }
.info-grid.dense dd { font-size: 12px; }

/* 设备档案：基本信息按编号分块的紧凑表格 */
.archive-blocks { display: flex; flex-direction: column; gap: 13px; }
.archive-block-title {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 5px; font-size: 12.5px; font-weight: 700; color: var(--primary-dark);
}
.info-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.info-table th, .info-table td {
  border: 1px solid var(--border); padding: 3.5px 8px;
  font-size: 12.5px; line-height: 1.5; text-align: left; vertical-align: top;
}
.info-table th {
  width: 88px; background: #f7fafb; color: var(--muted);
  font-weight: 400; white-space: nowrap;
}
.info-table td { color: var(--text); word-break: break-word; }
.info-table th.is-blank, .info-table td.is-blank { background: #fcfdfe; }
.info-image-cell img {
  max-width: 240px; max-height: 150px; border-radius: 6px;
  border: 1px solid var(--border); object-fit: cover;
}

/* 人员档案基本信息：左侧相片 + 右侧表格 */
.info-sheet { display: flex; gap: 16px; align-items: flex-start; }
.info-photo { flex: none; width: 116px; margin: 0; text-align: center; }
.info-photo img {
  width: 116px; height: 148px; object-fit: cover; display: block;
  border: 1px solid var(--border); border-radius: 8px; background: #f3f7f9;
}
.info-photo-empty {
  display: flex; align-items: center; justify-content: center;
  width: 116px; height: 148px; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--muted); font-size: 12px;
}
.info-photo figcaption { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #5b6b7a; }
.info-table { flex: 1; min-width: 0; border-collapse: collapse; font-size: 13px; }
.info-table th, .info-table td { border: 1px solid var(--border); padding: 8px 11px; text-align: left; vertical-align: middle; }
.info-table th { width: 92px; background: #f7fafb; color: #7b8794; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.info-table td { word-break: break-word; }
@media (max-width: 720px) { .info-sheet { flex-direction: column; } }

.photo-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-upload img {
  width: 88px; height: 112px; object-fit: cover; display: block;
  border: 1px solid var(--border); border-radius: 8px; background: #f3f7f9;
}
.photo-upload input[type=file] { flex: 1; min-width: 200px; }

/* 试剂档案：图片墙（多张展示） */
.reagent-gallery { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.gallery-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.gallery-head h4 { margin: 0 0 2px; font-size: 13.5px; }
.gallery-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gallery-upload input[type=file] { min-width: 220px; max-width: 320px; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.gallery-item {
  position: relative; margin: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px; background: #f7fafb;
}
.gallery-item img { width: 100%; height: 130px; object-fit: cover; display: block; }
.gallery-item figcaption {
  padding: 6px 8px; font-size: 11.5px; color: #4a5568;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-item figcaption span { display: block; color: #97a1ad; font-size: 10.5px; }
.gallery-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: rgba(20, 30, 40, .55);
  color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}
.gallery-del:hover { background: #c0392b; }
.gallery-empty {
  grid-column: 1 / -1; padding: 18px; text-align: center;
  border: 1px dashed var(--border); border-radius: 10px;
}
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
.rich-text { font-size: 13.5px; line-height: 1.75; word-break: break-word; }
.rich-text p { margin: 2px 0 6px; }
.rich-text ul, .rich-text ol { margin: 2px 0 6px 20px; padding: 0; }
.rich-text h1, .rich-text h2, .rich-text h3 { margin: 8px 0 4px; font-size: 14px; }
.rich-text table { border-collapse: collapse; }
.rich-text table td, .rich-text table th { border: 1px solid #d1d5db; padding: 4px 6px; }
.rich-text img { max-width: 100%; height: auto; }

.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 14px; margin-top: 14px; margin-bottom: 14px; align-items: start; }
.split > .card { min-width: 0; }
.head-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 7px;
  background: #f6f9fb; border: 1px solid var(--border);
  font-size: 12px; color: #4d5c6b;
}
.inline-record-form { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px dashed var(--border); }
.inline-record-form .form-actions { margin-top: 14px; padding-top: 12px; }

/* ---------- Documents ---------- */
.form-card-wide { max-width: 1120px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-topbar { display: flex; justify-content: flex-start; margin-bottom: 4px; }
.form-grid.compact { gap: 10px 14px; }
.field.span-2 { grid-column: span 2; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; }
.th-sort:hover { color: var(--primary); }
.sort-mark { font-size: 9px; color: var(--primary); }
.import-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.import-row .field { flex: 1 1 320px; }
.body-editor {
  font-family: "Consolas", "Microsoft YaHei", monospace;
  font-size: 13px; line-height: 1.75;
  min-height: 300px; resize: vertical; white-space: pre-wrap;
}

/* ---------- 富文本编辑器 ---------- */
.rte {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.rte-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px 8px;
  background: #f6f9fb;
  border-bottom: 1px solid var(--border);
}
/* 覆盖 .field input/select 的整行样式，避免工具栏控件被撑满 */
.rte .rte-ctrl {
  width: auto; height: 28px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 12.5px; font-family: inherit; color: var(--text);
  outline: none;
}
.rte .rte-ctrl:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 122, 112, 0.12); }
.rte-btn {
  min-width: 30px; height: 28px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text);
  font-size: 13px; cursor: pointer; line-height: 1;
}
.rte-btn:hover { background: #e8eef3; border-color: var(--border); }
.rte-btn:active { background: #dbe7ef; }
.rte-btn b { font-weight: 700; }
.rte-btn i { font-style: italic; }
.rte-btn u { text-decoration: underline; }
.rte-btn s { text-decoration: line-through; }
.rte-color {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent;
}
.rte-color:hover { background: #e8eef3; border-color: var(--border); }
.rte-letter { font-size: 14px; font-weight: 700; line-height: 1; }
.rte-swatch {
  display: block; width: 14px; height: 14px; border-radius: 3px;
  background: #f59e0b; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.rte .rte-color input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; margin: 0; border: none; border-radius: 6px;
  background: transparent; opacity: 0; cursor: pointer;
}
.rte-bg span { color: #f59e0b; }
.rte-sep {
  width: 1px; height: 18px; background: var(--border); margin: 0 2px;
}
.rte-editor {
  min-height: 320px; max-height: 560px; overflow: auto;
  padding: 12px 16px;
  font-size: 14px; line-height: 1.8; color: var(--text);
  outline: none;
}
.rte-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.rte-editor img { max-width: 100%; height: auto; }
.rte-editor table { border-collapse: collapse; }
.rte-editor table td, .rte-editor table th { border: 1px solid #d1d5db; padding: 4px 6px; }

.doc-body {
  word-break: break-word;
  font-size: 13.8px; line-height: 1.85; color: var(--text);
  max-height: 640px; overflow: auto;
  padding: 2px;
}
.doc-body img { max-width: 100%; height: auto; }
.doc-body table { border-collapse: collapse; width: 100%; }
.doc-body table td, .doc-body table th { border: 1px solid #d1d5db; padding: 4px 6px; }
.doc-body p { margin: 0 0 8px; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body ul, .doc-body ol { margin: 0 0 8px; padding-left: 24px; }
.doc-body li { margin: 2px 0; }
.doc-body h1, .doc-body h2, .doc-body h3 { margin: 12px 0 6px; font-size: 15px; }
.doc-body a { color: var(--primary); }
.preview-host { margin-top: 12px; }
.preview-frame {
  width: 100%; height: 560px; margin-top: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #f8fbfc;
}
.preview-img { display: block; margin-top: 12px; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; }

/* 文档信息：紧凑单行拼接展示 */
.doc-meta { padding: 8px 14px; }
.doc-meta-line {
  display: flex; align-items: center; flex-wrap: wrap;
  font-size: 12.5px; line-height: 1.45; color: var(--text);
}
.doc-meta-line + .doc-meta-line { margin-top: 2px; }
.doc-meta-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.doc-meta-item + .doc-meta-item::before { content: "·"; color: #c6d0d9; margin: 0 7px; }
.doc-meta-label { color: var(--muted); font-size: 11.5px; }
.doc-meta .mono { font-size: 12px; }
.doc-meta .badge { height: 18px; padding: 0 6px; font-size: 10.5px; }

/* ---------- 文档基本信息表格 ---------- */
.meta-card { padding: 0; overflow: hidden; }
/* 页眉（元信息卡）展开/折叠头部 */
.meta-card-head {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 5px 10px;
  background: #f6f9fb;
  border-bottom: 1px solid var(--border);
}
.meta-card-head .btn { height: 26px; padding: 0 12px; font-size: 12px; }
.meta-card-body.is-collapsed { display: none; }
.meta-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-size: 12.5px;
}
.meta-table th,
.meta-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}
.meta-table th {
  width: 88px;
  background: #f6f9fb;
  color: #5b6b7a;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.meta-table tr:first-child th,
.meta-table tr:first-child td { border-top: none; }
.meta-table th:first-child,
.meta-table td:first-child { border-left: none; }
.meta-table th:last-child,
.meta-table td:last-child { border-right: none; }
.meta-table tr:last-child th,
.meta-table tr:last-child td { border-bottom: none; }
.meta-table .mono { font-size: 12.5px; }
.meta-table .badge { height: 18px; padding: 0 6px; font-size: 10.5px; }

/* 编辑表单：基本信息区更紧凑 */
.form-grid.compact { gap: 8px 10px; }
.form-grid.compact .field { gap: 3px; }
.form-grid.compact .field > span { font-size: 12px; }
.form-grid.compact .field input,
.form-grid.compact .field select { height: 32px; padding: 0 9px; font-size: 12.5px; }
.form-grid.compact .field textarea { padding: 6px 9px; font-size: 12.5px; }
/* 宽屏下基本信息改为 6 列，正好两排 */
@media (min-width: 1180px) {
  .form-grid.cols-6.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .form-grid.cols-3.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 文档文件夹树形浏览 ---------- */
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 文件夹树 + 右侧文档面板 */
.doc-tree-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 14px; align-items: start; }
.tree-panel {
  position: sticky; top: 84px;
  max-height: calc(100vh - 104px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.tree-head { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex: 1 1 auto; min-height: 0; }
.tree-head-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
/* 文件夹树整体折叠：头部行可点击 + 树体（下拉/操作/滚动区）包在可折叠容器内 */
.tree-head-toggle {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 2px 0;
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 11.5px; color: var(--muted);
  text-align: left;
}
.tree-head-toggle b { font-size: 12px; font-weight: 600; color: var(--text); }
.tree-head-toggle:hover b { color: var(--primary-dark); }
.tree-head-toggle .chev { width: 13px; height: 13px; color: var(--muted); }
.tree-head-toggle.is-open .chev { transform: rotate(180deg); }
.tree-body { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; }
.tree-head-row b { font-size: 12px; font-weight: 600; color: var(--text); }
.tree-select {
  width: 100%; height: 30px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 7px;
  background: #fbfdfe; color: var(--text); font-family: inherit; font-size: 12.5px;
}
.tree-select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(13, 122, 112, 0.1); }
.tree-head-actions { display: flex; gap: 10px; }
.tree-head-actions button {
  padding: 0; border: 0; background: transparent;
  color: var(--primary); font-family: inherit; font-size: 11.5px; cursor: pointer;
}
.tree-head-actions button:hover { color: var(--primary-dark); text-decoration: underline; }
.tree-scroll { flex: 1; overflow-y: auto; padding: 4px; }
.tree-folder-head {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 6px 8px;
  border: 0; border-radius: 7px; background: transparent;
  color: #41505f; font-family: inherit; font-size: 12.5px; font-weight: 600;
  text-align: left; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.tree-folder-head:hover { background: #f3f8f7; color: var(--primary-dark); }
.chev { width: 12px; height: 12px; flex: 0 0 auto; color: #9aa7b3; transition: transform 0.15s ease; }
.tree-folder.collapsed > .tree-folder-head .chev { transform: rotate(-90deg); }
.folder-ico { width: 15px; height: 15px; flex: 0 0 auto; color: var(--primary); }
.tree-folder-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-count {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 500; color: var(--muted);
  background: #f1f5f7; border-radius: 999px; padding: 0 6px;
}
.tree-folder.collapsed > .tree-children { display: none; }
.tree-children {
  display: flex; flex-direction: column; gap: 1px;
  margin-left: 15px; padding-left: 8px;
  border-left: 1px dashed #e4ebef;
}
.tree-file {
  display: flex; flex-direction: column; gap: 1px;
  padding: 5px 8px; border-radius: 6px;
  color: var(--text);
  transition: background 0.16s ease;
}
.tree-file:hover { background: #f3f8f7; color: var(--text); }
.tree-file.active { background: var(--primary-light); }
.tree-file-code { font-family: "Consolas", monospace; font-size: 10px; color: var(--muted); }
.tree-file-title { font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-file.active .tree-file-code { color: var(--primary-dark); }
.tree-file.active .tree-file-title { color: var(--primary-dark); font-weight: 600; }
.tree-empty { padding: 5px 8px; font-size: 11.5px; color: #9aa7b3; }
.tree-folder.tree-flash > .tree-folder-head { background: var(--primary-light); }
.tree-folder.selected > .tree-folder-head { background: var(--primary-light); color: var(--primary-dark); }
.tree-folder.selected .tree-folder-name { font-weight: 700; }

.doc-view { min-width: 0; transition: opacity 0.15s ease; }
.doc-view.is-loading { opacity: 0.5; pointer-events: none; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.panel-title { min-width: 0; }
.panel-title h2 { font-size: 20px; line-height: 1.3; }
.panel-title .muted { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; margin-top: 2px; }
.panel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel-actions form { margin: 0; }
.doc-view .card { margin-bottom: 12px; }
.doc-view .card:last-child { margin-bottom: 0; }
.panel-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 360px;
  border: 1px dashed #d7e2e8; border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted); font-size: 13px;
}
.panel-placeholder svg { color: #c5d1da; }
.panel-placeholder.is-error { border-color: #f0d3cf; background: #fff; color: var(--red); }
.result-list { display: flex; flex-direction: column; gap: 6px; }
.result-item {
  display: block; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.result-item:hover { border-color: #bfd6d2; background: #f8fbfa; color: var(--text); }
.result-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.result-code { flex: 0 0 auto; font-family: "Consolas", monospace; font-size: 10.5px; color: var(--muted); }
.result-title {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-badge { flex: 0 0 auto; }
.result-meta {
  display: flex; flex-wrap: wrap; gap: 3px 14px;
  margin-top: 3px; font-size: 11.5px; color: var(--muted);
}
.result-empty {
  padding: 22px 10px; text-align: center;
  color: var(--muted); font-size: 12.5px;
  border: 1px dashed var(--border); border-radius: 10px; background: #fff;
}

/* 文档浏览快捷导航：上一份 / 下一份 / 所有文档 / 上级目录
   顶/底两个实例：桌面只显示顶部内联胶囊组；手机只显示内容末尾的吸底条。
   sticky bottom 只能固定「自然位置在视口下方」的元素，故吸底实例必须渲染在内容末尾。 */
.doc-quicknav { display: flex; margin-bottom: 12px; }
.doc-quicknav--bottom { display: none; }
.quicknav-group {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
}
.quicknav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 10px; border-radius: 7px;
  color: var(--text); font-size: 12.5px; white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}
.quicknav-btn:hover { background: #f3f8f7; color: var(--primary-dark); }
.quicknav-btn.is-disabled { color: #c2ccd4; cursor: default; }
.quicknav-btn.is-disabled:hover { background: transparent; color: #c2ccd4; }
.quicknav-btn svg { flex: 0 0 auto; }
.quicknav-pos { font-size: 12px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.quicknav-sep { width: 1px; height: 16px; background: var(--border); margin: 0 3px; }
.quicknav-up { color: var(--primary-dark); background: var(--primary-light); }
.quicknav-up:hover { background: #d8ece8; color: var(--primary-dark); }

@media (max-width: 960px) {
  .doc-quicknav--top { display: none; }
  .doc-quicknav--bottom {
    display: block;
    position: sticky; bottom: 0; z-index: 20;
    margin: 12px -16px 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .doc-quicknav--bottom .quicknav-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    width: 100%; gap: 0;
    padding: 0; border: none; border-radius: 0; background: transparent;
  }
  .doc-quicknav--bottom .quicknav-btn,
  .doc-quicknav--bottom .quicknav-pos {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    height: 52px; padding: 0 2px;
    border-radius: 0;
    font-size: 10.5px; line-height: 1.2;
    white-space: nowrap;
  }
  .doc-quicknav--bottom .quicknav-btn { flex: none; }
  .doc-quicknav--bottom .quicknav-btn svg { width: 17px; height: 17px; }
  /* 竖排时统一图标在上，避免「下一份」出现文字在上、箭头在下的错位 */
  .doc-quicknav--bottom .quicknav-next svg { order: -1; }
  .doc-quicknav--bottom .quicknav-sep { display: none; }
  .doc-quicknav--bottom .quicknav-pos {
    font-size: 12.5px; font-weight: 500; color: var(--text);
  }
  .doc-quicknav--bottom .quicknav-pos::after {
    content: "位置"; font-size: 10.5px; font-weight: 400; color: var(--muted);
  }
  .doc-quicknav--bottom .quicknav-up { background: transparent; }
}

.preview-card { padding: 14px; }.preview-card .preview-frame { margin-top: 0; }
.preview-card .preview-img { margin-top: 0; }
.panel-placeholder p { margin: 0; }

/* 文件夹管理页 */
.inline-folder-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.inline-folder-form .input { max-width: 340px; height: 36px; }
.folder-table th.col-drag { width: 34px; }
.col-drag { cursor: grab; color: #b8c4cd; }
.drag-handle { display: inline-flex; align-items: center; }
.folder-sort-row.dragging { opacity: 0.45; }
.folder-sort-row.drag-over td { border-top: 2px solid var(--primary); }
.col-order { width: 118px; }
.folder-table select.input { min-width: 110px; max-width: 130px; height: 34px; padding: 4px 8px; }
.order-input { width: 88px; height: 30px; padding: 0 8px; }
.folder-name { font-weight: 600; }
.folder-save-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--border); background: #fbfdfe;
}
.hidden-form { display: none; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(31, 167, 154, 0.25), transparent 60%),
    radial-gradient(700px 500px at 92% 92%, rgba(26, 95, 180, 0.18), transparent 60%),
    linear-gradient(135deg, #08262d, #0b4f4c 55%, #106b61);
}
.login-wrap {
  display: grid; grid-template-columns: 1.12fr 0.88fr;
  width: 100%; max-width: 1000px; min-height: 560px;
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.login-brand {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 46px;
  background: linear-gradient(150deg, #0b4f4a, #0d7a70 62%, #1a9c8d);
  color: #fff;
}
.login-logo {
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 26px; font-weight: 700;
}
.login-brand h1 { font-size: 27px; margin-bottom: 8px; }
.login-sub { color: rgba(255, 255, 255, 0.82); margin-bottom: 28px; font-size: 14px; }
.login-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: rgba(255, 255, 255, 0.9); }
.login-points li { position: relative; padding-left: 20px; }
.login-points li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #7ff0d9; box-shadow: 0 0 0 4px rgba(127, 240, 217, 0.18);
}
.login-foot { margin-top: 32px; font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 52px 46px; }
.login-card h2 { font-size: 22px; margin-bottom: 4px; }
.login-card > .muted { margin-bottom: 20px; font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.login-card .btn-block { margin-top: 6px; }
.login-card .flash-stack { margin-bottom: 4px; }

/* ---------- Error ---------- */
.error-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef4f5, #f7fafb);
}
.error-card {
  max-width: 480px; width: 100%;
  padding: 48px 40px; text-align: center;
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(16, 42, 67, 0.1);
}
.error-code { font-size: 64px; font-weight: 800; line-height: 1; color: var(--primary); margin-bottom: 12px; }
.error-card h1 { font-size: 19px; margin-bottom: 10px; }
.error-card .muted { font-size: 13px; margin-bottom: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-workspace { grid-template-columns: 200px minmax(0, 1fr); }
  .doc-tree-layout { grid-template-columns: 232px minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 12px 0 30px rgba(12, 30, 40, 0.14);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(12, 30, 40, 0.42);
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .sidebar-overlay.show { opacity: 1; visibility: visible; }
  .main { margin-left: 0; }
  body.sidebar-collapsed .sidebar,
  body.sidebar-collapsed .sidebar:hover,
  body.sidebar-collapsed .sidebar:focus-within {
    width: 232px; padding: 20px 14px 16px;
    box-shadow: 12px 0 30px rgba(12, 30, 40, 0.14);
  }
  body.sidebar-collapsed .main { margin-left: 0; }
  body.sidebar-collapsed .brand { justify-content: flex-start; padding: 2px 8px 22px; gap: 11px; }
  body.sidebar-collapsed .brand-text { width: auto; opacity: 1; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 10px 12px; gap: 11px; }
  body.sidebar-collapsed .nav-item span { width: auto; opacity: 1; }
  body.sidebar-collapsed .sidebar-foot { display: flex; }
  .doc-workspace { grid-template-columns: 1fr; }
  .doc-list { position: static; max-height: 200px; }
  .doc-tree-layout { grid-template-columns: 1fr; }
  .tree-panel { position: static; max-height: 280px; }
  .doc-view .preview-frame { height: 460px; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .content { padding: 18px 16px 34px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero-actions { width: 100%; }
  .alert-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid.cols-6 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .import-row { flex-direction: column; align-items: stretch; }
  .preview-frame { height: 380px; }
  .doc-view .preview-frame { height: 340px; }
  .toolbar-right { width: 100%; }
  .toolbar-right .btn { flex: 1; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid.dense { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  /* 紧凑卡片（主页待办 / 台账统计）固定两列，避免 3+1 参差对不齐 */
  .stat-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid.compact .stat-card { padding: 9px 10px; gap: 8px; }
  .stat-grid.compact .stat-icon { width: 28px; height: 28px; border-radius: 8px; }
  .stat-grid.compact .stat-icon svg { width: 14px; height: 14px; }
  /* 首页按钮均分宽度 */
  .hero-actions .btn { flex: 1 1 0; justify-content: center; }
  /* 提醒行：标题独占一行、状态标签换行到下一行，长标签不再挤压标题 */
  .alert-row { flex-wrap: wrap; row-gap: 5px; }
  .alert-main { flex: 1 1 100%; }
  .alert-row .badge { margin-left: 0; }
  .toolbar { align-items: stretch; }
  .filters { width: 100%; }
  .filters .search { width: 100%; }
  .filters .input { flex: 1 1 130px; width: auto; }
  .toolbar > .btn { width: 100%; }
  /* 卡片头部的小按钮（筛选 chips / 月份切换等）保持横排自动换行，不纵向堆叠 */
  .card-head { flex-wrap: wrap; }
  .card-head .toolbar { flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
  .card-head .toolbar > .btn { width: auto; min-height: 34px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .top-link { display: none; }
  .user-meta small { display: none; }
  .page-kicker { display: none; }
  .page-heading h1 { font-size: 17px; }
  .detail-head { align-items: flex-start; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .stock-panel { align-items: flex-start; }
  .login-wrap { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { padding: 30px 26px; }
  .login-points { display: none; }
  .login-foot { display: none; }
  .login-card { padding: 30px 26px; }
  .login-body { padding: 14px; }
}

/* ---------- 人员管理模块 ---------- */
[hidden] { display: none !important; }
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-item {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 7px; border: 1px solid var(--border); border-radius: 8px;
  background: #f8fbfc; font-size: 12.5px;
}
.file-item .sub { font-size: 11.5px; }
.file-item .file-name {
  max-width: 170px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: inline-block; vertical-align: middle;
}
.auto-upload { display: inline-flex; align-items: center; gap: 4px; }
.auto-upload input[type=file] { max-width: 168px; font-size: 12px; }

/* 档案条目：信息按字段拆列 + 附件紧凑横向 */
.record-table { min-width: 0; }
.record-table thead th { padding: 7px 9px; font-size: 11.5px; }
.record-table tbody td { padding: 6px 9px; font-size: 12.5px; }
.record-table .nowrap { white-space: nowrap; }
.record-table .col-actions { width: 1%; }
.attach-cell { width: 1%; white-space: nowrap; }
.record-files { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.record-files .auto-upload { flex: 0 0 auto; margin: 0; }
.record-files .auto-upload input[type=file] { width: 118px; max-width: 118px; font-size: 11px; }
.record-files .file-list {
  flex: 1 1 auto; min-width: 0; flex-direction: row; flex-wrap: wrap;
  align-items: center; gap: 4px;
}
.record-files .file-item {
  padding: 2px 5px; gap: 3px; flex-wrap: nowrap;
  border-radius: 6px; font-size: 11.5px;
}
.record-files .file-item .file-name { max-width: 96px; font-size: 11.5px; }
.record-files .file-item .file-del {
  height: 18px; min-height: 0; padding: 0 4px;
  font-size: 11px; line-height: 1; border-radius: 5px;
}
.record-files .file-none { font-size: 11.5px; }

/* 培训活动：内容/评价、现场图片与批量添加 */
.pre-wrap { white-space: pre-wrap; line-height: 1.7; word-break: break-word; }
.card-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 4px 0 10px; }
.photo-card { border: 1px solid var(--border); border-radius: 9px; background: #f8fbfc; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.photo-card img { width: 100%; height: 104px; object-fit: cover; border-radius: 6px; display: block; background: #e8eff2; }
.photo-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; }
.photo-meta .file-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-actions { display: flex; align-items: center; gap: 4px; }
.batch-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.batch-table-wrap { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.batch-table-wrap .table { min-width: 640px; }
.batch-table-wrap thead th { position: sticky; top: 0; z-index: 2; }
.modal-actions #batch-count { margin-right: auto; }
.inline-upload { margin-top: 10px; align-items: end; }
.inline-upload .form-actions { margin-top: 0; padding-top: 0; border-top: 0; }
.record-add { margin-top: 10px; }
.record-add > summary {
  cursor: pointer; font-size: 12.5px; color: var(--primary);
  padding: 7px 0; user-select: none;
}
.record-add[open] > summary { margin-bottom: 8px; }
.inline-select { display: inline-flex; align-items: center; gap: 5px; }
.input-xs { height: 26px; padding: 0 7px; font-size: 12px; width: auto; }
.modal-wide { max-width: 1040px; width: 92vw; }
.file-preview-body {
  height: 68vh; min-height: 320px; padding: 0;
  background: #f3f7f9; display: flex; align-items: center; justify-content: center;
}
.file-preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.file-preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.input.is-invalid {
  border-color: #d9534f;
  box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.12);
}

/* 关联文档：可检索下拉选择器 */
.doc-picker { position: relative; flex: 1 1 240px; min-width: 180px; }
/* 表单字段为纵向布局，包装器高度需随输入框，否则下拉列表会被 flex-basis 撑到远处 */
.field .doc-picker { flex: 0 0 auto; width: 100%; min-width: 0; }
.doc-picker .doc-picker-input { width: 100%; }
.doc-picker-native { display: none; }
.doc-picker-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  max-height: 260px; overflow-y: auto; background: #fff;
  border: 1px solid #d8dee3; border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 40, 60, 0.16);
}
.doc-picker-item {
  padding: 7px 10px; font-size: 13px; line-height: 1.4;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-picker-item.active, .doc-picker-item:hover { background: #eef6fb; }
.doc-picker-empty { padding: 9px 10px; color: #8a949c; font-size: 12px; }

/* 系统设置 · 打印配置：每个模块一行，纸张/方向/页边距并排 */
.print-config-table .input { width: 100%; }
.print-config-table td { vertical-align: middle; }
.reset-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #6b7686; margin-right: 6px; }
.reset-inline input { margin: 0; }

/* ---------- 专业测试：外周血白细胞分类 ---------- */
.tag-warn { background: var(--amber-bg); color: var(--amber); }
.blood-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.blood-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
  position: sticky;
  top: 12px;
}
.blood-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: all 0.15s ease;
}
.blood-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.blood-zone.active { border-style: solid; border-color: var(--primary); background: var(--primary-light); }
.blood-zone-all { background: var(--gray-bg); font-weight: 700; }
.blood-zone.drop-hot { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(13, 122, 112, 0.12); }
.blood-zone.has-items { border-style: solid; }
.blood-zone-name { font-size: 12.8px; font-weight: 600; }
.blood-zone-code { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.blood-zone-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--gray-bg); color: var(--gray);
  font-size: 11.5px; font-weight: 700;
}
.blood-zone.has-items .blood-zone-count { background: var(--primary-light); color: var(--primary); }
.blood-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--blood-cell-min, 112px), 1fr));
  align-content: start;
  gap: var(--blood-gap, 10px);
  min-height: 220px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
  user-select: none;
}
.blood-cell-hidden { display: none; }
.blood-marquee {
  position: absolute;
  border: 2px dashed #1d4ed8;
  background: rgba(29, 78, 216, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  pointer-events: none;
  z-index: 5;
}
.blood-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
}
.blood-view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.blood-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--gray);
  cursor: pointer;
  white-space: nowrap;
}
.blood-toggle input { width: 15px; height: 15px; accent-color: #1d4ed8; }
.blood-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.blood-zoom-value {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.blood-gap-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--gray);
  white-space: nowrap;
}
.blood-gap-group .input { height: 30px; font-size: 12px; padding: 0 8px; }
.blood-workspace.labels-hidden .blood-cell-tag,
.blood-workspace.labels-hidden .blood-cell-file { display: none; }
.blood-io { margin-bottom: 4px; }
.blood-io .field { margin-bottom: 8px; }
.blood-cell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.blood-cell:hover { border-color: var(--primary); box-shadow: 0 8px 18px rgba(16, 42, 67, 0.1); }
.blood-cell.dragging { opacity: 0.45; }
.blood-cell.assigned { border-color: #bfe6df; }
.blood-cell.selected,
.blood-cell.selected.assigned {
  border: 2px solid #1d4ed8;
  border-color: #1d4ed8;
  /* 选中态立即生效，避免受 offscreen 元素过渡延迟影响而短暂显示浅青绿 */
  transition: none;
  box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.18),
              0 0 10px rgba(29, 78, 216, 0.22),
              inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  z-index: 3;
}
.blood-cell.selected::after {
  content: '✓';
  position: absolute; top: 3px; right: 3px;
  width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: none;
  z-index: 4;
}
.blood-cell img { display: block; width: 100%; height: calc(92px * var(--blood-zoom-scale, 1)); object-fit: cover; }
.blood-cell-tag {
  position: absolute; left: 0; right: 0; bottom: 20px;
  padding: 3px 6px;
  background: rgba(17, 32, 45, 0.72);
  color: #fff;
  font-size: 10.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.blood-cell.assigned .blood-cell-tag { background: rgba(13, 122, 112, 0.86); }
.blood-cell-file {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #51606e;
  font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.blood-cell-del {
  position: absolute; top: 5px; left: 5px;
  margin: 0;
}
.blood-cell-del button {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 7px;
  background: rgba(173, 36, 36, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.blood-cell:hover .blood-cell-del button { opacity: 1; }
.blood-admin { margin-top: 14px; }
.blood-admin > summary { cursor: pointer; font-weight: 600; color: var(--text); }
.blood-admin-add { display: flex; gap: 8px; align-items: center; margin: 12px 0; max-width: 560px; }
.blood-admin-add .input { flex: 1; }
.blood-admin-rename { display: flex; gap: 6px; align-items: center; }
.blood-admin-rename .input { max-width: 220px; height: 30px; font-size: 12px; }
.blood-lightbox {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(8, 16, 24, 0.72);
}
.blood-lightbox[hidden] { display: none; }
.blood-lightbox-body {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 90vw; max-height: 88vh;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
}
.blood-lightbox-body img { max-width: 82vw; max-height: 74vh; object-fit: contain; border-radius: 8px; }
.blood-lightbox-close {
  position: absolute; top: -14px; right: -14px;
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: var(--text); color: #fff;
  font-size: 18px; line-height: 1;
  cursor: pointer;
}
.blood-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.blood-image-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.blood-image-card img { display: block; width: 100%; height: 110px; object-fit: cover; }
.blood-image-meta { padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.blood-image-meta .input { height: 30px; font-size: 12px; padding: 0 8px; }

/* 触屏归类条（手机 / 平板）：选中图片后从底部浮出 */
.blood-assign-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(16, 42, 67, 0.12);
}
.blood-assign-bar[hidden] { display: none; }
.blood-assign-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px;
}
.blood-assign-chips {
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.blood-assign-chips::-webkit-scrollbar { display: none; }
.blood-assign-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d5e0e4;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.blood-assign-chip:active { background: var(--primary-light); border-color: var(--primary); }
body.blood-assign-open .content { padding-bottom: 136px; }

/* iOS Safari：禁止长按菜单 / 文本选中 / 双击缩放误触 */
.blood-cell,
.blood-cell img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.blood-cell { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.blood-touch .blood-cell { cursor: pointer; }
body.blood-touch .blood-cell:hover { box-shadow: none; }
body.blood-touch .blood-cell-del button { opacity: 1; }
.blood-stage { -webkit-overflow-scrolling: touch; }
.blood-panel { -webkit-overflow-scrolling: touch; }

@media (max-width: 1100px) {
  .blood-layout { grid-template-columns: 1fr; }
  /* 分类标签改成横向一条 sticky 栏，避免单列时占满整屏 */
  .blood-panel {
    flex-direction: row;
    position: sticky;
    top: 8px;
    z-index: 20;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 4px 2px;
    background: rgba(255, 255, 255, 0.96);
    scrollbar-width: none;
  }
  .blood-panel::-webkit-scrollbar { display: none; }
  .blood-zone { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
}

@media (max-width: 640px) {
  .toolbar .btn-group { flex-wrap: wrap; width: 100%; }
  .toolbar .btn-xs { height: 40px; min-width: 40px; }
  .blood-toolbar .btn-xs { height: 40px; min-width: 40px; }
  .blood-zoom-group { padding: 4px; }
  .blood-zoom-value { min-width: 40px; }
  .blood-gap-group .input { height: 40px; }
  .form-actions { flex-wrap: wrap; gap: 8px; }
  .form-actions .btn-primary { height: 44px; }
  .blood-cell-del button { width: 32px; height: 32px; }
}

/* 专业测试：案例小题编辑器与分层编号 */
.sub-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary, #0d7a70);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.sub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sub-head .sub-stem { flex: 1 1 auto; }
.sub-head .sub-type { width: 108px; }
.sub-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #0d7a70);
  min-width: 34px;
}
.sub-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 12px;
}
.sub-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted, #64748b);
}
.sub-option .input { height: 32px; padding: 0 8px; }
.sub-option .check { white-space: nowrap; }
.sub-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.case-head-row td { background: #f6faf9; font-weight: 600; }
.case-head-card { border-left: 3px solid var(--primary, #0d7a70); }
.case-head-card .case-title { font-weight: 600; }
.case-question-card { margin-left: 18px; }
.q-no {
  display: inline-block;
  min-width: 30px;
  font-weight: 700;
  color: var(--primary, #0d7a70);
}

/* ---------- 外周血分类记录 ---------- */
.blood-record-group { margin-bottom: 18px; }
.blood-record-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.blood-record-group-head strong { font-size: 13.5px; }
.blood-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.blood-record-cell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
}
.blood-record-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.blood-record-cell img { display: block; width: 100%; height: 96px; object-fit: cover; }
.blood-record-cell.is-wrong {
  border: 2px solid #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}
.blood-record-meta {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 8px;
  font-size: 11.5px; line-height: 1.5; color: var(--muted);
}
.blood-record-file { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blood-record-wrong { color: #b91c1c; font-weight: 600; }
.blood-record-flag {
  position: absolute; top: 6px; right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc2626; color: #fff;
  font-size: 10.5px; line-height: 16px; font-weight: 600;
}
.blood-record-total td { background: #f8fafc; }
.blood-record-note { margin: 0; line-height: 1.7; white-space: pre-wrap; }
.blood-record-missed-thumb {
  display: block; width: 64px; height: 48px;
  object-fit: cover; border-radius: 6px;
}
.blood-lightbox-answer { font-size: 12.5px; color: #b91c1c; text-align: center; }

/* 血片管理页：病例说明 / 题目解析（可编辑入口在卡片右上角） */
.blood-notes .card-body { display: flex; flex-direction: column; gap: 14px; }
.blood-note-block { display: flex; flex-direction: column; gap: 4px; }
.blood-note-label {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em;
}

/* 作答页：可展开的病例说明 */
.blood-case-note { padding: 0; }
.blood-case-note summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding: 12px 16px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.blood-case-note summary::-webkit-details-marker { display: none; }
.blood-case-note summary::before {
  content: '▸'; color: var(--muted); font-size: 12px; margin-right: 2px;
}
.blood-case-note[open] summary::before { content: '▾'; }
.blood-case-note summary .muted { font-weight: 400; font-size: 12.5px; }
.blood-case-note > .card-body { border-top: 1px solid var(--border); padding: 12px 16px 14px; }

/* 分类记录打印/导出区块配置（详情页打印设置面板 + 系统设置打印页） */
.print-config { padding: 0; }
.print-config-sum {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding: 14px 18px; cursor: pointer; list-style: none;
}
.print-config-sum::-webkit-details-marker { display: none; }
.print-config-sum::before {
  content: '▸'; color: var(--muted); font-size: 12px; margin-right: 2px;
}
.print-config[open] .print-config-sum::before { content: '▾'; }
.print-config-sum .muted { font-size: 12.5px; }
.print-config > .card-body { border-top: 1px solid var(--border); }
.print-section-options { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.print-section-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.print-section-item input[disabled] { cursor: default; }
.print-config-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 12px;
}
.print-config-actions .hint { flex: 1 1 320px; margin: 0; }
.print-config-count {
  font-size: 12.5px; color: var(--muted);
  padding: 2px 8px; border-radius: 999px; background: #f1f5f9;
}
.print-config-count.is-empty { color: #b91c1c; background: #fef2f2; }

/* ---------- 全局导航：常用入口 / 模块内页签 / 快速搜索 ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 左栏常用区：窄图标栏下与模块图标同样式，悬停展开时显示标题 */
.nav-fav {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.nav-fav-title {
  font-size: 10.5px; letter-spacing: 1.4px; color: #9aa7b3;
  padding: 0 12px 4px; text-transform: uppercase;
  transition: opacity 0.1s ease;
}
body.sidebar-collapsed .nav-fav-title { width: 0; opacity: 0; overflow: hidden; padding: 0; }
body.sidebar-collapsed .sidebar:hover .nav-fav-title,
body.sidebar-collapsed .sidebar:focus-within .nav-fav-title {
  width: auto; opacity: 1; padding: 0 12px 4px;
}
.nav-fav-item svg { opacity: 0.7; }
.nav-fav-item .nav-fav-star { display: none; }

/* 模块内顶部页签：胶囊分段（方案 B，参数与 static/ui_nav_preview.html 一致） */
.module-tabs {
  position: relative;
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 16px; padding: 5px;
  background: #eef3f5; border: 1px solid #dde6ea; border-radius: 14px;
}
.module-tabs-scroll {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.module-tabs-scroll::-webkit-scrollbar { display: none; }
/* 溢出且未滚到末端时，右侧渐隐提示 */
.module-tabs.is-fading .module-tabs-scroll {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}
/* 展开二级菜单时取消渐隐遮罩，否则下拉会被 mask 裁掉 */
.module-tabs.is-fading:has(.module-nav-group:hover) .module-tabs-scroll,
.module-tabs.is-fading:has(.module-nav-group.is-open) .module-tabs-scroll,
.module-tabs.is-fading:has(.module-nav-group:focus-within) .module-tabs-scroll {
  -webkit-mask-image: none;
  mask-image: none;
}
.module-tab-wrap { position: relative; display: flex; align-items: center; flex: 0 0 auto; }
.module-tab {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 18px;
  color: #4d5c6b; white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}
.module-tab:hover { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(16, 42, 67, 0.06); }
.module-tab.active {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 3px 8px rgba(13, 122, 114, 0.28);
  animation: moduleTabPop 0.16s ease-out;
}
.module-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(13, 122, 114, 0.28); }
.module-tab.active:focus-visible {
  box-shadow: 0 0 0 3px rgba(13, 122, 114, 0.28), 0 3px 8px rgba(13, 122, 114, 0.28);
}
.module-tab.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
@keyframes moduleTabPop {
  0% { transform: scale(0.94); }
  100% { transform: scale(1); }
}
.module-tab-group {
  flex: 0 0 auto; font-size: 10.5px; color: #7b8794; letter-spacing: 0.08em;
  white-space: nowrap; padding: 0 4px 0 12px; margin-left: 12px;
  border-left: 1px solid #dbe5e9;
}
.module-tabs-scroll > .module-tab-group:first-child { border-left: 0; margin-left: 0; padding-left: 4px; }

/* 分组主菜单：鼠标移入展开二级导航（下拉用 fixed 定位，避免被横向滚动容器裁切） */
.module-nav-group {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center;
}
.module-nav-group::after {
  content: ''; width: 1px; height: 16px; margin-right: 4px;
  background: #dbe5e9;
}
.module-nav-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px 0 13px; border: 0; border-radius: 999px;
  background: transparent; color: #4d5c6b;
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 18px;
  white-space: nowrap; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.module-nav-label { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.module-nav-current {
  max-width: 7em; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; font-weight: 500; opacity: 0.72;
}
.module-nav-current::before { content: '·'; margin-right: 3px; opacity: 0.7; }
.module-nav-caret {
  width: 12px; height: 12px; opacity: 0.65; flex: 0 0 auto;
  transition: transform 0.16s ease;
}
.module-nav-trigger:hover,
.module-nav-group.is-open .module-nav-trigger {
  background: #fff; color: var(--primary);
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.06);
}
.module-nav-group.is-open .module-nav-caret { transform: rotate(180deg); }
.module-nav-group.is-active .module-nav-trigger {
  background: var(--primary); color: #fff;
  box-shadow: 0 3px 8px rgba(13, 122, 114, 0.28);
}
.module-nav-trigger:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(13, 122, 114, 0.28);
}
.module-nav-dropdown {
  position: fixed; z-index: 45;
  min-width: 176px; max-width: 260px; max-height: 66vh; overflow-y: auto;
  padding: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 14px 32px rgba(12, 30, 40, 0.16);
  visibility: hidden; opacity: 0; transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}
.module-nav-dropdown::before {
  content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
.module-nav-group:hover .module-nav-dropdown,
.module-nav-group.is-open .module-nav-dropdown,
.module-nav-group:focus-within .module-nav-dropdown {
  visibility: visible; opacity: 1; transform: none; pointer-events: auto;
}
.module-nav-row { display: flex; align-items: center; width: 100%; border-radius: 8px; }
.module-nav-row:hover { background: #f3f8f7; }
.module-nav-dropdown .module-tab {
  flex: 1 1 auto; justify-content: flex-start; height: 30px;
  padding: 0 8px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--text);
  animation: none;
}
.module-nav-dropdown .module-tab:hover {
  background: transparent; color: var(--primary); box-shadow: none;
}
.module-nav-dropdown .module-tab.active {
  background: var(--primary-light); color: var(--primary-dark); font-weight: 600;
  box-shadow: none;
}
.module-nav-dropdown .module-tab-pin { margin: 0 2px 0 0; opacity: 0.25; }
.module-nav-row:hover .module-tab-pin,
.module-nav-dropdown .module-tab-pin.is-pinned { opacity: 1; }
.module-tab-pin {
  width: 24px; height: 24px; padding: 0; margin-left: -4px;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font-size: 13px; line-height: 24px; color: #c2ccd4;
  opacity: 0; transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.module-tab-wrap:hover .module-tab-pin,
.module-tab-pin.is-pinned,
.module-tab-pin:focus-visible { opacity: 1; }
.module-tab-pin:hover { color: var(--primary); background: #e2eef0; }
.module-tab-pin.is-pinned { color: var(--primary); }
.module-tabs-more-wrap { position: relative; flex: 0 0 auto; }
/* 模块页签右侧动作位（如文档管理「+ 新增文档」） */
.module-tabs-action {
  flex: 0 0 auto;
  display: flex; align-items: center;
  padding: 0 6px 0 4px;
}
.module-tabs-action .btn { height: 32px; border-radius: 999px; white-space: nowrap; }
/* 筛选区精简/高级切换：精简模式隐藏高级字段 */
.filters.mode-simple .filter-adv { display: none !important; }
.module-tabs-more {
  height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid #d5e0e4; background: #fff; color: #4d5c6b;
  font-size: 12px; cursor: pointer; display: none;
}
.module-tabs-more:hover { border-color: var(--primary); color: var(--primary); }
.module-tabs-more.is-visible { display: inline-flex; align-items: center; }
.module-tabs-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 168px; max-height: 62vh; overflow-y: auto;
  padding: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(12, 30, 40, 0.14);
}
.module-tabs-menu-item {
  display: block; padding: 7px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--text); white-space: nowrap;
}
.module-tabs-menu-item:hover { background: #f3f8f7; color: var(--primary); }
.module-tabs-menu-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* 窄屏隐藏分组标题，把宽度让给胶囊 */
@media (max-width: 960px) {
  .module-tab-group { display: none; }
}
/* 减少动态效果：关闭缩放动画与颜色/阴影过渡 */
@media (prefers-reduced-motion: reduce) {
  .module-tabs-scroll { scroll-behavior: auto; }
  .module-tab,
  .module-tab-pin { transition: none; }
  .module-tab.active { animation: none; }
}

/* 顶栏快速搜索入口 */
.nav-search-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: #7b8a97; font-size: 12.5px; cursor: pointer;
}
.nav-search-trigger:hover { border-color: var(--primary); color: var(--primary); }
.nav-search-trigger svg { width: 15px; height: 15px; }
.nav-search-trigger kbd {
  font-family: inherit; font-size: 10.5px; color: #9aa7b3;
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
  background: #f8fafc;
}

/* Ctrl+K 搜索面板 */
.nav-search-mask {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  background: rgba(12, 30, 40, 0.42);
}
.nav-search-mask[hidden] { display: none; }
.nav-search {
  width: min(560px, 92vw); max-height: 70vh;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(12, 30, 40, 0.22);
  overflow: hidden;
}
.nav-search-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.nav-search-head svg { width: 18px; height: 18px; color: #9aa7b3; flex: 0 0 auto; }
.nav-search-head input {
  flex: 1 1 auto; min-width: 0; height: 34px; border: 0; outline: none;
  font-size: 14px; font-family: inherit; color: var(--text); background: transparent;
}
.nav-search-head kbd {
  font-family: inherit; font-size: 11px; color: #9aa7b3;
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
}
.nav-search-list { overflow-y: auto; padding: 6px; }
.nav-search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
}
.nav-search-item:hover { background: #f3f8f7; }
.nav-search-item.is-active { background: var(--primary-light); }
.nav-search-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.nav-search-item-label { font-size: 13.5px; color: var(--text); }
.nav-search-item.is-active .nav-search-item-label { color: var(--primary-dark); font-weight: 600; }
.nav-search-item-module { font-size: 11.5px; color: #9aa7b3; }
.nav-search-pin {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: #c2ccd4; cursor: pointer; font-size: 12px; line-height: 20px;
}
.nav-search-pin:hover { color: var(--primary); border-color: var(--border); }
.nav-search-pin.is-pinned { color: var(--primary); }
.nav-search-empty { padding: 18px 12px; text-align: center; color: #8a97a5; font-size: 13px; }
.nav-search-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: #8a97a5; background: #f8fbfc;
}

@media (max-width: 960px) {
  .nav-search-trigger span,
  .nav-search-trigger kbd { display: none; }
  .nav-search-trigger { width: 36px; padding: 0; justify-content: center; }
}

/* ---------- 质量管理：覆盖台账 / 填报进度 / 看板 ---------- */
.q-note {
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--primary-light); border: 1px solid #cfe8e3;
  border-radius: 10px; color: #245c56; font-size: 12.5px;
}
.q-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.q-stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
}
.q-stat .q-label { display: block; font-size: 12.5px; color: var(--muted); }
.q-stat strong { display: inline-block; margin-top: 4px; font-size: 26px; line-height: 1.2; }
.q-stat .q-unit { margin-left: 4px; font-size: 12px; color: var(--muted); }
.q-stat.is-danger strong { color: var(--red); }
.q-stat.is-good strong { color: var(--green); }
.q-progress {
  width: 100%; height: 8px; border-radius: 4px;
  background: #edf1f5; overflow: hidden;
}
.q-progress span { display: block; height: 100%; background: var(--primary); }
.q-progress.is-warn span { background: var(--amber); }
.q-progress.is-danger span { background: var(--red); }
.q-progress-cell { min-width: 130px; }
.q-progress-cell .q-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.q-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.q-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: #fbfdfe; font-size: 13px; cursor: pointer;
}
.q-check input { accent-color: var(--primary); }
.q-file { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.q-file a { word-break: break-all; }
.q-plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.q-plan {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.q-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-plan-head strong { font-size: 14px; }
.q-plan .q-meta { margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
.q-inline-num { width: 92px; }
.q-section { margin-bottom: 18px; }
.q-section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.q-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* 室内质控计划：质控类型联动分组勾选质控名称 */
.field[hidden], .qc-name-group[hidden] { display: none !important; }
.qc-name-group { margin-bottom: 10px; }
.qc-name-group .q-check { align-items: flex-start; max-width: 100%; }
.q-check .sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }

/* 室内质控全年任务：四类视图 / 临近天数 / 筛选与提交记录 */
.q-task-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px; margin-bottom: 6px;
}
.q-tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.q-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card); color: var(--text);
  font-size: 13px; text-decoration: none;
}
.q-tab:hover { border-color: var(--primary); }
.q-tab.is-active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.q-tab-count {
  min-width: 20px; padding: 1px 6px; border-radius: 10px;
  background: rgba(0, 0, 0, .06); font-size: 11.5px; text-align: center;
}
.q-tab.is-active .q-tab-count { background: rgba(255, 255, 255, .24); }
.q-near-form { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.q-near-form .q-inline-num { width: 74px; }
.q-tab-hint { font-size: 12px; margin: 0 0 14px; }
.q-date-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.q-date-label .input { width: 145px; }
.q-preview {
  padding: 9px 12px; margin: 10px 0 4px; border-radius: 8px;
  background: var(--primary-light); font-size: 12.5px; color: #245c56;
}
.q-preview strong { font-size: 15px; }
.q-log-meta { font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .q-task-bar { align-items: flex-start; flex-direction: column; }
}


/* 常用医嘱 · 检验项目明细选择弹窗 */
.modal-card.picker-modal { width: 840px; max-width: calc(100vw - 32px); height: min(640px, calc(100vh - 64px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.picker-modal-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.picker-modal-head h3 { margin: 0 0 2px; font-size: 15px; }
.picker-modal-head .muted { font-size: 12.5px; display: block; }
.picker-modal-head .modal-close { position: absolute; top: 12px; right: 12px; }
.picker-modal { position: relative; }
.picker-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; background: #f7fafb; border-bottom: 1px solid var(--border); }
.picker-filters .input, .picker-filters select { height: 34px; }
.picker-filters select { width: 150px; }
.picker-filters .search { flex: 1 1 200px; max-width: 300px; }
/* 弹窗内的批量表单需撑满剩余高度，否则 .picker-table-zone 的 flex:1 + overflow-y 失效、长列表被裁剪 */
.picker-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.picker-table-zone { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.picker-table { font-size: 13px; min-width: 0; }
.picker-table thead th { padding: 8px 12px; position: sticky; top: 0; z-index: 1; background: #f7fafb; }
.picker-table tbody td { padding: 7px 12px; }
.picker-table tbody tr { cursor: pointer; }
.picker-table tbody tr:hover { background: #f3f8f7; }
.picker-table tbody tr.row-checked { background: var(--primary-light); }
.picker-table .col-check { width: 36px; text-align: center; }
.picker-table .col-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.picker-table tbody tr.row-in-group, .picker-table tbody tr.row-in-group:hover { background: #fafcfc; cursor: default; }
.picker-table tbody tr.row-in-group td { color: var(--muted-strong); }
.picker-table .badge-in-group { height: 18px; padding: 0 6px; font-size: 10.5px; margin-left: 6px; color: #5a6672; }
/* 灰态（已在组套）勾选框 */
.picker-table .col-check input:disabled { accent-color: var(--disabled); cursor: default; }
/* 双击提交中的行：整行灰化 + 名称后「添加中…」脉动徽标 */
.picker-table tbody tr.row-pending, .picker-table tbody tr.row-pending:hover { background: #eef1f4; cursor: progress; }
.picker-table tbody tr.row-pending td { color: var(--muted-strong); }
.picker-table tbody tr.row-pending .col-check input { pointer-events: none; }
.picker-table .badge-pending {
  height: 18px; padding: 0 6px; font-size: 10.5px; margin-left: 6px;
  color: #5a6672; background: #eef1f4; border: 1px solid var(--border);
  border-radius: 999px; line-height: 16px;
  animation: pending-pulse 1.2s ease-in-out infinite;
}
@keyframes pending-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.picker-modal-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #fff; border-top: 1px solid var(--border); }
.picker-count { flex: 1; font-size: 13px; color: var(--muted-strong); }
.picker-count b { font-size: 15px; font-weight: 700; color: var(--primary); margin: 0 2px; }
/* 弹窗打开时锁定页面滚动 */
body.picker-lock { overflow: hidden; }
/* 键盘焦点可见性 */
.picker-modal :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.picker-modal .input:focus-visible { outline: 2px solid var(--primary); box-shadow: none; }
.picker-table .col-check input:focus-visible { border-radius: 3px; }

/* 常用医嘱列表页 · 左侧三行式基本信息 + 右侧明细头部 */
.order-code-prefix { font-size: 12px; margin-right: 6px; }
.order-ext-code { font-size: 12.5px; }
.order-price { font-weight: 700; }
.detail-card-head { align-items: flex-start; gap: 12px; }
.detail-card-info { min-width: 0; flex: 1; }
.detail-card-info h3 { margin: 0; font-size: 15px; }
.detail-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.detail-meta .mono { font-size: 12px; }

/* 常用医嘱列表页 · 左右比例（左侧紧凑列表 + 右侧更宽明细），不改全局 .split */
.split-orders { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); }
@media (max-width: 1120px) {
  .split-orders { grid-template-columns: 1fr; }
}
/* 常用医嘱列表页 · 左侧列表表格：不强制横向滚动，表头与数据水平 padding 对齐 */
.split-orders .order-list-table { min-width: 0; width: 100%; }
.split-orders .order-list-table thead th { padding: 8px 10px; }
.split-orders .order-list-table tbody td { padding: 7px 10px; word-break: break-word; }
.split-orders .order-list-table .table-link { display: block; }
/* 整行点选：行可点击，hover 手型；row-active 高亮沿用全局样式 */
.split-orders .order-list-table tbody tr[data-href] { cursor: pointer; }

/* 常用医嘱表单 · 检验项目明细操作区（复用弹窗添加） */
.order-items-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.order-items-actions .hint { flex: 1 1 100%; }

/* ---------- 站点图标（系统设置可自定义） ---------- */
/* 自定义图标代替「检」字：填满标识位并保留圆角，避免超出背景圆角 */
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 11px;
  padding: 3px;
  box-sizing: border-box;
}
.login-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 15px;
  padding: 4px;
  box-sizing: border-box;
}
.site-icon-panel {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  gap: 20px 26px;
}
.site-icon-preview {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7faf9;
}
.site-icon-preview img {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}
.site-icon-actions { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.site-icon-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.site-icon-form .field { flex: 1 1 240px; }
.site-icon-hint { margin: 0; }

/* ---------- 表单型弹窗（出库等）：内容区滚动、按钮常驻 ---------- */
/* 视口高度与键盘高度由 app.js 写入 --app-vh / --kb-inset，键盘弹出时弹窗整体上移 */
.modal-card.sheet {
  display: flex; flex-direction: column;
  max-height: calc(100vh - 40px);
  max-height: calc(var(--app-vh, 100vh) - 40px);
  padding: 0; overflow: hidden;
}
.modal-card.sheet .sheet-head {
  flex: 0 0 auto; margin: 0; padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-card.sheet .sheet-form {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
}
.modal-card.sheet .sheet-body {
  display: grid; gap: 10px; padding: 14px 18px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* 批次信息条：固定在标题下、不随字段滚动，出库时物资/批号/可用数量始终可见 */
.modal-card.sheet .sheet-info {
  flex: 0 0 auto; margin: 0; padding: 9px 18px;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  background: #f7fafb;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.modal-card.sheet .sheet-info > div { min-width: 0; }
.modal-card.sheet .sheet-info > div:first-child { grid-column: 1 / -1; }
.modal-card.sheet .sheet-info > div:first-child dd { white-space: normal; }
.modal-card.sheet .sheet-info dt { flex: 0 0 auto; }
.modal-card.sheet .sheet-info dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-card.sheet .sheet-foot {
  flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); background: #fff;
}
@media (max-width: 640px) {
  /* 手机端弹窗改为底部抽屉：贴底圆角、限高滚动；键盘弹出时按 --kb-inset 抬高，取消/确认按钮始终可见 */
  .modal-mask {
    align-items: flex-end;
    padding: 10px 0 var(--kb-inset, 0px);
  }
  .modal-card {
    width: 100%; max-width: 100%;
    max-height: calc(100% - 10px);
    max-height: calc(var(--app-vh, 100dvh) - 10px);
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }
  .modal-card.wide, .modal-card.dict-modal-card, .modal-card.modal-wide { width: 100%; max-width: 100%; }
  .modal-card.sheet { padding: 0; overflow: hidden; }
  .modal-card.sheet .sheet-head { padding: 10px 16px 9px; }
  .modal-card.sheet .sheet-body { padding: 10px 16px; gap: 8px; }
  .modal-card.sheet .sheet-foot { padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .modal-card.sheet .sheet-foot .btn { flex: 1 1 0; min-height: 42px; }
  /* 信息条在手机上压成两行：物资单独一行，批号/效期/库位/可用自动折行，约 50px 高 */
  .modal-card.sheet .sheet-info {
    display: flex; flex-wrap: wrap; gap: 2px 12px;
    padding: 7px 16px; font-size: 12px;
  }
  .modal-card.sheet .sheet-info > div { font-size: 12px; line-height: 1.7; }
  .modal-card.sheet .sheet-info > div:first-child { flex: 1 1 100%; }
  .modal-card.sheet .sheet-info > div:first-child dd { font-weight: 600; color: var(--text); }
  .modal-card.sheet .sheet-body textarea { min-height: 54px; }
  /* 可用数量已在固定信息条里，手机端不再重复显示行内提示，省一行高度 */
  .modal-card.sheet #ob-hint { display: none; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; min-height: 42px; }
}


/* 物资目录 / 库存：窄屏点击行 → 该行下方弹出横向操作按钮条 */
.table-tap .actions-tr > td {
  background: #f7fafc; padding: 8px 10px;
  border-top: 1px dashed var(--border);
}
.table-tap .pop-actions .row-actions {
  display: flex; flex-direction: row; align-items: center;
  gap: 6px; justify-content: flex-start; white-space: nowrap;
}
.table-tap .pop-actions .row-actions .btn { min-height: 36px; }
@media (max-width: 640px) {
  /* 窄屏下操作按钮收入行内操作条：行可点、原操作列隐藏 */
  .table-tap tbody tr:not(.actions-tr) { cursor: pointer; }
  .table-tap .col-actions { display: none; }
  .table-tap .row-actions { display: none; }
}
