/* 医生端信息层级和响应式布局。业务状态与权限仍由共享 API 决定。 */
.doctor-mode .account-entry {
  position: fixed;
  z-index: 60;
  top: 11px;
  right: clamp(12px, 2vw, 28px);
  padding: 0;
  background: transparent;
}

.doctor-mode .account-entry > button {
  min-height: 40px;
  padding: 7px 12px;
  border-color: #9abfb4;
  background: #f4fcf9;
  font-size: 12px;
  font-weight: 700;
}

.role-bar-doctor {
  grid-template-columns: 1fr auto 1fr;
  min-height: 62px;
  padding: 9px clamp(16px, 2vw, 28px);
  gap: 18px;
}

.role-bar-doctor .system-truth { display: none; }

.role-bar-doctor .role-switcher { justify-content: center; }

.role-bar-doctor .role-switcher button { min-height: 40px; }

.role-bar-doctor .role-brand small { font-size: 10px; }

.doctor-shell { grid-template-columns: 292px minmax(0, 1fr); min-width: 0; }

.doctor-sidebar {
  top: 62px;
  height: calc(100vh - 62px);
  padding: 18px 14px 15px;
  color: #35544d;
  background: #f5f9f7;
  border-right: 1px solid #dde8e3;
}

.doctor-brand { padding: 0 7px 14px; }

.doctor-brand > span {
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  height: 36px;
  color: #ffffff;
  background: var(--green);
}

