/* ════════════════════════════════════════════════════════════
   50. 来处(T190,came-from.js):从一段对话跳到另一段时,顶栏左边“‹ 来处助手名”,点了回去;
   手机上它占菜单的位置(回去比开菜单要紧,回去后菜单还在)。跳过去内容从右边进,回来从左边进。
   形象对话页(浮空顶栏)的对齐写在 49-agent-face.css。
   ════════════════════════════════════════════════════════════ */
#chat-view .came-back {
  display: none; align-items: center; gap: 1px; flex-shrink: 0;
  height: 36px; max-width: 9.5em; padding: 0 13px 0 7px;
  border: 0; border-radius: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: var(--chrome-glass-strong); -webkit-backdrop-filter: var(--chrome-blur); backdrop-filter: var(--chrome-blur);
  box-shadow: var(--chrome-edge), var(--chrome-shadow);
  font: inherit; font-size: 14px; line-height: 1; color: var(--text-main); white-space: nowrap;
}
#chat-view .came-back svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; }
#chat-view .came-back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#chat-view .came-back:active { background: var(--bg-hover); }
#chat-view .came-back:focus-visible { outline: 2px solid var(--text-main); outline-offset: 2px; }
#chat-view.has-came-back .came-back { display: inline-flex; }

@media (max-width: 1023px) {
  #chat-view .came-back { grid-column: 1; grid-row: 1; justify-self: start; }
  #chat-view.has-came-back #btn-chat-drawer { display: none; }
}

/* 跳过去从右边进、回来从左边进;只动正文和顶栏身份,输入栏不动 */
@keyframes chatNavForward { from { transform: translateX(12%); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes chatNavBack    { from { transform: translateX(-12%); opacity: .3; } to { transform: none; opacity: 1; } }
#chat-view.nav-forward :is(#chat-messages, .topbar-identity) { animation: chatNavForward .28s cubic-bezier(.2, .8, .2, 1) 1; }
#chat-view.nav-back :is(#chat-messages, .topbar-identity) { animation: chatNavBack .28s cubic-bezier(.2, .8, .2, 1) 1; }
@media (prefers-reduced-motion: reduce) {
  #chat-view:is(.nav-forward, .nav-back) :is(#chat-messages, .topbar-identity) { animation: none; }
}
