/* =========================================================
 *  canvas.css — 无限画布、节点卡片、连线、锚点、聚光灯、状态徽标
 *  1:1 从 style.css 拆分，视觉零改动
 * ========================================================= */

/* =========================================================
 *  无限画布
 * ========================================================= */

.canvas {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: default;
  /* 建立独立层叠上下文：内部连线/卡片层级不受外部全屏遮罩干扰 */
  isolation: isolate;
  background-color: #0b1017;
  background-image: radial-gradient(circle at 1.2px 1.2px, var(--dot) 1.2px, transparent 0);
  background-repeat: repeat;
  min-height: 0;
}

.canvas.is-panning {
  cursor: grabbing;
}

.canvas.is-pan-ready {
  cursor: grab;
}

.links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 🛡️ 整张连线画布永远不参与命中测试，
   * 只有具体的 <path class="edge-line"> 才单独开启 stroke 命中。 */
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

/* 连线图层 / 预览图层 / 连线分组：同样全部禁用命中，避免透明 SVG 盖住按钮 */
#links,
#links-layer,
#preview-layer,
.edge-group,
.preview-line {
  pointer-events: none;
}

.world {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  z-index: 3;
  will-change: transform;
}

/* =========================================================
 *  目录信息卡片
 * ========================================================= */

.canvas-info {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 8;
  max-width: min(380px, calc(100% - 32px));
  padding: 8px 12px;
  background: rgba(20, 29, 42, 0.86);
  border: 1px solid rgba(61, 139, 253, 0.28);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
  font-size: 12.5px;
  color: var(--muted);
  animation: fade-in 180ms ease-out;
}

.canvas-info[hidden] {
  display: none;
}

.canvas-info-header {
  appearance: none;
  border: none;
  background: transparent;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: #c8d6e8;
  cursor: pointer;
  outline: none;
  transition: color 140ms ease;
}

.canvas-info-header:hover {
  color: #7dd3fc;
}

.canvas-info-icon {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.canvas-info-header-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-info-chevron {
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 180ms ease, color 140ms ease;
}

.canvas-info-header:hover .canvas-info-chevron {
  color: #7dd3fc;
}

.canvas-info-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  animation: fade-in 180ms ease-out;
}

.canvas-info-detail[hidden] {
  display: none;
}

.canvas-info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.canvas-info-line + .canvas-info-line {
  margin-top: 6px;
}

.canvas-info-key {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6a7b93;
  text-transform: uppercase;
}

.canvas-info-author {
  font-size: 13px;
  font-weight: 650;
  color: #c8d6e8;
  text-decoration: none;
  transition: color 130ms ease;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-info-author:hover {
  color: #7dd3fc;
}

.canvas-info-dot {
  color: #45576e;
}

.canvas-info-luogu {
  font-size: 11.5px;
  color: #9ecbff;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(61, 139, 253, 0.12);
  border: 1px solid rgba(61, 139, 253, 0.28);
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}

.canvas-info-luogu:hover {
  background: rgba(61, 139, 253, 0.24);
  color: #fff;
  border-color: #5aa0ff;
}

.canvas-info-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}

.canvas-info-toggle:hover {
  color: var(--text);
  border-color: #3d5470;
  background: rgba(255, 255, 255, 0.08);
}

.canvas-info-toggle-icon {
  font-size: 9px;
  line-height: 1;
  display: inline-block;
  transition: transform 140ms ease;
}

.canvas-info-desc {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  line-height: 1.7;
  color: #b8cce8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #24334a transparent;
}

.canvas-info-desc[hidden] {
  display: none;
}

.canvas-info-desc::-webkit-scrollbar {
  width: 6px;
}

.canvas-info-desc::-webkit-scrollbar-thumb {
  background: #24334a;
  border-radius: 3px;
}

.canvas-info-desc.has-markdown {
  white-space: normal;
}

.canvas-info-desc.has-markdown > :first-child {
  margin-top: 0;
}

.canvas-info-desc.has-markdown > :last-child {
  margin-bottom: 0;
}

.canvas-info-desc.has-markdown p {
  margin: 6px 0;
}

.canvas-info-desc.has-markdown h1,
.canvas-info-desc.has-markdown h2,
.canvas-info-desc.has-markdown h3,
.canvas-info-desc.has-markdown h4,
.canvas-info-desc.has-markdown h5,
.canvas-info-desc.has-markdown h6 {
  color: #e8eef7;
  font-weight: 700;
  line-height: 1.4;
  margin: 10px 0 6px;
}

