﻿#chat {
    position: fixed;
    bottom: 0px;
    right: 0px;
    left: 0px;
    z-index: 99999;
}

.chat-room {
    height: 400px;
    border: 1px solid #ccc;
    border-bottom: none;
    border-top-right-radius: 5px;
    border-top-left-radius: 5px;
    background-color: #FFF;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    position: fixed;
    bottom: 0px;
    font-size: 14px;
    transition: all ease .3s;
}

    .chat-room .chat-head {
        position: absolute;
        border-bottom: solid 1px #ccc;
        right: 0px;
        top: 0px;
        left: 0px;
        cursor: pointer;
        padding: 0px;
    }

    .chat-room .chat-title {
        margin-right: 20px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        height: 30px;
        line-height: 30px;
        margin: 10px 8px;
    }

    .chat-room .chat-close {
        position: absolute;
        display: block;
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        right: 0px;
        top: 10px;
        cursor: pointer;
        font-size: 14px;
    }

    .chat-room .chat-body {
        position: absolute;
        overflow-y: auto;
        top: 0px;
        right: 0px;
        left: 0px;
        top: 50px;
        bottom: 60px;
        padding: 10px 8px;
    }

        .chat-room .chat-body p {
            margin: 0px;
        }

        .chat-room .chat-body .flex {
            display: flex;
            align-items: flex-end;
        }

        .chat-room .chat-body .send .flex {
            flex-direction: row-reverse;
        }

        .chat-room .chat-body .msg {
            border-radius: 3px;
            padding: 5px 10px;
            margin: 5px 10px;
            max-width: 180px;
            word-break: break-all;
        }

            .chat-room .chat-body .msg:before {
                content: "";
                width: 0px;
                height: 0px;
                border: 10px solid;
                position: absolute;
            }

        .chat-room .chat-body .system {
            text-align: center;
            margin: 10px 0;
        }

            .chat-room .chat-body .system span {
                background-color: #eee;
                color: #6a6c6f;
                border-radius: 10px;
                padding: 0 10px;
                font-size: 12px;
            }

        .chat-room .chat-body .state {
            margin: 5px 0px;
            font-size: 12px;
        }

        .chat-room .chat-body .del {
            height: 16px;
            background-color: #eee;
            text-align: center;
            line-height: 10px;
            display: none;
            border-radius: 8px;
            line-height: 16px;
            cursor: pointer;
        }

        .chat-room .chat-body .read {
            white-space: nowrap;
            line-height: 16px;
        }

            .chat-room .chat-body .read.readed::after {
                content: '已讀';
            }

        .chat-room .chat-body .send .state {
            text-align: right;
        }

        .chat-room .chat-body .receive .msg {
            background-color: #ccc;
        }

            .chat-room .chat-body .receive .msg:before {
                border-color: transparent #ccc transparent transparent;
                left: 0px;
            }

        .chat-room .chat-body .send .msg {
            background-color: #99CCFF;
        }

            .chat-room .chat-body .send .msg:before {
                border-color: transparent transparent transparent #99CCFF;
                right: 0px;
            }

        .chat-room .chat-body .send:hover .del {
            display: block;
        }

        .chat-room .chat-body .send:hover .read {
            display: none;
        }

    .chat-room .chat-footer {
        border-top: solid 1px #ccc;
        position: absolute;
        bottom: 0px;
        right: 0px;
        left: 0px;
        overflow-y: auto;
        background-color: #fff;
        padding: 0px;
    }

    .chat-room .chat-sender {
        margin: 10px 8px;
        height: 40px;
    }

    /*收合*/
    .chat-room.fold {
        bottom: -360px;
    }

        .chat-room.fold .chat-title {
            margin: 5px 8px;
        }

        .chat-room.fold .chat-close {
            top: 5px;
        }

    /*提醒*/
    .chat-room.chat-alert .chat-head {
        animation: chat-alert 3s infinite;
    }

@keyframes chat-alert {
    0%, 50%, 100% {
        background-color: transparent;
    }

    25%, 75% {
        background-color: #ddd;
    }
}
