/* 连线 Flow · 独立样式（选择器统一前缀 .g-flow） */

.g-flow {
  justify-content: flex-start;
}

/* ---------------- 顶部：尺寸分段 ---------------- */

.g-flow .flow-head {
  align-items: center;
  min-height: 44px;
}

.g-flow .flow-head .grow { width: 100%; }
.g-flow .flow-head .seg { width: 100%; padding: 4px; }
.g-flow .flow-head .seg-item { min-height: 38px; font-size: 12px; }

/* ---------------- 数据 ---------------- */

.g-flow .stats { gap: 8px; }
.g-flow .stat { padding: 8px 6px; }
.g-flow .stat-v { font-size: 16.5px; }

/* ---------------- 棋盘 ---------------- */

.g-flow .flow-boardwrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-flow .flow-board {
  position: relative;
  width: min(100%, clamp(224px, calc(100dvh - 380px), 460px));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(95, 224, 200, 0.1), transparent 58%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 54px -32px rgba(0, 0, 0, 0.95);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.g-flow .flow-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.g-flow .flow-cell {
  fill: rgba(255, 255, 255, 0.035);
}

.g-flow .flow-board[data-size="7"] .flow-cell,
.g-flow .flow-board[data-size="8"] .flow-cell {
  fill: rgba(255, 255, 255, 0.03);
}

/* 路径：先画一层深色描边做分割，再画彩色圆角粗线 */
.g-flow .flow-line-out {
  fill: none;
  stroke: rgba(4, 7, 12, 0.55);
  stroke-width: 0.56;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.g-flow .flow-line {
  fill: none;
  stroke-width: 0.44;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.g-flow .flow-ghost {
  fill: none;
  stroke-width: 0.34;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0.34 0.3;
  stroke-opacity: 0.92;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

/* ---------------- 端点 ---------------- */

.g-flow .flow-ep .ep-dot {
  stroke: rgba(255, 255, 255, 0.36);
  stroke-width: 0.035;
}

.g-flow .flow-ep .ep-ring {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.g-flow .flow-ep.pending .ep-ring {
  opacity: 1;
  animation: flowRing 1s ease-in-out infinite;
}

.g-flow .flow-ep .ep-check {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.g-flow .flow-ep.complete .ep-check { opacity: 1; }

.g-flow .flow-ep.complete .ep-dot {
  filter: brightness(1.16);
}

@keyframes flowRing {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.25; }
}

/* ---------------- 操作行 ---------------- */

.g-flow .flow-toolbar .btn { min-height: 44px; }

/* ---------------- 底部信息 ---------------- */

.g-flow .flow-meta { padding: 10px 12px 11px; }
.g-flow .flow-meta-head { align-items: baseline; gap: 8px; }
.g-flow .flow-meta-head .hint:first-child {
  color: var(--dim);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.g-flow .flow-meta-head .hint:last-child { flex: none; }
.g-flow .flow-meta .progress { height: 5px; margin-top: 6px; }
.g-flow .flow-tip {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--faint);
}
.g-flow .flow-pending-line:empty { display: none; }
.g-flow .flow-pending-line {
  margin-top: 5px;
  color: var(--accent);
  font-weight: 600;
}

/* ---------------- 结算覆盖层 ---------------- */

.g-flow .flow-over {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 11, 18, 0.85);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
}

.g-flow .flow-over.show { opacity: 1; visibility: visible; }

.g-flow .flow-over-card {
  width: 100%;
  max-width: 254px;
  text-align: center;
}

.g-flow .flow-over-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.g-flow .flow-over-sub {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--dim);
}

.g-flow .flow-over-stats {
  display: flex;
  gap: 8px;
  margin: 13px 0;
}

.g-flow .flow-ostat {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.g-flow .flow-ostat span {
  display: block;
  font-size: 10px;
  color: var(--faint);
  margin-bottom: 2px;
}

.g-flow .flow-ostat b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-flow .flow-over .btn { min-height: 44px; }
.g-flow .flow-over-row2 { margin-top: 8px; }
.g-flow .flow-over-row2 .btn { min-height: 38px; font-size: 12.5px; }

/* ---------------- 窄屏 / 动效偏好 ---------------- */

@media (max-width: 359px) {
  .g-flow .flow-head .seg-item { font-size: 11px; }
  .g-flow .stat-v { font-size: 15.5px; }
  .g-flow .flow-tip { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .g-flow .flow-ep.pending .ep-ring { animation: none; opacity: 0.85; }
  .g-flow .flow-ghost { transition: none; }
}
