html:has(.howto-toc) { scroll-behavior: smooth; }

/* /how-to 使用教程页。经 finalStylesheet 加载（在 public-foundation.css 之后），
   标题类选择器统一带 .public-site main 前缀，才能压过
   public-foundation.css 里 body.public-site main :is(h1,.hero-title) 的字号规则。 */
.public-site main .howto-intro {
  padding: clamp(34px, 4vw, 58px) 0 clamp(26px, 3vw, 38px);
  color: #fff;
  background:
    radial-gradient(90% 130% at 88% -20%, rgba(15, 99, 199, .55), transparent 62%),
    linear-gradient(122deg, #062b63 0%, #083f91 58%, #0f63c7 100%);
}
.public-site main .howto-intro .howto-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  color: #dbeafe;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.public-site main .howto-intro h1 {
  max-width: 22ch;
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  line-height: 1.14;
  letter-spacing: -.03em;
}
.public-site main .howto-intro .howto-lead {
  max-width: 74ch;
  margin: 0;
  color: #dfe9f8;
  font-size: 1.02rem;
  line-height: 1.85;
}
.public-site main .howto-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.public-site main .howto-stats li {
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  color: #f2f7ff;
  font-size: .9rem;
  font-weight: 700;
}
.public-site main .howto-updated {
  margin: 18px 0 0;
  color: #b9cdea;
  font-size: .8rem;
}

/* 图标：模板里的 howtoIcon 宏输出 <span class="howto-glyph"><svg/></span>，尺寸由外层决定 */
.public-site main .howto-glyph { display: inline-flex; align-items: center; justify-content: center; }
.public-site main .howto-glyph svg { display: block; width: 100%; height: 100%; }

