/* 侧边栏客服组件样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 侧边栏样式 */
.service-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

/* 主菜单样式 */
.sidebar-main {
    background: #1890ff;
    color: white;
    border-radius: 4px 0 0 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle {
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle i {
    font-size: 24px;
    margin-bottom: 5px;
}

.toggle-text {
    font-size: 12px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* 展开菜单样式 */
.sidebar-expanded {
    width: 0;
    overflow: hidden;
    background: white;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
}

.sidebar-expanded.active {
    width: 200px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 16px;
    color: #333;
}

.close-btn {
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.service-options {
    padding: 10px 0;
}

.service-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.service-item:hover {
    background: #f5f5f5;
}

.service-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: white;
}

.service-item:nth-child(1) .service-icon {
    background: #12b7f5;
}

.service-item:nth-child(2) .service-icon {
    background: #07c160;
}

.service-item:nth-child(3) .service-icon {
    background: #07c160;
}

.service-item:nth-child(4) .service-icon {
    background: #ff6b35;
}

.service-text {
    font-size: 14px;
    color: #333;
}

/* 服务面板样式 */
.service-panels {
    position: absolute;
    right: 100%;
    top: 0;
    width: 0;
    overflow: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
}

.service-panel {
    width: 300px;
    padding: 0;
    display: none;
}

.service-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.panel-header h4 {
    font-size: 16px;
    color: #333;
}

.back-btn {
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #333;
}

.panel-content {
    padding: 20px;
}

.qq-list {
    margin-top: 15px;
}

.qq-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.qq-item:last-child {
    border-bottom: none;
}

.qq-item a {
    display: flex;
    align-items: center;
    color: #12b7f5;
    text-decoration: none;
    font-weight: 500;
}

.qq-item a i {
    margin-right: 5px;
}

.qq-item a:hover {
    color: #0d9cd8;
}

.qr-code {
    text-align: center;
    margin: 15px 0;
}

.qr-code img {
    max-width: 180px;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.qr-tip {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* 聊天窗口样式 */
.chat-window {
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
    max-height: 240px;
}

.message {
    display: flex;
    margin-bottom: 15px;
}

.bot-message {
    align-items: flex-start;
}

.user-message {
    align-items: flex-end;
    justify-content: flex-end;
}

.bot-message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 10px;
    flex-shrink: 0;
}

.message-content {
    max-width: 80%;
}

.message-content p {
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.user-message .message-content p {
    background: #1890ff;
    color: white;
}

.chat-input {
    display: flex;
    margin-top: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 14px;
}

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

.send-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #0d7ae6;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .service-panel {
        width: 280px;
    }
    
    .sidebar-expanded.active {
        width: 180px;
    }
    
    .service-sidebar {
        transform: translateY(-50%) scale(0.9);
        transform-origin: right center;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 浮动动画 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}



/* QQ面板样式优化 */
.qq-options {
    display: flex;
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.qq-option {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.qq-option.active {
    background: #1890ff;
    color: white;
}

.qq-option:not(.active):hover {
    background: #f0f0f0;
}

.qq-mode {
    display: none;
}

.qq-mode.active {
    display: block;
}

.warning-tip {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    color: #d48806;
    margin-bottom: 15px;
}

.warning-tip i {
    margin-right: 5px;
}

.qq-tips {
    margin-top: 20px;
    padding: 15px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    font-size: 12px;
}

.qq-tips ul {
    margin: 8px 0 0 15px;
    padding: 0;
}

.qq-tips li {
    margin-bottom: 4px;
}
.sidebar-main:hover {
    animation: float 2s ease-in-out infinite;
}