/* 【客服留言-DEMO】临时功能，删除时移除本文件及 index.html 中对本文件的引用。 */

/* ===== 右下角浮动按钮 ===== */
.chat-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #1677ff;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(22, 119, 255, 0.4);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.5);
}

/* ===== 弹出面板（向左上展开） ===== */
.chat-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    width: 320px;
    max-height: 460px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(15, 34, 67, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.chat-panel.hidden {
    display: none;
}

/* 面板标题栏 */
.chat-header {
    background-color: #1677ff;
    color: #fff;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

/* 留言列表区（可滚动） */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background-color: #f5f7fa;
    min-height: 80px;
    max-height: 180px;
}

.chat-msg {
    background-color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #333;
    box-shadow: 0 1px 4px rgba(15, 34, 67, 0.05);
    word-break: break-all;
}

/* 访客自己发的留言：靠右、蓝色气泡 */
.chat-msg.visitor {
    background-color: #1677ff;
    color: #fff;
    margin-left: 32px;
}

/* 客服回复：靠左、白底灰边气泡 */
.chat-msg.admin {
    background-color: #fff;
    border: 1px solid #e8e8e8;
    margin-right: 32px;
}

.chat-msg.admin .chat-msg-time {
    color: #bbb;
}

.chat-msg.visitor .chat-msg-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-msg-name {
    font-size: 11px;
    color: #1677ff;
    margin-bottom: 2px;
}

.chat-msg-time {
    color: #999;
    font-size: 11px;
    margin-top: 4px;
}

.chat-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* 输入区 */
.chat-form {
    padding: 12px 16px;
    border-top: 1px solid #e8e8e8;
    background-color: #fff;
}

.chat-name-input {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
    box-sizing: border-box;
}

.chat-name-input:focus {
    border-color: #1677ff;
}

.chat-textarea {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: none;
    height: 120px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.chat-textarea:focus {
    border-color: #1677ff;
}

.chat-form-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.chat-count {
    font-size: 11px;
    color: #999;
}

.chat-send-btn {
    background-color: #1677ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-send-btn:hover {
    background-color: #0958d9;
}

.chat-send-btn:disabled {
    background-color: #a0c4ff;
    cursor: not-allowed;
}

.chat-tip {
    color: #f5222d;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}