/* atlas — 软件图谱页专属布局（只装 .atlas-* 类，不污染手册页） */

.atlas-banner {
  max-width: 1060px; margin: 0 auto; padding: 1.4rem 1.2rem 0.6rem;
}
.atlas-banner h1 { margin: 0 0 .5rem; font-size: 1.5rem; color: var(--accent); }
.atlas-banner p { margin: .45rem 0; font-size: .92rem; line-height: 1.8; color: var(--ink); }
.atlas-boundary {
  background: var(--accent-soft); border-left: 3px solid var(--accent2);
  border-radius: 6px; padding: .5rem .8rem; font-size: .85rem;
}

.atlas-layout {
  max-width: 1060px; margin: 0 auto; padding: 1rem 1.2rem 2rem;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.4rem;
  align-items: start;
}

/* —— 目录（左 sticky）—— */
.atlas-toc { position: sticky; top: 1rem; }
.atlas-toc-box { background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.atlas-toc-box summary {
  cursor: pointer; font-weight: 600; color: var(--accent);
  font-size: .9rem; user-select: none;
}
.atlas-toc-box nav { margin-top: .45rem; display: flex; flex-direction: column; gap: .12rem; }
.atlas-toc-box nav a {
  color: var(--ink); text-decoration: none; font-size: .82rem;
  padding: .22rem .45rem; border-radius: 6px; line-height: 1.5;
}
.atlas-toc-box nav a.toc-spine { font-weight: 500; }
.atlas-toc-box nav a:hover { background: var(--accent-soft); }
.atlas-toc-box nav a.is-active {
  background: var(--accent); color: #fff;
}

/* —— 正文区 —— */
.atlas-main { min-width: 0; }
.atlas-section { scroll-margin-top: 4.5rem; }

/* —— 软件档案卡片 —— */
.atlas-card {
  border: 1px solid var(--line); border-left: 4px solid var(--accent2);
  border-radius: 10px; margin: 1.3rem 0; background: #fff;
}
.atlas-card-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .7rem .9rem; border-bottom: 1px solid var(--line);
}
.atlas-card-head h2 { margin: 0; font-size: 1.15rem; color: var(--accent); }
.atlas-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.atlas-badge {
  font-style: normal; font-size: .72rem; padding: .12rem .5rem;
  border-radius: 999px; white-space: nowrap;
}
.atlas-badge-cat { background: var(--accent-soft); color: var(--accent); }
.atlas-badge-chain { background: #eaf2fb; color: #1f5fa8; }
.atlas-badge-fid { background: #eef6ee; color: #2e7d32; }
.atlas-badge-ev { background: #fdf1e3; color: #9a6a1e; }
.atlas-card-body { padding: .3rem .9rem .8rem; }

/* —— 引用 chip（3 类视觉）—— */
.atlas-chip {
  display: inline-block; font-size: .78rem; line-height: 1.7;
  padding: 0 .45rem; border-radius: 999px; margin: 0 .1rem;
  text-decoration: none; white-space: nowrap;
}
.atlas-chip-manual { background: #eaf2fb; color: #1f5fa8; border: 1px solid #c9dcf5; }
.atlas-chip-diag { background: #eef6ee; color: #2e7d32; border: 1px solid #cde8cd; }
.atlas-chip-expl { background: #f3f0fb; color: #6a4fb3; border: 1px solid #ddd5f2; }
.atlas-chip-lec { background: #fdf1e3; color: #9a6a1e; border: 1px solid #f3ddbc; }
.atlas-chip-hub { background: #fdf0f0; color: #b3261e; border: 1px solid #f2caca; }
.atlas-chip a:hover { text-decoration: underline; }
/* repo 灰文本 + Hub 暂无条目徽标：不可点 */
.atlas-chip-repo {
  background: #f2f4f7; color: var(--muted); border: 1px dashed var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem; border-radius: 4px;
}
.atlas-chip-badge {
  background: #f2f4f7; color: var(--muted); border: 1px solid var(--line);
}
.atlas-chip-broken { background: #fdf0f0; color: #b3261e; border: 1px dashed #f2caca; }

/* —— 引用索引 —— */
.atlas-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0; }
.atlas-filter select, .atlas-filter input {
  font: inherit; font-size: .85rem; padding: .3rem .6rem;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.atlas-filter input { flex: 1 1 180px; min-width: 140px; }
.atlas-index-scroll { overflow-x: auto; }
.atlas-index-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.atlas-index-table th, .atlas-index-table td {
  border: 1px solid var(--line); padding: .32rem .5rem; white-space: nowrap;
}
.atlas-index-table th { background: var(--accent-soft); color: var(--accent); text-align: left; }
.atlas-index-table td:nth-child(2) { white-space: normal; min-width: 12em; }

/* —— 窄屏：单栏 + 目录顶置 —— */
@media (max-width: 900px) {
  .atlas-layout { grid-template-columns: 1fr; }
  .atlas-toc { position: static; }
  .atlas-toc-box nav { flex-direction: row; flex-wrap: wrap; }
}
