/* ===================================
   万物手札 - 动画效果
   版本：v2.5.0
   =================================== */

/* 页面切换动画 */
.page {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 卡片出现动画 */
.item-card {
  animation: slideUp 0.3s ease-out;
  animation-fill-mode: both;
}

.item-card:nth-child(1) { animation-delay: 0.05s; }
.item-card:nth-child(2) { animation-delay: 0.1s; }
.item-card:nth-child(3) { animation-delay: 0.15s; }
.item-card:nth-child(4) { animation-delay: 0.2s; }
.item-card:nth-child(5) { animation-delay: 0.25s; }
.item-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* FAB 按钮动画 */
.fab {
  animation: fabAppear 0.5s var(--ease-spring);
}

@keyframes fabAppear {
  from {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* 主题面板动画 */
.theme-panel {
  animation: themePanelIn 0.3s var(--ease-spring);
}

@keyframes themePanelIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 提示消息动画 */
.toast.show {
  animation: toastIn 0.3s var(--ease-spring);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 按钮点击反馈 */
button:active {
  transform: scale(0.95);
  transition: transform 0.1s ease-out;
}

/* 输入框焦点动画 */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 var(--primary-light);
  }
  70% {
    box-shadow: 0 0 0 6px transparent;
  }
  100% {
    box-shadow: 0 0 0 3px var(--primary-light);
  }
}

/* 加载动画 */
.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 模态框动画 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalOverlayIn 0.3s ease-out;
}

@keyframes modalOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-card);
  border: var(--grid-line);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-xl);
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: modalContentIn 0.3s var(--ease-spring);
}

@keyframes modalContentIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.3s ease-out;
}

.modal-close:hover {
  background: var(--primary);
  opacity: 0.9;
}

/* 收藏动画 */
.favorite-animation {
  animation: favoritePop 0.5s var(--ease-spring);
}

@keyframes favoritePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* 删除动画 */
.deleting {
  animation: deleteSlide 0.3s ease-in forwards;
}

@keyframes deleteSlide {
  to {
    opacity: 0;
    transform: translateX(-100%);
    height: 0;
    margin: 0;
    padding: 0;
  }
}
