/* ===== 知识图谱页面 ===== */
.graph-page {
  padding: 60px 24px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.graph-header {
  text-align: center;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease forwards;
}

.graph-header > * {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}
.graph-header > *:nth-child(1) { animation-delay: 0s; }
.graph-header > *:nth-child(2) { animation-delay: 0.1s; }

.graph-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.2s forwards;
  opacity: 0;
}

.graph-control-btn {
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.graph-control-btn:hover { border-color: var(--accent-bronze); color: var(--text-primary); }
.graph-control-btn.active { background: var(--accent-gold); color: #1a1a1a; border-color: var(--accent-gold); }

/* 图谱画布 */
.graph-canvas-container {
  position: relative;
  width: 100%;
  height: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease 0.3s forwards;
  opacity: 0;
}

.graph-canvas-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(201,169,110,0.03) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(90,122,138,0.03) 0%, transparent 50%);
  pointer-events: none;
}

#graphCanvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#graphCanvas:active {
  cursor: grabbing;
}

.graph-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 16px;
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.event { background: #c9a06e; }
.legend-dot.person { background: #6e96c9; }
.legend-dot.school { background: #a06ec9; }
.legend-dot.idea { background: #6ec9a0; }

.graph-tooltip {
  position: absolute;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  max-width: 240px;
}

.graph-tooltip.visible { opacity: 1; }

.graph-tooltip h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--accent-gold);
}

.graph-tooltip p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* 六度关联 */
.six-degrees {
  max-width: 900px;
  margin: 0 auto 80px;
  animation: fadeInUp 0.6s ease 0.4s forwards;
  opacity: 0;
}

.six-degrees h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  text-align: center;
  margin-bottom: 24px;
}

.six-degrees-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.six-degrees-select {
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  min-width: 200px;
  cursor: pointer;
}

.six-degrees-select:focus {
  border-color: var(--accent-gold);
}

.six-degrees-arrow {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-gold);
}

.six-degrees-result {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 100px;
  display: none;
}

.six-degrees-result.visible {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.path-node {
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.path-arrow {
  color: var(--accent-gold);
  font-size: 16px;
  font-family: var(--font-display);
}

@media (max-width: 768px) {
  .graph-canvas-container { height: 400px; }
  .graph-legend { bottom: 10px; left: 10px; gap: 10px; padding: 8px 12px; }
}