/* 流程图：四阶段横排，阶段之间用 CSS 画的箭头衔接 */
.public-site main .howto-flow {
  padding: clamp(30px, 3.4vw, 44px) 0 clamp(26px, 3vw, 36px);
  border-bottom: 1px solid var(--site-line, #dce4ee);
  background: #f6f9fd;
}
.public-site main .howto-flow-title {
  margin: 0 0 8px;
  color: var(--site-ink, #1d2b3a);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.25;
  letter-spacing: -.018em;
}
.public-site main .howto-flow-lead { max-width: 76ch; margin: 0 0 24px; color: var(--site-muted, #5b6b7f); font-size: .95rem; line-height: 1.75; }
.public-site main .howto-flow-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.public-site main .howto-flow-phase {
  position: relative;
  padding: 18px 16px 16px;
  border: 1px solid var(--site-line, #dce4ee);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(8, 63, 145, .06);
}
.public-site main .howto-flow-phase + .howto-flow-phase::before {
  content: "";
  position: absolute;
  top: 40px;
  left: -15px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--site-blue, #0f63c7);
  border-right: 2px solid var(--site-blue, #0f63c7);
  transform: rotate(45deg);
}
.public-site main .howto-flow-badge {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 9px;
  border-radius: 11px;
  background: linear-gradient(140deg, #083f91, #0f63c7);
  color: #fff;
}
.public-site main .howto-flow-badge .howto-glyph { width: 100%; height: 100%; }
.public-site main .howto-flow-phase h3 {
  margin: 12px 0 6px;
  color: var(--site-navy, #083f91);
  font-size: 1rem;
  line-height: 1.35;
}
.public-site main .howto-flow-phase > p { margin: 0; color: #46566a; font-size: .86rem; line-height: 1.65; }
.public-site main .howto-flow-steps {
  margin: 13px 0 0;
  padding: 11px 0 0;
  border-top: 1px dashed var(--site-line, #dce4ee);
  list-style: none;
}
.public-site main .howto-flow-steps li + li { margin-top: 3px; }
.public-site main .howto-flow-steps a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--site-ink, #1d2b3a);
  font-size: .84rem;
  line-height: 1.42;
}
.public-site main .howto-flow-steps a:hover { background: #eaf2fd; color: var(--site-navy, #083f91); }
.public-site main .howto-flow-steps a b {
  flex: 0 0 auto;
  color: var(--site-blue, #0f63c7);
  font: 750 .74rem/1.4 ui-monospace, Consolas, monospace;
}

.public-site main .howto-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.public-site main .howto-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 750;
}
.public-site main .howto-button--primary { background: var(--site-red, #f1272f); color: #fff; }
.public-site main .howto-button--primary:hover { background: var(--site-red-dark, #d91c24); }
.public-site main .howto-button--ghost { border: 1px solid rgba(255, 255, 255, .5); color: #fff; }
.public-site main .howto-button--ghost:hover { background: rgba(255, 255, 255, .12); }

/* 左侧目录 + 右侧步骤 */
.public-site main .howto-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 72px;
}
.public-site main .howto-content { min-width: 0; }
.public-site main .howto-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px 0 18px 18px;
  border-left: 1px solid var(--site-line, #dce4ee);
}
.public-site main .howto-toc-title {
  margin: 0 0 14px;
  color: var(--site-muted, #5b6b7f);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.public-site main .howto-toc-rail { position: absolute; top: 18px; bottom: 18px; left: -1px; width: 2px; background: var(--site-line, #dce4ee); }
.public-site main .howto-toc-rail-fill { display: block; width: 100%; height: 0; background: var(--site-blue, #0f63c7); transition: height .35s ease; }
.public-site main .howto-toc-list { margin: 0; padding: 0; list-style: none; }
.public-site main .howto-toc-list li + li { margin-top: 2px; }
.public-site main .howto-toc-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--site-ink, #1d2b3a);
  font-size: .9rem;
  line-height: 1.45;
}
/* 目录序号不能被挤成竖排：侧栏窄时 "01" 会被 flex 压缩成 "0"/"1" 两行 */
.public-site main .howto-toc-list a b { flex: 0 0 auto; white-space: nowrap; color: var(--site-muted, #5b6b7f); font: 700 .78rem/1 ui-monospace, Consolas, monospace; }
.public-site main .howto-toc-list a:hover { background: #f1f6fc; }
.public-site main .howto-toc-list a.is-active { background: #eaf2fd; color: var(--site-navy, #083f91); font-weight: 750; }
.public-site main .howto-toc-list a.is-active b { color: var(--site-blue, #0f63c7); }

/* 步骤卡片 */
.public-site main .howto-step {
  position: relative;
  margin-bottom: 22px;
  padding: 26px 28px 24px;
  border: 1px solid var(--site-line, #dce4ee);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--site-shadow, 0 10px 28px rgba(8, 63, 145, .08));
  scroll-margin-top: 96px;
  transition: opacity .5s ease, transform .5s ease;
}
/* 隐藏态只在 JS 加上 howto-anim 后才生效：无脚本 / 脚本出错 / 偏好减少动效时卡片始终可见 */
html.howto-anim .public-site main .howto-step { opacity: 0; transform: translateY(18px); }
html.howto-anim .public-site main .howto-step.is-revealed { opacity: 1; transform: none; }
.public-site main .howto-step-head { display: flex; align-items: flex-start; gap: 16px; }
.public-site main .howto-step-no {
  flex: 0 0 auto;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--site-navy, #083f91);
  color: #fff;
  font: 800 1.05rem/1 ui-monospace, Consolas, monospace;
}
html.howto-anim .public-site main .howto-step.is-revealed .howto-step-no { animation: howto-pop .45s ease both; }
.public-site main .howto-step h2 {
  margin: 4px 0 8px;
  color: var(--site-ink, #1d2b3a);
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  line-height: 1.28;
  letter-spacing: -.015em;
}
.public-site main .howto-step-lead { margin: 0; color: var(--site-muted, #5b6b7f); font-size: .98rem; line-height: 1.8; }
.public-site main .howto-points { margin: 16px 0 0; padding: 0; list-style: none; }
.public-site main .howto-points li { position: relative; padding-left: 26px; margin-bottom: 9px; color: #33414f; font-size: .96rem; line-height: 1.78; }
.public-site main .howto-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--site-blue, #0f63c7);
  font-weight: 800;
}
.public-site main .howto-tip {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--site-blue, #0f63c7);
  border-radius: 0 10px 10px 0;
  background: #f1f6fc;
  color: #26456d;
  font-size: .93rem;
  line-height: 1.7;
}
.public-site main .howto-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.public-site main .howto-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--site-line, #dce4ee);
  border-radius: 999px;
  background: #fafcfe;
}
.public-site main .howto-chip em { color: var(--site-muted, #5b6b7f); font-size: .74rem; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.public-site main .howto-chip b { color: var(--site-navy, #083f91); font-size: .88rem; }

.public-site main .howto-shot { margin: 20px 0 0; }
.public-site main .howto-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--site-line, #dce4ee);
  border-radius: 12px;
  background: #f6f8fb;
  box-shadow: 0 6px 18px rgba(8, 63, 145, .07);
}
.public-site main .howto-shot figcaption { margin-top: 9px; color: var(--site-muted, #5b6b7f); font-size: .82rem; line-height: 1.6; }

/* 3.1 / 3.2 / 3.3 这类拆开的子步骤：小标题 + 说明 + 各自一张截图 */
.public-site main .howto-part-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 7px;
  color: var(--site-navy, #083f91);
  font-size: 1.02rem;
  line-height: 1.4;
}
.public-site main .howto-part-no {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eaf2fd;
  color: var(--site-blue, #0f63c7);
  font: 800 .76rem/1.5 ui-monospace, Consolas, monospace;
}
.public-site main .howto-part-lead { max-width: 78ch; margin: 0 0 12px; color: #46566a; font-size: .93rem; line-height: 1.72; }

/* 7—9 步没有可截图的界面，改用带图标的说明卡片 */
.public-site main .howto-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.public-site main .howto-icon-card {
  padding: 15px 16px;
  border: 1px solid var(--site-line, #dce4ee);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #f4f8fd);
}
.public-site main .howto-icon-badge {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 8px;
  border-radius: 10px;
  background: #eaf2fd;
  color: var(--site-blue, #0f63c7);
}
.public-site main .howto-icon-badge .howto-glyph { width: 100%; height: 100%; }
.public-site main .howto-icon-card b { display: block; margin: 10px 0 5px; color: var(--site-navy, #083f91); font-size: .93rem; line-height: 1.45; }
.public-site main .howto-icon-card p { margin: 0; color: #3c4c5e; font-size: .86rem; line-height: 1.68; }
.public-site main .howto-step-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--site-blue, #0f63c7);
  font-size: .95rem;
  font-weight: 750;
}
.public-site main .howto-step-cta:hover { color: var(--site-navy, #083f91); text-decoration: underline; }

/* 常见问题 */
.public-site main .howto-faq { margin-top: 34px; scroll-margin-top: 96px; }
.public-site main .howto-faq h2 { margin: 0 0 14px; color: var(--site-ink, #1d2b3a); font-size: 1.4rem; }
.public-site main .howto-faq details {
  margin-bottom: 10px;
  border: 1px solid var(--site-line, #dce4ee);
  border-radius: 12px;
  background: #fff;
}
.public-site main .howto-faq summary {
  padding: 15px 18px;
  color: var(--site-navy, #083f91);
  font-size: .98rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.public-site main .howto-faq summary::-webkit-details-marker { display: none; }
.public-site main .howto-faq summary::after { content: "+"; float: right; color: var(--site-blue, #0f63c7); font-size: 1.2rem; line-height: 1; }
.public-site main .howto-faq details[open] summary::after { content: "–"; }
.public-site main .howto-faq details p { margin: 0; padding: 0 18px 16px; color: #33414f; font-size: .94rem; line-height: 1.8; }

/* 收尾 CTA */
.public-site main .howto-final {
  margin-top: 30px;
  padding: 26px 28px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(122deg, #062b63 0%, #083f91 62%, #0f63c7 100%);
}
.public-site main .howto-final h2 { margin: 0 0 8px; color: #fff; font-size: 1.35rem; }
.public-site main .howto-final p { margin: 0; color: #dfe9f8; font-size: .98rem; line-height: 1.8; }
.public-site main .howto-final .howto-button--ghost { border-color: rgba(255, 255, 255, .55); }
/* 两篇教程互链：收尾 CTA 下方一行文字链接，不抢主按钮的视觉层级 */
.public-site main .howto-final .howto-cross { margin-top: 14px; font-size: .92rem; }
.public-site main .howto-final .howto-cross a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.public-site main .howto-final .howto-cross a:hover { text-decoration-thickness: 2px; }

@keyframes howto-pop { 0% { transform: scale(.82); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

@media (max-width: 1100px) {
  .public-site main .howto-layout { grid-template-columns: 1fr; gap: 22px; }
  /* 流程图横排改成竖排，箭头从“右指”转成“下指” */
  .public-site main .howto-flow-track { grid-template-columns: 1fr; gap: 14px; max-width: 620px; }
  .public-site main .howto-flow-phase + .howto-flow-phase::before {
    top: -11px;
    left: 50%;
    margin-left: -4px;
    transform: rotate(135deg);
  }
  .public-site main .howto-toc {
    position: sticky;
    top: 66px;
    z-index: 5;
    max-height: none;
    margin: 0 -16px;
    padding: 10px 16px;
    border-left: 0;
    border-bottom: 1px solid var(--site-line, #dce4ee);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .public-site main .howto-toc-title, .public-site main .howto-toc-rail { display: none; }
  .public-site main .howto-toc-list { display: flex; gap: 8px; }
  .public-site main .howto-toc-list li + li { margin-top: 0; }
  .public-site main .howto-toc-list a { border: 1px solid var(--site-line, #dce4ee); border-radius: 999px; white-space: nowrap; font-size: .84rem; padding: 7px 12px; }
  .public-site main .howto-step { scroll-margin-top: 130px; }
}
@media (max-width: 620px) {
  .public-site main .howto-step { padding: 20px 16px 18px; border-radius: 13px; }
  .public-site main .howto-step-head { gap: 12px; }
  .public-site main .howto-step-no { width: 38px; height: 38px; border-radius: 10px; font-size: .95rem; }
  .public-site main .howto-intro h1 { max-width: none; }
  .public-site main .howto-flow { padding: 26px 0 22px; }
  .public-site main .howto-icon-grid { grid-template-columns: 1fr; }
  .public-site main .howto-part-title { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  /* 该偏好下 JS 不会给 <html> 加 howto-anim，卡片本就常显；这里只关掉剩余动效 */
  .public-site main .howto-step,
  .public-site main .howto-step-no,
  .public-site main .howto-toc-rail-fill { transition: none; animation: none; }
}
