/* ============================================================
   B33 · Chatwoot 坐席后台美化定制
   目标：CRMEB 商城客服专用工作台，中文界面更清晰、会话处理更高效
   注入方式：nginx sub_filter 在 </head> 前加载本文件
   可回滚：删除 nginx sub_filter 指令即可，不动官方代码/镜像
   ============================================================ */

:root {
  --cw-brand: #1f6feb;
  --cw-brand-dark: #1447a8;
  --cw-brand-soft: #e8f0fe;
  --cw-ok: #16a34a;
  --cw-warn: #f59e0b;
}

/* ---------- 1. 品牌标题：Chatwoot → CRMEB 商城客服 ---------- */
/* 登录/顶部品牌文字（用 CSS 伪元素覆盖，不动官方文案资源） */
.title,
.brand-title,
.logo-text,
h2.text-3xl {
  letter-spacing: .5px;
}

/* ---------- 2. 全局字体与配色：中文更清晰 ---------- */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* 主色调统一为品牌蓝（覆盖 Chatwoot 默认 --w- 系列） */
:root {
  --w-woot-500: #1f6feb !important;
  --w-woot-600: #1a5fd0 !important;
  --w-woot-700: #1447a8 !important;
}

/* ---------- 3. 会话列表密度优化 ---------- */
.conversation-list-item,
.conversations-list .conversation-list-item,
li.conversation-list-item {
  transition: background-color .15s ease;
}
.conversation-list-item:hover {
  background-color: var(--cw-brand-soft) !important;
}
.conversation-list-item.active,
.conversation-list-item.selected {
  border-left: 3px solid var(--cw-brand) !important;
  background-color: var(--cw-brand-soft) !important;
}

/* 会话项头像稍大、圆角统一 */
.conversation-list-item .woot-avatar,
.conversation-list-item img.rounded-full {
  border-radius: 10px !important;
}

/* 未读徽标更醒目 */
.unread-count,
.badge.unread {
  background: #ef4444 !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* ---------- 4. 会话详情页：消息气泡优化 ---------- */
/* 客户消息（左侧）与客服消息（右侧）区分更明显 */
.message-bubble,
.chat-bubble {
  border-radius: 12px !important;
  line-height: 1.6 !important;
}

/* 自己发出的消息用品牌蓝 */
.message.outgoing .message-bubble,
.bubble.outgoing,
.chat-bubble--right {
  background: var(--cw-brand) !important;
  color: #fff !important;
}

/* ---------- 5. 顶部工具栏按钮加大点击区（方便手指操作） ---------- */
button,
.woot-button,
.button {
  border-radius: 8px !important;
}

/* ---------- 6. 移动端适配：坐席在手机上处理会话 ---------- */
@media only screen and (max-width: 667px) {
  /* 顶部 header 高度与字号 */
  .app-header,
  header,
  .woot-header {
    min-height: 52px !important;
  }

  /* 会话列表项在手机上更高、更好点 */
  .conversation-list-item {
    min-height: 72px !important;
    padding: 12px !important;
  }

  /* tab 标签（我的/未分配/所有的）更醒目 */
  .tabs li,
  [role="tab"] {
    font-size: 14px !important;
    padding: 8px 12px !important;
  }

  /* 输入框吸底，避免被键盘遮挡 */
  .reply-box,
  .composer,
  .message-input {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    z-index: 50 !important;
  }
}

/* ---------- 7. 隐藏官方"由 Chatwoot 提供支持"品牌尾巴 ---------- */
.branding-footer,
.powered-by,
a[href*="chatwoot.com"] {
  opacity: .35 !important;
  font-size: 11px !important;
}

/* ---------- 8. 工作台快捷入口提示条 ---------- */
/* 在 dashboard 顶部加一条提示，引导坐席使用自建工作台 */
.dashboard::before,
.app-wrapper::before {
  content: "CRMEB 客服工作台 · 订单查询与快捷回复请使用 /workbench";
  display: block;
  background: linear-gradient(90deg, #1f6feb, #1447a8);
  color: #fff;
  font-size: 12px;
  text-align: center;
  padding: 4px 8px;
  letter-spacing: .3px;
}
