/* =====================================================================
   components.css — 可复用组件
   ===================================================================== */

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s, transform .08s, box-shadow .18s, opacity .18s;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: var(--grad-accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(75, 71, 230, 0.34); }
.btn-primary:active:not(:disabled) { filter: brightness(.97); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-block { width: 100%; }

/* —— 图标按钮 —— */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

/* —— 表单字段 —— */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 15px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* —— 提示条 —— */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.alert-error { color: var(--danger); background: var(--danger-soft); }
.alert-ok    { color: var(--ok);     background: var(--ok-soft); }
.alert svg { flex: 0 0 auto; margin-top: 1px; }
