/* 学生会、研究生会组织结构图。
 * 独立样式，放在 party-organizations.css 之后引入。
 * 仅使用基础 flex 布局与伪元素连线，兼容博达系统页面。
 */

.org-chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 14px;
}

.org-chart-caption {
  margin: 30px 0 0;
  padding-left: 11px;
  border-left: 3px solid #0755a5;
  color: #0755a5;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.org-chart-caption:first-of-type {
  margin-top: 2px;
}

.org-chart--wide .org-chart__branch {
  max-width: 380px;
}

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 860px;
  padding: 6px 12px 0;
  box-sizing: border-box;
}

.org-chart__root,
.org-chart__leader,
.org-chart__box {
  box-sizing: border-box;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbfe;
  color: #243850;
  text-align: center;
  box-shadow: 0 6px 18px rgba(23, 63, 104, 0.06);
}

.org-chart__root {
  position: relative;
  padding: 12px 28px;
  border-color: #0755a5;
  background: #0755a5;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 22px rgba(7, 85, 165, 0.18);
}

.org-chart__root::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 26px;
  margin-left: -1px;
  background: #a9c6e3;
}

.org-chart__leader {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 320px;
  margin-top: 26px;
  padding: 15px 32px;
  border: 2px solid #c5dcef;
  background: linear-gradient(115deg, #f0f6fc, #fff 82%);
  box-shadow: 0 10px 28px rgba(23, 63, 104, 0.08);
  line-height: 1.7;
}

.org-chart__leader::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 26px;
  margin-left: -1px;
  background: #a9c6e3;
}

.org-chart__leader-title {
  color: #0755a5;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.org-chart__leader-line {
  color: #4e6278;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8;
}

.org-chart__leader-people {
  margin-top: 4px;
  color: #0755a5;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8;
  white-space: nowrap;
}

.org-chart__departments {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  margin-top: 26px;
}

.org-chart__branch {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  max-width: 280px;
  padding: 26px 4px 0;
  text-align: center;
}

.org-chart__branch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #a9c6e3;
}

.org-chart__branch::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 26px;
  margin-left: -1px;
  background: #a9c6e3;
}

.org-chart__branch:first-child::before {
  left: 50%;
}

.org-chart__branch:last-child::before {
  right: 50%;
}

.org-chart__box {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
  padding: 14px 10px 16px;
  line-height: 1.6;
}

.org-chart__box-title {
  display: block;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe7f3;
  color: #0755a5;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.org-chart__box-line {
  display: block;
  color: #4e6278;
  font-size: 14px;
  line-height: 1.75;
  text-align: left;
  overflow-wrap: anywhere;
}

.org-chart__box-people {
  display: block;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed #cfdeed;
  color: #0755a5;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.75;
  text-align: left;
  word-break: keep-all;
  overflow-wrap: normal;
  word-spacing: 0.2em;
}

@media (max-width: 760px) {
  .org-chart {
    min-width: 860px;
    padding: 6px 4px 0;
  }

  .org-chart__root {
    padding: 11px 20px;
    font-size: 16px;
  }

  .org-chart__leader {
    min-width: 280px;
    padding: 14px 22px;
  }

  .org-chart__leader-title {
    font-size: 19px;
  }

  .org-chart__leader-line {
    font-size: 15px;
  }

  .org-chart__leader-people {
    font-size: 14px;
  }

  .org-chart__branch {
    padding-left: 6px;
    padding-right: 6px;
  }

  .org-chart__box {
    padding: 13px 10px 14px;
  }

  .org-chart__box-title {
    font-size: 16px;
  }

  .org-chart__box-line {
    font-size: 13px;
  }

  .org-chart__box-people {
    font-size: 14px;
  }
}
