/* LinkHealth · 物联运维控制台 HUD 区块 */
.sp-jarvis {
  --jv-bg: #f6f9fb;
  --jv-cyan: #0ba99b;
  --jv-teal: #07817a;
  --jv-blue: #2478d2;
  --jv-amber: #b97a1a;
  --jv-red: #d63c4e;
  --jv-text: #10222f;
  --jv-dim: #59707f;
  --jv-glass: rgba(255, 255, 255, 0.7);
  --jv-glass-strong: rgba(255, 255, 255, 0.88);
  --jv-line: rgba(16, 42, 58, 0.12);
  --jv-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  padding: clamp(96px, 10vw, 156px) 0;
  color: #10222f;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(11, 169, 155, 0.08), transparent 70%),
    linear-gradient(180deg, #f6f9fb, #eef4f8 45%, #f6f9fb);
  font-family: var(--font-sans, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif);
}

.sp-jarvis *,
.sp-jarvis *::before,
.sp-jarvis *::after { box-sizing: border-box; }

.sp-jarvis::before {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(36, 120, 210, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 120, 210, 0.12) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  content: "";
}

.sp-jarvis .sp-shell { position: relative; z-index: 1; }
.sp-jarvis .sp-section-head { grid-template-columns: 1fr; }
.sp-jarvis .sp-section-head h2 { max-width: none; }
.sp-jarvis .sp-section-intro { max-width: 960px; }

/* ---------- monitor frame (16:9) ---------- */
.sp-jarvis__monitor {
  position: relative;
  container-type: inline-size;
  margin-top: clamp(40px, 4.6vw, 64px);
  padding: clamp(8px, 1cqw, 14px);
  border: 1px solid rgba(16, 42, 58, 0.12);
  border-radius: clamp(16px, 2cqw, 26px);
  background: #ffffff;
  box-shadow:
    0 40px 120px rgba(15, 40, 60, 0.14),
    0 0 90px rgba(11, 169, 155, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sp-jarvis__monitor::after {
  /* stand hint */
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(-34px, -3cqw, -22px);
  width: 26%;
  height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(11, 169, 155, 0.35), transparent);
  filter: blur(1px);
}

.jv-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(16, 42, 58, 0.1);
  border-radius: clamp(10px, 1.2cqw, 16px);
  background:
    radial-gradient(90% 70% at 50% 38%, rgba(11, 169, 155, 0.07), transparent 72%),
    linear-gradient(180deg, #ffffff, #f4f9fa 55%, #eef4f8);
  color: var(--jv-text);
  font-family: var(--jv-mono);
  transform: perspective(1500px) rotateX(var(--jv-rx, 0deg)) rotateY(var(--jv-ry, 0deg));
  transition: transform 0.3s ease-out;
  will-change: transform;
}

/* 鼠标视差分层（JS 驱动 transform，此处仅定义过渡） */
.jv-topbar,
.jv-col,
.jv-core,
.jv-bottom,
.jv-glare {
  transition: transform 0.3s ease-out;
}

.jv-scanlines {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.jv-glare {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(160, 220, 255, 0.06), transparent 32%);
}

.jv-scan {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.jv-scan i {
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  height: 12%;
  background: linear-gradient(180deg, transparent, rgba(11, 169, 155, 0.05), transparent);
  animation: jv-scan-sweep 9s linear infinite;
}

@keyframes jv-scan-sweep {
  to { top: 112%; }
}

/* ---------- top bar ---------- */
.jv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  padding: 1.1cqw 1.6cqw;
  border-bottom: 1px solid var(--jv-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(238, 244, 248, 0.45));
  font-size: clamp(8px, 0.85cqw, 12px);
  letter-spacing: 0.14em;
}

.jv-brand {
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  font-weight: 700;
  color: #10222f;
}

.jv-brand i {
  width: 0.85cqw;
  height: 0.85cqw;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: var(--jv-cyan);
  box-shadow: 0 0 10px rgba(11, 169, 155, 0.3), 0 0 22px rgba(11, 169, 155, 0.15);
  animation: jv-blink 2.6s ease-in-out infinite;
}

@keyframes jv-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.jv-brand span { color: var(--jv-dim); font-weight: 400; }

.jv-topbar__mid {
  display: flex;
  align-items: center;
  gap: 0.9cqw;
  color: var(--jv-dim);
}

.jv-topbar__mid .is-on {
  width: 0.6cqw;
  height: 0.6cqw;
  min-width: 6px;
  min-height: 6px;
  border-radius: 50%;
  background: var(--jv-teal);
  box-shadow: 0 0 8px rgba(11, 169, 155, 0.25);
}

.jv-topbar__mid b { color: var(--jv-cyan); font-weight: 500; }

.jv-topbar__right {
  display: flex;
  align-items: center;
  gap: 1cqw;
  color: var(--jv-dim);
}

.jv-topbar__right em {
  font-style: normal;
  color: var(--jv-cyan);
  cursor: pointer;
}

/* ---------- main grid ---------- */
.jv-main {
  flex: 1;
  display: grid;
  grid-template-columns: 24% 1fr 28%;
  gap: 1.2cqw;
  min-height: 0;
  padding: 1.2cqw 1.4cqw;
}

.jv-col {
  display: flex;
  flex-direction: column;
  gap: 1.2cqw;
  min-height: 0;
}

.jv-panel {
  position: relative;
  padding: 1cqw 1.1cqw;
  border: 1px solid var(--jv-line);
  border-radius: 0.9cqw;
  background: var(--jv-glass);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 28px rgba(15, 40, 60, 0.08);
}

.jv-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 8%;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--jv-cyan), transparent);
  opacity: 0.8;
}

