/* ===== 在线客服聊天 ===== */
.chat-wrap {
    width: 1000px;
    max-width: 100%;
    margin: 20px auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 75vh;
    min-height: 520px;
}

/* 顶部客服信息条 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff6a4d, #e93323);
    color: #fff;
    flex-shrink: 0;
}
.chat-header-info {
    display: flex;
    align-items: center;
}
.chat-header-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.3);
}
.chat-header-text .kefu-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}
.kefu-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
    display: flex;
    align-items: center;
}
.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #67C23A;
    border-radius: 50%;
    margin-right: 4px;
}
.chat-header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* 消息区 */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f5f5f5;
}
.chat-tip {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 6px 0;
    margin-bottom: 8px;
}

/* 消息气泡 */
.chat-msg-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.chat-item {
    display: flex;
    align-items: flex-start;
}
.chat-item.self {
    flex-direction: row-reverse;
}
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #ddd;
}
.chat-item.self .chat-avatar {
    margin-left: 10px;
}
.chat-item:not(.self) .chat-avatar {
    margin-right: 10px;
}
.chat-bubble-wrap {
    max-width: 60%;
    display: flex;
    flex-direction: column;
}
.chat-item.self .chat-bubble-wrap {
    align-items: flex-end;
}
.chat-sender {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
    padding: 0 2px;
}
.chat-bubble {
    padding: 9px 13px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-all;
    position: relative;
}
.chat-item:not(.self) .chat-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #ececec;
}
.chat-item.self .chat-bubble {
    background: #fff;
    color: #000;
}
.chat-bubble img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}
/* 系统消息（居中灰色） */
.chat-system {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 4px 0;
}
/* 商品卡片消息 */
.chat-goods-card {
    width: 230px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #eee;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    display: block;
}
.chat-goods-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}
.chat-goods-card .gc-info {
    padding: 8px 10px;
}
.chat-goods-card .gc-name {
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.chat-goods-card .gc-price {
    font-size: 14px;
    color: #e93323;
    font-weight: 600;
}

/* 输入区 */
.chat-input-bar {
    flex-shrink: 0;
    border-top: 1px solid #eee;
    background: #fff;
    padding: 10px 16px;
}
.chat-input-tools {
    margin-bottom: 6px;
}
.chat-input-tools i {
    font-size: 22px;
    color: #888;
    cursor: pointer;
    margin-right: 12px;
}
.chat-input-tools i:hover {
    color: #e93323;
}
.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}
.chat-input-row textarea {
    flex: 1;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.5;
    max-height: 100px;
    outline: none;
}
.chat-input-row textarea:focus {
    border-color: #e93323;
}
.chat-send-btn {
    flex-shrink: 0;
    background: #e93323;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0 22px;
    height: 38px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity ease 0.2s;
}
.chat-send-btn:hover {
    opacity: 0.85;
}
.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 服务结束态 */
.chat-ended-bar {
    flex-shrink: 0;
    border-top: 1px solid #eee;
    background: #fafafa;
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}
.chat-ended-bar button {
    margin-left: 14px;
    background: #e93323;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 16px;
    cursor: pointer;
    font-size: 13px;
}
.chat-ended-bar button:hover {
    opacity: 0.85;
}

/* 店铺选择列表 */
.chat-shop-select {
    padding: 30px 20px;
}
.chat-shop-select h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 16px;
}
.chat-shop-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: box-shadow ease 0.2s;
}
.chat-shop-item:hover {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}
.chat-shop-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}
.chat-shop-item .name {
    flex: 1;
    font-size: 14px;
    color: #333;
}
.chat-shop-item .enter {
    color: #e93323;
    font-size: 13px;
}
