/* 官网悬浮「招商顾问」AI 客服 —— 与落地页 navy/gold 主题一致 */
.rc-widget, .rc-widget * { box-sizing: border-box; }
.rc-widget {
  --rc-navy: #0a1e3a;
  --rc-navy-2: #10294a;
  --rc-gold: #c8a45c;
  --rc-gold-deep: #a8874a;
  --rc-gold-light: #e7d6ae;
  --rc-ivory: #f8f6f1;
  --rc-ink: #1a2836;
  --rc-muted: #5f6f80;
  --rc-line: #e6e1d5;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* 底部行：气泡 + 悬浮按钮 */
.rc-bottom-row { display: flex; align-items: flex-end; gap: 10px; }
.rc-bubble {
  position: relative;
  max-width: 216px;
  background: #fff;
  border: 1px solid var(--rc-line);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--rc-ink);
  box-shadow: 0 10px 28px rgba(10, 30, 58, .16);
  cursor: pointer;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.rc-bubble.rc-show { opacity: 1; transform: translateX(0); pointer-events: auto; }
.rc-bubble::before {
  content: "";
  position: absolute; right: -8px; bottom: 15px;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  border-left: 8px solid var(--rc-line);
}
.rc-bubble::after {
  content: "";
  position: absolute; right: -6px; bottom: 15px;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  border-left: 8px solid #fff;
}

/* 悬浮按钮：图标 + 「在线咨询」文字一体的胶囊按钮 */
.rc-launcher {
  display: inline-flex; align-items: center; gap: 9px;
  height: 50px; padding: 0 22px; border-radius: 999px;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--rc-gold), var(--rc-gold-deep));
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  font-family: inherit;
  box-shadow: 0 12px 30px rgba(10, 30, 58, .32), 0 0 0 0 rgba(200, 164, 92, .5);
  transition: transform .16s ease, box-shadow .16s ease;
  animation: rc-pulse 2.4s infinite;
}
.rc-launcher:hover { transform: translateY(-3px); }
.rc-launcher svg { width: 22px; height: 22px; }
@keyframes rc-pulse {
  0%   { box-shadow: 0 12px 30px rgba(10,30,58,.32), 0 0 0 0 rgba(200,164,92,.5); }
  70%  { box-shadow: 0 12px 30px rgba(10,30,58,.32), 0 0 0 14px rgba(200,164,92,0); }
  100% { box-shadow: 0 12px 30px rgba(10,30,58,.32), 0 0 0 0 rgba(200,164,92,0); }
}

/* 对话面板 */
.rc-panel {
  width: 372px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 96px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--rc-line);
  box-shadow: 0 30px 70px rgba(10, 30, 58, .28);
  transform-origin: bottom right;
}
.rc-panel.rc-hidden { display: none; }

.rc-head {
  background: linear-gradient(135deg, var(--rc-navy), var(--rc-navy-2));
  color: #fff; padding: 15px 16px; display: flex; align-items: center; gap: 12px;
}
.rc-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--rc-gold), var(--rc-gold-deep));
  display: grid; place-items: center; font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 19px; color: #fff;
}
.rc-head-title { font-weight: 600; font-size: 15px; letter-spacing: .5px; }
.rc-head-sub { font-size: 11.5px; color: var(--rc-gold-light); opacity: .9; letter-spacing: 1px; }
.rc-head .rc-close {
  margin-left: auto; width: 30px; height: 30px; border: none; cursor: pointer;
  background: rgba(255,255,255,.1); color: #d4e0ec; border-radius: 8px; font-size: 16px;
}
.rc-head .rc-close:hover { background: rgba(255,255,255,.2); color: #fff; }

.rc-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  background: linear-gradient(180deg, var(--rc-ivory), #fff 60%);
  display: flex; flex-direction: column; gap: 10px;
}
.rc-msg { max-width: 82%; padding: 10px 13px; border-radius: 13px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.rc-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--rc-line); color: var(--rc-ink); border-bottom-left-radius: 4px; }
.rc-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--rc-gold), var(--rc-gold-deep)); color: #fff; border-bottom-right-radius: 4px; }
.rc-msg .rc-typing { display: inline-flex; gap: 4px; }
.rc-msg .rc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--rc-muted); animation: rc-blink 1.2s infinite; }
.rc-msg .rc-typing i:nth-child(2) { animation-delay: .2s; }
.rc-msg .rc-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes rc-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.rc-quick { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.rc-quick button {
  border: 1px solid var(--rc-gold-light); background: #fbf8f1; color: var(--rc-gold-deep);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.rc-quick button:hover { background: var(--rc-gold); color: #fff; border-color: var(--rc-gold); }

.rc-inputbar {
  display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--rc-line); background: #fff;
}
.rc-inputbar input {
  flex: 1; border: 1px solid var(--rc-line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; color: var(--rc-ink); outline: none;
}
.rc-inputbar input:focus { border-color: var(--rc-gold-deep); box-shadow: 0 0 0 3px rgba(200,164,92,.15); }
.rc-inputbar button.rc-send {
  border: none; border-radius: 10px; padding: 0 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--rc-gold), var(--rc-gold-deep)); color: #fff; font-size: 14px;
}
.rc-inputbar button.rc-send:disabled { opacity: .55; cursor: not-allowed; }

.rc-foot {
  padding: 4px 16px 10px; text-align: center; font-size: 11px; color: var(--rc-muted);
}
.rc-foot a { color: var(--rc-gold-deep); text-decoration: none; }

@media (max-width: 480px) {
  .rc-widget { right: 12px; bottom: 18px; top: auto; transform: none; }
  .rc-panel { width: calc(100vw - 28px); height: calc(100vh - 120px); }
  .rc-bubble { display: none; }
  /* 移动端：胶囊缩成圆形图标 + 「客服」小标签，少占地方 */
  .rc-launcher {
    position: relative;
    height: 46px; width: 46px; padding: 0; border-radius: 50%;
    justify-content: center;
  }
  .rc-launcher span { display: none; }
  .rc-launcher svg { width: 24px; height: 24px; }
  .rc-launcher::after {
    content: "客服";
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    margin-top: 4px; font-size: 10px; letter-spacing: 1px; font-weight: 500;
    color: var(--rc-gold-deep); background: rgba(255,255,255,.95);
    padding: 1px 6px; border-radius: 999px; border: 1px solid var(--rc-gold-light);
    white-space: nowrap; box-shadow: 0 2px 8px rgba(10,30,58,.12);
  }
}
