/* 模块流程画布 */
:root {
  --canvas-bg: #3a3d42;
  --phone-bg: #fff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --arrow: #ff7a1a;
  --accent: #c45c26;
  --ok: #2f9e44;
  --screen-w: 375px;
  --screen-h: 812px;
  --label-h: 28px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--canvas-bg);
  color: #eee;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(28, 30, 34, .94);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar a {
  color: #c9c9c9;
  text-decoration: none;
  font-size: 13px;
}
.topbar a:hover { color: #fff; }
.topbar h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.topbar .nav {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.zoom-readout {
  margin-left: 8px;
  font-size: 12px;
  color: #aaa;
  min-width: 48px;
}

.canvas-wrap {
  position: relative;
  overflow: auto;
  height: calc(100% - 46px);
  cursor: grab;
}
.canvas-wrap.dragging { cursor: grabbing; }

.canvas {
  position: relative;
  transform-origin: 0 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.wires path {
  fill: none;
  stroke: var(--arrow);
  stroke-width: 1.5;
  marker-end: url(#arrowHead);
}
.wires text {
  fill: var(--arrow);
  font-size: 11px;
  font-weight: 600;
}

.node {
  position: absolute;
  z-index: 2;
  width: var(--screen-w);
}
.node .label {
  height: var(--label-h);
  line-height: var(--label-h);
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone {
  width: var(--screen-w);
  height: var(--screen-h);
  background: var(--phone-bg);
  color: var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  position: relative;
}
/* 移动端原型：隐藏滚动条，保留滚动 */
.phone,
.phone * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.phone::-webkit-scrollbar,
.phone *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.phone .status {
  height: 44px;
  padding: 14px 16px 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #111;
  background: #fff;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", "PingFang SC", sans-serif;
}
.phone .status .ios-time { line-height: 1; }
.phone .status .ios-trailing {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 12px;
}
.phone .status .ios-signal {
  width: 17px;
  height: 10px;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
}
.phone .status .ios-signal i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: currentColor;
}
.phone .status .ios-signal i:nth-child(1) { height: 3.5px; }
.phone .status .ios-signal i:nth-child(2) { height: 5.5px; }
.phone .status .ios-signal i:nth-child(3) { height: 7.5px; }
.phone .status .ios-signal i:nth-child(4) { height: 10px; }
.phone .status .ios-wifi {
  width: 15px;
  height: 11px;
  position: relative;
  margin: 0 1px;
}
.phone .status .ios-wifi::before,
.phone .status .ios-wifi::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 1.6px solid currentColor;
  border-bottom: none;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}
.phone .status .ios-wifi::before {
  width: 15px;
  height: 7px;
  top: 0;
}
.phone .status .ios-wifi::after {
  width: 9px;
  height: 5px;
  top: 3px;
}
.phone .status .ios-wifi b {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3.5px;
  height: 3.5px;
  margin-left: -1.75px;
  border-radius: 50%;
  background: currentColor;
}
.phone .status .ios-battery {
  width: 27px;
  height: 12px;
  border: 1.2px solid currentColor;
  border-radius: 3px;
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone .status .ios-battery em {
  position: relative;
  z-index: 1;
  font-style: normal;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  color: #111;
  transform: scale(0.92);
}
.phone .status .ios-battery::before {
  content: "";
  position: absolute;
  inset: 1.5px 3px 1.5px 1.5px;
  border-radius: 1.5px;
  background: currentColor;
}
.phone .status .ios-battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 3px;
  width: 1.8px;
  height: 5px;
  border-radius: 0 1.5px 1.5px 0;
  background: currentColor;
  opacity: .55;
}
.phone .nav {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 100px 0 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
  gap: 8px;
}
.phone .nav .back { color: var(--muted); font-weight: 400; }

/* 小程序胶囊：与搜索行对齐（约状态栏下方） */
.mp-capsule {
  position: absolute;
  top: 50px;
  right: 8px;
  z-index: 10;
  width: 87px;
  height: 32px;
  display: flex;
  align-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  overflow: hidden;
}
.mp-capsule-more,
.mp-capsule-close {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.mp-capsule-divider {
  width: 1px;
  height: 18px;
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.mp-capsule-more::before {
  content: "";
  width: 18px;
  height: 6px;
  background:
    radial-gradient(circle 1.6px at 2px 50%, #1a1a1a 98%, transparent),
    radial-gradient(circle 2.1px at 9px 50%, #1a1a1a 98%, transparent),
    radial-gradient(circle 1.6px at 16px 50%, #1a1a1a 98%, transparent);
}
.mp-capsule-close::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1.5px solid #1a1a1a;
  border-radius: 50%;
  box-sizing: border-box;
}
.mp-capsule-close::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  background: #1a1a1a;
  border-radius: 50%;
}
.phone .body {
  flex: 1;
  overflow: hidden;
  background: #f5f5f5;
  padding: 10px;
}
.phone .tabbar {
  height: 56px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  font-size: 10px;
  color: #888;
  text-align: center;
  align-items: center;
}
.phone .tabbar .on { color: var(--accent); font-weight: 600; }

.chip {
  display: inline-block;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid var(--line);
  margin: 2px;
  font-size: 10px;
}
.card {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 6px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.thumb {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #e8d5c4, #c9a882);
  border-radius: 6px;
  flex-shrink: 0;
}
.thumb.lg {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.muted { color: var(--muted); font-size: 10px; }
.price { color: var(--accent); font-weight: 700; }
.btn {
  display: inline-block;
  padding: 6px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  text-align: center;
}
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.block { display: block; width: 100%; }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.decision {
  position: absolute;
  z-index: 2;
  width: 120px;
  height: 120px;
  transform: rotate(45deg);
  background: #5a5e66;
  border: 2px solid var(--arrow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.decision span {
  transform: rotate(-45deg);
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  padding: 6px;
  color: #fff;
  font-weight: 600;
}
.note {
  position: absolute;
  z-index: 2;
  width: 240px;
  background: #2b2e33;
  border-left: 3px solid #3db86e;
  padding: 10px 12px;
  font-size: 11px;
  color: #ddd;
  line-height: 1.5;
}
.note strong { color: #3db86e; }
