/* 酵素作用模擬 style.css */
body {
  font-family: 'Noto Sans TC', Arial, sans-serif;
  background: #f0f0f0;
  overflow-x: hidden;
  
}
#control-panel {
  height: 100%;
}


#parameters {        
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding-right: 8px;  /* 預留空間給 scrollbar */
  padding: 16px 18px 12px 18px;
  margin-bottom: 10px;
  text-align: left;
  margin-bottom: 10px;
  min-width: 220px;
  max-width: 260px;
  width: 220px;
  background: #fff;
  border: 1.5px solid #bbb;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0001;
  box-sizing: border-box;
  overflow-y: auto;  
  overflow-x: hidden;
}



/* general-mode fieldset 原本的 inline style 整合 */
#general-mode {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1.5px solid #009688;
  border-radius: 8px;
  background: #fff;
}
#general-mode legend {
  color: #009688;
  font-weight: bold;
}

/* experiment-mode fieldset 原本的 inline style 整合 */
#experiment-mode {
  margin-top: 18px;
  padding: 8px 10px;
  border: 1.5px solid #8009ff;
  border-radius: 8px;
  background: #fff;
}
#experiment-mode legend {
  color: #8009ff;
  font-weight: bold;
}


/* brownian-toggle-btn 原本的 style 整合 */
#brownian-toggle-btn {
  margin-top: 8px;
  background: #009688;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 14px;
  cursor: pointer;
}


/* reset-btn 原本的 style 整合 */
#reset-btn {
  margin-top: 10px;
}

/* exp-start-btn 原本的 style 整合 */
#exp-start-btn {
  margin-top: 6px;
  background: #8009ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 14px;
  cursor: pointer;
}

/* auto-exp-btn 原本的 style 整合 */
#auto-exp-btn {
  margin-top: 8px;
  background: #8009ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 14px;
  cursor: pointer;
}

/* auto-exp-stop-btn 原本的 style 整合 */
#auto-exp-stop-btn {
  margin-top: 8px;
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 14px;
  cursor: pointer;
}

/* experiment-mode 自動實驗區塊 style 整合 */
#experiment-mode .auto-exp-section {
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

#toolbox {
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding-right: 8px;  /* 預留空間給 scrollbar */
  width: 120px;
  flex-shrink: 0;
  margin-right: 16px;
  background: #f7fafd;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0001;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.toolbox-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  min-height: 48px;
}
.toolbox-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  justify-self: center;
}
.toolbox-btn-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-column: 2;
  grid-row: 1 / span 2;
}


#main-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}


#canvas {
  position: relative;
  height: 100%;
  min-height: 320px; /* 或你想要的最小高度 */
  box-sizing: border-box;
  min-width: 500px;
  width: 100%;
  max-width: 500px;
  margin: 0px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px #0002;
  overflow: hidden;
}

.draggable {
  position: absolute;
  cursor: grab;
  user-select: none;
  touch-action: none;
  width: 40px;
  height: 40px;
  z-index: 2;
  transition: filter 0.2s;
}
.draggable:active {
  cursor: grabbing;
}

.product {
  position: absolute;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
  transition: opacity 0.5s;
}

.activation-site {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px dashed #8009ff;
  border-radius: 30%;
  background: rgba(0,188,212,0.08);
  z-index: 0;
  pointer-events: none;
}

.toolbox-add10,
.toolbox-minus10 {
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  user-select: none;
  padding: 2px 0;
  text-align: left;
  width: 40px;
}

.toolbox-add10 {
  color: #8009ff;
}
.toolbox-add10:hover {
  text-decoration: underline;
  color: #ff9800;
}
.toolbox-minus10 {
  color: #f44336;
}
.toolbox-minus10:hover {
  text-decoration: underline;
  color: #ff9800;
}
#chart-panels {
  height: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 400px;
  max-width: 400px;
  width: 100%;  
  box-sizing: border-box;
}
#chart-panels canvas {
  height: 100% !important;
  min-height: 0;
  display: block;
  margin: 0 auto;
  background: #f9f9f9;
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#chart-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
#chart-tabs button {
  padding: 6px 18px;
  border: none;
  background: #f0f0f0;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-weight: bold;
}
#chart-tabs button.active,
#chart-tabs button:focus {
  background: #8009ff;
  color: #fff;
}
#concentration-chart {
  display: block;
  margin: 0 auto;
  background: #f9f9f9;
  border-radius: 8px;
  min-height: 400px;
  width: 100%;         /* 讓canvas自適應panel寬度 */
  
}

#exp-temp-chart {
  min-height: 400px;
}

@media (max-width: 600px) {
  #main-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  #canvas {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    border-radius: 0;
  }
  #chart-panels {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    border-radius: 0;
    padding: 8px 2vw;
  }

}