Given two axis-aligned 3D bounding boxes, implement a function that returns their Intersection over Union (IoU) as a floating-point number. Each box is represented as [x1, y1, z1, x2, y2, z2], where (x1, y1, z1) is the minimum corner and (x2, y2, z2) is the maximum corner.
def iou_3d(box1, box2):