/* ================================================================
 * 酒泉市人民医院 · 问题协同看板  (两本台账版)
 * 样式表 — 2026-08-04 重构；2026 视觉升级（仅样式层美化，未改动功能逻辑）
 * ================================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 主色：医疗蓝，层次更丰富 */
  --brand: #1256a3;                       /* 主色（保留） */
  --brand-2: #1a73c7;                     /* 次级蓝 */
  --brand-3: #3b8ee0;                     /* 强调/高亮蓝 */
  --brand-grad: linear-gradient(135deg, #1a73c7 0%, #1256a3 100%);
  --brand-grad-soft: linear-gradient(135deg, #2f8bd6 0%, #1a73c7 100%);
  --brand-soft: #eaf2fb;                  /* 主色浅底 */
  --brand-soft-2: #f3f8fe;               /* 更浅的主色浅底 */

  /* 文字 */
  --ink: #16223a;                         /* 主文字 */
  --ink-2: #51607a;                       /* 次级文字 */
  --ink-3: #8a98ad;                       /* 辅助文字 */

  /* 线条 / 边框 / 底色 */
  --line: #e6ecf3;                        /* 分隔线 */
  --border: #e3e9f1;                      /* 通用边框（原样式多处引用却未声明，此处补定义） */
  --bg: #f3f6fb;                          /* 页面底色（更柔和） */
  --card: #ffffff;

  /* 状态色 + 浅底 */
  --ok: #1aa06a;      --ok-soft: #e7f6ef;
  --warn: #e8820f;    --warn-soft: #fdf1e4;
  --danger: #e23b30;  --danger-soft: #fdeceb;
  --purple: #7b54d6;  --purple-soft: #f1ecfc;
  --amber: #c9860c;   --amber-soft: #fdf4e4;
  --red: #c0392b;     --red-soft: #fbe9e8;

  /* 渐变（按钮 / 进度条） */
  --ok-grad: linear-gradient(135deg, #22b67b, #16a06a);
  --warn-grad: linear-gradient(135deg, #f2932f, #e8820f);

  /* 圆角 */
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;

  /* 柔和分层阴影（多段、低透明度） */
  --sh: 0 1px 2px rgba(20,40,70,.04), 0 2px 6px rgba(20,40,70,.045), 0 8px 24px rgba(20,40,70,.05);
  --sh-sm: 0 1px 2px rgba(20,40,70,.05), 0 3px 8px rgba(20,40,70,.05);
  --sh-lg: 0 8px 28px rgba(20,40,70,.10), 0 2px 8px rgba(20,40,70,.06);
  --sh-pop: 0 18px 50px rgba(18,34,64,.22), 0 4px 14px rgba(18,34,64,.10);

  /* 统一过渡节奏（克制、顺滑） */
  --t: .18s cubic-bezier(.4, 0, .2, 1);
  --t-fast: .12s ease;

  /* 字体栈（更顺滑） */
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system,
          BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* 美化增强令牌 */
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #eaf2fb 0%, rgba(234,242,251,0) 60%),
             radial-gradient(900px 500px at -10% 110%, #eef4fb 0%, rgba(238,244,251,0) 55%),
             #f3f6fb;
  --sb-glow: radial-gradient(120% 60% at 50% 0%, rgba(91,168,236,.45) 0%, rgba(91,168,236,0) 60%);
  --card-grad: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --sb-accent: linear-gradient(90deg, #3b8ee0, #1256a3);
  --hl: inset 0 1px 0 rgba(255,255,255,.7);
  --scb: #c7d4e3;          /* 滚动条滑块 */
  --scb-h: #a9bdd4;        /* 滚动条滑块 hover */
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font);
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ================================================================
 * 布局：左侧可收缩菜单 + 右侧内容区
 * ================================================================ */
:root { --sbw: 216px; --sbw-min: 62px; }
html.sb-collapsed { --sbw: var(--sbw-min); }
html.topbar-hidden { --topbar-h: 0px; }
html:not(.topbar-hidden) { --topbar-h: 58px; }

.layout { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sbw);
  flex: none;
  background:
    var(--sb-glow),
    linear-gradient(180deg, #1259a8 0%, #0e4f9a 32%, #103f78 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: width .2s ease, box-shadow .2s ease;
  box-shadow: 2px 0 16px rgba(9, 40, 78, .18);
  overflow: hidden;
}
.sidebar::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--sb-accent); opacity: .9; pointer-events: none;
}
.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  min-height: 64px;
  overflow: hidden;
}
.sb-brand .logo {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(18, 86, 163, .35);
  object-fit: contain;
  padding: 3px;
}
.sb-brand-txt { white-space: nowrap; overflow: hidden; }
.sb-brand .t1 { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.sb-brand .t2 { font-size: 11px; opacity: .7; margin-top: 1px; }
html.sb-collapsed .sb-brand { justify-content: center; padding: 16px 6px; }
html.sb-collapsed .sb-brand-txt { display: none; }

.nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }
.nav-grp {
  font-size: 11px;
  color: rgba(255, 255, 255, .45);
  padding: 12px 12px 6px;
  letter-spacing: 1px;
  white-space: nowrap;
}
html.sb-collapsed .nav-grp {
  padding: 10px 0 6px;
  text-align: center;
  font-size: 0;
}
html.sb-collapsed .nav-grp::before {
  content: ''; display: block; height: 1px; margin: 0 12px;
  background: rgba(255, 255, 255, .14);
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, .82);
  white-space: nowrap;
  transition: var(--t);
  cursor: pointer;
  position: relative;
}
.nav a .ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.nav a .ico svg { width: 18px; height: 18px; fill: currentColor; }
.nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a.active {
  background: linear-gradient(135deg, #2f8bd6 0%, #1256a3 100%);
  color: #fff; font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(18, 86, 163, .35);
}
/* active 项左侧高亮条（渐变胶囊模式下隐藏，避免重复） */
.nav a.active::before { display: none; }
html.sb-collapsed .nav a { justify-content: center; padding: 11px 0; }
html.sb-collapsed .nav a .txt { display: none; }
html.sb-collapsed .nav a.active::before { display: none; }

.sb-foot { padding: 8px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sb-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
  transition: var(--t);
}
.sb-toggle:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.sb-toggle .ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; transition: transform .2s; }
.sb-toggle .ico svg { width: 18px; height: 18px; fill: currentColor; }
html.sb-collapsed .sb-toggle { justify-content: center; padding: 9px 0; }
html.sb-collapsed .sb-toggle .txt { display: none; }
html.sb-collapsed .sb-toggle .ico { transform: rotate(180deg); }

.sb-mask { display: none; position: fixed; inset: 0; background: rgba(9, 26, 48, .45); z-index: 150; }

/* ---------- 内容区 ---------- */
.content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sbw);
  transition: margin-left .2s ease;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
html.topbar-hidden .content { height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 233, 241, .7);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  min-height: 58px;
  box-shadow: 0 1px 0 rgba(16, 32, 56, .02), 0 6px 20px rgba(16, 32, 56, .05);
  transition: transform .22s ease, opacity .22s ease;
}
html.topbar-hidden .topbar { transform: translateY(-100%); opacity: 0; pointer-events: none; }
html.topbar-hidden .main { padding-top: 6px; }
.topbar-toggle { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 7px; }
.topbar-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.topbar-restore { display: none; position: sticky; top: 0; left: 0; right: 0; z-index: 65; height: 24px; align-items: center; justify-content: center; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
html.topbar-hidden .topbar-restore { display: flex; }
.topbar-restore-btn { width: 28px; height: 20px; padding: 0; display: grid; place-items: center; border-radius: 6px; font-size: 12px; line-height: 1; color: var(--ink-3); background: transparent; border: 1px solid var(--line); }
.topbar-restore-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-2); }
.page-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.hamburger { display: none; width: 34px; height: 34px; border-radius: 8px; color: var(--ink-2); transition: var(--t); }
.hamburger svg { width: 20px; height: 20px; fill: currentColor; }
.hamburger:hover { background: var(--brand-soft); color: var(--brand); }
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.who { font-size: 13px; color: var(--ink-2); }

