/* =========================================================
   投放一：九针回传（games-probe.js）
   ========================================================= */

.sweep-wrap {
  position: relative;
  padding: 6px;
  margin: 8px 0 6px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.045), transparent 62%),
    #07080a;
  overflow: hidden;
}

/* 底纹网格 */
.sweep-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 12px 12px;
}

/* 上电时下扫的扫描带 */
.sweep-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-110%);
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.05) 70%,
      rgba(255, 255, 255, 0.17) 100%);
  transition: opacity 0.3s ease;
}

.sweep-wrap.on .sweep-scan {
  opacity: 0.55;
  animation: scanY 3.6s linear infinite;
}

@keyframes scanY {
  from { transform: translateY(-110%); }
  to { transform: translateY(320%); }
}

.sweep-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

/* 连滑采样开启后接管手势 */
.sweep-grid.chain-on {
  touch-action: none;
}

.probe-cell {
  position: relative;
  aspect-ratio: 1.08;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #0a0b0e;
  border: 1px solid #14171d;
  font-family: monospace;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.25s ease;
}

/* 四角定位括号 */
.pc-c {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 0 solid #262c36;
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.pc-tl { top: 2px; left: 2px; border-top-width: 1px; border-left-width: 1px; }
.pc-tr { top: 2px; right: 2px; border-top-width: 1px; border-right-width: 1px; }
.pc-bl { bottom: 2px; left: 2px; border-bottom-width: 1px; border-left-width: 1px; }
.pc-br { bottom: 2px; right: 2px; border-bottom-width: 1px; border-right-width: 1px; }

/* 上电：只提亮边框，不加动效 */
.probe-cell.live {
  border-color: #232833;
  background: #0b0d11;
}

.probe-id {
  font-size: 8px;
  color: #333a45;
  letter-spacing: 0.5px;
  transition: color 0.18s ease;
}

.probe-cell.live .probe-id { color: var(--text-dim); }
.probe-cell.done .probe-id { color: #565e6b; }

.probe-val {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.probe-cell.sampling .probe-val {
  opacity: 0.4;
  transform: none;
  color: #9aa2ad;
}

.probe-cell.done .probe-val {
  opacity: 1;
  transform: none;
}

/* 波形条 */
.pc-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 9px;
  margin-top: 1px;
}

.pc-wave i {
  display: block;
  width: 2px;
  height: 2px;
  background: #2a303a;
  transition: height 0.16s ease, background 0.16s ease;
}

.probe-cell.live .pc-wave i {
  background: #464e5b;
}

.probe-cell.done .pc-wave i { background: #8b939f; }

/* 定位成立 */
.probe-cell.hit {
  border-color: #cfd5dd;
  background: #171b22;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 16px -8px #fff;
}

.probe-cell.hit .pc-c { border-color: #cfd5dd; }
.probe-cell.hit .pc-wave i { background: #e6e9ee; }

/* ERR-0 */
.probe-cell.err {
  border-color: var(--accent);
  background: #150b0c;
}

.probe-cell.err .pc-c { border-color: var(--accent); }
.probe-cell.err .probe-val { color: var(--accent); }
.probe-cell.err .pc-wave i { background: var(--accent); }

/* 进度条 */
.sweep-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.sweep-count { flex-shrink: 0; }

.sweep-bar {
  position: relative;
  flex: 1;
  height: 2px;
  background: #14171d;
  overflow: hidden;
}

.sweep-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #8b939f;
  transition: width 0.22s ease;
}

.sweep-actions {
  display: flex;
  gap: 6px;
}

.sweep-actions .btn {
  flex: 1;
  justify-content: center;
  gap: 8px;
}

/* 阵列状态灯 */
.probe-state {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0;
  color: var(--text-dim);
}

.probe-state.live { color: #9aa2ad; }
.probe-state.hit { color: #e6e9ee; }
.probe-state.err { color: var(--accent); }
.probe-state.null { color: #3a414c; }

/* 阵列自动化：列表形式，已接入常驻 */
.probe-upg {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.upg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 7px;
}

/* 顶部计时（过载脉冲剩余时间），空着时也占位，避免标题上下跳 */
.upg-timer {
  min-height: 11px;
  letter-spacing: 0.4px;
  color: #3f4653;
  transition: color 0.2s ease;
}

.upg-timer.on {
  color: #cfd5dd;
}

.probe-upg .btn {
  align-items: center;
}

.probe-upg .btn > div {
  flex: 1;
  min-width: 0;
}

.probe-upg .btn .sub {
  line-height: 1.45;
}

/* 已接入的行不可点，只作留档 */
.probe-upg .upg-item {
  cursor: default;
  background: #0d0f13;
}

.probe-upg .upg-item:active {
  background: #0d0f13;
}

.probe-upg .upg-item > div > div:first-child {
  color: #8b939f;
}

.probe-upg .upg-item .sub {
  color: #3f4653;
}

/* 申购行：一次只露一条，新露出的那条自己浮上来 */
@keyframes shopRowIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shopRowInDim {
  from { transform: translateY(-5px); }
  to   { transform: translateY(0); }
}

.probe-upg .shop-row {
  animation: shopRowIn 0.3s ease-out backwards;
}

/* 买不起的行本来就被压暗，别再让它闪一下全亮 */
.probe-upg .shop-row:disabled {
  animation-name: shopRowInDim;
}

.probe-upg .shop-row .sc-right {
  flex-shrink: 0;
  margin-left: 8px;
  text-align: right;
}
