/**

 * 客服插件 - 悬浮窗样式

 * 从 Plugin.php 分离，支持独立缓存

 * 版本: 1.1.0

 */



.ffcx-chat-widget {

    position: fixed;

    bottom: 20px;

    right: 20px;

    z-index: 99998;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

}

.ffcx-chat-widget.ffcx-chat-left {

    left: 20px;

    right: auto;

}

.ffcx-chat-btn {

    width: 56px;

    height: 56px;

    border-radius: 50%;

    background: var(--chat-btn-color, #4f46e5);

    color: #fff;

    border: none;

    cursor: pointer;

    box-shadow: 0 4px 16px rgba(0,0,0,0.2);

    display: flex;

    align-items: center;

    justify-content: center;

    transition: transform 0.2s, box-shadow 0.2s;

    position: relative;

    z-index: 2;

}

.ffcx-chat-btn:hover {

    transform: scale(1.08);

    box-shadow: 0 6px 24px rgba(0,0,0,0.25);

}

.ffcx-chat-badge {

    position: absolute;

    top: -4px;

    right: -4px;

    background: #ef4444;

    color: #fff;

    font-size: 11px;

    font-weight: 700;

    min-width: 20px;

    height: 20px;

    border-radius: 10px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0 5px;

    z-index: 3;

    box-shadow: 0 2px 6px rgba(239,68,68,0.4);

}

.ffcx-chat-window {

    position: absolute;

    bottom: 68px;

    right: 0;

    width: 360px;

    max-width: calc(100vw - 40px);

    height: 480px;

    max-height: calc(100vh - 120px);

    background: #fff;

    border-radius: 16px;

    box-shadow: 0 12px 48px rgba(0,0,0,0.18);

    display: flex;

    flex-direction: column;

    overflow: hidden;

    z-index: 1;

    animation: ffcxChatSlideUp 0.25s ease;

}

.ffcx-chat-widget.ffcx-chat-left .ffcx-chat-window {

    right: auto;

    left: 0;

}

@keyframes ffcxChatSlideUp {

    from { opacity: 0; transform: translateY(16px); }

    to { opacity: 1; transform: translateY(0); }

}

.ffcx-chat-header {

    background: var(--chat-btn-color, #4f46e5);

    color: #fff;

    padding: 14px 16px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    flex-shrink: 0;

}

.ffcx-chat-header-title {

    font-weight: 700;

    font-size: 15px;

}

.ffcx-chat-header-actions {

    display: flex;

    gap: 8px;

}

.ffcx-chat-header-actions button {

    background: rgba(255,255,255,0.2);

    border: none;

    color: #fff;

    width: 28px;

    height: 28px;

    border-radius: 50%;

    cursor: pointer;

    font-size: 14px;

    display: flex;

    align-items: center;

    justify-content: center;

    transition: background 0.2s;

}

.ffcx-chat-header-actions button:hover {

    background: rgba(255,255,255,0.35);

}

.ffcx-chat-body {

    flex: 1;

    overflow-y: auto;

    padding: 16px;

    background: #f8fafc;

    display: flex;

    flex-direction: column;

}

.ffcx-chat-welcome {

    text-align: center;

    padding: 24px 0;

    color: #64748b;

}

.ffcx-chat-welcome-icon {

    font-size: 40px;

    margin-bottom: 8px;

}

.ffcx-chat-welcome p {

    font-size: 13px;

    line-height: 1.6;

}

.ffcx-chat-messages {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 10px;

}

.ffcx-chat-msg {

    max-width: 80%;

    padding: 10px 14px;

    border-radius: 14px;

    font-size: 13px;

    line-height: 1.55;

    word-break: break-word;

    animation: ffcxMsgIn 0.2s ease;

}

@keyframes ffcxMsgIn {

    from { opacity: 0; transform: translateY(8px); }

    to { opacity: 1; transform: translateY(0); }

}

.ffcx-chat-msg.visitor {

    align-self: flex-end;

    background: var(--chat-btn-color, #4f46e5);

    color: #fff;

    border-bottom-right-radius: 4px;

}

.ffcx-chat-msg.admin {

    align-self: flex-start;

    background: #fff;

    color: #1e293b;

    border: 1px solid #e2e8f0;

    border-bottom-left-radius: 4px;

}

.ffcx-chat-msg .ffcx-chat-time {

    font-size: 10px;

    opacity: 0.65;

    margin-top: 4px;

    text-align: right;

}

.ffcx-chat-msg.admin .ffcx-chat-time {

    color: #94a3b8;

}



/* 图片消息样式 */

.ffcx-chat-msg .ffcx-chat-img {

    max-width: 200px;

    max-height: 200px;

    border-radius: 8px;

    cursor: pointer;

    transition: transform 0.2s;

}

.ffcx-chat-msg .ffcx-chat-img:hover {

    transform: scale(1.05);

}



/* 评价按钮样式 */

.ffcx-chat-rate {

    display: flex;

    gap: 6px;

    padding: 8px 0;

    justify-content: center;

}

.ffcx-chat-rate button {

    font-size: 22px;

    background: none;

    border: none;

    cursor: pointer;

    transition: transform 0.15s;

    opacity: 0.5;

}

.ffcx-chat-rate button:hover,

.ffcx-chat-rate button.active {

    transform: scale(1.2);

    opacity: 1;

}



/* 上传按钮 */

.ffcx-chat-upload-btn {

    width: 36px;

    height: 36px;

    border-radius: 50%;

    background: #f1f5f9;

    color: #64748b;

    border: 1px solid #e2e8f0;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    transition: background 0.2s;

}

.ffcx-chat-upload-btn:hover {

    background: #e2e8f0;

}

.ffcx-chat-footer {

    display: flex;

    align-items: flex-end;

    gap: 8px;

    padding: 10px 12px;

    border-top: 1px solid #e2e8f0;

    background: #fff;

    flex-shrink: 0;

}

.ffcx-chat-input {

    flex: 1;

    border: 1px solid #e2e8f0;

    border-radius: 10px;

    padding: 10px 14px;

    font-size: 13px;

    resize: none;

    outline: none;

    max-height: 80px;

    font-family: inherit;

    line-height: 1.5;

    transition: border-color 0.2s;

}

.ffcx-chat-input:focus {

    border-color: var(--chat-btn-color, #4f46e5);

    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);

}

.ffcx-chat-send {

    width: 38px;

    height: 38px;

    border-radius: 50%;

    background: var(--chat-btn-color, #4f46e5);

    color: #fff;

    border: none;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    transition: opacity 0.2s;

}

.ffcx-chat-send:hover {

    opacity: 0.85;

}

.ffcx-chat-send:disabled {

    opacity: 0.4;

    cursor: not-allowed;

}



/* 离线留言表单 */

.ffcx-chat-offline {

    padding: 20px 16px;

    text-align: center;

}

.ffcx-chat-offline p {

    font-size: 13px;

    color: #64748b;

    margin-bottom: 12px;

}

.ffcx-chat-offline input,

.ffcx-chat-offline textarea {

    width: 100%;

    border: 1px solid #e2e8f0;

    border-radius: 8px;

    padding: 8px 12px;

    font-size: 13px;

    margin-bottom: 8px;

    font-family: inherit;

    resize: vertical;

}

.ffcx-chat-offline button {

    padding: 8px 24px;

    background: var(--chat-btn-color, #4f46e5);

    color: #fff;

    border: none;

    border-radius: 8px;

    cursor: pointer;

    font-size: 13px;

    font-weight: 600;

}



@media (max-width: 480px) {

    .ffcx-chat-window {

        width: calc(100vw - 20px);

        right: 10px;

        height: 420px;

        bottom: 64px;

        border-radius: 14px;

    }

    .ffcx-chat-widget.ffcx-chat-left .ffcx-chat-window {

        right: auto;

        left: 10px;

    }

}