.doctor-brand b { color: #1c3a36; font-size: 14px; }

.doctor-brand small { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7a948c; }

/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-sidebar > .doctor-desktop-nav {
  display: block;
  flex: 1;
  min-height: 0;
  margin-top: 12px;
  overflow-x: hidden;
  overflow-y: auto;
}

.doctor-sidebar .doctor-nav-group { margin: 0 0 13px; }

.doctor-nav-group h2 {
  margin: 0 5px 4px;
  padding: 8px 6px 5px;
  color: #6d8b82;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .03em;
}

.doctor-sidebar nav .doctor-nav-group button {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  color: #35544d;
  background: transparent;
  font-size: 12px;
  line-height: 1.35;
}

.doctor-sidebar nav .doctor-nav-group button:hover { color: #1c3a36; background: #e7f2ed; }

.doctor-sidebar nav .doctor-nav-group button.active {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 4px 12px rgba(40, 123, 109, .22);
}

.doctor-sidebar nav .doctor-nav-group button > span { flex: 0 0 17px; font-size: 14px; }

.doctor-sidebar .sidebar-truth { padding: 10px 6px 0; }

.doctor-sidebar .sidebar-truth b { color: #6d8b82; font-size: 10px; }

.doctor-sidebar .sidebar-truth small { color: #8aa098; font-size: 9px; }

.doctor-mobile-nav { display: none; }

.doctor-main {
  min-width: 0;
  padding: 26px clamp(18px, 2.7vw, 38px) 60px;
}

.doctor-header { gap: 16px; margin-bottom: 18px; }

.doctor-header h1 { margin: 4px 0 4px; font-size: clamp(26px, 2.7vw, 34px); letter-spacing: -.025em; line-height: 1.22; }

.doctor-header p { max-width: 760px; font-size: 13px; line-height: 1.55; }

.doctor-header > div > span { font-size: 11px; letter-spacing: .04em; }

/* 临床数据分析中心标题行操作：导出报表与返回并排，不因标题过长而换行错位。 */
.multi-center-header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-top: 15px; }
.multi-center-header-actions button { white-space: nowrap; }

/* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
.doctor-header.patient-directory-header { display: block; min-height: 0; height: auto; margin-bottom: 12px; }

.patient-directory-header > div { width: 100%; min-width: 0; }

.patient-directory-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }

.patient-directory-title-row:has(> .patient-create-entry[open]) { flex-wrap: wrap; align-items: flex-start; }

.patient-directory-title-row > h1 { flex: 0 0 auto; margin: 4px 0; }

.patient-directory-title-row > .patient-create-entry { flex: 0 0 auto; margin: 0 0 0 auto; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-create-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 40px;
  padding: 7px 12px;
  list-style: none;
  border: 1px solid var(--green-dark);
  border-radius: 11px;
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 8px 18px rgba(21, 63, 69, .18);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: filter .16s ease, box-shadow .16s ease, transform .16s ease;
}

.patient-create-trigger::-webkit-details-marker { display: none; }

.patient-create-trigger::marker { content: ""; }

.patient-create-trigger > span { font-size: 18px; line-height: 1; }

.patient-create-trigger:hover { filter: brightness(1.08); box-shadow: 0 10px 22px rgba(21, 63, 69, .22); }

.patient-create-trigger:active { transform: translateY(1px); }

.patient-create-trigger:focus-visible { outline: 3px solid #5bb7a0; outline-offset: 3px; }

/* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
.patient-directory-title-row > .patient-create-entry[open] { flex: 1 0 100%; width: 100%; box-sizing: border-box; margin: 2px 0 0; padding: 12px; border: 1px solid #c8dfd5; border-radius: 12px; background: #f7fbf9; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-create-entry[open] > .patient-create-trigger { color: var(--green-dark); border-color: #a8cec2; background: #e9f5f0; box-shadow: none; }

.patient-create-entry > p,
.patient-create-entry > form { margin: 12px 0; }

.patient-create-entry > p { color: #526a61; font-size: 12px; line-height: 1.5; }

/* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
.doctor-main .clinical-card { box-shadow: 0 5px 20px rgba(23, 62, 57, .045); }

/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid #cfe2dc;
  border-radius: 12px;
  background: #f7fcfa;
}

.doctor-context-patient { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }

.doctor-context-patient b { color: #1d4d45; font-size: 13px; }

.doctor-context-patient span { color: #5b706a; font-size: 12px; }

.doctor-context-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.doctor-context-actions button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid #a8cec2;
  border-radius: 8px;
  color: #245d51;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.doctor-context-actions button strong { color: #a84827; font-variant-numeric: tabular-nums; }

.doctor-context-bar small { grid-column: 1 / -1; color: #667a73; font-size: 11px; line-height: 1.4; }

/* 待处理事项页的患者选择条：顶部用下拉框切换患者，下方风险与待办按所选患者过滤。 */
.doctor-patient-switcher {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #cfe2dc;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfefd, #f4faf7);
}

.switcher-label { color: #1d4d45; font-size: 13px; font-weight: 800; white-space: nowrap; }

.switcher-control { position: relative; display: flex; align-items: center; min-width: 0; }

.switcher-control select {
  width: 100%;
  min-height: 44px;
  padding: 10px 42px 10px 14px;
  border: 1px solid #cfe0da;
  border-radius: 11px;
  background: #fff;
  color: #1d4d45;
  font-size: 14px;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.switcher-control select:hover { border-color: #a8cec2; }
.switcher-control select:focus { outline: none; border-color: #2f7a6c; box-shadow: 0 0 0 3px rgba(47, 122, 108, .14); }

.switcher-arrow { position: absolute; right: 14px; color: #2f7a6c; font-size: 12px; pointer-events: none; }

.switcher-summary { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; min-width: 0; }
.switcher-summary b { color: #1d4d45; font-size: 12px; }
.switcher-summary span { color: #667a73; font-size: 11px; }

.switcher-empty { grid-column: 1 / -1; margin: 0; color: #667a73; font-size: 12px; }

@media (max-width: 640px) {
  .doctor-patient-switcher { grid-template-columns: minmax(0, 1fr); }
  .switcher-summary { grid-column: 1; }
}

/* 综合评估页：客观测量与专业评估并排展示，窄屏收为一列。 */
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 850px) {
  .evidence-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 患者主档保持表格语义；在窄屏将同一行重排为可读记录。 */
.doctor-main .patient-directory { min-width: 0; gap: 12px; padding: 18px; }

.patient-directory .patient-table-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.7fr) repeat(2, minmax(125px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.patient-directory .patient-table-filters label { min-width: 0; }

.patient-directory .patient-table-filters input,
.patient-directory .patient-table-filters select { min-width: 0; }

.patient-directory .patient-table-filters > button { min-height: 44px; padding-inline: 16px; font-weight: 750; }

.patient-directory .patient-table-filters .clinical-registry-feedback { grid-column: 1 / -1; }

.patient-directory .patient-table-filters .clinical-registry-feedback:empty { display: none; }

.patient-directory .patient-entry { padding: 0; overflow: hidden; background: #f7fbf9; }

.patient-directory .patient-entry > summary {
  min-height: 46px;
  padding: 11px 14px;
  color: #1d5d4d;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.patient-directory .patient-entry[open] { padding-bottom: 14px; }

.patient-directory .patient-entry > p,
.patient-directory .patient-entry > form { margin: 0 14px 12px; }

.patient-directory .patient-entry > p { font-size: 12px; line-height: 1.5; }

.patient-directory .table-scroll { min-width: 0; border: 1px solid #e1eae5; border-radius: 10px; }

.patient-directory table { min-width: 0; table-layout: fixed; }

.patient-directory th,
.patient-directory td { padding: 10px 8px; overflow-wrap: anywhere; font-size: 12px; }

.patient-directory th { font-size: 11px; font-weight: 750; }

.patient-directory th:nth-child(1) { width: 16%; }

.patient-directory th:nth-child(2) { width: 16%; }

.patient-directory th:nth-child(3) { width: 11%; }

.patient-directory th:nth-child(4) { width: 15%; }

.patient-directory th:nth-child(5) { width: 11%; }

.patient-directory th:nth-child(6) { width: 31%; }

.patient-directory tbody tr:last-child td { border-bottom: 0; }

.patient-directory .patient-row-actions { min-width: 0; }

.patient-directory .patient-row-actions button { min-height: 34px; margin: 0 4px 5px 0; padding: 5px 7px; font-size: 11px; }

.patient-directory .patient-page-controls { padding-top: 2px; font-size: 12px; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-detail-panel header > div { min-width: 0; }

.patient-detail-panel header h2 { overflow-wrap: anywhere; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.patient-detail-panel header > button { flex: 0 0 auto; min-width: 64px; white-space: nowrap; }

/* 响应式布局（(max-width: 850px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 850px) {

  /* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
  .role-bar-doctor { position: relative; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 9px 140px 8px 14px; }

  .role-bar-doctor .role-brand { min-width: 0; }

  .role-bar-doctor .role-switcher { grid-column: 1 / -1; width: calc(100% + 126px); }

  .role-bar-doctor .role-switcher button { min-height: 38px; padding: 6px 8px; font-size: 12px; }

  .doctor-mode .account-entry { position: absolute; top: 12px; }

  .doctor-shell { display: block; width: 100%; max-width: none; overflow: visible; }

  .doctor-sidebar {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 9px 14px;
    overflow: visible;
  }

  .doctor-sidebar .doctor-brand,
  .doctor-sidebar > .doctor-desktop-nav,
  .doctor-sidebar .sidebar-truth { display: none; }

  .doctor-sidebar .doctor-mobile-nav { display: block; grid-column: 1; grid-row: 1; min-width: 0; }

  .doctor-mobile-nav > summary {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 7px 11px;
    border: 1px solid #739891;
    border-radius: 9px;
    color: #e4f4ee;
    list-style: none;
    cursor: pointer;
  }

  .doctor-mobile-nav > summary::-webkit-details-marker { display: none; }

  .doctor-mobile-nav > summary span { color: #b5cec7; font-size: 11px; white-space: nowrap; }

  .doctor-mobile-nav > summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

  .doctor-mobile-nav > summary i { margin-left: auto; font-size: 18px; font-style: normal; transition: transform .2s; }

  .doctor-mobile-nav[open] > summary i { transform: rotate(180deg); }

  .doctor-sidebar .doctor-mobile-nav > nav {
    position: absolute;
    z-index: 45;
    top: calc(100% - 1px);
    right: 12px;
    left: 12px;
    display: block;
    width: auto;
    max-width: none;
    max-height: min(70vh, 540px);
    margin: 0;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #cbded7;
    border-radius: 0 0 13px 13px;
    background: #f8fcfa;
    box-shadow: 0 16px 35px rgba(13, 43, 40, .22);
  }

  .doctor-mobile-nav .doctor-nav-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0 0 8px; }

  .doctor-mobile-nav .doctor-nav-group h2 { grid-column: 1 / -1; margin: 0; padding: 9px 5px 5px; color: #406a5e; }

  .doctor-sidebar .doctor-mobile-nav .doctor-nav-group button { color: #28584d; background: #edf5f1; font-size: 12px; }

  .doctor-sidebar .doctor-mobile-nav .doctor-nav-group button.active { color: #fff; background: #256957; }

  .doctor-main { width: 100%; max-width: none; padding: 20px 16px 55px; overflow: visible; }

  .doctor-context-bar { grid-template-columns: minmax(0, 1fr); }

  .doctor-context-actions { grid-column: 1; }

  /* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
  .patient-directory .patient-table-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .patient-directory .patient-table-filters label:first-child { grid-column: 1 / -1; }

  .patient-directory .patient-table-filters > button { grid-column: 1 / -1; justify-self: start; min-width: 90px; }
}

/* 响应式布局（(max-width: 720px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 720px) {

  /* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
  .doctor-header { margin-bottom: 14px; }

  .doctor-header h1 { font-size: clamp(25px, 5vw, 30px); }

  /* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
  .doctor-header.patient-directory-header { display: block; height: auto; min-height: 0; margin-bottom: 12px; }

  .patient-directory-title-row { flex-wrap: nowrap; gap: 8px; }

  /* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
  .patient-create-trigger { min-height: 38px; padding: 6px 10px; white-space: nowrap; }

  /* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
  .doctor-main .patient-directory { padding: 14px; }

  .patient-directory .table-scroll { overflow: visible; border: 0; border-radius: 0; }

  .patient-directory table,
  .patient-directory tbody { display: block; width: 100%; }

  .patient-directory thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

  .patient-directory tbody { display: grid; gap: 9px; }

  .patient-directory tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    padding: 13px;
    border: 1px solid #dae7df;
    border-radius: 10px;
    background: #fff;
  }

  .patient-directory tbody td { display: block; min-width: 0; padding: 0; border: 0; font-size: 13px; }

  .patient-directory tbody td::before { display: block; margin-bottom: 3px; color: #647d72; content: attr(data-label); font-size: 11px; font-weight: 700; }

  .patient-directory tbody td:first-child { font-variant-numeric: tabular-nums; }

  .patient-directory tbody td.patient-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 9px; border-top: 1px solid #e8efea; }

  .patient-directory tbody td.patient-row-actions::before { flex: 0 0 100%; margin: 0; }

  .patient-directory .patient-row-actions button { min-height: 44px; margin: 0; padding: 6px 9px; font-size: 12px; }

  .patient-directory tbody td[colspan] { grid-column: 1 / -1; }
}

/* 响应式布局（(max-width: 480px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 480px) {

  /* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
  .role-bar-doctor { padding-right: 112px; }

  .role-bar-doctor .role-brand .logo { width: 34px; height: 34px; font-size: 20px; }

  .role-bar-doctor .role-brand b { font-size: 14px; }

  .role-bar-doctor .role-brand small { font-size: 9px; }

  .role-bar-doctor .role-switcher { width: calc(100% + 98px); }

  .role-bar-doctor .role-switcher button { padding-inline: 4px; font-size: 11px; }

  .doctor-mode .account-entry > button { min-height: 36px; padding: 5px 8px; font-size: 11px; }

  .doctor-sidebar { padding-inline: 11px; }

  .doctor-mobile-nav > summary { padding-inline: 9px; }

  .doctor-mobile-nav > summary span { display: none; }

  .doctor-main { padding: 17px 12px 50px; }

  .doctor-context-bar { padding: 11px 12px; }

  .doctor-context-actions button { flex: 1 1 135px; justify-content: space-between; }

  /* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
  .patient-directory .patient-table-filters > button { width: 100%; }

  .patient-directory tbody tr { padding: 11px; }

  .patient-directory .patient-row-actions button { flex: 1 1 calc(50% - 6px); }

  .patient-directory .patient-row-actions button:last-child { flex-basis: 100%; }

  .patient-directory .patient-page-controls { justify-content: space-between; }

  .patient-directory .patient-page-controls span { flex-basis: 100%; }
}

/* 减少动效偏好：关闭非必要过渡与动画，保留相同的操作结果和焦点反馈。 */
@media (prefers-reduced-motion: reduce) {

  /* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
  .doctor-mobile-nav > summary i { transition: none; }
}

/* 量表目录在窄屏保留“量表 + 录入”同屏可见，展开项紧邻所选行。 */
.instrument-workbench { grid-template-columns: minmax(0, 1fr); }

.instrument-workbench,
.instrument-catalog-scroll { min-width: 0; }

.instrument-catalog-table .instrument-catalog-row.is-open { background: #f1f9f5; }

.instrument-catalog-table .instrument-catalog-action { white-space: nowrap; }

.instrument-catalog-table .instrument-catalog-action button { min-height: 42px; }

.instrument-catalog-editor > td { padding: 8px 0 16px; border-bottom: 1px solid #c6dcd4; }

.instrument-catalog-editor .instrument-create { margin: 0; }

.instrument-catalog-editor .instrument-create h4 { margin: 0 0 7px; color: #1b5042; font-size: 17px; }

.instrument-catalog-editor .instrument-create:focus { outline: 3px solid #1674af; outline-offset: 2px; }

/* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
.clinical-item-entry-form { min-width: 0; gap: 13px; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.item-entry-guidance { margin: 0; color: #405f54; font-size: 13px; line-height: 1.5; }

.item-entry-date { width: fit-content; padding: 6px 9px; border: 1px solid #d3e4da; border-radius: 7px; background: #f8fbf9; }

.item-entry-date summary { color: #315f50; font-size: 12px; cursor: pointer; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.item-entry-date label { margin-top: 9px; }

/* 结构化表格：列标题、数值、来源和条目操作保留稳定对齐，辅助文字区别展示；需要时由局部容器滚动，避免扩宽页面主体。 */
.item-entry-table-wrap { min-width: 0; overflow-x: auto; }

.item-entry-table { width: 100%; border-collapse: collapse; }

.item-entry-table th,.item-entry-table td { padding: 9px 10px; border-bottom: 1px solid #dbe8e0; text-align: left; vertical-align: middle; font-size: 13px; }

.item-entry-table th { width: 54%; color: #244f42; font-weight: 750; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.item-entry-table select { width: 100%; min-width: 0; min-height: 42px; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.item-entry-groups { display: grid; gap: 12px; }

.item-entry-groups fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid #dbe8e0; border-radius: 9px; }

.item-entry-groups legend { padding: 0 5px; color: #205b4c; font-weight: 800; }

.item-entry-groups fieldset p { margin: 7px 0; color: #5a7065; font-size: 12px; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.item-entry-groups input:disabled { background: #f1f5f1; }

.item-entry-groups label[hidden] { display: none; }

/* 响应式布局（(max-width: 800px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 800px) {

  /* 量表入口与提示：名称、分值和状态属于同一量表卡片或记录；风险颜色配合文字展示，灰色表示未评估或资料不足，CSS本身不判断评分。 */
  .instrument-table-scroll { overflow: visible; }

  .instrument-record-table,.instrument-record-table tbody { display: block; min-width: 0; width: 100%; }

  .instrument-record-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

  .instrument-record-table tbody { display: grid; gap: 0; }

  .instrument-record-table .instrument-record-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; margin-top: 10px; padding: 12px 12px 8px; border: 1px solid #d8e7dd; border-bottom: 0; border-radius: 10px 10px 0 0; background: #fff; }

  .instrument-record-table .instrument-record-row td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 12px; }

  .instrument-record-table .instrument-record-row td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; font-size: 15px; }

  .instrument-record-table .instrument-record-row td:nth-child(1) { grid-column: 1; grid-row: 2; color: #64776c; }

  .instrument-record-table .instrument-record-row td:nth-child(5) { grid-column: 2; grid-row: 2; color: #64776c; text-align: right; }

  .instrument-record-table .instrument-record-row td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; color: #1b5042; font-weight: 750; }

  .instrument-record-table .instrument-record-row td:nth-child(4) { grid-column: 1 / -1; grid-row: 4; }

  .instrument-record-table .instrument-record { display: block; border: 1px solid #d8e7dd; border-top: 0; border-radius: 0 0 10px 10px; background: #fff; }

  .instrument-record-table .instrument-record > td { display: block; width: 100%; min-width: 0; padding: 8px 12px 12px; border: 0; }

  .instrument-record-table .instrument-day-head { display: block; margin-top: 14px; padding: 10px 12px; background: #eaf3ee; border-radius: 8px; }

  .instrument-record-table .instrument-day-head td { display: block; padding: 0; border: 0; color: #1b5042; font-weight: 700; }

  .instrument-record-table .instrument-day-head td small { display: inline; margin: 0 0 0 8px; font-weight: 400; color: #61756e; }

  .instrument-catalog-scroll { overflow: visible; }

  .instrument-catalog-table,
  .instrument-catalog-table tbody { display: block; width: 100%; min-width: 0; }

  .instrument-catalog-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

  .instrument-catalog-table tbody { display: grid; gap: 10px; }

  .instrument-catalog-table .instrument-catalog-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px 10px;
    padding: 13px;
    border: 1px solid #d5e5dc;
    border-radius: 11px;
    background: #fff;
  }

  .instrument-catalog-table .instrument-catalog-row.is-open { border-color: #71aa95; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }

  .instrument-catalog-table .instrument-catalog-row td { display: block; min-width: 0; padding: 0; border: 0; font-size: 13px; overflow-wrap: anywhere; }

  .instrument-catalog-table .instrument-catalog-row td::before { display: block; margin-bottom: 2px; color: #60796d; content: attr(data-label); font-size: 11px; font-weight: 700; }

  .instrument-catalog-table .instrument-catalog-row td:nth-child(2) { grid-column: 1; grid-row: 1; font-size: 16px; }

  .instrument-catalog-table .instrument-catalog-row td:nth-child(2)::before,
  .instrument-catalog-table .instrument-catalog-row td:nth-child(5)::before { display: none; }

  .instrument-catalog-table .instrument-catalog-row td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: start; }

  .instrument-catalog-table .instrument-catalog-row td:nth-child(1) { grid-column: 1; grid-row: 2; }

  .instrument-catalog-table .instrument-catalog-row td:nth-child(4) { grid-column: 2; grid-row: 2; }

  .instrument-catalog-table .instrument-catalog-row td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; padding-top: 7px; border-top: 1px solid #e9f0eb; }

  .instrument-catalog-table .instrument-catalog-action button { max-width: 100%; min-height: 44px; padding: 7px 10px; }

  .instrument-catalog-table .instrument-catalog-editor { display: block; margin-top: -10px; }

  .instrument-catalog-table .instrument-catalog-editor > td { display: block; padding: 0; border: 0; }

  .instrument-catalog-table .instrument-catalog-editor .instrument-create { border-top-left-radius: 4px; border-top-right-radius: 4px; }
}

/* 响应式布局（(max-width: 390px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 390px) {

  /* 量表入口与提示：名称、分值和状态属于同一量表卡片或记录；风险颜色配合文字展示，灰色表示未评估或资料不足，CSS本身不判断评分。 */
  .instrument-catalog-table .instrument-catalog-row { padding: 11px; gap: 7px; }

  .instrument-catalog-table .instrument-catalog-action button { padding-inline: 8px; font-size: 12px; }

  .instrument-catalog-editor .instrument-create { padding: 12px; }
}

/* 响应式布局（(max-width: 600px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 600px) {

  /* 结构化表格：列标题、数值、来源和条目操作保留稳定对齐，辅助文字区别展示；需要时由局部容器滚动，避免扩宽页面主体。 */
  .item-entry-table,.item-entry-table tbody { display: block; width: 100%; }

  .item-entry-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

  .item-entry-table tr { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid #dbe8e0; }

  .item-entry-table th,.item-entry-table td { display: block; width: 100%; padding: 0; border: 0; }
}

/* 患者优先：总表与当前类别在同一页面，减少重复标题和多层卡片。 */
.patient-clinical-workspace { display: grid; gap: 13px; min-width: 0; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-workspace-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 4px 0 7px; border-bottom: 1px solid #d8e6df;
}

.patient-workspace-heading span,
.patient-section-heading span,
.patient-active-title span { color: #28745e; font-size: 11px; font-weight: 800; letter-spacing: .04em; }

.patient-workspace-heading h1 { margin: 3px 0; color: #173b3c; font-size: clamp(23px, 2.5vw, 31px); line-height: 1.2; }

.patient-workspace-heading p { margin: 0; color: #526d64; font-size: 12px; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.patient-workspace-heading button,
.patient-quick-actions button,
.patient-index-table button,
.patient-recent-records button,
.patient-other-records button:not(.primary) {
  min-height: 38px; padding: 7px 11px; border: 1px solid #b9d5c9; border-radius: 8px;
  background: #fff; color: #17644e; font-weight: 700; cursor: pointer;
}

.patient-index-table button[aria-current="page"] { background: #e4f2ec; color: #164a3e; }

/* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
.patient-workspace-heading button:focus-visible,
.patient-clinical-workspace button:focus-visible,
.patient-clinical-workspace input:focus-visible,
.patient-clinical-workspace select:focus-visible,
.patient-clinical-workspace textarea:focus-visible { outline: 3px solid #1674af; outline-offset: 2px; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-scope {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px;
  padding: 10px 13px; border: 1px solid #d4e5dc; border-radius: 10px; background: #f6faf8;
  color: #254d42; font-size: 12px;
}

.patient-scope > div { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid #c4ddd0; border-radius: 7px; background: #fff; font-weight: 700; color: #175b49; }

/* 查看范围改为主档只读展示，重选方向经「修改主档」按钮进入就地编辑，不再在本页勾选。 */
.patient-scope > button { padding: 7px 12px; border: 1px solid #14634e; border-radius: 8px; background: #14634e; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.patient-scope > button:hover { background: #0f513f; }

/* 查看范围分段选择：管理方向为其它/双方向时，用两个互斥按钮切换认知障碍/肌少症查看，不影响主档方向。 */
.patient-scope .scope-choice-row { display: inline-flex; padding: 0; border: 1px solid #c4ddd0; border-radius: 8px; overflow: hidden; background: #fff; }
.patient-scope .scope-choice { padding: 7px 14px; border: 0; background: transparent; color: #175b49; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.patient-scope .scope-choice + .scope-choice { border-left: 1px solid #c4ddd0; }
.patient-scope .scope-choice.active { background: #14634e; color: #fff; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.patient-scope label { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 9px; border: 1px solid #c4ddd0; border-radius: 7px; background: #fff; font-weight: 700; cursor: pointer; }

.patient-scope input { width: 17px; height: 17px; margin: 0; accent-color: #176b55; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-scope small { color: #5b756a; }

/* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
.patient-scope .clinical-registry-feedback { flex-basis: 100%; margin: 0; }

.patient-scope .clinical-registry-feedback:empty { display: none; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }

.patient-section-heading h2,.patient-active-title h2 { margin: 2px 0; color: #183f3c; font-size: 18px; }

.patient-section-heading small { color: #63796f; font-size: 11px; }

/* 患者目录与建档：列表信息、搜索条件和新增入口紧密排列；标题行上的主操作保持紧凑，新增表单按字段关系组织，避免空白区域挤走结果。 */
.doctor-main .patient-index,
.doctor-main .patient-facts,
.doctor-main .patient-recent-records,
.doctor-main .patient-other-records,
.doctor-main .patient-timeline-table { padding: 15px; border-radius: 12px; box-shadow: none; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-active-panel { min-width: 0; display: grid; gap: 10px; }

.patient-active-title { display: flex; align-items: baseline; gap: 9px; padding: 2px 1px; }

/* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
.patient-active-panel .clinical-registry { margin: 0; padding: 15px; border-radius: 12px; }

.patient-active-panel .clinical-registry-title { margin-bottom: 12px; }

.patient-active-panel .clinical-registry-title h2 { font-size: 20px; }

.patient-active-panel .clinical-registry-title p { font-size: 12px; }

.patient-active-panel .clinical-card { box-shadow: none; }

/* 结构化表格：列标题、数值、来源和条目操作保留稳定对齐，辅助文字区别展示；需要时由局部容器滚动，避免扩宽页面主体。 */
.patient-data-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #e0ebe5; border-radius: 9px; }

.patient-data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }

.patient-data-table th,.patient-data-table td { padding: 9px 10px; border-bottom: 1px solid #e3ede7; text-align: left; vertical-align: top; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

.patient-data-table thead th { color: #526b60; background: #f3f8f5; font-size: 11px; }

.patient-data-table tbody tr:last-child > * { border-bottom: 0; }

.patient-data-table tbody th { color: #234b42; font-weight: 750; }

.patient-data-table tbody tr.is-current { background: #f0f8f3; }

.patient-data-table small { display: block; color: #61776c; }

/* 档案数据专列：病因以胶囊标签区分证据级别、完整备注下置缩进展示；握力按左右手分行列出全部试次原值。 */
.archive-etio { display: flex; flex-direction: column; gap: 5px; padding: 1px 0; }

.archive-etio-chip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 700; color: #234b42; }

.archive-etio-certainty { padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 800; line-height: 1.4; }
.archive-etio-certainty.cert-suspected { color: #98611b; background: var(--amber-soft); }
.archive-etio-certainty.cert-supported { color: #2b5f7a; background: var(--blue-soft); }
.archive-etio-certainty.cert-confirmed { color: #216a5d; background: var(--green-soft); }

.archive-etio-note { display: block; padding: 1px 0 1px 9px; border-left: 2px solid #d9e7de; color: #61776c; font-size: 11px; line-height: 1.55; }

.archive-grip { display: flex; flex-direction: column; gap: 3px; }
.archive-grip-row { display: flex; align-items: baseline; gap: 6px; }
.archive-grip-row b { color: #61776c; font-size: 10px; font-weight: 700; }
.archive-grip-row span { color: #234b42; font-weight: 700; }

/* 临床专病管理状态卡：标题与删除入口分行对齐，删除按钮为危险色并明确不可恢复。 */
.archive-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.archive-delete { padding: 6px 12px; border: 1px solid #d8b4b0; border-radius: 8px; background: #fff; color: #9c3f37; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.archive-delete:hover { background: #fdf0ee; }
.archive-warning { margin: 8px 0; padding: 9px 11px; border-left: 3px solid #c07a36; background: var(--amber-soft); color: #7a5318; font-size: 12px; line-height: 1.55; }

/* 档案数据操作列：修改弹出弹窗填写，删除为就地危险按钮，不需要删除原因。 */
.archive-data-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.archive-row-edit, .archive-row-delete { padding: 6px 12px; border-radius: 8px; background: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.archive-row-edit { border: 1px solid #9fb8bf; color: #23535c; }
.archive-row-edit:hover { background: #eef5f6; }
.archive-row-edit:disabled { opacity: 0.6; cursor: default; }
.archive-row-delete { border: 1px solid #d8b4b0; color: #9c3f37; }
.archive-row-delete:hover { background: #fdf0ee; }
.archive-row-delete:disabled { opacity: 0.6; cursor: default; }

/* 档案数据标题与 Excel 下载入口：标题与导出按钮同行，下载为低强调的描边按钮。 */
.archive-data-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.archive-data-head h3 { margin: 0; }
.archive-export { padding: 6px 12px; border: 1px solid #9fb8bf; border-radius: 8px; background: #fff; color: #23535c; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.archive-export:hover { background: #eef5f6; }
.archive-export:disabled { opacity: 0.6; cursor: default; }

/* 量表记录 Excel 导出：记录表首列加勾选框（含表头全选），末列表头放下载按钮。 */
.scale-export-select { width: 42px; text-align: center; }
.scale-export-select input { width: 16px; height: 16px; accent-color: #1c5e50; cursor: pointer; vertical-align: middle; }
.scale-export-download { width: 76px; text-align: right; white-space: nowrap; }

.patient-index-table th:first-child { width: 18%; }

.patient-index-table th:nth-child(2) { width: 37%; }

.patient-index-table th:nth-child(3) { width: 12%; }

.patient-index-table th:nth-child(4) { width: 13%; }

.patient-index-table th:nth-child(5) { width: 20%; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.patient-other-records form { margin: 12px 0; }

.patient-other-records details > summary { cursor: pointer; color: #17644e; font-weight: 700; }

/* 响应式布局（(max-width: 800px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 800px) {

  /* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
  .patient-workspace-heading { align-items: flex-start; }

  /* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
  .patient-workspace-heading button { flex: 0 0 auto; }

  /* 结构化表格：列标题、数值、来源和条目操作保留稳定对齐，辅助文字区别展示；需要时由局部容器滚动，避免扩宽页面主体。 */
  .patient-data-table-wrap { border: 0; overflow: visible; }

  .patient-data-table,.patient-data-table tbody { display: block; width: 100%; }

  .patient-data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

  .patient-data-table tbody { display: grid; gap: 7px; }

  .patient-data-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; padding: 10px; border: 1px solid #d9e7de; border-radius: 9px; background: #fff; }

  .patient-data-table tbody tr.is-current { background: #f0f8f3; border-color: #8dbea8; }

  .patient-data-table tbody th,.patient-data-table tbody td { display: block; min-width: 0; padding: 0; border: 0; }

  .patient-data-table tbody th,
  .patient-index-table tbody th:first-child { width: auto; }

  .patient-data-table tbody th::before,.patient-data-table tbody td::before { display: block; margin-bottom: 2px; color: #647c70; content: attr(data-label); font-size: 10px; font-weight: 700; }

  .patient-index-table tbody td:nth-child(2),.patient-index-table tbody td:last-child,
  .patient-recent-records tbody td:last-child,.patient-other-records tbody td:last-child { grid-column: 1 / -1; }

  .patient-index-table tbody td:last-child,.patient-recent-records tbody td:last-child { padding-top: 6px; border-top: 1px solid #e8efea; }

  .patient-data-table tbody td[colspan] { grid-column: 1 / -1; }

  /* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
  .patient-active-panel .clinical-registry { padding: 11px; }

  .patient-active-panel .clinical-registry .clinical-card { padding: 12px; }
}

/* 响应式布局（(max-width: 520px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 520px) {

  /* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
  .patient-workspace-heading { display: grid; }

  /* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
  .patient-workspace-heading button { justify-self: start; }

  /* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
  .patient-scope { display: grid; gap: 8px; }

  .patient-scope > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }

  /* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
  .patient-scope label { justify-content: center; }

  .patient-index-table button { width: 100%; }

  /* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
  .patient-active-title { display: block; }
}

/* 患者量表的编辑器保持在当前记录内，窄屏不挤到表格右侧。 */
.patient-scale-table .instrument-filters { margin: 12px 0; }

.instrument-inline-edit { min-width: 0; }

.instrument-inline-edit > summary { color: #14634e; font-weight: 700; padding: 8px 12px; border: 1px solid #b7d4c7; border-radius: 8px; background: #edf8f1; cursor: pointer; }

.instrument-inline-edit[open] { flex: 1 0 100%; padding: 12px; background: #f5faf7; border: 1px solid #b7d4c7; border-radius: 8px; }

.instrument-inline-edit[open] > summary { width: fit-content; }

.instrument-inline-edit h4 { margin: 12px 0; }

.instrument-record-source { font-size: 12px; color: #617269; }

/* 临床资料层级：主档、专病资料、随访和检查内容各自保留阅读区域；标题、字段与辅助说明形成顺序，便于医生核对来源。 */
.instrument-record .clinical-registry-message { margin: 8px 0; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.patient-index-disclosure { margin: 10px 0; border: 1px solid #c7dbd3; border-radius: 10px; background: #fff; }

.patient-index-disclosure > summary { padding: 12px 16px; cursor: pointer; font-weight: 650; color: #245b4b; }

.patient-index-disclosure > .patient-index { margin: 0; border: 0; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.patient-scale-table .patient-section-heading > button { padding: 9px 14px; border: 1px solid #14634e; border-radius: 8px; background: #14634e; color: #fff; font: inherit; cursor: pointer; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.source-scale-group { min-width: 0; margin: 12px 0; padding: 12px; border: 1px solid #cadbd5; border-radius: 8px; }

.source-scale-group legend { font-weight: 700; padding: 0 6px; }

.source-scale-group p, .source-version { font-size: 13px; line-height: 1.6; }

/* 结构化表格：列标题、数值、来源和条目操作保留稳定对齐，辅助文字区别展示；需要时由局部容器滚动，避免扩宽页面主体。 */
.source-item-form .item-entry-table { width: 100%; table-layout: fixed; }

.source-item-form .item-entry-table th, .source-item-form .item-entry-table td { white-space: normal; overflow-wrap: anywhere; }

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.source-item-form select, .source-item-form input { width: 100%; min-width: 0; box-sizing: border-box; }

.source-reference-buttons, .source-submit { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.source-reference img { height: auto; max-width: 100%; }

/* 安全反馈：求助动作、风险文字和处置提示保持独立层级，避免淹没在一般记录中；高亮只用于辨识入口，不代表已通知或已处置。 */
.source-item-form [data-source-safety-output]:not([hidden]) { padding: 12px; color: #872d21; background: #fff0e8; border: 1px solid #c4664f; }

/* 辅助阅读与展开状态：按当前可见性显示内容，并保留屏幕阅读器需要的信息；隐藏样式只影响展示，不删除已有业务记录。 */
.source-item-form tr[hidden] { display: none !important; }

/* 响应式布局（(max-width: 640px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media (max-width: 640px) {
/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.source-scale-group { padding: 8px; }
/* 结构化表格：列标题、数值、来源和条目操作保留稳定对齐，辅助文字区别展示；需要时由局部容器滚动，避免扩宽页面主体。 */
.source-item-form .item-entry-table th, .source-item-form .item-entry-table td { padding: 8px 4px; } }

/* 量表双模式：保留尚未提交的输入，切换不重建表单。 */
.instrument-entry-modes { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; }

.instrument-entry-modes button { flex:1 1 180px; padding:10px 12px; min-height:44px; }

.instrument-entry-modes button[aria-pressed="true"] { background:#176d59; color:#fff; border-color:#176d59; }

/* 辅助阅读与展开状态：按当前可见性显示内容，并保留屏幕阅读器需要的信息；隐藏样式只影响展示，不删除已有业务记录。 */
[data-entry-panel][hidden] { display:none !important; }

/* 量表归属和题目对应；项号在隐藏条件题时保持稳定。 */
.instrument-form-identity { margin: 0; padding: 10px 12px; background: #edf6f1; border-left: 3px solid #176d59; color: #244f42; overflow-wrap: anywhere; }

.instrument-question-badge { display: block; margin-bottom: 5px; color: #416c5e; font-size: 12px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }

.instrument-question-index { min-width: 0; padding: 10px 12px; border: 1px solid #c7dbd3; border-radius: 8px; background: #f8fbf9; }

.instrument-question-index > summary { cursor: pointer; color: #245b4b; font-weight: 700; overflow-wrap: anywhere; }

.instrument-question-index p { margin: 8px 0; color: #576f63; font-size: 12px; line-height: 1.6; }

.instrument-question-index section { margin: 10px 0; }

.instrument-question-index h5 { margin: 0 0 6px; font-size: 13px; color: #244f42; }

.instrument-question-index h5 small { display: block; margin-top: 3px; font-weight: 500; color: #576f63; }

.instrument-question-group { margin: 8px 0; padding: 8px; border: 1px solid #d6e3dc; border-radius: 6px; }

.instrument-question-group > summary { cursor: pointer; color: #244f42; font-size: 13px; font-weight: 650; }

.instrument-question-group > summary small { display: block; margin: 4px 0; color: #576f63; font-weight: 500; }

.instrument-question-group[open] > summary { margin-bottom: 8px; }

/* 日常评估和删除、更正历史分开；处理原因与恢复入口就地展示。 */
.instrument-archived { min-width: 0; margin-top: 16px; padding: 12px; border: 1px solid #d5deda; border-radius: 9px; background: #f8faf9; }

.instrument-archived > summary { cursor: pointer; color: #52665e; font-weight: 650; }

.instrument-archived > p { color: #5c7066; font-size: 13px; line-height: 1.6; }

.instrument-lifecycle-note { padding: 10px 12px; margin: 0 0 10px; background: #f4f6f5; border-left: 3px solid #8ca398; color: #415b4e; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }

.instrument-lifecycle-note p { margin: 5px 0; }

.instrument-lifecycle-note small { display: block; }

.instrument-remove[open], .instrument-restore[open] { flex: 1 0 100%; min-width: 0; padding: 12px; border: 1px solid #d7dfdb; border-radius: 8px; }

.instrument-remove > summary, .instrument-restore > summary { padding: 8px 10px; cursor: pointer; font-weight: 650; }

.instrument-remove p, .instrument-restore p { font-size: 13px; line-height: 1.6; }

.instrument-remove form, .instrument-restore form { display: grid; gap: 10px; }

.instrument-remove input, .instrument-remove select, .instrument-restore input { width: 100%; min-width: 0; box-sizing: border-box; }

.instrument-question-index ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 6px; }

.instrument-question-index li { min-width: 0; }

.instrument-question-index button { width: 100%; min-height: 44px; padding: 8px; text-align: left; white-space: normal; overflow-wrap: anywhere; font: inherit; font-size: 13px; }

.instrument-question-index button:disabled { opacity: 1; color: #69776f; background: #eef1ef; cursor: not-allowed; }

.instrument-question-index [data-question-condition] { display: block; padding: 3px 8px; color: #69776f; font-size: 12px; }

.instrument-question-index [data-question-condition][hidden] { display: none; }

.instrument-question-index.is-compact { margin-top: 7px; padding: 7px 9px; font-size: 12px; }

[data-instrument-question] { scroll-margin-block: 110px; }

[data-instrument-question][data-question-current] { outline: 2px solid #1674af; outline-offset: -2px; background: #eef7ff; }

.scale-overview-disclosure{margin:18px 0;border:1px solid #c6dcd5;border-radius:16px;background:#fff;overflow:clip}

.scale-overview-disclosure>summary{padding:17px 20px;cursor:pointer;font-size:17px;font-weight:750;color:#214d46;background:#f4f9f7}

.scale-overview-disclosure>summary>span{font-size:13px;margin-left:8px;font-weight:500;color:#637972}

.scale-overview{padding:20px;min-width:0}

.scale-overview-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:16px;flex-wrap:wrap}

.scale-overview h2{margin:0 0 7px;color:#183e39}

.scale-overview-heading p{margin:0;color:#5b706b;font-size:13px}

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-counts{display:flex;gap:7px;flex-wrap:wrap;font-size:12px}

.scale-counts>span{padding:6px 9px;border-radius:7px;background:#eff3f2;color:#596e68}

.scale-shortcut-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}

/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-main .scale-shortcut{display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:7px;min-width:0;min-height:160px;padding:16px;border:1px solid var(--signal-border,#d2ded9);border-top:4px solid var(--signal-color,#899c96);border-radius:12px;background:var(--signal-bg,#f5f7f6);color:#1c3732;box-shadow:none;cursor:pointer;transition:box-shadow .2s,transform .2s}

.doctor-main .scale-shortcut:hover{box-shadow:0 5px 16px #193e3917;transform:translateY(-2px)}

.doctor-main .scale-shortcut:focus-visible{outline:3px solid #1b6860;outline-offset:3px}

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.signal-red{--signal-color:#ab3337;--signal-bg:#fff0ef;--signal-border:#e9b4b5;--signal-text:#963036}

.signal-yellow{--signal-color:#a9650b;--signal-bg:#fff8e7;--signal-border:#ebd09a;--signal-text:#8a5107}

.signal-green{--signal-color:#20714d;--signal-bg:#edf8ef;--signal-border:#aed4b9;--signal-text:#205e3e}

.signal-neutral{--signal-color:#859991;--signal-bg:#f3f6f5;--signal-border:#d0ded8;--signal-text:#52655e}

.scale-counts>.signal-red,.scale-counts>.signal-yellow,.scale-counts>.signal-green{background:var(--signal-bg);color:var(--signal-text)}

.scale-collections{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}

/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-main .scale-collections button{min-height:38px;padding:6px 14px;border:1px solid #bdd4c9;border-radius:999px;background:#fff;color:#315e54;font-size:13px;font-weight:650;cursor:pointer}

.doctor-main .scale-collections button[aria-pressed="true"]{background:#1c5e50;border-color:#1c5e50;color:#fff}

.doctor-main .scale-collections button:focus-visible{outline:3px solid #1b6860;outline-offset:2px}

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-crf-note{margin:0 0 14px;padding:11px 13px;border-left:3px solid #569883;background:#f2f8f5;color:#385e53;font-size:12px;line-height:1.6}

.scale-shortcut-source{font-size:11px;line-height:1.5;color:#48655d;overflow-wrap:anywhere}

.scale-crf-reference{margin:0 0 12px;padding:0 14px;border:1px solid #c9dfd2;border-radius:10px;background:#f5faf7;color:#385e53;font-size:12px;line-height:1.6}

.scale-crf-reference>summary{padding:10px 0;cursor:pointer;font-weight:650}
.scale-crf-reference p{margin:7px 0;overflow-wrap:anywhere}

.scale-shortcut-top{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}

.scale-shortcut-top>b{font-size:17px;word-break:normal}

/* 量表入口与提示：名称、分值和状态属于同一量表卡片或记录；风险颜色配合文字展示，灰色表示未评估或资料不足，CSS本身不判断评分。 */
.scale-signal{display:inline-flex;align-items:center;gap:5px;color:var(--signal-text,#52655e);font-size:12px;font-weight:700;line-height:1.5;white-space:nowrap}

.scale-signal>span{width:7px;height:7px;flex:none;border-radius:50%;background:var(--signal-color,#859991)}

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-shortcut-name{font-size:13px;font-weight:500;line-height:1.45;min-height:1.45em}

.scale-shortcut-score{display:flex;gap:7px;align-items:baseline;font-size:29px;font-weight:750;line-height:1.15;font-variant-numeric:tabular-nums}

.scale-shortcut-score>small{font-size:12px;font-weight:500;color:#61716c}

.scale-shortcut-meta{font-size:11px;line-height:1.5;color:#5a6b64;font-weight:400}

/* 量表卡片状态文字：未填写/填写中/待复核/已复核等按进展着色，配同色圆点一眼区分。 */
.scale-status{display:inline-flex;align-items:center;gap:4px;font-weight:700}
.scale-status::before{content:'';width:6px;height:6px;flex:none;border-radius:50%;background:currentColor}
.scale-status-empty{color:#87928d}
.scale-status-progress{color:#356782}
.scale-status-pending{color:#b9791f}
.scale-status-done{color:#20714d}
.scale-status-blocked{color:#735a9f}
.scale-status-danger{color:#bd3b45}

.scale-shortcut-action{display:flex;justify-content:space-between;font-size:12px;font-weight:600;color:var(--signal-text);margin-top:auto}

.scale-more,.scale-optional{margin:13px 0 0}
.scale-more>summary,.scale-optional>summary,.scale-rules>summary,.scale-full-catalog>summary{cursor:pointer;padding:12px 0;color:#315e54;font-weight:650}
.scale-optional-tag{display:inline-flex;align-items:center;padding:1px 8px;border-radius:999px;background:#eef2f4;border:1px solid #d3dde2;color:#667a82;font-size:11px;font-weight:700;line-height:1.5;white-space:nowrap}

.scale-rules{margin-top:12px;font-size:13px;line-height:1.65;color:#50665e}
.scale-rules>div{padding:12px 0;border-top:1px solid #dce6e1}
.scale-rules p{margin:5px 0}
/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.scale-rules a,.scale-selected-signal a{color:#1a6655;overflow-wrap:anywhere}

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-management-heading{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin:0 0 14px}
.scale-management-heading p{margin:0;font-size:13px;color:#5c7067}

/* 公共表单与按钮：统一字段边界、文字层级、操作间距和可用状态；选择、焦点、禁用和错误态各有外观，业务层仍负责提交与权限检查。 */
.scale-selected-signal{padding:12px 16px;border:1px solid #d4e1db;border-radius:10px;margin-bottom:14px;background:#fff}
.scale-selected-signal summary{cursor:pointer;font-size:13px;color:#456253}
.scale-selected-signal p{font-size:13px;line-height:1.6}
.scale-selected-signal small{font-size:12px}

/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-full-catalog{margin-top:12px}
.scale-full-catalog>summary{border:1px solid #d3e2da;border-radius:10px;padding:14px;background:#f5f9f6}

/* 响应式布局（max-width:800px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media(max-width:800px){
/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-shortcut-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
/* 量表入口与提示：名称、分值和状态属于同一量表卡片或记录；风险颜色配合文字展示，灰色表示未评估或资料不足，CSS本身不判断评分。 */
.scale-overview{padding:14px}
.scale-overview-disclosure>summary{padding:15px;font-size:15px}
/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-main .scale-shortcut{padding:12px;min-height:169px}}

/* 响应式布局（max-width:400px)）：覆盖此条件下的列数、导航、字段宽度和阅读顺序，权限与数据筛选规则不随视口改变。 */
@media(max-width:400px){
/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-shortcut-grid{gap:8px}
/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-main .scale-shortcut{padding:10px}
/* 公共页面基础：为正文、标题、品牌、内容容器和辅助说明建立统一外观；尺寸、颜色和留白用于可读性，后续组件规则补充具体布局。 */
.scale-shortcut-top>b{font-size:15px}
.scale-shortcut-name{font-size:12px}
.scale-shortcut-score{font-size:25px}
/* 量表入口与提示：名称、分值和状态属于同一量表卡片或记录；风险颜色配合文字展示，灰色表示未评估或资料不足，CSS本身不判断评分。 */
.scale-signal{font-size:11px}}

/* 减少动效偏好：关闭非必要过渡与动画，保留相同的操作结果和焦点反馈。 */
@media(prefers-reduced-motion:reduce){
/* 医生导航与工作区：患者内容占据主阅读区，角色、业务入口和登录入口集中在导航区域；选中态仅表示当前位置，权限仍来自共享后台。 */
.doctor-main .scale-shortcut{transition:none}
.doctor-main .scale-shortcut:hover{transform:none}}

/* ===== 医生端「待处理事项」待办卡片（用药问题 + 健康数据异常事件） ===== */
.dashboard-todo-list { display: grid; gap: 10px; }
.dashboard-todo-item { padding: 14px; border: 1px solid #e1e8e7; border-radius: 12px; background: #fafcfb; }
.dashboard-todo-head { display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; }
.dashboard-todo-head b { flex: 1 1 220px; min-width: 0; color: #1d4d45; font-size: 14px; }
.dashboard-todo-head small { color: #667a73; font-size: 10px; white-space: nowrap; }
.dashboard-todo-body { margin: 9px 0 0; color: #3f5751; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.dashboard-todo-item form { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #dce7e4; }
.dashboard-todo-item form .primary { justify-self: end; }
.dashboard-todo-item .home-reply-line { margin-top: 12px; }
.panel-foot { display: block; margin-top: 10px; color: #667a73; font-size: 10px; }

/* ===== 综合评估等级选项卡 ===== */
.level-tab-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.level-tab { position: relative; }
.level-tab input { position: absolute; opacity: 0; pointer-events: none; }
.level-tab span { display: inline-block; padding: 9px 15px; border: 1px solid #cfe0db; border-radius: 99px; color: #4a655f; background: #f4f9f7; font-size: 13px; font-weight: 800; cursor: pointer; }
.level-tab input:checked + span { border-color: #2f7a6c; color: #fff; background: #2f7a6c; }
.level-tab input:focus-visible + span { outline: 3px solid rgba(47, 122, 108, .35); outline-offset: 2px; }

/* ===== 综合评估：疾病变化趋势折线图 ===== */
.geriatric-trend-card { margin-top: 16px; }
.geriatric-trend-card .panel-heading { margin-bottom: 14px; }
.geriatric-trend-card .panel-heading h2 { font-size: 18px; }
.geriatric-trend { display: grid; gap: 10px; }
.trend-chart-wrap { width: 100%; overflow: hidden; border: 1px solid #e1e8e7; border-radius: 12px; background: linear-gradient(180deg, #fbfdfc, #f6faf8); }
.trend-svg { display: block; width: 100%; height: auto; }
.trend-grid-line { stroke: #e6eeec; stroke-width: 1; stroke-dasharray: 3 4; }
.trend-y-label { fill: #6a7f82; font-size: 11px; font-weight: 700; }
.trend-x-label { fill: #7b8f8d; font-size: 10px; }
.trend-line { fill: none; stroke: #287b6d; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; }
.trend-legend-item { display: inline-flex; align-items: center; gap: 6px; color: #4a635d; font-size: 11px; font-weight: 700; }
.trend-legend-item i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, .12); }
.trend-note { color: #7b8f8d; font-size: 10px; line-height: 1.5; }
.home-trend-section .trend-chart-wrap { max-width: 720px; margin: 0 auto; }

/* ===== 患者首页：各访视日期得分总览矩阵与查看明细 ===== */
.panel-heading .panel-detail-link {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 6px 13px;
  border: 1px solid #cfe0da;
  border-radius: 999px;
  color: var(--green);
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.panel-heading .panel-detail-link:hover { color: #fff; background: var(--green); border-color: var(--green); }
.home-scale-matrix thead th { text-align: center; font-size: 12px; }
.home-scale-matrix thead th:first-child { text-align: left; }
.home-scale-matrix td { text-align: center; white-space: nowrap; font-size: 13px; }
.home-scale-matrix td:first-child { text-align: left; white-space: normal; min-width: 150px; }
.home-scale-name b { display: block; color: #1c3a36; font-size: 14px; font-weight: 800; }
.home-scale-name span { display: block; margin-top: 3px; color: #8aa098; font-size: 12px; font-weight: 650; }
.home-scale-matrix td .home-score { font-weight: 800; font-size: 14px; }
.home-scale-trend { text-align: center; vertical-align: middle; }
.home-scale-bars { display: block; width: 120px; height: 44px; margin: 0 auto; }

/* ===== 前后对比：摘要、升降与日期矩阵 ===== */
.home-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.home-summary article { border: 1px solid #dce7e4; border-radius: 14px; background: #fff; padding: 14px 16px; }
.home-summary span { display: block; color: #667a73; font-size: 12px; }
.home-summary b { display: block; margin-top: 5px; font-size: 22px; color: #1c3a36; font-weight: 800; }
.pairs-table th[scope="row"] b { display: block; color: #1c3a36; font-size: 14px; font-weight: 800; }
.pairs-table th[scope="row"] span { display: block; margin-top: 3px; color: #8aa098; font-size: 12px; font-weight: 650; }
.pairs-table td b { font-size: 15px; color: #1c3a36; }
.pairs-table td small { display: block; margin-top: 2px; color: #667a73; font-size: 12px; }
.pairs-delta { font-weight: 800; font-size: 14px; white-space: nowrap; }
.pairs-delta i { font-style: normal; margin-right: 3px; }
.pairs-delta[data-dir="up"] { color: #2563eb; }
.pairs-delta[data-dir="down"] { color: #0f766e; }
.pairs-delta[data-dir="flat"] { color: #64748b; }
.pairs-delta.once { color: #8aa098; font-weight: 650; font-size: 12px; }
.pairs-note { margin-top: 10px; color: #667a73; font-size: 12px; }
.pairs-date-filter { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 16px 18px; border: 1px solid #dce7e4; border-radius: 14px; background: #f6faf9; }
.pairs-date-filter-head span { color: #287b6d; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pairs-date-filter-head h3 { margin: 3px 0 0; font-size: 16px; color: #1c3a36; }
.pairs-date-filter-head small { display: block; margin-top: 3px; color: #667a73; font-size: 12px; }
.pairs-date-controls { display: flex; align-items: center; gap: 10px; }
.pairs-date-controls label { display: flex; flex-direction: column; gap: 5px; color: #647d72; font-size: 12px; font-weight: 700; }
.pairs-date-controls select { min-width: 148px; padding: 8px 10px; border: 1px solid #d0e2dc; border-radius: 9px; background: #fff; color: #1c3a36; font-size: 13px; }
.pairs-date-arrow { color: #8aa098; font-size: 16px; padding-bottom: 8px; }
.pairs-empty { color: #c3d1d8; font-weight: 700; }
@media (max-width: 720px) { .home-summary { grid-template-columns: 1fr; } .pairs-date-filter { flex-direction: column; align-items: stretch; } .pairs-date-controls { flex-wrap: wrap; } }

/* ===== 综合评估：历史评估记录折叠 ===== */
.geriatric-history { padding: 0; overflow: hidden; }
.geriatric-history > summary { cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 18px 20px; list-style: none; }
.geriatric-history > summary::-webkit-details-marker { display: none; }
.geriatric-history-title span { color: #287b6d; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.geriatric-history-title h2 { margin: 4px 0 0; font-size: 18px; color: #1d4d45; }
.geriatric-history-title small { color: #667a73; font-size: 11px; }
.geriatric-history-chevron { margin-left: auto; color: #6b8277; font-size: 16px; transition: transform .2s; }
.geriatric-history[open] > summary .geriatric-history-chevron { transform: rotate(180deg); }
.geriatric-history-body { padding: 0 20px 18px; }

/* ===== 家属观察记录三表 ===== */
.records-table { width: 100%; border-collapse: collapse; text-align: left; }
.records-table th { padding: 11px 12px; color: #647d72; border-bottom: 1px solid #dce7e4; background: #f3f8f6; font-size: 10px; font-weight: 800; white-space: nowrap; }
.records-table td { padding: 12px; border-bottom: 1px solid #edf1f0; font-size: 12px; vertical-align: top; overflow-wrap: anywhere; }
.records-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 850px) {
  .records-table, .records-table tbody { display: block; width: 100%; }
  .records-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .records-table tbody tr { display: grid; gap: 6px; padding: 11px; border: 1px solid #e1e8e7; border-radius: 10px; margin-bottom: 9px; background: #fafcfb; }
  .records-table tbody td { display: block; min-width: 0; padding: 0; border: 0; font-size: 13px; }
  .records-table tbody td::before { display: block; margin-bottom: 3px; color: #647d72; content: attr(data-label); font-size: 10px; font-weight: 800; }
}

/* ===== 专病日常反馈按病种展开 ===== */
.checkin-track { margin: 10px 0; border: 1px solid #e1e8e7; border-radius: 12px; background: #fafcfb; overflow: hidden; }
.checkin-track > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-size: 13px; font-weight: 800; color: #245b4b; background: #f3f8f6; list-style: none; }
.checkin-track > summary::-webkit-details-marker { display: none; }
.checkin-track > summary span { font-size: 11px; font-weight: 700; color: #647d72; background: #e6f0ec; border-radius: 999px; padding: 2px 9px; }
.checkin-track > summary::after { content: "⌄"; margin-left: auto; color: #6b8277; font-size: 15px; transition: transform .2s; }
.checkin-track[open] > summary::after { transform: rotate(180deg); }
.checkin-track .empty-state { padding: 16px; }
.checkin-track .empty-state h3 { font-size: 13px; }

/* ===== 长列表「更早记录」折叠：统一最近优先 + 历史折叠的标题样式 ===== */
.clinical-older-records { margin: 10px 0; border: 1px solid #e1e8e7; border-radius: 12px; background: #fafcfb; overflow: hidden; }
.clinical-older-records > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-size: 13px; font-weight: 800; color: #245b4b; background: #f3f8f6; list-style: none; }
.clinical-older-records > summary::-webkit-details-marker { display: none; }
.clinical-older-records > summary::after { content: "⌄"; margin-left: auto; color: #6b8277; font-size: 15px; transition: transform .2s; }
.clinical-older-records[open] > summary::after { transform: rotate(180deg); }
.clinical-older-records .instrument-table-scroll, .clinical-older-records .table-scroll { margin: 0; }
.clinical-older-records .patient-data-table-wrap { border: 0; border-radius: 0; }
.timeline-pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin: 12px 0 4px; }
.timeline-pager button { min-height: 34px; padding: 6px 14px; border: 1px solid #b9d5c9; border-radius: 8px; background: #fff; color: #17644e; font-weight: 700; cursor: pointer; }
.timeline-pager button:disabled { opacity: .5; cursor: not-allowed; }
.timeline-pager span { color: #526b60; font-size: 13px; }

.checkin-split { display: grid; gap: 14px; }
.checkin-group h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: #245b4b; }
.empty-inline { margin: 0; color: #8aa098; font-size: 12px; padding: 2px 0 6px; }

/* ===== 量表评估三 tab 工作台：总览 / 填写 / 记录，与病历照片页的 tab 视觉一致 ===== */
.clinical-scale-workbench{display:grid;gap:16px}
.scale-tabs{display:flex;gap:8px;border-bottom:1px solid #dbe8e1;margin-bottom:4px;flex-wrap:wrap}
.scale-tabs [role="tab"]{padding:12px 20px;border:1px solid #c6dcd4;border-bottom:0;border-radius:12px 12px 0 0;background:#f4f8f5;color:#4a645a;font-weight:700;cursor:pointer;font-size:16px}
.scale-tabs [role="tab"]:hover{background:#eaf3ee}
.scale-tabs [role="tab"].active,.scale-tabs [role="tab"][aria-selected="true"]{background:#fff;color:#1b5042;border-color:#1b5042}
.scale-tab-panel[hidden]{display:none}

/* 填写 / 记录 tab 顶部的统一评估日期控件，单选或多选。 */
.scale-date-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:13px 15px;border:1px solid #d3e4db;border-radius:12px;background:#f8fcfa;margin-bottom:14px}
.scale-date-bar label{display:flex;align-items:center;gap:8px;font-weight:700;color:#1b5042}
.scale-date-bar input[type="date"],.scale-date-bar select{padding:8px 10px;border:1px solid #c6dcd4;border-radius:8px;font:inherit;color:#23403a;background:#fff;min-height:40px}
.scale-date-bar small{color:#61756e;font-size:12px;max-width:46ch}

/* 记录 tab 评估日期多选下拉：按钮触发、勾选框多选，避免按住 Ctrl/Cmd 的 native 多选。 */
.scale-date-picker{display:flex;align-items:center;gap:8px}
.scale-date-picker-name{font-weight:700;color:#1b5042}
.scale-date-multi{position:relative;display:inline-block}
.scale-date-trigger{padding:8px 12px;border:1px solid #c6dcd4;border-radius:8px;background:#fff;font:inherit;color:#23403a;cursor:pointer;min-height:40px;min-width:150px;text-align:left}
.scale-date-trigger:hover{background:#eef7f2}
.scale-date-options{position:absolute;top:calc(100% + 4px);left:0;z-index:20;min-width:180px;max-height:240px;overflow:auto;padding:8px;border:1px solid #c6dcd4;border-radius:10px;background:#fff;box-shadow:0 8px 22px rgba(23,91,73,.14);display:grid;gap:2px}
.scale-date-options label{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;cursor:pointer;font-weight:600;color:#23403a}
.scale-date-options label:hover{background:#eef7f2}
.scale-date-options input{width:16px;height:16px;margin:0;accent-color:#176b55}
.scale-date-clear{margin-top:6px;padding:7px 10px;border:1px solid #d8b4b0;border-radius:8px;background:#fff;color:#9c3f37;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.scale-date-clear:hover{background:#fdf0ee}

/* 量表总览评估日期自绘日历：月份切换 + 日网格，已评估日期下方标小圆点。 */
.scale-date-field{position:relative;display:inline-flex;align-items:center;gap:8px}
.scale-date-field>label{font-weight:700;color:#1b5042}
.scale-date-trigger{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #c6dcd4;border-radius:8px;background:#fff;font:inherit;font-weight:700;color:#23403a;cursor:pointer;min-height:40px}
.scale-date-trigger:hover{background:#eef7f2}
.scale-date-caret{color:#7a948c;font-size:11px}
.scale-calendar{position:absolute;top:calc(100% + 6px);left:0;z-index:30;width:264px;padding:12px;border:1px solid #c6dcd4;border-radius:12px;background:#fff;box-shadow:0 10px 28px rgba(23,91,73,.16)}
.scale-calendar-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:800;color:#1b5042}
.scale-calendar-nav{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #c6dcd4;border-radius:8px;background:#fff;color:#1b5042;font-size:16px;line-height:1;cursor:pointer}
.scale-calendar-nav:hover{background:#eef7f2}
.scale-calendar-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:4px}
.scale-calendar-weekdays span{text-align:center;font-size:11px;font-weight:700;color:#7a948c;padding:4px 0}
.scale-calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.scale-calendar-day{position:relative;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px 0 4px;border:none;border-radius:8px;background:transparent;font:inherit;font-size:13px;font-weight:600;color:#23403a;cursor:pointer}
.scale-calendar-day:hover{background:#eef7f2}
.scale-calendar-day.is-today{box-shadow:inset 0 0 0 1px #176b55}
.scale-calendar-day.is-selected{background:#1c5e50;color:#fff}
.scale-calendar-day.is-selected .scale-calendar-dot{background:#fff}
.scale-calendar-blank{min-height:34px}
.scale-calendar-dot{width:5px;height:5px;border-radius:50%;background:var(--red);opacity:0}
.scale-calendar-day.has-dot .scale-calendar-dot{opacity:1}

/* 填写 / 记录 tab 的操作按钮：打开并填写、继续填写、医生复核、撤销复核、删除。 */
.scale-row-action{display:inline-block;padding:7px 13px;margin:2px 6px 2px 0;border-radius:8px;font-weight:700;font-size:13px;cursor:pointer;border:1px solid #1c5e50;background:#1c5e50;color:#fff}
.scale-row-action:hover{background:#14503f;border-color:#14503f}
.scale-row-action-review{background:#b7791f;border-color:#b7791f}
.scale-row-action-review:hover{background:#9c6517;border-color:#9c6517}
.scale-row-action-ghost{background:#fff;color:#315e54;border-color:#bfd7ca}
.scale-row-action-ghost:hover{background:#eef7f2}
.scale-row-action-danger{background:#fff;color:#9c3f37;border-color:#d8b4b0}
.scale-row-action-danger:hover{background:#fdf0ee}

/* 量表目录与记录表的操作列，避免按钮换行挤压。 */
.scale-fill-catalog td,.scale-record-table td{vertical-align:top}
.scale-record-actions,.scale-fill-catalog td:last-child{white-space:nowrap}

/* 独立填写页：左上返回箭头 + 标题，整页替换工作台。 */
.scale-fill-page{display:grid;gap:14px}
.scale-fill-back{justify-self:start;padding:8px 14px;border:1px solid #bfd7ca;border-radius:999px;background:#fff;color:#175b49;font-weight:700;cursor:pointer;font-size:14px}
.scale-fill-back:hover{background:#eef7f2}
.scale-fill-nav{display:flex;gap:8px;flex-wrap:wrap}
.scale-fill-record{display:grid;gap:10px;padding:14px 16px;border:1px solid #d3e4db;border-radius:12px;background:#fbfdfc}
.scale-fill-summary{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0;color:#1b5042;font-size:14px}
.scale-fill-summary b{color:#175b49}
.scale-fill-head h3{margin:0 0 4px;color:#1b5042;font-size:20px}
.scale-fill-head p{margin:0;color:#61756e}
.scale-fill-review{display:grid;gap:14px}
.scale-fill-note{color:#5b706b;font-size:13px;line-height:1.6}
.scale-review-form{margin-top:6px}
.scale-locked-actions{display:flex;gap:8px}

/* 量表状态补充色：已复核、填写中、未填写、无法完成、安全中止。 */
.instrument-status.status-accepted{background:#e2f2e9;color:#175b49}
.instrument-status.status-in_progress{background:#e6f0fb;color:#2c5f9e}
.instrument-status.status-empty{background:#eef2ef;color:#7c8f87}
.instrument-status.status-unable_to_assess,.instrument-status.status-safety_stopped{background:#f3ebeb;color:#855252}

/* ===== 重构后的医生端界面：侧边栏患者列表 + 顶部当前患者卡片与横向标签 ===== */

/* 侧边栏患者列表：替代原「患者与专病」导航与患者下拉选择器，选中项高亮醒目。 */
.doctor-sidebar > .doctor-desktop-nav { flex: 0 0 auto; margin-top: 10px; overflow: visible; }

/* 侧边栏当前患者大卡片：四行依次为姓名+年龄+观察时长、建档时间、管理方向、绑定码；姓名字号稍大。 */
.doctor-patient-card {
  margin: 8px 4px 0;
  padding: 13px 13px 11px;
  border: 1px solid #dde8e3;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 62, 57, .06);
}
.doctor-patient-card-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 10px;
  margin-bottom: 3px;
  border-bottom: 1px solid #eef4f1;
}
.doctor-patient-card-name h2 {
  margin: 0;
  color: #1c3a36;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.doctor-patient-card-name .doctor-patient-card-age {
  color: #6d8b82;
  font-size: 12px;
  font-weight: 750;
}
.doctor-patient-card-name .doctor-patient-card-duration {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  color: #287b6d;
  background: #e1f2ed;
  font-size: 10.5px;
  font-weight: 800;
}
.doctor-patient-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.doctor-patient-card-row-label {
  flex: 0 0 auto;
  color: #8aa098;
  font-size: 10.5px;
  letter-spacing: .02em;
}
.doctor-patient-card-row-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #35544d;
  font-size: 12px;
  font-weight: 750;
}

.doctor-patient-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 12px 4px 0;
}
.doctor-patient-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 6px 6px;
}
.doctor-patient-list-head span { color: #6d8b82; font-size: 11px; font-weight: 750; letter-spacing: .03em; }
.doctor-patient-list-head small { color: #8aa098; font-size: 10px; }

.doctor-patient-search { display: block; padding: 0 6px 7px; }
.doctor-patient-search input { width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid #c9dad2; border-radius: 10px; color: #23423c; background: #ffffff; font-size: 13px; }
.doctor-patient-search input::placeholder { color: #9ab0a8; }
.doctor-patient-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(40, 123, 109, .15); }

.doctor-patient-list-empty { margin: 6px; padding: 12px 8px; border-radius: 8px; color: #8aa098; font-size: 12px; text-align: center; }

.doctor-patient-list-body {
  display: grid;
  gap: 4px;
  min-height: 0;
  padding: 2px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(174,224,212,.35) transparent;
}
.doctor-patient-list-body::-webkit-scrollbar { width: 5px; }
.doctor-patient-list-body::-webkit-scrollbar-thumb { border-radius: 8px; background: rgba(174,224,212,.28); }

.doctor-patient-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #35544d;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.doctor-patient-item:hover { color: #1c3a36; background: #e7f2ed; }
.doctor-patient-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.doctor-patient-item-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a948c;
  font-size: 10.5px;
  line-height: 1.35;
}
.doctor-patient-item:hover .doctor-patient-item-meta { color: #54736b; }
.doctor-patient-item.active {
  color: #1c3a36;
  background: #e1f2ed;
  border-color: #7fc7b6;
  box-shadow: 0 4px 12px rgba(40, 123, 109, .12);
}
.doctor-patient-item.active .doctor-patient-item-meta { color: #33655b; }
.doctor-patient-item-inactive {
  align-self: flex-start;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #b23a44;
  background: #fdeaea;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.4;
}
.doctor-patient-list-add {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed #a8c9bd;
  border-radius: 10px;
  color: #4a7168;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.doctor-patient-list-add:hover { color: #ffffff; background: var(--green); border-color: var(--green); }

/* 顶部当前患者卡片与横向分类标签：醒目展示当前患者，分类页切换固定于内容上方。 */
.clinical-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid #dbe7e2;
  border-radius: 14px;
  background: #f4f8f6;
}
.clinical-page-tabs-care {
  margin-left: auto;
  flex: 0 0 auto;
}

.current-patient-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #d3e2dc;
  border-left: 6px solid var(--green);
  border-radius: 14px;
  background: linear-gradient(120deg, #ffffff, #f0f8f5);
  box-shadow: 0 8px 24px rgba(23, 62, 57, .08);
}
.current-patient-card-label {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.current-patient-card-main { min-width: 0; }
.current-patient-card-main h1 {
  margin: 0 0 3px;
  color: #173b3c;
  font-size: clamp(21px, 2.2vw, 26px);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.current-patient-card-main p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #4d6861;
  font-size: 13px;
}
.current-patient-card-main p > span { font-weight: 700; }
.current-patient-card-main p > i { color: #9ab0a8; font-style: normal; }
.current-patient-status { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.current-patient-status.inactive { color: #a63a44; background: #ffebed; }

.clinical-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.clinical-page-tabs button {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #cddcd5;
  border-radius: 9px;
  color: #3f5e56;
  background: #ffffff;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.clinical-page-tabs button:hover { color: #173b3c; background: #e5f0ec; border-color: #b7cec5; }
.clinical-page-tabs button.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(40, 123, 109, .28);
}
.clinical-page-tabs button:focus-visible { outline: 3px solid #1b6860; outline-offset: 2px; }
.clinical-page-tabs button .clinical-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 7px;
  border-radius: 999px;
  color: #fff;
  background: #e0644a;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}
.clinical-page-tabs button.active .clinical-tab-badge { color: #1d5c50; background: #fff; }

/* 多中心研究分析：专病方向 tab 与量表分值矩阵。 */
.multi-center-tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 5px;
  border: 1px solid #dde8e3;
  border-radius: 12px;
  background: #f4f8f6;
}
.multi-center-tabs button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 9px;
  color: #4d6b63;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.multi-center-tabs button i {
  padding: 1px 8px;
  border-radius: 999px;
  color: #6d8b82;
  background: #e7f0ec;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.multi-center-tabs button:hover { color: #1c3a36; background: #e7f2ed; }
.multi-center-tabs button.active {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 4px 12px rgba(40, 123, 109, .28);
}
.multi-center-tabs button.active i { color: #287b6d; background: #ffffff; }

/* 专病分析项：横向可换行的项目分组按钮，主标签配一句口径说明，帮助医生一眼看懂每个分组看什么。 */
.multi-center-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.multi-center-items button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 14px;
  border: 1px solid #dde8e3;
  border-radius: 11px;
  color: #4d6b63;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.multi-center-items button b {
  color: #1c3a36;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
}
.multi-center-items button small {
  color: #8aa098;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}
.multi-center-items button:hover { border-color: #bcd8cd; background: #f4faf7; }
.multi-center-items button.active {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 4px 12px rgba(40, 123, 109, .14);
}
.multi-center-items button.active b { color: #1d5c50; }
.multi-center-items button.active small { color: #287b6d; }

/* 查看方式与分组维度：同一行的两组分段控件，保持页面简洁，不额外展开面板。 */
.multi-center-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.multi-center-modes, .multi-center-groups {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid #dde8e3;
  border-radius: 10px;
  background: #f4f8f6;
}
.multi-center-modes-label {
  margin: 0 6px 0 4px;
  color: #8aa098;
  font-size: 12px;
  font-weight: 700;
}
.multi-center-modes button, .multi-center-groups button {
  min-height: 32px;
  padding: 5px 14px;
  border: 0;
  border-radius: 7px;
  color: #4d6b63;
  background: transparent;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.multi-center-modes button:hover, .multi-center-groups button:hover { color: #1c3a36; background: #e7f2ed; }
.multi-center-modes button.active, .multi-center-groups button.active {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 3px 9px rgba(40, 123, 109, .26);
}

.multi-center-matrix-scroll { overflow-x: auto; border: 1px solid #dde8e3; border-radius: 13px; background: #ffffff; box-shadow: 0 5px 20px rgba(23, 62, 57, .05); }
.multi-center-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.multi-center-matrix th, .multi-center-matrix td {
  padding: 11px 13px;
  border-bottom: 1px solid #eef4f1;
  text-align: center;
  white-space: nowrap;
}
.multi-center-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #54736b;
  background: #f4f8f6;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
}
.multi-center-matrix thead th.multi-center-patient-col { text-align: left; }
.multi-center-matrix thead th.multi-center-date-col { text-align: left; }
.multi-center-matrix tbody tr:last-child td { border-bottom: 0; }
.multi-center-matrix tbody tr:hover td { background: #f7fbf9; }
.multi-center-patient-col {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 122px;
  max-width: 190px;
  text-align: left;
  background: #ffffff;
}
.multi-center-matrix tbody tr:hover .multi-center-patient-col { background: #f7fbf9; }
.multi-center-patient-col b { display: block; color: #1c3a36; font-size: 14px; font-weight: 800; letter-spacing: .03em; }
.multi-center-patient-col small { display: block; margin-top: 2px; color: #8aa098; font-size: 11px; }
.multi-center-date-col {
  min-width: 100px;
  text-align: left;
  color: #54736b;
  background: #ffffff;
}
.multi-center-date-col .multi-center-date {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  color: #35544d;
  background: #eef4f1;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .01em;
}
.multi-center-matrix tbody tr:hover .multi-center-date-col { background: #f7fbf9; }
.multi-center-matrix td.has-score b { color: #216a5d; font-size: 15px; font-weight: 800; }
.multi-center-matrix td.has-score small { color: #9ab0a8; font-size: 10.5px; font-weight: 650; }
.multi-center-matrix td.is-empty span { color: #c9d8d2; }

.multi-center-empty {
  padding: 48px 24px;
  border: 1px dashed #d5e2dd;
  border-radius: 14px;
  color: #6d8b82;
  background: #fafcfb;
  text-align: center;
}
.multi-center-empty > span { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; color: var(--green); background: var(--green-soft); font-size: 24px; font-weight: 900; }
.multi-center-empty h3 { margin: 0 0 6px; color: #35544d; font-size: 15px; }
.multi-center-empty p { margin: 0; color: #8aa098; font-size: 12.5px; }

/* 多中心研究分析：人群概况与专病分析的指标卡、分节标题与说明文字。 */
.multi-center-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.multi-center-card {
  padding: 16px 18px;
  border: 1px solid #dde8e3;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 5px 20px rgba(23, 62, 57, .05);
}
.multi-center-card span { display: block; color: #6d8b82; font-size: 12px; font-weight: 700; }
.multi-center-card b { display: block; margin-top: 6px; color: #1c3a36; font-size: 26px; font-weight: 900; letter-spacing: .01em; line-height: 1; }
.multi-center-card b small { margin-left: 4px; color: #8aa098; font-size: 12px; font-weight: 700; }
.multi-center-section { margin: 0 0 18px; }
.multi-center-section h3 { margin: 0 0 8px; color: #245b4b; font-size: 14px; font-weight: 800; }
.multi-center-note { margin: 0 0 12px; color: #7c8f87; font-size: 12.5px; line-height: 1.6; }
.multi-center-matrix td b.delta { color: #1d5c50; font-size: 14px; font-weight: 800; }
.multi-center-matrix td .multi-center-na { color: #9ab0a8; font-size: 12px; }
.multi-center-matrix td small { display: block; margin-top: 2px; color: #9ab0a8; font-size: 11px; font-weight: 650; }
@media (max-width: 850px) {
  .multi-center-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 移动端：侧边栏折叠为顶部栏，患者列表转入下拉菜单并切换为浅色。 */
@media (max-width: 850px) {
  .doctor-sidebar > .doctor-patient-list { display: none; }
  .doctor-sidebar > .doctor-patient-card { display: none; }
  .doctor-mobile-nav .doctor-patient-card {
    margin: 0 0 9px;
    padding: 12px;
    border: 1px solid #d5e6df;
    border-radius: 9px;
    background: #eef6f2;
  }
  .doctor-mobile-nav .doctor-patient-card-name h2 { color: #173b3c; }
  .doctor-mobile-nav .doctor-patient-card-name .doctor-patient-card-age { color: #5d7c72; }
  .doctor-mobile-nav .doctor-patient-card-name .doctor-patient-card-duration { color: #1d4d45; background: #aee0d4; }
  .doctor-mobile-nav .doctor-patient-card-row-label { color: #6f8e84; }
  .doctor-mobile-nav .doctor-patient-card-row-value { color: #28584d; }
  .doctor-mobile-nav .doctor-patient-list {
    display: block;
    flex: none;
    margin: 0 0 9px;
    padding: 10px;
    border: 1px solid #d5e6df;
    border-radius: 9px;
    background: #eef6f2;
  }
  .doctor-mobile-nav .doctor-patient-list-head { padding: 2px 2px 6px; }
  .doctor-mobile-nav .doctor-patient-list-head span { color: #406a5e; }
  .doctor-mobile-nav .doctor-patient-list-head small { color: #6f8e84; }
  .doctor-mobile-nav .doctor-patient-list-body { display: grid; gap: 4px; overflow: visible; }
  .doctor-mobile-nav .doctor-patient-search { padding: 0 2px 6px; }
  .doctor-mobile-nav .doctor-patient-search input { border-color: #9fc7b8; color: #1d4d45; background: #fff; }
  .doctor-mobile-nav .doctor-patient-search input::placeholder { color: #6f8e84; }
  .doctor-mobile-nav .doctor-patient-search input:focus { border-color: #7fd4c2; box-shadow: 0 0 0 3px rgba(127, 212, 194, .22); }
  .doctor-mobile-nav .doctor-patient-list-empty { color: #6f8e84; }
  .doctor-mobile-nav .doctor-patient-item { color: #28584d; }
  .doctor-mobile-nav .doctor-patient-item:hover { background: #e2efe9; }
  .doctor-mobile-nav .doctor-patient-item-meta { color: #5d7c72; }
  .doctor-mobile-nav .doctor-patient-item.active { color: #173d3a; background: #aee0d4; border-color: #7fd4c2; box-shadow: none; }
  .doctor-mobile-nav .doctor-patient-item.active .doctor-patient-item-meta { color: #33655b; }
  .doctor-mobile-nav .doctor-patient-list-add { color: #406a5e; border-color: #9fc7b8; }
  .doctor-mobile-nav .doctor-patient-list-add:hover { color: #173d3a; background: #aee0d4; }
  .clinical-topbar { gap: 10px; }
}
