/* 莹虹商贸客服系统前端样式 */
.yhsm-cs-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.yhsm-cs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.yhsm-cs-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    font-weight: 300;
}

.yhsm-cs-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

/* 联系渠道选择 */
.yhsm-cs-channels {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.channel-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.channel-tab {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.channel-tab:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.channel-tab.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.channel-tab i {
    display: block;
    font-size: 2em;
    margin-bottom: 8px;
}

/* 内容区域 */
.yhsm-cs-content {
    padding: 0;
}

.channel-content {
    display: none;
    min-height: 400px;
}

.channel-content.active {
    display: block;
}

/* 在线聊天样式 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    margin-left: auto;
}

.user-message .message-bubble {
    background: #007cba;
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.agent-message .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 18px 18px 18px 4px;
}

.message-bubble {
    padding: 12px 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-time {
    font-size: 0.8em;
    opacity: 0.6;
    margin-top: 5px;
}

.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

#chat-input:focus {
    border-color: #007cba;
}

#send-message {
    padding: 12px 25px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#send-message:hover {
    background: #005a87;
}

/* 微信客服样式 */
.wechat-content {
    text-align: center;
    padding: 40px 20px;
}

.qrcode-container {
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: inline-block;
}

.qrcode-container img {
    width: 200px;
    height: 200px;
    display: block;
}

.wechat-info {
    margin-top: 20px;
}

.wechat-id {
    font-size: 1.2em;
    font-weight: bold;
    color: #07c160;
    margin: 10px 0;
}

/* 工单表单样式 */
.ticket-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #218838;
}

/* 电话联系样式 */
.phone-content {
    text-align: center;
    padding: 40px 20px;
}

.phone-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #007cba;
    margin: 20px 0;
}

.call-button {
    display: inline-block;
    padding: 15px 30px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    margin: 10px 0;
    transition: background 0.3s;
}

.call-button:hover {
    background: #218838;
    color: white;
}

.work-hours {
    margin-top: 20px;
    color: #666;
}

/* 浮动按钮样式 */
.yhsm-cs-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
}

.floating-button {
    width: 60px;
    height: 60px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.floating-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
}

.floating-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yhsm-cs-container {
        margin: 10px;
        border-radius: 8px;
    }
    
    .channel-tabs {
        flex-direction: column;
    }
    
    .channel-tab {
        min-width: auto;
    }
    
    .chat-container {
        height: 400px;
    }
    
    .yhsm-cs-floating {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-panel {
        width: 280px;
        right: -10px;
    }
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: #28a745;
}

.status-offline {
    background: #6c757d;
}

.status-busy {
    background: #ffc107;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
