/* ============================================================
   锐驰二手车 RUICHI AUTO - 在线聊天窗口样式
   对应后台「在线咨询」（admin-chat.html）
   ============================================================ */
.ruichichat-fab,
.ruichichat-panel {
  --rc-red: #E11D2E;
  --rc-red-dark: #B3111F;
  --rc-ink: #0A0A0B;
  --rc-gray: #6B7280;
  box-sizing: border-box;
}
.ruichichat-fab *,
.ruichichat-panel * {
  box-sizing: border-box;
}

/* ---------- 面板 ---------- */
.ruichichat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 372px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid rgba(10, 10, 11, 0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -18px rgba(10, 10, 11, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transform-origin: right bottom;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.ruichichat-panel[aria-hidden="true"] {
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  pointer-events: none;
}
.ruichichat-panel[aria-hidden="false"] {
  transform: none;
  opacity: 1;
}

.ruichichat-head {
  flex: 0 0 auto;
  padding: 16px 18px 14px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--rc-ink) 0%, #1B1B1E 100%);
}
.ruichichat-head-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ruichichat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 700;
}
.ruichichat-title iconify-icon {
  color: var(--rc-red);
  font-size: 20px;
}
.ruichichat-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #B9BDC4;
}
.ruichichat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9CA3AF;
}
.ruichichat-status-dot.is-online {
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.ruichichat-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ruichichat-close:hover {
  background: rgba(255, 255, 255, 0.18);
}
.ruichichat-head small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #9CA3AF;
}

/* ---------- 消息区 ---------- */
.ruichichat-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #F7F8FA;
}
.ruichichat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ruichichat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
.ruichichat-msg.agent {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid rgba(10, 10, 11, 0.06);
  color: #16181D;
  border-bottom-left-radius: 4px;
}
.ruichichat-msg.user {
  align-self: flex-end;
  background: var(--rc-red);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}
.ruichichat-msg.sys {
  align-self: center;
  background: transparent;
  color: var(--rc-gray);
  font-size: 12px;
  text-align: center;
}

/* ---------- 快捷业务 ---------- */
.ruichichat-quick {
  flex: 0 0 auto;
  padding: 2px 14px 10px;
}
.ruichichat-quick-title {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--rc-gray);
}
.ruichichat-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ruichichat-quick-btns button {
  padding: 6px 11px;
  border: 1px solid rgba(225, 29, 46, 0.28);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--rc-red);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ruichichat-quick-btns button:hover,
.ruichichat-quick-btns button.selected {
  background: var(--rc-red);
  border-color: var(--rc-red);
  color: #FFFFFF;
}

/* ---------- 输入区 ---------- */
.ruichichat-compose {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(10, 10, 11, 0.06);
  background: #FFFFFF;
}
.ruichichat-compose input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(10, 10, 11, 0.12);
  border-radius: 10px;
  background: #F7F8FA;
  color: #16181D;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
.ruichichat-compose input:focus {
  border-color: var(--rc-red);
  background: #FFFFFF;
}
.ruichichat-compose button {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--rc-red);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ruichichat-compose button:hover {
  background: var(--rc-red-dark);
}

@media (max-width: 480px) {
  .ruichichat-panel {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: 72vh;
  }
}