.canvas-info-desc.has-markdown h1 { font-size: 15px; }
.canvas-info-desc.has-markdown h2 { font-size: 14px; }
.canvas-info-desc.has-markdown h3 { font-size: 13px; }
.canvas-info-desc.has-markdown h4,
.canvas-info-desc.has-markdown h5,
.canvas-info-desc.has-markdown h6 {
  font-size: 12.5px;
  color: #b8cce8;
}

.canvas-info-desc.has-markdown ul,
.canvas-info-desc.has-markdown ol {
  margin: 6px 0;
  padding-left: 20px;
}

.canvas-info-desc.has-markdown li {
  margin: 2px 0;
}

.canvas-info-desc.has-markdown li::marker {
  color: #5aa0ff;
}

.canvas-info-desc.has-markdown code:not(pre code) {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: #9ecbff;
  white-space: pre-wrap;
  word-break: break-word;
}

.canvas-info-desc.has-markdown pre {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #22304a;
  background: #0a101a;
  overflow-x: auto;
}

.canvas-info-desc.has-markdown pre code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #e8eef7;
  background: transparent;
}

.canvas-info-desc.has-markdown blockquote {
  margin: 8px 0;
  padding: 4px 10px;
  border-left: 3px solid #5aa0ff;
  background: rgba(90, 160, 255, 0.07);
  border-radius: 0 4px 4px 0;
}

.canvas-info-desc.has-markdown blockquote > :first-child { margin-top: 0; }
.canvas-info-desc.has-markdown blockquote > :last-child { margin-bottom: 0; }

.canvas-info-desc.has-markdown a {
  color: #5aa0ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(90, 160, 255, 0.5);
}

.canvas-info-desc.has-markdown a:hover {
  color: #7dd3fc;
  border-bottom-color: #7dd3fc;
}

.canvas-info-desc.has-markdown strong {
  color: #ffffff;
  font-weight: 700;
}

.canvas-info-desc.has-markdown em {
  color: #dbe6f5;
  font-style: italic;
}

.canvas-info-desc.has-markdown hr {
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  margin: 10px 0;
}

.canvas-info-desc.has-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 11.5px;
}

.canvas-info-desc.has-markdown th,
.canvas-info-desc.has-markdown td {
  padding: 5px 8px;
  border: 1px solid #22304a;
  text-align: left;
}

.canvas-info-desc.has-markdown th {
  background: rgba(61, 139, 253, 0.12);
  color: #e8eef7;
  font-weight: 650;
}

.canvas-info-desc.has-markdown img {
  max-width: 100%;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.canvas-info-desc.has-markdown .katex {
  color: #e8eef7;
  font-size: 1em;
}

.canvas-info-desc.has-markdown .katex-display {
  margin: 8px 0;
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.canvas-info-desc.has-markdown .preview-empty {
  color: #5c6c82;
  font-style: italic;
}

/* =========================================================
 *  连线
 * ========================================================= */

/* 双层 SVG 连线组：底层 Halo + 顶层主题线 */
.edge-group {
  transition: opacity 220ms ease;
}

.edge-halo {
  fill: none;
  stroke: #0b1017;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.edge-line {
  fill: none;
  stroke: #4a7fd4;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke 140ms ease, stroke-width 140ms ease, opacity 220ms ease,
    filter 220ms ease;
}

.edge-line:hover {
  stroke: #7dd3fc;
}

.preview-line {
  stroke: #7dd3fc;
  stroke-width: 2.2;
  stroke-dasharray: 7 5;
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
}

.link-del {
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease;
}

.link-del circle {
  fill: #1b2740;
  stroke: #4a7fd4;
  stroke-width: 1.5;
  transition: fill 140ms ease, stroke 140ms ease;
}

.link-del path {
  stroke: #93a4bb;
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: none;
  transition: stroke 140ms ease;
}

.links:hover .link-del,
.link-del:hover {
  opacity: 1;
}

.link-del:hover circle {
  fill: var(--danger);
  stroke: #ff7a8a;
}

.link-del:hover path {
  stroke: #fff;
}

/* 连线聚光灯 / 悬停聚焦 */
.edge-group.is-dimmed {
  opacity: 0.12;
}

.edge-group.is-dimmed .edge-line {
  pointer-events: none;
}

.edge-group.is-highlighted .edge-line {
  stroke: #7dd3fc;
  stroke-width: 2.8;
  filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.75));
}

