/* 病-症-证-穴批量审核界面 V5.18.5
   独立加载，避免历史主样式中的语法错误影响本模块。 */

.knowledge-structure-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-top:16px;
}
.structure-stat{
  min-height:102px;
  padding:17px;
  border:1px solid var(--border);
  border-radius:18px;
  background:
    linear-gradient(145deg,color-mix(in srgb,var(--primary) 7%,transparent),transparent 58%),
    var(--surface);
  box-shadow:var(--shadow);
}
.structure-stat span{
  display:block;
  color:var(--muted);
  font-size:12px;
}
.structure-stat strong{
  display:block;
  margin-top:10px;
  color:var(--text);
  font-size:28px;
}
.structure-stat.priority{
  border-color:color-mix(in srgb,var(--accent) 38%,var(--border));
  background:
    linear-gradient(145deg,color-mix(in srgb,var(--accent) 14%,transparent),transparent 62%),
    var(--surface);
}
.knowledge-structure-center{overflow:hidden}
.knowledge-structure-toolbar{
  display:grid;
  grid-template-columns:220px 190px minmax(240px,1fr) auto;
  gap:11px;
  align-items:end;
  margin-top:16px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:color-mix(in srgb,var(--surface) 80%,var(--bg));
}
.knowledge-structure-toolbar label,
.structure-note{
  display:grid;
  gap:7px;
  color:var(--muted);
  font-size:12px;
}
.knowledge-structure-toolbar select,
.knowledge-structure-toolbar input,
.structure-note input{
  width:100%;
  min-height:44px;
}
.structure-batch-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:end;
  margin:13px 0;
}
.structure-batch-row .primary{
  min-height:46px;
  white-space:nowrap;
}
.structure-batch-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:9px;
}
.structure-batch-actions button{min-height:46px}
.batch-auto-button{
  border-color:color-mix(in srgb,var(--accent) 48%,var(--border))!important;
  color:var(--accent)!important;
}
.structure-selection-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:-2px 0 12px;
  padding:10px 13px;
  border:1px dashed color-mix(in srgb,var(--primary) 32%,var(--border));
  border-radius:13px;
  color:var(--muted);
  background:color-mix(in srgb,var(--primary) 5%,transparent);
  font-size:12px;
}
.structure-selection-toolbar>div{
  display:flex;
  gap:7px;
  flex-shrink:0;
}
.structure-selection-toolbar .compact{
  min-height:34px;
  padding:6px 11px;
}
.knowledge-structure-list{
  display:grid;
  gap:10px;
  max-height:720px;
  overflow:auto;
  padding-right:3px;
}
.knowledge-structure-list.empty{
  min-height:120px;
  place-items:center;
  color:var(--muted);
  border:1px dashed var(--border);
  border-radius:16px;
}
.knowledge-structure-item{
  display:grid!important;
  grid-template-columns:52px minmax(0,1fr)!important;
  gap:14px;
  width:100%;
  min-height:104px;
  padding:16px!important;
  border:1px solid var(--border);
  border-radius:16px;
  background:color-mix(in srgb,var(--surface) 88%,var(--bg));
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease,box-shadow .16s ease;
}
.knowledge-structure-item:hover{
  border-color:color-mix(in srgb,var(--primary) 45%,var(--border));
  background:color-mix(in srgb,var(--primary) 6%,var(--surface));
  transform:translateY(-1px);
}
.knowledge-structure-item:focus-within{
  outline:3px solid color-mix(in srgb,var(--accent) 22%,transparent);
  outline-offset:2px;
}
.knowledge-structure-item:has(input:checked){
  border-color:color-mix(in srgb,var(--accent) 62%,var(--border));
  background:
    linear-gradient(135deg,color-mix(in srgb,var(--accent) 10%,transparent),transparent),
    var(--surface);
  box-shadow:inset 5px 0 0 var(--accent);
}
.knowledge-structure-item:has(input:disabled){
  cursor:not-allowed;
  opacity:.68;
  transform:none;
}
.knowledge-structure-item>.knowledge-structure-checkbox,
.knowledge-structure-item>input[type="checkbox"]{
  appearance:auto!important;
  display:block!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  margin:5px auto 0!important;
  padding:0!important;
  accent-color:var(--accent);
  cursor:pointer;
}
.knowledge-structure-item>input:disabled{cursor:not-allowed}
.knowledge-structure-main{
  display:block;
  min-width:0;
}
.knowledge-structure-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.knowledge-structure-head h4{
  margin:5px 0 0;
  color:var(--text);
  font-size:15px;
}
.knowledge-structure-badges{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}
.role-badge{
  display:inline-flex;
  padding:6px 9px;
  border:1px solid color-mix(in srgb,var(--primary) 24%,var(--border));
  border-radius:999px;
  color:var(--primary);
  background:color-mix(in srgb,var(--primary) 9%,transparent);
  font-size:10px;
  font-weight:800;
}
.role-badge.core{
  border-color:color-mix(in srgb,var(--accent) 35%,var(--border));
  color:var(--accent);
  background:color-mix(in srgb,var(--accent) 10%,transparent);
}
.structure-source-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  margin-top:8px;
  color:var(--muted);
  font-size:11px;
}
.structure-source-meta span{overflow-wrap:anywhere}
.structure-signal-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}
.structure-signal-list span{
  padding:5px 8px;
  border-radius:999px;
  color:color-mix(in srgb,var(--text) 78%,var(--muted));
  background:color-mix(in srgb,var(--primary) 8%,transparent);
  font-size:10px;
}
.structure-preview{
  display:-webkit-box;
  margin:10px 0 0;
  overflow:hidden;
  color:var(--muted);
  font-size:12px;
  line-height:1.65;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
}
.structure-result-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.structure-result-summary div{
  padding:13px;
  border:1px solid var(--border);
  border-radius:14px;
}
.structure-result-summary strong{
  display:block;
  margin-top:6px;
  font-size:22px;
}
.structure-result-list{
  display:grid;
  gap:8px;
  margin-top:12px;
}
.structure-result-list p{
  margin:0;
  padding:10px 12px;
  border-radius:12px;
  background:color-mix(in srgb,var(--surface) 78%,var(--bg));
}
.structure-result-actions{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-top:14px;
}
.quality-gate{
  margin-top:12px;
  padding:12px;
  border:1px solid color-mix(in srgb,#d89614 38%,var(--border));
  border-radius:14px;
  background:color-mix(in srgb,#d89614 8%,transparent);
}
.quality-gate.is-pass{
  border-color:color-mix(in srgb,var(--accent) 42%,var(--border));
  background:color-mix(in srgb,var(--accent) 8%,transparent);
}
.quality-gate b{
  display:block;
  margin-bottom:6px;
}
.clinical-card-toolbar{
  flex-wrap:wrap;
  justify-content:flex-end;
}
.clinical-card-toolbar #clinicalCardBatchApproveBtn{
  min-height:42px;
  white-space:nowrap;
}

@media(max-width:1080px){
  .knowledge-structure-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .knowledge-structure-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .structure-search{grid-column:1/-1}
}
@media(max-width:680px){
  .knowledge-structure-stats,
  .knowledge-structure-toolbar,
  .structure-batch-row,
  .structure-result-summary{
    grid-template-columns:1fr;
  }
  .knowledge-structure-head{flex-direction:column}
  .knowledge-structure-badges{justify-content:flex-start}
  .structure-batch-row .primary{width:100%}
  .structure-batch-actions,
  .structure-selection-toolbar{
    display:grid;
    grid-template-columns:1fr;
  }
  .structure-selection-toolbar>div{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .structure-batch-actions button,
  .clinical-card-toolbar #clinicalCardBatchApproveBtn{
    width:100%;
  }
}
