/* Collision Lab Styles - 最终版（右侧无滚动条，使用说明压缩，左右等高） */
.collision-lab {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  color: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.cl-head {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #374151;
}

.cl-head strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

.cl-sub {
  font-size: 1rem;
  color: #9ca3af;
}

/* Grid布局：左侧自适应，右侧固定400px，并使用 stretch 使两侧高度一致 */
.cl-wrap {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: stretch;   /* 让左右两侧高度拉伸一致 */
}

/* 左侧画布容器（flex列，确保内容撑开高度） */
.cl-canvas-wrapper {
  background: #111827;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #374151;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;           /* 占满网格高度 */
}

.cl-canvas-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cl-canvas-head h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fbbf24;
  margin: 0;
}

.cl-status {
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.cl-status.waiting { background: #374151; color: #d1d5db; }
.cl-status.inside { background: #065f46; color: #d1fae5; }
.cl-status.outside { background: #7f1d1d; color: #fecaca; }

/* 画布固定宽高比 */
.cl-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid #4b5563;
  border-radius: 8px;
  background: #0a0a0a;
  cursor: crosshair;
}

.cl-canvas.dragging { cursor: move; }

.cl-canvas-foot {
  display: flex;
  gap: 1rem;
}

/* 左侧使用说明 - 压缩高度 */
.cl-help-section {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;  /* 减少内边距 */
  margin-top: 0.25rem;
}

.cl-help-section .cl-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;   /* 减小下边距 */
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #374151;
  color: #22c55e;
}

.cl-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cl-help-list li {
  font-size: 0.8rem;        /* 减小字体 */
  color: #9ca3af;
  margin-bottom: 0.2rem;     /* 减小行距 */
}

.cl-help-list li strong { color: #d1d5db; }

/* 右侧面板（无整体滚动条） */
.cl-panel {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;             /* 占满网格高度 */
}

/* 右侧卡片样式 */
.cl-section {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 0.5rem 1rem 0.75rem 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.cl-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #374151;
  color: #22c55e;
}

/* 步骤区域 */
.cl-steps { display: flex; flex-direction: column; gap: 0.5rem; }
.cl-step {
  border-left: 3px solid transparent;
  padding-left: 0.75rem;
}
.cl-step.highlight {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0 4px 4px 0;
}
.cl-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.1rem;
}
.cl-step-label { font-size: 0.9rem; color: #9ca3af; }
.cl-step-badge {
  font-size: 0.7rem;
  background: #374151;
  color: #d1d5db;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}
.cl-step-result {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fbbf24;
}
.cl-step-result.cl-final { font-size: 1.1rem; color: #9ca3af; }

/* 实时数据网格 */
.cl-data-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.cl-data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cl-data-label { color: #9ca3af; }
.cl-data-value {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #e5e7eb;
  background: #1f2937;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.cl-data-value.cl-highlight { color: #60a5fa; background: #1e3a5f; }

/* 点列表 - 固定高度，内部滚动 */
.cl-points-section {
  flex: 0 0 auto;           /* 不伸缩 */
  height: 280px;            /* 固定高度，可根据需要调整 */
  display: flex;
  flex-direction: column;
  overflow: hidden;         /* 隐藏溢出，由内部列表滚动 */
}

.cl-points-list {
  flex: 1;
  overflow-y: auto;         /* 内部滚动 */
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-right: 4px;       /* 为滚动条留空间 */
}

.cl-point-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  background: #1f2937;
  border-radius: 6px;
  flex-wrap: nowrap;
  min-height: 2rem;
}
.cl-point-item.hovered { background: #374151; border-left: 3px solid #fbbf24; }
.cl-point-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}
.cl-point-num {
  width: 1.5rem;
  height: 1.5rem;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cl-point-coords {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-point-delete {
  flex-shrink: 0;
  background: #991b1b;
  color: #fecaca;
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.cl-point-delete:hover { background: #b91c1c; }

/* 按钮 */
.cl-btn {
  flex: 1;
  background: #1e40af;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.cl-btn:hover { background: #1d4ed8; }
.cl-btn.cl-clear { background: #991b1b; }
.cl-btn.cl-clear:hover { background: #b91c1c; }

/* 滚动条样式（仅点列表内） */
.cl-points-list::-webkit-scrollbar {
  width: 6px;
}
.cl-points-list::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 8px;
}
.cl-points-list::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 8px;
}
.cl-points-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* 小屏幕适配 */
@media (max-width: 800px) {
  .cl-wrap {
    grid-template-columns: 1fr;
  }
  .cl-panel {
    width: 100%;
    height: auto;
  }
  .cl-canvas-wrapper {
    height: auto;
  }
}