.jv-panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.9cqw;
  font-size: clamp(7px, 0.72cqw, 11px);
  letter-spacing: 0.22em;
  color: var(--jv-dim);
}

.jv-live { color: var(--jv-teal); letter-spacing: 0.08em; animation: jv-blink 2s ease-in-out infinite; }

/* ---------- left: reactor + stats + waveform ---------- */
.jv-panel--reactor { display: flex; flex-direction: column; }

.jv-reactor {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0.2cqw auto 0;
  width: 78%;
  aspect-ratio: 1;
}

.jv-reactor svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.jv-reactor circle { fill: none; stroke-width: 5; }

.jv-reactor__track { stroke: rgba(16, 42, 58, 0.12); }

.jv-reactor__fill {
  stroke: var(--jv-cyan);
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 4.25;
  filter: drop-shadow(0 0 6px rgba(11, 169, 155, 0.25));
  transition: stroke-dashoffset 0.6s ease;
}

.jv-reactor__ticks { stroke: rgba(89, 112, 127, 0.5); stroke-width: 1; }

.jv-reactor__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.jv-reactor__value b {
  font-size: clamp(14px, 1.9cqw, 30px);
  font-weight: 600;
  color: #10222f;
}

.jv-reactor__value b i {
  font-style: normal;
  font-size: 0.45em;
  letter-spacing: 0.1em;
}

.jv-reactor__value span {
  font-size: clamp(7px, 0.68cqw, 10px);
  letter-spacing: 0.3em;
  color: var(--jv-dim);
}

.jv-stats { display: flex; flex-direction: column; gap: 0.85cqw; }

.jv-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25cqw 0.8cqw;
  font-size: clamp(7px, 0.72cqw, 11px);
  letter-spacing: 0.12em;
}

.jv-stat span { color: var(--jv-dim); }

.jv-stat b { color: var(--jv-text); font-weight: 500; }

.jv-stat b.is-safe { color: var(--jv-teal); }

.jv-stat i {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  border-radius: 2px;
  background: rgba(16, 42, 58, 0.08);
  overflow: hidden;
}

.jv-stat i em {
  display: block;
  height: 100%;
  width: var(--v, 50%);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--jv-blue), var(--jv-cyan));
  box-shadow: 0 0 8px rgba(11, 169, 155, 0.2);
  transition: width 0.5s ease;
}

.jv-stat--ok i em,
.jv-stat--threat i em { background: linear-gradient(90deg, var(--jv-teal), var(--jv-cyan)); }

/* 多屏数据轮播的淡入淡出 */
.jv-panel .jv-panel__title,
.jv-panel .jv-fade-body {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.jv-panel.is-switching .jv-panel__title,
.jv-panel.is-switching .jv-fade-body {
  opacity: 0;
  transform: translateY(6px);
}

.jv-panel--wave canvas { transition: filter 0.8s ease; }

.jv-panel--wave { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.jv-panel--wave canvas { flex: 1; width: 100%; min-height: 0; }

/* ---------- center: orb ---------- */
.jv-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4cqw;
  min-height: 0;
}

.jv-orb {
  position: relative;
  width: 74%;
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.jv-orb.is-dragging { cursor: grabbing; }

.jv-orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.jv-orb__core {
  position: absolute;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #d9f5f0, var(--jv-cyan) 34%, rgba(7, 129, 122, 0.55) 62%, rgba(11, 169, 155, 0.12) 78%, transparent 80%);
  box-shadow:
    0 0 30px rgba(11, 169, 155, 0.35),
    0 0 90px rgba(11, 169, 155, 0.18),
    0 0 160px rgba(36, 120, 210, 0.12);
  animation: jv-core-pulse 3.2s ease-in-out infinite;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

/* "LH" 字母粒子停留期间，核心光球变暗让位 */
.jv-orb.is-morphing .jv-orb__core {
  opacity: 0.28;
  filter: brightness(0.7);
}

.jv-orb.is-morphing .jv-orb__halo { animation: none; opacity: 0.25; }

/* 文字浮现期间 CSS 轨道环淡出，避免穿过字形 */
.jv-orb .jv-ring { transition: opacity 0.6s ease; }

.jv-orb.is-morphing .jv-ring { opacity: 0.18; }

@keyframes jv-core-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.07); filter: brightness(1.25); }
}

