﻿/* 客服中心组件样式 */
:root {
    --cs-primary-color: #10b981;
    --cs-secondary-color: #059669;
    --cs-bg-color: #ffffff;
    --cs-text-color: #1e293b;
    --cs-border-color: #e2e8f0;
    --cs-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --cs-transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--cs-text-color);
}

/* 侧边栏客服组件 */
.cs-widget-sidebar {
    background-color: var(--cs-bg-color);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.cs-widget-sidebar-header {
    margin-bottom: 1rem;
}

.cs-widget-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cs-text-color);
}

.cs-widget-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 二维码区域 */
.cs-qr-sidebar-section {
    text-align: center;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--cs-border-color);
}

.cs-qr-sidebar-image {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.cs-qr-sidebar-image img {
    width: 150px;
    height: 150px;
    border: 2px solid white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cs-qr-sidebar-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

/* 电话区域 */
.cs-phone-sidebar-section {
    display: flex;
    justify-content: center;
}

.cs-phone-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--cs-primary-color);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--cs-transition);
    width: 100%;
    justify-content: center;
}

.cs-phone-sidebar-link:hover {
    background-color: var(--cs-secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    text-decoration: none;
}

.cs-phone-sidebar-icon {
    font-size: 1.1rem;
}

.cs-phone-sidebar-text {
    font-size: 0.95rem;
}

/* 收藏按钮区域 */
.cs-favorite-sidebar-section {
    display: flex;
    justify-content: center;
}

.cs-favorite-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--cs-transition);
    width: 100%;
    justify-content: center;
}

.cs-favorite-sidebar-toggle:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cs-favorite-sidebar-icon {
    font-size: 1.1rem;
}

.cs-favorite-sidebar-text {
    font-size: 0.95rem;
}

/* 收藏面板 */
.cs-favorite-panel {
    position: fixed;
    top: 0;
    right: 320px;
    width: 400px;
    height: 100vh;
    background-color: var(--cs-bg-color);
    box-shadow: var(--cs-shadow);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--cs-transition);
}

.cs-favorite-panel.open {
    transform: translateX(0);
}

.cs-favorite-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--cs-border-color);
}

.cs-favorite-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cs-text-color);
}

.cs-favorite-panel-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color var(--cs-transition);
}

.cs-favorite-panel-close:hover {
    color: var(--cs-text-color);
}

.cs-favorite-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cs-no-favorites {
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    padding: 2rem 0;
}

/* 收藏项样式 */
.cs-favorite-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid var(--cs-border-color);
    transition: all var(--cs-transition);
}

.cs-favorite-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.cs-favorite-item-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.cs-favorite-item-info {
    flex: 1;
    min-width: 0;
}

.cs-favorite-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cs-text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.cs-favorite-item-date {
    font-size: 0.85rem;
    color: #64748b;
}

.cs-favorite-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    transition: color var(--cs-transition);
}

.cs-favorite-item-remove:hover {
    color: #dc2626;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cs-widget-sidebar {
        padding: 1rem;
    }
    
    .cs-favorite-panel {
        width: 100%;
        right: 0;
    }
    
    .cs-qr-sidebar-image img {
        width: 120px;
        height: 120px;
    }
    
    .cs-widget-sidebar-content {
        gap: 0.75rem;
    }
    
    .cs-qr-sidebar-section {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .cs-widget-sidebar {
        padding: 0.75rem;
    }
    
    .cs-widget-sidebar-header {
        margin-bottom: 0.75rem;
    }
    
    .cs-widget-sidebar-title {
        font-size: 1rem;
    }
    
    .cs-widget-sidebar-content {
        gap: 0.5rem;
    }
    
    .cs-qr-sidebar-section {
        padding: 0.5rem;
    }
    
    .cs-qr-sidebar-image img {
        width: 100px;
        height: 100px;
    }
    
    .cs-favorite-sidebar-toggle {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .cs-phone-sidebar-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .cs-phone-sidebar-icon,
    .cs-phone-sidebar-text {
        font-size: 0.85rem;
    }
}

/* Toast消息样式 */
.cs-toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    z-index: 99999;
    display: none;
    animation: csFadeIn 0.3s ease;
}

@keyframes csFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}