/* ============================================================
   hud.guard.css — 五道保险丝
   ============================================================ */

/* ---------- 一：动效不得承载信息 ----------
   提供一个「关动效」开关，交付前必须用它验一遍：
   页面信息必须完整，不能有「只靠动画才知道」的状态。 */
[data-hud-motion="off"] *,
[data-hud-motion="off"] *::before,
[data-hud-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}
/* 关动效后，状态点必须仍有静态区分 */
[data-hud-motion="off"] .hud-status--danger { font-weight: 700; }
[data-hud-motion="off"] .hud-status--warn   { font-weight: 700; }
/* 关动效后，载入环要有静态文字兜底 */
[data-hud-motion="off"] .hud-spinner { border-top-color: var(--hud-ink-3); }

/* ---------- 二：投影档 ---------- */
[data-hud-env="projector"] {
  --hud-ink-2: color-mix(in srgb, var(--hud-ink-2) 100%, white 18%);
  --hud-ink-3: color-mix(in srgb, var(--hud-ink-3) 100%, white 14%);
  --hud-line-1: rgba(255, 255, 255, .14);
}
[data-hud-env="projector"] .hud-atmo__noise { display: none; }   /* 投影下噪点会被放大成雪花 */
[data-hud-env="projector"] .hud-atmo__scan  { opacity: .35; }    /* 扫描带压暗，避免盖住数字 */

/* ---------- 三：打印 ---------- */
@media print {
  .hud-atmo, .hud-spinner, .hud-tickband, .hud-dashline { display: none !important; }

  html, body, .hud-root, [data-hud] {
    background: #fff !important;
    color: #000 !important;
  }
  .hud-panel, .hud-kpi, .hud-chip, .hud-seg, .hud-btn {
    background: #fff !important;
    border: 1px solid #999 !important;
    clip-path: none !important;
    color: #000 !important;
  }
  .hud-panel__title, .hud-kpi__label, .hud-label, .hud-micro, .hud-readout .k,
  .hud-table th { color: #333 !important; }
  .hud-readout, .hud-table td, .hud-table th { border-color: #ccc !important; }
  .hud-panel__title::before { background: #333 !important; }
  .hud-bar { background: #eee !important; border: 1px solid #999 !important; }
  .hud-bar__fill { background: #555 !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* ---------- 四：降级可用 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 字体加载失败时布局不能塌：所有字体族都已给到 sans-serif / monospace 兜底 */

/* 无 JS 时氛围层缺席，内容完整——因为 .hud-atmo 由 JS 注入 */

/* ---------- 五：极端文本 ---------- */
.hud-h1, .hud-h2 { text-wrap: balance; }
.hud-break-all { overflow-wrap: anywhere; }      /* 不用 break-all，会断在中文中间 */
.hud-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-empty { color: var(--hud-ink-4); font-family: var(--hud-mono); font-size: var(--hud-fs-label); }

/* 超大数值：缩字号不换行 */
.hud-kpi__value { min-width: 5ch; }
.hud-kpi__value.is-long { font-size: var(--hud-fs-h2); }
.hud-kpi__value.is-xlong { font-size: var(--hud-fs-body); }

/* 横向溢出兜底 */
.hud-root, [data-hud] { overflow-x: hidden; }
