/* 即时聊天面板 */
.ccwy-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 24px;
  width: min(92vw, 380px);
  height: min(74vh, 560px);
  z-index: 1080;
  display: none;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe7f8;
  box-shadow: 0 18px 48px rgba(15,39,68,.22);
  overflow: hidden;
}
.ccwy-chat-panel.open { display: flex; }
.ccwy-chat-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  background: linear-gradient(135deg, #132f4c, #2563eb);
  color: #fff;
}
.ccwy-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,.4);
  background: #fff;
}
.ccwy-chat-head-meta { flex: 1; min-width: 0; }
.ccwy-chat-head-meta strong { display: block; font-size: .95rem; }
.ccwy-chat-head-meta span { font-size: .75rem; opacity: .85; }
.ccwy-chat-close {
  border: 0; background: rgba(255,255,255,.15);
  color: #fff; width: 32px; height: 32px; border-radius: 8px;
  font-size: 1.1rem; line-height: 1;
}
.ccwy-chat-status {
  padding: .35rem .9rem;
  font-size: .75rem;
  background: #f3f7fd;
  color: #64748b;
  border-bottom: 1px solid #e8f0fe;
}
.ccwy-chat-status.online { color: #15803d; }
.ccwy-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: .9rem;
  background: #f8fbff;
}
.ccwy-chat-bubble {
  max-width: 82%;
  margin-bottom: .65rem;
  clear: both;
}
.ccwy-chat-bubble .meta {
  font-size: .68rem; color: #94a3b8; margin-bottom: .15rem;
}
.ccwy-chat-bubble .text {
  display: inline-block;
  padding: .55rem .75rem;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.5;
  word-break: break-word;
}
.ccwy-chat-bubble.visitor { float: right; text-align: right; }
.ccwy-chat-bubble.visitor .text {
  background: #2563eb; color: #fff; border-bottom-right-radius: 4px;
}
.ccwy-chat-bubble.staff, .ccwy-chat-bubble.system { float: left; text-align: left; }
.ccwy-chat-bubble.staff .text {
  background: #fff; border: 1px solid #dbe7f8; color: #0c1b2a; border-bottom-left-radius: 4px;
}
.ccwy-chat-bubble.system .text {
  background: #eef2ff; color: #475569; border-radius: 10px;
}
.ccwy-chat-foot {
  display: flex; gap: .5rem;
  padding: .65rem .7rem;
  border-top: 1px solid #e8f0fe;
  background: #fff;
}
.ccwy-chat-foot input {
  flex: 1; border: 1px solid #dbe7f8; border-radius: 999px;
  padding: .55rem .9rem; font-size: .88rem; outline: none;
}
.ccwy-chat-foot input:focus { border-color: #93c5fd; }
.ccwy-chat-foot button {
  border: 0; border-radius: 999px;
  background: #2563eb; color: #fff;
  padding: 0 1rem; font-weight: 600; font-size: .88rem;
}
@media (max-width: 576px) {
  .ccwy-chat-panel {
    right: 0; left: 0; bottom: 0;
    width: 100%; height: 78vh;
    border-radius: 16px 16px 0 0;
  }
}
