/* ============================================
   动效系统 · theme-motion
   加载顺序：style → theme-shouzhang → theme-elegant → 本文件
   原则：一屏一个主角动效；只动 transform/opacity；
   prefers-reduced-motion 全局豁免
   ============================================ */

/* —— 一、视图切换（out-in：旧 120ms 淡出 → 新 260ms 淡入上移） —— */
.view-leave-active { transition: opacity .12s ease; }
.view-leave-to { opacity: 0; }
.view-enter-active { transition: opacity .26s ease, transform .26s cubic-bezier(.22, .61, .36, 1); }
.view-enter-from { opacity: 0; transform: translateY(12px); }

/* 新视图内容级联：前 6 个直接子元素依次上浮，其余直接出现 */
.view-enter-active section > * { animation: rise-in .4s cubic-bezier(.22, .61, .36, 1) both; }
.view-enter-active section > *:nth-child(2) { animation-delay: .05s; }
.view-enter-active section > *:nth-child(3) { animation-delay: .09s; }
.view-enter-active section > *:nth-child(4) { animation-delay: .13s; }
.view-enter-active section > *:nth-child(5) { animation-delay: .17s; }
.view-enter-active section > *:nth-child(6) { animation-delay: .21s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }

/* —— 二、点击反馈：暖金水波纹 + 按压手感 —— */
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(176, 141, 79, .25);
  transform: scale(0); animation: ripple .5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn:active { transform: translateY(0) scale(.97); }
.quick:active, .ck-flow:active, .cb-entry:active { transform: translateY(0) scale(.97); }
.quick, .ck-flow, .cb-entry { position: relative; overflow: hidden; }

/* —— 三、弹窗：更柔的入場 + 内容级联 —— */
.modal { animation: modal-up .28s cubic-bezier(.34, 1.3, .64, 1); }
@keyframes modal-up { from { transform: translateY(18px); opacity: 0; } }
.modal > * { animation: rise-in .3s ease both; }
.modal > *:nth-child(2) { animation-delay: .04s; }
.modal > *:nth-child(3) { animation-delay: .08s; }
.modal > *:nth-child(4) { animation-delay: .12s; }
.modal > *:nth-child(5) { animation-delay: .16s; }
.modal > *:nth-child(6) { animation-delay: .2s; }
/* 手机端抽屉：从底部滑入（方向与现有底部弹窗一致） */
@media (max-width: 760px) {
  .modal { animation-name: modal-up-mobile; }
  @keyframes modal-up-mobile { from { transform: translateY(40px); opacity: 0; } }
}

/* —— 四、微动效点缀 —— */
/* 底栏图标切换小跳 */
.tabbar a span { transition: transform .2s ease; }
.tabbar a.active span { animation: tab-bounce .2s ease; }
@keyframes tab-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* 抽签揭晓：签卡轻晃两下 */
.roulette.settled .r-name { animation: settle-sway .5s ease .25s; }
@keyframes settle-sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-2deg); } 65% { transform: rotate(2deg); } }
/* 勾选确认感 */
.ck-step input:checked + .ck-check { animation: ck-pop .18s ease; }
@keyframes ck-pop { 50% { transform: scale(1.16); } }
/* 买菜篮加减按压 */
.qty button { transition: transform .1s ease; }
.qty button:active { transform: scale(.88); }

/* —— 减少动态效果：全局豁免 —— */
@media (prefers-reduced-motion: reduce) {
  .view-enter-active, .view-leave-active, .view-enter-active section > *,
  .modal, .modal > *, .ripple, .tabbar a.active span,
  .roulette.settled .r-name, .ck-step input:checked + .ck-check {
    animation: none !important; transition: none !important;
  }
}
