/* star.css — 星图壳与星空首页（site-star-map.org）。
   三栏聚焦：桌面左（星图总览 + 当前星球的结构树）/中内容/右（本页目录与
   邻接）；窄屏中央优先，「总览」「关联」按钮开抽屉。星空画布永远是深空底
   （星图自身的视觉，不随主题翻转）；其余表面一律走站点语义令牌
   （global.css：--bg-* / --text-* / --border-* / --accent-*），随主题切换。 */

.star-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 264px;
  gap: 18px;
  align-items: start;
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px clamp(12px, 3vw, 28px) 48px;
}
/* 右栏没有内容的页（星球落点页：入口列在正文里）→ 两栏。 */
.star-shell-two {
  grid-template-columns: 232px minmax(0, 1fr);
}

.star-center {
  min-width: 0;
}
.star-center .container {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* ── 左 dock：总览 ─────────────────────────────────────────────── */
.star-left {
  position: sticky;
  top: 76px;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-surface);
}
.star-left-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-default);
}
.star-overview-link {
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
/* 左栏自己的关闭键：只在 ≤760px（左栏是抽屉时）出现（尺寸见 .star-adj-close） */
.star-left-close {
  display: none;
}
.star-canvas {
  display: block;
  width: 100%;
}
.star-canvas-mini {
  height: 190px;
}
.star-module-list {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  border-top: 1px solid var(--border-default);
}
.star-module-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
}
.star-module-list a:hover {
  background: var(--bg-subtle);
}
.star-module-list a[aria-current="page"] {
  background: var(--accent-subtle);
  font-weight: 600;
}

/* ── 右栏：邻接（关系有名称：所属星球/子节点/前置/相关/对照/同级） ── */
.star-right {
  position: sticky;
  top: 76px;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  background: var(--bg-surface);
  padding: 12px 14px 16px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}
.star-adj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.star-adj-title {
  font-weight: 700;
  font-size: 14px;
}
.star-adj-close {
  display: none;
}
/* 关闭键只在抽屉模式出现:32px 点击区(负外边距不撑高标题行) */
.star-adj-close,
.star-left-close {
  min-width: 32px;
  min-height: 32px;
  margin: -8px -8px -8px 0;
  border: 0;
  border-radius: var(--zt-radius-sm);
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
}
.star-adj-close:hover,
.star-left-close:hover {
  background: var(--bg-subtle);
}
.star-adj-group {
  margin-top: 10px;
}
.star-adj-group h4 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.star-adj-group nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.star-adj-link {
  font-size: 13.5px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  padding: 4px 8px;
  margin-left: -8px;
}
.star-adj-link:hover {
  background: var(--bg-subtle);
}

/* ── 星空首页 ──────────────────────────────────────────────────── */
.star-stage {
  position: relative;
  height: min(72vh, 660px);
  background: #070b14;
  overflow: hidden;
}
/* 画布只做增强：没有脚本就整块不占位——首页星空舞台收起（卡片直接顶上来），
   左栏缩略星图不画。zt-js 由页面头的内联脚本加上（apps/server/html.zio）。 */
html:not(.zt-js) .star-stage,
html:not(.zt-js) .star-canvas-mini {
  display: none;
}
/* 只给读屏的标题（首页星空没有可见标题，页面仍要有 h1） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.star-canvas-home {
  position: absolute;
  inset: 0;
  height: 100%;
  cursor: default;
}
.star-stage-hint {
  /* 提示行放在左上角：星空的扇形从中心向外铺，角上最空。 */
  position: absolute;
  left: 18px;
  top: 14px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 13px;
  margin: 0;
  pointer-events: none;
}
/* 提示后半句按输入方式切换:触屏没有「悬停」 */
.star-hint-touch {
  display: none;
}
@media (hover: none) {
  .star-hint-hover {
    display: none;
  }
  .star-hint-touch {
    display: inline;
  }
}
.star-home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 26px auto 48px;
  padding: 0 clamp(12px, 3vw, 28px);
}
.star-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-surface);
}
.star-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.14);
}
.star-card-star {
  color: var(--accent-primary);
  font-size: 18px;
  line-height: 1;
}
.star-card-title {
  font-weight: 700;
  font-size: 16px;
}
.star-card-summary {
  font-size: 13.5px;
  color: var(--text-tertiary);
}
.star-card-count {
  font-size: 12px;
  color: var(--text-tertiary);
  opacity: 0.8;
}

