/**
 * Button - 按钮组件
 * Liquid Glass Design System
 */

/* ── 基础按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-height);
  padding: 0 var(--btn-padding-x);
  border: none;
  border-radius: var(--btn-radius);
  font-family: inherit;
  font-size: var(--btn-font-size, var(--font-size-base));
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Primary (统一紫色渐变 + shimmer) ── */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(99, 102, 241, 0.9) 50%, rgba(59, 130, 246, 0.9) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.45), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transition: box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
  user-select: none;
}

/* shimmer 流光效果（::after 伪元素，不依赖子元素） */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(139, 92, 246, 0.6), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transform: scale(1.02);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { cursor: not-allowed; opacity: 0.8; }

/* ── Accent / CTA ── */
.btn-accent {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  box-shadow:
    0 4px 14px rgba(255, 152, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-accent:hover {
  background: #FFB74D;
  box-shadow:
    0 6px 22px rgba(255, 152, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ── Ghost ── */
.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-divider);
}

.btn-ghost:hover {
  background: var(--color-bg-page);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Danger ── */
.btn-danger {
  background: var(--color-error);
  color: var(--color-text-inverse);
  box-shadow:
    0 4px 14px rgba(244, 67, 54, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── Glass Button（Liquid Glass 核心组件）── */
.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: var(--color-text-primary);
  box-shadow: var(--glass-shadow);
}

.btn-glass:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    var(--glass-shadow),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.btn-glass:active {
  transform: scale(0.98) translateY(0);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── 尺寸变体 ── */
.btn-sm {
  height: 36px;
  padding: 0 var(--space-3);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 56px;
  padding: 0 var(--space-6);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}

.btn-full {
  width: 100%;
}

/* ── Icon Button ── */
.btn-icon {
  width: var(--btn-height);
  height: var(--btn-height);
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-icon.btn-sm {
  width: 36px;
  height: 36px;
}

/* ── Success / Warning / Info ── */
.btn-success {
  background: var(--color-success);
  color: white;
  box-shadow: 0 4px 14px rgba(76, 175, 80, 0.35);
}

.btn-warning {
  background: var(--color-warning);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.35);
}

/* ── 按钮抖动动画 ── */
@keyframes btnShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.shake {
  animation: btnShake 0.4s ease;
}


/* ── Submit Button（btn-primary 增强修饰符）── */
/* 叠加在 btn-primary 之上，添加登录表单所需字间距/字重/无边框 */
.submit-btn {
  border: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 14px 24px;
}
