/* CHATFX-1110 小克：聊天页的动效（配 chatfx.js）。她说「ui 动画也顺手做一下」。
   聊天页的样子（气泡圆角、头像、顶栏玻璃、配色）都是她自己定的，这里一样不改，只加动的部分：
   - 新消息：气泡从输入栏那边弹出来（她的从右下、Vael 的从左下），Vael 一段一段发的时候每个气泡各弹一次
   - 按下去：顶栏的圆按钮 / 胶囊、输入栏上的按钮缩一下，松手弹回来
   - 发送键：有字了弹出来；颜色不再是微信绿，跟着「我的气泡」的颜色走（没自己调过气泡颜色的还是绿的）
   系统开了「减少动态效果」时都不动。删掉 chatfx.css / chatfx.js 这两行就没有了。 */
:root { --fx-spring: linear(0, .0358, .1262, .2488, .3858, .5236, .6528, .767, .8631, .9399, .9979, 1.0389, 1.065, 1.079, 1.0835, 1.081, 1.0738, 1.0637, 1.0523, 1.0408, 1.0299, 1.0202, 1.0121, 1.0055, 1.0005, .997, .9947, .9935, .993, .9932, .9938, .9946, .9955, .9965, 1);
  --fx-soft: linear(0, .0245, .0869, .1731, .272, .3752, .4767, .5723, .6593, .7362, .8025, .8583, .904, .9406, .9691, .9906, 1.0061, 1.0167, 1.0234, 1.027, 1.0283, 1.0279, 1.0264, 1.024, 1.0213, 1.0184, 1.0155, 1.0127, 1.0102, 1.0079, 1.006, 1.0043, 1.003, 1.0019, 1); }
@supports not (transition-timing-function: linear(0, 1)) { :root { --fx-spring: cubic-bezier(.2, 1.4, .4, 1); --fx-soft: cubic-bezier(.2, 1.1, .3, 1); } }

/* 发送键、表情页签：跟着「我的气泡」的颜色 */
:root[data-palette-me="custom"] .input-bar.has-text .send { background: var(--palette-me-solid, var(--green)); color: var(--palette-me-text, #fff); }
:root[data-palette-me="custom"] .emo-tab.on { background: var(--palette-me-solid, var(--green)); color: var(--palette-me-text, #fff); }

@media (prefers-reduced-motion: no-preference) {
  /* 新消息 */
  .messages .row .fx-in { animation: fx-pop .52s var(--fx-spring) both; transform-origin: 0 100%; animation-delay: var(--fx-d, 0ms); }
  .messages .row.user .fx-in { transform-origin: 100% 100%; }
  .messages .row .fx-fade { animation: fx-fade .4s ease both; animation-delay: var(--fx-d, 0ms); }
  /* 按下去缩一下 */
  #app > .header .side.glass-btn, #app > .header .cap {
    transition-property: transform, opacity, filter, background-color, color; transition-duration: .5s; transition-timing-function: var(--fx-spring); }
  #app > .header .side.glass-btn:active { transform: scale(.88); transition-duration: .1s; transition-timing-function: ease-out; }
  #app > .header .cap:active { transform: scale(.95); transition-duration: .1s; transition-timing-function: ease-out; }
  /* 11-10 21:5x：输入栏上的动画全拿掉了（发送键弹出来、按钮回弹）——她说打字时光标往上飘，iPhone 上输入框旁边有东西在动 / 被提成单独一层时光标会画错位置 */
}
@keyframes fx-pop { from { opacity: 0; transform: translateY(12px) scale(.9); } 55% { opacity: 1; } }
@keyframes fx-fade { from { opacity: 0; } }
@keyframes fx-send { from { opacity: 0; transform: scale(.5) rotate(-30deg); } }
