/* ═══════════════════════════════════════════════════════════════════
   Components: Button
   ═══════════════════════════════════════════════════════════════════ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: transform var(--ease-out), box-shadow var(--ease-out), background-color var(--ease-out);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: 3px solid rgba(168, 78, 47, 0.18);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

/* Variants */
.button.primary {
  background: linear-gradient(135deg, var(--color-brand-700), var(--color-brand-800));
  color: #fff9f4;
  box-shadow: 0 14px 30px rgba(168, 78, 47, 0.24);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.68);
  color: var(--color-ink);
  border: 1px solid rgba(25, 38, 43, 0.14);
}

.button.text {
  color: var(--color-brand-800);
  background: transparent;
  border: 1px dashed rgba(168, 78, 47, 0.3);
}

.button.small {
  min-height: 44px;
  padding: 0 16px;
}

/* Full-width on small screens */
@media (max-width: 640px) {
  .button,
  .form-actions .button,
  .hero-actions .button {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   UI 2.1 — 控件统一 (方案 §12)
   Primary / Secondary / Ghost / IconButton / Switch / Segmented
   ─ 统一圆角 8、去 Glow、去 lift、最小触控 44px ─
   ═══════════════════════════════════════════════════════════════════ */
.button {
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-s);
  font-weight: 600;
  box-shadow: none;
  transition: background-color var(--ease-out), color var(--ease-out), border-color var(--ease-out);
}

.button:hover,
.button:focus-visible {
  transform: none;
  outline: none;
  box-shadow: var(--focus-ring);
}

.button.primary {
  background: var(--primary-600, #2F62BE);
  color: var(--text-inverse);
  box-shadow: none;
}

.button.primary:hover { background: var(--primary-700, #244F9E); }

.button.ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.button.ghost:hover { background: var(--surface-hover); }

/* #UI Secondary：浅蓝底 + 蓝字，介于 Primary 与 Ghost 之间 */
.button.secondary {
  background: #EAF0FC;
  border: 1px solid #B9CAE4;
  color: #2F62BE;
}

.button.secondary:hover { background: #DCE7F8; }

.button.text {
  background: transparent;
  border: none;
  color: var(--brand-700);
}

.button.small {
  min-height: 44px;
  padding: 0 16px;
}

/* Switch（真实开关，role=switch）
   用法：<button class="switch" role="switch" aria-checked="false">…</button> */
.switch {
  width: 52px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.switch-track {
  position: relative;
  display: block;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background var(--ease-out);
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18, 38, 31, 0.25);
  transition: transform var(--ease-out);
}
.switch[aria-checked="true"] .switch-track { background: var(--success); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
.switch:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Segmented Control 选中态 = Intelligent Blue（与 .fy-segment.active 一致） */
.fy-segment.active {
  background: var(--primary-600, #2F62BE);
  color: var(--text-inverse);
}

/* IconButton 最小触控 44×44 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
