*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  background: var(--color-bg-page);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font-family-base);
  color: var(--color-text-primary);
  background:
    radial-gradient(circle at top, rgba(207, 231, 244, 0.72), transparent 36%),
    linear-gradient(180deg, #edf2ea 0%, var(--color-bg-page) 100%);
  overflow-x: hidden;
}

body,
button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img,
canvas {
  display: block;
  max-width: 100%;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

/* ============================================
   Zenow 全局动画系统
   治愈系风格：柔和、流畅、温暖
   ============================================ */

/* 基础淡入动画 */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 从下滑入（卡片、弹窗） */
@keyframes slide-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 从上滑入（通知、提示） */
@keyframes slide-in-down {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 缩放弹入（小元素、徽章） */
@keyframes scale-pop {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 弹性弹入（奖励、成就） */
@keyframes scale-bounce {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 温柔脉动（提示、呼吸） */
@keyframes pulse-gentle {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.88;
  }
}

/* 金色呼吸光晕（特殊强调） */
@keyframes glow-breathe {
  0%, 100% {
    box-shadow: 0 0 20px rgba(227, 174, 66, 0.3),
                0 4px 12px rgba(41, 76, 59, 0.15);
  }
  50% {
    box-shadow: 0 0 32px rgba(227, 174, 66, 0.5),
                0 6px 18px rgba(41, 76, 59, 0.2);
  }
}

/* 绿色呼吸光晕（常规强调） */
@keyframes glow-breathe-green {
  0%, 100% {
    box-shadow: 0 0 16px rgba(58, 101, 75, 0.25);
  }
  50% {
    box-shadow: 0 0 24px rgba(58, 101, 75, 0.4);
  }
}

/* 平滑旋转（加载） */
@keyframes spin-smooth {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 轻微摇晃（吸引注意） */
@keyframes wiggle-gentle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(2deg); }
  75% { transform: rotate(-2deg); }
}

/* 数字滚动（计数动画） */
@keyframes number-roll {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 勾选标记动画 */
@keyframes check-mark {
  0% {
    stroke-dashoffset: 100;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* 进度条填充 */
@keyframes progress-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* 闪烁提示 */
@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ============================================
   工具类 - 快速应用动画
   ============================================ */

.animate-fade-in {
  animation: fade-in 0.3s ease-out both;
}

.animate-slide-up {
  animation: slide-in-up 0.4s ease-out both;
}

.animate-slide-down {
  animation: slide-in-down 0.4s ease-out both;
}

.animate-pop {
  animation: scale-pop 0.3s ease-out both;
}

.animate-bounce {
  animation: scale-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.animate-pulse {
  animation: pulse-gentle 2s ease-in-out infinite;
}

.animate-glow {
  animation: glow-breathe 2.5s ease-in-out infinite;
}

.animate-spin {
  animation: spin-smooth 1s linear infinite;
}

.animate-wiggle {
  animation: wiggle-gentle 0.5s ease-in-out;
}

/* 延迟类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ============================================
   过渡预设
   ============================================ */

.transition-fast {
  transition: all 180ms ease;
}

.transition-normal {
  transition: all 240ms ease;
}

.transition-slow {
  transition: all 360ms ease;
}

.transition-bounce {
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   交互状态预设
   ============================================ */

/* 悬停上浮效果 */
.hover-lift {
  transition: all 220ms ease;
}

.hover-lift:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(41, 76, 59, 0.2);
}

/* 悬停轻微放大 */
.hover-scale {
  transition: transform 200ms ease;
}

.hover-scale:hover:not(:disabled) {
  transform: scale(1.03);
}

/* 悬停加深 */
.hover-darken {
  transition: filter 180ms ease;
}

.hover-darken:hover:not(:disabled) {
  filter: brightness(0.95);
}

/* 点击回弹 */
.click-feedback:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  transition: transform 100ms ease;
}

/* 聚焦轮廓 */
.focus-ring:focus-visible {
  outline: 3px solid rgba(227, 174, 66, 0.5);
  outline-offset: 2px;
  transition: outline-color 150ms ease;
}

/* ============================================
   无障碍支持 - 减少动画
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .animate-pulse,
  .animate-glow,
  .animate-spin,
  .animate-wiggle {
    animation: none !important;
  }
}
