:root {
    --primary-color: #447793;
    --primary-light: #5a8aa6;
    --primary-dark: #2d5a74;
    --card-background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    --card-border: #e8e8e8;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f4f8;
}

.salesperson-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.salesperson-item:hover {
    background-color: #f0f7ff;
    transform: translateX(4px);
}

.salesperson-item.active {
    background-color: #e6f7ff;
    border-left: 4px solid var(--primary-color);
}

.relationship-canvas {
    width: 100%;
    height: 100%;
    position: relative;
}

.customer-node {
    position: absolute;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
    cursor: move;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background-size: cover;
    background-position: center;
}

.customer-node:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 10;
}

.customer-node.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.customer-label {
    position: absolute;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}

.customer-label .name {
    font-weight: 600;
    color: #262626;
    margin-bottom: 2px;
}

.customer-label .region {
    font-size: 11px;
    color: #8c8c8c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.customer-tooltip {
    position: absolute;
    background: white;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    min-width: 200px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.customer-tooltip.show {
    opacity: 1;
}

.customer-tooltip .tooltip-header {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.customer-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: #595959;
}

.customer-tooltip .tooltip-label {
    color: #8c8c8c;
}

.customer-tooltip .tooltip-value {
    font-weight: 500;
    color: #262626;
}

.customer-node.high-value {
    border-color: #d19a9a;
    color: #d19a9a;
}

.customer-node.medium-value {
    border-color: #faad14;
    color: #faad14;
}

.salesperson-center {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 4px solid white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 20;
}

.connection-line {
    position: absolute;
    background: var(--primary-color);
    transform-origin: 0 50%;
    pointer-events: none;
    opacity: 0.3;
}

.connection-line.strong {
    opacity: 0.6;
    height: 3px;
}

.connection-line.medium {
    opacity: 0.4;
    height: 2px;
}

.connection-line.weak {
    opacity: 0.2;
    height: 1px;
}

.email-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.email-item:hover {
    background-color: #f0f7ff;
    transform: translateX(4px);
}

.chart-container {
    height: 300px;
    width: 100%;
}

.metric-card {
    background: var(--card-background);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* 树形结构样式 */
.sales-card {
    padding: 12px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sales-card:hover {
    background-color: #f0f7ff;
}

.sales-card.active {
    background-color: #e6f7ff;
    border-left: 4px solid var(--primary-color);
}

.sales-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

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

.sales-name {
    font-weight: 600;
    color: #262626;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-count {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 2px;
}

.sales-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* 树形结构 - 父节点 */
.sales-group {
    position: relative;
}

.sales-parent {
    position: relative;
    padding-left: 12px;
}

.sales-expand-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c8c8c;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sales-group.expanded .sales-expand-icon i {
    transform: rotate(90deg);
}

/* 树形结构 - 子节点 */
.sales-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fafafa;
}

.sales-group.expanded .sales-children {
    max-height: 1000px;
}

.sales-child {
    padding-left: 52px;
    border-left: 2px solid #e8e8e8;
    position: relative;
}

.sales-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 20px;
    height: 1px;
    background-color: #e8e8e8;
}

.sales-child:last-child {
    border-left-color: transparent;
}

.sales-child:last-child::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 50%;
    background-color: #e8e8e8;
}