/* 悬停血统高光：霓虹点亮 */
.edge-group.highlight {
  opacity: 1 !important;
}

.edge-group.highlight .edge-line {
  stroke: #38bdf8 !important;
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 6px #38bdf8);
}

.edge-group.is-dimmed .link-del {
  pointer-events: none;
  opacity: 0 !important;
}

/* 聚焦时，未命中的连线组半透明虚化 */
.canvas.is-focused .edge-group:not(.highlight) {
  opacity: 0.15 !important;
}

.canvas.is-focused .edge-group:not(.highlight) .link-del {
  pointer-events: none;
  opacity: 0 !important;
}

/* =========================================================
 *  节点卡片
 * ========================================================= */

.node {
  position: absolute;
  width: 200px;
  height: 128px;
  padding: 12px 14px 12px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--node-accent-border, var(--node-border));
  background-color: var(--node);
  background-image:
    linear-gradient(
      90deg,
      var(--node-accent, #5aa0ff) 0,
      var(--node-accent, #5aa0ff) 6px,
      transparent 6px
    ),
    linear-gradient(
      165deg,
      var(--node-accent-soft, rgba(90, 160, 255, 0.18)),
      rgba(0, 0, 0, 0) 62%
    );
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, 100% 100%;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  user-select: none;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.78);
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 200ms cubic-bezier(0.2, 0.9, 0.3, 1.2),
    opacity 260ms ease-out, box-shadow 260ms ease, border-color 260ms ease,
    filter 260ms ease;
}

/* 程序化整理动画 / 手动拖拽期间关闭 left/top 过渡：
 * 位置由逐帧插值直接驱动，避免过渡叠加造成拖影与连线脱节。 */
.canvas.is-layout-animating .node,
.node.is-dragging {
  transition: transform 200ms cubic-bezier(0.2, 0.9, 0.3, 1.2),
    opacity 260ms ease-out, box-shadow 260ms ease, border-color 260ms ease,
    filter 260ms ease;
}

.node.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 🖤 黑题（NOI/NOI+/CTS）：微增亮度的纯净黑曜石（Gunmetal Obsidian）
 * 无白边：仅用 5px 深炭色左侧条 + 柔和暗影勾勒轮廓，保持“黑题”本色 */
.node[data-diff="noi"] {
  --node-accent: transparent !important; /* 关闭渐变左条，改用真实 border-left */
  border-color: transparent !important;
  border-left: 5px solid #33333a !important;
  box-shadow:
    0 0 0 1px rgba(63, 63, 70, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

/* 悬停：左侧条与轮廓微弱提亮一档，低调沉稳 */
.node[data-diff="noi"]:hover:not(.is-dragging):not(.is-target):not(.is-highlighted):not(.is-selected) {
  border-left-color: #5a5a64 !important;
  box-shadow:
    0 0 15px rgba(74, 74, 82, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

.node.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.04);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.node.is-target {
  box-shadow:
    0 0 0 4px rgba(125, 211, 252, 0.28),
    0 12px 28px rgba(0, 0, 0, 0.5);
  border-color: #7dd3fc !important;
}

.node.is-selected {
  box-shadow:
    0 0 0 3px rgba(61, 139, 253, 0.5),
    0 12px 28px rgba(0, 0, 0, 0.5);
}

/* 🔦 聚光灯 */
.node.is-visible.is-dimmed {
  opacity: 0.15;
  filter: grayscale(0.85) brightness(0.7);
  pointer-events: none;
}

.node.is-visible.is-highlighted {
  z-index: 50;
  transform: translate(-50%, -50%) scale(1.06);
  border-color: #7dd3fc !important;
  animation: node-pulse 1.7s ease-in-out infinite;
}

@keyframes node-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(125, 211, 252, 0.75),
      0 0 26px 7px rgba(90, 160, 255, 0.45),
      0 14px 30px rgba(0, 0, 0, 0.55);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(125, 211, 252, 0.95),
      0 0 42px 14px rgba(90, 160, 255, 0.78),
      0 18px 40px rgba(0, 0, 0, 0.62);
  }
}

.node.flash-highlight {
  animation: node-flash 620ms ease-in-out 2;
  z-index: 12;
}

@keyframes node-flash {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(125, 211, 252, 0),
      0 10px 24px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(125, 211, 252, 0.5),
      0 18px 40px rgba(0, 0, 0, 0.6);
  }
}

.node-title {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  pointer-events: none;
  min-height: 0;
  padding-right: 2px;
}

