/**
 * org.css - 组织机构页面样式
 * 主题色统一使用 common.css 中的 CSS 变量
 */

/* ==================== 主内容区域 ==================== */
.main-content {
  padding: 36px 0;
  min-height: 75vh;
}

/* ==================== 分类筛选栏 ==================== */
.filter-bar {
  background: #fff;
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 600;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  background: var(--border-soft);
  color: var(--text-sub);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-tag.active {
  background: var(--primary-color);
  color: #fff;
}

/* ==================== 组织机构树状图 ==================== */
.org-list-container {
  background: #fff;
  padding: 40px 30px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.org-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 根节点 */
.org-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
}

.org-root-box {
  background: #EBF2FF;
  color: var(--primary-color);
  font-size: 22px;
  font-weight: 600;
  padding: 16px 60px;
  border-radius: 6px;
  min-width: 180px;
  text-align: center;
}

.org-root-connector {
  width: 2px;
  height: 40px;
  background: #D0D8E4;
}

/* 子节点行 */
.org-children-row {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding-top: 0;
}

.org-horizontal-line {
  position: absolute;
  top: 0;
  left: calc(12px + 10%);
  right: calc(2px + 10%);
  height: 2px;
  background: #D0D8E4;
}

.org-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 8%;
  margin-left: 10px;
}

.org-child-connector {
  width: 2px;
  height: 24px;
  background: #D0D8E4;
}

.org-child-box {
  background: #EBF2FF;
  padding: 16px 10px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  width: 100%;
}

.org-child-text {
  writing-mode: vertical-lr;
  text-orientation: upright;
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  white-space: normal;
  height: 11em;
  overflow-wrap: break-word;
  display: inline-block;
  vertical-align: middle;
  text-align: center;
}

/* ==================== 响应式适配 ==================== */
/* 移动端 (<= 768px) */
@media screen and (max-width: 1200px) {
  .org-list-container {
    padding: 24px 16px;
  }
  .org-child-text {
    height: unset;
  }
  .org-chart {
    align-items: flex-start;
    padding-left: 40px;
  }

  .org-root {
    position: relative;
    align-items: flex-start;
    margin-left: -40px;
    margin-bottom: 24px;
  }

  .org-root::after {
    content: '';
    position: absolute;
    left: 12px;
    bottom: -24px;
    width: calc(50% - 12px);
    height: 24px;
    border-left: 2px solid #D0D8E4;
  }

  .org-root-box {
    font-size: 18px;
    padding: 12px 40px;
  }

  .org-root-connector {
    display: none;
  }

  .org-children-row {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .org-children-row::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 0;
    bottom: calc(5% + 4px);
    width: 2px;
    background: #D0D8E4;
  }

  .org-horizontal-line {
    display: none;
  }

  .org-child {
    position: relative;
    flex-direction: row;
    align-items: center;
    max-width: none;
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 12px;
    margin-left: 0;
  }

  .org-child::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: #D0D8E4;
  }

  .org-child-connector {
    display: none;
  }

  .org-child-box {
    min-height: auto;
    padding: 10px 16px;
    width: 100%;
  }

  .org-child-text {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    font-size: 14px;
    letter-spacing: 1px;
  }
}
