/* ---- MedAI 聊天室: the camera moves forward into the chat card, the card becomes a window and
   the chat comes up to meet the reader (chat-portal.js). The overlay's resting state is the window
   fully open with the chat's skeleton in place; on the way home the same timeline runs backwards.
   Only transform and opacity animate. ---- */
.cx{position:fixed;inset:0;z-index:2147483000;contain:strict;cursor:progress;pointer-events:auto;display:none;
  /* the chat's own palette (chat/client/web/src/styles/gate-tokens.less), so the last frame is the chat's first */
  --c-bg:#f6f7f9;--c-surface:#fff;--c-line:#e2e6ed;--c-fg:#1c2026;--c-muted:#767f8c;--c-brand:#354d68}
[data-theme=dark] .cx{--c-bg:#14171b;--c-surface:#1b1f25;--c-line:#2d333d;--c-fg:#e7eaef;--c-muted:#8b94a1;--c-brand:#55769c}
/* the overlay sits in home.html; shown while the script runs it (cx-live) and, coming back from the
   chat, from the very first paint (cx-back, set by chat-portal-boot.js) so the chat's last frame and
   this page's first frame are the same picture. If the script never runs it lifts by itself. */
.cx.cx-live,html.cx-back .cx{display:block}
html.cx-back .cx:not(.cx-live){animation:cx-cover-out .3s ease 2.6s forwards}
@keyframes cx-cover-out{to{opacity:0;visibility:hidden}}
.cx-src{visibility:hidden}
.cx-stage{position:absolute;inset:0;perspective:900px;overflow:hidden}
.cx-pane{position:absolute;inset:0;border-radius:18px;background:var(--c-bg);overflow:hidden;transform-origin:50% 50%;perspective:800px;
  box-shadow:0 30px 80px -24px rgba(15,23,42,.5)}
.cx-skin{position:absolute;inset:0;border-radius:inherit;background:var(--card);border:1px solid var(--brand);opacity:0}
.cx-card{position:absolute;margin:0;box-sizing:border-box;transform-origin:50% 50%;border-color:var(--brand);opacity:0}
/* the chat's first screen (same geometry as the live page: rail 72, header 48, members 300, input 40 high
   with 16/8 px margins); chat/client/web/assets/boot.css draws the same picture */
.cx-ui{position:absolute;inset:0;transform-origin:50% 50%}
.cx-ui{display:flex}
.cx-ui .cx-rail{flex:none;width:72px;display:flex;flex-direction:column;padding:8px 0 0;background:var(--c-bg);border-right:1px solid var(--c-line)}
.cx-ui .cx-home{display:flex;justify-content:center;margin:0 6px 6px;padding:4px 0 10px;border-bottom:1px solid var(--c-line)}
.cx-ui .cx-home img{width:36px;height:36px;border-radius:10px}
.cx-ui .cx-ri{display:flex;flex-direction:column;align-items:center;gap:3px;margin:0 6px 2px;padding:7px 2px 5px}
.cx-ui .cx-ri s{display:block;width:30px;height:8px;margin:3px 0 1px;border-radius:4px;background:var(--c-muted);opacity:.28;text-decoration:none}
.cx-ui .cx-sq{width:36px;height:36px;border-radius:10px;background:color-mix(in srgb,var(--c-brand) 16%,transparent)}
.cx-ui .cx-rail>.cx-ri:nth-child(2) .cx-sq{background:var(--c-brand);opacity:.85}
.cx-ui .cx-ci{width:36px;height:36px;border-radius:50%;background:color-mix(in srgb,var(--c-brand) 22%,transparent)}
.cx-ui .cx-rfoot{margin-top:auto;padding:6px 0 8px;border-top:1px solid var(--c-line)}
.cx-ui .cx-main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--c-bg)}
.cx-ui .cx-head{flex:none;height:48px;display:flex;align-items:center;gap:8px;padding:0 10px 0 16px;background:var(--c-surface);border-bottom:1px solid var(--c-line);box-sizing:border-box}
.cx-ui .cx-head b{width:56px;height:14px;border-radius:7px;background:var(--c-fg);opacity:.72}
.cx-ui .cx-head s{width:16px;height:10px;border-radius:5px;background:var(--c-muted);opacity:.35;text-decoration:none}
.cx-ui .cx-msgs{flex:1;display:flex;flex-direction:column;justify-content:flex-end;gap:14px;padding:16px 16px 12px;overflow:hidden}
.cx-ui .cx-msg{display:flex;align-items:flex-start;gap:12px;padding:0 0 0 18px}
.cx-ui .cx-msg u{flex:none;width:36px;height:36px;border-radius:50%;background:color-mix(in srgb,var(--c-brand) 26%,transparent);text-decoration:none}
.cx-ui .cx-msg span{display:flex;flex-direction:column;gap:6px}
.cx-ui .cx-msg b{width:54px;height:10px;border-radius:5px;background:var(--c-fg);opacity:.5}
.cx-ui .cx-msg em{display:block;height:30px;border-radius:3px 12px 12px 12px;background:rgba(128,128,128,.13)}
.cx-ui .cx-msg.own{flex-direction:row-reverse;padding:0 18px 0 0}
.cx-ui .cx-msg.own span{align-items:flex-end}
.cx-ui .cx-msg.own em{border-radius:12px 3px 12px 12px;background:color-mix(in srgb,var(--c-brand) 16%,transparent)}
.cx-ui .cx-inrow{flex:none;padding:8px 16px}
.cx-ui .cx-input{height:40px;box-sizing:border-box;border:1px solid var(--c-line);border-radius:10px;background:var(--c-surface)}
.cx-ui .cx-side{display:none;flex:none;width:300px;flex-direction:column;background:var(--c-surface);border-left:1px solid var(--c-line);box-sizing:border-box}
[data-members=open] .cx-ui .cx-side{display:flex}
.cx-ui .cx-shead{height:48px;flex:none;display:flex;align-items:center;padding:0 8px 0 14px;border-bottom:1px solid var(--c-line);box-sizing:border-box}
.cx-ui .cx-shead b{width:72px;height:12px;border-radius:6px;background:var(--c-fg);opacity:.72}
.cx-ui .cx-search{flex:none;height:32px;margin:10px 10px 4px;border:1px solid var(--c-line);border-radius:6px;box-sizing:border-box}
.cx-ui .cx-sgroup{display:block;width:44px;height:9px;margin:14px 14px 6px;border-radius:5px;background:var(--c-muted);opacity:.35;text-decoration:none}
.cx-ui .cx-urow{display:flex;align-items:center;gap:10px;height:44px;margin:0 6px;padding:0 8px}
.cx-ui .cx-urow u{flex:none;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--c-brand) 22%,transparent);text-decoration:none}
.cx-ui .cx-urow b{height:10px;border-radius:5px;background:var(--c-fg);opacity:.55}
@media (max-width:767px){.cx-ui .cx-rail,.cx-ui .cx-side{display:none!important}.cx-ui .cx-head{padding-left:50px}.cx-ui .cx-inrow{padding:8px}.cx-ui .cx-msg{padding-left:6px}.cx-ui .cx-msg.own{padding-right:6px}}
/* forward motion: streaks rushing past from the vanishing point */
.cx-rush{position:absolute;inset:0;pointer-events:none}
.cx-streak{position:absolute;left:50%;top:50%;width:26vmax;height:2px;margin-top:-1px;border-radius:2px;transform-origin:0 50%;opacity:0;
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--brand) 55%,transparent))}
