/* 状态徽章与圆点 */
.badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--ready {
  color: var(--ready);
  background: var(--ready-soft);
}

.badge--partial {
  color: var(--partial);
  background: var(--partial-soft);
}

.badge--open {
  color: var(--open);
  background: var(--open-soft);
}

.dot {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot--ready {
  background: var(--ready);
}

.dot--partial {
  background: var(--partial);
}

.dot--open {
  background: #b8bec7;
}

.dot--branch {
  background: none;
  border: 1.5px solid var(--faint);
}

.flag {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--todo);
  border: 1px dashed var(--todo);
  background: var(--todo-soft);
  white-space: nowrap;
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: 1px;
}

.tag--idea {
  color: var(--embodied);
  background: var(--embodied-soft);
  border: 1px solid #b9e0d8;
}

.tag--todo {
  color: var(--todo);
  background: var(--todo-soft);
  border: 1px dashed var(--todo);
}

/* 引用 */
.cite {
  display: inline-block;
  border: 0;
  padding: 0 4px;
  margin: 0 1px;
  font-size: 0.78em;
  line-height: 1.5;
  vertical-align: 0.15em;
  border-radius: 4px;
  color: var(--accent);
  background: var(--accent-soft);
  font-variant-numeric: tabular-nums;
}

.cite:hover {
  background: var(--accent);
  color: #fff;
}

.popover {
  position: absolute;
  z-index: 50;
  width: min(420px, calc(100vw - 16px));
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  line-height: 1.6;
}

.popover__id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 2px;
}

.popover__all {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
}

.refbody > span:first-child {
  margin-right: 6px;
}

.refbody a {
  margin-right: 8px;
  white-space: nowrap;
}

.refbody a::after {
  content: ' ↗';
  font-size: 0.85em;
}

.missing {
  color: var(--partial);
}

/* 进度条 */
.progress {
  margin-top: 14px;
}

.progress__bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  gap: 2px;
}

.progress__seg.dot--open {
  background: #c9ced5;
}

.progress--compact {
  margin-top: 12px;
}

.progress--compact .progress__bar {
  height: 6px;
}

.progress__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.progress__legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.progress__todo {
  color: var(--todo);
}

.progress__total {
  margin-left: auto;
}

/* 列表 */
.points {
  list-style: none;
  display: grid;
  gap: 10px;
}

.point {
  position: relative;
  padding-left: 16px;
}

.point::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.point--idea,
.point--todo {
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
}

.point--idea {
  background: var(--embodied-soft);
}

.point--todo {
  background: var(--todo-soft);
}

.point--idea::before,
.point--todo::before {
  display: none;
}

.reflist {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

.reflist summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}

.reflist ol {
  list-style: none;
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.reflist li {
  display: grid;
  grid-template-columns: 40px 1fr;
}

.reflist__id {
  font-family: var(--mono);
  color: var(--faint);
}

.note {
  margin-top: 16px;
  padding: 10px 14px;
  border-left: 3px solid var(--partial);
  background: var(--partial-soft);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}

.note strong {
  margin-right: 8px;
  color: var(--partial);
}

.todo-box {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--todo);
  background: var(--todo-soft);
  border-radius: 8px;
  font-size: 14px;
}

.todo-box strong {
  color: var(--todo);
}

/* 面包屑 */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.crumbs__sep {
  color: var(--faint);
}

.crumbs [aria-current] {
  color: var(--text);
}
