/* 在线客服悬浮组件 —— 与全站 WinUI / Fluent 风格统一
   深色亚克力 · 强调色 #4CC2FF · Segoe 字体栈 */

.muse-chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CC2FF 0%, #2B88D8 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(76, 194, 255, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.muse-chat-fab:hover { transform: translateY(-2px); }
.muse-chat-fab:active { transform: translateY(0); }
.muse-chat-fab svg { width: 26px; height: 26px; fill: #fff; }
.muse-chat-fab .fab-close { display: none; }
.muse-chat-fab.open .fab-open { display: none; }
.muse-chat-fab.open .fab-close { display: block; }

.muse-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 900;
  width: min(368px, calc(100vw - 24px));
  height: min(540px, calc(100dvh - 120px));
  display: none;
  flex-direction: column;
  background: rgba(38, 38, 38, 0.82);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  font-family: var(--font, "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
  color: var(--text, #fff);
}
.muse-chat-panel.open { display: flex; }

.muse-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  flex: none;
}
.muse-chat-head .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CC2FF 0%, #2B88D8 100%);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600; color: #fff;
  flex: none;
}
.muse-chat-head .who { flex: 1; min-width: 0; }
.muse-chat-head .name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.muse-chat-head .status { font-size: 12px; color: rgba(255, 255, 255, 0.55); display: flex; align-items: center; gap: 5px; }
.muse-chat-head .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7EE2A8; flex: none;
}
.muse-chat-head .x {
  appearance: none; border: none; background: transparent;
  color: rgba(255, 255, 255, 0.7); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.muse-chat-head .x:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.muse-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.muse-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.muse-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 4px;
}
.muse-msg.me {
  align-self: flex-end;
  background: #2B88D8;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.muse-msg.err {
  align-self: flex-start;
  background: rgba(255, 120, 130, 0.12);
  border: 1px solid rgba(255, 120, 130, 0.35);
  color: #FFB3BA;
}
.muse-msg .typing-dots { display: inline-flex; gap: 4px; padding: 3px 0; }
.muse-msg .typing-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  animation: muse-blink 1.2s infinite;
}
.muse-msg .typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.muse-msg .typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes muse-blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.muse-chat-foot {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.muse-chat-foot textarea {
  flex: 1;
  resize: none;
  max-height: 84px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 8px 10px;
  outline: none;
}
.muse-chat-foot textarea:focus { border-bottom-color: #4CC2FF; background: rgba(255, 255, 255, 0.08); }
.muse-chat-foot textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
.muse-chat-send {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #4CC2FF;
  color: #0b2a3d;
  font-family: inherit;
  font-size: 14px; font-weight: 600;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  flex: none;
}
.muse-chat-send:hover:not(:disabled) { background: #6FCFFF; }
.muse-chat-send:disabled { opacity: 0.45; cursor: default; }
.muse-chat-note {
  flex: none;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  padding: 0 12px 9px;
}

@media (max-width: 760px) {
  .muse-chat-fab { right: 16px; bottom: 16px; }
  .muse-chat-panel {
    right: 12px;
    bottom: 82px;
    width: calc(100vw - 24px);
    height: min(70dvh, calc(100dvh - 100px));
  }
}