.jv-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(11, 169, 155, 0.35);
  pointer-events: none;
}

.jv-ring--one {
  inset: 6%;
  border-style: dashed;
  border-color: rgba(11, 169, 155, 0.4);
  animation: jv-spin 26s linear infinite;
  box-shadow: 0 0 24px rgba(11, 169, 155, 0.1) inset;
}

.jv-ring--two {
  inset: 15%;
  border-color: transparent;
  border-top-color: rgba(36, 120, 210, 0.7);
  border-right-color: rgba(36, 120, 210, 0.3);
  border-width: 2px;
  animation: jv-spin 9s linear infinite reverse;
  filter: drop-shadow(0 0 8px rgba(36, 120, 210, 0.2));
}

.jv-ring--three {
  inset: -3%;
  border-color: rgba(11, 169, 155, 0.25);
  border-bottom-color: rgba(7, 129, 122, 0.7);
  animation: jv-spin 15s linear infinite;
}

.jv-ring--tilt {
  inset: 10%;
  border-color: rgba(11, 169, 155, 0.28);
  transform: rotateX(72deg);
  animation: jv-spin-tilt 12s linear infinite;
}

@keyframes jv-spin {
  to { transform: rotate(360deg); }
}

@keyframes jv-spin-tilt {
  from { transform: rotateX(72deg) rotate(0deg); }
  to { transform: rotateX(72deg) rotate(360deg); }
}

