/* 脑图编辑器 - 自由画布 */
.mindmap-editor {
  background: #fff;
  border-radius: 8px;
  min-height: calc(100vh - var(--header-height) - 40px);
  display: flex;
  flex-direction: column;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #ebeef5;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.editor-title {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 180px;
}

.editor-title .title-text {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

.editor-view-stats {
  margin-left: 10px;
  font-size: 12px;
  color: #909399;
}

.editor-hint {
  font-size: 12px;
  color: #909399;
  display: flex;
  align-items: center;
  gap: 4px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-canvas-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle, #dcdfe6 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: #f5f7fa;
  cursor: grab;
  min-height: 520px;
  touch-action: none;
}

.editor-canvas-wrap.is-panning {
  cursor: grabbing;
}

.editor-canvas-wrap:active {
  cursor: grabbing;
}

.mm-canvas-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.mm-links {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.mm-link {
  fill: none;
  stroke: #b3c0d1;
  stroke-width: 2;
}

.mm-node {
  position: absolute;
  z-index: 2;
  min-width: 120px;
  max-width: 220px;
  min-height: 44px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid #409eff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s;
}

.mm-node:hover {
  box-shadow: 0 4px 14px rgba(64, 158, 255, 0.22);
}

.mm-node.selected {
  border-color: #337ecc;
  background: #ecf5ff;
  box-shadow: 0 4px 16px rgba(64, 158, 255, 0.3);
}

.mm-node.root {
  border-color: #e6a23c;
  background: linear-gradient(135deg, #fff9f0 0%, #fff 100%);
  font-weight: 600;
}

.mm-node.dragging {
  cursor: grabbing;
  opacity: 0.92;
  z-index: 10;
}

.mm-collapse-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: #f0f2f5;
  border-radius: 4px;
  cursor: pointer;
  color: #606266;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mm-collapse-btn:hover {
  background: #e4e7ed;
}

.mm-node-text {
  flex: 1;
  font-size: 14px;
  color: #303133;
  line-height: 1.4;
  word-break: break-all;
}

.mm-node-text.empty {
  color: #c0c4cc;
  font-style: italic;
}

.mm-node-input {
  flex: 1;
  border: 1px solid #409eff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px;
  outline: none;
  min-width: 80px;
}

.mm-node-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.mm-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: #909399;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mm-btn:hover {
  background: #f0f2f5;
  color: #409eff;
}

.editor-canvas-wrap .empty-tip {
  padding: 80px 20px;
  text-align: center;
  color: #909399;
}
