.qbc-pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.qbc-pm-panel {
  display: flex;
  max-height: 92vh;
  width: min(920px, 100%);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.qbc-pm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 48%, #ecfeff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.qbc-pm-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
}

.qbc-pm-subtitle {
  margin: 6px 0 0;
  color: #475569;
  font-size: 13px;
}

.qbc-pm-close {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 10px;
}

.qbc-pm-close:hover {
  background: #fff;
  color: #0f172a;
}

.qbc-pm-status {
  min-height: 0;
  padding: 0 22px;
  color: #475569;
  font-size: 12px;
  transition: all 0.18s ease;
}

.qbc-pm-status:not(:empty) {
  min-height: 30px;
  padding-top: 10px;
}

.qbc-pm-status.is-error {
  color: #b91c1c;
}

.qbc-pm-status.is-success {
  color: #047857;
}

.qbc-pm-status.is-loading {
  color: #0369a1;
}

.qbc-pm-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 16px 22px 22px;
}

.qbc-pm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.qbc-pm-summary-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.qbc-pm-summary-chip strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}

.qbc-pm-summary-chip.is-enabled {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.qbc-pm-summary-chip.is-disabled {
  background: #f8fafc;
}

.qbc-pm-summary-chip.is-uninstalled {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.qbc-pm-help {
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
}

.qbc-pm-help-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: #0f172a;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}

.qbc-pm-help-summary::-webkit-details-marker {
  display: none;
}

.qbc-pm-help-summary::after {
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff;
  color: #4f46e5;
  content: "收起";
  font-size: 11px;
  font-weight: 600;
}

.qbc-pm-help:not([open]) .qbc-pm-help-summary::after {
  content: "展开";
}

.qbc-pm-help-label {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.qbc-pm-help-icon {
  font-size: 16px;
  line-height: 1;
}

.qbc-pm-help-label strong {
  color: #312e81;
  font-size: 13px;
}

.qbc-pm-help-badge {
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
}

.qbc-pm-help-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #e0e7ff;
  padding: 12px 14px 14px;
}

.qbc-pm-help-intro {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.qbc-pm-help-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qbc-pm-help-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 10px;
  background: #fff;
}

.qbc-pm-help-step-index {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

.qbc-pm-help-step-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.qbc-pm-help-step-copy strong {
  color: #1e293b;
  font-size: 12px;
}

.qbc-pm-help-step-copy span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.55;
}

.qbc-pm-help-command {
  align-self: flex-start;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
}

.qbc-pm-help-notes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}

.qbc-pm-help-notes strong {
  color: #334155;
  font-size: 12px;
}

.qbc-pm-help-notes ul {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.qbc-pm-guide,
.qbc-pm-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qbc-pm-bind {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

.qbc-pm-bind-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qbc-pm-bind-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.qbc-pm-bind-count {
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.qbc-pm-bind-desc {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

.qbc-pm-bind-actions {
  display: flex;
  gap: 8px;
}

.qbc-pm-bind-code {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed #60a5fa;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.qbc-pm-bind-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qbc-pm-bind-code-value {
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 6px;
}

.qbc-pm-bind-code-tip,
.qbc-pm-bind-pending {
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

.qbc-pm-bind-pending {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}

.qbc-pm-bind-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qbc-pm-bind-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.qbc-pm-bind-item-main {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.qbc-pm-bind-item-main code {
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 2px 6px;
  font-size: 12px;
}

.qbc-pm-bind-empty {
  color: #94a3b8;
  font-size: 12px;
}

.qbc-pm-guide h4,
.qbc-pm-group h4 {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.qbc-pm-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}

.qbc-pm-command-text {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.qbc-pm-command-text code {
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  padding: 2px 6px;
  font-size: 12px;
}

.qbc-pm-copy,
.qbc-pm-refresh {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.qbc-pm-copy:hover,
.qbc-pm-refresh:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.qbc-pm-plugin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.qbc-pm-plugin[data-status="enabled"] {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.qbc-pm-plugin[data-status="uninstalled"] {
  border-style: dashed;
  background: #fafafa;
}

.qbc-pm-plugin-main {
  min-width: 0;
}

.qbc-pm-plugin-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.qbc-pm-plugin-name {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.qbc-pm-plugin-id {
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.qbc-pm-plugin-desc {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.qbc-pm-badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.qbc-pm-badge.is-enabled {
  background: #dcfce7;
  color: #166534;
}

.qbc-pm-badge.is-disabled {
  background: #e2e8f0;
  color: #475569;
}

.qbc-pm-badge.is-uninstalled {
  background: #ede9fe;
  color: #5b21b6;
}

.qbc-pm-badge.is-maintenance {
  background: #fef3c7;
  color: #92400e;
}

.qbc-pm-badge.is-self {
  background: #dbeafe;
  color: #1d4ed8;
}

.qbc-pm-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.qbc-pm-action {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
}

.qbc-pm-action:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.qbc-pm-action.is-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.qbc-pm-action.is-primary:hover {
  background: #1d4ed8;
}

.qbc-pm-action.is-danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.qbc-pm-action.is-danger:hover {
  background: #fef2f2;
}

.qbc-pm-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.qbc-pm-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 28px;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
}

.qbc-pm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e2e8f0;
  padding: 12px 22px;
  background: #f8fafc;
}

.qbc-pm-footer-hint {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 640px) {
  .qbc-pm-overlay {
    padding: 0;
  }

  .qbc-pm-panel {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .qbc-pm-summary {
    grid-template-columns: 1fr;
  }

  .qbc-pm-help-steps {
    grid-template-columns: 1fr;
  }

  .qbc-pm-plugin {
    align-items: flex-start;
    flex-direction: column;
  }

  .qbc-pm-actions {
    width: 100%;
  }

  .qbc-pm-action {
    flex: 1;
  }
}
