.page-custom-steps {
  --cs-num-col: 76px;
  --cs-meta-col: 200px;
  --cs-rule: 3px double var(--color-line);
}

.page-custom-steps .cs-article {
  display: block;
}

/* 页头 */
.page-custom-steps .cs-head {
  padding-top: var(--space-4);
  border-bottom: var(--cs-rule);
  padding-bottom: var(--space-6);
}

.page-custom-steps .cs-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-3xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-ink);
  margin: var(--space-3) 0 var(--space-2);
  max-width: 20ch;
}

.page-custom-steps .cs-head .lede {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
  max-width: var(--measure);
  margin: var(--space-2) 0 0;
}

.page-custom-steps .cs-jump {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
}

.page-custom-steps .cs-jump a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 通用标题降档 */
.page-custom-steps .cs-h2 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-ink);
  margin: var(--space-2) 0 var(--space-3);
  max-width: 24ch;
}

/* 图片 */
.page-custom-steps .cs-figure {
  margin: var(--space-6) 0 0;
}

.page-custom-steps .cs-figure .figure-media {
  border: var(--border-thin) solid var(--color-line);
  background: var(--color-surface-alt);
}

.page-custom-steps .cs-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.page-custom-steps .cs-figure .figure-caption {
  font-size: var(--text-xs);
  color: var(--color-ink-muted);
  line-height: 1.6;
  margin-top: var(--space-1);
}

/* 起点区块：正文 + 旁注双栏 */
.page-custom-steps .cs-open {
  margin-top: var(--section-y);
}

.page-custom-steps .cs-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.page-custom-steps .cs-open-aside {
  align-self: start;
}

.page-custom-steps .note-aside {
  background: var(--color-surface-alt);
  border-left: var(--border-thick) solid var(--color-primary);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
}

.page-custom-steps .note-aside .note-aside-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 var(--space-2);
}

.page-custom-steps .note-aside p {
  margin: 0;
}

/* 步骤分组 */
.page-custom-steps .cs-group {
  margin-top: var(--section-y-lg);
}

.page-custom-steps .cs-group .section-title--wide {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-ink);
  margin: var(--space-2) 0 0;
}

/* 组内插图错位 */
.page-custom-steps .cs-figure--right,
.page-custom-steps .cs-figure--left {
  margin-top: var(--space-6);
}

/* 步骤列表 */
.page-custom-steps .cs-steps {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
}

.page-custom-steps .cs-step {
  border-top: var(--cs-rule);
  padding: var(--space-4) 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.page-custom-steps .cs-step:last-child {
  border-bottom: var(--cs-rule);
  padding-bottom: var(--space-4);
}

.page-custom-steps .cs-step-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-figure);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin: 0;
}

.page-custom-steps .cs-step-num::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-top: var(--space-1);
  border-top: var(--border-thin) solid var(--color-line);
  border-bottom: var(--border-thin) solid var(--color-line);
}

.page-custom-steps .cs-step-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-xl);
  line-height: var(--leading-heading);
  color: var(--color-ink);
  margin: 0 0 var(--space-2);
}

.page-custom-steps .cs-step-tag {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-bottom: var(--space-1);
}

.page-custom-steps .cs-step-body p {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-ink);
  max-width: var(--measure);
}

.page-custom-steps .cs-meta {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.7;
  display: grid;
  gap: 6px;
  align-content: start;
}

.page-custom-steps .cs-meta > div {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  gap: var(--space-1);
  border-bottom: var(--border-thin) solid var(--color-line);
  padding-bottom: 4px;
}

.page-custom-steps .cs-meta dt {
  color: var(--color-ink-muted);
  letter-spacing: 0.08em;
  margin: 0;
}

.page-custom-steps .cs-meta dd {
  margin: 0;
  color: var(--color-ink-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* 自检表区块 */
.page-custom-steps .cs-check {
  margin-top: var(--section-y-lg);
}

.page-custom-steps .cs-check-intro {
  margin-bottom: var(--space-4);
}

.page-custom-steps .cs-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: var(--border-thin) solid var(--color-line);
}

.page-custom-steps .cs-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.page-custom-steps .cs-table-caption {
  caption-side: top;
  text-align: left;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--color-ink-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-line);
  background: var(--color-surface);
}

.page-custom-steps .cs-table th,
.page-custom-steps .cs-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-line);
  line-height: 1.7;
}

.page-custom-steps .cs-table thead th {
  background: var(--color-surface-deep);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--color-ink);
  white-space: nowrap;
  border-bottom: var(--border-thin) solid var(--color-ink-soft);
}

.page-custom-steps .cs-table tbody th {
  font-weight: 500;
  color: var(--color-ink);
  background: var(--color-surface-deep);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.page-custom-steps .cs-table tbody td {
  color: var(--color-ink-soft);
}

.page-custom-steps .cs-table tbody tr:nth-child(even) td {
  background: var(--color-surface-alt);
}

.page-custom-steps .cs-table tbody tr:last-child th,
.page-custom-steps .cs-table tbody tr:last-child td {
  border-bottom: none;
}

.page-custom-steps .cs-check-aside {
  margin-top: var(--space-4);
}

/* 行动出口 */
.page-custom-steps .cs-exit {
  margin-top: var(--section-y);
}

.page-custom-steps .cs-exit-frame {
  border: var(--border-thin) solid var(--color-line);
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
}

.page-custom-steps .cs-exit-frame .prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-custom-steps .cs-exit-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  border-top: var(--cs-rule);
  padding-top: var(--space-4);
}

.page-custom-steps .cs-exit-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-ink-soft);
  padding-left: var(--space-3);
  border-left: var(--border-thick) solid var(--color-primary);
}

.page-custom-steps .cs-exit-k {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: var(--color-ink-muted);
}

/* 焦点可见 */
.page-custom-steps a:focus-visible,
.page-custom-steps .cs-exit-frame a:focus-visible {
  outline: var(--border-thick) solid var(--color-focus);
  outline-offset: 2px;
}

/* 桌面端栅格 */
@media (min-width: 780px) {
  .page-custom-steps .cs-title {
    font-size: var(--text-4xl);
    max-width: 22ch;
  }

  .page-custom-steps .cs-split {
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
    gap: var(--gutter);
    align-items: start;
  }

  .page-custom-steps .cs-open-aside {
    margin-top: var(--space-8);
  }

  .page-custom-steps .cs-step {
    grid-template-columns: var(--cs-num-col) minmax(0, 1fr) var(--cs-meta-col);
    gap: var(--space-4);
    align-items: start;
  }

  .page-custom-steps .cs-step-num {
    padding-top: 2px;
  }

  .page-custom-steps .cs-step-body {
    max-width: 46ch;
  }

  .page-custom-steps .cs-figure--right {
    max-width: 640px;
    margin-left: auto;
    margin-right: 0;
  }

  .page-custom-steps .cs-figure--left {
    max-width: 600px;
    margin-left: 0;
    margin-right: auto;
  }

  .page-custom-steps .cs-check-aside {
    max-width: 46ch;
    margin-top: var(--space-6);
  }

  .page-custom-steps .cs-exit-frame {
    padding: var(--space-8) var(--space-6);
  }

  .page-custom-steps .cs-exit-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .page-custom-steps .cs-step {
    padding: var(--space-6) 0 var(--space-8);
  }

  .page-custom-steps .cs-figure--right {
    max-width: 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-custom-steps * {
    transition: none !important;
    animation: none !important;
  }
}
