/* ================= 通用原子与组件类 ================= */

.hidden {
  display: none !important;
}

.spacer {
  flex: 1;
}

/* ---- 按钮基础规范（参考 style.md）---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius, 12px);
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn-primary:hover:not(:disabled) {
  background: #000;
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius, 12px);
  background: var(--danger, #FF3849);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn-danger:hover:not(:disabled) {
  background: #a93226;
}
.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #000;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  box-sizing: border-box;
}
.icon-btn:hover:not(:disabled) {
  background: var(--icon-hover-bg, rgba(0, 0, 0, 0.03));
}
.icon-btn:active:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.icon-btn .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.icon-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.icon-btn .icon svg {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(23, 131, 255, 0.2);
  border-top-color: var(--link, #1783ff);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-sizing: border-box;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.icon-btn.is-loading,
button.is-loading {
  opacity: 1 !important;
  pointer-events: none;
  cursor: default;
}

/* ---- 徽章与标签 ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 16px;
  background: var(--surface, #f5f5f5);
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
}

.badge-green {
  background: rgba(47, 179, 109, 0.1);
  color: var(--admin-green, #2fb36d);
}

.badge-red {
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger, #FF3849);
}

/* 键盘按键标识 */
kbd, .kbd kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
