/* =========================================================
   投放二：三轴对频仪表台 + 自动校准开关（games-phase.js）
   ========================================================= */

/* 开关 */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 17px;
  padding: 0;
  background: #0c0e12;
  border: 1px solid var(--border-light);
  cursor: pointer;
}

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: #3a414c;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.switch.on {
  border-color: #8b939f;
  background: #171b22;
}

.switch.on i {
  transform: translateX(17px);
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

/* =========================================================
   三轴对频 · 仪表台
   ========================================================= */
.axis-rig {
  position: relative;
  margin: 8px 0;
  padding: 7px 8px 6px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 62%),
    linear-gradient(180deg, #0a0c10 0%, #06070a 100%);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 底纹网格 */
.axis-rig::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 14px 14px;
}

/* 常驻扫描线 */
.axis-rig::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.45;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0 1px,
    transparent 1px 3px
  );
}

/* --- 顶栏 --- */
.rig-hud {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  font-family: monospace;
  font-size: 8.5px;
  letter-spacing: 1.4px;
  color: var(--text-dim);
}

.rig-led {
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  background: #7d8590;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.5);
  animation: logLed 2.6s ease-in-out infinite;
}

.rig-hud-title {
  color: #6b7280;
}

.rig-hud-state {
  margin-left: auto;
  letter-spacing: 0.8px;
  color: #3f4653;
  transition: color 0.2s ease;
}

/* --- 舞台：相位盘 + 三轨 --- */
.rig-stage {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0 7px;
}

.rig-dial {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid #1b2028;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 62%),
    #07080b;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.dial-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

.dial-ring.r1 { inset: 9px; }
.dial-ring.r2 { inset: 23px; border-style: dashed; border-color: rgba(255, 255, 255, 0.09); }

/* 刻度环 */
.dial-ticks {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  opacity: 0.5;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.3) 0deg 0.7deg,
    transparent 0.7deg 9deg
  );
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%);
  mask: radial-gradient(circle, transparent 62%, #000 63%);
  pointer-events: none;
}

/* 旋转扫描扇形 */
.dial-sweep {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  opacity: 0.42;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 44%);
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 70%);
  mask: radial-gradient(circle, transparent 28%, #000 70%);
  animation: dialSpin 4.4s linear infinite;
  pointer-events: none;
}

@keyframes dialSpin {
  to { transform: rotate(360deg); }
}

/* 指针：绕盘心转 */
.dial-needle {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 1px;
  height: 36px;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(0deg);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.12));
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.55);
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
}

/* 盘心读数 */
.dial-read {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: monospace;
  font-size: 7.5px;
  letter-spacing: 0.4px;
  color: #7d8590;
  pointer-events: none;
}

/* --- 三轨 --- */
.axis-cells {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.axis-cell {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 1px 6px;
  padding: 3px 6px 5px;
  border: 1px solid #14171d;
  background: #090b0e;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ax-id {
  font-family: monospace;
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.6px;
  color: #333a45;
}

.ax-val {
  font-family: monospace;
  font-size: 11.5px;
  line-height: 1.7;
  text-align: right;
  letter-spacing: 0.4px;
  color: #fff;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.ax-bar {
  grid-column: 1 / -1;
  height: 2px;
  background: #14171d;
  overflow: hidden;
}

.ax-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #3a414c;
  transition: width 0.26s cubic-bezier(0.2, 0.9, 0.3, 1), background 0.2s ease;
}

/* --- 底栏 --- */
.rig-foot {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}

.rig-note {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 下压扫描带 --- */
.rig-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 38%;
  z-index: 4;
  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) 68%,
    rgba(255, 255, 255, 0.17) 100%
  );
  transition: opacity 0.24s ease;
}

@keyframes rigScan {
  from { transform: translateY(-110%); }
  to { transform: translateY(240%); }
}

/* ============ 状态：起振 ============ */
.axis-rig.calib {
  border-color: #2a323d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 30px -14px rgba(255, 255, 255, 0.55);
}

.axis-rig.calib .rig-scan {
  opacity: 0.9;
  animation: rigScan 0.46s linear infinite;
}

.axis-rig.calib .dial-sweep {
  opacity: 0.95;
  animation-duration: 0.65s;
}

