/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
}

/* 侧边栏样式 */
.sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* 客户列表样式 */
.customer-list {
    padding: 0;
}

/* 搜索框样式 */
.search-container {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.search-container .input-group {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-container .form-control {
    border: 1px solid #e9ecef;
    border-right: none;
}

.search-container .input-group-text {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-right: none;
    color: #6c757d;
}

.search-container .btn {
    border: 1px solid #e9ecef;
    border-left: none;
    background-color: #ffffff;
    color: #6c757d;
}

.search-container .btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.customer-items {
    padding: 0;
}

.customer-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
}

.customer-item:hover {
    background-color: #f8f9fa;
}

.customer-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: #2196f3;
}

.customer-info {
    flex: 1;
    min-width: 0;
}

.customer-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #202124;
    margin-bottom: 0.25rem;
}

.customer-meta {
    font-size: 0.8rem;
    color: #5f6368;
}

.customer-status {
    margin-left: 0.5rem;
}

.no-customers {
    text-align: center;
    padding: 2rem 1rem;
    color: #5f6368;
}

.no-customers i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* 分页样式 */
.pagination-container {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.pagination-info {
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    align-items: center;
}

.pagination-controls .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls span {
    color: #6c757d;
    font-weight: 500;
}

/* 主内容区域 */
.main-content {
    padding: 1rem;
    padding-top: 0.5rem;
    
    height: calc(100vh - 56px);
    overflow-y: auto;
}

/* 欢迎页面样式 */
.welcome-section {
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.welcome-header {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-header h2 {
    color: #202124;
    margin-bottom: 0.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: white;
    font-size: 1.2rem;
}

.stat-content h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #202124;
}

.stat-content p {
    margin: 0;
    color: #5f6368;
    font-size: 0.9rem;
}

.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h4 {
    color: #202124;
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.recent-customers h4 {
    color: #202124;
    margin-bottom: 1rem;
}

/* 客户详情页面样式 */
.customer-detail-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.customer-header {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 0.2rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-basic-info {
    display: flex;
    align-items: center;
}

.customer-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: #2196f3;
    font-size: 1.5rem;
}

.customer-details h2 {
    margin-bottom: 0.5rem;
    color: #202124;
}

.customer-details .d-flex {
    align-items: baseline;
}

.customer-details .btn-outline-primary {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-width: 1px;
    transition: all 0.2s;
}

.customer-details .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.customer-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
    height: 1 rem;
}

.customer-meta-info span {
    font-size: 0.9rem;
    color: black;
    background-color: white;
}

.customer-status-badge span{
    color: white !important;
}
.customer-actions {
    display: flex;
    gap: 0.75rem;
    margin: 0.5rem;
}

.main-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* 确保主内容区域不会超出屏幕高度 */
    height: calc(100vh - 120px);
    overflow: hidden;
}

/* 主内容区域行容器 */
.main-content-area-row {
    height: 100%;
    margin: 0;
}

/* 右侧信息面板列 */
.main-content-area-row .col-md-4 {
    height: 100%;
    padding: 0 0.5rem;
}

/* 左侧聊天区域列 */
.main-content-area-row .col-md-8 {
    height: 100%;
    padding: 0 0.5rem;
}

/* 聊天界面样式 */
.chat-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.chat-header h5 {
    margin: 0;
    color: #202124;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: 400px;
}

.message {
    display: flex;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.message-agent {
    flex-direction: row-reverse;
}

.message-customer {
    flex-direction: row;
}

.message-ai {
    flex-direction: row;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.message-agent .message-avatar {
    background-color: #e3f2fd;
    color: #2196f3;
}

.message-customer .message-avatar {
    background-color: #f3e5f5;
    color: #9c27b0;
}

.message-ai .message-avatar {
    background-color: #e8f5e8;
    color: #4caf50;
}

.message-content {
    max-width: 90%;
}

.message-text {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.message-agent .message-text {
    background-color: #2196f3;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-customer .message-text {
    background-color: #f1f3f4;
    color: #202124;
    border-bottom-left-radius: 4px;
}

.message-ai .message-text {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-bottom-left-radius: 4px;
    border: 1px solid #c8e6c9;
}

.message-time {
    font-size: 0.75rem;
    color: #5f6368;
    margin-top: 0.25rem;
    text-align: center;
}

/* AI输入指示器样式 */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #4caf50;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator i:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator i:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator i:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.no-messages {
    text-align: center;
    padding: 2rem;
    color: #5f6368;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* 信息面板样式 */
.info-panel {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    /* 设置固定高度，避免超出屏幕 */
    height: calc(100vh - 168px);
    overflow-y: auto;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* 信息面板滚动条样式 */
.info-panel::-webkit-scrollbar {
    width: 6px;
}

.info-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.section-header h6 {
    margin: 0;
    color: #202124;
    font-weight: 600;
}

.kyc-list, .sales-list {
    margin-bottom: 0;
}

.kyc-item, .sale-item {
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    transition: all 0.2s;
}

.kyc-item:hover, .sale-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    transform: translateY(-1px);
}

.kyc-date, .sale-product {
    font-weight: 600;
    font-size: 0.9rem;
    color: #202124;
    margin-bottom: 0.25rem;
}

.kyc-summary, .sale-details {
    font-size: 0.8rem;
    color: #5f6368;
}

.sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sale-product {
    font-weight: 600;
    font-size: 0.9rem;
    color: #202124;
    margin-bottom: 0;
}

.sale-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sale-amount {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0;
}

/* 跟进记录样式 */
.activity-list {
    margin-bottom: 0;
}

.activity-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background-color: #ffffff;
    transition: all 0.2s;
}

.activity-item:hover {
    border-color: #17a2b8;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.15);
    transform: translateY(-1px);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.activity-type {
    font-size: 0.75rem;
    font-weight: 600;
}

.activity-description {
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow: hidden;
}

.activity-actions, .sales-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.activity-actions .btn, .sales-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.section-actions {
    text-align: center;
}

.section-actions .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
}

.no-data {
    text-align: center;
    padding: 1rem;
}

.more-items {
    text-align: center;
    padding: 0.5rem;
}

/* 模态框样式 */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* 表格样式 */
.table {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: #202124;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 表格样式优化 */
.table-responsive {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table thead th {
    background-color: #343a40;
    color: white;
    border: none;
    padding: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.table tbody td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e9ecef;
}

/* AI消息中的格式化内容样式 */
.message-ai .message-text h1,
.message-ai .message-text h2,
.message-ai .message-text h3,
.message-ai .message-text h4,
.message-ai .message-text h5,
.message-ai .message-text h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.message-ai .message-text h1 {
    color: #0d6efd;
    font-size: 1.25rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.message-ai .message-text h2 {
    color: #6c757d;
    font-size: 1.1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.25rem;
}

.message-ai .message-text h3 {
    color: #0dcaf0;
    font-size: 1rem;
}

.message-ai .message-text p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #212529;
}

.message-ai .message-text ul,
.message-ai .message-text ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.message-ai .message-text li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.message-ai .message-text li i {
    color: #198754;
    margin-right: 0.5rem;
    font-size: 0.8em;
}

.message-ai .message-text code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #d63384;
    border: 1px solid #e9ecef;
}

.message-ai .message-text pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    margin: 1rem 0;
    overflow-x: auto;
    font-size: 0.875em;
}

.message-ai .message-text pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
}

.message-ai .message-text blockquote {
    background-color: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
    font-style: italic;
    color: #6c757d;
}

.message-ai .message-text table {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.message-ai .message-text table th {
    background-color: #343a40;
    color: black;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.message-ai .message-text table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.message-ai .message-text table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.message-ai .message-text table tbody tr:hover {
    background-color: #e9ecef;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .main-content {
        height: auto;
    }
    
    .customer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .customer-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .customer-meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.25rem;
    }
    
    .message-ai .message-text h1 {
        font-size: 1.1rem;
    }
    
    .message-ai .message-text h2 {
        font-size: 1rem;
    }
    
    .message-ai .message-text h3 {
        font-size: 0.9rem;
    }
    
    .message-ai .message-text table {
        font-size: 0.8rem;
    }
    
    .message-ai .message-text table th,
    .message-ai .message-text table td {
        padding: 0.5rem 0.25rem;
    }
    
    .message-ai .message-text pre {
        padding: 0.75rem;
        font-size: 0.8em;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 模态框backdrop修复样式 */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* 确保模态框关闭时backdrop被正确移除 */
.modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* 强制移除残留的backdrop */
body.modal-open {
    overflow: hidden;
}

/* 修复模态框显示问题 */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* 确保模态框内容正确显示 */
.modal-content {
    position: relative;
    z-index: 1055;
} 