/* 客服功能样式 */
:root {
    --cs-primary: #6366f1;
    --cs-secondary: #8b5cf6;
    --cs-success: #10b981;
    --cs-warning: #f59e0b;
    --cs-danger: #ef4444;
    --cs-dark: #1e293b;
    --cs-light: #f8fafc;
    --cs-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 客服容器 */
.customer-service-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    pointer-events: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 聊天窗口 */
.cs-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99998;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cs-chat-window.show {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* 聊天窗口头部 */
.cs-chat-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #4a5568;
}

.cs-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cs-chat-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.cs-chat-status {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.cs-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.cs-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 聊天消息区域 */
.cs-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #2d3748;
}

.cs-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cs-message.user {
    flex-direction: row-reverse;
}

.cs-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: #e2e8f0;
}

.cs-message.user .cs-message-avatar {
    background: #667eea;
    color: white;
}

.cs-message-content {
    max-width: 70%;
    background: #4a5568;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    line-height: 1.4;
}

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

.cs-message-time {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    text-align: center;
}

/* 快捷回复 */
.cs-quick-replies {
    padding: 12px 20px;
    border-top: 1px solid #4a5568;
    background: #1a202c;
}

.cs-quick-reply-title {
    font-size: 12px;
    color: #a0aec0;
    margin-bottom: 8px;
}

.cs-quick-reply-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cs-quick-reply-btn {
    background: #4a5568;
    border: 1px solid #718096;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* 输入区域 */
.cs-chat-input {
    padding: 16px 20px;
    border-top: 1px solid #4a5568;
    background: #1a202c;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-input-field {
    flex: 1;
    border: 1px solid #4a5568;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #2d3748;
    color: #e2e8f0;
}

.cs-input-field::placeholder {
    color: #a0aec0;
}

.cs-input-field:focus {
    border-color: #667eea;
    background: #4a5568;
}

.cs-send-btn {
    background: #667eea;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.cs-send-btn:hover {
    background: #5a67d8;
}

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

/* 主客服按钮 */
.cs-main-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--cs-shadow);
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-size: 24px;
    position: relative;
    overflow: hidden;
}

.cs-main-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
}

.cs-main-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cs-main-button:hover::before {
    opacity: 1;
}

/* 客服图标动画 */
.cs-icon {
    transition: transform 0.3s ease;
}

.cs-main-button.active .cs-icon {
    transform: rotate(180deg);
}

/* 消息提示点 */
.cs-notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: var(--cs-danger);
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* 客服选项菜单 */
.cs-options-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: var(--cs-shadow);
    padding: 15px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.cs-options-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cs-options-menu::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* 客服选项标题 */
.cs-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--cs-dark);
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

/* 客服选项列表 */
.cs-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cs-option-item {
    margin-bottom: 8px;
}

.cs-option-item:last-child {
    margin-bottom: 0;
}

.cs-option-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--cs-dark);
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #f8fafc;
    border: 1px solid transparent;
}

.cs-option-link:hover {
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    color: white;
    transform: translateX(5px);
    border-color: var(--cs-primary);
    text-decoration: none;
}

.cs-option-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.cs-option-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.cs-option-badge {
    background: var(--cs-success);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* 工作时间提示 */
.cs-work-time {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
    font-size: 12px;
    color: #0369a1;
    text-align: center;
}

.cs-work-time i {
    margin-right: 5px;
    color: #0ea5e9;
}

/* 联系方式弹窗 */
.cs-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cs-contact-modal.show {
    opacity: 1;
    visibility: visible;
}

.cs-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cs-contact-modal.show .cs-modal-content {
    transform: scale(1);
}

.cs-modal-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.cs-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--cs-dark);
    margin-bottom: 5px;
}

.cs-modal-subtitle {
    font-size: 14px;
    color: #64748b;
}

.cs-contact-info {
    margin-bottom: 20px;
}

.cs-contact-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cs-contact-item:hover {
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.cs-contact-item:last-child {
    margin-bottom: 0;
}

.cs-contact-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 16px;
}

.cs-contact-item:hover .cs-contact-icon {
    background: white;
    color: var(--cs-primary);
}

.cs-contact-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--cs-dark);
}

.cs-contact-item:hover .cs-contact-details h4 {
    color: white;
}

.cs-contact-details p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.cs-contact-item:hover .cs-contact-details p {
    color: rgba(255, 255, 255, 0.9);
}

.cs-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
}

.cs-modal-close:hover {
    background: var(--cs-danger);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .customer-service-container {
        bottom: 15px;
        right: 15px;
    }
    
    .cs-main-button {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .cs-options-menu {
        min-width: 260px;
        right: -10px;
    }
    
    .cs-modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .cs-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 80px;
        right: 20px;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .cs-options-menu {
        min-width: 240px;
        right: -20px;
    }
    
    .cs-option-link {
        padding: 10px 12px;
    }
    
    .cs-option-text {
        font-size: 13px;
    }
}

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

.cs-main-button {
    animation: float 3s ease-in-out infinite;
}

.cs-main-button:hover {
    animation: none;
}