/* 在线客服 - 前台页面（直接展示，无浮动按钮） */
* { box-sizing: border-box; }
.kefu-chat-body {
    margin: 0;
    min-height: 100vh;
    font: 14px/1.6 "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(160deg, #f0f4f8 0%, #e2e8f0 100%);
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kefu-box {
    width: 100%;
    max-width: 720px;
    height: 85vh;
    min-height: 480px;
    max-height: 780px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kefu-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.kefu-icon-headset {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M3 18v-6a9 9 0 0 1 18 0v6'/%3E%3Cpath d='M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z'/%3E%3C/svg%3E") center/contain no-repeat;
    vertical-align: middle;
}
.kefu-header-title { font-size: 18px; font-weight: 600; }
.kefu-header-tip { font-size: 12px; opacity: .9; }

.kefu-msg-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.kefu-msg-welcome {
    text-align: center;
    color: #94a3b8;
    padding: 24px;
    font-size: 14px;
}
.kefu-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
}
.kefu-msg.visitor { align-self: flex-end; flex-direction: row-reverse; }
.kefu-msg.admin { align-self: flex-start; }
.kefu-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.kefu-msg.visitor .kefu-msg-avatar { background: #0ea5e9; }
.kefu-msg-main { min-width: 0; }
.kefu-msg-name {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}
.kefu-msg.visitor .kefu-msg-name { text-align: right; }
.kefu-msg-bubble {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    word-break: break-word;
    line-height: 1.5;
    font-size: 14px;
}
.kefu-msg.admin .kefu-msg-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px 12px 12px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kefu-msg.visitor .kefu-msg-bubble {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border-radius: 12px 4px 12px 12px;
}
.kefu-msg-time { font-size: 11px; color: #94a3b8; display: block; margin-top: 4px; }
.kefu-msg.visitor .kefu-msg-time { text-align: right; }
.kefu-msg-img { max-width: 220px; border-radius: 8px; display: block; }

.kefu-toolbar {
    padding: 8px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.kefu-tool-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.kefu-tool-btn:hover { border-color: #0ea5e9; color: #0ea5e9; background: #f0f9ff; }
.kefu-upload-btn { margin: 0; cursor: pointer; position: relative; align-self: center; }
.kefu-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.kefu-emoji-panel {
    display: none;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    max-height: 160px;
    overflow-y: auto;
    flex-shrink: 0;
}
.kefu-emoji-panel.open { display: block; }
.kefu-emoji-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.kefu-emoji-item {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s;
}
.kefu-emoji-item:hover { background: #e2e8f0; }

.kefu-input-wrap {
    padding: 12px 16px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.kefu-input-wrap .kefu-input-btns { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.kefu-input-wrap textarea {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    resize: none;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color .2s;
}
.kefu-input-wrap textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.kefu-btn-send {
    padding: 12px 24px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .2s;
    flex-shrink: 0;
}
.kefu-btn-send:hover { opacity: .92; }
.kefu-btn-send:active { opacity: .85; }

@media (max-width: 640px) {
    .kefu-chat-body { padding: 12px; align-items: flex-start; }
    .kefu-box { max-width: none; height: calc(100vh - 24px); min-height: 400px; border-radius: 12px; }
    .kefu-msg { max-width: 92%; }
}