/* ── 窄屏：中央优先，左右由按钮开抽屉（设计 §窄屏） ─────────────── */
.star-dock-btn {
  display: none;
}
/* 关着的抽屉要在滑出动画结束后才 visibility:hidden——键盘焦点不会
   落进屏幕外的链接里；打开时立即可见、只动 transform。 */
@media (max-width: 1080px) {
  .star-right {
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .star-right.open {
    visibility: visible;
    transition: transform 0.22s ease;
  }
}
@media (max-width: 760px) {
  .star-left {
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .star-left.open {
    visibility: visible;
    transition: transform 0.22s ease;
  }
  .star-left-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 1080px) {
  .star-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .star-right {
    position: fixed;
    z-index: 120; /* 高于站点顶栏(100):抽屉自己的关闭键不能被顶栏盖住 */
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    max-height: none;
    border-radius: 14px 0 0 14px;
    transform: translateX(105%);
    transition: transform 0.22s ease;
  }
  .star-right.open {
    transform: none;
    box-shadow: -12px 0 40px rgba(2, 6, 23, 0.35);
  }
  .star-adj-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .star-dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    z-index: 55;
    right: 14px;
    bottom: 16px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(2, 6, 23, 0.18);
  }
  .star-dock-btn-right {
    bottom: 64px;
  }
}

@media (max-width: 760px) {
  .star-shell {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 8px;
  }
  .star-left {
    position: fixed;
    z-index: 120; /* 同右抽屉:盖在站点顶栏之上 */
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 84vw);
    border-radius: 0 14px 14px 0;
    overflow: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  .star-left.open {
    transform: none;
    box-shadow: 12px 0 40px rgba(2, 6, 23, 0.35);
  }
  .star-stage {
    height: min(56vh, 480px);
    border-radius: 0 0 14px 14px;
  }
  .star-stage-hint {
    left: 12px;
    right: 12px;
    top: 10px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .star-right,
  .star-left {
    transition: none;
  }
}

/* ════════════════════════════════════════════════════════════════
   星图壳新增 DOM:顶栏搜索 / 左栏结构树 / 右栏目录与关系 /
   文档页中栏 / 星球落点页 / 搜索结果页。
   全部用语义令牌,随主题自动切换。 */

/* ── 顶栏搜索:表单、浮层与命中高亮 ────────────────────────────────── */
.nav-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-search-input {
  width: clamp(150px, 16vw, 220px);
  height: 34px;
  padding: 0 30px 0 var(--zt-space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-full);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: border-color var(--zt-motion-fast) var(--zt-ease);
}
.nav-search-input:focus {
  border-color: var(--accent-primary);
}
.nav-search-input::placeholder {
  color: var(--text-tertiary);
}
.nav-search-btn {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--zt-radius-sm);
  background: none;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--zt-motion-fast) var(--zt-ease);
}
.nav-search-btn:hover {
  color: var(--text-primary);
}

/* 浮层:输入框正下方,盖住 header 内容(顶栏 z-index 100) */
.nav-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 130;
  width: min(380px, 92vw);
  max-height: 60vh;
  overflow: auto;
  padding: var(--zt-space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-lg);
  box-shadow: var(--zt-shadow-lg);
}
.nav-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px var(--zt-space-2);
  padding: var(--zt-space-2) var(--zt-space-3);
  border: 0;
  border-radius: var(--zt-radius-sm);
  color: inherit;
  text-decoration: none;
}
.nav-search-result:hover,
.nav-search-result.is-active {
  background: var(--bg-subtle);
}
/* 键盘游标(↑/↓):左侧内嵌主色条,与鼠标悬停区分开 */
.nav-search-result.is-active {
  background: var(--accent-subtle);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}
.nav-search-result .nav-search-kind {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
}
.nav-search-result .nav-search-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-search-result .nav-search-summary {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-search-more {
  display: block;
  margin-top: var(--zt-space-1);
  padding: var(--zt-space-2) var(--zt-space-3);
  border-top: 1px solid var(--border-default);
  font-size: 13px;
  text-align: center;
  color: var(--accent-primary);
  text-decoration: none;
}
.nav-search-more:hover {
  color: var(--accent-hover);
}

/* 种类徽标:顶栏搜索与搜索结果页共用 */
.nav-search-kind,
.search-kind {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-full);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: nowrap;
}
.nav-search-kind[data-kind="page"],
.search-kind[data-kind="page"] {
  color: var(--text-secondary);
}
.nav-search-kind[data-kind="concept"],
.search-kind[data-kind="concept"] {
  color: var(--ph-ask);
}
.nav-search-kind[data-kind="experiment"],
.search-kind[data-kind="experiment"] {
  color: var(--ph-revise);
}
.nav-search-kind[data-kind="function"],
.search-kind[data-kind="function"] {
  color: var(--accent-primary);
}
.nav-search-kind[data-kind="macro"],
.search-kind[data-kind="macro"] {
  color: var(--ph-exec);
}
.nav-search-kind[data-kind="native"],
.search-kind[data-kind="native"] {
  color: var(--ph-extract);
}
.nav-search-kind[data-kind="special-form"],
.search-kind[data-kind="special-form"],
.nav-search-kind[data-kind="module"],
.search-kind[data-kind="module"],
.nav-search-kind[data-kind="tool"],
.search-kind[data-kind="tool"] {
  color: var(--ph-check);
}

