/* RBYS Smart Assistant — chat widget styling */
:root {
  --chat-accent: #1d7fe0;
  --chat-accent-d: #1552c4;
}

.rbys-chat-launcher {
  position: fixed; right: var(--ly-chatbot-right, 18px); top: var(--ly-chatbot-top, 50%); bottom: auto; z-index: 80;
  transform: translateY(-50%);
  width: var(--ly-chatbot-size, 74px); height: var(--ly-chatbot-size, 74px); border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #ffffff, #e9f1fb);
  border: 1px solid rgba(15,42,80,.12);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  box-shadow: 0 10px 30px rgba(20,50,90,.24);
  transition: transform .2s ease, box-shadow .2s ease;
}
/* 机器人 logo 随按钮等比放大（原 48/62 ≈ 78%） */
.rbys-chat-launcher svg { width: 78%; height: 78%; }
.rbys-chat-launcher:hover { transform: translateY(calc(-50% - 3px)) scale(1.04); box-shadow: 0 14px 38px rgba(20,50,90,.34); }

.rbys-chat-panel {
  position: fixed; right: var(--ly-chatbot-right, 18px); bottom: calc(var(--ly-chatbot-top, 50%) + 50px); z-index: 81;
  width: var(--ly-chatbot-panelWidth, 372px); max-width: calc(100vw - 36px); height: var(--ly-chatbot-panelHeight, 530px); max-height: calc(50vh - 70px);
  background: #fff; border: 1px solid rgba(15,42,80,.12); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(20,50,90,.24);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.97); transform-origin: bottom right;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.rbys-chat-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.rbys-chat-head {
  background: linear-gradient(120deg, #1d7fe0, #1552c4);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: #fff; flex: none;
}
.rbys-chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 30%, #ffffff, #e9f1fb);
  border: 1px solid rgba(255,255,255,.6);
  display: grid; place-items: center; overflow: hidden;
}
.rbys-chat-headtext { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.rbys-chat-headtext strong { font-size: .94rem; font-weight: 700; }
.rbys-chat-headtext span { font-size: .72rem; color: #d8e8ff; display: flex; align-items: center; gap: 6px; }
.rbys-chat-headtext i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }
.rbys-chat-close {
  margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.5rem;
  line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px; opacity: .85;
}
.rbys-chat-close:hover { background: rgba(255,255,255,.15); opacity: 1; }

.rbys-chat-body {
  flex: 1 1 auto; overflow-y: auto; padding: 16px 14px;
  background: linear-gradient(180deg, #f7faff, #eef4fc);
  display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin;
}
.rbys-msg { display: flex; }
.rbys-msg.bot { justify-content: flex-start; }
.rbys-msg.user { justify-content: flex-end; }
.rbys-bubble {
  max-width: 86%; padding: 10px 13px; font-size: .84rem; line-height: 1.6;
  border-radius: 14px; word-break: break-word; white-space: pre-wrap;
}
.rbys-msg.bot .rbys-bubble {
  background: #fff; color: #10233c; border: 1px solid rgba(15,42,80,.09);
  border-bottom-left-radius: 4px; box-shadow: 0 3px 10px rgba(20,50,90,.05);
}
.rbys-msg.user .rbys-bubble {
  background: linear-gradient(135deg, #1d7fe0, #1552c4); color: #fff;
  border-bottom-right-radius: 4px; box-shadow: 0 3px 10px rgba(26,95,214,.22);
}

.rbys-typing { display: flex; gap: 4px; align-items: center; padding: 13px 15px; }
.rbys-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94b4de; animation: rbysBlink 1.2s infinite ease-in-out; }
.rbys-typing span:nth-child(2) { animation-delay: .18s; }
.rbys-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes rbysBlink { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.rbys-chat-quick {
  flex: none; display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto;
  background: #eef4fc; scrollbar-width: none;
}
.rbys-chat-quick::-webkit-scrollbar { display: none; }
.rbys-chat-quick button {
  flex: none; white-space: nowrap; font: inherit; font-size: .74rem; font-weight: 600;
  padding: 6px 11px; border-radius: 20px; cursor: pointer;
  color: var(--chat-accent); background: #fff; border: 1px solid rgba(29,127,224,.3);
  transition: background .15s ease, color .15s ease;
}
.rbys-chat-quick button:hover { background: var(--chat-accent); color: #fff; }

.rbys-chat-input {
  flex: none; display: flex; gap: 8px; padding: 10px 12px 12px;
  background: #fff; border-top: 1px solid rgba(15,42,80,.08);
}
.rbys-chat-input input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: .84rem;
  padding: 10px 12px; border: 1px solid var(--line-strong, rgba(15,42,80,.2));
  border-radius: 10px; outline: none; color: #10233c; background: #fbfdff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.rbys-chat-input input:focus { border-color: var(--chat-accent); box-shadow: 0 0 0 3px rgba(29,127,224,.12); }
.rbys-chat-input button {
  flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #1d7fe0, #1552c4); color: #fff; font-size: 1rem;
  display: grid; place-items: center; transition: transform .15s ease;
}
.rbys-chat-input button:hover { transform: scale(1.05); }

@media (max-width: 640px) {
  /* 移动端保持贴底，避免遮挡内容 */
  .rbys-chat-launcher { top: auto; bottom: 18px; right: 14px; transform: none; }
  .rbys-chat-launcher:hover { transform: translateY(-3px) scale(1.04); }
  .rbys-chat-panel {
    right: 8px; left: 8px; bottom: 96px; top: auto; width: auto; max-width: none;
    height: min(560px, calc(100vh - 110px)); max-height: calc(100vh - 110px);
  }
}
