/* 极简白色风格与高帧率硬件加速渲染 */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
  background-color: #f8fafc;
  color: #0f172a;
  font-family: var(--font-sans);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 浅色点状网格背景 */
.bg-dot-pattern {
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

/* 
 * 核心修复：严禁在卡片上设置 transition: all 或 transition: left/top/transform！
 * 仅允许 transition 阴影与边框，确保拖动画布或拖动节点时 100% 紧随鼠标与连线，绝不产生 150ms 延迟脱节！
 */
.node-card {
  position: absolute;
  box-sizing: border-box;
  will-change: left, top;
  transition: box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.card-shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card-shadow:hover {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

/* 当前激活游玩卡片高亮 */
.active-card {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25), 0 8px 20px -4px rgba(99, 102, 241, 0.2) !important;
}

/* 选中卡片微高亮 */
.selected-card {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2) !important;
}

/* 
 * 画布与变换容器：硬件加速且无 CSS 过渡延迟
 */
#canvasContainer {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#canvasWorld {
  will-change: transform;
  transform-origin: 0 0;
  transition: none !important;
}

#svgLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

#nodesContainer {
  position: relative;
  z-index: 10;
}

.cursor-grab {
  cursor: grab;
}

.cursor-grabbing {
  cursor: grabbing;
}

/* 极简滚动条 */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 移动端遮罩与弹窗适配 */
@media (max-width: 640px) {
  .mobile-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 85vh;
  }
}
