/* ==========================================================================
   flow.css — 支付全链路全景页（/pay/flow/）
   仅本页引用。复用 main.css 的设计令牌（--accent / --accent-2 / --accent-warm
   / --panel / --line / --fg* / --grad-text / --font-* / --s* / --radius*）。
   布局：左侧 sticky 链路导航 + 右侧 stage 内容；移动端 rail 变顶部横条。
   ========================================================================== */

/* ---------- 0. 页头 ---------- */
.flow-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 11, 17, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.flow-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-block: .7rem;
}
.flow-nav__back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.flow-nav__back:hover { color: var(--accent-2); }
.flow-nav__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--fg);
  margin-left: auto;
  letter-spacing: .01em;
}

/* ---------- 1. Hero ---------- */
.flow-hero {
  padding-block: clamp(3rem, 9vh, 5.5rem) var(--s5);
  text-align: center;
}
.flow-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--fg-dim);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  margin-bottom: var(--s4);
}
.flow-hero__badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}
.flow-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.6vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 auto var(--s3);
  max-width: 18ch;
}
.flow-hero__title .grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.flow-hero__lead {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--fg-dim);
  font-size: var(--fs-lead);
  line-height: 1.7;
}
.flow-hero__lead b { color: var(--fg); font-weight: 600; }

/* 链路条：8 节点，桌面横排，移动端可滚 */
.flow-chain {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: var(--s6);
  overflow-x: auto;
  padding-bottom: var(--s2);
  scrollbar-width: thin;
}
.flow-chain__node {
  flex: 1 1 0;
  min-width: 96px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 0 var(--s2);
}
.flow-chain__node::after {
  /* 节点之间的连接线 */
  content: "";
  position: absolute;
  top: 21px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: .35;
  z-index: 0;
}
.flow-chain__node:last-child::after { display: none; }
.flow-chain__dot {
  position: relative;
  z-index: 1;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-hi);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .9rem;
  color: var(--fg-dim);
  transition: transform .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.flow-chain__node.is-home .flow-chain__dot {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
}
.flow-chain__label {
  font-size: var(--fs-xs);
  color: var(--fg-dim);
  text-align: center;
  line-height: 1.3;
}
.flow-chain__node.is-home .flow-chain__label { color: var(--accent-warm); font-weight: 600; }

/* ---------- 2. 主体两栏 ---------- */
.flow-layout {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: var(--s6);
  align-items: start;
  padding-bottom: var(--s7);
}

/* 左侧 sticky 链路导航 */
.flow-rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.flow-rail__head {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 0 .4rem var(--s2);
}
.flow-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--fg-dim);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.flow-link:hover { background: var(--panel); color: var(--fg); }
.flow-link.is-active {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border-left-color: var(--accent-2);
  color: var(--fg);
}
.flow-link__num {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--panel-hi);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  color: var(--fg-dim);
}
.flow-link.is-active .flow-link__num {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #04212a;
}
.flow-link__txt { font-size: var(--fs-sm); line-height: 1.25; }
.flow-link__star {
  margin-left: auto;
  font-size: .7rem;
  color: var(--accent-warm);
  font-family: var(--font-mono);
}

/* 右侧内容 */
.flow-main { min-width: 0; }

/* ---------- 3. 单个 stage ---------- */
.flow-stage {
  position: relative;
  padding: var(--s5) 0 var(--s6);
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.flow-stage:first-child { border-top: 0; }
.flow-stage__head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.flow-stage__idx {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  opacity: .55;
}
.flow-stage.is-home .flow-stage__idx { color: var(--accent-warm); opacity: .9; }
.flow-stage__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}
.flow-stage__tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
  border-radius: 999px;
  padding: .2rem .6rem;
  white-space: nowrap;
  background: rgba(245, 158, 11, .08);
}
.flow-stage__lead {
  color: var(--fg-dim);
  font-size: var(--fs-lead);
  line-height: 1.7;
  max-width: 64ch;
  margin: 0 0 var(--s4);
}
.flow-stage.is-home .flow-stage__lead { color: #e7d8bf; }

/* 关键单据 chips */
.flow-docs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: var(--s4);
}
.flow-doc {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--fg-dim);
}
.flow-doc::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.flow-stage.is-home .flow-doc::before { background: var(--accent-warm); }

/* 钻取链接 */
.flow-drill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: var(--s4);
  padding: .55rem .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--accent-2);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.flow-drill:hover {
  border-color: var(--accent-2);
  transform: translateX(3px);
  background: var(--panel-hi);
}
.flow-drill svg { width: 14px; height: 14px; }

/* 深色提示卡（用于要点/注意，区别于白底 mermaid） */
.flow-note {
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(47, 129, 247, .06);
  color: var(--fg-dim);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
.flow-stage.is-home .flow-note {
  border-left-color: var(--accent-warm);
  background: rgba(245, 158, 11, .07);
}
.flow-note b { color: var(--fg); }

/* ---------- 4. minipay 架构区 ---------- */
.flow-minipay {
  border-top: 1px solid var(--line);
  padding-top: var(--s6);
}
.flow-minipay__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 var(--s2);
}
.flow-minipay__lead {
  color: var(--fg-dim);
  max-width: 60ch;
  line-height: 1.7;
  margin: 0 0 var(--s4);
}
.flow-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s4) 0 var(--s5);
}
.flow-fact {
  flex: 1 1 160px;
  padding: var(--s3);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.flow-fact__num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1;
}
.flow-fact__num.is-warm { color: var(--accent-warm); }
.flow-fact__lbl { margin-top: .4rem; font-size: var(--fs-xs); color: var(--fg-dim); }

/* footer CTA */
.flow-cta {
  margin-top: var(--s6);
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(47,129,247,.08), rgba(34,211,238,.05));
  text-align: center;
}
.flow-cta a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
}
.flow-cta a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 5. 窄屏 ---------- */
@media (max-width: 860px) {
  .flow-layout { grid-template-columns: 1fr; gap: var(--s4); }
  .flow-rail {
    position: sticky;
    top: 45px;
    z-index: 20;
    flex-direction: row;
    gap: .4rem;
    overflow-x: auto;
    padding: .6rem 0;
    margin: 0 calc(var(--s3) * -1);
    padding-inline: var(--s3);
    background: rgba(8, 11, 17, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .flow-rail::-webkit-scrollbar { display: none; }
  .flow-rail__head { display: none; }
  .flow-link {
    flex: none;
    padding: .45rem .6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .flow-link.is-active { border-color: var(--accent-2); }
  .flow-link__star { display: none; }
  .flow-stage__tag { display: none; }
}
