/* =========================================================
 * security.css —— 安全模块（策略管理 / 创建 / 详情 / 审计日志）
 * 共用的小颗粒样式
 * =======================================================*/

/* 折叠面板 */
.plugin-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 0;
  opacity: 0;
}
.plugin-body.open {
  max-height: 1200px;
  opacity: 1;
}

/* toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 20px;
  transition: 0.2s;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}
input:checked + .toggle-slider { background-color: #2563eb; }
input:checked + .toggle-slider:before { transform: translateX(16px); }

/* 标签 chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
}
.chip-remove { cursor: pointer; color: #93c5fd; }
.chip-remove:hover { color: #1d4ed8; }

textarea { resize: vertical; }

/* badge */
.badge-phase {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* 策略说明气泡 */
.plugin-help-anchor { position: relative; flex-shrink: 0; }
.plugin-help-popover {
  pointer-events: none;
  position: absolute;
  z-index: 60;
  left: 0;
  top: 100%;
  margin-top: 6px;
  width: 18rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  font-size: 12px;
  line-height: 1.45;
  color: #4b5563;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.plugin-help-anchor:hover .plugin-help-popover,
.plugin-help-anchor:focus-within .plugin-help-popover {
  visibility: visible;
  opacity: 1;
}
