/* Chemical Reaction Specific Styles */

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.range-slider {
  width: 100%;
  margin: 8px 0;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-value {
  font-family: monospace;
  font-weight: 600;
  color: #2c3e50;
  font-size: 12px;
  float: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
  font-family: monospace;
}

.stat-label {
  font-size: 10px;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.energy-diagram {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
}

.reaction-container {
  position: relative;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 3px solid #2196f3;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

#reactionCanvas {
  display: block;
  width: 100%;
  height: 400px;
}

.container-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.temperature-display, .pressure-display {
  position: absolute;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.temperature-display {
  top: 8px;
  left: 8px;
}

.pressure-display {
  top: 8px;
  right: 8px;
}

.reaction-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #667eea;
}

.control-group label {
  font-size: 12px;
  color: #495057;
  cursor: pointer;
  user-select: none;
}

.mechanism-display {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 16px;
  min-height: 120px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
}

.mechanism-step {
  margin-bottom: 12px;
  padding: 8px;
  background: white;
  border-left: 3px solid #667eea;
  border-radius: 4px;
}

.step-number {
  font-weight: 600;
  color: #667eea;
  margin-right: 8px;
}

.step-equation {
  font-family: monospace;
  color: #2c3e50;
  margin: 4px 0;
}

.step-description {
  font-size: 11px;
  color: #6c757d;
  font-style: italic;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* 分子样式 */
.molecule {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.molecule.h2 {
  background: #ff6b6b;
  width: 16px;
  height: 16px;
}

.molecule.o2 {
  background: #4ecdc4;
  width: 18px;
  height: 18px;
}

.molecule.h2o {
  background: #45b7d1;
  width: 20px;
  height: 20px;
}

.molecule.co2 {
  background: #96ceb4;
  width: 18px;
  height: 18px;
}

.molecule.ch4 {
  background: #ffeaa7;
  width: 16px;
  height: 16px;
}

/* 化学键 */
.bond {
  position: absolute;
  background: #2c3e50;
  height: 2px;
  transform-origin: left center;
}

.bond.forming {
  animation: bondForm 0.5s ease-in-out;
}

.bond.breaking {
  animation: bondBreak 0.5s ease-in-out;
}

@keyframes bondForm {
  from { width: 0; opacity: 0; }
  to { width: 100%; opacity: 1; }
}

@keyframes bondBreak {
  from { width: 100%; opacity: 1; }
  to { width: 0; opacity: 0; }
}

/* 碰撞效果 */
.collision-effect {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,0,0.8) 0%, rgba(255,165,0,0.4) 50%, transparent 100%);
  animation: collisionPulse 0.3s ease-out;
  pointer-events: none;
}

@keyframes collisionPulse {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .reaction-controls {
    grid-template-columns: 1fr;
  }
  
  .toolbar {
    justify-content: center;
  }
  
  #reactionCanvas {
    height: 300px;
  }
}

/* 动画效果 */
.stat-card.updated {
  animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
  0% { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); }
  50% { background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%); }
  100% { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); }
}