/* ============================================
   问渠 K12 — 共享 UI 组件样式
   toast / skeleton / error-state / loading
   ============================================ */

/* ---- Toast 通知 ---- */
.wq-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wq-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.wq-toast.error {
  background: rgba(239,68,68,0.9);
}
.wq-toast.success {
  background: rgba(16,185,129,0.9);
}
.wq-toast.warning {
  background: rgba(232,196,107,0.9);
  color: #2A2A2A;
}

/* ---- Skeleton 骨架屏 ---- */
.wq-skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: wq-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.wq-skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  width: 100%;
}
.wq-skeleton-text.short {
  width: 60%;
}
.wq-skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.wq-skeleton-card {
  height: 120px;
  border-radius: var(--radius);
}

@keyframes wq-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---- Loading Spinner ---- */
.wq-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: wq-spin 0.8s linear infinite;
}
.wq-spinner.lg {
  width: 36px;
  height: 36px;
  border-width: 4px;
}
.wq-spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

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

/* ---- Typing 指示器（AI 对话用）---- */
.wq-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}
.wq-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: wq-typing-bounce 1.4s ease-in-out infinite;
}
.wq-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.wq-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes wq-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ---- 错误状态 ---- */
.wq-error-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-2);
}
.wq-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.wq-error-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.wq-error-msg {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 20px;
  line-height: 1.5;
}
.wq-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.wq-retry-btn:active {
  background: var(--primary-deep);
}

/* ---- 空状态 ---- */
.wq-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.wq-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.wq-empty-text {
  font-size: 14px;
  line-height: 1.6;
}
