/* 悬浮客服按钮样式 */
.chat-toggle-button {
    position: fixed;
    /*    bottom: 63px;
        right: 26px;*/
    background-color: #007BFF;
    color: white;
    border-radius: 20px;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 12px;
}

.chat-toggle-button span {
    font-weight: bolder;
}

.chat-toggle-button img {
    height: 18px;
    width: 18px;
    margin-right: 4px;
}


/* 聊天窗口样式 */
.chat-widget {
    width: 320px;
    height: 500px;
    position: fixed;
    /*    bottom: 20px;
        right: 40px;*/
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    /*overflow: hidden;*/
    border: none;
    z-index: 999;
}

.chat-widget .chat-history {
    background: #f7f7f7;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    color: rgb(119, 119, 119);
    margin-bottom: 6px;
    user-select: none;
}

.chat-widget .message-days {
    background: #f7f7f7;
    text-align: center;
    font-size: 12px;
    cursor: pointer;
    color: #77777766;
    position: relative;
    margin: 10px 0;
    user-select: none;
}

.chat-widget .message-days::before,
.chat-widget .message-days::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 27%;
    height: 1px;
    background: #7777771c;
}

.chat-widget .message-days::before {
    left: 20px;
}

.chat-widget .message-days::after {
    right: 20px;
}

/* 隐藏时的聊天窗口 */
.chat-widget.hidden {
    display: none;
}

/* 聊天头部包含客服信息 */
.chat-widget .chat-header {
    background-color: #0066FF;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

/* 客服头像与在线状态 */
.chat-widget .agent-info {
    display: flex;
    align-items: center;
}

.chat-widget .agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.chat-widget .agent-name {
    font-size: 16px;
    font-weight: bold;
}

.chat-widget .online-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #d4f1c5;
}

.chat-widget .status-online {
    width: 8px;
    height: 8px;
    background-color: #00ff00;
    border-radius: 50%;
    margin-right: 4px;
}

.chat-widget .status-offline {
    width: 8px;
    height: 8px;
    background-color: grey;
    border-radius: 50%;
    margin-right: 4px;
}

/* 最小化按钮 */
.chat-widget .chat-minimize-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chat-widget .chat-body {
    flex: 1;
    padding: 5px 15px 15px 15px;
    overflow-y: auto;
    background-color: #f7f7f7;
    overflow-x: hidden;
}


/* 滚动条宽度 */
.chat-widget .chat-body::-webkit-scrollbar {
    width: 8px; /* 滚动条的宽度 */
}

/* 滚动条轨道 */
.chat-widget .chat-body::-webkit-scrollbar-track {
    background-color: #f1f1f1; /* 滚动条轨道背景颜色 */
    border-radius: 10px; /* 轨道圆角 */
}

/* 滚动条滑块 */
.chat-widget .chat-body::-webkit-scrollbar-thumb {
    background-color: #007BFF; /* 滑块颜色 */
    border-radius: 10px; /* 滑块圆角 */
    border: 2px solid #f1f1f1; /* 滑块边框与轨道区分 */
}

/* 滚动条滑块在 hover 时的颜色 */
.chat-widget .chat-body::-webkit-scrollbar-thumb:hover {
    background-color: #0056b3; /* 滑块在悬浮时变为深色 */
}

/* 支持 Firefox 的滚动条样式 */
.chat-widget .chat-body {
    scrollbar-width: thin; /* 设置滚动条宽度为细条 */
    scrollbar-color: #007BFF #f1f1f1; /* 滚动条颜色和轨道颜色 */
}

.chat-widget .chat-message {
    margin-bottom: 10px;
}

.chat-widget .chat-message.bot {
    max-width: 75%;
    margin-right: auto;
    text-align: left;
}

.chat-widget .chat-message .message-content {
    word-break: break-word;
    overflow-wrap: break-word;
}

.chat-widget .chat-message.bot .message-content {
    display: inline-block;
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    color: black;
    text-align: left;
}

.chat-widget .chat-message.bot .message-time {
    display: block;
    font-size: 12px;
    color: rgb(136, 148, 171);
    text-align: left;
    padding: 0 0 1px 2px;
}


.chat-widget .chat-message.user .message-time {
    display: block;
    font-size: 12px;
    color: rgb(136, 148, 171);
    text-align: right;
    padding: 10px 0 1px 0;
}

.chat-widget .chat-message.user {
    max-width: 75%;
    margin-left: auto;
    text-align: right;
}

