/* ========== CRM玻璃态样式 - 适配首页风格 ========== */
/* 此文件用于在首页中集成CRM和训练中心，去除独立背景和粒子效果 */

/* ========== CSS变量定义 ========== */
:root {
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --bg-primary: rgba(255, 255, 255, 0.95);
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --color-primary: #3B82F6;
    --color-secondary: #8B5CF6;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #06B6D4;
}

/* ========== 基础样式 ========== */
.glass-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #111827;
}

/* ========== 加载动画 ========== */
.crm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: crm-spin 1s linear infinite;
}

@keyframes crm-spin {
    to { transform: rotate(360deg); }
}

.crm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
}

/* ========== 空状态 ========== */
.crm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.crm-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.crm-empty-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111827;
}

.crm-empty-subtext {
    font-size: 0.875rem;
    color: #6B7280;
}

/* ========== 按钮样式 ========== */
.crm-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.crm-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.crm-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.crm-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #111827;
}

.crm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.crm-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.crm-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* ========== 输入框样式 ========== */
.crm-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    color: #111827;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.crm-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.7);
}

.crm-input::placeholder {
    color: #9CA3AF;
}

/* ========== 卡片样式 ========== */
.crm-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.crm-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.crm-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ========== 徽章样式 ========== */
.crm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.crm-badge-primary {
    background: rgba(59, 130, 246, 0.15);
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.crm-badge-primary:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}

.crm-badge-secondary {
    background: rgba(139, 92, 246, 0.15);
    color: #6B21A8;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.crm-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.crm-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.crm-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ========== 标签样式 ========== */
.crm-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    color: #111827;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.crm-tag-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
    border-color: rgba(59, 130, 246, 0.2);
}

.crm-tag-green {
    background: rgba(34, 197, 94, 0.1);
    color: #15803D;
    border-color: rgba(34, 197, 94, 0.2);
}

.crm-tag-yellow {
    background: rgba(234, 179, 8, 0.1);
    color: #A16207;
    border-color: rgba(234, 179, 8, 0.2);
}

.crm-tag-red {
    background: rgba(239, 68, 68, 0.1);
    color: #B91C1C;
    border-color: rgba(239, 68, 68, 0.2);
}

.crm-tag-purple {
    background: rgba(168, 85, 247, 0.1);
    color: #6B21A8;
    border-color: rgba(168, 85, 247, 0.2);
}

/* ========== 模态框样式 ========== */
.crm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.crm-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.crm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.crm-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.crm-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.crm-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ========== 表格样式 ========== */
.crm-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.crm-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #111827;
    font-size: 0.875rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.crm-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #111827;
}

.crm-table tbody tr {
    transition: all 0.2s;
}

.crm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ========== 统计卡片 ========== */
.crm-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.crm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.crm-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.crm-stat-label {
    font-size: 0.875rem;
    color: #6B7280;
}

/* ========== 进度条 ========== */
.crm-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.crm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.3s ease;
}

/* ========== 消息提示 ========== */
.crm-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    animation: crm-slide-in 0.3s ease;
}

@keyframes crm-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.crm-message.success {
    border-left: 4px solid #22C55E;
}

.crm-message.error {
    border-left: 4px solid #EF4444;
}

.crm-message.info {
    border-left: 4px solid #3B82F6;
}

.crm-message.warning {
    border-left: 4px solid #EAB308;
}

/* ========== 训练模块文字颜色覆盖 ========== */
/* 训练模块的文字默认是白色，需要改为深色以适应玻璃态背景 */
#successCasesViewContent h2,
#realScenarioTestingViewContent h2,
#selfPlayTrainingViewContent h2,
#rlhfViewContent h2,
#multiObjectiveViewContent h2 {
    color: #111827 !important;
}

#successCasesViewContent p,
#realScenarioTestingViewContent p,
#selfPlayTrainingViewContent p,
#rlhfViewContent p,
#multiObjectiveViewContent p {
    color: #6B7280 !important;
}

#successCasesViewContent,
#realScenarioTestingViewContent,
#selfPlayTrainingViewContent,
#rlhfViewContent,
#multiObjectiveViewContent {
    color: #111827;
}

/* ========== 客户画像浮动标签样式 ========== */
.crm-profile-floating-tag {
    position: absolute;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: crm-float 3s ease-in-out infinite;
    white-space: nowrap;
    z-index: 10;
}

.crm-profile-floating-tag:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

@keyframes crm-float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
}

/* 标签颜色变体（带渐变） */
.crm-profile-tag-white {
    background: white;
    color: #374151;
}

.crm-profile-tag-pink {
    background: linear-gradient(to right, #f472b6, #ec4899);
    color: white;
}

.crm-profile-tag-blue {
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    color: white;
}

.crm-profile-tag-green {
    background: linear-gradient(to right, #4ade80, #22c55e);
    color: white;
}

.crm-profile-tag-yellow {
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    color: #111827;
}

.crm-profile-tag-red {
    background: linear-gradient(to right, #f87171, #ef4444);
    color: white;
}

.crm-profile-tag-indigo {
    background: linear-gradient(to right, #818cf8, #6366f1);
    color: white;
}

.crm-profile-tag-purple {
    background: linear-gradient(to right, #a78bfa, #8b5cf6);
    color: white;
}

.crm-profile-tag-teal {
    background: linear-gradient(to right, #2dd4bf, #14b8a6);
    color: white;
}

/* 标签动画延迟 */
.crm-profile-tag-delay-0 { animation-delay: 0s; }
.crm-profile-tag-delay-1 { animation-delay: 0.5s; }
.crm-profile-tag-delay-2 { animation-delay: 1s; }
.crm-profile-tag-delay-3 { animation-delay: 1.5s; }
.crm-profile-tag-delay-4 { animation-delay: 2s; }
.crm-profile-tag-delay-5 { animation-delay: 2.5s; }
.crm-profile-tag-delay-6 { animation-delay: 0.8s; }
.crm-profile-tag-delay-7 { animation-delay: 1.8s; }
.crm-profile-tag-delay-8 { animation-delay: 1.2s; }
.crm-profile-tag-delay-9 { animation-delay: 0.3s; }
.crm-profile-tag-delay-10 { animation-delay: 2.2s; }
.crm-profile-tag-delay-11 { animation-delay: 1.7s; }

/* 标签角标（显示创建方式） */
.crm-profile-tag-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 11;
    line-height: 1;
}

.crm-profile-tag-badge-manual {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.crm-profile-tag-badge-auto {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.crm-profile-tag-badge-system {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

/* 客户照片容器（用于浮动视图） */
.crm-profile-photo-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.crm-profile-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.8);
    z-index: 5;
    position: relative;
}

/* 静态光晕效果 */
.crm-profile-static-glow {
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

/* ========== 滚动条美化 ========== */
.crm-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.crm-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.crm-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.crm-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .crm-container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .crm-customer-sidebar,
    .training-customer-sidebar {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .crm-modal {
        width: 95%;
        padding: 1.5rem;
    }
}

