/* 办公室里直接和员工对话（配合 chat.js） */
.panel-card { display: flex; flex-direction: column; width: min(460px, 100%); }
.p-more { margin-top: 12px; font-size: 13px; color: var(--muted); }
.p-more summary { cursor: pointer; padding: 4px 0; }
.p-more p { color: var(--ink); margin: 6px 0; }
.old-link { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 500; background: none !important; color: var(--muted); }

.chat { flex: 1; min-height: 240px; display: flex; flex-direction: column; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; scroll-behavior: smooth; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; padding: 20px; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--orange); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--soft); color: var(--ink); border-bottom-left-radius: 6px; }
.msg.sys { align-self: center; background: none; color: #C2410C; font-size: 12.5px; text-align: center; }
.msg code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(0, 0, 0, .06); padding: 1px 4px; border-radius: 5px; }
.msg .tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.msg .tools span { font-size: 11.5px; background: var(--card); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 1px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.msg time { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.typing { display: inline-flex; gap: 3px; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
.chat-state { margin: 0 0 6px; font-size: 12.5px; color: #B45309; background: #FFF4E5; border-radius: 10px; padding: 7px 10px; }
body.night .chat-state { background: #3A2A12; color: #F5C27A; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--soft); color: var(--ink); font: 15px/1.45 var(--font); }
.chat-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--orange) 50%, transparent); }
.chat-form button { height: 44px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--orange); color: #fff; font-weight: 700; cursor: pointer; }
.chat-form button[disabled] { opacity: .5; cursor: default; }

/* 3D 场景和侧栏上的状态 */
.lbl.busy::after { content: "输入中…"; font-size: 11px; color: var(--muted); margin-left: 2px; }
.lbl.unread i, .staff li.unread .av { box-shadow: 0 0 0 3px #EF4444; }
.staff li .badge { margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px; background: #EF4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.staff li.busy .who p::before { content: "✎ 正在回复 · "; color: var(--orange); }

@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }
@media (max-width: 760px) {
  .panel-card { height: 92vh; max-height: 92vh; }
  .p-notes { display: none; }
}
.msg.me.other { align-self: flex-end; background: color-mix(in srgb, var(--orange) 14%, var(--card)); color: var(--ink); }
.msg .from { display: block; font-size: 11.5px; margin-bottom: 2px; color: var(--orange); }
