* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft Yahei", sans-serif;
}
body {
  padding: 30px;
  background: #fff;
}
/* 最外层容器，横向排列 */
.tree-wrap {
  display: flex;
  align-items: flex-start;
}
	.tree-wrap a{
  color: #fff;
}
/* 根节点：外国语学院，竖排文字 */
.tree-root {
  background-color: #0066bb;
  color: #fff;
  padding: 14px 16px;
  border-radius: 4px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 18px;
  font-weight: bold;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 树列表基础样式，清除默认圆点 */
.tree-list {
  list-style: none;
  margin-left: 40px;
  position: relative;
}
.tree-list > li {
  margin-bottom: 26px;
  position: relative;
}
/* 一级节点（行政机构、教学单位...） */
.level-1 {
  display: inline-block;
  background-color: #22b8dd;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 17px;
  position: relative;
}
/* 一级节点向左的横线 */
.level-1::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 50%;
  width: 30px;
  height: 1px;
  background: #555;
}
/* 二级子列表 */
.tree-child {
  list-style: none;
  margin-left: 80px;
  margin-top: 10px;
  position: relative;
}
/* 二级列表左侧竖线 */
.tree-child::before {
  content: "";
  position: absolute;
  left: -50px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #555;
}
.tree-child > li {
  margin-bottom: 10px;
  position: relative;
}
/* 二级节点样式 */
.level-2 {
  display: inline-block;
  background-color: #00c29b;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 16px;
  position: relative;
}
.level-2::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 50%;
  width: 30px;
  height: 1px;
  background: #555;
}
/* 三级子列表（研究生英语教学部下的两个） */
.tree-grandchild {
  list-style: none;
  margin-left: 80px;
  margin-top: 16px; /* 向下偏移，避免遮挡上级节点 */
  position: relative;
}
.tree-grandchild::before {
  content: "";
  position: absolute;
  left: -50px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #555;
}
.tree-grandchild > li {
  margin-bottom: 10px;
  position: relative;
}
.level-3 {
  display: inline-block;
  background-color: #63b8ee; /* 浅蓝背景 */
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 16px;
  position: relative;
}
.level-3::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 50%;
  width: 30px;
  height: 1px;
  background: #555;
}

/* 响应式适配：小屏幕改为纵向布局 */
@media (max-width:768px) {
  .tree-wrap {
    flex-direction: column;
  }
  .tree-root {
    writing-mode: horizontal-tb;
    height: auto;
    width: fit-content;
    margin-bottom: 20px;
  }
  .tree-list {
    margin-left: 0;
  }
  .tree-child {
    margin-left: 40px;
  }
  .tree-grandchild {
    margin-left: 40px;
  }
}
