
  /* ========== 客服 SDK 作用域样式（rgl- 前缀，避免与宿主页面冲突） ========== */
  #reglow-cs-bar,
  #reglow-cs-bar *,
  #reglow-cs-chat,
  #reglow-cs-chat * {
    box-sizing: border-box;
    font-family:
      system-ui,
      -apple-system,
      "PingFang SC",
      "Microsoft YaHei",
      sans-serif;
  }

  /* ========== 单个悬浮按钮 + 工具组合卡片 + 返回顶部 ========== */
  #reglow-cs-bar {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 122px; /* 返回顶部槽位(56) + 间距(10) + 主按钮(56)：主按钮下方始终预留一个自身大小的位置 */
    z-index: 100000;
    user-select: none;
    touch-action: none;
    --rgl-primary: #4f46e5;
  }
  .rgl-fab-main {
    position: absolute;
    left: 0;
    bottom: 66px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--rgl-primary, #4f46e5);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    transition:
      transform 0.15s ease,
      box-shadow 0.15s ease;
  }
  .rgl-fab-main:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  }
  /* 悬浮按钮流光效果：高光沿整个按钮面流动（常显，非 hover 触发） */
  .rgl-fab-main::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    background: conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0) 0deg,
      rgba(255, 255, 255, 0) 265deg,
      rgba(255, 255, 255, 0.55) 335deg,
      rgba(255, 255, 255, 0) 360deg
    );
    animation: rglFabShine 30s linear infinite; /* 30 秒一圈 */
    transition: opacity 0.25s ease;
  }
  /* 点击打开（显示 ×）时隐藏流光 */
  .rgl-fab-main.rgl-open::before {
    animation: none;
    opacity: 0;
  }
  /* 图标保持在流光之上（红点保持 absolute 定位不变） */
  #rgl-fab-icon {
    position: relative;
    z-index: 1;
  }
  .rgl-fab-badge {
    z-index: 1;
  }
  @keyframes rglFabShine {
    to {
      transform: rotate(360deg);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .rgl-fab-main::before {
      animation: none;
    }
  }
  /* 返回顶部（白底，滚动到页面底部时出现，占主按钮下方的预留槽位） */
  .rgl-backtop {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    color: var(--rgl-primary, #4f46e5);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    transition:
      transform 0.15s ease,
      box-shadow 0.15s ease;
  }
  .rgl-backtop:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
  }
  .rgl-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    display: none;
  }
  /* 工具组合卡片（气泡卡片） */
  .rgl-fab-pop {
    position: absolute;
    right: 0;
    bottom: 136px; /* 容器高122 + 间距14，卡片紧贴主按钮上方 */
    width: 168px; /* 主菜单窄；子视图（扫码/联系/反馈）由 JS 加宽到 248px */
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.2);
    display: none;
    overflow: hidden;
    animation: rglPopUp 0.16s ease;
    z-index: 100001;
  }
  .rgl-fab-pop::after {
    content: "";
    position: absolute;
    right: 20px;
    bottom: -6px;
    transform: rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    box-shadow: -2px 3px 5px rgba(0, 0, 0, 0.06);
  }
  @keyframes rglPopUp {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.97);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  .rgl-fab-pop-head {
    padding: 12px 14px;
    background: var(--rgl-primary, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
  }
  .rgl-fab-pop-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.9;
  }
  .rgl-fab-pop-close:hover {
    opacity: 1;
  }
  .rgl-fab-pop-body {
    padding: 8px;
  }
  .rgl-fab-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 9px;
    font-size: 13.5px;
    color: #333;
    text-align: left;
    transition: background 0.12s ease;
  }
  .rgl-fab-row:hover {
    background: #f2f4f8;
  }
  .rgl-fab-row .rgl-fab-row-ico {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--rgl-primary, #4f46e5) 10%, #fff);
    color: var(--rgl-primary, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .rgl-fab-row .rgl-fab-row-label {
    flex: 1;
  }
  .rgl-fab-row .rgl-fab-row-chevron {
    color: #c3c7d0;
    flex-shrink: 0;
  }
  .rgl-fab-pop-divider {
    height: 1px;
    background: #f0f1f4;
    margin: 4px 8px;
  }
  .rgl-fab-back {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--rgl-primary, #4f46e5);
    font-size: 12.5px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
  }
  .rgl-fab-back:hover {
    background: color-mix(in srgb, var(--rgl-primary, #4f46e5) 10%, #fff);
  }
  .rgl-fab-qr {
    text-align: center;
    padding: 6px 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center; /* 二维码水平居中 */
  }
  .rgl-fab-qr img {
    width: 148px;
    height: 148px;
    border-radius: 10px;
    border: 1px solid #ececf0;
    object-fit: contain;
    background: #fff;
  }
  .rgl-fab-qr-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-top: 10px;
  }
  .rgl-fab-qr-desc {
    font-size: 12.5px;
    color: #777;
    margin-top: 4px;
    line-height: 1.6;
  }
  .rgl-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    padding: 9px 4px;
    border-bottom: 1px solid #f0f1f4;
  }
  .rgl-contact-row:last-child {
    border-bottom: none;
  }
  .rgl-contact-row .rgl-contact-ico {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--rgl-primary, #4f46e5) 10%, #fff);
    color: var(--rgl-primary, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .rgl-contact-row .rgl-contact-label {
    font-size: 11.5px;
    color: #999;
  }
  .rgl-contact-row .rgl-contact-val {
    font-size: 13px;
    color: #222;
    margin-top: 2px;
    word-break: break-all;
  }
  .rgl-contact-row a.rgl-contact-val {
    color: var(--rgl-primary, #4f46e5);
    text-decoration: none;
  }
  /* 反馈 */
  .rgl-fb-hd {
    font-size: 13.5px;
    color: #333;
    font-weight: 600;
    margin: 4px 0 12px;
    text-align: center;
  }
  .rgl-fb-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
  }
  .rgl-fb-star {
    cursor: pointer;
    color: #d1d5db;
    font-size: 26px;
    line-height: 1;
    transition:
      transform 0.12s ease,
      color 0.12s ease;
  }
  .rgl-fb-star:hover {
    transform: scale(1.18);
  }
  .rgl-fb-star.on {
    color: #f5a623;
  }
  .rgl-fb-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 12px;
  }
  .rgl-fb-submit {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-radius: 8px;
    background: var(--rgl-primary, #4f46e5);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
  }
  .rgl-fb-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .rgl-fb-done {
    text-align: center;
    color: #2e7d32;
    font-size: 14px;
    padding: 26px 0;
  }

  /* ========== 聊天窗口（可拖拽，知识库向左伸缩不推移聊天） ========== */
  #reglow-cs-chat {
    position: fixed;
    width: 400px;
    max-width: calc(100vw - 24px);
    height: 620px;
    max-height: calc(100vh - 24px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
    --rgl-primary: #4f46e5;
  }
  .rgl-header {
    padding: 10px 14px;
    background: var(--rgl-primary, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }
  .rgl-header:active {
    cursor: grabbing;
  }
  .rgl-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
  }
  .rgl-header-info {
    min-width: 0;
    flex: 1;
  }
  .rgl-header-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rgl-header-sub {
    font-size: 11px;
    opacity: 0.88;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rgl-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }
  .rgl-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
    transition: background 0.15s ease;
  }
  .rgl-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    opacity: 1;
  }
  .rgl-icon-btn.active {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
  }
  .rgl-body {
    flex: 1;
    display: flex;
    min-height: 0;
  }
  /* 聊天列（默认 400px，窄屏/移动端可收缩，避免发送按钮被裁切） */
  .rgl-chat-col {
    width: 400px;
    min-width: 0;
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
  }
  .rgl-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f6f8;
  }
  .rgl-msgs::-webkit-scrollbar {
    width: 5px;
  }
  .rgl-msgs::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
  }

  /* ========== 知识库面板（左侧，展开/收起） ========== */
  .rgl-kb-pane {
    width: 340px;
    min-width: 0;
    flex-shrink: 1;
    border-right: 1px solid #ececf0;
    background: #fafbfc;
    display: none;
    flex-direction: column;
    min-height: 0;
  }
  .rgl-kb-toolbar {
    padding: 10px 12px;
    border-bottom: 1px solid #ececf0;
    background: #fff;
    flex-shrink: 0;
  }
  .rgl-kb-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
  }
  .rgl-kb-search {
    width: 100%;
    border: 1px solid #e3e4e8;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    outline: none;
    background: #f7f8fa;
  }
  .rgl-kb-search:focus {
    border-color: var(--rgl-primary, #4f46e5);
    background: #fff;
  }
  .rgl-kb-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 16px; /* 底部保留 16px 留白 */
    display: flex;
    flex-direction: column;
    gap: 8px; /* 常见问题列表条目间距 */
    min-height: 0;
  }
  .rgl-kb-list::-webkit-scrollbar,
  .rgl-kb-detail-scroll::-webkit-scrollbar {
    width: 4px;
  }
  .rgl-kb-list::-webkit-scrollbar-thumb,
  .rgl-kb-detail-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 4px;
  }
  .rgl-kb-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font-size: 12.5px;
    line-height: 1.5;
    color: #444;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    flex-shrink: 0; /* 防止条目被 flex 压缩导致文字截断 */
    transition:
      background 0.15s ease,
      color 0.15s ease;
    overflow: hidden;
  }
  .rgl-kb-item-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    display: block;
  }
  .rgl-kb-item-snip {
    font-size: 16px;
    color: #666;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .rgl-kb-item:hover {
    background: #eef0f4;
  }
  .rgl-kb-item:hover .rgl-kb-item-title {
    color: var(--rgl-primary, #4f46e5);
  }
  .rgl-kb-empty {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 24px 10px;
  }
  .rgl-kb-more {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 6px 0 0;
    flex-shrink: 0;
    line-height: 1.5;
  }
  .rgl-kb-detail {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    background: #fff;
  }
  .rgl-kb-back {
    align-self: flex-start;
    margin: 8px 12px 0;
    border: none;
    background: transparent;
    color: var(--rgl-primary, #4f46e5);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
  }
  .rgl-kb-back:hover {
    background: color-mix(in srgb, var(--rgl-primary, #4f46e5) 10%, #fff);
  }
  .rgl-kb-detail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 16px;
  }
  .rgl-kb-detail-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    line-height: 1.5;
    margin-bottom: 10px;
  }
  .rgl-kb-detail-content {
    font-size: 13.5px;
    line-height: 1.8;
    color: #444;
    word-break: break-word;
  }
  .rgl-kb-detail-content img {
    max-width: 100%;
    border-radius: 8px;
  }
  .rgl-kb-ask {
    margin-top: 14px;
    width: 100%;
    padding: 8px 0;
    border: 1px solid var(--rgl-primary, #4f46e5);
    border-radius: 8px;
    background: #fff;
    color: var(--rgl-primary, #4f46e5);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .rgl-kb-ask:hover {
    background: color-mix(in srgb, var(--rgl-primary, #4f46e5) 10%, #fff);
  }

  /* ========== 消息气泡 ========== */
  .rgl-msg {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }
  .rgl-msg.user {
    justify-content: flex-end;
  }
  .rgl-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    background-size: cover;
    background-position: center;
  }
  .rgl-msg-col {
    min-width: 0;
    max-width: 78%;
    display: flex;
    flex-direction: column;
  }
  .rgl-msg.user .rgl-msg-col {
    align-items: flex-end;
  }
  .rgl-msg-meta {
    font-size: 10px;
    color: #9aa0aa;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: nowrap;
  }
  .rgl-bubble {
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
  }
  .rgl-msg.user .rgl-bubble {
    background: var(--rgl-primary, #4f46e5);
    color: #fff;
  }
  .rgl-msg.bot .rgl-bubble,
  .rgl-msg.agent .rgl-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e2e8;
  }
  .rgl-bubble img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    cursor: pointer;
  }
  .rgl-msg-system {
    text-align: center;
    margin: 8px 0;
  }
  .rgl-msg-system > span {
    display: inline-block;
    background: #e8eaef;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    max-width: 90%;
  }
  .rgl-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e0e2e8;
    width: fit-content;
    font-size: 13px;
    color: #999;
  }
  .rgl-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c3c7d0;
    display: inline-block;
    animation: rglBlink 1.2s infinite;
  }
  .rgl-typing i:nth-child(2) {
    animation-delay: 0.2s;
  }
  .rgl-typing i:nth-child(3) {
    animation-delay: 0.4s;
  }
  @keyframes rglBlink {
    0%,
    80%,
    100% {
      opacity: 0.25;
    }
    40% {
      opacity: 1;
    }
  }
  .rgl-quick-transfer {
    margin-top: 8px;
    font-size: 12px;
    color: var(--rgl-primary, #4f46e5);
    cursor: pointer;
    text-align: right;
  }
  .rgl-rating {
    text-align: center;
    margin: 10px 0;
  }
  .rgl-rating-card {
    display: inline-block;
    background: #fff;
    border: 1px solid #e0e2e8;
    border-radius: 12px;
    padding: 10px 16px;
    max-width: 90%;
  }
  .rgl-rating-card .rgl-star {
    cursor: pointer;
    font-size: 22px;
    color: #d1d5db;
  }
  .rgl-preview {
    display: none;
    padding: 0 12px 6px;
    border-top: 1px solid #eef0f3;
  }
  .rgl-preview-inner {
    position: relative;
    display: inline-block;
    margin: 6px 4px 0;
  }
  .rgl-preview-inner img {
    max-height: 80px;
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: block;
  }
  .rgl-preview-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
  }
  .rgl-footer {
    padding: 8px 12px 12px;
    border-top: 1px solid #eef0f3;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
  }
  .rgl-attach {
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    color: #666;
  }
  .rgl-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #dde0e6;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
  }
  .rgl-input:focus {
    border-color: var(--rgl-primary, #4f46e5);
  }
  .rgl-send {
    padding: 10px 16px;
    background: var(--rgl-primary, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
  }
  .rgl-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* 暗色下主色自动切换为 --rgl-primary-dark（浅色主色保留不变） */
  #reglow-cs-bar.rgl-dark,
  #reglow-cs-chat.rgl-dark {
    --rgl-primary: var(--rgl-primary-dark, #6366f1) !important;
  }

  /* ========== 暗色模式（跟随宿主页面 .dark / data-theme=dark / 系统偏好） ========== */
  #reglow-cs-chat {
    color: #333;
  }
  .rgl-input {
    color: #333;
  }
  .rgl-input::placeholder {
    color: #9aa0aa;
  }
  #reglow-cs-chat.rgl-dark {
    background: #1f2430;
    color: #e5e7eb;
  }
  .rgl-dark .rgl-msgs {
    background: #171b24;
  }
  .rgl-dark .rgl-footer,
  .rgl-dark .rgl-preview {
    border-top-color: #2b3242;
  }
  .rgl-dark .rgl-attach {
    color: #cbd5e1;
  }
  .rgl-dark .rgl-input {
    background: #262c3a;
    border-color: #3a4256;
    color: #e5e7eb;
  }
  .rgl-dark .rgl-input::placeholder {
    color: #94a3b8;
  }
  .rgl-dark .rgl-msg.bot .rgl-bubble,
  .rgl-dark .rgl-msg.agent .rgl-bubble {
    background: #262c3a;
    border-color: #3a4256;
    color: #e5e7eb;
  }
  .rgl-dark .rgl-msg-meta {
    color: #94a3b8;
  }
  .rgl-dark .rgl-msg-system > span {
    background: #2a3140;
    color: #cbd5e1;
  }
  .rgl-dark .rgl-typing {
    background: #262c3a;
    border-color: #3a4256;
    color: #94a3b8;
  }
  .rgl-dark .rgl-rating-card {
    background: #262c3a;
    border-color: #3a4256;
  }
  /* 知识库侧栏 */
  .rgl-dark .rgl-kb-pane {
    background: #1b202b;
    border-right-color: #2b3242;
  }
  .rgl-dark .rgl-kb-toolbar {
    background: #1f2430;
    border-bottom-color: #2b3242;
  }
  .rgl-dark .rgl-kb-title,
  .rgl-dark .rgl-kb-item-title,
  .rgl-dark .rgl-kb-detail-title {
    color: #e5e7eb;
  }
  .rgl-dark .rgl-kb-search {
    background: #262c3a;
    border-color: #3a4256;
    color: #e5e7eb;
  }
  .rgl-dark .rgl-kb-search:focus {
    background: #262c3a;
  }
  .rgl-dark .rgl-kb-item {
    color: #cbd5e1;
  }
  .rgl-dark .rgl-kb-item-snip,
  .rgl-dark .rgl-kb-detail-content {
    color: #a8b1c1;
  }
  .rgl-dark .rgl-kb-item:hover {
    background: #262c3a;
  }
  .rgl-dark .rgl-kb-detail {
    background: #1f2430;
  }
  .rgl-dark .rgl-kb-ask {
    background: transparent;
  }
  .rgl-dark .rgl-kb-empty,
  .rgl-dark .rgl-kb-more {
    color: #94a3b8;
  }
  /* 悬浮菜单卡片 / 反馈 */
  .rgl-dark .rgl-fab-pop,
  .rgl-dark .rgl-fab-pop::after {
    background: #1f2430;
  }
  .rgl-dark .rgl-fab-row {
    color: #e5e7eb;
  }
  .rgl-dark .rgl-fab-row:hover {
    background: #262c3a;
  }
  .rgl-dark .rgl-fab-pop-divider {
    background: #2b3242;
  }
  .rgl-dark .rgl-fab-qr {
    background: #262c3a;
  }
  .rgl-dark .rgl-fab-qr-title,
  .rgl-dark .rgl-contact-row .rgl-contact-val,
  .rgl-dark .rgl-fb-hd {
    color: #e5e7eb;
  }
  .rgl-dark .rgl-fab-qr-desc,
  .rgl-dark .rgl-contact-row .rgl-contact-label,
  .rgl-dark .rgl-fb-labels {
    color: #94a3b8;
  }
  .rgl-dark .rgl-backtop {
    background: #262c3a;
    color: #cbd5e1;
  }

  /* ========== 移动端（窄屏）：常见问题以侧边栏菜单（抽屉）展示，聊天区保持全宽 ========== */
  @keyframes rglKbSlideIn {
    from {
      transform: translateX(-100%);
      opacity: 0.6;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
  @media (max-width: 640px) {
    .rgl-body {
      position: relative;
    }
    .rgl-chat-col {
      width: 100%;
      flex: 1 1 100%;
    }
    .rgl-kb-pane {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 75%;
      max-width: 320px;
      z-index: 6;
      border-right: none;
      box-shadow: 6px 0 18px rgba(0, 0, 0, 0.14);
      animation: rglKbSlideIn 0.18s ease;
    }
  }
