/* ============================================
   动画效果
   ============================================ */

/* 淡入 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 淡出 */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 从上滑入 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 从下滑入 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 从左滑入 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 从右滑入 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 缩放弹入 */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 脉冲 */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* 旋转 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* AI输出出现 */
@keyframes ai-output-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
    border-color: transparent;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    border-color: var(--primary-light);
  }
}

/* 打字机效果 */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

/* 闪烁光标 */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* 通知滑入 */
@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 通知滑出 */
@keyframes notificationSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* 摇晃 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* 弹跳 */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 渐变流动（用于加载按钮） */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 骨架屏加载 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 加载中动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  animation: pulse 1.5s infinite;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-hover) 25%, var(--bg-body) 50%, var(--bg-surface-hover) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}
.skeleton-text.short {
  width: 40%;
}
.skeleton-text.full {
  width: 100%;
}

/* 通知容器 */
.notification-container {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.notification {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  animation: notificationSlideIn 0.3s ease;
  transition: opacity 0.3s ease;
}
.notification.success {
  border-left-color: var(--success);
}
.notification.warning {
  border-left-color: var(--warning-dark);
}
.notification.error {
  border-left-color: var(--danger);
}
.notification.removing {
  animation: notificationSlideOut 0.3s ease forwards;
}

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.notification-body {
  flex: 1;
}
.notification-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.notification-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.notification-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
  cursor: pointer;
}
.notification-close:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
