/* 在线客服系统 - 通用样式 */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #303133;
    background: #f5f7fa;
    -webkit-font-smoothing: antialiased;
}
a { color: #2c6ef4; text-decoration: none; }
.clear { clear: both; }

/* 图片 / 表情 / 附件 */
.chatContent img.chatImg {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 6px;
    margin: 4px 0;
    cursor: zoom-in;
}
.chatContent img.chatFace {
    width: 24px;
    height: 24px;
    vertical-align: -6px;
    margin: 0 1px;
}
.chatContent .chatAttachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}
.chatNoticeLine {
    text-align: center;
    color: #bbb;
    font-size: 12px;
    padding: 6px 0;
}

/* ============ 访客聊天窗口 ============ */
.visitorBody { background: #f5f7fa; overflow: hidden; }
#app.chatCenter {
    position: relative;
    height: 100%;
    max-width: 1120px;
    margin: 0 auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(20, 40, 90, .10);
}
.chatEntTitle {
    flex-shrink: 0;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid #f0f1f4;
    background: #fff;
}
.chatEntTitleLogo { background: #eef3ff; }
.chatEntTitle .el-badge__content.is-dot {
    right: 4px;
    top: 2px;
    border: 2px solid #fff;
}
.kefuStatusDot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    background: #bbb;
}
.kefuStatusDot.online { background: #52c41a; }
.kefuStatusDot.offline { background: #bbb; }

.chatEntBox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chatContext { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chatVisitorPage {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f7f8fa;
}
.chatVisitorPage .chatBox { width: 100%; }
.chatVisitorPage .el-row { margin-bottom: 14px; }

.chatTime { text-align: center; color: #bbb; font-size: 12px; margin: 4px 0 8px; }
.chatTimeHide { display: none; }

.chatVisitorPage .chatMsgContent { max-width: calc(100% - 56px); }
.chatVisitorPage .chatContent {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #ededed;
    color: #333;
    font-size: 14px;
    line-height: 1.65;
    text-align: left;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
}
.chatVisitorPage .kefuMe .chatContent,
.chatVisitorPage .chatBoxMe .chatContent {
    background: #2c6ef4;
    border-color: #2c6ef4;
    color: #fff;
}
.chatVisitorPage .chatContent a { color: inherit; }
.chatVisitorPage .chatContent img.chatImg { border: 0; }

.chatBoxSend {
    flex-shrink: 0;
    position: relative;
    padding: 8px 16px 14px;
    border-top: 1px solid #f0f1f4;
    background: #fff;
}
.visitorIconBox { display: flex; align-items: center; height: 32px; }
.iconBtn { color: #8a8f99; cursor: pointer; padding: 3px 7px; }
.iconBtn:hover { color: #2c6ef4; }
.visitorEditorArea { margin-top: 2px; }
.visitorEditorArea .el-textarea__inner {
    border: none;
    box-shadow: none;
    padding: 6px 2px;
    font-size: 14px;
    background: transparent;
}
.visitorEditorArea .el-input__count { background: transparent; right: 4px; }
.visitorEditorBtn {
    position: absolute;
    right: 18px;
    bottom: 16px;
    border-radius: 18px;
    padding: 9px 22px;
    background: #2c6ef4;
    border-color: #2c6ef4;
}
.visitorEditorBtn.is-disabled {
    background: #b9c9ee;
    border-color: #b9c9ee;
}

.chatArticle {
    position: absolute;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 256px;
    flex-shrink: 0;
    padding: 18px;
    border-left: 1px solid #f0f1f4;
    background: #fff;
    overflow-y: auto;
}
#app.chatCenter.hasArticle .chatEntBox { margin-right: 256px; }
.hotQuestionTitle { font-size: 15px; margin: 0 0 12px; color: #303133; }
.allNotice { font-size: 13px; color: #666; line-height: 1.85; word-break: break-word; }
.allNotice img { max-width: 100%; }

/* 表情面板 */
.faceBox {
    position: absolute;
    left: 12px;
    bottom: 158px;
    width: 324px;
    max-width: calc(100% - 24px);
    max-height: 218px;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid #ebeef5;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
    z-index: 30;
}
.faceBoxList { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.faceIcon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
}
.faceIcon:hover { background: #eef3ff; }
.faceIcon img { width: 24px; height: 24px; }

/* ============ 客服后台聊天 ============ */
.chatMainPage { height: 100%; }
.chatMainPage > .el-row { height: 100%; }
.chatMainPage > .el-row > .el-col { height: 100%; }
.chatLeft {
    height: 100%;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #ebeef5;
}
.chatLeft .el-tabs__header { margin: 0; padding: 0 8px; }
.chatLeft .el-tabs__content { padding: 6px 0; }
.onlineUsers {
    display: flex;
    align-items: center;
    padding: 9px 8px;
    border-bottom: 1px solid #f7f7f7;
    transition: background .15s;
}
.onlineUsers:hover { background: #f7f9ff; }
.onlineUsers.cur { background: #eef3ff; }
.onlineUsers .el-col { overflow: hidden; }
.lastNewMsg {
    height: 20px;
    line-height: 20px;
    color: #a0a4ab;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.imgGray { filter: grayscale(1); opacity: .7; }

.chatBgContext {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f7f8fa;
}
.chatBgContext .el-alert { flex-shrink: 0; border-radius: 0; }
.kefuFuncBtns {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #f0f1f4;
}
.chatMainPage .chatBox {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 18px;
}
.chatMainPage .chatBox > .el-row { margin-bottom: 8px; }
.chatMainPage .chatRow { display: flex; gap: 9px; align-items: flex-start; }
.chatMainPage .chatRowAvator { flex-shrink: 0; }
.chatMainPage .chatMsgContent { max-width: calc(100% - 60px); }
.chatMainPage .chatUser { line-height: 20px; font-size: 12px; color: #999; margin-bottom: 3px; }
.chatMainPage .chatContent {
    display: inline-block;
    padding: 9px 13px;
    border-radius: 9px;
    background: #fff;
    border: 1px solid #ededed;
    font-size: 14px;
    line-height: 1.65;
    text-align: left;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}
.chatMainPage .chatBoxMe .chatRow { flex-direction: row-reverse; }
.chatMainPage .chatBoxMe .chatMsgContent { text-align: right; }
.chatMainPage .chatBoxMe .chatUser { text-align: right; }
.chatMainPage .chatBoxMe .chatContent {
    background: #2c6ef4;
    border-color: #2c6ef4;
    color: #fff;
}
.chatMainPage .chatContentRow { display: flex; align-items: flex-end; justify-content: flex-start; }
.chatMainPage .chatBoxMe .chatContentRow { justify-content: flex-end; }
.chatMainPage .chatContentRow .read-icon { flex: 0 0 auto; margin: 0 0 4px 6px; font-size: 12px; color: #aaa; }
.chatMainPage .chatContentRow .read-icon.read { color: #409EFF; }
.systemMsg { text-align: center; margin: 10px 0; }
.systemMsg span {
    background: #eceef2;
    color: #8a8f99;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 10px;
    display: inline-block;
}

.kefuFuncBox {
    flex-shrink: 0;
    position: relative;
    padding: 8px 14px 14px;
    border-top: 1px solid #ebeef5;
    background: #fff;
}
.iconBtnsBox { position: relative; display: flex; align-items: center; height: 32px; }
.kefuFaceBox { left: 0; bottom: 40px; }
.kefuSendBtn { float: right; margin: 9px 0 0 12px; border-radius: 16px; padding: 9px 22px; }
.chatArea .el-textarea__inner {
    border: none;
    box-shadow: none;
    background: transparent;
    font-size: 14px;
    padding: 6px 2px;
}

.chatRight {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #ebeef5;
    overflow: hidden;
}
.chatRight .chatBg { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px; }
.chatRight .el-tabs__header { margin-bottom: 4px; }
.chatRight .visitorInfo { border-right: 0; }
.chatRight .visitorInfo .el-menu-item { height: 38px; line-height: 38px; font-size: 13px; }
.replyBox {
    flex-shrink: 0;
    height: 44%;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #ebeef5;
    padding: 8px 10px;
    overflow: hidden;
}
.chatRightTitle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #606266;
    padding: 2px 2px 4px;
}
.replyBox .el-tabs { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.replyBox .el-tabs__content { flex: 1; min-height: 0; overflow-y: auto; }
.replySearch { margin-bottom: 6px; }
.replyContent { font-size: 13px; }
.replyItem {
    padding: 6px 8px;
    border-radius: 5px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    word-break: break-all;
}
.replyItem:hover { background: #f5f8ff; }
.replyItemTitle { font-size: 13px; color: #444; }

.imgLibBox { padding: 2px; max-height: 300px; overflow-y: auto; }
.imgLibItem {
    display: inline-block;
    width: 58px;
    height: 58px;
    margin: 3px;
    border: 1px solid #eee;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
    vertical-align: middle;
}
.imgLibItem img { width: 100%; height: 100%; object-fit: cover; }
.imgLibItem:hover { border-color: #409EFF; }
.imgLibUploadBtn {
    display: inline-block;
    width: 58px;
    height: 58px;
    margin: 3px;
    border: 1px dashed #ccc;
    border-radius: 5px;
    text-align: center;
    line-height: 58px;
    cursor: pointer;
    color: #999;
    font-size: 22px;
    vertical-align: middle;
}
.imgLibUploadBtn:hover { border-color: #409EFF; color: #409EFF; }

.ctxMenu {
    position: fixed;
    background: #fff;
    border: 1px solid #e4e7ed;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
    border-radius: 5px;
    font-size: 13px;
    z-index: 9999;
    padding: 4px 0;
    min-width: 108px;
}
.ctxMenu div { padding: 7px 14px; cursor: pointer; color: #333; }
.ctxMenu div:hover { background: #f5f7fa; }

@keyframes msgFlash {
    0% { background-color: #fff3cd; }
    50% { background-color: #ffeaa7; }
    100% { background-color: #fff3cd; }
}
.userFlash { animation: msgFlash 1s infinite; }
.top-badge { color: #E6A23C; margin-right: 4px; font-weight: bold; }
.device-tag { margin-left: 6px; color: #409EFF; font-weight: normal; font-size: 12px; }
.offline-tag { margin-left: 4px; color: #bbb; font-size: 11px; }
.remark-line { display: flex; align-items: center; }
.remark-line .el-input { margin-left: 6px; }

/* ============ 后台主框架 ============ */
.text-center { text-align: center; }
.mainLeftMenu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 96px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    background: #fff;
    border-right: 1px solid #e6e6e6;
}
.mainLeftMenu .mainLogo { background: #eef3ff; }
.menuLeftItem {
    width: 76px;
    margin-bottom: 6px;
    padding: 11px 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}
.menuLeftItem i { font-size: 20px; }
.menuLeftItem:hover { background: #f5f8ff; color: #2c6ef4; }
.menuLeftItem.active { background: #eef3ff; color: #2c6ef4; }
.menuLeftItemLogout { margin-top: auto; margin-bottom: 16px; }
.mainRight { margin-left: 96px; height: 100vh; }
.mainIframe { width: 100%; height: 100%; border: 0; display: block; }

/* 后台内容通用 */
.profile-form {
    max-width: 880px;
    margin: 20px auto;
    padding: 26px 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}
.form-title {
    font-size: 18px;
    color: #303133;
    margin: 0 0 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ebeef5;
}

/* 登录页 */
.loginPage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 15% 20%, #e7f0ff 0, transparent 45%),
                radial-gradient(circle at 85% 80%, #e8f7ff 0, transparent 45%),
                #f4f7fc;
}
.loginCard {
    width: 100%;
    max-width: 410px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(30, 60, 120, .13);
    padding: 38px 36px 34px;
}
.loginLogo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c6ef4, #64a2ff);
    color: #fff;
    font-size: 28px;
}
.loginTitle { font-size: 21px; font-weight: 700; color: #1f2d3d; text-align: center; }
.loginSub { font-size: 13px; color: #9aa3af; text-align: center; margin: 8px 0 26px; }
.loginCard .el-input__inner { height: 44px; line-height: 44px; }
.loginBtn { width: 100%; height: 44px; border-radius: 22px; font-size: 15px; margin-top: 6px; }
.loginTip { margin-top: 18px; font-size: 12px; color: #a8afb8; text-align: center; line-height: 1.7; }

.bigPic {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
.bigPic img { max-width: 90vw; max-height: 90vh; object-fit: contain; box-shadow: 0 4px 20px rgba(0, 0, 0, .5); }
.bigPic.show { display: flex; }

/* 访客移动端公告 */
.mobile-notice-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mobile-notice-box { background: #fff; border-radius: 12px; width: 100%; max-width: 380px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.mobile-notice-header { padding: 18px 16px 10px; font-size: 17px; font-weight: bold; color: #333; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0f0f0; }
.mobile-notice-header .close { color: #999; font-size: 20px; cursor: pointer; line-height: 1; }
.mobile-notice-body { padding: 20px 18px; font-size: 15px; color: #333; line-height: 1.6; max-height: 50vh; overflow-y: auto; word-break: break-all; }
.mobile-notice-footer { padding: 12px 16px 18px; }
.mobile-notice-btn { width: 100%; background: #2c6ef4; color: #fff; border: none; border-radius: 24px; padding: 13px 0; font-size: 16px; cursor: pointer; }
.mobile-notice-btn:active { background: #2258cc; }

@media (max-width: 760px) {
    #app.chatCenter { max-width: none; box-shadow: none; }
    .chatArticle { display: none; }
    #app.chatCenter.hasArticle .chatEntBox { margin-right: 0; }
    .chatVisitorPage { padding: 12px 14px; }
    .faceBox { width: calc(100% - 24px); }
    .loginCard { padding: 30px 24px; }
}
