/* 仿真控制面板 */
.sim-control-panel {
    position: fixed;
    top: 16px;
    left: 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    overflow: hidden;
}
.sim-title {
    font-size: 15px;
    font-weight: bold;
    color: #1e293b;
    padding: 12px 16px;
    margin: 0;
    border-bottom: 2px solid #3b82f6;
    user-select: none;
}
.sim-content {
    padding: 12px 16px 16px 16px;
    transition: opacity 0.2s ease;
}

/* 收起状态 - 只保留标题栏可见 */
.sim-control-panel.collapsed {
    min-width: auto !important;
}

.sim-control-panel.collapsed .sim-content {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.sim-control-panel.collapsed .toggle-icon {
    transform: rotate(-90deg);
}
.sim-buttons {
    display: flex;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 12px;
}
.sim-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.sim-btn-start {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}
.sim-btn-start:hover { background: linear-gradient(135deg, #059669, #047857); }
.sim-btn-pause {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}
.sim-btn-pause:hover { background: linear-gradient(135deg, #d97706, #b45309); }
.sim-btn-reset {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}
.sim-btn-reset:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.sim-speed-control {
    margin-bottom: 12px;
}
.sim-speed-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    display: block;
}
.sim-speed-btns {
    display: flex;
    gap: 4px;
}
.sim-speed-btn {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.sim-speed-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* KPI面板 */
.kpi-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    overflow: hidden;
}

.kpi-panel .kpi-title {
    padding: 12px 16px !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: 2px solid #3b82f6;
    user-select: none;
}

.kpi-panel .kpi-content {
    padding: 12px 16px 16px 16px;
    transition: opacity 0.2s ease;
}

/* 收起状态 - 只保留标题栏可见 */
.kpi-panel.collapsed {
    min-width: auto !important;
}

.kpi-panel.collapsed .kpi-content {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.kpi-panel.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.kpi-title {
    font-size: 15px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b82f6;
}
.kpi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}
.kpi-section {
    margin-bottom: 4px;
}
.kpi-label { color: #64748b; }
.kpi-value { font-weight: 600; color: #1e293b; transition: all 0.3s ease; }
.kpi-value.good { color: #059669; }
.kpi-value.warn { color: #d97706; }
.kpi-value.bad { color: #dc2626; }

/* KPI面板滚动条美化 */
.kpi-panel::-webkit-scrollbar {
    width: 6px;
}
.kpi-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.kpi-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.kpi-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 节点库存水位 */
.box {
    overflow: hidden !important;
    position: relative;
}
.inventory-water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
    transition: height 0.5s ease;
    z-index: 0;
}
.inventory-water.warning {
    background: linear-gradient(to top, rgba(245, 158, 11, 0.4), rgba(245, 158, 11, 0.15));
}
.inventory-water.danger {
    background: linear-gradient(to top, rgba(239, 68, 68, 0.4), rgba(239, 68, 68, 0.15));
}
.box > *:not(.inventory-water) {
    position: relative;
    z-index: 1;
}
.inventory-label {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #475569;
    background: rgba(255,255,255,0.8);
    padding: 0 3px;
    border-radius: 2px;
    z-index: 2;
}


/* 粒子流容器 */
.canvas {
    position: relative;
}
.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100;
    width: 100%;
    height: 100%;
}
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 0 6px currentColor;
}
.particle.a-class { background: #ef4444; color: #ef4444; }
.particle.b-class { background: #3b82f6; color: #3b82f6; }
.particle.c-class { background: #10b981; color: #10b981; }

/* 节点繁忙呼吸效果 */
.box.busy {
    animation: nodeBusy 1.5s infinite;
}
.box.overload {
    animation: nodeOverload 0.8s infinite;
}
@keyframes nodeBusy {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}
@keyframes nodeOverload {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* 连线流量样式 */
.line-h, .line-v {
    transition: opacity 0.3s;
}

/* 悬停提示框 */
.role-tooltip {
    position: fixed;
    z-index: 10000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    padding: 14px 18px;
    max-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
}
.role-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}
.tooltip-title {
    font-size: 15px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tooltip-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: normal;
}
.tooltip-tag.supplier { background: #fef2f2; color: #dc2626; }
.tooltip-tag.cdc { background: #fff7ed; color: #ea580c; }
.tooltip-tag.rdc { background: #f1f5f9; color: #475569; }
.tooltip-tag.store { background: #f0fdf4; color: #16a34a; }
.tooltip-content {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
}
.tooltip-content h4 {
    font-size: 12px;
    color: #1e293b;
    margin: 8px 0 4px 0;
    font-weight: 600;
}
.tooltip-content ul {
    margin: 4px 0;
    padding-left: 18px;
}
.tooltip-content li {
    margin: 2px 0;
}

/* 方框悬停效果 */
.box[data-role] {
    cursor: help;
    transition: transform 0.15s, box-shadow 0.15s;
}
.box[data-role]:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 页面整体布局 */
body {
    margin: 0;
    padding: 0;
    background: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
}

/* 通用section样式 */
.simulation-section, .explanation-section, .methodology-section, .kpi-methodology-section {
    width: 100%;
    box-sizing: border-box;
}

/* KPI指标管理方法论section */
.kpi-methodology-section {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 40px 0;
    border-bottom: 1px solid #e2e8f0;
}

.kpi-methodology-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 三级金字塔结构 */
.kpi-pyramid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 30px 0;
}

.kpi-level {
    background: white;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    margin: 0 auto;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-level:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* 金字塔层级宽度递减 */
.strategic-level {
    width: 50%;
    border-left: 5px solid #ef4444;
    background: linear-gradient(90deg, #fef2f2 0%, white 15%);
}

.planning-level {
    width: 68%;
    border-left: 5px solid #3b82f6;
    background: linear-gradient(90deg, #eff6ff 0%, white 12%);
}

.operational-level {
    width: 84%;
    border-left: 5px solid #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, white 12%);
}

.execution-level {
    width: 100%;
    border-left: 5px solid #10b981;
    background: linear-gradient(90deg, #f0fdf4 0%, white 10%);
}

.level-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.level-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.strategic-level .level-badge { background: #ef4444; }
.planning-level .level-badge { background: #3b82f6; }
.operational-level .level-badge { background: #f59e0b; }
.execution-level .level-badge { background: #10b981; }

.level-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.level-frequency {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
    padding: 3px 10px;
    background: #f1f5f9;
    border-radius: 12px;
}

.level-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.level-kpi {
    padding: 6px 14px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

.strategic-level .level-kpi { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.planning-level .level-kpi { border-color: #bfdbfe; background: #eff6ff; color: #1e40af; }
.operational-level .level-kpi { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.execution-level .level-kpi { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

.level-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

/* 指标流向箭头 */
.kpi-flow-diagram {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.flow-arrow {
    padding: 16px 20px;
    border-radius: 8px;
    text-align: center;
}

.flow-arrow.flow-up {
    background: #eff6ff;
    border: 1px dashed #3b82f6;
}

.flow-arrow.flow-down {
    background: #faf5ff;
    border: 1px dashed #8b5cf6;
}

.flow-arrow span {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.flow-arrow.flow-up span { color: #1d4ed8; }
.flow-arrow.flow-down span { color: #7c3aed; }

.flow-arrow p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* 指标映射说明 */
.kpi-mapping-note {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    font-size: 13px;
    color: #0c4a6e;
    line-height: 1.7;
}

.kpi-mapping-note strong {
    font-weight: 600;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .kpi-level {
        width: 100% !important;
    }
    
    .kpi-flow-diagram {
        grid-template-columns: 1fr;
    }
    
    .level-frequency {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

/* 方法论section样式 */
.methodology-section {
    background: white;
    padding: 20px 0 40px 0;
    border-bottom: 1px solid #e2e8f0;
}

/* 仿真场景区 */
.simulation-section {
    background: white;
    padding: 20px 0 40px 0;
    border-bottom: 1px solid #e2e8f0;
}

/* RDC布局展示区 */
.layout-section {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #e2e8f0;
}

/* 3D场景加载占位区域 */
.layout-placeholder {
    width: 100%;
    height: 650px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.placeholder-title {
    font-size: 20px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 8px;
}

.placeholder-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.placeholder-warning {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 24px;
}

.load-3d-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.load-3d-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.load-3d-btn:active {
    transform: translateY(0);
}

/* section标题栏操作按钮组 */
.section-action-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.load-section-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.load-section-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.load-section-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.close-section-btn {
    background: white;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #dc2626;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.close-section-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.fullscreen-section-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.fullscreen-section-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.fullscreen-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 全屏状态下容器铺满屏幕 */
.layout-container:fullscreen {
    max-width: 100% !important;
    padding: 0 !important;
    width: 100vw;
    height: 100vh;
    background: #f8fafc;
    overflow: hidden;
}

.layout-container:-webkit-full-screen {
    max-width: 100% !important;
    padding: 0 !important;
    width: 100vw;
    height: 100vh;
    background: #f8fafc;
    overflow: hidden;
}

.layout-container:fullscreen #layoutIframe {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.layout-container:-webkit-full-screen #layoutIframe {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.layout-container:fullscreen .fullscreen-btn {
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.layout-container:-webkit-full-screen .fullscreen-btn {
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.section-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.section-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1e293b;
    font-weight: 700;
}

.section-header p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.canvas-wrapper {
    max-width: 1740px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: auto;
}

.canvas {
    width: 1500px;
    height: 660px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin: 0 auto;
    overflow: hidden;
}
/* 所有场景元素整体上移240px，消除顶部空白，内部相对位置完全不变 */
.canvas > * {
    transform: translateY(-200px);
}

/* 方法论图表单独样式：不应用上移，内容整体居中 */
.methodology-canvas > * {
    transform: translateY(0) !important;
}
.methodology-canvas {
    position: relative;
    overflow: hidden;
}
/* 方法论图表内容整体上移140px，消除编辑器导出的顶部空白，保持内部相对位置不变 */
.methodology-canvas > * {
    transform: translateY(-140px) !important;
}

/* 专业说明区 */
.explanation-section {
    max-width: 1540px;
    margin: 0 auto;
    padding: 40px 24px;
}

.explanation-section .section-header {
    text-align: left;
    margin-bottom: 32px;
    padding: 0;
}

.explanation-section .section-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 说明卡片网格 */
.explanation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.explanation-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.explanation-card.full-width {
    grid-column: 1 / -1;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 角色列表 */
.role-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.role-color {
    width: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.role-color.supplier-a { background: #ef4444; }
.role-color.supplier-b { background: #3b82f6; }
.role-color.supplier-c { background: #10b981; }
.role-color.cdc { background: #ea9162; }
.role-color.rdc-self { background: #cdd4da; }
.role-color.rdc-outsource { background: #d2d6da; }
.role-color.store-a { background: #ddf3ef; }
.role-color.store-b { background: #d8ddd4; }
.role-color.store-c { background: #d5e4ce; }

.role-info {
    flex: 1;
}

.role-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.role-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* 运作流程 */
.process-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.step-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* KPI说明表格 */
.kpi-explain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.kpi-explain-table th,
.kpi-explain-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.kpi-explain-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
}

.kpi-explain-table td {
    color: #475569;
}

.kpi-explain-table tr:last-child td {
    border-bottom: none;
}

.kpi-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.kpi-status.good { background: #dcfce7; color: #166534; }
.kpi-status.warn { background: #fef3c7; color: #92400e; }
.kpi-status.bad { background: #fee2e2; color: #991b1b; }

/* ABC分类图例 */
.abc-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.abc-item {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.abc-item.a { background: #fef2f2; border: 1px solid #fecaca; }
.abc-item.b { background: #eff6ff; border: 1px solid #bfdbfe; }
.abc-item.c { background: #f0fdf4; border: 1px solid #bbf7d0; }

.abc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 auto 8px auto;
    box-shadow: 0 0 6px currentColor;
}

.abc-item.a .abc-dot { background: #ef4444; color: #ef4444; }
.abc-item.b .abc-dot { background: #3b82f6; color: #3b82f6; }
.abc-item.c .abc-dot { background: #10b981; color: #10b981; }

.abc-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.abc-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* 地图可视化区域 */
.map-section {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

.map-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    height: 600px;
    margin-top: 16px;
}

.map-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.map-stat-card,
.map-legend-card,
.map-node-list {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 图层控制 */
.layer-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.layer-toggle:hover {
    background: #f1f5f9;
}
.layer-toggle input {
    display: none;
}
.toggle-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    transition: all 0.2s;
    flex-shrink: 0;
}
.toggle-dot.line {
    border-radius: 2px;
    height: 3px;
    width: 12px;
}
.layer-toggle input:not(:checked) + .toggle-dot {
    opacity: 0.3;
    box-shadow: 0 0 0 1px #e2e8f0;
}
.layer-toggle input:not(:checked) ~ span:last-child {
    opacity: 0.5;
    text-decoration: line-through;
    color: #94a3b8;
}

/* 线路KPI数据标签 */
.line-kpi-tag {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    z-index: 200;
    text-align: center;
    white-space: nowrap;
    /* 移除transition，避免数值更新时闪动 */
}
.line-kpi-tag .kpi-flow {
    font-weight: 600;
    color: #1e293b;
    font-size: 10px;
}
.line-kpi-tag .kpi-cost {
    color: #64748b;
    font-size: 9px;
    margin-top: 1px;
}
/* 供应线标签 - 橙色系 */
.supply-kpi { border-color: #fdba74; }
.supply-kpi .kpi-flow { color: #d97706; }
/* 干线标签 - 蓝色系 */
.trunk-kpi { border-color: #93c5fd; }
.trunk-kpi .kpi-flow { color: #2563eb; }
/* A类配送 - 绿色系 */
.delivery-a-kpi { border-color: #6ee7b7; }
.delivery-a-kpi .kpi-flow { color: #059669; }
/* B类配送 - 黄绿 */
.delivery-b-kpi { border-color: #bef264; }
.delivery-b-kpi .kpi-flow { color: #65a30d; }
/* C类配送 - 浅绿 */
.delivery-c-kpi { border-color: #d9f99d; }
.delivery-c-kpi .kpi-flow { color: #4d7c0f; }
/* 供应商标签 */
.supplier-a-kpi, .supplier-b-kpi, .supplier-c-kpi { 
    border-color: #86efac; 
    padding: 2px 4px;
}
.supplier-a-kpi .kpi-flow, 
.supplier-b-kpi .kpi-flow, 
.supplier-c-kpi .kpi-flow { 
    color: #16a34a; 
    font-weight: 500;
}

/* 移除pulse动画避免闪动，标签位置固定不缩放 */
.line-kpi-tag.active {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
}

/* 作业节点资源利用率标签 */
.node-resource-tag {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 9px;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 150;
    text-align: center;
    white-space: nowrap;
    border-left: 3px solid #10b981;
    /* 移除transition避免颜色变化时的闪动 */
}
.node-resource-tag.warning {
    border-left-color: #f59e0b;
    background: rgba(255, 251, 235, 0.95);
}
.node-resource-tag.danger {
    border-left-color: #ef4444;
    background: rgba(254, 242, 242, 0.95);
}
.node-resource-tag .resource-value {
    font-weight: 700;
    font-size: 12px;
    color: #10b981;
}
.node-resource-tag.warning .resource-value {
    color: #d97706;
}
.node-resource-tag.danger .resource-value {
    color: #dc2626;
}
.node-resource-tag .resource-name {
    color: #64748b;
    font-size: 8px;
    margin-top: 1px;
}
/* 库存标签 - 紧凑只显示百分比 */
.node-resource-tag.inventory-tag {
    padding: 2px 5px;
    border-radius: 4px;
    border-left-width: 2px;
}
.node-resource-tag.inventory-tag .resource-value {
    font-size: 9px;
    font-weight: 600;
}

.map-stat-card h4,
.map-legend-card h4,
.map-node-list h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-item {
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #ea9162;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: #64748b;
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.legend-marker.cdc {
    background: #ea9162;
    width: 18px;
    height: 18px;
}

.legend-marker.rdc-self {
    background: #cdd4da;
    width: 14px;
    height: 14px;
}

.legend-marker.rdc-out {
    background: #5f6876;
    width: 14px;
    height: 14px;
}

.legend-marker.supplier {
    background: #36d399;
}

.legend-marker.store-a {
    background: #ddf3ef;
}

.legend-marker.store-b {
    background: #d8ddd4;
}

.legend-marker.store-c {
    background: #d5e4ce;
}

.legend-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.legend-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

.legend-line > div {
    width: 30px;
    height: 3px;
    flex-shrink: 0;
}

.line-supply {
    background: #f59e0b;
    background-image: linear-gradient(to right, #f59e0b 50%, transparent 50%);
    background-size: 8px 3px;
}

.line-trunk {
    background: #3b82f6;
    background-image: linear-gradient(to right, #3b82f6 50%, transparent 50%);
    background-size: 10px 3px;
}

.line-delivery {
    background: #10b981;
}

.node-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.node-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.node-list-item:hover {
    background: #f1f5f9;
}

.node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-dot.cdc { background: #ea9162; }
.node-dot.rdc-self { background: #6b7280; }
.node-dot.rdc-out { background: #374151; }
.node-dot.supplier { background: #36d399; }
.node-dot.store-a { background: #10b981; }
.node-dot.store-b { background: #84cc16; }
.node-dot.store-c { background: #65a30d; }

.node-info {
    flex: 1;
    min-width: 0;
}

.node-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-city {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-main {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    background: #f8fafc;
    width: 100%;
    height: 100%;
}

