@keyframes zy-msg-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes zy-msg-send {
  from { opacity: 0; transform: translateY(8px) translateX(14px) scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes zy-swap {
  from { opacity: .4; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes zy-recall {
  from { opacity: 0; transform: scale(.92); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes zy-badge-pop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes zy-session-ping {
  0% { box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0); }
  35% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .5); background-color: rgba(37, 99, 235, .18); }
  100% { box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0); }
}

.bubble-row.fresh, .bubble-line.fresh { animation: zy-msg-in .28s ease; }
.bubble-row.fresh.mine, .bubble-line.fresh.mine { animation: zy-msg-send .28s cubic-bezier(.22, 1, .36, 1); }
.msgs.swap { animation: zy-swap .22s ease; }
.msg-recalled { animation: zy-recall .32s ease; }
.unread-badge { animation: zy-badge-pop .35s cubic-bezier(.22, 1.4, .36, 1); }
.session { transition: background .18s ease, transform .15s ease; }
.session:active { transform: scale(.98); }
.session.ping { animation: zy-session-ping .7s ease; }

.face-pop, .face-panel { overflow-x: hidden; }
.face-pop { width: min(360px, calc(100vw - 32px)); }
.face-grid { overflow-x: hidden; }
.face-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0 0 8px;
  border-bottom: 1px solid #e2e8f0;
}
.face-tab {
  border: 0; background: #f1f5f9; color: #475569; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; line-height: 1.3;
}
.face-tab.on { background: var(--accent, #2563eb); color: #fff; }
.face-tab:hover { filter: brightness(1.04); }

.chat-video {
  max-width: min(240px, 100%); max-height: 180px; border-radius: 10px;
  display: block; margin-top: 4px; background: #0f172a;
}

.file-card {
  display: flex; gap: 10px; align-items: center;
  min-width: 180px; max-width: 260px; margin: 4px 0;
  padding: 8px 10px; border-radius: 12px;
  background: #fff; border: 1px solid #e5e7eb;
  text-decoration: none; color: #1f1f1f; box-sizing: border-box;
}
a.file-card:hover { border-color: #bfdbfe; box-shadow: 0 4px 12px rgba(37, 99, 235, .1); }
.composer-box.drop-on { border-color: var(--accent, #2563eb); background: #eff6ff; }
.upload-hint { font-size: 12px; color: #64748b; padding: 0 4px 6px; }
.file-ico { font-size: 22px; line-height: 1; flex-shrink: 0; }
.file-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.file-meta b {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta small { color: #64748b; font-size: 11px; }
.bubble.mine .file-card, .bubble.mine .file-meta b { color: #1f1f1f; }
.bubble.mine .file-meta small { color: #64748b; }

html[data-night="1"] .face-tabs { border-color: #334155; }
html[data-night="1"] .face-tab { background: #0f172a; color: #cbd5e1; }
html[data-night="1"] .file-card {
  background: #1e293b; border-color: #334155; color: #e2e8f0;
}
html[data-night="1"] .file-meta b { color: #e2e8f0; }
html[data-night="1"] .file-meta small { color: #94a3b8; }

.panel-toggle { display: none; }
.work-panel-hd { display: none; }
.work-head { position: relative; z-index: 40; overflow: visible; }
.work-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; position: relative; z-index: 41; }
.work-head .theme-panel { z-index: 70; }
.work-head .settings-panel { min-width: 200px; }
.captcha-row img { width: 168px; height: 56px; object-fit: cover; cursor: pointer; border-radius: 10px; }
.ai-suggest { padding: 8px 10px 4px; }
.ai-suggest-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: #64748b; font-weight: 600;
}
.ai-suggest-refresh {
  border: 0; background: transparent; color: var(--accent, #2563eb);
  font-size: 12px; cursor: pointer; padding: 0;
}
.ai-suggest-refresh:disabled { opacity: .55; cursor: default; }
.ai-suggest-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chip {
  max-width: 100%; text-align: left; border: 1px solid #d7e2ee; background: #f8fafc;
  border-radius: 12px; padding: 6px 10px; font-size: 12px; line-height: 1.45;
  color: #334155; cursor: pointer;
}
.ai-chip:hover { border-color: #93c5fd; background: #eef4ff; }
.ai-suggest-empty { margin-top: 6px; font-size: 12px; color: #94a3b8; }
html[data-night="1"] .ai-suggest-hd { color: #94a3b8; }
html[data-night="1"] .ai-chip { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html[data-night="1"] .ai-chip:hover { background: #1e293b; }
.quick-add { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.quick-item { display: flex; align-items: center; gap: 8px; }
.quick-item > span { flex: 1; min-width: 0; }
.quick-preview { max-height: 240px; overflow: auto; padding: 10px 12px; background: #f8fafc; border-radius: 10px; font-size: 14px; line-height: 1.65; word-break: break-word; }

@media (max-width: 980px) {
  .work-shell { overflow: hidden; }
  .work-mask {
    display: none;
    position: fixed; inset: 0; z-index: 45;
    background: rgba(15, 23, 42, .46);
  }
  .work-shell.aside-open .work-mask,
  .work-shell.panel-open .work-mask { display: block !important; }
  .menu-toggle, .panel-toggle {
    display: inline-flex !important;
    align-items: center; justify-content: center; gap: 4px;
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 10px; border: 1px solid var(--line, #e2e8f0);
    background: #fff; color: var(--accent, #2563eb);
    cursor: pointer; flex-shrink: 0; padding: 0;
  }
  .panel-toggle {
    width: auto; min-width: 0; padding: 0 10px; font-size: 13px; font-weight: 600;
  }
  .work-head-extra { display: none !important; }
  .work-aside, .work-panel {
    position: fixed !important;
    top: 0; bottom: 0; z-index: 50;
    width: min(320px, 88vw) !important;
    max-width: 88vw;
    height: 100%;
    flex: none !important;
    box-shadow: 0 0 32px rgba(15, 23, 42, .28);
    transition: transform .22s ease;
  }
  .work-aside {
    left: 0;
    display: flex !important;
    flex-direction: column;
    transform: translateX(-105%);
  }
  .work-panel {
    right: 0; left: auto;
    display: block !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(105%);
    background: #fff;
  }
  .work-shell.aside-open .work-aside,
  .work-shell.panel-open .work-panel { transform: none; }
  .work-panel-title { display: none; }
  .work-panel-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 1;
    margin: -16px -16px 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
  }
  .work-panel-hd h4 { margin: 0; }
  .panel-close {
    width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: #f1f5f9; color: #334155; font-size: 20px; line-height: 32px;
    cursor: pointer;
  }
  .work-head {
    height: auto !important;
    min-height: 52px;
    padding: 8px 10px !important;
    gap: 8px;
    z-index: 55;
    overflow: visible;
  }
  .work-head .settings-panel,
  .work-head .theme-panel {
    position: fixed;
    top: 56px;
    right: 10px;
    left: auto;
    z-index: 80;
  }
  html[data-night="1"] .work-panel { background: #111827; }
  html[data-night="1"] .work-panel-hd { background: #111827; border-color: #1f2937; }
  html[data-night="1"] .panel-close { background: #1e293b; color: #e2e8f0; }
  html[data-night="1"] .menu-toggle,
  html[data-night="1"] .panel-toggle {
    background: #1e293b; border-color: #334155; color: #93c5fd;
  }
}

.transfer-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.transfer-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
  padding: 14px 16px 16px;
}
.transfer-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.transfer-hd b { font-size: 16px; }
.transfer-hd button {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: #f1f5f9; cursor: pointer; font-size: 18px; color: #64748b;
}
.transfer-modal .hint { margin: 0 0 10px; color: #64748b; font-size: 13px; }
.transfer-list { list-style: none; margin: 0; padding: 0; max-height: min(420px, 60vh); overflow: auto; }
.transfer-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 10px; cursor: pointer;
}
.transfer-list li:hover { background: #f1f5f9; }
.transfer-list b { display: block; font-size: 14px; }
.transfer-list small { display: block; color: #94a3b8; font-size: 12px; }
html[data-night="1"] .transfer-modal { background: #111827; color: #e2e8f0; }

.zy-call {
  position: fixed; z-index: 90; inset: auto 16px 16px auto;
  pointer-events: none;
}
.zy-call-card {
  pointer-events: auto;
  width: min(280px, calc(100vw - 32px));
  background: #0f172a; color: #fff;
  border-radius: 18px;
  padding: 18px 16px 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .35);
  text-align: center;
}
.zy-call-face {
  width: 72px; height: 72px; margin: 0 auto 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .45);
  animation: zy-call-pulse 1.6s ease-out infinite;
}
.zy-call-avatar, .zy-call-face .zy-avatar {
  width: 72px !important; height: 72px !important; border-radius: 50%;
  object-fit: cover; font-size: 28px; display: grid; place-items: center;
  background: #1d4ed8; color: #fff; margin: 0;
}
@keyframes zy-call-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); }
  70% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.zy-call-name { font-size: 16px; font-weight: 700; }
.zy-call-sub { margin-top: 4px; font-size: 12px; color: #94a3b8; }
.zy-call-time { margin-top: 6px; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: .04em; min-height: 1.2em; }
.zy-call-ops { display: flex; gap: 16px; justify-content: center; margin-top: 16px; }
.zy-call-btn {
  width: 48px; height: 48px; border: 0; border-radius: 50%; padding: 0;
  cursor: pointer; background: #334155; color: #fff;
  display: grid; place-items: center;
}
.zy-call-btn svg { width: 22px; height: 22px; display: block; }
.zy-call-btn svg.hang { transform: rotate(135deg); }
.zy-call-btn.ok { background: #16a34a; }
.zy-call-btn.ok svg { transform: none; }
.zy-call-btn.danger { background: #dc2626; }
.zy-call-btn.off { background: #64748b; }
.zy-call-btn:hover { filter: brightness(1.08); }
html.zy-embed .zy-call, html.zy-pc-page .zy-call {
  inset: auto 12px 12px auto;
}
html.zy-embed .zy-call-card, html.zy-pc-page .zy-call-card {
  width: min(240px, calc(100% - 24px));
}
html[data-night="1"] .transfer-hd button { background: #1e293b; color: #cbd5e1; }
html[data-night="1"] .transfer-list li:hover { background: #1e293b; }

.call-row { display: flex; justify-content: center; width: 100%; max-width: none; align-self: stretch; margin: 10px 0; }
.call-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #e8edf3; color: #64748b;
  font-size: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.05);
  font-variant-numeric: tabular-nums;
}
.call-chip-ico { width: 14px; height: 14px; flex: 0 0 auto; }
html[data-night="1"] .call-chip { background: #1e293b; border-color: #334155; color: #94a3b8; }

.session-block.colleague { flex: 1; }
.serve-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0 8px 6px;
}
.serve-tab {
  border: 0;
  border-radius: 8px;
  padding: 5px 2px;
  font-size: 11px;
  line-height: 1.2;
  color: #94a3b8;
  background: rgba(148,163,184,.12);
  cursor: pointer;
}
.serve-tab.on {
  color: #fff;
  background: rgba(37,99,235,.88);
}
.profile-kv {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}
.profile-kv label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.profile-kv b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  word-break: break-all;
}
.profile-link { word-break: break-all; }
html[data-night="1"] .profile-kv b { color: #e2e8f0; }
