:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #687287;
  --line: #dfe4ee;
  --orange: #f59e0b;
  --shadow: 0 18px 46px rgba(39, 52, 82, 0.10);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 全局禁止文本选中，避免左右拖拽时选中文案 */
html,
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 图片禁止拖拽/选中 */
img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

/* 输入框仍允许选中和编辑 */
input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.08), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

/* 顶部 */
.topbar {
  flex: 0 0 auto;
  height: 120px;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(35, 49, 78, 0.04);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: block;
  width: 360px;
  height: 112px;
  object-fit: contain;
  object-position: left center;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1.25;
}

.brand-copy span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.toolbar button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d8deea;
  border-radius: 9px;
  background: #fff;
  color: #354058;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.toolbar button:hover {
  transform: translateY(-1px);
  border-color: #bec7d8;
  box-shadow: 0 6px 16px rgba(47, 61, 91, 0.10);
}

.toolbar .contact-button {
  border-color: var(--orange);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  box-shadow: 0 7px 18px rgba(245, 158, 11, 0.24);
}

/* 阶段快速导航（顶栏下方悬浮） */
.stage-nav {
  position: fixed;
  top: var(--stage-nav-top, 86px);
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(238, 243, 252, 0.82) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 22px rgba(35, 49, 78, 0.07);
  backdrop-filter: blur(14px) saturate(1.15);
}

.stage-nav-btn {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 82%, #ffffff);
  border-radius: 999px;
  background: var(--stage-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--stage-color) 18%, transparent);
  transition: 0.2s ease;
}

.stage-nav-btn:hover {
  background: color-mix(in srgb, var(--stage-color) 90%, #0f172a);
  border-color: color-mix(in srgb, var(--stage-color) 76%, #ffffff);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--stage-color) 28%, transparent);
}

.stage-nav-btn.is-active,
.stage-nav-btn.is-active:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--stage-color) 94%, #ffffff) 0%, color-mix(in srgb, var(--stage-color) 86%, #0f172a) 100%);
  border-color: #ffffff;
  color: #ffffff;
  font-weight: 900;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-color) 28%, transparent),
    0 10px 22px color-mix(in srgb, var(--stage-color) 32%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  outline: none;
}

@media (max-width: 768px) {
  .stage-nav {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    padding: 8px 8px;
    overflow: hidden;
  }

  .stage-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 30px;
    padding: 0 2px;
    font-size: clamp(9px, 2.6vw, 11px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    display: block;
    line-height: 30px;
  }
}

/* 主区域 */
.app-shell {
  min-height: 0;
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
}

.map-panel {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.map-hint {
  position: absolute;
  z-index: 20;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  max-width: 90%;
  border: 1px solid rgba(220, 225, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #70798c;
  box-shadow: 0 8px 24px rgba(34, 47, 77, 0.08);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

.viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: none;
  cursor: grab;
  user-select: none;
}

.viewport:active {
  cursor: grabbing;
}

.canvas {
  position: relative;
  transform-origin: 0 0;
  transition: transform 0.22s ease;
  will-change: transform;
}

.canvas.is-dragging {
  transition: none;
}

.mindmap {
  position: relative;
  z-index: 1;
  min-width: 1480px;
  min-height: 2200px;
  padding: 90px 80px 120px;
  display: flex;
  align-items: flex-start;
  gap: 110px;
}

.connector-layer {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

/* 根节点 */
.root-node {
  position: sticky;
  top: 80px;
  z-index: 3;
  flex: 0 0 255px;
  width: 255px;
  min-height: 258px;
  padding: 26px 22px;
  border: 2px solid #f59e0b;
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 15%, rgba(245, 158, 11, 0.20), transparent 30%),
    linear-gradient(145deg, #fffdfa 0%, #fff5df 100%);
  box-shadow: 0 20px 48px rgba(245, 158, 11, 0.17);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.root-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ffd99b;
  color: #b46800;
  font-size: 12px;
  font-weight: 800;
}

.root-node h1 {
  margin-top: 15px;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: 0.5px;
}

.root-node p {
  margin-top: 12px;
  color: #6e6250;
  font-size: 13px;
  line-height: 1.65;
}

.root-badges {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.root-badges span {
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #f1d59c;
  color: #8a5b0b;
  font-size: 11px;
  font-weight: 800;
}

.root-contact {
  margin-top: 18px;
  height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.24);
}

/* 阶段主列 */
.flow-column {
  position: relative;
  z-index: 2;
  flex: 0 0 1040px;
  width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 58px;
}

.stage-card {
  position: relative;
  width: 1040px;
  min-height: 120px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 20%, #dfe4ee);
  border-radius: 22px;
  background:
    linear-gradient(145deg, var(--stage-soft), #ffffff 38%, #ffffff 100%);
  box-shadow: var(--shadow);
  transition: 0.28s ease;
  overflow: visible;
}

.stage-card::before {
  content: "";
  position: absolute;
  left: 72px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--stage-color) 38%, transparent), transparent);
  pointer-events: none;
}

/* 需用户参与的重点阶段：醒目高亮 */
.stage-card.is-user-action {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--stage-color) 60%, #ffffff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-color) 14%, transparent), var(--shadow);
}

.stage-card.is-user-action:hover {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-color) 20%, transparent), 0 22px 56px rgba(39, 52, 82, 0.16);
}

.stage-user-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--stage-color);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.root-action-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  color: #48566e;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  text-align-last: left;
  text-justify: none;
}

.root-action-text {
  flex: 1;
  text-align: left;
  text-align-last: left;
  word-break: break-word;
}

.root-action-note strong {
  color: #2f3a4d;
}

.root-action-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.stage-card:hover {
  border-color: color-mix(in srgb, var(--stage-color) 42%, #ffffff);
  box-shadow: 0 22px 56px rgba(39, 52, 82, 0.14);
}

.stage-head {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  min-height: 80px;
  display: grid;
  grid-template-columns: 52px 1fr 34px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--stage-soft);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--stage-color) 12%, transparent);
}

.stage-head:hover {
  background: rgba(255, 255, 255, 0.72);
}

.stage-index {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--stage-color), color-mix(in srgb, var(--stage-color) 72%, #ffffff));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--stage-color) 28%, transparent);
}