/* 命中高亮:背景淡、字色继承、不加粗 */
.nav-search mark,
.search-page mark {
  padding: 0 2px;
  border-radius: var(--zt-radius-sm);
  background: var(--accent-subtle);
  color: inherit;
  font-weight: inherit;
}

/* ── 顶栏搜索:窄屏(与顶栏 980px / 640px 断点对齐) ───────────────── */
@media (max-width: 980px) {
  .nav-search-input {
    width: 160px;
  }
}
@media (max-width: 640px) {
  /* 单行放不下「标志 + 版本徽标 + 搜索 + 两个按钮」:版本徽标收起(页脚
     仍有版本/分支/commit);操作区可缩,搜索框吃掉剩余宽度(标志与两个
     按钮不缩)——320px 宽也是一行 */
  .logo-tag {
    display: none;
  }
  .nav-bar {
    flex-wrap: nowrap;
  }
  .nav-actions {
    min-width: 0;
  }
  .nav-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 240px;
  }
  .nav-search-input {
    width: 100%;
    min-width: 0;
    padding-right: var(--zt-space-3);
  }
  .nav-search-btn {
    display: none;
  }
  /* 下拉层不再锚在搜索框右缘(窄屏会伸出屏幕左边):贴屏幕两侧的固定层 */
  .nav-search-results {
    position: fixed;
    top: 62px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 84px);
  }
}

