/* arch.css - 树形布局样式（使用 CSS 变量，与系统样式一致） */

#page-arch {
  position: relative;
}

/* ==================== 标签页按钮（与新建项目按钮样式一致） ==================== */
.arch-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: 50px; /* 大圆角胶囊形状 */
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  height: 36px; /* 与 .btn 高度一致 */
  line-height: 1;
}

.arch-tab-btn:hover {
  background: var(--surface2);
  border-color: var(--primary);
}

.arch-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.arch-tab-btn.active:hover {
  background: var(--primary);
  opacity: .9;
}

.arch-tree {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
}

.arch-empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 1rem;
}

/* ==================== 项目节点 ==================== */
.project-node {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  width: max-content;
  min-width: 200px;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.project-node:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== 环节节点容器 ==================== */
.project-stages {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-left: 2rem;
  flex-wrap: wrap;
}

/* ==================== 环节节点 ==================== */
.stage-node {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  min-width: 120px;
  text-align: center;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.stage-node:hover {
  border-color: var(--primary);
  background: var(--surface);
}

.stage-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stage-tasks {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==================== 环节进度条 ==================== */
.stage-progress {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.stage-progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.stage-progress-text {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ==================== Badge（分类标签） ==================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-g {
  background: rgba(62, 207, 106, 0.15);
  color: var(--green);
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 768px) {
  .project-stages {
    flex-direction: column;
    margin-left: 1rem;
  }

  .project-node {
    min-width: 100%;
    width: 100%;
  }

  .stage-node {
    min-width: 100%;
  }
}
