/* 开放与平台 → 安全组：Harness 面板、筛选栏与规则表。
 * 只引用 harness-ui.css 的 --hui-* 令牌，布局规则限定在 #runnerSecurityView 内。 */
#runnerSecurityView.page-view.active {
  background: var(--hui-canvas);
  color: var(--hui-text);
  font-family: var(--hui-sans);
}
#runnerSecurityView .page-heading h1 {
  margin: 0 0 6px;
  color: var(--hui-text);
  font-size: 22px;
  font-weight: 600;
}
#runnerSecurityView .page-heading > div > p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--hui-secondary);
  font-size: 13px;
  line-height: 1.5;
}

#runnerSecurityBody { display: flex; flex-direction: column; gap: 16px; }
.sg-card {
  overflow: hidden;
  border: 1px solid var(--hui-border);
  border-radius: 14px;
  background: var(--hui-surface);
  box-shadow: var(--hui-panel-shadow);
}
.sg-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hui-border);
}
.sg-card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--hui-text);
  font-size: 15px;
  font-weight: 600;
}
.sg-card-head p { margin: 0; color: var(--hui-secondary); font-size: 13px; line-height: 1.5; }
.sg-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.sg-card-body { padding: 16px 18px; }
.sg-note { margin: 0 0 12px; color: var(--hui-secondary); font-size: 13px; line-height: 1.6; }
.sg-note strong { color: var(--hui-text); font-weight: 600; }
.sg-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; color: var(--hui-tertiary); font-size: 12.5px; }
.sg-meta b { margin-left: 5px; color: var(--hui-text); font-family: var(--hui-mono); font-weight: 500; }
.sg-error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--hui-error);
  border-radius: 8px;
  background: var(--hui-surface);
  color: var(--hui-error);
  font-size: 13px;
  line-height: 1.5;
}
.sg-error[hidden] { display: none; }
.sg-error .button { margin-left: 10px; }
.sg-loading { padding: 22px 18px; color: var(--hui-muted); font-size: 13px; }

.sg-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hui-border);
}
.sg-tabs { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--hui-soft); }
.sg-tab {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hui-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s, background-color .15s;
}
.sg-tab:hover { color: var(--hui-text); }
.sg-tab.is-active { background: var(--hui-surface); color: var(--hui-text); box-shadow: var(--hui-ind-shadow); }
.sg-tab span { margin-left: 4px; color: var(--hui-tertiary); font-family: var(--hui-mono); font-size: 11px; }
.sg-tab.is-active span { color: var(--hui-secondary); }
.sg-search { position: relative; display: inline-flex; align-items: center; flex: 1 1 220px; max-width: 320px; }
.sg-search svg { position: absolute; left: 10px; color: var(--hui-tertiary); pointer-events: none; }
.sg-search input { width: 100%; height: 34px; padding-left: 32px; }
.sg-required { display: inline-flex; align-items: center; gap: 7px; color: var(--hui-secondary); font-size: 12.5px; cursor: pointer; }
.sg-required input { margin: 0; }

.sg-table-wrap { overflow-x: auto; }
#runnerSecurityView .sg-table { width: 100%; min-width: 780px; border-collapse: collapse; table-layout: fixed; }
#runnerSecurityView .sg-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hui-border);
  color: var(--hui-tertiary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
#runnerSecurityView .sg-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--hui-border-soft);
  color: var(--hui-text);
  font-size: 12.5px;
  line-height: 1.45;
  vertical-align: middle;
}
#runnerSecurityView .sg-table tbody tr:last-child td { border-bottom: 0; }
#runnerSecurityView .sg-table tbody tr:hover td { background: var(--hui-soft); }
#runnerSecurityView .sg-table th:nth-child(1) { width: 78px; }
#runnerSecurityView .sg-table th:nth-child(2) { width: 76px; }
#runnerSecurityView .sg-table th:nth-child(3) { width: 78px; }
#runnerSecurityView .sg-table th:nth-child(4) { width: 190px; }
#runnerSecurityView .sg-table th:nth-child(5) { width: 76px; }
#runnerSecurityView .sg-table th:nth-child(7) { width: 76px; }
.sg-mono { font-family: var(--hui-mono); font-size: 12px !important; overflow-wrap: anywhere; }
.sg-desc { color: var(--hui-secondary) !important; overflow-wrap: anywhere; }
.sg-dash { color: var(--hui-tertiary); }
.sg-ipv6 { margin-left: 6px; color: var(--hui-tertiary); font-size: 10px; }
.sg-empty { padding: 26px 12px; color: var(--hui-muted); font-size: 13px; text-align: center; }
.sg-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--hui-border);
  color: var(--hui-tertiary);
  font-size: 12px;
}
.sg-card-foot[hidden] { display: none; }

@media (max-width: 860px) {
  .sg-card-head { flex-direction: column; }
  .sg-actions { width: 100%; }
  .sg-search { flex-basis: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-tab { transition: none; }
}

.sg-description { margin: 8px 0 0; color: var(--hui-secondary); font-size: 13px; }
#runnerSecurityView .sg-table-editing { min-width: 980px; }
#runnerSecurityView .sg-table-editing th:last-child { width: 195px; }
.sg-row-actions { white-space: nowrap; }
.sg-dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 20px;
  border: 1px solid var(--hui-border);
  border-radius: 14px;
  background: var(--hui-surface);
  color: var(--hui-text);
  font-family: var(--hui-sans);
}
.sg-dialog::backdrop { background: rgb(0 0 0 / .4); }
.sg-dialog h2 { margin: 0 0 16px; font-size: 16px; }
.sg-rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sg-rule-fields label { display: grid; gap: 5px; font-size: 13px; }
.sg-rule-fields .hui-input { width: 100%; }
.sg-rule-wide { grid-column: 1 / -1; }
.sg-dialog .sg-actions { justify-content: flex-end; margin-top: 16px; }
