/* Flow Field Lab - dark theme aligned with Collision Lab
   深色主题，保证在任何模式下清晰可见
*/
.flowfield-lab {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #374151;          /* 深色边框 */
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  background: #1a1a1a;                /* 主背景深色 */
  color: #e5e7eb;                      /* 主文本 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.flowfield-lab .ff-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #374151;
}

.flowfield-lab .ff-head strong {
  font-size: 1.5rem;
  font-weight: 700;
  color: #60a5fa;                      /* 蓝色标题 */
}

.flowfield-lab .ff-head .ff-sub {
  font-size: 0.9rem;
  color: #9ca3af;                       /* 辅助文本 */
}

.flowfield-lab .ff-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.5rem;
  align-items: start;
}

.flowfield-lab .ff-canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  max-width: none !important;
  min-width: 0 !important;
  justify-self: stretch;
  border: 2px solid #4b5563;           /* 画布边框 */
  border-radius: 8px;
  background: #0a0a0a;                  /* 画布背景深色 */
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.flowfield-lab .ff-panel {
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 1rem;
  background: #111827;                  /* 卡片背景 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.flowfield-lab .ff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.flowfield-lab .ff-btn {
  padding: 0.6rem 1rem;
  border-radius: 30px;
  border: none;
  background: #1e40af;                  /* 按钮蓝色 */
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.flowfield-lab .ff-btn:hover {
  background: #1d4ed8;
}

.flowfield-lab .ff-btn:active {
  transform: translateY(1px);
}

/* 清除按钮（如果有）可以单独设置红色，但此处未定义，留待后续 */

.flowfield-lab .ff-options {
  align-items: center;
  color: #d1d5db;
}

.flowfield-lab .ff-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: #9ca3af;
}

.flowfield-lab input[type="range"] {
  width: 120px;
  background: #1f2937;
  height: 4px;
  border-radius: 2px;
  accent-color: #60a5fa;                /* 滑块主题色 */
}

.flowfield-lab .ff-hint {
  font-size: 0.92rem;
  color: #9ca3af;
  margin-top: 12px;
  border-top: 1px dashed #374151;
  padding-top: 10px;
}

.flowfield-lab .ff-hint ul {
  margin: 6px 0 0 18px;
  color: #d1d5db;
}

.flowfield-lab .ff-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.92rem;
  color: #9ca3af;
}

.flowfield-lab .ff-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flowfield-lab .ff-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.2); /* 浅色边框在深色背景上可见 */
}

.flowfield-lab .ff-dot-start { background: #2b7cff; }
.flowfield-lab .ff-dot-goal { background: #ff3b30; }
.flowfield-lab .ff-dot-unit { background: #34c759; }
.flowfield-lab .ff-dot-wall { background: #333; border-color: #666; }

/* 输入框、选择框等 */
.flowfield-lab select,
.flowfield-lab input[type="number"] {
  background: #1f2937;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

@media (max-width: 860px) {
  .flowfield-lab .ff-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .flowfield-lab input[type="range"] {
    width: 100%;
  }
}