/* =====================================================================
   康之源随访云 · 排版调整 V2（2026-12-01）
   纯样式覆盖，不改结构与接口；删除本文件引用即可整体回滚
   V2 修正：①固定列宽改为百分比，宽屏自适应 ②单元格溢出裁切，杜绝压字重叠
            ③深色主题（green/black）配色改用主题变量 ④取消悬停展开造成的白条
   ===================================================================== */

/* ---------- 1. 表格密度 ---------- */
.table-wrap table{font-size:13px}
.table-wrap thead th{
  padding:9px 12px !important;
  font-size:12px !important;
  letter-spacing:.2px;
}
.table-wrap tbody td{
  padding:7px 12px !important;
  line-height:1.45 !important;
  box-sizing:border-box;
}
.table-wrap tbody tr{height:auto}

/* 时间列 / 方式列不折行 */
#tb-workbench td:nth-child(6),#tb-workbench td:nth-child(7),#tb-workbench td:nth-child(8),
#tb-tasks td:nth-child(7),#tb-tasks td:nth-child(8),#tb-tasks td:nth-child(10),#tb-tasks td:nth-child(11){
  white-space:nowrap;
}

/* ---------- 2. 操作列按钮化 ---------- */
.table-wrap a.link{
  display:inline-block;
  padding:3px 6px;
  margin-right:3px;
  border-radius:6px;
  font-size:11.5px;
  color:var(--kz-acc,#175cd3);
  background:var(--kz-soft,#f7faff);
  border:1px solid var(--kz-softbd,#e5eefb);
  text-decoration:none;
  transition:.15s;
  white-space:nowrap;
}
.table-wrap a.link:hover{
  background:var(--kz-accsoft,#eaf2ff);
  border-color:var(--kz-acc,#c9dcff);
  color:var(--kz-acc,#0b4ea2);
}
.table-wrap a.link:first-child{
  background:var(--kz-accsoft,#eef4ff);
  border-color:var(--kz-acc,#c9dcff);
  color:var(--kz-acc,#175cd3);
  font-weight:600;
}
.table-wrap a.link:first-child:hover{
  background:var(--kz-acc,#2563eb);
  border-color:var(--kz-acc,#2563eb);
  color:var(--kz-card,#fff);
}
.table-wrap td:last-child{white-space:nowrap}

/* ---------- 3. 工具栏 ---------- */
.toolbar{flex-wrap:wrap !important;row-gap:8px}
#tab-workbench .toolbar{
  flex-wrap:nowrap !important;
  overflow-x:auto;
  padding-bottom:2px;
  scrollbar-width:thin;
}
.toolbar::-webkit-scrollbar{height:4px}
.toolbar::-webkit-scrollbar-thumb{background:var(--kz-line,#dfe7f3);border-radius:2px}
.toolbar .chips{flex:0 0 auto;flex-wrap:nowrap}
.toolbar input:not([type="checkbox"]):not([type="radio"]){
  flex:1 1 180px;min-width:150px;width:auto !important;
}
.toolbar input[type="checkbox"]{flex:0 0 auto !important;min-width:0 !important;width:15px !important;height:15px !important}
.toolbar select{flex:0 0 auto}
.toolbar button{flex:0 0 auto}

/* ---------- 4. 指标卡：按张数定列数，消灭孤卡 ---------- */
.cards{grid-template-columns:repeat(auto-fit,minmax(200px,1fr)) !important;gap:12px !important}
.cards:has(> .card:nth-child(3):last-child){grid-template-columns:repeat(3,1fr) !important}
.cards:has(> .card:nth-child(4):last-child){grid-template-columns:repeat(4,1fr) !important}
.cards:has(> .card:nth-child(5):last-child){grid-template-columns:repeat(5,1fr) !important}
.cards:has(> .card:nth-child(6):last-child){grid-template-columns:repeat(6,1fr) !important}
.card{min-height:84px !important;padding:12px 16px !important}
.card em{font-size:26px !important;letter-spacing:-.4px !important}
.card span{font-size:12px !important}

.wb-hero{align-items:stretch}
.wb-hero > .wb-card{display:flex;flex-direction:column;justify-content:space-between}

/* ---------- 5. 内容区留白（收紧侧栏到内容的距离，与面包屑同一条左对齐线） ---------- */
.tab{padding:18px 18px 40px !important}
.pagebar{padding:12px 18px !important}
.panel{margin-bottom:16px}

/* ---------- 6. 左侧导航 ---------- */
#app{border-right:0}
nav a{padding:5px 10px !important;font-size:12.5px !important;margin:2px 8px 2px 5px !important;border-radius:8px}
nav .nav-group{padding:9px 14px 3px !important;font-size:10.5px !important;letter-spacing:1.2px}
/* 侧栏与内容之间：一条细分隔线，让间距看得见而不是糊在一起 */
#app > nav, #app > .side, #app > aside{border-right:1px solid var(--kz-line,rgba(128,128,128,.16))}

/* ---------- 6b. 菜单图标（线性单色，随主题取色） ---------- */
nav a::before{
  content:'' !important;
  width:15px !important;height:15px !important;
  flex:none;
  border-radius:0 !important;
  background:currentColor !important;
  box-shadow:none !important;
  opacity:.62;
  -webkit-mask:var(--ico,url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='7'/></svg>")) center/contain no-repeat;
  mask:var(--ico,url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='7'/></svg>")) center/contain no-repeat;
  transition:opacity .15s;
}
nav a:hover::before{opacity:.9}
nav a.on::before{opacity:1;background:currentColor !important;box-shadow:none !important}
nav a.on{font-weight:600}

nav a[data-tab="workbench"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1.6'/><rect x='14' y='3' width='7' height='7' rx='1.6'/><rect x='3' y='14' width='7' height='7' rx='1.6'/><rect x='14' y='14' width='7' height='7' rx='1.6'/></svg>")}
nav a[data-tab="tasks"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10 6h10M10 12h10M10 18h10'/><path d='M3.5 6l1.6 1.6L8 4.7'/><path d='M3.5 12l1.6 1.6L8 10.7'/><path d='M3.5 18l1.6 1.6L8 16.7'/></svg>")}
nav a[data-tab="patients"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='3.6'/><path d='M5 20c1.2-3.7 3.8-5.5 7-5.5s5.8 1.8 7 5.5'/></svg>")}
nav a[data-tab="groups"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7.5A2 2 0 0 1 5 5.5h3.6l2 2.4H19a2 2 0 0 1 2 2v7.6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/></svg>")}
nav a[data-tab="records"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8.4'/><path d='M12 7.4V12l3.2 2'/><path d='M4.2 9.2L2.6 5.6'/></svg>")}
nav a[data-tab="remind"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 9.2a6 6 0 1 0-12 0c0 4.6-1.8 5.8-1.8 5.8h15.6S18 13.8 18 9.2z'/><path d='M10.4 20a2 2 0 0 0 3.2 0'/></svg>")}
nav a[data-tab="stats"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V11M10 20V4M16 20v-6M22 20H2'/></svg>")}
nav a[data-tab="basic"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='6' rx='7.6' ry='3'/><path d='M4.4 6v12c0 1.7 3.4 3 7.6 3s7.6-1.3 7.6-3V6'/><path d='M4.4 12c0 1.7 3.4 3 7.6 3s7.6-1.3 7.6-3'/></svg>")}
nav a[data-tab="disease"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 12.5h4l2-4.5 3 9 2-4.5h8'/></svg>")}
nav a[data-tab="templates"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/><path d='M14 3v5h5M9 13h6M9 17h4'/></svg>")}
nav a[data-tab="smstpl"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 11.5a8 8 0 0 1-11.6 7.2L4 20.5l1.6-5A8 8 0 1 1 21 11.5z'/></svg>")}
nav a[data-tab="sms"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21.5 3.5L2.8 10.4l7.3 3 3 7.3z'/><path d='M21.5 3.5L10.1 13.4'/></svg>")}
nav a[data-tab="channels"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.2 13.8a5 5 0 0 0 7 0l2.4-2.4a5 5 0 1 0-7-7l-1.2 1.2'/><path d='M13.8 10.2a5 5 0 0 0-7 0l-2.4 2.4a5 5 0 1 0 7 7l1.2-1.2'/></svg>")}
nav a[data-tab="ai"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6.6 3.6h2.6l1.4 3.8-2 1.5a12.5 12.5 0 0 0 6.5 6.5l1.5-2 3.8 1.4v2.6a2 2 0 0 1-2 2A16.5 16.5 0 0 1 4.6 5.6a2 2 0 0 1 2-2z'/></svg>")}
nav a[data-tab="users"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3.4'/><path d='M3 20c.9-3.4 3.1-5.1 6-5.1s5.1 1.7 6 5.1'/><path d='M16 5.1a3.4 3.4 0 0 1 0 5.9M17.4 14.8c2 .7 3.3 2.2 3.9 4.6'/></svg>")}
nav a[data-tab="roles"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7 2.8v6c0 4.4-3 7.6-7 9-4-1.4-7-4.6-7-9v-6z'/><path d='M9 12l2.2 2.2L15.4 10'/></svg>")}
nav a[data-tab="menus"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6h16M4 12h16M4 18h9'/><circle cx='19' cy='18' r='1.6'/></svg>")}
nav a[data-tab="logs"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/><path d='M14 3v5h5M8.6 13h6.8M8.6 17h4.6'/></svg>")}
nav a[data-tab="settings"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7h9M17.5 7H21M3 17h4.5M13 17h8'/><circle cx='14.8' cy='7' r='2.4'/><circle cx='10.2' cy='17' r='2.4'/></svg>")}
nav a[data-tab="help"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M9.3 9.3a2.9 2.9 0 0 1 5.6 1c0 2-2.8 2.3-2.8 4'/><path d='M12 17.4h.01'/></svg>")}
nav a[data-tab="kzy"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M15.2 3a5 5 0 0 0-4.6 7.2L3 17.8V21h3.2l7.6-7.6A5 5 0 0 0 21 8.8l-3.2 1.8-2.4-2.4z'/></svg>")}
nav a[data-tab="license"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='15.5' r='4.2'/><path d='M11 12.5l8-8M16.5 4.5l3 3M14.5 6.5l2 2'/></svg>")}
nav a[data-tab="upgrade"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 18a4 4 0 0 1 .4-8 6 6 0 0 1 11.6 1.6A3.5 3.5 0 0 1 17.6 18'/><path d='M12 21v-9.6M9 14.2l3-3 3 3'/></svg>")}
nav a[data-tab="aiplatform"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='6' y='6' width='12' height='12' rx='2.5'/><rect x='10' y='10' width='4' height='4' rx='1'/><path d='M9 2.5v3.5M15 2.5v3.5M9 18v3.5M15 18v3.5M2.5 9H6M2.5 15H6M18 9h3.5M18 15h3.5'/></svg>")}
nav a[data-tab="project"]{--ico:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='7' width='18' height='13' rx='2'/><path d='M8.5 7V5.2a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2V7M3 12.4h18'/></svg>")}

/* ---------- 7. 顶栏 ---------- */
.appbar-right{gap:12px !important}
.theme-dots{gap:5px !important}
.theme-dots a{width:13px !important;height:13px !important}
/* 品牌名与版本号紧贴成一行 */
.appbar-brand{gap:3px !important;align-items:center}
.appbar-brand b{max-width:none !important;overflow:visible !important}
.appbar-brand small{
  font-size:10px !important;
  padding:1px 6px !important;
  margin:0 0 0 1px !important;
  align-self:center;
  line-height:1.5;
  border-radius:999px;
}

/* ---------- 8. 空数据占位 ---------- */
.table-wrap td.empty{
  color:var(--kz-t3,#98a2b3) !important;
  padding:54px 12px !important;
  text-align:center;
  font-size:13px;
  line-height:1.9;
}
.table-wrap td.empty::before{
  content:'';
  display:block;
  width:34px;height:34px;
  margin:0 auto 10px;
  opacity:.30;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5 12 4l9 4.5-9 4.5z'/><path d='M3 8.5V15l9 4.5 9-4.5V8.5'/><path d='M12 13v6.5'/></svg>") center/contain no-repeat;
  mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5 12 4l9 4.5-9 4.5z'/><path d='M3 8.5V15l9 4.5 9-4.5V8.5'/><path d='M12 13v6.5'/></svg>") center/contain no-repeat;
}

/* 工具栏控件统一高度，不再高低不齐 */
.toolbar input:not([type="checkbox"]):not([type="radio"]),
.toolbar select,
.toolbar button,
.toolbar .btn{height:32px !important;box-sizing:border-box !important;font-size:12.5px !important}

/* ---------- 9. 工作台表：百分比定宽 + 溢出裁切（宽屏自适应，绝不压字） ---------- */
#tb-workbench{table-layout:fixed;width:100% !important;min-width:1040px !important}
#tb-workbench th,#tb-workbench td{box-sizing:border-box;overflow:hidden}
#tb-workbench th:nth-child(1){width:26px}
#tb-workbench th:nth-child(2){width:122px}
#tb-workbench th:nth-child(3){width:108px}
#tb-workbench th:nth-child(4){width:90px}
#tb-workbench th:nth-child(5){width:auto}
#tb-workbench th:nth-child(6){width:128px}
#tb-workbench th:nth-child(7){width:128px}
#tb-workbench th:nth-child(8){width:74px}
#tb-workbench th:nth-child(9){width:240px}
#tb-workbench tbody td:nth-child(2),
#tb-workbench tbody td:nth-child(4){
  white-space:nowrap !important;text-overflow:ellipsis;
}
/* 紧急度徽章：完整显示“逾期 15 天以上”这类最长文案 */
#tb-workbench tbody td:nth-child(2) .tag,
#tb-workbench tbody td:nth-child(2) .badge{
  display:inline-block;
  font-size:11.5px !important;
  padding:1px 7px !important;
  white-space:nowrap;
  max-width:100%;
}
#tb-workbench tbody td:nth-child(5){white-space:normal !important;line-height:1.32 !important}
#tb-workbench tbody td:nth-child(3){line-height:1.3 !important}
#tb-workbench tbody td:nth-child(3) span{font-size:11.5px;opacity:.72;display:block}

/* ---------- 10. 随访任务表：11 列压缩到 1280 一屏放下（不横滚，操作列可见） ---------- */
#tb-tasks{table-layout:fixed;width:100% !important;min-width:1040px !important}
#tb-tasks th,#tb-tasks td{box-sizing:border-box;overflow:hidden}
#tb-tasks{font-size:12.5px}
#tb-tasks th:nth-child(1){width:26px}
#tb-tasks th:nth-child(2){width:64px}
#tb-tasks th:nth-child(3){width:96px}
#tb-tasks th:nth-child(4){width:62px}
#tb-tasks th:nth-child(5){width:70px}
#tb-tasks th:nth-child(6){width:auto}
#tb-tasks th:nth-child(7){width:130px !important}
#tb-tasks th:nth-child(8){width:112px !important}
#tb-tasks th:nth-child(9){width:46px}
#tb-tasks th:nth-child(10){width:66px}
#tb-tasks th:nth-child(11){width:236px !important}
#tb-tasks tbody td:nth-child(6){white-space:normal !important;line-height:1.32 !important}
#tb-tasks td:last-child{white-space:nowrap !important}
#tb-tasks td:last-child a.link{margin-bottom:3px}

/* ---------- 11. 深色主题（green / black）兜底 ---------- */
html[data-theme="green"] .table-wrap,
html[data-theme="black"] .table-wrap{background:var(--kz-card,#181b1f) !important}
html[data-theme="green"] .table-wrap thead th,
html[data-theme="black"] .table-wrap thead th{background:var(--kz-hover) !important}
html[data-theme="green"] .table-wrap a.link,
html[data-theme="black"] .table-wrap a.link{color:var(--kz-acc) !important}
html[data-theme="green"] .table-wrap tbody tr:hover td,
html[data-theme="black"] .table-wrap tbody tr:hover td{background:var(--kz-hover) !important}

/* ---------- 12. 服务健康小块：4 列排布 ---------- */
#health-grid{grid-template-columns:repeat(auto-fit,minmax(228px,1fr)) !important}

/* ---------- 13. 窄屏兜底 ---------- */
@media (max-width:1200px){
  .cards:has(> .card:nth-child(5):last-child),
  .cards:has(> .card:nth-child(6):last-child){grid-template-columns:repeat(3,1fr) !important}
  #tb-workbench th:nth-child(5){width:13%}
  #tb-workbench th:nth-child(9){width:24%}
}

/* ---------- 14. 窄屏（≤1400）把空间让给分组列，行高更整齐 ---------- */
@media (max-width:1400px){
  #tb-workbench th:nth-child(2){width:112px}
  #tb-workbench th:nth-child(4){width:82px}
  #tb-workbench th:nth-child(8){width:70px}
  #tb-workbench th:nth-child(9){width:218px}
  #tb-workbench tbody td:nth-child(5){font-size:12px !important}
}
/* ---------- 15. 工具栏按钮紧凑，页面筛选区最多两行 ---------- */
.toolbar{gap:8px !important}
.toolbar button,.toolbar .btn{padding:0 12px !important;white-space:nowrap}
.toolbar select{width:auto !important;min-width:104px;max-width:140px}
#tab-patients .toolbar input#pt-kw{flex:0 0 226px !important;min-width:0 !important}
#tab-patients .toolbar label{white-space:nowrap}
#tab-patients .toolbar span#pt-status-sum{white-space:nowrap;margin-right:2px}
#tab-tasks .toolbar input#tk-kw{flex:0 0 180px !important;min-width:0 !important}

/* ---------- 16. 普通表格：长串一律折行，绝不压到邻列 ---------- */
.table-wrap th,.table-wrap td{word-break:break-word !important;overflow-wrap:anywhere}
#tb-templates th:nth-child(5),#tb-templates td:nth-child(5){min-width:210px}
#tb-templates th:nth-child(6),#tb-templates td:nth-child(6){min-width:96px;white-space:nowrap}
#tb-templates th:nth-child(2),#tb-templates td:nth-child(2){min-width:96px}
/* 患者管理第二行：勾选项靠右与按钮成组 */
#tab-patients .toolbar label{margin-left:auto}
#tb-templates th:nth-child(1),#tb-templates td:nth-child(1){min-width:160px}
#tb-templates th:nth-child(8),#tb-templates td:nth-child(8){min-width:150px;white-space:nowrap}

/* ---------- 17. 表单密度 ---------- */
.field{margin-bottom:10px !important}
.field label{margin-bottom:5px !important;font-size:12px !important}
.grid2{gap:10px 14px !important}

/* ---------- 18. 随访分组表：列保底宽度，避免“胃肠外/科”“电话/手/工”拆字 ---------- */
#tb-groups th:nth-child(1),#tb-groups td:nth-child(1){min-width:176px}
#tb-groups th:nth-child(2),#tb-groups td:nth-child(2){min-width:88px;white-space:nowrap}
#tb-groups th:nth-child(3),#tb-groups td:nth-child(3){min-width:78px;white-space:nowrap}
#tb-groups th:nth-child(4),#tb-groups td:nth-child(4){min-width:90px}
#tb-groups th:nth-child(5),#tb-groups td:nth-child(5){white-space:nowrap}
#tb-groups th:nth-child(7),#tb-groups td:nth-child(7){white-space:nowrap}
#tb-groups th:nth-child(8),#tb-groups td:nth-child(8){min-width:132px}
#tb-groups th:nth-child(10),#tb-groups td:nth-child(10){min-width:192px;white-space:nowrap}
#tb-groups th:nth-child(6),#tb-groups td:nth-child(6){min-width:146px}
#tb-groups th:nth-child(9),#tb-groups td:nth-child(9){min-width:126px}
#tb-groups th:nth-child(7),#tb-groups td:nth-child(7){min-width:56px}
#tb-groups{min-width:1190px !important;width:100% !important}
#tb-groups td:last-child a.link{font-size:11px !important;padding:2px 5px !important;margin-right:2px !important}
#tb-groups{min-width:1230px !important}

/* ---------- 19. 操作日志表：定宽，动作列不再吞掉整行 ---------- */
#tb-logs{table-layout:fixed;width:100% !important}
#tb-logs th,#tb-logs td{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}
#tb-logs th:nth-child(1),#tb-logs td:nth-child(1){width:172px}
#tb-logs th:nth-child(2),#tb-logs td:nth-child(2){width:124px}
#tb-logs th:nth-child(3),#tb-logs td:nth-child(3){width:200px}
#tb-logs th:nth-child(4),#tb-logs td:nth-child(4){width:192px}
#tb-logs th:nth-child(5),#tb-logs td:nth-child(5){width:auto}
#tb-logs td:nth-child(1){white-space:nowrap;color:var(--kz-t3);font-variant-numeric:tabular-nums}
#tb-logs td:nth-child(3){white-space:nowrap}
#tb-logs tbody tr:hover td{background:var(--kz-hover) !important}

/* ---------- 20. 短信选人列表：每行左对齐成列，不挤成一串 ---------- */
#sm-patient-list label{
  display:flex !important;
  align-items:center;
  gap:10px;
  margin:0 !important;
  padding:5px 8px;
  border-radius:7px;
  font-size:12.5px;
  cursor:pointer;
}
#sm-patient-list label:hover{background:var(--kz-hover)}
#sm-patient-list label input[type="checkbox"]{margin:0 !important;flex:none}
#sm-patient-list label > span{white-space:nowrap}

/* ---------- 21. 顶部状态小卡：长值折行/高度不齐 ---------- */
#lic-state,#kzy-status{grid-template-columns:repeat(4,minmax(0,1fr)) !important}
#lic-state .hcard,#kzy-status .hcard{min-width:0;overflow:hidden}
#lic-state .hcard b,#kzy-status .hcard b{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  word-break:break-word !important;
  font-size:12px !important;
  line-height:1.35;
  letter-spacing:0 !important;
}

/* ---------- 22. 授权明细表：深色主题下第一列白底 ---------- */
#tb-lic td:first-child{
  background:var(--kz-soft) !important;
  color:var(--kz-t3) !important;
  border-color:var(--kz-line) !important;
}
#tb-lic td{border-color:var(--kz-line) !important}
#tb-tic td{color:inherit}

/* ---------- 23. 菜单管理表：标识列收窄，操作列给足，按钮不再贴边 ---------- */
#tb-menus{table-layout:fixed;width:100% !important}
#tb-menus th,#tb-menus td{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}
#tb-menus th:nth-child(1),#tb-menus td:nth-child(1){width:72px}
#tb-menus th:nth-child(2),#tb-menus td:nth-child(2){width:auto}
#tb-menus th:nth-child(3),#tb-menus td:nth-child(3){width:250px}
#tb-menus th:nth-child(4),#tb-menus td:nth-child(4){width:100px}
#tb-menus th:nth-child(5),#tb-menus td:nth-child(5){width:88px}
#tb-menus th:nth-child(6),#tb-menus td:nth-child(6){width:300px}
#tb-menus td:nth-child(1){white-space:nowrap;color:var(--kz-t3)}
#tb-menus td:nth-child(3){white-space:nowrap;font-family:ui-monospace,Consolas,"Courier New",monospace;font-size:12px;color:var(--kz-t3)}
#tb-menus td:nth-child(6){white-space:nowrap;padding-left:8px;padding-right:8px}
#tb-menus td:nth-child(6) button{margin:0 2px;font-size:11.5px;padding:3px 7px}
@media (max-width:1400px){
  #tb-menus th:nth-child(3),#tb-menus td:nth-child(3){width:210px}
  #tb-menus th:nth-child(6),#tb-menus td:nth-child(6){width:282px}
}

/* ---------- 24. 短信选人列表：姓名/病历号/手机/分组 分列对齐 ---------- */
#sm-patient-list .sm-row{
  display:grid;
  grid-template-columns:16px 78px 122px 112px 1fr;
  align-items:center;
  gap:16px;
  margin:0;
  padding:6px 10px;
  border-radius:7px;
  font-size:12.5px;
  cursor:pointer;
}
#sm-patient-list .sm-row{border-bottom:1px solid var(--kz-line)}
#sm-patient-list .sm-row > span.sm-no,
#sm-patient-list .sm-row > span.sm-ph,
#sm-patient-list .sm-row > span.sm-gp{border-left:1px solid var(--kz-line);padding-left:14px}
#sm-patient-list .sm-row > span.sm-ph,
#sm-patient-list .sm-row > span.sm-gp{font-size:12px;opacity:.92}
#sm-patient-list .sm-row:last-child{border-bottom:0}
#sm-patient-list .sm-row:hover{background:var(--kz-hover)}
#sm-patient-list .sm-row input[type="checkbox"]{margin:0 !important;width:auto;flex:none}
#sm-patient-list .sm-row .sm-nm{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#sm-patient-list .sm-row .sm-no,
#sm-patient-list .sm-row .sm-ph{color:var(--kz-t3);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#sm-patient-list .sm-row .sm-gp{color:var(--kz-t3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:1400px){
  #sm-patient-list .sm-row{grid-template-columns:16px 68px 112px 100px 1fr;gap:12px}
}

/* ---------- 25. 顶栏配色：三个圆点收成调色盘，悬停展开 ---------- */
.appbar .theme-dots,.theme-dots{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
  width:28px;
  height:26px;
  padding:0;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  overflow:hidden;
  cursor:pointer;
  transition:width .2s ease,gap .2s ease,padding .2s ease;
}
.theme-dots::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:15px;
  height:15px;
  transform:translate(-50%,-50%);
  background:currentColor;
  opacity:.92;
  -webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6a9.4 9.4 0 0 0 0 18.8c1.25 0 2.2-.95 2.2-2.1 0-.55-.22-1.05-.55-1.4-.32-.36-.52-.82-.52-1.3 0-1.1.9-2 2-2h2.25A4.6 4.6 0 0 0 22.3 9.5C21.7 5.5 17.2 2.6 12 2.6z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6a9.4 9.4 0 0 0 0 18.8c1.25 0 2.2-.95 2.2-2.1 0-.55-.22-1.05-.55-1.4-.32-.36-.52-.82-.52-1.3 0-1.1.9-2 2-2h2.25A4.6 4.6 0 0 0 22.3 9.5C21.7 5.5 17.2 2.6 12 2.6z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition:opacity .15s ease;
  pointer-events:none;
}
.theme-dots a{
  width:14px;
  height:14px;
  flex:0 0 14px;
  opacity:0;
  transition:opacity .15s ease;
}
.theme-dots:hover{
  width:84px;
  gap:7px;
  padding:0 9px;
  justify-content:flex-start;
}
.theme-dots:hover::before{opacity:0}
.theme-dots:hover a{opacity:1}
@media (hover:none){
  .theme-dots{width:auto;gap:7px;padding:3px 9px}
  .theme-dots::before{display:none}
  .theme-dots a{opacity:1}
}

/* ---------- 26. 在线咨询浮标：PC 端收成小圆，悬停恢复；顶栏日期提亮 ---------- */
@media (min-width:769px){
  .kim-btn{
    width:38px !important;
    height:38px !important;
    padding:0 !important;
    border-radius:50% !important;
    justify-content:center !important;
    gap:0 !important;
    opacity:.82;
    transition:width .18s ease,border-radius .18s ease,opacity .18s ease,padding .18s ease;
  }
  .kim-btn > span:not(.kim-dot){display:none !important}
  .kim-btn:hover{
    width:auto !important;
    padding:11px 18px !important;
    border-radius:999px !important;
    justify-content:acenter !important;
    opacity:1;
  }
  .kim-btn:hover > span:not(.kim-dot){display:inline !important}
}
.appbar-date{color:rgba(255,255,255,.74) !important}

/* ---------- 27. 通道配置：卡片两列并排，不再只占左侧一窄条 ---------- */
.ch-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:16px !important;
  align-items:start;
}
.ch-grid .ch-card{max-width:none}
.ch-grid .ch-card dl{grid-template-columns:92px minmax(0,1fr)}
.ch-grid .ch-card dl dd{overflow-wrap:anywhere}
@media (max-width:1200px){
  .ch-grid{grid-template-columns:1fr !important}
}

/* ---------- 28. 通道配置：四个区块真正两列并排 ---------- */
.ch-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:18px;
  align-items:start;
}
.ch-col{min-width:0}
.ch-col > .ch-grid{
  grid-template-columns:1fr !important;
  margin-bottom:14px !important;
}
.ch-col > .panel{margin-bottom:14px}
.ch-col > h3{margin-top:0 !important}
@media (max-width:1200px){
  .ch-row{grid-template-columns:1fr}
}

/* ---------------- V33-1 角色权限表：编码/数据范围不再拆字 ---------------- */
#tb-roles{table-layout:fixed;min-width:1120px}
#tb-roles th:nth-child(1),#tb-roles td:nth-child(1){width:206px}
#tb-roles th:nth-child(2),#tb-roles td:nth-child(2){
  width:116px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-family:ui-monospace,Consolas,"Courier New",monospace;font-size:12.5px;color:var(--kz-t2)}
#tb-roles th:nth-child(3),#tb-roles td:nth-child(3){width:96px;white-space:nowrap}
#tb-roles th:nth-child(4),#tb-roles td:nth-child(4){width:auto}
#tb-roles th:nth-child(5),#tb-roles td:nth-child(5){width:76px;text-align:center}
#tb-roles th:nth-child(6),#tb-roles td:nth-child(6){width:88px}
#tb-roles th:nth-child(7),#tb-roles td:nth-child(7){width:116px;white-space:nowrap}
#tb-roles td:nth-child(1) > div{color:var(--kz-t3) !important}
#tb-roles td:nth-child(4){color:var(--kz-t3) !important;line-height:1.6}
#tb-roles td .link{margin-right:10px}

/* ---------------- V33-2 短信模板表：预览不硬切、名称不折版号 ---------------- */
#tb-smstpl{table-layout:fixed;min-width:1120px}
#tb-smstpl th:nth-child(1),#tb-smstpl td:nth-child(1){width:188px}
#tb-smstpl th:nth-child(2),#tb-smstpl td:nth-child(2){width:126px;white-space:nowrap}
#tb-smstpl th:nth-child(3),#tb-smstpl td:nth-child(3){width:92px}
#tb-smstpl th:nth-child(4),#tb-smstpl td:nth-child(4){
  width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--kz-t2) !important}
#tb-smstpl th:nth-child(5),#tb-smstpl td:nth-child(5){width:104px;white-space:nowrap}
#tb-smstpl th:nth-child(6),#tb-smstpl td:nth-child(6){width:88px}
#tb-smstpl th:nth-child(7),#tb-smstpl td:nth-child(7){width:112px;white-space:nowrap}
#tb-smstpl td:nth-child(1) > div{color:var(--kz-t3) !important;font-size:11px}
#tb-smstpl td .link{margin-right:10px}

/* ---------------- V33-3 帮助中心：深浅主题统一可读 ---------------- */
html[data-theme="black"] .hp-side,html[data-theme="green"] .hp-side{
  background:var(--kz-card) !important;border-color:var(--kz-line) !important}
html[data-theme="black"] .hp-cat,html[data-theme="green"] .hp-cat{color:var(--kz-t3) !important}
html[data-theme="black"] .hp-item,html[data-theme="green"] .hp-item{color:var(--kz-t2) !important}
html[data-theme="black"] .hp-item:hover,html[data-theme="green"] .hp-item:hover{background:var(--kz-hover) !important}
html[data-theme="black"] .hp-item.on,html[data-theme="green"] .hp-item.on{color:var(--kz-t1) !important}
html[data-theme="black"] .hp-main,html[data-theme="green"] .hp-main{
  background:var(--kz-card) !important;border-color:var(--kz-line) !important}
html[data-theme="black"] .hp-main h3,html[data-theme="green"] .hp-main h3{color:var(--kz-t1) !important}
html[data-theme="black"] .hp-main h4,html[data-theme="green"] .hp-main h4{color:var(--kz-t1) !important}
html[data-theme="black"] .hp-main p,html[data-theme="green"] .hp-main p,
html[data-theme="black"] .hp-main li,html[data-theme="green"] .hp-main li{color:var(--kz-t2) !important}
html[data-theme="black"] .hp-main .hp-meta,html[data-theme="green"] .hp-main .hp-meta{color:var(--kz-t3) !important}
html[data-theme="black"] .hp-main table th,html[data-theme="green"] .hp-main table th{color:var(--kz-t1) !important}
html[data-theme="black"] .hp-main table td,html[data-theme="green"] .hp-main table td{
  color:var(--kz-t2) !important;border-color:var(--kz-line) !important}
html[data-theme="black"] .hp-main code,html[data-theme="green"] .hp-main code{
  background:var(--kz-soft) !important;color:var(--kz-t1) !important}
html[data-theme="black"] .hp-main .note,html[data-theme="green"] .hp-main .note{
  background:rgba(245,158,11,.13) !important;color:#f0dcae !important}
html[data-theme="black"] .hp-main .hp-empty,html[data-theme="green"] .hp-main .hp-empty{color:var(--kz-t3) !important}
html[data-theme="black"] .hp-bar input,html[data-theme="green"] .hp-bar input{color:var(--kz-t1) !important}

/* ---------------- V34 问卷模板表：操作列三键完整、1280 不横滚 ---------------- */
#tb-templates{table-layout:fixed !important;min-width:1000px !important}
#tb-templates th:nth-child(1),#tb-templates td:nth-child(1){width:172px;min-width:0 !important}
#tb-templates th:nth-child(2),#tb-templates td:nth-child(2){width:104px;min-width:0 !important;line-height:1.55}
#tb-templates th:nth-child(3),#tb-templates td:nth-child(3){width:56px;text-align:center}
#tb-templates th:nth-child(4),#tb-templates td:nth-child(4){width:60px;text-align:center}
#tb-templates th:nth-child(5),#tb-templates td:nth-child(5){width:auto;min-width:0 !important}
#tb-templates th:nth-child(6),#tb-templates td:nth-child(6){width:96px;min-width:0 !important;white-space:nowrap}
#tb-templates th:nth-child(7),#tb-templates td:nth-child(7){width:72px}
#tb-templates th:nth-child(8),#tb-templates td:nth-child(8){
  width:168px;min-width:0 !important;white-space:nowrap;
  padding-left:6px !important;padding-right:6px !important}
#tb-templates td:nth-child(8) .link{margin-right:10px;display:inline-block}
#tb-templates td:nth-child(8) .link:last-child{margin-right:0}
#tb-templates td:nth-child(1) b{display:block;line-height:1.5}
#tb-templates td:nth-child(1) > div{color:var(--kz-t3) !important;font-size:11px;margin-top:2px}
/* 版本胶囊不再撑高行 */
#tb-templates td:nth-child(3) .tag,#tb-templates td:nth-child(3) span{font-size:11px}

/* ---------------- V35 窄屏（≤1366）适配：通道两列回落、两表收窄 ---------------- */
@media (max-width:1380px){
  .ch-row{grid-template-columns:1fr !important}
  .ch-col > .ch-grid{margin-bottom:12px !important}
}
/* 角色权限表：1280 视口不横滚 */
#tb-roles{min-width:1030px !important}
#tb-roles th:nth-child(1),#tb-roles td:nth-child(1){width:196px}
#tb-roles th:nth-child(2),#tb-roles td:nth-child(2){width:108px}
/* 短信模板表：1280 视口不横滚 */
#tb-smstpl{min-width:1030px !important}
#tb-smstpl th:nth-child(1),#tb-smstpl td:nth-child(1){width:178px}
#tb-smstpl th:nth-child(2),#tb-smstpl td:nth-child(2){width:118px}
#tb-smstpl th:nth-child(6),#tb-smstpl td:nth-child(6){width:80px}
#tb-smstpl th:nth-child(7),#tb-smstpl td:nth-child(7){width:104px}
/* 通道卡片：深色主题下操作区分隔虚线不再刺眼；HIS 头部标签与说明拉开 */
html[data-theme="black"] .ch-card .acts,html[data-theme="green"] .ch-card .acts{
  border-top:0 !important;padding-top:5px !important}
#his-box{min-width:0;overflow:hidden}
#his-box > div:first-child{flex-wrap:wrap;row-gap:6px}
#his-box > div:first-child > div:last-child{
  display:flex;gap:6px;align-items:center;flex:none;margin-left:14px}
#his-box > div:first-child > div:first-child{min-width:0}
#his-box > div:first-child .muted{line-height:1.6}

/* ---------------- V36 宽屏（≥1600）：病种/科室/随访人不再截字 ---------------- */
@media (min-width:1600px){
  #tb-workbench th:nth-child(4){width:122px !important}
  #tb-tasks th:nth-child(3){width:120px !important}
  #tb-tasks th:nth-child(4){width:88px !important}
  #tb-tasks th:nth-child(5){width:88px !important}
  #tb-tasks th:nth-child(9){width:74px !important}
}

/* ===== V42：PC 端侧栏底部标语与工具行 ===== */

/* 侧栏：内容高于视口时整栏跟着页面滚，底部标语被切掉半截。
   固定成视口高、导航独立滚动，footer 始终完整可见 */
body:has(.side) .side {
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
}
.side nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.side-foot {
  flex: none;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

/* 工具行：1366 屏下 7 个筛选项会顶到右边界，允许换行并给控件弹性 */
.toolbar {
  flex-wrap: wrap;
  row-gap: 8px;
}
.toolbar input,
.toolbar select {
  min-width: 0;
}

/* 侧栏菜单 768 高时放不下 20 项，需要内部滚动：给个看得见的细滚动条 */
.side nav::-webkit-scrollbar { width: 6px; }
.side nav::-webkit-scrollbar-track { background: transparent; }
.side nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .16);
  border-radius: 3px;
}
.side nav:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .28); }

/* PC 端在线咨询浮标：1366×768 下会压住表格最后一列的操作按钮。
   这里只做减法——缩小、贴右边缘、常态半透明，移上去才完全显形。
   彻底让开需要从 IM 侧调挂载位置，属运维中心范围 */
@media (min-width: 1200px) {
  .kim-btn {
    width: 40px !important;
    height: 40px !important;
    right: 0 !important;
    bottom: 18px !important;
    border-radius: 10px 0 0 10px !important;
    opacity: .55;
    transition: opacity .15s;
  }
  .kim-btn:hover { opacity: 1; }
}

/* ============================================================
   V43 · 余下 16 个页面的表格体检（2026-12-01）
   一、单元收紧：11 列表在 1366 下每列多 8px 空间
   二、操作列右侧吸附：表格横向溢出时操作按钮不再被裁
   三、窄列禁止折字：科室/病种/随访人/日期等短文本不再竖排
   ============================================================ */

/* 一、单元格内边距与字号：14px → 10px，13px → 12.5px */
.table-wrap th,
.table-wrap td {
  padding-left: 10px;
  padding-right: 10px;
}
.table-wrap table { font-size: 12.5px; }
.table-wrap thead th { padding-top: 10px; padding-bottom: 10px; }

/* 二、操作列吸附右边缘：表格比容器宽时，操作按钮始终可见 */
.table-wrap th:last-child,
.table-wrap td:last-child {
  position: sticky;
  right: 0;
  background: var(--kz-card, #fff);
  box-shadow: -10px 0 12px -10px rgba(16, 32, 56, .18);
}
.table-wrap thead th:last-child {
  background: var(--kz-thead, #f8fafd);
  z-index: 2;
}

/* 表格横向可滚时给右边缘一点渐隐提示，避免误以为内容就到这里 */
.table-wrap {
  position: relative;
  background-image: linear-gradient(to right, transparent, transparent);
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(16, 32, 56, .18);
  border-radius: 4px;
}
.table-wrap:hover::-webkit-scrollbar-thumb { background: rgba(16, 32, 56, .3); }

/* 三、随访任务表：短文本列不折字（1366 下曾把「消化内科」折成两行、「张明」折成「张/明」） */
#tb-tasks th:nth-child(2), #tb-tasks td:nth-child(2),
#tb-tasks th:nth-child(4), #tb-tasks td:nth-child(4),
#tb-tasks th:nth-child(5), #tb-tasks td:nth-child(5),
#tb-tasks th:nth-child(7), #tb-tasks td:nth-child(7),
#tb-tasks th:nth-child(9), #tb-tasks td:nth-child(9),
#tb-tasks th:nth-child(10), #tb-tasks td:nth-child(10) {
  white-space: nowrap;
}
/* 患者列：手机号与编号是长串，给足宽度不折成三行 */
#tb-tasks th:nth-child(3), #tb-tasks td:nth-child(3) { min-width: 128px; }
#tb-tasks th:nth-child(6), #tb-tasks td:nth-child(6) { min-width: 170px; }
#tb-tasks th:nth-child(8), #tb-tasks td:nth-child(8) { white-space: nowrap; }

/* AI 外呼场景表：「测试」曾被压成竖排两行 */
#tb-ai-scenes th:nth-child(9), #tb-ai-scenes td:nth-child(9),
#tb-ai-scenes th:nth-child(10), #tb-ai-scenes td:nth-child(10) { white-space: nowrap; }

/* 用户管理：角色「系统管理员」压到数据范围列上 */
#tb-users th:nth-child(6), #tb-users td:nth-child(6) { white-space: nowrap; min-width: 84px; }
#tb-users th:nth-child(7), #tb-users td:nth-child(7) { white-space: nowrap; }

/* 病种 / 短信模板 / 角色 / 菜单：操作列三按钮不折行 */
#tb-diseases td:last-child,
#tb-disease-page td:last-child,
#tb-smstpl td:last-child,
#tb-roles td:last-child,
#tb-menus td:last-child,
#tb-templates td:last-child {
  white-space: nowrap;
}

/* 窄屏（<1200）时再收一档内边距，尽量少触发横向滚动 */
@media (max-width: 1199px) {
  .table-wrap th, .table-wrap td { padding-left: 8px; padding-right: 8px; }
  .table-wrap table { font-size: 12px; }
}

/* --- V43b 复验补丁 --- */
/* 患者列：「139****2222-HZ2026110002」是连写长串，128px 仍会折成三行 */
#tb-tasks th:nth-child(3), #tb-tasks td:nth-child(3) {
  min-width: 196px;
  white-space: nowrap;
}
/* 病种列：nowrap 后「胆囊切除术后」会溢出压到下一列，补最小宽 */
#tb-tasks th:nth-child(5), #tb-tasks td:nth-child(5) { min-width: 96px; }

/* 随访分组表 10 列在 1366 下放不进 1130：
   「说明」列与「下一分组」内容重复度高（编辑弹窗里也有），窄屏让位，
   1440 起仍完整显示 */
@media (max-width: 1439px) {
  #tb-groups th:nth-child(9), #tb-groups td:nth-child(9) { display: none; }
}

/* --- V43c：表格宽度策略 --- */
/* 原来 table 固定 width:100%，容器不够宽时浏览器会压缩列，
   nowrap 的内容被裁断（「139****1111-H」「胆囊切除」）。
   改为按内容定宽 + 最小撑满容器，列不再被压缩，溢出交给 .table-wrap 横向滚动，
   操作列已 sticky 在右边缘，滚动时始终可见。 */
.table-wrap > table {
  width: auto !important;
  min-width: 100% !important;
}
/* 长文本列限宽，避免个别说明性字段把表格拉到几千像素 */
.table-wrap td { max-width: 460px; }

/* --- V43d：列宽改用 th 宽度 --- */
/* td 的 min-width 在 table-layout:auto 下不生效（CSS 规范里 min-width 不适用 table-cell），
   所以此前患者列仍被压到 120px、号码被裁断。改为在 th 上给列宽建议，auto 布局会采纳。 */
#tb-tasks th:nth-child(3) { width: 200px; }
#tb-tasks th:nth-child(5) { width: 104px; }
#tb-tasks th:nth-child(6) { width: 190px; }
#tb-groups th:nth-child(8) { width: 190px; }
#tb-groups th:nth-child(1) { width: 230px; }
#tb-users th:nth-child(6) { width: 96px; }

/* --- V43e --- */
/* AI 外呼场景表实际列序：1 场景名称 2 描述 3 话术 4 任务分组ID 5 模板ID 6 关联问卷 7 环境 8 状态 9 操作
   上一版按 9/10 写错了，环境列「测试」仍竖排 */
#tb-ai-scenes th:nth-child(7), #tb-ai-scenes td:nth-child(7),
#tb-ai-scenes th:nth-child(8), #tb-ai-scenes td:nth-child(8) { white-space: nowrap; }
#tb-ai-scenes th:nth-child(7) { width: 60px; }
/* 菜单管理：标识列原本吃掉 470px 空白，收窄让整表更紧凑 */
#tb-menus th:nth-child(3) { width: 240px; }

/* --- V43f：让任务表在 1366 下整表放得下 ---
   溢出的后果是「随访人／随访方式」两列被吸附的操作列压住，
   深色主题下表头文字与数据行叠在一起，很难看。收两处列宽与按钮间距，
   目标是把总宽压回内容区以内，彻底不出现横向滚动。 */
#tb-tasks th:nth-child(3) { width: 180px; }
#tb-tasks th:nth-child(6) { width: 152px; }
#tb-tasks th:nth-child(7) { width: 104px; }
#tb-tasks th:nth-child(8) { width: 96px; }
#tb-tasks td:last-child { padding-left: 6px; padding-right: 8px; }
#tb-tasks td:last-child a { margin-left: 2px !important; margin-right: 2px !important; padding-left: 6px !important; padding-right: 6px !important; }

/* --- V43g：再收 32px，1366 下任务表彻底不横滚 --- */
#tb-tasks th:nth-child(6) { width: 120px; }
#tb-tasks th:nth-child(10) { width: 62px; }

/* --- V43h：修正上一版的误设（第 10 列是随访方式，不该压到 62），
   改为收「执行随访」等按钮的字号与内边距，从操作列里抠空间 --- */
#tb-tasks th:nth-child(6) { width: 140px; }
#tb-tasks th:nth-child(10) { width: 74px; }
#tb-tasks td:last-child a {
  font-size: 11.5px !important;
  padding-left: 5px !important;
  padding-right: 5px !important;
  margin-left: 1px !important;
  margin-right: 1px !important;
}

/* --- V43i：任务表由 11 列并为 10 列 ---
   1366 下 11 列的 max-content 总宽始终超出内容区 40px 左右，压列宽只会在
   别处裁字。把「随访人」「随访方式」并成一列（张明 · 电话/手工），净省一列，
   整表放得下，横向滚动消失。表头与 app.js 渲染行同步改过。 */
#tb-tasks th:nth-child(9) { width: 118px; }

/* 操作列没给宽度时，auto 布局把它压到 78px，三个文字按钮被容器裁掉。
   明确给列宽，让四个按钮并排显示。 */
#tb-tasks th:last-child { width: 208px; }
#tb-tasks th:nth-child(9) { width: 112px; }

/* 再调 10px：「张明 · 电话/手工」尾部被操作列压住 */
#tb-tasks th:nth-child(9) { width: 124px; }
#tb-tasks th:last-child { width: 200px; }

/* 「未指派 · 电话/手工」比「张明 · 电话/手工」宽两个字，再给 14px */
#tb-tasks th:nth-child(9) { width: 138px; }
#tb-tasks th:last-child { width: 190px; }

/* --- V43j：工作台顶部提示条在深色主题下是白底红字，很跳 ---
   提示条的颜色是渲染时内联写死的高亮浅底色，深空蓝/墨金下像贴了张白纸。
   按级别换成半透明底，保留高/中/一般的颜色区分。 */
html[data-theme="green"] .wb-alert.wa-high,
html[data-theme="black"] .wb-alert.wa-high {
  background: rgba(239, 68, 68, .13) !important;
  border-color: rgba(239, 68, 68, .34) !important;
  color: #ffb3aa !important;
}
html[data-theme="green"] .wb-alert.wa-warn,
html[data-theme="black"] .wb-alert.wa-warn {
  background: rgba(245, 158, 11, .12) !important;
  border-color: rgba(245, 158, 11, .32) !important;
  color: #f5c66b !important;
}
html[data-theme="green"] .wb-alert.wa-info,
html[data-theme="black"] .wb-alert.wa-info {
  background: rgba(59, 130, 246, .13) !important;
  border-color: rgba(59, 130, 246, .32) !important;
  color: #9cc3ff !important;
}
html[data-theme="green"] .wb-alert .wa-detail,
html[data-theme="black"] .wb-alert .wa-detail { color: var(--kz-t3) !important; }
html[data-theme="green"] .wb-alert a,
html[data-theme="black"] .wb-alert a { color: inherit !important; }
