/* MK console particle backdrop (works with mk-particle-bg.js).
 *
 * The static part of the scene is painted by the browser as background layers
 * on the canvas element itself (deep-space gradient + honeycomb lattice +
 * vignette), so the canvas only rasterises the animated glow work. The script
 * re-positions the lattice layer through canvas.style.backgroundPosition.
 *
 * To disable the effect, delete the <link> and <script> tags that reference
 * mk-particle-bg from static/index.html (see restore_mk_particle_bg.ps1).
 */
.dashboard-root > .mk-particle-bg,
.login-page > .mk-particle-bg {
  position: fixed !important;
  z-index: 0 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;
  pointer-events: none !important;
  opacity: 1 !important;
  background-color: #04070f !important;
  background-image:
    radial-gradient(132% 102% at 50% 46%, rgba(8, 18, 36, 0) 0%, rgba(6, 12, 24, 0.30) 60%, rgba(3, 7, 15, 0.80) 100%),
    url("/assets/img/mk-hex-grid.png"),
    radial-gradient(100% 80% at 50% 42%, #0c1d33 0%, #0a1730 42%, #04070f 100%) !important;
  background-repeat: no-repeat, repeat, no-repeat !important;
  background-size: auto, 62px 36px, auto !important;
  background-position: 0 0, 0 0, 0 0;
}

/* Light theme: same structure, brighter palette, weaker lattice. */
html[data-theme="light"] .dashboard-root > .mk-particle-bg,
html[data-theme="light"] .login-page > .mk-particle-bg,
html.light .dashboard-root > .mk-particle-bg,
html.light .login-page > .mk-particle-bg {
  background-color: #e8f2f8 !important;
  background-image:
    radial-gradient(132% 102% at 50% 46%, rgba(255, 255, 255, 0) 0%, rgba(226, 240, 248, 0.35) 62%, rgba(206, 226, 240, 0.75) 100%),
    url("/assets/img/mk-hex-grid.png"),
    radial-gradient(100% 80% at 50% 42%, #f4fbff 0%, #e3f1f8 45%, #cfe3ee 100%) !important;
}

/* Keep every console control above the backdrop layer.
 * [2026-09-12 FIX] 必须排除应用自带的全屏锁屏层 .lockscreen。
 * 它是 #app 的直接子元素，原样式 position:fixed; inset:0; z-index:9999。
 * 被这条通配规则改成 position:relative; z-index:1 之后，绝对定位的子元素
 * 撑不起父级高度，锁屏层高度直接塌成 0 —— 锁屏不可见，整页只剩粒子背景，
 * 也就是「进不去了 / 登录窗口不见了」。
 * 同时排除 naive-ui 的全屏浮层容器，避免同类事故再次发生。 */
.dashboard-root > *:not(.mk-particle-bg):not(.lockscreen):not(.n-modal-container):not(.n-dialog-container):not(.n-notification-container),
.login-page > *:not(.mk-particle-bg):not(.lockscreen):not(.n-modal-container):not(.n-dialog-container):not(.n-notification-container) {
  position: relative;
  z-index: 1;
}

/* 全屏锁屏层永远盖在最上层，不能被粒子背景或任何层压住 */
.dashboard-root > .lockscreen,
.login-page > .lockscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
}
/* ==================================================================
 * [2026-09-12] 让后台首页真正露出粒子背景
 * 应用自带的 .dashboard-root / .rc-main 各铺了一层不透明渐变
 * (linear-gradient(135deg, #060b14, #0b1220, #0f172a))，会整块盖住
 * canvas.mk-particle-bg，导致首页只看到原来的深蓝底、看不到粒子。
 * 这里把它们改成透明，粒子背景即可透出；卡片/文字仍是各自原有颜色。
 * 想恢复原来的纯色底：删掉本段即可（见 restore_mk_particle_bg.ps1）。
 * ================================================================== */
.dashboard-root,
.dashboard-root > .rc-shell,
.dashboard-root .rc-main {
  background-color: transparent !important;
  background-image: none !important;
}