/* ========================================
   🎨 西梅故事 - 简洁现代客服系统
   ======================================== */

/* 客服悬浮按钮 - 全新卡片式设计 */
.customer-service-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 2px solid #f0f0f0;
}

.customer-service-btn::after {
    content: '在线客服';
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.customer-service-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
    border-color: #FF6B6B;
}

.customer-service-btn:hover::after {
    color: #FF6B6B;
}

.customer-service-btn i {
    width: 36px;
    height: 36px;
    background: #FF6B6B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.customer-service-btn:hover i {
    background: #FF5252;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* 在线状态指示器 */
.service-status {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #FF6B6B;
    z-index: 2;
}

.service-status.online {
    background: #4CAF50;
    animation: statusBlink 2s ease-in-out infinite;
}

.service-status.offline {
    background: #999;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 客服模态框容器 - 去掉模糊背景 */
.customer-service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.customer-service-modal.show {
    display: flex;
}

/* 客服窗口主体 - 简洁设计 */
.service-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    height: 600px;
    max-height: 85vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 客服头部 - 简洁单色 */
.service-modal-header {
    background: #FF6B6B;
    padding: 24px 24px 20px;
    position: relative;
}

.service-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.service-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.service-avatar i {
    color: white;
    font-size: 24px;
}

.service-info h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.service-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin: 0;
}

/* 关闭按钮 */
.service-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.service-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.service-close i {
    color: white;
    font-size: 16px;
}

/* 工作时间提示 - 隐藏 */
.working-hours {
    display: none;
}

/* 聊天区域 - 增加留白 */
.chat-area {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* 简洁滚动条 */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 消息气泡 - 简洁设计 */
.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: #FF6B6B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.message-wrapper {
    max-width: calc(100% - 150px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    width: fit-content;
    max-width: 100%;
}

.message-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    padding-left: 4px;
}

/* 用户消息 */
.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message.user .message-avatar {
    background: #667eea;
}

.chat-message.user .message-time {
    text-align: right;
    padding-right: 4px;
    padding-left: 0;
}

.chat-message.user .message-content {
    background: #667eea;
    color: white;
}

/* 输入区域 */
.chat-input-area {
    background: white;
    border-top: 1px solid #f0f0f0;
}

/* 快捷回复 - 一行显示 */
.quick-replies {
    padding: 14px 24px;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    border-bottom: 1px solid #f5f5f5;
    justify-content: space-between;
}

.quick-reply-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 6px 10px;
    font-size: 11px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.quick-reply-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 输入框 - 简洁设计 */
.chat-input-container {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.2s ease;
    overflow: hidden; /* 隐藏滚动条 */
    overflow-y: auto; /* 允许垂直滚动但隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    -webkit-appearance: none; /* 移除webkit默认样式 */
    -moz-appearance: none; /* 移除Firefox默认样式 */
    appearance: none; /* 移除默认样式 */
}

/* 隐藏Webkit浏览器的滚动条 */
.chat-input::-webkit-scrollbar {
    display: none;
}

/* 移除浏览器默认的上下箭头和下拉图标 */
.chat-input::-webkit-calendar-picker-indicator,
.chat-input::-webkit-inner-spin-button,
.chat-input::-webkit-outer-spin-button,
.chat-input::-webkit-clear-button,
.chat-input::-webkit-search-decoration,
.chat-input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
    appearance: none;
}

.chat-input:focus {
    border-color: #667eea;
    background: white;
}

.chat-input::placeholder {
    color: #aaa;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: #FF6B6B;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #FF5252;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.chat-send-btn:active {
    transform: translateY(0);
}

.chat-send-btn i {
    color: white;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .customer-service-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 16px;
    }
    
    .customer-service-btn::after {
        font-size: 13px;
    }
    
    .customer-service-btn i {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .service-modal-content {
        max-width: 100%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .customer-service-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .service-modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
    
    .service-modal-header {
        padding: 20px;
    }
    
    .chat-messages {
        padding: 20px 16px;
    }
    
    .quick-replies {
        padding: 14px 16px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

