.chat-launcher { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; color: var(--accent-ink); background: var(--accent); font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.chat-launcher:hover { filter: brightness(1.08); }
.chat-panel { position: fixed; right: 18px; bottom: 76px; z-index: 46; display: flex; flex-direction: column; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 110px)); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 16px 44px rgba(0, 0, 0, .28); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-status { margin-left: 8px; font-size: .78rem; font-weight: 600; }
.chat-status-on { color: var(--accent); }
.chat-status-off { color: var(--muted); }
.chat-close { width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.chat-close:hover { color: var(--ink); background: var(--bg); }
.chat-notice { margin: 0; padding: 8px 14px; color: var(--muted); background: var(--warn-bg); font-size: .78rem; line-height: 1.5; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; overflow-y: auto; }
.chat-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg-user { align-self: flex-end; color: var(--accent-ink); background: var(--accent); border-bottom-right-radius: 4px; }
.chat-msg-bot { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.chat-msg-staff { align-self: flex-start; background: var(--warn-bg); border-bottom-left-radius: 4px; }
.chat-msg-staff::before { content: "客服（真人）"; display: block; margin-bottom: 2px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.chat-msg-system { align-self: stretch; max-width: 100%; color: var(--muted); background: transparent; border: 1px dashed var(--line); font-size: .84rem; }
.chat-msg a { color: inherit; text-decoration: underline; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--bg); font: inherit; font-size: .92rem; line-height: 1.45; }
.chat-form .btn { padding: 9px 14px; }
.chat-form .btn:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 480px) {
  .chat-launcher { right: 12px; bottom: 12px; }
  .chat-panel { right: 12px; bottom: 68px; width: calc(100vw - 24px); height: min(70vh, calc(100vh - 100px)); }
}
