:root {
  color: #172033;
  background: #f3f6fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(52, 86, 195, 0.12), transparent 30%),
    radial-gradient(circle at 96% 12%, rgba(185, 82, 60, 0.1), transparent 28%),
    #f3f6fb;
}

.flow-page {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 32px;
}

.page-header {
  max-width: 1180px;
}

.preview-hub-return {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 5px;
  margin-right: 8px;
  padding: 0 12px;
  border: 1px solid #d7def8;
  border-radius: 15px;
  color: #405bc2;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  line-height: 30px;
  text-decoration: none;
  vertical-align: top;
}

.preview-hub-return:hover {
  background: #fff;
}

.eyebrow {
  display: inline-flex;
  height: 30px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d7def8;
  border-radius: 15px;
  color: #405bc2;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.page-header h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 4.5vw, 58px);
  font-weight: 720;
  letter-spacing: -1.7px;
  line-height: 1.12;
}

.page-header p {
  margin: 0;
  color: #667085;
  font-size: 16px;
  line-height: 1.75;
}

.system-relation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) 48px minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  margin-top: 38px;
}

.system-card {
  position: relative;
  min-height: 132px;
  padding: 22px 22px 19px;
  overflow: hidden;
  border: 1px solid #dde3ee;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(36, 50, 82, 0.07);
}

.system-card::after {
  position: absolute;
  top: -48px;
  right: -38px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  content: "";
  opacity: 0.12;
}

.system-card.hbc-app::after,
.system-card.hbc-api::after {
  background: #365acb;
}

.system-card.east-mini::after,
.system-card.east-member::after {
  background: #b8523c;
}