.chat-widget .chat-message.user .message-content {
    display: inline-block;
    background-color: #0066FF;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    color: white;
    text-align: left;
}

.chat-widget .chat-message img {
    max-width: 200px;
    height: 150px;
    border-radius: 10px;
    cursor: pointer;
    object-fit: cover;
    object-position: center;
}

.chat-widget .chat-message video {
    max-width: 200px;
    border-radius: 10px;
    cursor: pointer;
}

.chat-widget .chat-message .file-download {
    color: #0066FF;
    font-size: 13px;
}

.chat-widget .server-delay{
    color: greenyellow;
    font-weight: normal;
    margin-left: 1px;
}

/* 输入框区域 */
.chat-widget .chat-footer {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    /* gap: 6px;*/
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

.chat-widget .header-buttons textarea {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    outline: none;
    resize: none;
    height: 60px;
    margin-right: 10px;
    overflow: hidden;
}


/* 输入框和发送按钮 */
.chat-widget .header-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-widget .footer-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 5px;
}

.chat-widget .footer-buttons button {
    background-color: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.chat-widget .auto-keywords {
    list-style: none; /* 移除默认的列表样式 */
    padding: 0; /* 清除内边距 */
}

.chat-widget .keywords-message-tips {
    font-size: 12px;
    margin-bottom: 10px;
    color: #888 !important;
}

.chat-widget .auto-keywords li {
    position: relative; /* 使伪元素相对定位 */
    padding-left: 10px; /* 给li留出空间放圆点 */
    margin-bottom: 6px; /* 每个li之间的间距 */
    color: #007bff; /* 字体颜色 */
    cursor: pointer;
    user-select: none;
    font-size: 13px;
}

.chat-widget .auto-keywords li:last-child {
    margin-bottom: 0 !important;
}

.chat-widget .auto-keywords li::before {
    content: ''; /* 创建伪元素 */
    position: absolute; /* 绝对定位 */
    left: 0; /* 位置在左边 */
    top: 55%; /* 垂直居中 */
    transform: translateY(-50%); /* 精确垂直居中 */
    width: 4px; /* 圆点宽度 */
    height: 4px; /* 圆点高度 */
    background-color: #007bff; /* 圆点颜色 */
    border-radius: 50%; /* 圆形 */
}

/* 发送按钮 */
.chat-widget .send-button {
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    position: absolute;
    right: -15px;
    bottom: 42px;
}


/* 表情选择器样式 */
.chat-widget .emoji-picker {
    position: absolute;
    bottom: 107px;
    right: 0;
    background-color: white;
    border: 1px solid #e0e0e0;
    padding: 10px;
    display: none;
    border-radius: 10px 10px 0 0;
}

/* 标签按钮 */
.chat-widget .emoji-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
    gap: 2px;
}

.chat-widget .tab-button {
    background-color: #f1f1f1;
    border: none;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
}

.chat-widget .tab-button:hover {
    background-color: #e0e0e0;
}

.chat-widget .tab-button.active {
    background-color: #d1e7ff;
}

/* 表情分类的内容 */
.chat-widget .emoji-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    height: 200px;
    overflow: auto;
}


/* 滚动条宽度 */
.chat-widget .emoji-content::-webkit-scrollbar {
    width: 8px; /* 滚动条的宽度 */
}

/* 滚动条轨道 */
.chat-widget .emoji-content::-webkit-scrollbar-track {
    background-color: #f1f1f1; /* 滚动条轨道背景颜色 */
    border-radius: 10px; /* 轨道圆角 */
}

/* 滚动条滑块 */
.chat-widget .emoji-content::-webkit-scrollbar-thumb {
    background-color: #007BFF; /* 滑块颜色 */
    border-radius: 10px; /* 滑块圆角 */
    border: 2px solid #f1f1f1; /* 滑块边框与轨道区分 */
}

/* 滚动条滑块在 hover 时的颜色 */
.chat-widget .emoji-content::-webkit-scrollbar-thumb:hover {
    background-color: #0056b3; /* 滑块在悬浮时变为深色 */
}

/* 支持 Firefox 的滚动条样式 */
.chat-widget .emoji-content {
    scrollbar-width: thin; /* 设置滚动条宽度为细条 */
    scrollbar-color: #007BFF #f1f1f1; /* 滚动条颜色和轨道颜色 */
}

.chat-widget .emoji-content span {
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
    display: inline-block;
}

/* 正在输入指示 */
.chat-widget .typing-indicator {
    font-size: 12px;
    color: #555;
    padding: 5px 5px 5px 10px;
    background-color: white;
}
