/* 使用说明书（/guide/、/en/guide/）：在 site.css 的长文排版上加全书导航、翻页和少量文内部件。
   页面外壳由 tools/site-guide.mjs 生成。 */
.guide-toc {
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.guide-nav summary {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
  list-style: none;
  cursor: default;
}
.guide-nav summary::-webkit-details-marker {
  display: none;
}
.guide-nav .items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.guide-nav .items > a {
  padding: 4px 0;
  line-height: 1.45;
}
.guide-nav a[aria-current='page'] {
  color: var(--text-primary);
  font-weight: 600;
}
.guide-nav .sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 8px 2px;
  padding-left: 12px;
  border-left: 1px solid var(--line-subtle);
  font-size: 12.5px;
}
.guide-nav .sub a {
  padding: 3px 0;
  line-height: 1.4;
}
.nav-right .lang[aria-current] {
  color: var(--text-primary);
}

.prose.guide .lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 14px 0 24px;
}
.prose.guide h2:first-of-type {
  margin-top: 40px;
}
.prose.guide kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-elevated);
  border: 1px solid var(--line-subtle);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  color: var(--text-primary);
}
.prose.guide .tag {
  display: inline-block;
  font-size: 12px;
  line-height: 1.7;
  padding: 0 8px;
  margin-right: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  color: var(--text-secondary);
  vertical-align: 1px;
  white-space: nowrap;
}
.prose.guide .cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.prose.guide .cards > div {
  background: var(--bg-panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 1.65;
}
.prose.guide .cards h3 {
  margin: 0 0 6px;
}
.prose.guide .cards p:last-child,
.prose.guide .cards ul:last-child {
  margin-bottom: 0;
}
.prose.guide .steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}
.prose.guide .steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin: 12px 0;
}
.prose.guide .steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--line-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}
.prose.guide .note + .note {
  margin-top: 10px;
}
.prose.guide .todo-block {
  margin: 0 0 14px;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 56px;
}
.prose .pager a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.45;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}
.prose .pager a:hover {
  border-color: var(--line-strong);
  background: var(--bg-hover);
}
.pager a span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.pager .next {
  text-align: right;
}
.guide-updated {
  margin: 40px 0 0;
}

@media (max-width: 900px) {
  .guide-toc {
    max-height: none;
    overflow: visible;
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
  }
  .guide-nav summary {
    cursor: pointer;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .guide-nav summary::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--dur-base) var(--ease-out);
  }
  .guide-nav[open] summary::after {
    transform: rotate(-135deg);
  }
  .guide-nav[open] summary {
    margin-bottom: 10px;
  }
  .prose.guide .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .pager {
    grid-template-columns: minmax(0, 1fr);
  }
  .pager .next {
    text-align: left;
  }
}