.axis-rig.calib .rig-hud-state { color: #cfd5dd; }
.axis-rig.calib .rig-led { background: #cfd5dd; }

.axis-rig.calib .axis-cell { border-color: #232833; background: #0b0d11; }
.axis-rig.calib .ax-bar i { background: #8b939f; }
.axis-rig.calib .ax-val { color: #cfd5dd; }

/* ============ 状态：闭环 ============ */
.axis-rig.lock {
  border-color: #2b323d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 26px -10px rgba(255, 255, 255, 0.5);
}

.axis-rig.lock .rig-hud-state { color: #fff; }
.axis-rig.lock .rig-led {
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.axis-rig.lock .axis-cell {
  border-color: #3a414c;
  background: #0e1116;
}

.axis-rig.lock .ax-bar i {
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
}

.axis-rig.lock .ax-val { text-shadow: 0 0 10px rgba(255, 255, 255, 0.7); }
.axis-rig.lock .dial-needle { box-shadow: 0 0 12px rgba(255, 255, 255, 0.95); }
.axis-rig.lock .dial-read { color: #fff; }

/* ============ 状态：半闭 ============ */
.axis-rig.half .rig-hud-state { color: var(--gold); }
.axis-rig.half .ax-bar i { background: #8a6d21; }

.axis-rig.half .axis-cell.hit {
  border-color: #4a3a17;
  background: #0f0d08;
}

.axis-rig.half .axis-cell.hit .ax-bar i {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 210, 74, 0.55);
}

.axis-rig.half .axis-cell.hit .ax-val {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 210, 74, 0.45);
}

.axis-rig.half .dial-read { color: var(--gold); }

/* ============ 状态：失锁 ============ */
.axis-rig.fail {
  animation: rigFailShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.axis-rig.fail .rig-hud-state { color: var(--accent); }
.axis-rig.fail .ax-val { color: #8d5a5c; }
.axis-rig.fail .ax-bar i { background: #5a2a2c; }
.axis-rig.fail .axis-cell { border-color: #2a1a1c; }
.axis-rig.fail .dial-sweep { opacity: 0.2; }
.axis-rig.fail .dial-read { color: #8d5a5c; }

@keyframes rigFailShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(1px, 1px); }
}

/* ============ 状态：归零 ============ */
.axis-rig.void {
  border-color: var(--accent);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(158, 42, 43, 0.22), transparent 62%),
    linear-gradient(180deg, #0d0607 0%, #060304 100%);
  box-shadow: 0 0 0 1px rgba(158, 42, 43, 0.5), 0 0 34px -12px rgba(158, 42, 43, 0.9);
  animation: rigVoidTear 0.6s steps(3);
}

.axis-rig.void::after {
  opacity: 0.9;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 40, 60, 0.12) 0 1px,
    transparent 1px 3px
  );
  animation: rigNoise 0.12s steps(2) infinite;
}

.axis-rig.void .rig-hud-state,
.axis-rig.void .rig-note { color: #ff4a4c; }

.axis-rig.void .rig-led {
  background: #ff4a4c;
  box-shadow: 0 0 10px rgba(255, 74, 76, 0.9);
}

.axis-rig.void .ax-val {
  color: #ff4a4c;
  text-shadow: 0 0 12px rgba(255, 60, 60, 0.75);
}

.axis-rig.void .ax-bar i {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(158, 42, 43, 0.9);
}

.axis-rig.void .axis-cell {
  border-color: #3a1416;
  background: #100607;
}

.axis-rig.void .dial-sweep {
  opacity: 1;
  background: conic-gradient(from 0deg, rgba(255, 60, 60, 0.55), rgba(255, 60, 60, 0) 46%);
  animation-duration: 0.55s;
}

.axis-rig.void .dial-needle {
  background: linear-gradient(to bottom, #ff4a4c, rgba(255, 74, 76, 0.1));
  box-shadow: 0 0 12px rgba(255, 60, 60, 0.9);
}

.axis-rig.void .dial-read { color: #ff4a4c; }

@keyframes rigVoidTear {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-3px, 2px) skewX(1.2deg); }
  22% { transform: translate(4px, -2px) skewX(-1.6deg); }
  36% { transform: translate(-2px, 1px); }
  52% { transform: translate(3px, 2px) skewX(1deg); }
  72% { transform: translate(-1px, -1px); }
  100% { transform: translate(0, 0); }
}

@keyframes rigNoise {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}
