/* ============================================================
   心启能 · 心力赋能 — 统一 UI 组件库（命名空间 xqn-，不覆盖既有样式）
   依赖 tokens.css（:root 变量）。仅新增组件类，不重写页面原有 class。
   用法：页面先引 /css/tokens.css 与本文件，业务页在其后引自身样式。
   ============================================================ */
.xqn-brand-grad { background: var(--brand-grad); color: var(--c-surface); }
.xqn-brand-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.xqn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--r-md); padding: 11px 20px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: var(--font); transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.xqn-btn:active { transform: translateY(1px); }
.xqn-btn--primary { background: var(--brand-grad); color: var(--c-surface); box-shadow: var(--sh-2); }
.xqn-btn--primary:hover { box-shadow: var(--sh-3); }
.xqn-btn--ghost { background: var(--c-surface-2); color: var(--c-sub); }
.xqn-btn--soft { background: var(--brand-grad-soft); color: var(--brand-2); }
.xqn-btn--block { width: 100%; }
.xqn-btn[disabled] { opacity: .55; cursor: not-allowed; }

.xqn-card, .xqn-panel {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); padding: var(--sp-5);
}
.xqn-card--brand { border-color: transparent; box-shadow: var(--sh-2); }

.xqn-badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; background: var(--brand-grad-soft); color: var(--brand-2);
}
.xqn-badge--muted { background: var(--c-surface-2); color: var(--c-mut); }
.xqn-badge--success { background: var(--c-success-bg); color: var(--c-success); }
.xqn-badge--warn { background: var(--c-warn-bg); color: var(--c-warn); }

.xqn-section-title { font-size: 18px; font-weight: 800; color: var(--c-ink); margin: 0 0 var(--sp-3); display: flex; align-items: center; gap: 8px; }
.xqn-section-title small { font-size: 12px; font-weight: 600; color: var(--c-mut); }

.xqn-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--c-surface-2); color: var(--c-sub); font-size: 13px; }

/* 心力赋能闭环步骤条（卡牌→测评→倾听→咨询→会员→课程） */
.xqn-loop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.xqn-loop__step {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-lg);
  background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--sh-1);
}
.xqn-loop__step b { font-size: 14px; color: var(--c-ink); }
.xqn-loop__step span { font-size: 12px; color: var(--c-mut); }
.xqn-loop__arrow { color: var(--brand-3); font-weight: 800; }
.xqn-loop__step--active { border-color: var(--brand-3); box-shadow: var(--sh-3); }

.xqn-hero {
  border-radius: var(--r-xl); padding: var(--sp-8); color: var(--c-surface);
  background: var(--brand-grad); box-shadow: var(--sh-3);
}
.xqn-hero h1 { margin: 0 0 8px; font-size: 24px; font-weight: 900; }
.xqn-hero p { margin: 0; opacity: .92; font-size: 14px; line-height: 1.6; }

.xqn-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.xqn-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9999;
  background: rgba(15,23,42,.92); color: var(--c-surface); padding: 10px 18px; border-radius: var(--r-pill); font-size: 14px; box-shadow: var(--sh-3); }

/* ============================================================
   阶段四 · 基础组件库补全
   （Button 尺寸/状态 · Input/Textarea · Select · Table · Modal · Tag · Date · 状态层）
   命名空间 xqn-，只新增不覆盖；引用 tokens.css 组件级 token。
   ============================================================ */

/* ---------- Button 尺寸 / 状态扩展 ---------- */
.xqn-btn--sm { height: var(--btn-h-sm); padding: 0 14px; font-size: 13px; border-radius: var(--btn-radius); }
.xqn-btn--lg { height: var(--btn-h-lg); padding: 0 24px; font-size: 16px; }
.xqn-btn--danger { background: var(--c-danger); color: var(--c-surface); }
.xqn-btn--danger:hover { box-shadow: 0 8px 20px rgba(244, 63, 94, .28); }
.xqn-btn--outline { background: transparent; border: 1px solid var(--c-line); color: var(--c-sub); }
.xqn-btn--outline:hover { border-color: var(--brand-3); color: var(--brand-2); }

/* ---------- Input / Textarea ---------- */
.xqn-input, .xqn-select, .xqn-textarea {
  width: 100%; box-sizing: border-box;
  height: var(--input-h);
  border: 1px solid var(--c-line);
  border-radius: var(--input-radius);
  padding: 0 12px;
  font-size: 14px; font-family: var(--font); color: var(--c-ink);
  background: var(--bg-1);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.xqn-textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: var(--lh-base); }
.xqn-input:focus, .xqn-select:focus, .xqn-textarea:focus {
  border-color: var(--brand-3);
  box-shadow: var(--ring);
  outline: none;
}
.xqn-input::placeholder, .xqn-textarea::placeholder { color: var(--c-mut); }

/* ---------- Select ---------- */
.xqn-select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236E6789' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer;
}

/* ---------- Tag ---------- */
.xqn-tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--tag-radius);
  font-size: 12px; font-weight: 600; line-height: 1;
  background: var(--c-surface-2); color: var(--c-sub);
}
.xqn-tag--brand { background: var(--brand-grad-soft); color: var(--brand-2); }
.xqn-tag--success { background: var(--c-success-bg); color: var(--c-success); }
.xqn-tag--warn { background: var(--c-warn-bg); color: var(--c-warn); }
.xqn-tag--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.xqn-tag--info { background: var(--c-info-bg); color: var(--c-info); }

/* ---------- Table ---------- */
.xqn-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.xqn-table th {
  text-align: left; padding: 10px 12px;
  font-weight: 600; color: var(--c-mut); font-size: 12px;
  border-bottom: 1px solid var(--c-line);
  background: var(--bg-2);
  white-space: nowrap;
}
.xqn-table td { padding: 12px; border-bottom: 1px solid var(--c-line); color: var(--c-ink); }
.xqn-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.xqn-table tbody tr:hover { background: var(--bg-2); }
.xqn-table .num { font-family: var(--font-num); font-variant-numeric: var(--tabnum); }

/* ---------- Modal ---------- */
.xqn-modal-mask {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: xqn-fade var(--dur-fast) var(--ease-out);
}
.xqn-modal {
  width: 100%; max-width: 560px;
  background: var(--bg-1);
  border-radius: var(--modal-radius);
  box-shadow: var(--sh-3);
  animation: xqn-pop var(--dur-base) var(--ease-out);
  overflow: hidden;
}
.xqn-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--c-line); }
.xqn-modal__title { font-size: 16px; font-weight: 700; color: var(--c-ink); }
.xqn-modal__body { padding: 20px; max-height: 60vh; overflow: auto; }
.xqn-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--c-line); }

/* ---------- DatePicker 容器（对齐 input） ---------- */
.xqn-date { position: relative; }
.xqn-date input { padding-right: 34px; }

/* ---------- Skeleton 骨架屏 ---------- */
.xqn-skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-0) 37%, var(--bg-2) 63%);
  background-size: 200% 100%;
  animation: xqn-shimmer 1.4s var(--ease-inout) infinite;
  border-radius: var(--r-sm);
}

/* ---------- Empty 空状态 ---------- */
.xqn-empty { text-align: center; padding: 48px 20px; color: var(--c-mut); font-size: 14px; }
.xqn-empty::before {
  content: ''; display: block; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--c-surface) 0 24%, transparent 25%),
    linear-gradient(135deg, var(--v-200, var(--v-100)), var(--v-100, var(--brand-purple-soft)));
  box-shadow: var(--sh-1);
}

@keyframes xqn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xqn-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes xqn-shimmer { 100% { background-position: 200% 0; } }
