/* ============================================================
 * 排版整改 切片 G1（画布基础规范 106-125）
 * 仅复用既有颜色；覆盖 style.css，不修改原文件
 * ============================================================ */

/* ---------- 106 网格辅助线开关 ---------- */
/* 修复 v9_viewmem 恢复的 identity transform 使 canvasArea 成为 fixed 包含块，
   导致 #graphView.fullscreen 只在 canvasArea 内塌缩（stage 高度 2px） */
#canvasArea { transform: none !important; }
.graph-stage.g1-no-grid {
  background-image: none !important;
}
.graph-stage.g1-no-grid {
  background-color: #0F141E;
}
#graphView.light .graph-stage.g1-no-grid {
  background-color: #f7f9fc;
}

/* ---------- 106 空格临时平移 ---------- */
body.g1-spacepan, body.g1-spacepan .graph-stage {
  cursor: grabbing !important;
}

/* ---------- 右上角切换组 ---------- */
.g1-hudx {
  position: absolute; top: 10px; right: 16px; z-index: 1005;
  display: flex; gap: 6px;
}
.g1-hudx .g1hx {
  font-size: 12px; padding: 3px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: #93A1B8;
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer; transition: all .15s;
}
.g1-hudx .g1hx.on {
  background: rgba(56,189,248,0.18); color: #38BDF8;
  border-color: rgba(56,189,248,0.35);
}
.g1-hudx .g1hx:hover { background: rgba(255,255,255,0.12); color: #C6D0E0; }

/* ---------- 107 节点 hover 抬升 150ms ---------- */
.graph-node {
  transition: box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}
.graph-node:hover {
  transform: translateY(-3px);
  transition: box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}
.graph-node.gn-locked {
  opacity: 0.55; filter: grayscale(0.4); cursor: not-allowed;
}
.graph-node.gn-locked .gn-anchor,
.graph-node.gn-locked .gn-anchor-in {
  pointer-events: none;
}
.graph-node.g1-disabled { opacity: 0.4; }

/* ---------- 107 左入锚点 ---------- */
.gn-anchor-in {
  position: absolute; left: -6px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: #1B2230; border: 2px solid #606266;
  transform: translateY(-50%);
  opacity: 0.35; transition: opacity .15s, border-color .15s;
  z-index: 3;
}
.graph-node:hover .gn-anchor-in,
.graph-node:hover .gn-anchor {
  opacity: 1; border-color: #38BDF8;
}

/* ---------- 108 连线 hover 加粗 / 选中 ---------- */
.graph-edges path.gedge {
  transition: stroke-width .15s ease;
  cursor: pointer;
}
.graph-edges path.gedge:hover {
  stroke-width: 3.5;
}
.graph-edges path.gedge.g1-esel {
  stroke-width: 3.5;
  filter: drop-shadow(0 0 4px rgba(56,189,248,0.8));
}

/* ---------- 108 分支链路文字标签 ---------- */
.g1-bltext {
  fill: #93A1B8; font-size: 12px; pointer-events: none;
}

/* ---------- 109 框选虚线 ---------- */
.g1-rubber {
  position: absolute; border: 1px dashed #38BDF8;
  background: rgba(56,189,248,0.10);
  z-index: 1006; pointer-events: none;
}
.g1-rubber.hidden { display: none; }

/* ---------- 109 批量浮动栏 ---------- */
.g1-batch {
  position: absolute; top: 50px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: #161C28; border: 1px solid #2C3648;
  border-radius: 12px; padding: 6px 12px;
  z-index: 1007; box-shadow: 0 6px 18px rgba(29,33,41,0.12);
}
.g1-batch.hidden { display: none; }
.g1-batch .g1b-n { font-size: 12px; color: #93A1B8; margin-right: 4px; }
.g1-batch .btn { height: 26px; padding: 0 10px; font-size: 12px; }
.g1-batch .btn.danger { color: #E39A9A; border-color: rgba(220,120,120,0.3); }

/* ---------- 110 对齐辅助线 ---------- */
.g1-guides { position: absolute; inset: 0; pointer-events: none; z-index: 1004; }
.g1-guides line {
  stroke: #38BDF8; stroke-width: 1; stroke-dasharray: 4,3;
  display: none;
}

/* ---------- 111 分组容器折叠/菜单 ---------- */
.gv-scene-box .g1-fold {
  display: inline-block; cursor: pointer; margin-right: 4px;
  transition: transform .15s;
}
.gv-scene-box.g1-collapsed { height: 44px !important; }
.gv-scene-box.g1-collapsed .gv-scene-title { border-bottom: none; }
.graph-node.g1-hidden { display: none !important; }

.g1-boxmenu {
  position: absolute; background: #161C28;
  border: 1px solid #2C3648; border-radius: 8px;
  padding: 4px; z-index: 1009; min-width: 140px;
  box-shadow: 0 6px 18px rgba(29,33,41,0.12);
}
.g1-boxmenu .g1bm-item {
  padding: 7px 12px; font-size: 12px; color: #C6D0E0;
  cursor: pointer; border-radius: 4px;
}
.g1-boxmenu .g1bm-item:hover { background: rgba(56,189,248,0.15); color: #38BDF8; }

/* ---------- 111 聚焦分组 ---------- */
.graph-world.g1-focus .graph-node { opacity: 0.25; }
.graph-world.g1-focus .gv-scene-box { opacity: 0.3; }
.graph-world.g1-focus .graph-node.g1-focused,
.graph-world.g1-focus .graph-node { }
/* 聚焦时同场节点高亮 */
.graph-world.g1-focus .graph-node { }

/* ---------- 112 添加节点下拉 ---------- */
.g1-addwrap { position: relative; display: inline-block; margin-left: 6px; }
.g1-addmenu {
  position: absolute; top: 30px; right: 0;
  background: #161C28; border: 1px solid #2C3648;
  border-radius: 8px; padding: 4px; z-index: 1009; min-width: 160px;
  box-shadow: 0 6px 18px rgba(29,33,41,0.12);
}
.g1-addmenu.hidden { display: none; }
.g1-addmenu .g1am-item {
  padding: 7px 12px; font-size: 12px; color: #C6D0E0; cursor: pointer; border-radius: 4px;
}
.g1-addmenu .g1am-item:hover { background: rgba(56,189,248,0.15); color: #38BDF8; }

/* ---------- 113 转场/暂停特殊节点 ---------- */
.graph-node.g1-kind-trans { border-color: #8aa2bc; }
.graph-node.g1-kind-trans .gn-idx { background: rgba(56,189,248,0.16); color: #8aa2bc; }
.graph-node.g1-kind-pause { border-color: #ff7d00; }
.graph-node.g1-kind-pause .gn-idx { background: rgba(224,164,88,0.2); color: #ff7d00; }
.graph-node.g1-kind-ref { border-color: #00b42a; }
.graph-node.g1-kind-ref .gn-idx { background: rgba(95,194,154,0.2); color: #00b42a; }

/* ---------- 117 筛选 dim/hit ---------- */
.graph-node.g1-dim { opacity: 0.3; }
.graph-node.g1-hit { outline: 2px solid #38BDF8; outline-offset: 2px; }
.graph-node.flash { animation: g1flash 1.6s ease; }
@keyframes g1flash {
  0%,100% { outline: 2px solid transparent; }
  50% { outline: 2px solid #38BDF8; }
}

/* ---------- 118 缺失参数预警 ---------- */
.gn-chip.g1-warn {
  background: rgba(224,164,88,0.15); color: #ff7d00;
  border-color: rgba(224,164,88,0.3);
}

/* ---------- 120 自动布局动画 ---------- */
.graph-world.g1-anim .graph-node {
  transition: left .35s ease, top .35s ease;
}

/* ---------- 121 鸟瞰小地图 ---------- */
.g1-map {
  position: absolute; bottom: 50px; right: 16px;
  width: 160px; height: 110px;
  background: rgba(15,20,30,0.9); border: 1px solid #2C3648;
  border-radius: 8px; z-index: 1005; overflow: hidden;
}
.g1-map .g1-dot {
  position: absolute; border-radius: 2px; opacity: 0.7;
}
.g1-map .g1-mapvp {
  position: absolute; border: 1.5px solid #fff;
  background: rgba(255,255,255,0.12);
  z-index: 2; cursor: move;
}
.graph-stage.g1-nomap .g1-map { display: none; }

/* ---------- 122 批注气泡 ---------- */
.graph-node .g1-bubble {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 8px; background: #ff7d00; color: #161C28;
  font-size: 12px; line-height: 18px; text-align: center;
  cursor: pointer; z-index: 4;
}

/* ---------- 123 只读模式 ---------- */
#graphView.g1-readonly .g1-addwrap,
#graphView.g1-readonly #g1ExpBtn,
#graphView.g1-readonly #g1LayoutBtn {
  display: none;
}
.g1-rotip {
  position: absolute; top: 44px; left: 50%; transform: translateX(-50%);
  background: rgba(224,164,88,0.15); color: #ff7d00;
  border: 1px solid rgba(224,164,88,0.3);
  font-size: 12px; padding: 4px 14px; border-radius: 8px;
  z-index: 1006;
}

/* ---------- 124 性能模式 ---------- */
#graphView.g1-perf .graph-node {
  transition: none !important;
  animation: none !important;
}
#graphView.g1-perf .graph-node:hover {
  transform: none;
}
#graphView.g1-perf .graph-node .gn-thumb img {
  display: none;
}
#graphView.g1-perf .graph-node .gn-thumb-ph {
  display: flex !important;
}
#graphView.g1-perf .graph-edges path {
  transition: none !important;
}

/* ---------- 连线模式 ---------- */
#graphView.g1-linkmode .graph-stage { cursor: crosshair; }
#graphView.g1-linkmode .graph-node.g1-linkfrom {
  outline: 2px solid #38BDF8;
}