/* ---------- 问题看板：问题来源筛选（与汇总按钮同行，靠右） ---------- */
.dept-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.dept-filter { display:flex; align-items:center; gap:6px; margin-left:auto; }
.dept-filter .fl-label { font-size:13px; color:#64748b; }
/* ---------- 版本号（顶栏 + 右下角固定，便于确认强刷是否生效） ---------- */
.app-ver {
  font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border: 1px solid #d2e3f6;
  padding: 4px 11px; border-radius: 999px; letter-spacing: .3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(18, 86, 163, .08);
}
.app-ver-foot {
  position: fixed; right: 12px; bottom: 10px; z-index: 120;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums; pointer-events: none;
  box-shadow: 0 2px 8px rgba(16, 32, 56, .08);
  backdrop-filter: blur(4px);
}
/* ---------- 顶栏医院（租户）切换 ---------- */
.tenant-switcher { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.tenant-switcher .ts-label { font-size: 12px; color: var(--ink-3); }
.tenant-switcher .ts-name { font-size: 13px; font-weight: 600; color: var(--brand); }
.tenant-switcher .ts-select {
  font-size: 13px; font-weight: 600; color: var(--brand);
  border: 1px solid #d2e3f6; background: var(--brand-soft);
  border-radius: 999px; padding: 5px 26px 5px 12px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%231256a3' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.tenant-switcher .ts-select:focus { outline: none; border-color: var(--brand); }
/* 机构管理弹窗 */
.modal-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
.tm-members { display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: 360px; }
.tm-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.tm-chk input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------- 主区域 ---------- */
.main {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 60px;
  height: calc(100vh - var(--topbar-h));
  transition: height .22s ease;
}
html.topbar-hidden .main { height: 100vh; }
section.tab.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
section.tab.active:not(#tab-drafts) { overflow: auto; }
#tab-drafts { overflow-y: auto; overflow-x: hidden; }

/* ---------- 响应式：窄屏抽屉式菜单 ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 216px; }
  html.sb-open .sidebar { transform: none; }
  html.sb-open .sb-mask { display: block; }
  .content { margin-left: 0; }
  .hamburger { display: grid; place-items: center; }
  .main { padding: 16px 14px 50px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  /* 移动端让内容撑开 main，统一由 main 负责纵向滚动，避免整页划不动 */
  section.tab.active { flex: none; }
  html.sb-collapsed .sidebar { width: 216px; }
  html.sb-collapsed .nav a { justify-content: flex-start; padding: 10px 12px; }
  html.sb-collapsed .nav a .txt, html.sb-collapsed .sb-brand-txt, html.sb-collapsed .sb-toggle .txt { display: initial; }
  .sb-foot { display: none; }
}
.tab { display: none; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 按钮 ---------- */
.btn {
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  transition: var(--t);
  box-shadow: var(--sh-sm);
}
.btn:hover { background: #f5f8fc; border-color: #d8e1ec; transform: translateY(-1px); box-shadow: var(--sh); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-sm); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 115, 199, .25); }
.btn-export { background: var(--ok-grad); color: #fff; border: none; font-weight: 500; box-shadow: 0 4px 12px rgba(22, 160, 106, .22); }
.btn-export:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22, 160, 106, .28); }
.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  border: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(18, 86, 163, .22);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(18, 86, 163, .28); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 115, 199, .3); }
.btn.ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: #f5f8fc; border-color: #d8e1ec; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.small.del { color: var(--danger); }
.btn.small.del:hover { background: var(--danger-soft); border-color: #f4c4c0; }
.btn-warn {
  background: var(--warn-grad);
  color: #fff;
  border: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(232, 130, 15, .22);
}
.btn-warn:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(232, 130, 15, .28); }
.btn.small.rollback { color: #e8820f; border-color: #f2c79b; }
.btn.small.rollback:hover { background: #fdefe2; border-color: #f2c79b; }
.btn.small.hold { color: #b15c00; border-color: #f2c79b; }
.btn.small.hold:hover { background: #fdebd6; border-color: #ecae6f; }
.btn.small.resume { color: #0a9c8f; border-color: #a7e0d8; }
.btn.small.resume:hover { background: #e3f6f3; border-color: #a7e0d8; }
.btn.small.observe { color: #5b3fd6; border-color: #cbbdf5; }
.btn.small.observe:hover { background: #efeafd; border-color: #b9a4ef; }
.btn-danger {
  background: linear-gradient(135deg, #e23b32, #c0241c);
  color: #fff;
  border: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(206, 36, 28, .26);
}
.btn-danger:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(206, 36, 28, .32); }
.btn-danger:active { transform: translateY(0); }
.btn-danger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(206, 36, 28, .3); }
/* 删除确认弹窗：清晰展示问题描述 */
.confirm-desc {
  background: var(--brand-soft-2, #f3f8ff);
  border: 1px solid var(--border, #e3e9f1);
  border-left: 3px solid var(--danger, #d23);
  border-radius: var(--r-sm, 8px);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink, #1f2d3d);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

/* ---------- 筛选栏 ---------- */
.filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filters-line {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 10px 14px;
}
.filters input, .filters select {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink);
  background: #fbfcfe;
  min-width: 120px;
  transition: var(--t);
}
.filters input.f-keyword { flex: 0 0 auto; width: 220px; min-width: 180px; }
.filters input { flex: 0 0 auto; min-width: 120px; }
.filters-line .hint { margin: 0 0 0 auto; align-self: center; white-space: nowrap; font-size: 12.5px; color: var(--ink-3); flex: none; }
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 199, .12);
}

/* ---------- 提示文字 ---------- */
.hint { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }

/* 回收箱 */
.trash-body { margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.trash-table { box-shadow: none; border: none; }
.trash-table tbody tr:hover { background: #f5f9fe; }
.trash-empty { padding: 48px 0; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  contain: layout style; /* 隔离大表重排/重绘，连带提升滚动流畅度 */
  box-shadow: var(--sh);
}
#tab-drafts .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
th {
  background: linear-gradient(180deg, #f7fafd 0%, #eef3f9 100%);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 2px solid #d8e4f2;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: hidden;
  text-overflow: ellipsis;
}
thead {
  position: sticky;
  top: 0;
  z-index: 20;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}
tbody tr { transition: var(--t-fast); }
/* 屏幕外行跳过布局/绘制，列宽提交与滚动时的重排成本从全表降到仅可见行 */
tbody tr { content-visibility: auto; contain-intrinsic-size: auto 42px; }
/* 极淡斑马纹，提升可读性（hover 时由下方规则覆盖） */
tbody tr:nth-child(even) { background: #fafcfe; }
tbody tr:hover { background: var(--brand-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- 问题描述换行 ---------- */
.desc-cell { white-space: normal; word-break: break-word; line-height: 1.55; max-width: 280px; min-width: 120px; }
.cols-fixed .desc-cell { max-width: none; }
.title-cell { min-width: 100px; }
/* 防止列宽被拖成/保存成极小值后，中文在单元格里一列一个字 */
td, th { min-width: 60px; }
#hospital-table td:first-child,
#hospital-table th:first-child { min-width: 44px; padding-left: 0 !important; padding-right: 0 !important; }

/* ---------- 前四列冻结（系统底稿 / 问题看板下钻） ---------- */
/* 左偏移用 CSS 变量，由 JS（updateFrozenOffsets）按实际列宽写入，随拖拽/重置实时联动，无偏移错位 */
#drafts-table.frozen-4, #dept-table.frozen-4 { --cw0: 100px; --cw1: 100px; --cw2: 150px; --cw3: 320px; }
#drafts-table.frozen-4 th:nth-child(-n+4), #dept-table.frozen-4 th:nth-child(-n+4),
#drafts-table.frozen-4 td:nth-child(-n+4), #dept-table.frozen-4 td:nth-child(-n+4) {
  position: sticky;
  background: #fff; /* 必须不透明，否则横向滚动时内容从后方透出 */
}
#drafts-table.frozen-4 th:nth-child(1), #dept-table.frozen-4 th:nth-child(1),
#drafts-table.frozen-4 td:nth-child(1), #dept-table.frozen-4 td:nth-child(1) { left: 0; }
#drafts-table.frozen-4 th:nth-child(2), #dept-table.frozen-4 th:nth-child(2),
#drafts-table.frozen-4 td:nth-child(2), #dept-table.frozen-4 td:nth-child(2) { left: var(--cw0); }
#drafts-table.frozen-4 th:nth-child(3), #dept-table.frozen-4 th:nth-child(3),
#drafts-table.frozen-4 td:nth-child(3), #dept-table.frozen-4 td:nth-child(3) { left: calc(var(--cw0) + var(--cw1)); }
#drafts-table.frozen-4 th:nth-child(4), #dept-table.frozen-4 th:nth-child(4),
#drafts-table.frozen-4 td:nth-child(4), #dept-table.frozen-4 td:nth-child(4) { left: calc(var(--cw0) + var(--cw1) + var(--cw2)); }
/* 表头冻结列需同时吸顶+吸左，层级高于正文冻结列；左上角最高 */
#drafts-table.frozen-4 thead th:nth-child(-n+4), #dept-table.frozen-4 thead th:nth-child(-n+4) { z-index: 40; }
#drafts-table.frozen-4 thead th:nth-child(1), #dept-table.frozen-4 thead th:nth-child(1) { z-index: 50; }
/* 冻结区右侧分隔影线，便于区分固定区与滚动区 */
#drafts-table.frozen-4 th:nth-child(4), #dept-table.frozen-4 th:nth-child(4),
#drafts-table.frozen-4 td:nth-child(4), #dept-table.frozen-4 td:nth-child(4) { box-shadow: 2px 0 0 0 var(--line); }
/* 行 hover 时冻结单元格一并高亮 */
#drafts-table.frozen-4 tbody tr:hover td:nth-child(-n+4), #dept-table.frozen-4 tbody tr:hover td:nth-child(-n+4) { background: var(--brand-soft); }
/* 关闭冻结表的 content-visibility，确保 sticky 稳定（其余大表保留以保性能） */
#drafts-table.frozen-4 tbody tr, #dept-table.frozen-4 tbody tr { content-visibility: visible; }

/* ---------- 系统底稿列筛选行（每列一个筛选控件，跟随前四列冻结） ---------- */
.col-filter-row td {
  background: #fff;
  padding: 5px 6px;
  border-bottom: 2px solid #e4eaf1;
  vertical-align: middle;
}
.col-filter-row .colf {
  width: 100%; min-width: 0; box-sizing: border-box;
  font-size: 12px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fbfcfe; color: var(--ink); transition: var(--t);
}
.col-filter-row .colf:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 86, 163, .12);
}
.col-filter-row select.colf { cursor: pointer; }
.colf-date { display: flex; align-items: center; gap: 3px; }
.colf-date .colf { width: 100%; min-width: 0; padding: 3px 4px; }
.colf-date span { color: var(--ink-3); font-size: 11px; flex: none; }
.colf-clear {
  font-size: 12px; color: var(--brand); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; background: #fff; transition: var(--t);
}
.colf-clear:hover { background: var(--brand-soft); border-color: var(--brand); }
/* 列筛选行：选项类列改为多选下拉 */
.colf-multi { position: relative; width: 100%; }
.colf-multi-toggle {
  width: 100%; min-width: 0; box-sizing: border-box; cursor: pointer;
  font-size: 12px; padding: 4px 18px 4px 6px; text-align: left;
  border: 1px solid var(--line); border-radius: 6px; background: #fbfcfe; color: var(--ink);
  transition: var(--t); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%237a8aa0' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center;
}
.colf-multi-toggle:hover { border-color: var(--brand); background-color: #fff; }
.colf-multi-toggle:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 86, 163, .12); }
.colf-multi-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
  min-width: 100%; width: max-content; max-width: 220px; max-height: 260px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 34, 67, .18); padding: 6px;
}
.colf-multi-list { display: flex; flex-direction: column; gap: 2px; }
.colf-multi-opt {
  display: flex; flex-direction: row; align-items: center; gap: 7px; font-size: 12px; color: var(--ink);
  padding: 4px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: var(--t);
}
.colf-multi-opt:hover { background: var(--brand-soft); }
.colf-multi-opt input { accent-color: var(--brand); width: 14px; height: 14px; flex: none; order: -1; cursor: pointer; }
.colf-opt-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colf-count { flex: none; font-size: 11.5px; color: var(--ink-3); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.colf-multi-foot { display: flex; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.colf-multi-foot button {
  flex: 1; font-size: 12px; padding: 4px 0; border-radius: 6px; cursor: pointer; transition: var(--t);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.colf-multi-foot .colf-multi-ok { background: var(--brand); border-color: var(--brand); color: #fff; }
.colf-multi-foot button:hover { filter: brightness(1.04); }
/* 多选面板在冻结列内同样不被遮挡（本表多选仅出现在非冻结列，这里仅作兜底） */
#drafts-table.frozen-4 .col-filter-row .colf-multi-panel { z-index: 60; }
/* 列筛选行前四列：仅横向冻结（left），不竖向吸顶（top:auto）避免与表头重叠；随拖拽/重置实时联动 */
#drafts-table.frozen-4 .col-filter-row td:nth-child(-n+4) {
  position: sticky; left: auto; top: auto; background: #fff; z-index: 30;
}
#drafts-table.frozen-4 .col-filter-row td:nth-child(1) { left: 0; }
#drafts-table.frozen-4 .col-filter-row td:nth-child(2) { left: var(--cw0); }
#drafts-table.frozen-4 .col-filter-row td:nth-child(3) { left: calc(var(--cw0) + var(--cw1)); }
#drafts-table.frozen-4 .col-filter-row td:nth-child(4) { left: calc(var(--cw0) + var(--cw1) + var(--cw2)); box-shadow: 2px 0 0 0 var(--line); }

/* ---------- 列宽拖拽：指示线预览（拖动过程只移动浮层，零重排，丝滑不卡） ---------- */
.col-resizer {
  position: absolute; top: 0; right: 0; height: 100%; width: 14px;
  cursor: col-resize; user-select: none; touch-action: none; z-index: 8;
}
.col-resizer::before {
  content: ''; position: absolute; top: 0; bottom: 0; right: 2px; width: 1px;
  background: rgba(148, 163, 184, .5); transition: .15s;
}
.col-resizer:hover { background: rgba(37, 99, 235, .10); }
.col-resizer:hover::before { background: var(--brand); width: 3px; right: 1px; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing *, body.col-resizing *::before, body.col-resizing *::after {
  cursor: col-resize !important; transition: none !important;
}
th:has(> .col-resizer:hover) { background: #eef6ff !important; }
.col-resize-guide {
  position: fixed; left: 0; top: 0; width: 2px; background: var(--brand);
  z-index: 9999; pointer-events: none; opacity: .92; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
  will-change: transform; /* 合成层：移动只触 compositor，零 layout/paint，丝滑不卡 */
}
.col-resize-tip {
  position: absolute; top: -24px; left: -16px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
}

/* ---------- 徽标（进度状态）：更圆润的胶囊形、配色更柔和 ---------- */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.5;
}
.badge.b-done  { background: var(--ok-soft);    color: var(--ok); }
.badge.b-warn  { background: var(--warn-soft);  color: var(--warn); }
.badge.b-doing { background: var(--brand-soft); color: var(--brand); }
.badge.b-wxp   { background: var(--purple-soft); color: var(--purple); }
.badge.b-red   { background: var(--red-soft);   color: var(--red); }
.badge.b-green { background: var(--ok-soft);    color: var(--ok); }
.badge.b-amber { background: var(--amber-soft); color: var(--amber); }
.badge.b-ok    { background: var(--ok-soft);    color: var(--ok); }
.badge.b-gray  { background: #eef1f5;          color: #7a828c; }
.badge.b-hold  { background: #fdebd6;          color: #b15c00; }
.badge.b-observe { background: #efeafd;         color: #5b3fd6; }
.wxp-urg { font-size: 12px; color: var(--ink-2); display: inline-block; margin-right: 4px; }

/* ---------- 今日任务看板 ---------- */
.tasks-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-content: start; padding: 6px 2px 14px; flex: 1; min-height: 0; overflow-y: auto; }
.tcol {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 14px; min-width: 0; box-shadow: var(--sh);
}
.tcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 500; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.tcol-tot { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.tcol-sub { font-size: 12px; color: #6b7785; font-weight: 500; margin: 8px 0 4px; }
.trow { display: flex; gap: 8px; }
.tcell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid transparent; transition: var(--t);
}
.tcell:hover { background: var(--brand-soft); border-color: var(--border); }
.tcell-n { font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.tcell-l { font-size: 11px; color: #6b7785; }
.tcell.urg .tcell-n { color: var(--red); }
.tcell.nor .tcell-n { color: var(--brand); }
.tcell.zero { opacity: .45; cursor: default; }
.tcell.zero:hover { background: transparent; border-color: transparent; }

/* ---------- 登录提示 / 工具栏 ---------- */
.login-tip {
  background: var(--brand-soft-2);
  border: 1px dashed var(--brand-2);
  color: var(--brand);
  padding: 14px 18px;
  border-radius: var(--r);
  margin-bottom: 14px;
  font-size: 13px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
/* 工具栏标题 / 占位（HTML 已使用，原样式缺失，这里补定义） */
.tb-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.grow { flex: 1; }

/* ---------- 面板卡片 ---------- */
.panel {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--sh);
  transition: var(--t);
}
.panel h3 {
  font-size: 14px;
  margin: 18px 0 10px;
  color: var(--ink);
}
.panel h3:first-child { margin-top: 0; }

/* ---------- 科室对应映射 ---------- */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.map-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px;
}
.map-row .k { font-weight: 600; min-width: 96px; color: var(--ink-2); }
.map-row > span { color: var(--ink-3); }
.map-row .inp, .inp {
  flex: 1;
  min-width: 80px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-size: 13px;
  color: var(--ink);
  background: #fbfcfe;
  transition: var(--t);
}
.map-row .inp:focus, .inp:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 199, .12);
}
input.wide {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  margin-top: 6px;
  font-size: 13px;
  background: #fbfcfe;
  transition: var(--t);
}
input.wide:focus { outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(26, 115, 199, .12); }

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-grid label, .form-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-2);
}
.form-row label { flex: 1; min-width: 160px; }
.form-grid input, .form-row input,
.form-grid select, .form-row select {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 14px;
  background: #fbfcfe;
  transition: var(--t);
}
.form-grid input:focus, .form-row input:focus,
.form-grid select:focus, .form-row select:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 199, .12);
}
textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-family: inherit;
  font-size: 14px;
  background: #fbfcfe;
  resize: vertical;
  transition: var(--t);
}
textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 199, .12);
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 42, .45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 18px;
}
.modal-box {
  background: var(--card-grad);
  border: 1px solid rgba(226, 233, 241, .9);
  border-radius: var(--r-lg);
  padding: 24px;
  width: 380px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--sh-pop);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-box.wide-box { width: 760px; }
.modal-box label.grow { flex: 2; }
.modal-box .form-row { align-items: flex-end; }
.modal-box textarea { width: 100%; min-height: 90px; }
.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .2px;
  position: relative;
  padding-left: 14px;
}
.modal-title::before {
  content: ''; position: absolute; left: 0; top: 2px; bottom: 2px;
  width: 4px; border-radius: 4px; background: var(--brand-grad);
}
.modal-box label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-2);
}
.modal-box input, .modal-box select, .modal-box textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 14px;
  background: #fbfcfe;
  transition: var(--t);
}
.modal-box input:focus, .modal-box select:focus, .modal-box textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 199, .12);
}
/* ---------- 可搜索下拉框（combobox） ---------- */
.combobox { position: relative; }
.cb-input { width: 100%; }
.cb-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  max-height: 240px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(15, 26, 42, .18);
}
.cb-item { padding: 8px 11px; cursor: pointer; font-size: 14px; color: var(--ink); }
.cb-item:hover { background: var(--brand-soft); }
.cb-empty { padding: 8px 11px; color: var(--ink-3); font-size: 13px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

/* ---------- 登记 WXP 底稿弹窗：加宽 + 两列网格 ---------- */
#pushWxpModal .modal-box {
  width: 860px;
  max-width: 95vw;
  padding: 26px 30px;
}
/* ---------- 编辑 / 登记弹窗：放大 + 网格布局（尽量减少滚动条） ---------- */
.modal-box.edit-box { width: 980px; max-width: 96vw; max-height: 92vh; padding: 22px 26px; }
.modal-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 18px; }
.modal-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px 18px; }
.modal-grid2 .span2, .modal-grid3 .span3 { grid-column: 1 / -1; }
.modal-grid2 input, .modal-grid2 select, .modal-grid3 input, .modal-grid3 select { width: 100%; box-sizing: border-box; }
/* 系统底稿表格：计划完成日期 / 期望完成日期 行内直接编辑 */
.cell-date { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fbfcfe; color: var(--ink); }
.cell-date:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(26, 115, 199, .12); }
.cell-date.empty { color: var(--ink-3); }
/* 系统底稿表格：备注行内直接编辑 */
.cell-remark { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fbfcfe; color: var(--ink); }
.cell-remark:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(26, 115, 199, .12); }
.cell-remark.empty { color: var(--ink-3); }
/* 编辑 / 登记弹窗：表单行自动换行，字段多列紧凑排布，整体更高更矮 */
.modal-box.edit-box .form-row { flex-wrap: wrap; gap: 11px 18px; align-items: flex-end; }
.modal-box.edit-box .form-row > label { flex: 1 1 200px; min-width: 170px; }
.modal-box.edit-box .form-row > label.grow { flex: 2 1 320px; }
#pushWxpModal .modal-title { font-size: 18px; }
#pushWxpModal .muted { font-size: 13px; margin: -2px 0 2px; }
.pw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.pw-grid label { margin: 0; }
.pw-grid label.pw-span2 { grid-column: 1 / -1; }
#pushWxpModal .modal-actions { margin-top: 8px; }
#pushWxpModal .modal-actions .btn { padding: 10px 24px; font-size: 14px; }

