/* 客服弹窗样式 */
.customer-service-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.customer-service-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.customer-service-modal {
    background: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 头部 */
.cs-modal-header {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.95) 0%, rgba(175, 180, 230, 0.95) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cs-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-avatar svg {
    width: 28px;
    height: 28px;
    fill: #FFFFFF;
}

.cs-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.cs-modal-header h3 small {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
}

.cs-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.3s;
}

.cs-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 内容容器（包含问题和对话） */
.cs-content-container {
    flex: 1;
    overflow-y: auto;
    background: linear-gradient(180deg, #E8F4F8 0%, #F3E5F5 50%, #FFE5F0 100%);
}

.cs-content-container::-webkit-scrollbar {
    width: 6px;
}

.cs-content-container::-webkit-scrollbar-thumb {
    background: rgba(135, 206, 235, 0.6);
    border-radius: 3px;
}

.cs-content-container::-webkit-scrollbar-thumb:hover {
    background: rgba(135, 206, 235, 0.8);
}

/* 问题按钮区域 */
.cs-questions-area {
    padding: 20px;
    background: linear-gradient(180deg, #E8F4F8 0%, #F3E5F5 100%);
    border-bottom: 2px solid rgba(135, 206, 235, 0.3);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.cs-service-icon-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.9) 0%, rgba(175, 180, 230, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(135, 206, 235, 0.4);
    flex-shrink: 0;
    margin-top: 5px;
}

.cs-service-icon-container svg {
    width: 28px;
    height: 28px;
    fill: #FFFFFF;
}

.cs-questions-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.cs-question-btn {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.9) 0%, rgba(175, 180, 230, 0.9) 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
    text-align: center;
    word-break: break-word;
}

.cs-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.5);
    background: linear-gradient(135deg, rgba(135, 206, 235, 1) 0%, rgba(175, 180, 230, 1) 100%);
}

.cs-question-btn:active {
    transform: translateY(0);
}

/* 对话区域 */
.cs-conversation-area {
    padding: 20px;
    min-height: 200px;
    background: linear-gradient(180deg, #F3E5F5 0%, #FFE5F0 100%);
}

.cs-empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.cs-empty-message img {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 消息气泡 */
.cs-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 用户问题 */
.cs-message.user {
    display: flex;
    justify-content: flex-end;
}

.cs-message.user .cs-bubble {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.9) 0%, rgba(175, 180, 230, 0.9) 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
    padding: 12px 16px;
    max-width: 70%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
}

/* 客服回复 */
.cs-message.service {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
}

.cs-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.9) 0%, rgba(175, 180, 230, 0.9) 100%);
    border: 2px solid rgba(135, 206, 235, 0.6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-avatar-small svg {
    width: 18px;
    height: 18px;
    fill: #FFFFFF;
}

.cs-message.service .cs-bubble {
    background: white;
    color: #333;
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    max-width: 70%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: pre-line;
}

.cs-message.service .cs-bubble a {
    color: rgba(135, 206, 235, 1);
    text-decoration: underline;
    word-break: break-all;
    transition: color 0.2s;
}

.cs-message.service .cs-bubble a:hover {
    color: rgba(175, 180, 230, 1);
}

/* 图片消息 */
.cs-message.service .cs-bubble.image {
    padding: 8px;
    cursor: pointer;
}

.cs-message.service .cs-bubble.image img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
}

/* 链接消息 */
.cs-message.service .cs-bubble.link a {
    color: rgba(135, 206, 235, 1);
    text-decoration: underline;
    word-break: break-all;
}

.cs-message.service .cs-bubble.link a:hover {
    color: rgba(175, 180, 230, 1);
}

/* 时间戳 */
.cs-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.cs-message.service .cs-timestamp {
    text-align: left;
}

/* 加载动画 */
.cs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cs-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(135, 206, 235, 0.8);
    margin: 0 4px;
    animation: loadingBounce 1.4s infinite ease-in-out both;
}

.cs-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.cs-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 图片预览遮罩 */
.cs-image-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cs-image-preview-overlay.active {
    display: flex;
}

.cs-image-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
}

.cs-image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式 */
@media (max-width: 480px) {
    .cs-questions-grid {
        grid-template-columns: 1fr;
    }
    
    .customer-service-modal {
        width: 95%;
        max-height: 92vh;
    }
    
    .cs-message.user .cs-bubble,
    .cs-message.service .cs-bubble {
        max-width: 85%;
    }
    
    .cs-questions-area {
        padding: 15px;
        gap: 10px;
    }
    
    .cs-service-icon-container {
        width: 42px;
        height: 42px;
    }
    
    .cs-service-icon-container svg {
        width: 24px;
        height: 24px;
    }
    
    .cs-conversation-area {
        padding: 15px;
    }
    
    .cs-avatar {
        width: 40px;
        height: 40px;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .cs-avatar svg {
        width: 24px;
        height: 24px;
    }
    
    .cs-avatar-small {
        width: 28px;
        height: 28px;
    }
    
    .cs-avatar-small svg {
        width: 16px;
        height: 16px;
    }
    
    .cs-modal-header h3 {
        font-size: 14px;
    }
    
    .cs-modal-header h3 small {
        font-size: 11px;
    }
    
    .cs-question-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