.node-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}

.node-tags[hidden] {
  display: none;
}

.node-tags-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-tags:empty {
  display: none;
}

/* =========================================================
 *  ✨ 节点底部双按钮栏（题面 / 笔记）
 * ========================================================= */

.node-actions {
  margin-top: auto;
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.node-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: 8px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease,
    box-shadow 140ms ease, opacity 140ms ease;
}

.node-btn[hidden] {
  display: none;
}

.node-btn span {
  pointer-events: none;
  line-height: 1;
}

.node-btn > span:first-child {
  font-size: 12px;
  flex-shrink: 0;
}

.node-btn > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 左：题面按钮 */
.node-btn-link {
  background: rgba(90, 160, 255, 0.16);
  border-color: rgba(90, 160, 255, 0.34);
  color: #9ecbff;
}

.node-btn-link:hover {
  background: linear-gradient(180deg, #4d95ff, #2f7ae8);
  border-color: #5aa0ff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 139, 253, 0.42);
}

/* 右：笔记按钮 */
.node-btn-note {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.32);
  color: #b8e6ff;
}

.node-btn-note:hover {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  border-color: #7dd3fc;
  color: #0b1017;
  box-shadow: 0 4px 14px rgba(125, 211, 252, 0.42);
}

/* =========================================================
 *  连接锚点
 * ========================================================= */

.anchor {
  position: absolute;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #0b1017;
  background: var(--node-accent-border, var(--handle));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24);
  opacity: 0;
  transform: scale(0.5);
  cursor: crosshair;
  z-index: 4;
  /* 🛡️ 不可见的锚点绝不能接收点击，否则会在卡片边缘吞掉按钮点击 */
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.node:hover .anchor,
.node:focus-within .anchor {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.node .anchor:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 5px rgba(125, 211, 252, 0.22);
}

.anchor-top {
  top: -8px;
  left: 50%;
  margin-left: -7px;
}

.anchor-bottom {
  bottom: -8px;
  left: 50%;
  margin-left: -7px;
}

.anchor-left {
  left: -8px;
  top: 50%;
  margin-top: -7px;
}

.anchor-right {
  right: -8px;
  top: 50%;
  margin-top: -7px;
}

@media (hover: none) {
  .anchor {
    opacity: 0.85;
    transform: scale(0.9);
    pointer-events: auto;
  }
}

/* =========================================================
 *  缩放指示器
 * ========================================================= */

.zoom-badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  padding: 6px 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: rgba(20, 29, 42, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  cursor: pointer;
  user-select: none;
  transition: color 140ms ease, border-color 140ms ease;
}

.zoom-badge:hover {
  color: var(--text);
  border-color: #3d5470;
}

/* =========================================================
 *  🏷️ 刷题状态徽标（节点右上角）
 * ========================================================= */

.node-status-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 200ms ease;
}

.node-status-badge[hidden] {
  display: none;
}

/* 徽标前缀小圆点 */
.node-status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
  flex-shrink: 0;
}

/* 🟢 独立 AC */
.node-status-badge[data-status="ac"] {
  color: #10b981;
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.32);
}

/* 🟡 看题解才过 */
.node-status-badge[data-status="hint"] {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.32);
}

/* 🔴 未攻克 */
.node-status-badge[data-status="fail"] {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.32);
}

/* 聚光灯暗化时，徽标同步暗化 */
.node.is-dimmed .node-status-badge {
  opacity: 0.3;
}

/* 标题给徽标留出呼吸空间，避免长标题与徽标重叠 */
.node-title {
  padding-right: 2px;
}

/* =========================================================
 *  悬停血统高光聚焦（节点）
 * ========================================================= */

.node.highlight {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4) !important;
  z-index: 40;
}

/* 聚焦时：非血统节点半透明虚化 */
.canvas.is-focused .node:not(.highlight) {
  opacity: 0.15 !important;
  filter: grayscale(0.7) brightness(0.8);
}

/* 聚焦时：血统节点保持高亮（覆盖搜索聚光灯的 is-dimmed） */
.canvas.is-focused .node.highlight {
  opacity: 1 !important;
  filter: none !important;
}

.canvas.is-focused .node:not(.highlight) .node-status-badge {
  opacity: 0.3;
}

/* =========================================================
 *  移动端适配
 * ========================================================= */

@media (max-width: 720px) {
  .canvas-info {
    max-width: calc(100% - 24px);
    left: 12px;
    top: 12px;
    padding: 8px 10px;
  }
}