/* 聊天侧边栏 */
.chat-sidebar {
    position: fixed;
    top: 0;
    right: -350px; /* 默认隐藏 */
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid #e1e8ed;
}

.chat-sidebar.active {
    right: 0;
}

/* 聊天触发按钮 */
.chat-trigger {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(102,126,234,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    z-index: 1100;
    transition: box-shadow 0.2s, background 0.2s;
    opacity: 0.92;
}
.chat-trigger:hover {
    box-shadow: 0 8px 32px rgba(102,126,234,0.28);
    opacity: 1;
}
/* 移除原有的文字样式 */
.chat-trigger span { display: none; }

/* 聊天头部 */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.chat-title i {
    font-size: 18px;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.chat-action-btn i {
    font-size: 14px;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.bot-message {
    flex-direction: row;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bot-message .message-avatar {
    background: #e9ecef;
    color: #6c757d;
}

.message-avatar i {
    font-size: 16px;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 60px);
}

.message-text {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-message .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.bot-message .message-text {
    background: white;
    color: #333;
    border: 1px solid #e1e8ed;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

/* 聊天输入区域 */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e8ed;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid #e1e8ed;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
    color: #6c757d;
}

/* 发送按钮 */
.chat-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-send-btn i {
    font-size: 16px;
}

/* 加载动画 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: 60px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 广告控制按钮 */
.ad-trigger {
    position: fixed;
    top: 65%;
    right: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(255,107,107,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 1100;
    transition: box-shadow 0.2s, background 0.2s;
    opacity: 0.92;
}

.ad-trigger:hover {
    box-shadow: 0 8px 32px rgba(255,107,107,0.28);
    opacity: 1;
}

.ad-trigger.active {
    background: linear-gradient(135deg, #ff4757 0%, #c44569 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .chat-trigger {
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
        border-radius: 50%;
        width: 60px;
        height: 60px;
        padding: 0;
        min-width: auto;
    }
    
    .chat-trigger:hover {
        transform: scale(1.1);
    }
    
    .chat-trigger span {
        display: none;
    }
    
    .chat-trigger i {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 15px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-area {
        padding: 15px;
    }
    
    .message-text {
        font-size: 13px;
        padding: 10px 14px;
    }
} 

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
    .chat-trigger {
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .ad-trigger {
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .chat-sidebar {
        width: calc(100vw - 32px);
        right: -100vw;
    }
    
    .chat-sidebar.active {
        right: 16px;
    }
} 