.system-card small {
  display: block;
  margin-bottom: 9px;
  color: #8a94a6;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.system-card strong {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.system-card p {
  position: relative;
  z-index: 1;
  margin: 7px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.system-index {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 1;
  color: #a3adbd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.relation-arrow {
  color: #a1abbd;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.api-relation {
  color: #7758c8;
  font-size: 26px;
}

.api-focus {
  display: grid;
  grid-template-columns: minmax(270px, 0.8fr) minmax(520px, 1.7fr);
  gap: 28px;
  align-items: center;
  margin-top: 22px;
  padding: 24px 28px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(120deg, #202b49 0%, #2f3e69 64%, #4a3f75 100%);
  box-shadow: 0 18px 40px rgba(27, 37, 66, 0.16);
}

.api-focus-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.api-focus-heading > span {
  flex: none;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: #e3dcff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.api-focus h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.api-focus p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.api-contract {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 28px minmax(200px, 1.5fr) 28px minmax(100px, 0.8fr);
  align-items: center;
  gap: 8px;
}

.contract-item,
.contract-service {
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.contract-item small {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}

.contract-item b,
.contract-service {
  font-size: 13px;
}

.contract-service {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eeeaff;
  font-weight: 700;
  text-align: center;
}

.api-contract i {
  color: rgba(255, 255, 255, 0.5);
  font-style: normal;
  text-align: center;
}

.process-section {
  margin-top: 44px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading > div:first-child > span {
  color: #7c879b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: 26px;
  line-height: 1.35;
}

.actor-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.actor-legend span {
  position: relative;
  padding-left: 15px;
  color: #697386;
  font-size: 11px;
  line-height: 24px;
}

.actor-legend span::before {
  position: absolute;
  top: 9px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}

.legend-user::before {
  background: #365acb;
}

.legend-east::before {
  background: #b8523c;
}

.legend-api::before {
  background: #7758c8;
}

.flowchart-scroll {
  overflow-x: auto;
  border: 1px solid #d8dee9;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 46px rgba(38, 50, 78, 0.06);
  scrollbar-color: #c1c9d7 transparent;
  scrollbar-width: thin;
}

.flowchart-scroll:focus-visible {
  outline: 2px solid #4567d5;
  outline-offset: 3px;
}

.business-flowchart {
  display: block;
  width: 100%;
  min-width: 1580px;
  height: auto;
  color: #182235;
}

.business-flowchart text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.stage-guide text {
  fill: #667085;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stage-guide line {
  stroke: #d7dde7;
  stroke-width: 1;
}

.flow-line {
  fill: none;
  marker-end: url(#flowArrow);
  stroke: #8d98aa;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.business-flowchart marker path {
  fill: #8d98aa;
}

.branch-label {
  fill: #677387;
  font-size: 12px;
  font-weight: 700;
}

.flowchart-node rect,
.decision-node-svg path {
  fill: #fff;
  stroke: #7e899b;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.actor-user-node rect {
  stroke: #365acb;
}

.actor-east-node rect {
  stroke: #b8523c;
}

.actor-api-decision path {
  stroke: #7758c8;
}

.stop-node rect {
  stroke: #c95f51;
}

.success-node-svg rect {
  stroke: #2d9271;
}

.node-kicker {
  fill: #7c8799;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.node-title,
.decision-title {
  fill: #202b3e;
  font-size: 13px;
  font-weight: 700;
}

.node-note {
  fill: #7c8799;
  font-size: 9px;
}

.process-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) 46px minmax(0, 1fr);
  align-items: stretch;
}

.phase-card {
  display: flex;
  min-height: 590px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid #dce2ec;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(38, 50, 78, 0.08);
}

.phase-header {
  margin-bottom: 20px;
}

.phase-header span {
  color: #7e899b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.phase-header h3 {
  margin: 6px 0 0;
  font-size: 19px;
  line-height: 1.4;
}

.flow-node,
.merge-node,
.decision-node,
.branch-path,
.exchange-party,
.success-node {
  border-radius: 13px;
}

.flow-node,
.merge-node,
.exchange-party {
  border: 1px solid #e0e5ed;
  background: #f9fafc;
}

.flow-node {
  padding: 14px 16px;
}

.flow-node small,
.exchange-party small,
.success-node small {
  display: block;
  margin-bottom: 5px;
  color: #858fa1;
  font-size: 10px;
}

.flow-node strong,
.exchange-party strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.actor-user {
  border-left: 4px solid #365acb;
}

.actor-east {
  border-left: 4px solid #b8523c;
}

.actor-api {
  border-left: 4px solid #7758c8;
}

.down-arrow {
  display: block;
  height: 30px;
  color: #a1abbb;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
}

.decision-node {
  position: relative;
  padding: 14px 18px;
  border: 1px solid #d9dfeb;
  background: #eef1f7;
  text-align: center;
}

.decision-node small {
  display: block;
  margin-bottom: 4px;
  color: #7f899a;
  font-size: 10px;
}

.decision-node strong {
  font-size: 13px;
}

.api-decision {
  border-color: #dcd4f3;
  background: #f2effb;
}

.member-decision {
  border-color: #efddcd;
  background: #fbf4ee;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.branch-path {
  min-height: 74px;
  padding: 12px;
  border: 1px solid #e0e5ed;
  background: #fff;
}

.branch-path > span {
  display: inline-block;
  margin-bottom: 7px;
  padding: 2px 6px;
  border-radius: 5px;
  color: #687386;
  background: #eef1f5;
  font-size: 9px;
  font-weight: 750;
}

.branch-path strong,
.branch-path small {
  display: block;
}

.branch-path strong {
  font-size: 12px;
  line-height: 1.45;
}

.branch-path small {
  margin-top: 4px;
  color: #8a94a6;
  font-size: 10px;
  line-height: 1.4;
}

.auto-path,
.pass-path,
.activate-path {
  border-color: #d5e3dd;
  background: #f2f8f5;
}

.stop-path {
  border-color: #efd7d2;
  background: #fff5f3;
}

.extend-path {
  border-color: #d8e0f6;
  background: #f3f6fd;
}

.merge-node {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
}

.merge-node > span,
.success-node > span {
  display: flex;
  width: 24px;
  height: 24px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #2e9a76;
  font-size: 13px;
  font-weight: 800;
}

.merge-node strong {
  font-size: 13px;
}

.phase-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa5b5;
  font-size: 28px;
  font-weight: 700;
}

.api-exchange {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.exchange-party {
  min-height: 84px;
  padding: 12px;
}

.api-exchange > span {
  color: #8d97a8;
  font-size: 9px;
  text-align: center;
}

.validation-branches {
  margin-top: auto;
}

.member-branches {
  margin-top: 14px;
}

.member-branches .branch-path {
  min-height: 108px;
}

.success-node {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 15px;
  color: #175e49;
  border: 1px solid #cae4d9;
  background: #edf8f3;
}

.success-node small {
  color: #4e8b76;
}

.success-node strong {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.page-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
  color: #9aa4b4;
  font-size: 11px;
}

@media (min-width: 1121px) {
  .process-section {
    width: min(1880px, calc(100vw - 40px));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 1120px) {
  .system-relation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .relation-arrow {
    display: none;
  }

  .api-focus {
    grid-template-columns: 1fr;
  }

  .process-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .phase-card {
    min-height: auto;
  }

  .phase-connector {
    height: 32px;
    transform: rotate(90deg);
  }

  .merge-node,
  .validation-branches,
  .success-node {
    margin-top: 18px;
  }
}

@media (max-width: 720px) {
  .flow-page {
    width: min(100% - 24px, 1380px);
    padding-top: 34px;
  }

  .page-header h1 {
    letter-spacing: -1px;
  }

  .system-relation {
    grid-template-columns: 1fr;
  }

  .system-card {
    min-height: 116px;
  }

  .api-focus {
    padding: 20px;
  }

  .api-contract {
    grid-template-columns: 1fr;
  }

  .api-contract i {
    transform: rotate(90deg);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .actor-legend {
    justify-content: flex-start;
  }

  .business-flowchart {
    min-width: 1420px;
  }

  .phase-card {
    padding: 19px;
  }

  .branch-grid,
  .api-exchange {
    grid-template-columns: 1fr;
  }

  .api-exchange > span {
    padding: 3px 0;
    transform: rotate(90deg);
  }

  .member-branches .branch-path {
    min-height: 84px;
  }
}