/* ── 左栏:手册结构树 ─────────────────────────────────────────────── */
.star-tree {
  padding: var(--zt-space-2) 10px 14px;
  border-top: 1px solid var(--border-default);
}
.star-tree-head {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.star-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.star-tree-list .star-tree-list {
  margin-left: var(--zt-space-3);
  padding-left: var(--zt-space-2);
  border-left: 1px solid var(--border-default);
}
.star-tree-link {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px var(--zt-space-2);
  border-radius: var(--zt-radius-sm);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-secondary);
  text-decoration: none;
}
.star-tree-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.star-tree-link[aria-current="page"] {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}
.star-tree-item.is-on-path > .star-tree-link {
  color: var(--text-primary);
  font-weight: 600;
}
.star-tree-count {
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--zt-radius-full);
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  font-family: var(--zt-font-mono);
  font-size: 11px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.star-tree-link-code code {
  font-family: var(--zt-font-mono);
  font-size: 12.5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

/* 左栏变高:sticky 元素超出视口时底部要能滚到 */
.star-left {
  max-height: calc(100vh - 90px);
  overflow: auto;
}
/* ≤760px 左栏是全高抽屉,不受上面的高度上限约束 */
@media (max-width: 760px) {
  .star-left {
    max-height: none;
  }
}

/* ── 右栏:本页目录 + 带色关系 ────────────────────────────────────── */
.star-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 40vh;
  overflow: auto;
}
.star-toc-link {
  display: block;
  padding: 3px var(--zt-space-2);
  margin-left: -8px;
  border-left: 2px solid transparent;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
.star-toc-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.star-toc-link[data-toc-depth="3"] {
  padding-left: 22px;
}
.star-toc-link[data-toc-depth="4"] {
  padding-left: 34px;
}

/* 关系有名称:左色标区分前置 / 相关 / 对照 */
.star-adj-prerequisite .star-adj-link {
  padding-left: var(--zt-space-2);
  border-left: 2px solid var(--ph-ask);
}
.star-adj-related .star-adj-link {
  padding-left: var(--zt-space-2);
  border-left: 2px solid var(--ph-extract);
}
.star-adj-contrast .star-adj-link {
  padding-left: var(--zt-space-2);
  border-left: 2px solid var(--ph-exec);
}
.star-adj-fn code {
  font-family: var(--zt-font-mono);
  font-size: 12.5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

/* ── 文档页中栏:三栏里重排原有文档规则(仅作用域覆盖) ───────────── */
.star-doc .doc-crumbs {
  max-width: none;
  padding: 14px 0 0;
}
.star-doc .doc-body {
  padding-top: 10px;
}
.star-doc .prose {
  max-width: 820px;
}

/* 章节列表 */
.doc-children {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border-default);
}
.doc-children h2 {
  margin: 0 0 var(--zt-space-3);
  font-size: 1.15rem;
}
.doc-child-list {
  display: grid;
  gap: var(--zt-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: child;
}
.doc-child-list > li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 0 var(--zt-space-2);
  padding: 10px var(--zt-space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-md);
  background: var(--bg-surface);
}
.doc-child-list > li::before {
  counter-increment: child;
  content: counter(child);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--zt-radius-full);
  background: var(--accent-subtle);
  color: var(--accent-primary);
  font-family: var(--zt-font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.doc-child-list > li:hover {
  border-color: var(--accent-primary);
}
.doc-child-link {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.doc-child-summary {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── 星球落点页:分册与章片清单 ───────────────────────────────────── */
.planet-head {
  margin-bottom: 14px;
}
.planet-volumes {
  display: grid;
  /* 各块按自身内容取高：子节点少的入口块不随同行撑成空框 */
  align-items: start;
  gap: 18px;
}
.planet-volume {
  padding: 18px 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-lg);
  background: var(--bg-surface);
}
.planet-volume-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.planet-volume-title:hover {
  color: var(--accent-primary);
}
.planet-volume-summary {
  margin: 6px 0 var(--zt-space-3);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.planet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zt-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.planet-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px var(--zt-space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-full);
  background: var(--bg-canvas);
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.planet-chip-order {
  font-family: var(--zt-font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
}
.planet-chip:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* 宽屏:章节列表两列 */
@media (min-width: 1100px) {
  .doc-child-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .planet-volumes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── 搜索结果页(普通阅读页,不在三栏壳里) ────────────────────────── */
.search-page {
  padding-top: 26px;
  padding-bottom: 56px;
}
.search-form {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 14px 0 18px;
}
.search-input {
  flex: 1;
  height: 44px;
  padding: 0 var(--zt-space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-full);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  transition: border-color var(--zt-motion-fast) var(--zt-ease);
}
.search-input:focus {
  border-color: var(--accent-primary);
}
.search-summary {
  margin: 0 0 var(--zt-space-4);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.search-results {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.search-result {
  padding: var(--zt-space-3) 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-md);
  background: var(--bg-surface);
}
.search-result-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.search-result-link:hover .search-result-title {
  color: var(--accent-primary);
}
.search-result-title {
  min-width: 0;
  font-weight: 600;
  color: var(--text-primary);
}
.search-result-path {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.search-result-summary {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.search-empty,
.search-hint {
  padding: 18px 0;
  color: var(--text-secondary);
}

/* 窄屏:路径换行,整行落到下一行 */
@media (max-width: 640px) {
  .search-result-link {
    flex-wrap: wrap;
  }
  .search-result-path {
    margin-left: 0;
    flex-basis: 100%;
    white-space: normal;
  }
}

/* ── 参考页与符号页:分组标题、模块行、种类徽标 ───────────────────── */
/* 星图壳中栏约 850px,首页任务行的两列放不下三格内容 → 单列;
   模块行首列是源码路径(libs/… 较长),比首页任务行的首列宽 */
.star-doc .task-list {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
}
.task-row.ref-row {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
}
.task-row.ref-row b code {
  font-size: 0.9rem;
}
@media (max-width: 900px) {
  .task-row.ref-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-row.ref-row span {
    grid-column: 1;
  }
}
.star-doc .ref-group-title {
  margin: 30px 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text-primary);
}
.star-doc .ref-group-title:first-of-type {
  margin-top: 18px;
}

/* 种类徽标:函数 / 宏 / native / 特殊形式 / 模块 / 工具,配色同函数地图图例 */
.symbol-kind {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: var(--zt-radius-full);
  font-family: var(--zt-font-mono);
  font-size: 12px;
  line-height: 1.7;
  vertical-align: 1px;
  color: var(--text-secondary);
}
.symbol-kind[data-kind="function"] {
  color: var(--accent-primary);
}
.symbol-kind[data-kind="macro"] {
  color: var(--ph-exec);
}
.symbol-kind[data-kind="native"] {
  color: var(--ph-extract);
}
.symbol-kind[data-kind="special-form"],
.symbol-kind[data-kind="module"],
.symbol-kind[data-kind="tool"] {
  color: var(--ph-check);
}

/* 签名行:(map f coll) */
.symbol-sig {
  margin: 0 0 18px;
}
.symbol-sig code {
  font-family: var(--zt-font-mono);
  font-size: 0.95rem;
  padding: 3px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-sm);
  background: var(--bg-subtle);
  color: var(--accent-primary);
  overflow-wrap: anywhere;
}

/* 标题里的符号名(模块路径、函数名):等宽,但按标题字号缩放 */
.doc-body h1 code {
  font-family: var(--zt-font-mono);
  font-size: 0.78em;
  padding: 0 0.2em;
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-sm);
  background: var(--bg-subtle);
  color: inherit;
  overflow-wrap: anywhere;
}

/* ── 构想星球:概念页 / 落点页 / 实验页 ──────────────────────────── */
/* 这几类页面原按「零脚本的语义 HTML」做成,自带的标记(切换条、注记、关系区)
   此前没有样式;进星图壳后按中栏版式补齐,规则一律限定在 .star-doc 内。 */

/* 版本／语言切换条:标题下的一行元信息,窄屏自动换行
   (实验会话页的位置导航沿用同一条,见文末 .session-page) */
.star-doc .switches,
.session-page .switches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 22px;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--zt-radius-md);
  background: var(--bg-subtle);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.star-doc .switches p,
.session-page .switches p {
  margin: 0;
}
.star-doc .switches .current,
.session-page .switches .current {
  color: var(--text-primary);
  font-weight: 600;
}
.star-doc .switches .missing,
.session-page .switches .missing {
  color: var(--text-tertiary);
}

/* 紧跟标题的注记(正文沿自早期版本 / 本面没有所属概念) */
.star-doc .inherited,
.star-doc .doc-note {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
.star-doc .doc-note {
  margin: 0 0 16px;
}
/* 清单与关系区里的同类标注:不另起一行,弱化显示 */
.star-doc .doc-child-list .inherited,
.star-doc .relations .inherited {
  font-size: 0.78rem;
}
.star-doc .doc-child-list .missing,
.star-doc .relations .missing {
  color: var(--text-tertiary);
}
.star-doc .doc-child-list .missing {
  grid-column: 2;
}

/* 概念页底部的关系:几组并排。右栏是图上的邻接,这里是内容源的关系
   (多一组「后续概念」),也是窄屏与禁用 JS 时(右栏打不开)的关系入口 */
.star-doc .relations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border-default);
}
.star-doc .relations h2 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}
.star-doc .relations ul,
.star-doc .relations p {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.star-doc .relations li + li {
  margin-top: 4px;
}

/* ── 实验会话页 ───────────────────────────────────────────────────
   无 JS 原生表单的执行会话(会话带着本人观察,不套星图壳)。正文自己带容器;
   <article> 用 .prose 的版式,这里只补会话页特有的部分。 */
.session-page {
  padding-top: 22px;
  padding-bottom: 56px;
}
.session-page > article {
  max-width: 900px;
}
.session-page dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.session-page dt {
  color: var(--text-tertiary);
}
.session-page dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.session-page section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-default);
}
.session-page h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.session-page .step h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}
.session-page .step form {
  margin: 0 0 4px 4px;
}
.session-page .btn {
  padding: 7px 14px;
}
.session-page .session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.session-page .note {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
.session-page pre {
  overflow-x: auto;
}

/* ── 错误页 ───────────────────────────────────────────────────────
   类型化错误页（404／405／500 等）不套星图壳：正文自己带容器。
   「错误码／请求路径／说明」两列排，说明里的长路径允许折行。 */
.error-page {
  padding-top: 40px;
  padding-bottom: 24px;
}
.error-page > article {
  max-width: 900px;
}
.error-page h1 {
  margin: 0 0 18px;
  font-size: 1.6rem;
}
.error-page dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.error-page dt {
  color: var(--text-tertiary);
}
.error-page dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.error-page .hints {
  margin: 0 0 18px 20px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.error-page .hints li + li {
  margin-top: 4px;
}
.error-page a {
  color: var(--accent-primary);
}

/* ── 短页面页脚贴底 ───────────────────────────────────────────────
   正文不足一屏时（无脚本的首页、实验会话页、错误页）页脚下面不留空白。
   star.css 在 global.css 之后加载。body 的直接子元素成为纵向弹性项，
   块级子元素照旧撑满宽度，与原来的块排版一致。 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body > footer {
  margin-top: auto;
}
