/* ============================================================
 * 联购客户工作台（聊天头部入口 + 右侧客户列表/会话/分屏）
 * 中间栏/历史会话保持原有布局和操作
 * ============================================================ */

/* 聊天头部联购入口：与头部融合的 tab，默认只显示“联购客户”，点击进入；再次点击返回 */
.lg-header-entry{
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    gap: 6px;
    margin-left: 8px;
    padding: 0 12px;
    font-size: 14px;
    color: #5a6b85;
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}
.lg-header-entry::before{
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 16px;
    margin-top: -8px;
    background: #e8eaee;
}
.lg-header-entry::after{
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: transparent;
    transition: background .15s;
}
.lg-header-entry:hover{
    color: #3855d5;
}
.lg-header-entry.on{
    color: #3855d5;
    font-weight: 500;
}
.lg-header-entry.on::after{
    background: #3855d5;
}
.lg-header-entry-icon{
    flex: none;
    display: block;
}
.lg-header-entry-text{
    white-space: nowrap;
}

/* 首次进入引导 */
.lg-guide{
    flex: none;
    margin: 4px 6px 8px;
    padding: 10px 10px 8px;
    border-radius: 8px;
    background: #f2f5ff;
    border: 1px solid #e4eaff;
    box-sizing: border-box;
}
.lg-guide-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.lg-guide-title{
    font-size: 13px;
    font-weight: 600;
    color: #3855d5;
    line-height: 18px;
}
.lg-guide-close{
    flex: none;
    font-size: 12px;
    color: #7a8db8;
    cursor: pointer;
}
.lg-guide-close:hover{
    color: #3855d5;
}
.lg-guide-text{
    margin-top: 4px;
    font-size: 12px;
    line-height: 18px;
    color: #5a6b85;
}

/* 联购客户会话列表：右侧工作区独立列，不覆盖中间栏历史会话 */
.lg-chat-list{
    float: left;
    width: 240px;
    height: 100%;
    display: none;
    flex-direction: column;
    background: #fafafa;
    border-right: 1px solid #eee;
    box-sizing: border-box;
    overflow: hidden;
}
#right-wrapper.lg-liangou .lg-chat-list{
    display: flex;
}
.lg-list-sec{
    flex: none;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 13px 12px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
    letter-spacing: 1px;
}
.lg-list-sec::before{
    content: '';
    flex: none;
    width: 4px;
    height: 13px;
    border-radius: 999px;
    background: linear-gradient(180deg, #3855d5, #8aa0ef);
}
/* v12：客户搜索框（输入即本地过滤 + 防抖300ms服务端全量匹配合并；flex:none 不挤列表滚动区） */
.lg-search{
    flex: none;
    padding: 0 12px 8px;
    position: relative;
}
.lg-search input{
    width: 100%;
    height: 28px;
    border: 1px solid #e3e6eb;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    padding: 0 26px 0 10px;
    box-sizing: border-box;
    outline: none;
    color: #333;
}
.lg-search input:focus{
    border-color: #3855d5;
}
.lg-search-x{
    position: absolute;
    right: 20px;
    top: 7px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    color: #9aa1ad;
    cursor: pointer;
    font-size: 14px;
    display: none;
}
.lg-search-x:hover{
    color: #333;
}
.lg-search-tip{
    flex: none;
    padding: 0 12px 6px;
    font-size: 11px;
    color: #9aa1ad;
}
.lg-list{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 6px 8px;
}
.lg-list-empty{
    padding: 40px 12px;
    text-align: center;
    font-size: 13px;
    color: #999;
}
.lg-list-empty-tip{
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 18px;
    color: #a0a6b1;
}
.lg-list-retry{
    color: #0e91fc;
    cursor: pointer;
}
.lg-list-more{
    flex: none;
    padding: 8px 0;
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* 联购模式整行移除分屏 pane 头（图标+「微信沟通」标题+刷新/新窗口，不改共享组件，作用域限定 lg-liangou）：
   标题与 tab 行重复；刷新/新窗口不再需要——实时性由 WS 保证，
   且 liangou-wx.js v4 已具备自愈能力（心跳看门狗 90s 判死重连、唤醒/回网检查、断线 banner 页内「点击重连」），
   极端情况浏览器 F5 也能恢复（URL 带 uin/member_id，initFromUrl 复原当前群） */
#right-wrapper.lg-liangou .split-pane-header{
    display: none;
}

/* 会话项 */
.lg-item{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    margin: 5px 0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.lg-item:hover,
.lg-item.on{
    background: #DEE5EE;
}
.lg-item-avatar{
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #c9ced8;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lg-item-avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lg-item-main{
    flex: 1;
    min-width: 0;
}
.lg-item-top,
.lg-item-bottom{
    display: flex;
    align-items: center;
}
/* v12：名称两行化后第一行只留名称（时间移第二行），顶对齐防两行名称与单行元素中线错位 */
.lg-item-top{
    align-items: flex-start;
}
/* v12：名称两行 clamp 占满整行宽（不再被时间挤占）；超长换行最多2行，hover title 看全名（js 侧加）；
   短名行高不变、长名+20px（第二行 desc 恒空=死空间利用，时间/角标移第二行右） */
.lg-item-name{
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #333;
    line-height: 20px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    word-break: break-all;
    overflow: hidden;
}
.lg-item-time{
    flex: none;
    margin-left: 8px;
    font-size: 12px;
    color: #9aa1ad;
}
.lg-item-desc{
    flex: 1;
    min-width: 0;
    margin-top: 2px;
    font-size: 12px;
    color: #888;
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lg-item-badge{
    flex: none;
    margin-left: 8px;
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #EA0000;
    color: #fff;
    font-size: 11px;
    text-align: center;
    box-sizing: border-box;
}
/* v12：行级「商N」角标=该客户开单建议 pending 行数（与分屏 tab 角标同口径）；
   同 split-tab-badge 色 #e64b4b（用户定稿，区别未读红 #EA0000）；几何同 .lg-item-badge；
   位置第二行右、时间左（js 渲染顺序 desc→商N→未读→time） */
.lg-item-sugbadge{
    flex: none;
    margin-left: 8px;
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e64b4b;
    color: #fff;
    font-size: 11px;
    text-align: center;
    box-sizing: border-box;
}

/* v12：开单建议 tab 角标——workbench 幂等注入 <i class="split-tab-badge">，
   不改 split-screen 组件；作用域限定 lg-liangou（pane 头隐藏同款先例），其他分屏场景零影响 */
#right-wrapper.lg-liangou .split-tab-item{
    position: relative;
}
#right-wrapper.lg-liangou .split-tab-badge{
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e64b4b;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    line-height: 15px;
    text-align: center;
    box-shadow: 0 0 0 1px #fff;
    pointer-events: none;
}

/* ============================================================
 * v14：行级「AI」角标（修复记录⑳，AI 回复手动发送模式）——ai_auto_reply=2 且
 * 微信房间与 AI 回复客户不一致/微信页未就绪时，该客户行暂存 AI 回复的提醒；
 * paintAiBadges 幂等重绘，填入成功即清。几何同「商N」角标（v12 .lg-item-sugbadge），
 * 蓝色 #0e91fc 区分语义（商N=开单建议待处理，AI=有可取回复）；位置 time 后最右端
 * ============================================================ */
.lg-item-aibadge{
    flex: none;
    margin-left: 8px;
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #0e91fc;
    color: #fff;
    font-size: 11px;
    text-align: center;
    box-sizing: border-box;
}