.jv-orb__halo {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 169, 155, 0.14), transparent 62%);
  animation: jv-halo 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes jv-halo {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

.jv-core__label {
  font-size: clamp(8px, 0.8cqw, 12px);
  letter-spacing: 0.42em;
  color: var(--jv-cyan);
}

.jv-core__hint {
  margin: -0.6cqw 0 0;
  font-size: clamp(7px, 0.62cqw, 9px);
  letter-spacing: 0.3em;
  color: rgba(89, 112, 127, 0.75);
  animation: jv-blink 3.6s ease-in-out infinite;
}

.jv-core__readout {
  display: flex;
  gap: 2.4cqw;
  font-size: clamp(7px, 0.72cqw, 11px);
  letter-spacing: 0.14em;
}

.jv-core__readout div { display: grid; gap: 0.3cqw; text-align: center; }

.jv-core__readout span { color: var(--jv-dim); }

.jv-core__readout b { color: var(--jv-text); font-weight: 500; }

.jv-corner {
  position: absolute;
  width: 1.6cqw;
  height: 1.6cqw;
  border: 1px solid rgba(11, 169, 155, 0.45);
  pointer-events: none;
}

.jv-corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.jv-corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.jv-corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.jv-corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ---------- right: neural chat ---------- */
.jv-panel--chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.jv-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7cqw;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  min-height: 0;
  mask-image: linear-gradient(180deg, transparent, #000 8%);
}

.jv-chat li {
  max-width: 92%;
  padding: 0.55cqw 0.8cqw;
  border: 1px solid var(--jv-line);
  border-radius: 0.6cqw;
  font-size: clamp(8px, 0.8cqw, 12px);
  line-height: 1.55;
  letter-spacing: 0.02em;
  animation: jv-msg-in 0.4s ease both;
}

@keyframes jv-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.jv-chat li small {
  display: block;
  margin-bottom: 0.2cqw;
  font-size: 0.82em;
  letter-spacing: 0.18em;
  opacity: 0.75;
}

.jv-chat li.is-jarvis {
  align-self: flex-start;
  color: var(--jv-text);
  background: rgba(11, 169, 155, 0.06);
  border-color: rgba(11, 169, 155, 0.22);
  box-shadow: 0 0 18px rgba(11, 169, 155, 0.06);
}

.jv-chat li.is-jarvis small { color: var(--jv-cyan); }

.jv-chat li.is-user {
  align-self: flex-end;
  color: #07817a;
  background: rgba(11, 169, 155, 0.08);
  border-color: rgba(11, 169, 155, 0.26);
}

.jv-chat li.is-user small { color: var(--jv-teal); text-align: right; }

.jv-chat li.is-sys {
  align-self: center;
  max-width: 100%;
  padding: 0.3cqw 0.7cqw;
  border-color: transparent;
  background: transparent;
  color: var(--jv-dim);
  font-size: clamp(7px, 0.7cqw, 10px);
  letter-spacing: 0.16em;
  text-align: center;
}

.jv-chat__typing {
  display: flex;
  gap: 0.35cqw;
  padding: 0.6cqw 0.2cqw 0;
}

.jv-chat__typing span {
  width: 0.5cqw;
  height: 0.5cqw;
  min-width: 4px;
  min-height: 4px;
  border-radius: 50%;
  background: var(--jv-cyan);
  box-shadow: 0 0 8px rgba(11, 169, 155, 0.2);
  animation: jv-typing 1s ease-in-out infinite;
}

.jv-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.jv-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes jv-typing {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- bottom: command + dock ---------- */
.jv-bottom {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 1cqw 1.4cqw 1.2cqw;
  border-top: 1px solid var(--jv-line);
  background: linear-gradient(180deg, rgba(238, 244, 248, 0.4), rgba(255, 255, 255, 0.7));
}

.jv-command {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  margin: 0;
  padding: 0.55cqw 1cqw;
  border: 1px solid rgba(16, 42, 58, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 18px rgba(11, 169, 155, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.jv-command:focus-within {
  border-color: rgba(11, 169, 155, 0.5);
  box-shadow: inset 0 0 18px rgba(11, 169, 155, 0.08), 0 0 22px rgba(11, 169, 155, 0.14);
}

.jv-command__prompt {
  font-size: clamp(8px, 0.82cqw, 12px);
  letter-spacing: 0.14em;
  color: var(--jv-cyan);
  white-space: nowrap;
}

.jv-command input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--jv-text);
  font-family: var(--jv-mono);
  font-size: clamp(8px, 0.82cqw, 12px);
  letter-spacing: 0.06em;
  caret-color: var(--jv-cyan);
}

.jv-command input::placeholder { color: rgba(89, 112, 127, 0.55); }

.jv-dock {
  display: flex;
  align-items: center;
  gap: 0.6cqw;
  padding: 0.45cqw 0.8cqw;
  border: 1px solid var(--jv-line);
  border-radius: 999px;
  background: var(--jv-glass);
  backdrop-filter: blur(10px);
}

.jv-dock button {
  display: grid;
  place-items: center;
  width: 2.3cqw;
  height: 2.3cqw;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(16, 42, 58, 0.05);
  color: var(--jv-dim);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.jv-dock button svg { width: 58%; height: 58%; }

.jv-dock button:hover,
.jv-dock button:focus-visible {
  color: var(--jv-cyan);
  border-color: rgba(11, 169, 155, 0.45);
  box-shadow: 0 0 16px rgba(11, 169, 155, 0.16);
  transform: translateY(-18%) scale(1.12);
  outline: none;
}

.jv-dock button.is-active { color: var(--jv-cyan); border-color: rgba(11, 169, 155, 0.45); }

/* reveal 由 solutions-platform.js 统一驱动（.sp-js .sp-reveal → .sp-is-visible） */

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sp-jarvis__monitor { container-type: normal; }
  .jv-screen { aspect-ratio: auto; }
  .jv-topbar { padding: 10px 14px; font-size: 10px; }
  .jv-brand i { width: 8px; height: 8px; }
  .jv-main { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .jv-core { order: -1; padding: 18px 0 6px; }
  .jv-orb { width: min(56vw, 260px); }
  .jv-core__label { font-size: 10px; }
  .jv-core__readout { font-size: 10px; gap: 22px; }
  .jv-panel { padding: 12px 14px; border-radius: 10px; }
  .jv-panel__title { font-size: 10px; margin-bottom: 10px; }
  .jv-reactor { width: 150px; }
  .jv-reactor__value b { font-size: 22px; }
  .jv-reactor__value span { font-size: 9px; }
  .jv-stats { gap: 10px; }
  .jv-stat { font-size: 10px; }
  .jv-panel--wave canvas { min-height: 90px; }
  .jv-chat { max-height: 260px; }
  .jv-chat li { font-size: 11px; padding: 7px 10px; }
  .jv-chat__typing span { width: 5px; height: 5px; }
  .jv-bottom { flex-direction: column; padding: 12px 14px 14px; gap: 10px; }
  .jv-command { width: 100%; padding: 8px 14px; }
  .jv-command__prompt, .jv-command input { font-size: 11px; }
  .jv-dock button { width: 34px; height: 34px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .jv-brand i,
  .jv-live,
  .jv-core__hint,
  .jv-orb__core,
  .jv-orb__halo,
  .jv-ring,
  .jv-ring--tilt,
  .jv-scan i,
  .jv-chat li,
  .jv-chat__typing span { animation: none !important; }
}