/* ---------- 查询筛选面板按钮：字体更明显 ---------- */
.filters .btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 7px 14px;
  min-width: 64px;
  letter-spacing: .3px;
  white-space: nowrap;
}
.filters-line .btn { padding: 7px 12px; }
.filters #f-search {
  background: var(--brand-grad);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(18, 86, 163, .22);
}
.filters #f-search:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(18, 86, 163, .28); }
.filters .btn.ghost { color: var(--ink-2); }
.filters .btn.ghost:hover { color: var(--ink); }

/* ---------- 底稿搜索选择列表 ---------- */
.pick-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-top: 4px;
}
.pick-item {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  transition: var(--t-fast);
}
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: var(--brand-soft); }
.picked {
  background: var(--ok-soft);
  border: 1px solid #bfe6cd;
  color: #0c7a41;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
}

/* ---------- 杂项 ---------- */
.muted { color: var(--ink-3); }
.msg { font-size: 13px; color: var(--danger); }

/* ---------- Toast 通知 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: #0f1c2e;
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 8px 28px rgba(15, 26, 42, .3);
  opacity: 0;
  transition: .3s;
  z-index: 400;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 概览页 ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
  position: relative;
  overflow: hidden;
  transition: var(--t);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); border-color: var(--brand-2); }
/* 极淡左侧强调色 */
.kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-grad);
  border-radius: 0 3px 3px 0;
}
.kpi-val {
  font-size: 28px; font-weight: 700; line-height: 1.1;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--brand);
}
.kpi-label { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.ov-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.ov-card {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--sh);
  position: relative;
  overflow: hidden;
  transition: var(--t);
}
.ov-card:hover { box-shadow: var(--sh-lg); border-color: var(--brand-2); }
/* 极淡顶部强调色 */
.ov-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--brand-grad);
  border-radius: 3px 3px 0 0;
}
.ov-card h3 { font-size: 14px; margin: 0 0 12px; color: var(--ink); }
/* 周期对比卡片：标题行 + 周选择器 */
.ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ov-card-head h3 { margin: 0; }
/* 周期对比卡片可折叠 */
.ov-collapsible .ov-card-head { cursor: pointer; user-select: none; }
.ov-collapsible.collapsed .ov-card-head { margin-bottom: 0; }
.cyc-head-right { display: flex; align-items: center; gap: 8px; }
.cyc-arrow { font-size: 12px; color: var(--muted, #8a94a6); transition: transform .2s ease; line-height: 1; }
.ov-collapsible.collapsed .cyc-arrow { transform: rotate(-90deg); }
.ov-collapsible.collapsed .cyc-body { display: none; }
.cyc-select {
  font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-grad); color: var(--ink); cursor: pointer; max-width: 220px;
}
.cyc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.cyc-cell {
  background: var(--bg-2, #f6f8fb); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 12px; text-align: center;
}
.cyc-val { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.cyc-lab { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.cyc-add .cyc-val { color: #e0483a; }   /* 新增：红色（增量负担） */
.cyc-proc .cyc-val { color: #0a9c8f; }  /* 处理：绿色（消减） */
.cyc-end .cyc-val { color: var(--brand, #1a73c7); }
.cyc-foot { font-size: 12px; margin-top: 10px; }
@media (max-width: 900px) { .cyc-grid { grid-template-columns: repeat(2, 1fr); } }
/* 表格内联「问题来源」下拉 */
.ps-src { font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card-grad); color: var(--ink); cursor: pointer; max-width: 110px; }
.funnel, .bars, .trend { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-label {
  flex: none; width: 150px;
  color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track { flex: 1; height: 14px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 999px; }
.bar-val { flex: none; width: 40px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-pct { color: var(--muted, #8a94a6); font-size: 11px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.trend .bar-track { height: 20px; }
.trend .bar-fill { background: linear-gradient(90deg, #36c5a8, #1256a3); }

/* ---------- 菜单权限 ---------- */
.menus-editor { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.menu-role { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--card); }
.menu-role-name { font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.menu-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chk input { width: 16px; height: 16px; }

/* ---------- 科室分布 ---------- */
.dept-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.dept-toolbar .hint { margin-bottom: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.seg .btn {
  border: none; border-radius: 0; background: #fff; color: var(--ink-2);
  padding: 7px 14px; box-shadow: none;
}
.seg .btn + .btn { border-left: 1px solid var(--line); }
.seg .btn:hover { background: var(--brand-soft); color: var(--brand); transform: none; box-shadow: none; }
.seg .btn.active { background: var(--brand); color: #fff; }
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
/* 问题看板下钻明细：自身接管纵向滚动，避免被上层 overflow:hidden 锁死导致划不动 */
#dept-detail { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#dept-detail .table-wrap { flex: 1; min-height: 0; overflow: auto; }
/* 下钻明细视图：隐藏网格、自身接管纵向滚动，避免整段划不动 */
#dept-detail { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#dept-detail[style*="display:none"] { display: none !important; }
#dept-detail .table-wrap { flex: 1; min-height: 0; overflow: auto; }
.dept-card {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
  cursor: pointer;
  transition: var(--t);
  position: relative;
  overflow: hidden;
}
.dept-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-grad);
  border-radius: 0 3px 3px 0;
}
.dept-card:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); border-color: var(--brand-2); }
.dcard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dcard-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.dcard-count { font-size: 22px; font-weight: 700; color: var(--brand); }
.dcard-bars { display: flex; flex-direction: column; gap: 5px; }
.dcard-bar { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.dcard-track { flex: 1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.dcard-fill { display: block; height: 100%; background: var(--brand-2); border-radius: 999px; }
.dcard-barval { flex: none; width: 24px; text-align: right; color: var(--ink-2); }

/* ---------- 详情弹窗 ---------- */
.detail-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 18px;
  max-height: 60vh;
  overflow: auto;
}
.detail-row { display: flex; gap: 10px; font-size: 13px; }
.detail-k { flex: none; width: 96px; color: var(--ink-3); text-align: right; }
.detail-v { flex: 1; color: var(--ink); word-break: break-word; }

/* ---------- 系统底稿表格（防横向滚动） ---------- */
#drafts-table, #dept-table { font-size: 12.5px; }
#drafts-table th, #drafts-table td,
#dept-table th, #dept-table td { padding: 9px 10px; }
#drafts-table .title-cell,
#dept-table .title-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hospital-table .title-cell {
  max-width: 320px;
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}
#hospital-table .ops-cell { white-space: nowrap; }
#drafts-table .ops-cell,
#dept-table .ops-cell { white-space: nowrap; }
#drafts-table .ops-cell .btn,
#dept-table .ops-cell .btn { margin-right: 4px; }

/* ---------- 问题登记 · 工作流步骤条 ---------- */
.workflow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}
.wf-step { display: flex; align-items: center; gap: 8px; }
.wf-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  flex: none;
  transition: var(--t);
}
.wf-name { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.wf-arrow { color: var(--ink-3); font-size: 14px; }
.workflow .wf-step.done .wf-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.workflow .wf-step.done .wf-name { color: var(--ok); }
.workflow .wf-step.active .wf-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(18, 86, 163, .14); }
.workflow .wf-step.active .wf-name { color: var(--brand); font-weight: 600; }

/* ---------- 可检索组合框（提出科室） ---------- */
.combobox { position: relative; display: inline-flex; vertical-align: middle; }
.combobox input { width: 120px; min-width: 110px; }
.combobox-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: 100%;
  max-height: 250px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(16, 32, 56, .14); margin-top: 4px;
}
.combobox-list .cb-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; font-size: 14px; color: var(--ink); cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.combobox-list .cb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combobox-list .cb-count { flex: none; font-size: 12px; color: var(--ink-3); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.combobox-list .cb-item:last-child { border-bottom: none; }
.combobox-list .cb-item:hover,
.combobox-list .cb-item.active { background: var(--brand-soft); color: var(--brand); }
.combobox-list .cb-empty { padding: 9px 12px; font-size: 13px; color: var(--ink-3); }

/* ---------- 筛选：列名标签 / 多选 / 区间 / 高级 ---------- */
.fl-label {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  margin-left: 2px;
}
.filters-line .fl-label { margin-left: 2px; }
.range { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.range input[type=date] {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px; font-size: 13px; color: var(--ink);
  min-width: 118px; width: 124px; background: #fbfcfe; transition: var(--t);
}
.range input[type=date]:focus { outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(26, 115, 199, .12); }

.multiselect { position: relative; display: inline-flex; vertical-align: middle; }
.ms-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 18px;
  background: #f7f9fc; color: var(--ink);
  font-size: 13px; min-width: 110px; max-width: 180px;
  text-align: left; cursor: pointer; transition: var(--t);
  white-space: nowrap; overflow: hidden;
}
.ms-btn::after {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-left: auto;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px); transition: var(--t); flex: none;
}
.ms-btn:hover { border-color: var(--brand-2); background: #fff; box-shadow: var(--sh-sm); }
.ms-btn.open { border-color: var(--brand); background: #fff; }
.ms-btn.open::after { transform: rotate(-135deg) translateY(1px); }
.ms-panel {
  position: fixed; z-index: 80; top: auto; left: auto;
  min-width: 160px; width: max-content; max-width: 360px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(16, 32, 56, .18); padding: 6px;
}
.ms-actions { display: flex; gap: 8px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.ms-all, .ms-none {
  flex: 1 1 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-2);
  font-size: 12px; padding: 4px 8px; cursor: pointer; transition: var(--t); white-space: nowrap;
}
.ms-all:hover, .ms-none:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft-2); }
.ms-list { display: flex; flex-direction: column; gap: 2px; }
.ms-item {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  font-size: 13px; padding: 6px 8px; cursor: pointer; border-radius: 8px;
  user-select: none; transition: var(--t);
}
.ms-item:hover { background: var(--brand-soft); }
.ms-item:has(input:checked) { background: rgba(18, 86, 163, .06); }
.ms-check { display: flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; }
.ms-check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.ms-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.ms-count { margin-left: auto; font-size: 12px; color: var(--ink-3); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.ms-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ms-item:active { background: rgba(18, 86, 163, .12); }
.mono-cell { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; color: var(--ink-2); }
/* 登记界面：批量审核勾选列 + 批量按钮 */
.col-sel { width: 36px; text-align: center; padding-left: 0 !important; padding-right: 0 !important; }
.col-sel input[type=checkbox], .hf-chk { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
#btnBatchReview { background: #15539e; border-color: #15539e; color: #fff; }
#btnBatchReview:hover { background: #0f417e; border-color: #0f417e; }
#hf-selcnt { font-size: 13px; align-self: center; }


.adv-panel {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 16px; margin-bottom: 12px; box-shadow: var(--sh);
}
.adv-panel input, .adv-panel select {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px; color: var(--ink); min-width: 120px;
  background: #fbfcfe; transition: var(--t);
}
.adv-panel .multiselect { vertical-align: middle; }
.adv-panel .ms-btn { height: 32px; min-width: 110px; }
.adv-panel input:focus, .adv-panel select:focus { outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(26, 115, 199, .12); }

/* ---------- 概览：可下钻 KPI ---------- */
.kpi-drill { cursor: pointer; transition: var(--t); position: relative; }
.kpi-drill:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); border-color: var(--brand-2); }
.kpi-go { font-size: 12px; color: var(--brand); margin-top: 6px; opacity: 0; transition: var(--t); }
.kpi-drill:hover .kpi-go { opacity: 1; }
.bar-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- 科室分布（清爽版） ---------- */
.dept-card { cursor: pointer; }
.dcard-count { font-size: 22px; font-weight: 700; color: var(--brand); }
.dept-card:hover .dcard-count { color: #0d4b91; }
.dcard-st { flex: none; width: 96px; font-size: 12px; text-align: right; white-space: nowrap; }
.dcard-barval { flex: none; width: 28px; text-align: right; color: var(--ink-2); font-size: 12px; }
.dcard-fill { display: block; height: 100%; border-radius: 999px; }

/* ---------- 角色管理 ---------- */
.roles-list { display: flex; flex-direction: column; gap: 16px; }
.role-card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--card-grad); box-shadow: var(--sh); position: relative; overflow: hidden; transition: var(--t); }
.role-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-grad);
  border-radius: 0 3px 3px 0;
}
.role-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.role-label { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; font-size: 14px; font-weight: 600; color: var(--ink); width: 160px; }
.role-name { font-size: 13px; color: var(--ink-3); font-family: monospace; }
.role-members { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.member { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 8px; }
.member-role { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.role-menus { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.role-menus .chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.role-menus input { width: 16px; height: 16px; }

/* 科室分布：每条状态可下钻 */
.dcard-bar { cursor: pointer; border-radius: 6px; padding: 2px 4px; transition: background .12s; }
.dcard-bar:hover { background: var(--brand-soft); }
.dcard-bar .dcard-st { font-weight: 600; }
/* 处理中按底稿状态细分（缩进子行） */
.dcard-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 1px 4px 1px 18px; cursor: pointer; border-radius: 6px; transition: background .12s; }
.dcard-sub:hover { background: var(--brand-soft); }
.dcard-subname { flex: none; width: 96px; text-align: right; white-space: nowrap; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.dcard-sub .dcard-barval { color: #6b7889; }

/* 角色管理：分组 */
.role-grp { margin-bottom: 12px; }
.role-grp-title { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; letter-spacing: .3px; }
.role-grp .role-menus { margin-bottom: 0; }
.role-grp + .role-grp { margin-top: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .ov-grid { grid-template-columns: 1fr; }
  .bar-label { width: 110px; }
  .hamburger { width: 40px; height: 40px; }
  .hamburger svg { width: 22px; height: 22px; }
  html.sb-open .sidebar { box-shadow: 4px 0 32px rgba(9, 40, 78, .4); }
  .sb-mask { backdrop-filter: blur(1px); }
}
@media (max-width: 1200px) {
  .filters-line { flex-wrap: wrap; }
}
@media (max-width: 768px) {
  .topbar { padding: 0 12px; min-height: 52px; }
  .page-title { font-size: 15px; }
  .main { padding: 14px 12px 40px; }
  .filters {
    gap: 8px;
    padding: 12px 14px;
  }
  .filters-line { flex-wrap: wrap; }
  .filters input, .filters select, .multiselect, .range, .range input[type=date] {
    min-width: 100%;
    width: 100%;
    font-size: 16px;
  }
  .filters input.f-keyword { width: 100%; min-width: 100%; }
  .filters .btn { flex: 1 1 auto; min-height: 42px; }
  .range { display: flex; flex-wrap: wrap; }
  .fl-label { width: 100%; margin: 2px 0 -4px; }
  .btn { padding: 11px 16px; font-size: 14px; min-height: 42px; }
  .btn.small { padding: 8px 12px; font-size: 13px; min-height: 36px; }
  .modal-box { width: 100%; max-height: 90vh; overflow: auto; padding: 18px; }
  .modal-box.wide-box { width: 100%; }
  #pushWxpModal .modal-box { width: 100%; max-width: 100%; }
  .pw-grid { grid-template-columns: 1fr; }
  .modal-box .form-row { flex-direction: column; gap: 10px; }
  .modal-box label { width: 100%; }
  .modal-box input, .modal-box select, .modal-box textarea { font-size: 16px; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1; text-align: center; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  table { font-size: 12px; }
  th, td { padding: 9px 10px; }
  .detail-body { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dept-grid { grid-template-columns: 1fr; }
  .workflow { gap: 4px; padding: 10px 12px; }
  .wf-dot { width: 20px; height: 20px; font-size: 11px; }
  .wf-name { font-size: 12px; }
  /* 防止 iOS 点击输入框时页面缩放 */
  .adv-panel input, .colf, .colf-multi-toggle, .ms-btn, .combobox input, .inp, input.wide, textarea { font-size: 16px; }
  /* 移动端：彻底关闭冻结列，避免 sticky 锁死横向滚动，整表正常横滑 */
  #drafts-table.frozen-4 th,
  #drafts-table.frozen-4 td,
  #drafts-table.frozen-4 .col-filter-row td,
  #dept-table.frozen-4 th,
  #dept-table.frozen-4 td,
  #dept-table.frozen-4 .col-filter-row td {
    position: static !important;
    left: auto !important;
    box-shadow: none !important;
    z-index: auto !important;
  }
}
@media (max-width: 480px) {
  .who { display: none !important; }
  .kpi-row { grid-template-columns: 1fr; }
  .ms-panel { max-width: calc(100vw - 32px); }
}

/* ---------- 自定义滚动条（精致感） ---------- */
.nav::-webkit-scrollbar, .table-wrap::-webkit-scrollbar,
.modal-box::-webkit-scrollbar, .cb-list::-webkit-scrollbar,
.combobox-list::-webkit-scrollbar, textarea::-webkit-scrollbar,
.pick-list::-webkit-scrollbar, .colf-multi-panel::-webkit-scrollbar,
.ms-panel::-webkit-scrollbar, .tasks-board::-webkit-scrollbar,
#draft-detail-body::-webkit-scrollbar { width: 9px; height: 9px; }
.nav::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb,
.modal-box::-webkit-scrollbar-thumb, .cb-list::-webkit-scrollbar-thumb,
.combobox-list::-webkit-scrollbar-thumb, textarea::-webkit-scrollbar-thumb,
.pick-list::-webkit-scrollbar-thumb, .colf-multi-panel::-webkit-scrollbar-thumb,
.ms-panel::-webkit-scrollbar-thumb, .tasks-board::-webkit-scrollbar-thumb,
#draft-detail-body::-webkit-scrollbar-thumb {
  background: var(--scb); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.nav::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover,
.modal-box::-webkit-scrollbar-thumb:hover, .cb-list::-webkit-scrollbar-thumb:hover,
.combobox-list::-webkit-scrollbar-thumb:hover, .colf-multi-panel::-webkit-scrollbar-thumb:hover,
.ms-panel::-webkit-scrollbar-thumb:hover { background: var(--scb-h); background-clip: padding-box; }
.nav::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }

/* 侧栏滚动条在深色底上用浅色滑块 */
.sidebar .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); background-clip: padding-box; }
.sidebar .nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.42); background-clip: padding-box; }

/* 徽标配细边，更精致 */
.badge { border: 1px solid rgba(0,0,0,.04); }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar, .sb-mask, .filters, .toolbar, .modal { display: none; }
  .content { margin-left: 0; }
  .tab { display: block !important; }
  body { background: #fff; }
}

/* ---------- 系统模块维护 ---------- */
.mod-input { width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fbfcfe; transition: var(--t); }
.mod-input:focus { outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 2px rgba(26, 115, 199, .12); }
#modules-table td { vertical-align: middle; }
#modules-table .idx { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.use-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--brand-soft); color: var(--brand); }
.use-tag.zero { background: #f1f4f8; color: var(--ink-3); }

/* ---------- 同步底稿状态弹窗 ---------- */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.sync-auth { background: #f7f8fa; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 10px; }
.sync-summary { margin-top: 8px; color: var(--ok); font-weight: 500; }

/* ---------- 科室对应（映射配置） ---------- */
.chips-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2f7; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.chip-x { color: var(--warn); cursor: pointer; font-weight: 700; }
.map-table { width: 100%; max-width: 560px; }
.map-table input, .map-table select { width: 100%; }
.mini-input { width: 160px !important; }
.mini-btn { padding: 2px 10px; }
.mi-del, .mi-del2 { color: var(--warn); cursor: pointer; }

/* ---------- 附件（登记 / 底稿编辑 / 详情） ---------- */
.att-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.att-empty { color: var(--muted, #888); font-size: 13px; }
.att-item { display: flex; align-items: center; gap: 8px; background: #f7f8fa; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 10px; }
.att-link { color: var(--link, #1565c0); cursor: pointer; text-decoration: underline; word-break: break-all; }
.att-link:hover { color: #0d47a1; }
.att-meta { color: var(--muted, #888); font-size: 12px; white-space: nowrap; }
.att-del { margin-left: auto; background: transparent; border: none; color: var(--warn, #d33); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.att-del:hover { color: #b71c1c; }
.att-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 12px; color: #fff; background: #0a9c8f; border-radius: 999px; vertical-align: middle; }

/* ---------- 项目管理计划（看板） ---------- */
.plans-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 16px; margin-bottom: 14px; box-shadow: var(--sh);
}
.plans-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ps-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
  background: #f3f6fb; border: 1px solid var(--line);
}
.ps-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--brand-3)); }
.ps-total::before { display: none; }
.ps-total { background: var(--brand-soft); border-color: #cfe0f3; color: var(--brand); }
.plans-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.plans-filters select, .plans-filters input {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; font-size: 13px;
  color: var(--ink); background: #fbfcfe; transition: var(--t); min-width: 130px;
}
.plans-filters input { min-width: 190px; }
.plans-filters select:focus, .plans-filters input:focus {
  outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(26,115,199,.12);
}

/* 模块（最外层分组容器） */
.module-list { display: flex; flex-direction: column; gap: 16px; }
.module-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.module-header {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; user-select: none;
  background: linear-gradient(180deg, #f3f7fb 0%, #eaf1f9 100%); border-bottom: 1px solid var(--line);
}
.module-header:hover { background: #e6eef7; }
.module-toggle { width: 22px; height: 22px; flex: none; display: grid; place-items: center; color: var(--brand); font-size: 14px; font-weight: 700; }
.module-tag { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--brand-2); background: #e4effb; flex: none; }
.module-name { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.module-count { margin-left: 2px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.module-badges { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.module-badge { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--c, var(--ink-3)); }
.module-ops { display: flex; gap: 6px; margin-left: 12px; }
.module-body { padding: 10px 14px; }
.module-body.collapsed { display: none; }
.module-empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 22px 0; }

:root { --plan-cols: 24px 48px minmax(150px,1.6fr) 104px 96px 66px 116px 128px 128px minmax(140px,1fr) 78px; }
.plan-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sh); }
.plan-thead {
  display: grid; grid-template-columns: var(--plan-cols);
  align-items: center; gap: 8px 10px;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  padding: 9px 12px; background: #f1f6fb; border-bottom: 1px solid var(--line);
  border-radius: var(--r) var(--r) 0 0; white-space: normal;
}
.plan-thead > span { line-height: 1.3; }
.plan-tree {
  background: transparent; border: none; box-shadow: none; padding: 6px 8px 10px;
}
.plan-empty { color: var(--ink-3); font-size: 14px; text-align: center; padding: 40px 0; }
.pt-node { position: relative; }
.pt-children { margin-left: 18px; padding-left: 14px; border-left: 2px dashed #e3eaf3; }
.plan-grid {
  display: grid; grid-template-columns: var(--plan-cols);
  align-items: center; gap: 8px 10px;
}
.pt-row {
  padding: 6px 12px; border-radius: 8px; transition: background .15s ease;
}
.pt-row:hover { background: #f5f9fe; }
.pt-hit { background: #fff7e6; }
.pt-hit:hover { background: #fff1d6; }
.pt-toggle {
  width: 20px; height: 20px; display: grid; place-items: center; cursor: pointer;
  color: var(--brand); font-size: 12px; border-radius: 6px; user-select: none; justify-self: center;
}
.pt-toggle:hover { background: rgba(26,115,199,.1); }
.pt-toggle.pt-leaf { color: #c2ccd8; cursor: default; font-size: 9px; }
.pt-toggle.pt-leaf:hover { background: transparent; }
.pt-kind { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; justify-self: start; white-space: nowrap; }
.pt-kind.phase { color: #fff; background: var(--brand); }
.pt-kind.sub { color: var(--brand-2); background: #e4effb; }
.pt-ops { display: flex; gap: 6px; justify-self: end; }
.pt-ops .btn { padding: 3px 9px; font-size: 12px; }

/* 行内即时编辑（无需弹窗） */
.pt-edit {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 8px; width: 100%; min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pt-edit:hover { border-color: #b9d2ef; }
.pt-edit:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,115,199,.15); }
.pt-edit::placeholder { color: #aab4c2; }
.pt-title-edit { font-weight: 600; font-size: 14px; }
.pt-owner-edit { font-size: 12.5px; }
.pt-status-edit { font-size: 12px; font-weight: 600; cursor: pointer; }
.pt-prio-edit { font-size: 12px; cursor: pointer; }
.pt-date-edit { font-size: 12px; color: var(--ink-2); padding: 3px 6px; }
.pt-remark-edit { font-size: 12.5px; line-height: 1.35; resize: vertical; min-height: 30px; }
.pt-prog-cell { display: flex; align-items: center; gap: 6px; }
.pt-prog-edit { flex: 1; min-width: 0; accent-color: var(--brand); }
.pt-prog-val { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
@media (max-width: 980px) {
  .plan-thead { font-size: 11px; }
}

/* 弹窗内上级计划提示 */
.modal-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.modal-sub b { color: var(--brand); }
.confirm-sub { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; }

/* 新建/编辑弹窗内的进度条 */
.prog-edit { display: flex; align-items: center; gap: 12px; }
.prog-edit input[type=range] { flex: 1; accent-color: var(--brand); }
#pl-progress-val { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 40px; }

@media (max-width: 720px) {
  .plans-filters { width: 100%; }
  .plans-filters select, .plans-filters input { flex: 1; min-width: 0; }
}
.detail-attach-title { margin-top: 14px; font-weight: 600; color: var(--text, #222); }

/* ---------- 自定义列顺序弹窗 ---------- */
.modal.col-modal { z-index: 320; }
.col-modal .modal-hd { display:flex; align-items:center; justify-content:space-between; font-size:16px; font-weight:600; color:var(--ink); }
.col-modal .modal-close { cursor:pointer; font-size:20px; line-height:1; color:var(--ink-2); }
.col-modal .modal-close:hover { color:var(--brand); }
.col-modal .modal-bd { padding:8px 0; }
.col-modal .modal-tip { font-size:12.5px; color:var(--ink-2); margin:0 0 10px; }
.col-order-list { list-style:none; margin:0; padding:0; max-height:52vh; overflow-y:auto; }
.col-order-item { display:flex; align-items:center; gap:10px; padding:9px 12px; margin-bottom:6px; background:var(--card-grad); border:1px solid rgba(226,233,241,.9); border-radius:10px; cursor:grab; user-select:none; }
.col-order-item.dragging { opacity:.5; border-style:dashed; }
.col-order-item .col-drag { color:var(--ink-3); font-size:15px; }
.col-order-item .col-idx { width:22px; height:22px; line-height:22px; text-align:center; border-radius:50%; background:var(--brand-grad); color:#fff; font-size:12px; }
.col-order-item .col-name { font-size:14px; color:var(--ink); }
.col-modal .modal-ft { display:flex; justify-content:flex-end; gap:10px; }

/* ---------- 系统清单建设情况（列筛选 + 行内编辑 + 备注） ---------- */
.sys-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sys-kw { width: 320px; max-width: 100%; padding: 7px 11px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fbfcfe; color: var(--ink); }
.sys-kw:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(26,115,199,.12); }
.sys-toolbar .hint { margin: 0 0 0 auto; }
#systems-table { font-size: 13px; }
#systems-table th { background: var(--bg); font-weight: 600; white-space: nowrap; }
#systems-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-filter-row td { background: #fff; padding: 4px 6px; }
.sysf { width: 100%; box-sizing: border-box; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfe; color: var(--ink); }
.sysf:focus { outline: none; border-color: var(--brand-2); }
.sysf-clr { font-size: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-2); cursor: pointer; }
.sysf-clr:hover { color: var(--brand); border-color: var(--brand-2); }
.sys-cell { cursor: pointer; }
.sys-cell:hover { background: var(--brand-soft); }
.sys-cell.sys-empty { color: var(--ink-3); }
.sys-cell.editing { padding: 2px; background: #fff; }
.sys-edit { width: 100%; box-sizing: border-box; font-size: 13px; padding: 4px 6px; border: 1px solid var(--brand-2); border-radius: 6px; background: #fff; color: var(--ink); }
.sys-edit:focus { outline: none; box-shadow: 0 0 0 3px rgba(26,115,199,.12); }
.sys-del { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #c0392b; cursor: pointer; }
.sys-del:hover { background: #fdecea; border-color: #e6b0aa; }
/* 横向滚动时冻结前 3 列（序号 / 业务大类 / 系统名称），背景需不透明 */
#systems-table th:nth-child(-n+3), #systems-table td:nth-child(-n+3) { position: sticky; background: #fff; z-index: 2; }
#systems-table th:nth-child(1), #systems-table td:nth-child(1) { left: 0; }
#systems-table th:nth-child(2), #systems-table td:nth-child(2) { left: 70px; }
#systems-table th:nth-child(3), #systems-table td:nth-child(3) { left: 270px; }
#systems-table th:nth-child(-n+3) { z-index: 3; background: var(--bg); }
#systems-table td:nth-child(-n+3):hover { background: var(--brand-soft); }
@media (max-width: 768px) {
  .sys-kw { width: 100%; }
  .sys-toolbar .hint { margin-left: 0; }
}
