/**
 * v3 企业知识库 · 知识图谱页局部样式
 * 色系对齐 STYLE.md / v3_portal_layout（强调色 #4a6fa5）
 */

.v3-ekb-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 8px;
  font-size: 13px;
  color: #64748b;
}

.v3-ekb-graph-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v3-ekb-graph-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
}

.v3-ekb-graph-dot-doc {
  background: var(--v2-accent, #4a6fa5);
  border-color: #3b5a86;
}

.v3-ekb-graph-dot-item {
  background: var(--v2-accent-soft, #e5edf7);
  border-color: var(--v2-accent, #4a6fa5);
}

.v3-ekb-graph-dot-tag {
  background: #f8fafc;
  border-color: #94a3b8;
}

.v3-ekb-graph-dot-article {
  background: #f59e0b;
  border-color: #d97706;
}

.v3-ekb-graph-workspace {
  margin-top: 4px;
}

.v3-ekb-graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  min-height: 480px;
}

.v3-ekb-graph-canvas-wrap {
  position: relative;
  border: 1px solid var(--v3-sidebar-border, #e2e8f0);
  background: #f8fafc;
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
}

#graph-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

#graph-canvas:active {
  cursor: grabbing;
}

.v3-ekb-graph-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.v3-ekb-graph-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 1;
  background: rgba(248, 250, 252, 0.92);
  pointer-events: none;
}

.v3-ekb-graph-empty:not([hidden]) {
  display: flex;
  pointer-events: auto;
}

.v3-ekb-graph-empty[hidden] {
  display: none !important;
}

.v3-ekb-graph-side {
  border: 1px solid var(--v3-sidebar-border, #e2e8f0);
  background: var(--v2-accent-soft, #e5edf7);
  padding: 14px 16px;
  border-radius: 8px;
}

.v3-ekb-graph-side h3 {
  word-break: break-word;
  color: #344767;
}

#graph-side-summary {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
  word-break: break-word;
  color: #344767;
}

#graph-side-meta {
  font-size: 12px;
  margin: 0 0 12px;
}

.v3-ekb-item-row:target {
  outline: 2px solid var(--v2-accent, #4a6fa5);
  outline-offset: 2px;
  background: var(--v2-accent-soft, #e5edf7);
}

@media (max-width: 860px) {
  .v3-ekb-graph-layout {
    grid-template-columns: 1fr;
  }
}