.stage-head-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stage-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.stage-duration-list {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.stage-duration {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 28%, #ffffff);
  background: color-mix(in srgb, var(--stage-soft) 76%, #ffffff);
  color: var(--stage-color);
  font-size: 11px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.stage-head-copy strong {
  color: #18233a;
  font-size: 21px;
  line-height: 1.2;
}

.stage-head-copy small {
  color: #667188;
  font-size: 13px;
  line-height: 1.55;
}

.stage-toggle {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #dde3ed;
  color: var(--stage-color);
  font-size: 20px;
  font-weight: 900;
  transition: transform 0.25s ease;
}

.stage-card.is-expanded .stage-toggle {
  transform: rotate(180deg);
}

.stage-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  padding: 14px 12px 4px 88px;
  opacity: 1;
  max-height: 1600px;
  transition: opacity 0.22s ease, max-height 0.3s ease, padding 0.3s ease;
}

.stage-body.without-media {
  grid-template-columns: minmax(0, 1fr);
}

.stage-card.is-collapsed .stage-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.stage-card.is-collapsed .stage-transition-text {
  opacity: 0.55;
}

.stage-core {
  min-width: 0;
}

.step-flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step-node {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 82px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 30%, #e5e8ef);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 20px rgba(31, 45, 73, 0.07);
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.step-node:hover {
  transform: translateX(5px);
  border-color: var(--stage-color);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--stage-color) 14%, rgba(31, 45, 73, 0.08));
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--stage-soft);
  border: 1px solid color-mix(in srgb, var(--stage-color) 42%, #ffffff);
  color: var(--stage-color);
  font-weight: 900;
  font-size: 14px;
}

.step-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.step-copy strong {
  color: #253049;
  font-size: 15px;
  line-height: 1.35;
}

.step-copy small {
  color: #6d7688;
  font-size: 12.5px;
  line-height: 1.55;
}

.step-more,
.decision-badge {
  justify-self: end;
  white-space: nowrap;
  color: var(--stage-color);
  font-size: 11px;
  font-weight: 800;
}

.decision-badge {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--stage-soft);
  border: 1px solid color-mix(in srgb, var(--stage-color) 30%, #fff);
}

.step-node.is-decision {
  border-style: dashed;
  border-width: 2px;
}

.stage-outputs {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px dashed color-mix(in srgb, var(--stage-color) 35%, #dfe4ee);
  border-radius: 14px;
  background: color-mix(in srgb, var(--stage-soft) 72%, #ffffff);
}

.stage-outputs h3,
.stage-media h3 {
  margin-bottom: 10px;
  color: #4b5568;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.output-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.output-chips span {
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e0e5ee;
  color: #4c566b;
  font-size: 11px;
  font-weight: 700;
}

/* 判断分支 */
.decision-router {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 2px;
}

.decision-path {
  min-height: 48px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid;
  background: #fff;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.decision-path span {
  margin-right: 5px;
  font-size: 15px;
}

.decision-accept {
  border-color: #8ad7b6;
  color: #16754f;
  background: #effbf5;
}

.decision-reject {
  border-color: #f0ca74;
  color: #9a6500;
  background: #fffaf0;
}

.decision-path:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(40, 54, 82, 0.10);
}

/* 图片区域 */
.stage-media {
  min-width: 0;
  padding-left: 4px;
}

.media-card {
  position: relative;
  margin: 0 0 12px;
  padding: 9px;
  border: 1px solid #e1e6ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(35, 49, 78, 0.08);
  cursor: zoom-in;
  overflow: hidden;
  transition: 0.2s ease;
}

.media-card:hover {
  transform: translateY(-2px);
  border-color: var(--stage-color, #f59e0b);
  box-shadow: 0 12px 26px rgba(35, 49, 78, 0.13);
}

.media-card img {
  display: block;
  width: 100%;
  max-height: 188px;
  object-fit: contain;
  border-radius: 10px;
  background: #f7f8fb;
}

.media-card figcaption {
  margin-top: 8px;
  color: #5f687b;
  font-size: 11px;
  line-height: 1.5;
}

.media-zoom {
  position: absolute;
  right: 13px;
  top: 13px;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(22, 31, 49, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.stage-transition-text {
  position: absolute;
  left: 107px;
  bottom: -44px;
  z-index: 6;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--stage-color) 30%, #dfe4ee);
  color: var(--stage-color);
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(35, 49, 78, 0.08);
  pointer-events: none;
}

.end-node {
  position: relative;
  z-index: 3;
  width: 650px;
  min-height: 84px;
  margin-left: 20px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid #0f7490;
  border-radius: 18px;
  background: linear-gradient(145deg, #eaf9fc, #fff);
  box-shadow: 0 16px 36px rgba(15, 116, 144, 0.15);
}

.end-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f7490;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
}

.end-node div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.end-node strong {
  font-size: 17px;
}

.end-node small {
  color: #657084;
  font-size: 12px;
}

.stage-pulse {
  animation: stagePulse 1.1s ease;
}

@keyframes stagePulse {
  0%, 100% { box-shadow: var(--shadow); }
  45% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--stage-color) 18%, transparent), 0 22px 56px rgba(39, 52, 82, 0.18); }
}

/* 详情抽屉 */
.detail-drawer {
  --accent-color: #f59e0b;
  position: absolute;
  z-index: 240;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  padding: 28px 24px 36px;
  overflow-y: auto;
  border-left: 1px solid #dfe4ee;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -18px 0 52px rgba(25, 37, 64, 0.16);
  transform: translateX(102%);
  transition: transform 0.32s ease;
}

.detail-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

body.detail-open .side-qr {
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
}

/* 弹框/灯箱打开时锁定页面滚动，避免背景滚动穿透 */
body.detail-open,
body.lightbox-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

html:has(body.detail-open),
html:has(body.lightbox-open) {
  overflow: hidden !important;
}

/* 抽屉内部保持可滚动，且滚动不外溢到页面 */
.detail-drawer {
  overscroll-behavior: contain;
}

.drawer-close {
  position: absolute;
  right: 17px;
  top: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f7;
  color: #687287;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.drawer-close:hover {
  background: #e6eaf1;
  color: #1f2937;
}

.drawer-accent {
  width: 58px;
  height: 5px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.drawer-eyebrow {
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.detail-drawer h2 {
  margin-top: 8px;
  padding-right: 38px;
  font-size: 24px;
  line-height: 1.35;
}

.drawer-summary {
  margin-top: 12px;
  color: #667188;
  font-size: 14px;
  line-height: 1.75;
}

.drawer-content {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-block {
  padding: 15px;
  border: 1px solid #e2e6ee;
  border-radius: 14px;
  background: #fafbfd;
}

.detail-block h3 {
  margin-bottom: 10px;
  color: #2d374c;
  font-size: 14px;
  line-height: 1.45;
}

.detail-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-items.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-row {
  position: relative;
  padding: 9px 10px 9px 23px;
  border: 1px solid #e5e8ef;
  border-radius: 9px;
  background: #fff;
  color: #455066;
  font-size: 12.5px;
  line-height: 1.55;
}

.detail-row::before {
  content: "✓";
  position: absolute;
  left: 9px;
  top: 9px;
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 900;
}

.detail-warning {
  border-color: #f4cf91;
  background: #fff8eb;
}

.detail-warning .detail-row::before {
  content: "!";
  color: #d97706;
}

.detail-info {
  border-color: #b9d8f9;
  background: #f1f7ff;
}

.detail-success {
  border-color: #9dd8bc;
  background: #effaf4;
}

.detail-decision {
  border-color: #9dd8bc;
  background: linear-gradient(135deg, #effaf4 0 50%, #fff8e9 50% 100%);
}

.detail-code {
  border-color: #c8b5f5;
  background: #f7f3ff;
}

.detail-code .detail-row {
  padding-left: 12px;
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.detail-code .detail-row::before {
  display: none;
}

.detail-media-block .media-card {
  margin-bottom: 10px;
}

.detail-image-grid,
.contact-image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.contact-image-grid {
  grid-template-columns: 1fr 1fr;
}

.contact-image-grid .media-card img {
  max-height: 220px;
}

/* ===== 联系法务抽屉美化 ===== */
.detail-drawer.is-contact {
  padding: 18px 0 20px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(245, 158, 11, 0.12), transparent 60%),
    #ffffff;
}

.detail-drawer.is-contact .drawer-accent {
  display: none;
}

.detail-drawer.is-contact .drawer-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 24px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #b46800;
}

.detail-drawer.is-contact > h2 {
  margin: 10px 24px 0;
  padding-right: 44px;
  font-size: 19px;
  line-height: 1.3;
  background: linear-gradient(90deg, #d97706, #ea580c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.detail-drawer.is-contact .drawer-summary {
  margin: 8px 24px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff7ec;
  border: 1px solid #f6dcae;
  color: #7c5a25;
  font-size: 11.5px;
  line-height: 1.55;
}

.detail-drawer.is-contact .drawer-content {
  margin: 12px 24px 0;
  gap: 10px;
}

.detail-drawer.is-contact .detail-block {
  padding: 11px 12px;
}

.detail-drawer.is-contact .detail-block h3 {
  margin-bottom: 7px;
  font-size: 13px;
}

.detail-drawer.is-contact .contact-info {
  border: 1px solid #ffe2b8;
  background: linear-gradient(160deg, #fffaf2, #ffffff);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid #f0e2cb;
  border-radius: 10px;
  background: #ffffff;
  transition: 0.2s ease;
}

.contact-item:hover {
  border-color: #f5b955;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.14);
  transform: translateY(-1px);
}

.contact-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.14);
  font-size: 14px;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-label {
  color: #98785a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.contact-value {
  color: #2d374c;
  font-size: 12.5px;
  font-weight: 700;
  word-break: break-all;
}

.detail-drawer.is-contact .detail-media-block {
  border: 1px solid #e6ebf5;
  background: #f8fafd;
}

.detail-drawer.is-contact .detail-media-block h3 {
  margin-bottom: 8px;
}

.detail-drawer.is-contact .contact-image-grid {
  gap: 8px;
}

.detail-drawer.is-contact .contact-image-grid .media-card {
  padding: 6px;
  border: 1px solid #e6ebf5;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(35, 49, 78, 0.06);
}

.detail-drawer.is-contact .contact-image-grid .media-card img {
  width: 100%;
  max-height: min(118px, 15vh);
  object-fit: contain;
}

.detail-drawer.is-contact .contact-image-grid .media-card figcaption {
  margin-top: 6px;
  text-align: center;
  color: #5a6577;
  font-size: 11.5px;
  font-weight: 600;
}

/* 灯箱 */
.image-lightbox {
  position: fixed;
  z-index: 2000;
  inset: 0;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 28, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: 0.22s ease;
}

.image-lightbox[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  max-width: 92vw;
  max-height: 90vh;
  padding: 15px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img-wrap {
  position: relative;
  padding-top: 44px;
  line-height: 0;
}

.lightbox-images {
  --lightbox-zoom: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: min(88vw, 1100px);
  max-width: 88vw;
  max-height: 78vh;
  overflow: auto;
}

.lightbox-images.is-multiple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.lightbox-image-item {
  min-width: 0;
  margin: 0;
  line-height: 1.4;
}

.lightbox-img-wrap img,
.lightbox-image-item img {
  display: block;
  width: calc(100% * var(--lightbox-zoom));
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 12px;
  background: #f7f8fa;
}

.lightbox-images:not(.is-multiple) .lightbox-image-item img {
  margin: 0 auto;
}

.lightbox-images.is-multiple .lightbox-image-item img {
  max-height: none;
}

.lightbox-image-item figcaption {
  display: table;
  margin: 8px auto 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 91, 219, 0.08);
  color: #3b5bdb;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.lightbox-tools {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 27, 42, 0.72);
  backdrop-filter: blur(8px);
}

.lightbox-tools button {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.lightbox-tools button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 27, 42, 0.72);
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

.lightbox-figure figcaption {
  max-width: 760px;
  color: #4e586b;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

/* 页脚 —— 紧凑单行布局 */
.footer {
  flex: 0 0 auto;
  background: linear-gradient(90deg, #0f4bcc 0%, #0c1a4b 100%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  z-index: 100;
  padding: 8px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-main {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.footer-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-col.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
}

.footer-tagline {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

.footer-service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.footer-service-tags span {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.footer-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.footer-list li {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-list a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-list a:hover {
  color: #ffb454;
}

.footer-icon {
  display: inline-block;
  width: 14px;
  color: #ffb454;
  font-size: 12px;
}

.footer-col.footer-qr {
  display: none;
}

.qr-card {
  display: none;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  padding-top: 0;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: #ffb454;
}

/* 侧边二维码浮动卡片 —— 替代 footer 中的二维码 */
.side-qr {
  position: fixed;
  right: 14px;
  bottom: 154px;
  z-index: 130;
}

.side-qr-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px 12px;
  box-shadow: 0 6px 20px rgba(15, 75, 204, 0.2), 0 2px 6px rgba(15, 75, 204, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 130px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(15, 75, 204, 0.08);
}

.side-qr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 75, 204, 0.25), 0 3px 8px rgba(15, 75, 204, 0.15);
}

.side-qr-img {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  border: 1px solid #eef1f7;
}

.side-qr-img:hover {
  filter: brightness(1.03);
}

.side-qr-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f4bcc;
  line-height: 1.4;
  text-align: center;
}

.side-qr-text {
  margin: 0;
  font-size: 10.5px;
  color: #6b7280;
  line-height: 1.3;
  text-align: center;
}

/* 中屏 */
@media (max-width: 1200px) {
  .brand-copy {
    display: none;
  }

  .brand-logo {
    width: 250px;
  }

  .toolbar button {
    padding: 0 9px;
    font-size: 12px;
  }

  .footer-main {
    gap: 4px 10px;
  }

  .side-qr {
    right: 12px;
    bottom: 128px;
  }

  .side-qr-card {
    width: 110px;
    padding: 8px 10px;
  }

  .side-qr-img {
    width: 84px;
    height: 84px;
  }

  .side-qr-text {
    font-size: 10px;
  }
}

/* 手机 */
@media (max-width: 768px) {
  .topbar {
    height: auto;
    min-height: 104px;
    padding: 8px 10px;
    flex-direction: column;
    gap: 5px;
  }

  .brand-logo {
    width: 250px;
    height: 72px;
  }

  .toolbar {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .toolbar button {
    height: 30px;
    padding: 0 7px;
    font-size: 11px;
  }

  .toolbar .contact-button {
    display: inline-flex;
  }

  .map-hint {
    top: auto;
    bottom: 12px;
    white-space: normal;
    text-align: center;
    font-size: 10.5px;
    padding: 6px 10px;
  }

  .mindmap {
    min-width: 1380px;
    padding: 70px 45px 120px;
    gap: 80px;
  }

  .root-node {
    flex-basis: 230px;
    width: 230px;
  }

  .flow-column,
  .stage-card {
    width: 980px;
    flex-basis: 980px;
  }

  .detail-drawer {
    width: min(92vw, 430px);
  }

  .detail-items.detail-grid {
    grid-template-columns: 1fr;
  }

  /* 普通详情弹框二维码单列；联系弹框保持双列见下方 is-contact 覆盖 */
  .detail-drawer:not(.is-contact) .contact-image-grid {
    grid-template-columns: 1fr;
  }

  /* 小屏联系弹框：压缩尺寸并保持二维码双列，避免整体滚动 */
  .detail-drawer.is-contact {
    padding: 14px 0 16px;
  }

  .detail-drawer.is-contact .drawer-summary {
    display: none;
  }

  .detail-drawer.is-contact .drawer-content {
    margin: 10px 16px 0;
    gap: 8px;
  }

  .detail-drawer.is-contact > h2 {
    margin: 8px 16px 0;
    font-size: 17px;
  }

  .detail-drawer.is-contact .drawer-eyebrow {
    margin: 0 16px;
  }

  .detail-drawer.is-contact .contact-image-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .detail-drawer.is-contact .contact-image-grid .media-card img {
    max-height: min(150px, 26vw);
  }

  .detail-drawer.is-contact .contact-item {
    padding: 5px 9px;
  }

  .footer {
    padding: 6px 12px;
    font-size: 10.5px;
  }

  .footer-main {
    gap: 3px 8px;
  }

  .footer-logo {
    font-size: 12px;
  }

  .footer-tagline,
  .footer-service-tags,
  .footer-title {
    display: none;
  }

  .footer-list li {
    font-size: 10px;
  }

  .footer-bottom {
    font-size: 9.5px;
    gap: 4px 10px;
  }

  .side-qr {
    right: 8px;
    bottom: 44px;
  }

  .side-qr-card {
    width: 72px;
    padding: 5px 6px 6px;
    border-radius: 8px;
    gap: 3px;
  }

  .side-qr-img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
  }

  .side-qr-title {
    font-size: 9.5px;
  }

  .side-qr-text {
    display: none;
  }
}

/* ===== 步骤下方直接展示详细说明 ===== */
.step-item {
  position: relative;
}

.step-item.is-open .step-node {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.step-detail {
  margin: -4px 8px 0 48px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 18%, #dfe4ee);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--stage-soft) 58%, #ffffff) 0%, #ffffff 100%);
  overflow: hidden;
  max-height: 2600px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}

.step-item.is-closed .step-detail {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.inline-detail {
  padding: 14px 16px 16px;
}

.inline-detail-summary {
  margin-bottom: 12px;
  color: #5f687b;
  font-size: 12.5px;
  line-height: 1.7;
}

.inline-detail-block {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e9f1;
  border-radius: 12px;
  background: #fff;
}

.inline-detail-block:first-child {
  margin-top: 0;
}

.inline-detail-block h4 {
  margin-bottom: 10px;
  color: var(--stage-color);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 900;
}

.inline-detail-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-detail-row {
  position: relative;
  padding-left: 14px;
  color: #364055;
  font-size: 12.5px;
  line-height: 1.72;
}

.inline-detail-row::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--stage-color);
  font-weight: 900;
}

.inline-detail-items.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.inline-detail-items.inline-grid .inline-detail-row {
  padding: 8px 10px 8px 24px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--stage-soft) 70%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--stage-color) 14%, #e5e9f1);
}

.inline-detail-items.inline-grid .inline-detail-row::before {
  left: 10px;
  top: 8px;
}

.inline-warning,
.inline-info,
.inline-success,
.inline-code {
  background: #f8fbff;
  border-color: #dbe6f5;
}

.inline-warning h4,
.inline-info h4,
.inline-success h4,
.inline-code h4,
.inline-warning .inline-detail-row::before,
.inline-info .inline-detail-row::before,
.inline-success .inline-detail-row::before {
  color: #4f78c7;
}

.inline-warning .inline-detail-row,
.inline-info .inline-detail-row,
.inline-success .inline-detail-row {
  color: #364055;
}

.inline-code .inline-detail-row {
  color: #2f3a4d;
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.inline-code .inline-detail-row::before {
  display: none;
}

.inline-media-block .media-card {
  margin-bottom: 8px;
}

.inline-image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ===== 律所示例：搜索 + 名称网格 + 共享图片区 ===== */
.inline-firm-samples {
  --firm-accent: #3b82f6;
  --firm-accent-2: #5b93f5;
  --firm-soft: rgba(59, 130, 246, 0.06);
  --firm-ring: rgba(59, 130, 246, 0.14);
  --firm-text: #2f3a4d;
  --firm-shadow: rgba(47, 107, 255, 0.32);
}

.inline-firm-samples h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-firm-samples h4::after {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--firm-soft);
  color: var(--firm-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.inline-firm-samples-signing {
  --firm-accent: #2563eb;
  --firm-accent-2: #5b93f5;
  --firm-soft: rgba(37, 99, 235, 0.08);
  --firm-ring: rgba(37, 99, 235, 0.16);
  --firm-text: #214d9c;
  --firm-shadow: rgba(37, 99, 235, 0.26);
}

.inline-firm-samples-payment {
  --firm-accent: #7c3aed;
  --firm-accent-2: #a76cf5;
  --firm-soft: rgba(124, 58, 237, 0.08);
  --firm-ring: rgba(124, 58, 237, 0.16);
  --firm-text: #5b21b6;
  --firm-shadow: rgba(124, 58, 237, 0.24);
}

.inline-firm-samples-signing h4::after {
  content: "\7B7E\7F72";
}

.inline-firm-samples-payment h4::after {
  content: "\4ED8\6B3E";
}

.firm-search {
  width: 100%;
  margin: 8px 0 12px;
  padding: 9px 14px;
  border: 1px solid rgba(220, 225, 235, 0.9);
  border-left: 3px solid var(--firm-accent);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: #2f3a4d;
  outline: none;
  box-sizing: border-box;
}

.firm-search:focus {
  border-color: var(--firm-accent);
  box-shadow: 0 0 0 3px var(--firm-ring);
}

.firm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.firm-chip {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(220, 225, 235, 0.9);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--firm-text);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.firm-chip:hover {
  border-color: var(--firm-accent);
  background: var(--firm-soft);
}

.firm-chip.is-active {
  border-color: var(--firm-accent);
  background: linear-gradient(145deg, var(--firm-accent-2), var(--firm-accent));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px var(--firm-shadow), 0 0 0 3px var(--firm-ring);
  transform: translateY(-1px);
}

.firm-shared-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(220, 225, 235, 0.9);
  border-radius: 10px;
  background: #fbfcfe;
}

.firm-shared-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #2f3a4d;
}

@media (max-width: 768px) {
  .step-detail {
    margin-left: 16px;
  }

  .inline-detail {
    padding: 12px;
  }

  .inline-detail-items.inline-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== V3：树状思维导图式步骤说明 ===== */
.stage-body {
  max-height: 12000px;
}

.step-flow {
  position: relative;
}

.step-flow::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 42px;
  bottom: 42px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--stage-color) 72%, #ffffff),
    color-mix(in srgb, var(--stage-color) 22%, #ffffff)
  );
  opacity: 0.7;
  pointer-events: none;
}

.step-item {
  position: relative;
  padding-left: 0;
}

.step-item::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 17px;
  top: 40px;
  width: 30px;
  height: 2px;
  background: color-mix(in srgb, var(--stage-color) 58%, #ffffff);
  pointer-events: none;
}

.step-node {
  overflow: visible;
}

.step-detail {
  position: relative;
  margin-left: 58px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.step-detail::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 0;
  bottom: 18px;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stage-color) 34%, #ffffff);
}

.inline-detail {
  position: relative;
  padding: 14px 0 4px 20px;
}

.inline-detail-summary {
  position: relative;
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 18%, #dfe4ee);
  border-radius: 12px;
  background: color-mix(in srgb, var(--stage-soft) 58%, #ffffff);
}

.inline-detail-summary::before,
.inline-detail-block::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 22px;
  width: 22px;
  height: 2px;
  background: color-mix(in srgb, var(--stage-color) 40%, #ffffff);
}

.inline-detail-summary::after,
.inline-detail-block::after {
  content: "";
  position: absolute;
  left: -40px;
  top: 18px;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--stage-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--stage-color) 24%, #ffffff);
}

.inline-detail-block {
  position: relative;
  margin-top: 10px;
  box-shadow: 0 5px 14px rgba(31, 45, 73, 0.045);
}

.inline-detail-block h4 {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inline-detail-block h4::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.step-more {
  min-width: 60px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 24%, #e5e8ef);
  border-radius: 999px;
  background: var(--stage-soft);
  text-align: center;
}

.step-item.is-open .step-more::after {
  content: " ︿";
}

.step-item.is-closed .step-more::after {
  content: " ﹀";
}

@media (max-width: 768px) {
  .step-flow::before {
    left: 17px;
  }

  .step-detail {
    margin-left: 48px;
  }

  .step-detail::before {
    left: -20px;
  }

  .inline-detail {
    padding-left: 14px;
  }

  .inline-detail-summary::before,
  .inline-detail-block::before {
    left: -28px;
    width: 16px;
  }

  .inline-detail-summary::after,
  .inline-detail-block::after {
    left: -32px;
  }
}


/* ===== V4 参考图风格优化 ===== */
body {
  background: linear-gradient(180deg, #fafbfd 0%, #f2f5fb 100%);
}

.topbar {
  height: 88px;
  padding: 0 34px;
  justify-content: space-between;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 6px 26px rgba(36, 55, 88, 0.06);
}

.brand-left {
  flex: 0 0 auto;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 42px;
  justify-content: center;
  flex: 1 1 auto;
}

.topnav a {
  color: #1f2c44;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  position: relative;
  transition: color 0.2s ease;
}

.topnav a:hover,
.topnav a.active {
  color: #2f67f6;
}

.topnav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  border-radius: 3px;
  background: #2f67f6;
}

.toolbar {
  flex: 0 0 auto;
  gap: 10px;
}

.toolbar button {
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border-color: #d9e2f0;
  color: #30415e;
  background: #fff;
}

.toolbar button:hover {
  transform: translateY(-1px);
}

.toolbar .contact-button {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
}

.app-shell {
  background: linear-gradient(180deg, #f7f9fd 0%, #f3f6fb 100%);
}

.map-panel {
  padding-top: 18px;
}

.map-hint {
  top: 22px;
  padding: 9px 18px;
  border-radius: 16px;
  font-size: 12px;
  color: #6d7890;
}

.hero-note {
  position: absolute;
  top: 72px;
  right: 36px;
  z-index: 12;
  width: 270px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.96);
  border: 1px solid #e6edf8;
  box-shadow: 0 12px 36px rgba(42, 61, 92, 0.08);
}

.hero-note-title {
  margin-bottom: 12px;
  color: #2b5fe8;
  font-size: 18px;
  font-weight: 900;
}

.hero-note ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-note li {
  position: relative;
  padding-left: 18px;
  color: #40506c;
  font-size: 13px;
  line-height: 1.65;
}

.hero-note li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #2f67f6;
  font-weight: 900;
}

.mindmap {
  min-width: 1500px;
  padding: 130px 76px 110px;
  gap: 82px;
}

.root-node {
  top: 110px;
  flex: 0 0 320px;
  width: 320px;
  min-height: 460px;
  border: 1px solid #e7edf6;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 16px 42px rgba(38, 57, 92, 0.08);
}

.root-kicker {
  background: #eef4ff;
  border-color: #d9e8ff;
  color: #2d5bd1;
}

.root-node h1 {
  margin-top: 18px;
  color: #151f36;
  font-size: 34px;
  line-height: 1.28;
}

.root-node h1 br {
  display: none;
}

.root-node h1::after {
  content: "";
}

.root-node p {
  margin-top: 16px;
  color: #3f4d67;
  font-size: 15px;
  line-height: 1.8;
}

.root-badges {
  margin-top: 20px;
  gap: 10px;
}

.root-badges span {
  padding: 7px 10px;
  border-radius: 999px;
  border-color: #dbe7ff;
  background: #fff;
  color: #2d5bd1;
  font-size: 12px;
}

.root-contact {
  margin-top: 22px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f67f6, #3b82f6);
  box-shadow: 0 10px 22px rgba(47, 103, 246, 0.22);
}

.flow-column {
  width: 1020px;
  flex-basis: 1020px;
  gap: 28px;
}

.stage-card {
  width: 1020px;
  min-height: 118px;
  padding: 16px 16px 18px;
  border-radius: 24px;
  border: 1px solid #e5ecf6;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249,251,255,0.98) 100%);
  box-shadow: 0 10px 28px rgba(38, 57, 92, 0.06);
}

.stage-card::before {
  left: 70px;
}

.stage-head {
  min-height: 78px;
  padding: 10px 12px;
}

.stage-head:hover {
  background: #f7faff;
}

.stage-index {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  box-shadow: none;
}

.stage-head-copy strong {
  font-size: 28px;
  line-height: 1.18;
  color: #172033;
}

.stage-head-copy small {
  font-size: 13px;
  line-height: 1.7;
  color: #66758e;
}

.stage-body {
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 18px;
  padding: 12px 10px 4px 82px;
}

.step-node {
  min-height: 78px;
  border-radius: 16px;
  border-color: #e3eaf5;
  background: #fff;
}

.step-node:hover {
  background: #fbfdff;
}

.step-copy strong {
  font-size: 15px;
}

.step-copy small {
  font-size: 12px;
}

.step-more,
.decision-badge {
  font-size: 11px;
}

.step-detail {
  margin-left: 42px;
  border-color: #e7edf6;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

.inline-detail {
  padding: 14px 16px;
}

.inline-detail-summary {
  color: #55637d;
}

.inline-detail-block {
  border-color: #e7edf6;
  background: #fff;
}

.inline-detail-block h4 {
  color: #1d3557;
}

.inline-warning {
  background: #fff8ef;
}

.inline-info {
  background: #f6fbff;
}

.inline-success {
  background: #f2fbf5;
}

.stage-outputs,
.stage-media .media-card {
  border-radius: 18px;
}

.stage-outputs {
  border-style: solid;
  border-color: #edf2fa;
  background: #fbfcff;
}

.stage-outputs h3,
.stage-media h3 {
  font-size: 13px;
  color: #f59e0b;
}

.output-chips span {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.stage-media {
  padding-left: 0;
}

.media-card {
  border-radius: 18px;
  border-color: #e8eef7;
  box-shadow: 0 8px 22px rgba(38, 57, 92, 0.07);
}

.media-card img {
  max-height: 180px;
  border-radius: 12px;
}

.decision-router {
  gap: 12px;
}

.decision-path {
  min-height: 52px;
  border-radius: 14px;
}

.end-node {
  width: 600px;
  border-radius: 20px;
  border-width: 1px;
  box-shadow: 0 12px 28px rgba(38, 57, 92, 0.08);
}

@media (max-width: 1200px) {
  .topnav {
    gap: 26px;
  }

  .hero-note {
    right: 18px;
    width: 240px;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: auto;
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topnav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 24px;
  }

  .topnav a {
    font-size: 13px;
  }

  .hero-note {
    position: static;
    width: auto;
    margin: 62px 12px 0;
  }

  .map-hint {
    top: 18px;
    max-width: calc(100% - 24px);
    white-space: normal;
    border-radius: 14px;
  }

  .mindmap {
    padding-top: 34px;
  }

  .root-node {
    min-height: 360px;
    width: 260px;
    flex-basis: 260px;
  }

  .root-node h1 {
    font-size: 28px;
  }

  .stage-head-copy strong {
    font-size: 21px;
  }
}

/* ===== Small-screen layout fixes ===== */
@media (max-width: 768px) {
  body {
    min-height: 100dvh;
  }

  .topbar {
    min-height: 0;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  }

  .brand-logo {
    width: 230px;
    height: 66px;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding: 0 2px 4px;
    scrollbar-width: none;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar button {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
  }

  .app-shell {
    min-height: 0;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .map-panel {
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: 100vw;
    min-height: 0;
    padding-top: 0;
  }

  .map-hint {
    position: relative;
    inset: auto;
    left: auto;
    top: auto;
    bottom: auto;
    transform: none;
    flex: 0 0 auto;
    width: calc(100vw - 20px);
    max-width: 355px;
    margin: 8px 10px 6px;
    padding: 7px 10px;
    border-radius: 10px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    pointer-events: none;
  }

  .viewport {
    flex: 1 1 auto;
    width: 100vw;
    max-width: 100vw;
    min-height: 0;
  }

  .mindmap {
    padding-top: 40px;
    padding-bottom: 80px;
  }

  .detail-drawer {
    width: min(94vw, 420px);
    max-height: calc(100dvh - 92px);
  }

  .side-qr {
    display: none;
  }

  .footer {
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .footer-main {
    width: 100%;
    max-width: 355px;
    display: block;
    text-align: center;
  }

  .footer-col,
  .footer-col.footer-brand {
    min-width: 0;
  }

  .footer-col.footer-brand {
    justify-content: center;
    margin-bottom: 3px;
  }

  .footer-col:not(.footer-brand) {
    display: block;
    width: 100%;
  }

  .footer-logo {
    max-width: 86vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .footer-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 2px 8px;
  }

  .footer-list li {
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    justify-content: flex-start;
    font-size: 9px;
  }

  .footer-icon {
    width: 10px;
    flex: 0 0 10px;
    font-size: 10px;
  }

  .footer-bottom {
    margin-top: 3px;
    display: block;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.25;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 6px;
  }

  .toolbar button {
    padding: 0 8px;
  }



  .footer-main {
    display: block;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo {
    max-width: 86vw;
    text-align: center;
  }

  .footer-col.footer-brand {
    justify-content: center;
    margin-bottom: 3px;
  }

  .footer-col:not(.footer-brand) {
    display: block;
    width: 100%;
  }

  .footer-list {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 2px 8px;
  }

  .footer-list li {
    max-width: none;
    justify-content: flex-start;
    font-size: 9px;
  }

  .footer-icon {
    width: 10px;
    flex-basis: 10px;
    font-size: 10px;
  }

  .footer-bottom {
    margin-top: 2px;
    font-size: 8.5px;
  }
}

@media (max-height: 680px) and (max-width: 768px) {
  .topbar {
    padding-top: calc(6px + env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .brand-logo {
    width: 200px;
    height: 52px;
  }

  .toolbar button {
    height: 28px;
  }

  .map-hint {
    margin-top: 6px;
    margin-bottom: 4px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 10px;
  }

  .footer {
    padding-top: 5px;
  }

  .footer-bottom {
    display: none;
  }
}

/* ===== Header center copy and reference-style footer ===== */
.top-center {
  flex: 1 1 auto;
  min-width: 240px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #172033;
  pointer-events: none;
}

.top-center strong {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.top-center span {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  color: #6b7280;
}

.footer {
  padding: 12px 28px 10px;
  background: #367bf3;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 -8px 28px rgba(54, 123, 243, 0.16);
}

.footer-main {
  max-width: 1420px;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(420px, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 18px 28px;
}

.footer-col.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.footer-logo {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
  color: #ffffff;
}

.footer-tagline {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
}

.footer-contact {
  min-width: 0;
}

.footer-list {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.9fr);
  gap: 7px 28px;
}

.footer-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.footer-list li span:last-child,
.footer-list li a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-list a {
  color: #ffffff;
  text-decoration: none;
}

.footer-list a:hover {
  color: #dbeafe;
}

.footer-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.footer-qr {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.footer-qr-card {
  width: 82px;
  margin: 0;
  padding: 5px;
  border-radius: 8px;
  background: #ffffff;
  color: #367bf3;
  text-align: center;
  box-shadow: 0 5px 16px rgba(0, 16, 48, 0.18);
}

.footer-qr-card img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
}

.footer-qr-card figcaption {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
}

.footer-bottom {
  max-width: 1420px;
  margin-top: 6px;
  padding-top: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  line-height: 1.25;
}

@media (max-width: 1200px) {
  .top-center strong {
    font-size: 15px;
  }

  .top-center span {
    font-size: 11px;
  }

  .footer {
    padding: 10px 18px 8px;
  }

  .footer-main {
    grid-template-columns: minmax(160px, 210px) minmax(360px, 1fr) auto;
    gap: 14px;
  }

  .footer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
  }

  .footer-list li {
    font-size: 12px;
  }

  .footer-qr-card {
    width: 70px;
  }

  .footer-qr-card img {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 900px) {
  .topbar {
    gap: 12px;
  }

  .top-center {
    order: 3;
    flex-basis: 100%;
    min-width: 0;
  }

  .footer-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
  }

  .footer-col.footer-brand {
    grid-column: 1 / 2;
  }

  .footer-contact {
    grid-column: 1 / 2;
  }

  .footer-qr {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
  }
}

@media (max-width: 768px) {
  .top-center {
    width: 100%;
    margin-top: -2px;
    gap: 2px;
  }

  .top-center strong {
    font-size: 13px;
  }

  .top-center span {
    max-width: calc(100vw - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
  }

  .footer {
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .toolbar .contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .footer-main {
    max-width: 520px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    text-align: center;
  }

  .footer-col.footer-brand {
    align-items: center;
    margin-bottom: 0;
  }

  .footer-logo {
    max-width: 92vw;
    font-size: 13px;
    text-align: center;
  }

  .footer-tagline {
    display: none;
  }

  .footer-contact {
    display: block;
    width: 100%;
  }

  .footer-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
  }

  .footer-list li {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px;
    justify-content: stretch;
    text-align: left;
    font-size: 9.5px;
  }

  .footer-label {
    min-width: 28px;
    height: 18px;
    font-size: 9px;
  }

  .footer-qr {
    display: none;
  }

  .footer-bottom {
    display: block;
    margin-top: 3px;
    max-width: 92vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8.5px;
  }
}

@media (max-width: 480px) {
  .top-center strong {
    max-width: calc(100vw - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .footer-main {
    max-width: 355px;
  }

  .footer-list li:nth-child(1),
  .footer-list li:nth-child(6) {
    grid-column: 1 / -1;
  }
}

@media (max-height: 680px) and (max-width: 768px) {
  .top-center span {
    display: none;
  }

  .footer-list li:nth-child(1),
  .footer-list li:nth-child(6),
  .footer-bottom {
    display: none;
  }
}

/* Final mobile guard: keep the H5 surface full-width even in narrow preview panes. */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0;
  }

  .topbar,
  .app-shell,
  .map-panel,
  .viewport,
  .footer {
    width: 100%;
    max-width: 100%;
  }

  .topbar {
    align-items: stretch;
  }

  .brand,
  .brand-left,
  .top-center,
  .toolbar {
    min-width: 0;
  }

  .toolbar {
    display: flex;
    justify-content: flex-start;
  }

  .toolbar .contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .footer {
    align-self: stretch;
  }

  .footer-main {
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
  }

  .footer-qr,
  .footer-qr-card {
    display: none !important;
  }
}

/* ===== Unified top and footer chrome ===== */
.topbar {
  height: 74px;
  padding: 8px 28px;
  gap: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-bottom: 1px solid #dbe8ff;
  box-shadow: 0 8px 26px rgba(54, 123, 243, 0.08);
}

.brand-logo {
    width: 260px;
    height: 80px;
  }

.top-center {
  color: #16356a;
}

.top-center strong {
  font-size: 16px;
  line-height: 1.2;
}

.top-center span {
  color: #5c6f91;
  font-size: 11.5px;
}

.toolbar {
  gap: 8px;
}

.toolbar button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid #d7e5ff;
  background: #ffffff;
  color: #1c3d72;
  box-shadow: 0 4px 12px rgba(38, 83, 150, 0.06);
}

.toolbar button:hover {
  border-color: #9fc3ff;
  box-shadow: 0 7px 18px rgba(54, 123, 243, 0.14);
}

.toolbar .contact-button {
  background: #367bf3;
  border-color: #367bf3;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(54, 123, 243, 0.26);
}

.footer {
  background: #367bf3;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 -8px 24px rgba(54, 123, 243, 0.18);
}

.footer-label {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.footer-list li,
.footer-list a,
.footer-logo {
  color: #ffffff;
}

.footer-tagline,
.footer-bottom {
  color: rgba(255, 255, 255, 0.76);
}

.footer-list a:hover {
  color: #eaf2ff;
}

@media (max-width: 768px) {
  .topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 0;
    height: auto;
    padding: calc(7px + env(safe-area-inset-top)) 10px 7px;
  }

  .brand,
  .brand-left {
    flex: 0 0 auto;
    justify-content: flex-start;
    align-self: center;
  }

  .brand-logo {
    width: 180px;
    height: 52px;
    object-position: left center;
    transform: scale(1.24);
    transform-origin: left center;
  }

  .top-center {
    display: none;
  }

  .toolbar {
    flex: 1 1 auto;
    width: auto;
    max-width: calc(100vw - 138px);
    min-width: 0;
    padding: 0;
    gap: 4px;
    row-gap: 3px;
    flex-wrap: nowrap !important;
    overflow: hidden;
    justify-content: flex-end;
    align-content: center;
  }

  .toolbar button {
    height: 24px;
    padding: 0 7px;
    font-size: 9.5px;
    box-shadow: none;
  }

  .toolbar .contact-button {
    display: inline-flex;
    width: auto;
    padding: 0 14px;
    color: #ffffff;
    white-space: nowrap;
  }

  .footer {
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  }

  .footer-main {
    gap: 4px;
  }

  .footer-logo {
    font-size: 12px;
    line-height: 1.2;
  }

  .footer-list {
    gap: 3px 8px;
  }

  .footer-list li {
    font-size: 9px;
    line-height: 1.25;
  }

  .footer-bottom {
    font-size: 8px;
  }
}

@media (max-width: 390px) {
  .top-center span {
    display: none;
  }

  .toolbar button {
    padding: 0 8px;
  }
}

/* ===== Vertical flow layout ===== */
.mindmap {
  min-width: 1120px;
  min-height: 2800px;
  padding: 86px 40px 150px;
  flex-direction: column;
  align-items: center;
  gap: 74px;
}

.root-node {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  width: 520px;
  min-height: 320px;
}

.flow-column {
  flex: 0 0 auto;
  width: min(1040px, 100%);
}

.stage-card {
  width: 100%;
}

@media (max-width: 1200px) {
  .mindmap {
    min-width: 1040px;
    padding-left: 30px;
    padding-right: 30px;
  }

  .root-node {
    width: 480px;
  }

  .flow-column {
    width: 980px;
  }
}

@media (max-width: 768px) {
  .mindmap {
    min-width: 760px;
    min-height: 2500px;
    padding: 50px 24px 120px;
    gap: 48px;
  }

  .root-node {
    width: 700px;
    min-height: 270px;
  }

  .root-node h1 {
    width: 360px !important;
    max-width: 360px !important;
    font-size: 26px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
    text-align: center;
  }

  .root-node h1 br {
    display: initial;
  }

  .flow-column,
  .stage-card {
    width: 700px;
    flex-basis: auto;
  }
}

/* ===== Final polish: stage toggle and footer ===== */
.stage-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid color-mix(in srgb, var(--stage-color) 34%, #dbe7ff);
  color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(36, 74, 140, 0.10);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.stage-toggle::before,
.stage-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stage-color) 82%, #1d3557);
  transform-origin: center;
}

.stage-toggle::before {
  transform: translate(-78%, -50%) rotate(45deg);
}

.stage-toggle::after {
  transform: translate(-22%, -50%) rotate(-45deg);
}

.stage-head:hover .stage-toggle {
  border-color: color-mix(in srgb, var(--stage-color) 54%, #ffffff);
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--stage-soft) 72%, #ffffff) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 22px rgba(36, 74, 140, 0.16);
}

.stage-card.is-expanded .stage-toggle {
  transform: rotate(180deg);
}

.footer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(239, 246, 255, 0.96) 100%);
  color: #173968;
  border-top: 1px solid #cfe0fb;
  box-shadow: 0 -10px 30px rgba(41, 84, 155, 0.12);
  backdrop-filter: blur(14px);
}

.footer-logo {
  color: #123d76;
}

.footer-tagline,
.footer-bottom {
  color: #5b6f91;
}

.footer-list li,
.footer-list a {
  color: #183b6b;
}

.footer-list a:hover {
  color: #2563eb;
}

.footer-label {
  background: #e8f1ff;
  color: #2f67d8;
  border: 1px solid #d4e4ff;
}

.footer-qr-card {
  color: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

@media (max-width: 768px) {
  .stage-toggle {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .footer {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(235, 244, 255, 0.98) 100%);
  }
}

/* Mobile scrolling: let the browser handle one-finger vertical scroll. */
@media (max-width: 768px) {
  .viewport {
    overflow: auto;
    cursor: auto;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .viewport:active {
    cursor: auto;
  }

  .canvas {
    will-change: auto;
  }
}

/* Final small-screen layout: avoid scaled canvas scroll gaps. */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-y: auto;
  }

  .topbar,
  .app-shell,
  .map-panel,
  .viewport,
  .footer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .app-shell {
    flex: 0 0 auto;
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .map-panel {
    display: block;
    overflow: visible;
  }

  .topbar,
  .footer {
    overflow-x: hidden;
  }

  .brand-logo {
    width: min(220px, 48vw);
    height: 68px;
    transform: none !important;
  }

  .toolbar {
    max-width: none;
  }

  .map-hint {
    width: auto;
    max-width: calc(100% - 20px);
  }

  .viewport {
    overflow-x: hidden;
    overflow-y: visible;
    height: auto;
    min-height: 0;
  }

  .canvas {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    transform: none !important;
  }

  .mindmap {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 16px 12px 24px;
    gap: 20px;
    align-items: stretch;
    overflow-x: hidden;
  }

  .connector-layer {
    max-width: 100%;
    overflow: hidden;
  }

  .root-node,
  .flow-column,
  .stage-card,
  .end-node {
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
  }

  .root-node {
    min-height: 0;
    padding: 18px 14px;
    border-radius: 18px;
  }

  .root-node h1 {
    width: auto !important;
    max-width: 100% !important;
    font-size: 22px !important;
    word-break: normal !important;
  }

  .root-node p {
    font-size: 13px;
    line-height: 1.6;
  }

  .flow-column {
    gap: 18px;
  }

  .stage-card {
    min-height: 0;
    padding: 10px;
    border-radius: 16px;
  }

  .stage-card::before {
    display: none;
  }

  .stage-head {
    min-height: 60px;
    grid-template-columns: 36px minmax(0, 1fr) 30px;
    gap: 8px;
    padding: 8px;
  }

  .stage-index {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 16px;
  }

  .stage-head-copy strong {
    font-size: 17px;
  }

  .stage-head-copy small {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .stage-title-line,
  .stage-duration-list,
  .step-copy,
  .inline-detail,
  .inline-detail-block,
  .inline-detail-row,
  .output-chips {
    min-width: 0;
    max-width: 100%;
  }

  .stage-body {
    display: block;
    padding: 8px 0 2px;
  }

  .step-flow {
    gap: 12px;
  }

  .step-flow::before,
  .step-item::before,
  .step-detail::before,
  .inline-detail-summary::before,
  .inline-detail-summary::after,
  .inline-detail-block::before,
  .inline-detail-block::after {
    display: none;
  }

  .step-node {
    min-height: 64px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
    border-radius: 12px;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .step-copy strong {
    font-size: 13.5px;
  }

  .step-copy small {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .step-more,
  .decision-badge {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    padding: 4px 7px;
    font-size: 10px;
  }

  .step-detail {
    margin-left: 0;
  }

  .inline-detail {
    padding: 10px 0 2px;
  }

  .inline-detail-summary,
  .inline-detail-block {
    padding: 10px;
    border-radius: 10px;
  }

  .inline-detail-row {
    font-size: 11.5px;
    line-height: 1.6;
  }

  .decision-router {
    grid-template-columns: 1fr;
  }

  .end-node {
    padding: 14px;
  }
}

/* Direct page mode: the flow is normal document content, not a draggable canvas. */
:root {
  --fixed-topbar-height: 74px;
  --fixed-footer-height: 132px;
}

html,
body {
  height: auto;
  min-height: 100%;
  overflow-x: auto;
}

body {
  display: block;
  overflow-y: auto;
}

.topbar,
.footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1000;
}

.topbar {
  top: 0;
}

.footer {
  bottom: 0;
}

.app-shell,
.map-panel,
.viewport {
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.app-shell {
  display: block;
  padding-top: var(--fixed-topbar-height);
  padding-bottom: var(--fixed-footer-height);
}

.viewport,
.viewport:active {
  height: auto;
  cursor: auto;
  user-select: auto;
  touch-action: pan-y pinch-zoom;
}

.canvas,
.canvas.is-dragging {
  width: 100%;
  max-width: 100%;
  transform: none !important;
  transition: none;
  will-change: auto;
}

.mindmap {
  width: 1480px;
  min-width: 1480px;
  min-height: 0;
  margin: 0 auto;
  padding: 90px 80px 120px;
  gap: 110px;
}

.flow-column {
  flex: 0 0 1040px;
  width: 1040px;
  max-width: none;
}

.stage-card {
  width: 100%;
}

.detail-drawer {
  position: fixed;
  top: var(--fixed-topbar-height);
  right: 0;
  bottom: var(--fixed-footer-height);
  z-index: 1100;
  max-height: none;
}

.drawer-close {
  z-index: 2;
}

@media (max-width: 768px) {
  :root {
    --fixed-topbar-height: 92px;
    --fixed-footer-height: 104px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .topbar,
  .footer {
    width: 100%;
    max-width: 100%;
  }

  .mindmap {
    width: 100%;
    min-width: 0;
    padding: 16px 12px 24px;
    gap: 20px;
  }

  .flow-column {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }
}

/* Vertical stage flow: root on top, stages stacked downward, page scrolls vertically. */
:root {
  --stage-scroll-gap: 58px;
  --stage-scroll-card-width: min(1040px, calc(100vw - 48px));
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.viewport {
  display: block;
  width: 100%;
  max-width: 100vw;
  height: auto;
  overflow: visible;
  cursor: auto;
  user-select: auto;
}

.viewport.is-dragging,
.viewport.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.stage-head {
  grid-template-columns: 52px minmax(0, 1fr);
  cursor: default;
}

.stage-toggle {
  display: none !important;
}

.connector-layer {
  z-index: 8;
}

.root-node,
.flow-column {
  position: relative;
  z-index: 4;
}

.app-shell {
  height: auto;
  min-height: 0;
  overflow: visible;
  padding-top: var(--fixed-topbar-height);
  padding-bottom: var(--fixed-footer-height);
}

.map-panel {
  height: auto;
  overflow: visible;
}

.canvas,
.canvas.is-dragging {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
}

.mindmap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1100px, 100%);
  min-width: 0;
  max-width: 1100px;
  min-height: 0;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 60px) 80px;
  gap: var(--stage-scroll-gap);
}

.root-node {
  position: relative;
  top: auto;
  align-self: stretch;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  padding: 16px 24px;
}

/* 纵向布局下压缩介绍卡片，让用户一眼看到更多阶段标题 */
.root-node h1 {
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.25;
}

.root-node > p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.root-badges {
  margin-top: 10px;
  gap: 6px;
}

.root-action-note {
  margin-top: 10px;
  padding: 7px 12px;
}

.root-contact {
  margin-top: 12px;
  height: 34px;
}

.flow-column {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--stage-scroll-gap);
}

.flow-column .stage-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
}

.flow-column .end-node {
  width: 100%;
  margin-left: 0;
  align-self: stretch;
}

.stage-head {
  position: sticky;
  top: calc(var(--fixed-topbar-height) + 8px);
}

.flow-column .stage-head-copy,
.flow-column .stage-head-copy strong,
.flow-column .stage-head-copy small,
.flow-column .step-copy,
.flow-column .step-copy strong,
.flow-column .step-copy small,
.flow-column .inline-detail-summary,
.flow-column .inline-detail-row {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 768px) {
  :root {
    --stage-scroll-gap: 20px;
    --stage-scroll-card-width: calc(100vw - 24px);
  }

  .map-hint {
    display: none;
  }

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    position: static;
    display: block;
  }

  .viewport {
    height: auto;
    overflow: visible;
    touch-action: auto;
  }

  .app-shell {
    position: static;
    height: auto;
    min-height: calc(100dvh - var(--fixed-topbar-height) - var(--fixed-footer-height));
    padding-top: var(--fixed-topbar-height);
    padding-bottom: var(--fixed-footer-height);
    overflow: visible;
  }

  .map-panel {
    height: auto;
    overflow: visible;
  }

  .canvas,
  .canvas.is-dragging {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
  }

  .mindmap {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    align-items: stretch;
    padding: 16px 12px 24px;
    gap: var(--stage-scroll-gap);
  }

  .root-node {
    display: flex;
    position: relative;
    top: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    max-height: none;
    margin-right: 0;
    overflow: visible;
  }

  .flow-column {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: var(--stage-scroll-gap);
  }

  .flow-column .stage-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
  }

  .flow-column .end-node {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  .stage-head {
    grid-template-columns: 36px minmax(0, 1fr);
    top: calc(var(--fixed-topbar-height) + 4px);
  }

  .connector-layer {
    display: none;
  }

  .topbar,
  .footer {
    position: fixed;
    left: 0;
    right: 0;
  }

  .footer {
    bottom: 0;
    padding-bottom: calc(7px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .footer-list li,
  .footer-list li span,
  .footer-list a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-qr {
    display: none;
  }

  .swipe-hint {
    display: none;
  }
}

/* Persistent selected stage after using the top stage navigation. */
.stage-card.is-current-stage {
  border-color: color-mix(in srgb, var(--stage-color) 54%, #ffffff);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--stage-soft) 82%, #ffffff) 0%, #ffffff 42%, #ffffff 100%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-color) 13%, transparent), 0 18px 46px rgba(39, 52, 82, 0.12);
}

.stage-card.is-current-stage .stage-head {
  background: color-mix(in srgb, var(--stage-soft) 86%, #ffffff);
}

/* 右侧滑动提示（仅小屏） */
.swipe-hint {
  display: none;
  position: absolute;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 40;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(54, 123, 243, 0.92);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(54, 123, 243, 0.32);
  pointer-events: none;
  animation: swipeHintPulse 1.4s ease-in-out infinite;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.swipe-hint.is-hidden {
  opacity: 0;
  transform: translateX(12px);
}

.swipe-hint-arrow {
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

@keyframes swipeHintPulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

@media (max-width: 768px) {
  .image-lightbox {
    padding: 14px;
  }

  .lightbox-figure {
    max-width: 96vw;
    max-height: 92vh;
    padding: 10px;
  }

  .lightbox-images,
  .lightbox-images.is-multiple {
    grid-template-columns: 1fr;
    max-width: 92vw;
    max-height: 80vh;
  }

  .lightbox-img-wrap img,
  .lightbox-image-item img,
  .lightbox-images.is-multiple .lightbox-image-item img {
    max-height: none;
  }
}
