/* ============================================================
   DESMOND AI 客服助理 - 聊天窗口样式
   ============================================================ */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent, #0E7490); color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(14,116,144,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; transition: transform .2s ease;
}
.chat-fab:hover { transform: scale(1.08); }
.chat-fab.badge::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #FF3B30; border: 2px solid #fff;
}

.chat-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 9999;
  width: min(360px, calc(100vw - 40px)); height: 480px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  display: none; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
}
.chat-panel.open { display: flex; }

.chat-header {
  padding: 14px 16px; background: var(--accent, #0E7490); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.chat-header .title { font-weight: 700; font-size: 15px; }
.chat-header .status { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 4px; }
.chat-header .status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #34C759; display: inline-block;
}
.chat-close {
  background: none; border: none; color: #fff; font-size: 20px;
  cursor: pointer; padding: 0 4px; line-height: 1;
}

.chat-body {
  flex: 1; overflow-y: auto; padding: 14px;
  background: #F6F6F4; display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
}
.msg.bot {
  background: #fff; color: #1A1B1C; align-self: flex-start;
  border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.msg.user {
  background: var(--accent, #0E7490); color: #fff; align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg.typing { opacity: .7; font-style: italic; }

.chat-input-bar {
  flex-shrink: 0; padding: 10px; background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
  display: flex; gap: 8px; align-items: center;
}
.chat-input-bar input {
  flex: 1; border: 1px solid #E5E4DE; border-radius: 20px;
  padding: 9px 14px; font-size: 14px; outline: none;
  font-family: inherit;
}
.chat-input-bar input:focus { border-color: var(--accent, #0E7490); }
.chat-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--accent, #0E7490); color: #fff; font-size: 16px;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-send:hover { opacity: .9; }

.chat-quick {
  flex-shrink: 0; padding: 8px 10px; background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
  display: flex; gap: 6px; overflow-x: auto;
}
.chat-quick button {
  flex-shrink: 0; border: 1px solid var(--accent, #0E7490);
  background: transparent; color: var(--accent, #0E7490);
  border-radius: 16px; padding: 5px 12px; font-size: 12.5px;
  cursor: pointer; white-space: nowrap; font-family: inherit;
}
.chat-quick button:hover { background: var(--accent-soft, #E0F0F4); }

@media (max-width: 480px) {
  .chat-panel { right: 10px; bottom: 80px; width: calc(100vw - 20px); height: 70vh; }
  .chat-fab { right: 16px; bottom: 16px; }
}
