/* Virtual Chemistry Lab Specific Styles */

.lab-layout {
  display: grid;
  grid-template-columns: 250px 1fr 280px;
  gap: 16px;
  margin-bottom: 16px;
  min-height: 600px;
}

@media (max-width: 1200px) {
  .lab-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* 材料库样式 */
.materials-panel {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  max-height: 600px;
  overflow-y: auto;
}

.material-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.category-btn {
  padding: 4px 8px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-btn:hover {
  background: #f8f9fa;
}

.category-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.material-item {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: grab;
  transition: all 0.3s ease;
  user-select: none;
}

.material-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.material-item:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.material-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.material-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: bold;
}

.material-name {
  font-size: 10px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 2px;
}

.material-formula {
  font-size: 9px;
  color: #6c757d;
  font-family: monospace;
}

/* 实验台样式 */
.lab-bench {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 3px solid #2196f3;
  position: relative;
}

.bench-area {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 16px;
  min-height: 500px;
  padding: 16px;
}

/* 试管架样式 */
.test-tube-rack {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #8d6e63 0%, #5d4037 100%);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.rack-title {
  color: white;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.tube-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  justify-items: center;
}

.tube-slot {
  position: relative;
}

.test-tube {
  width: 40px;
  height: 120px;
  background: linear-gradient(to bottom, transparent 0%, transparent 85%, #e0e0e0 85%, #bdbdbd 100%);
  border: 2px solid #757575;
  border-radius: 0 0 20px 20px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.test-tube:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.test-tube.selected {
  border-color: #ff9800;
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.5);
}

.test-tube.drop-target {
  border-color: #4caf50;
  background: linear-gradient(to bottom, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.1) 85%, #e0e0e0 85%, #bdbdbd 100%);
}

.tube-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  transition: all 0.5s ease;
  border-radius: 0 0 18px 18px;
}

.tube-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: white;
  font-weight: 500;
  white-space: nowrap;
}

/* 加热设备样式 */
.heating-equipment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bunsen-burner {
  position: relative;
  width: 60px;
  height: 80px;
}

.burner-base {
  width: 60px;
  height: 40px;
  background: linear-gradient(135deg, #424242 0%, #212121 100%);
  border-radius: 8px;
  position: absolute;
  bottom: 0;
}

.flame {
  width: 30px;
  height: 40px;
  background: linear-gradient(to top, #ff5722 0%, #ff9800 50%, #ffeb3b 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flame.active {
  opacity: 1;
  animation: flicker 0.5s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1); }
  100% { transform: translateX(-50%) scale(1.1) rotate(2deg); }
}

.burner-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #2c3e50;
  font-weight: 500;
  white-space: nowrap;
}

/* 操作工具样式 */
.lab-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-btn, .equipment-btn {
  padding: 8px;
  border: 2px solid #dee2e6;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tool-btn:hover, .equipment-btn:hover {
  border-color: #667eea;
  background: #f8f9fa;
}

.tool-btn.active, .equipment-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
}

.tool-btn .icon, .equipment-btn .icon {
  width: 16px;
  height: 16px;
}

/* 实验信息样式 */
.experiment-info {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border: 2px solid #ff9800;
  max-height: 600px;
  overflow-y: auto;
}

.tube-info {
  margin-bottom: 16px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.info-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.info-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

.info-value {
  font-size: 12px;
  color: #2c3e50;
  font-weight: 600;
  font-family: monospace;
}

/* 反应历史样式 */
.reaction-history {
  margin-bottom: 16px;
}

.history-title {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.history-list {
  max-height: 150px;
  overflow-y: auto;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
}

.history-item {
  padding: 6px;
  border-left: 3px solid #667eea;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 11px;
}

.history-time {
  color: #6c757d;
  font-size: 10px;
}

.history-reaction {
  color: #2c3e50;
  font-weight: 500;
  margin-top: 2px;
}

/* 安全提示样式 */
.safety-alerts {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
}

.alert-title {
  font-size: 13px;
  font-weight: 600;
  color: #dc3545;
  margin-bottom: 8px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  font-size: 11px;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  margin-bottom: 4px;
  animation: alertSlideIn 0.3s ease-out;
}

.alert-extreme-danger {
  background: #f8d7da !important;
  border-color: #f5c6cb !important;
  color: #721c24 !important;
  font-weight: 600;
  animation: alertSlideIn 0.3s ease-out, dangerPulse 1s ease-in-out infinite;
}

.alert-explosion {
  background: #ffe6e6 !important;
  border-color: #ffcccc !important;
  color: #8b0000 !important;
  font-weight: 700;
  animation: alertSlideIn 0.3s ease-out, explosionAlert 0.5s ease-in-out infinite;
}

.alert-danger {
  background: #f8d7da !important;
  border-color: #f5c6cb !important;
  color: #721c24 !important;
  font-weight: 600;
}

@keyframes alertSlideIn {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes dangerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes explosionAlert {
  0%, 100% { 
    transform: scale(1);
    box-shadow: none;
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
  }
}

.alert-item .icon.warning {
  width: 14px;
  height: 14px;
  color: #f39c12;
}

/* 实验报告样式 */
.experiment-report {
  background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%);
  border: 2px solid #8bc34a;
}

.report-content {
  margin-bottom: 16px;
}

.report-section {
  margin-bottom: 16px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  border-bottom: 2px solid #8bc34a;
  padding-bottom: 4px;
}

.section-content {
  font-size: 12px;
  color: #495057;
  line-height: 1.5;
}

#experimentSteps {
  margin: 0;
  padding-left: 16px;
}

#experimentSteps li {
  margin-bottom: 4px;
}

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 0;
  border-radius: 8px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
}

.modal-body {
  padding: 16px;
}

.material-details {
  margin-bottom: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.detail-label {
  color: #6c757d;
  font-weight: 500;
}

.detail-value {
  color: #2c3e50;
  font-weight: 600;
}

.amount-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.amount-selector label {
  font-size: 13px;
  color: #2c3e50;
  font-weight: 500;
}

.range-slider {
  flex: 1;
  -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);
}

#amountValue {
  font-family: monospace;
  font-weight: 600;
  color: #2c3e50;
  font-size: 12px;
  min-width: 40px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #dee2e6;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-style: italic;
  font-size: 12px;
}

.empty-state svg {
  width: 32px;
  height: 32px;
  opacity: 0.3;
  margin-bottom: 8px;
}

/* 反应效果动画 */
.reaction-effect {
  position: absolute;
  pointer-events: none;
}

.bubble-effect {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: bubble 2.5s ease-out infinite;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

@keyframes bubble {
  0% {
    transform: translateY(0) scale(0.3);
    opacity: 1;
  }
  30% {
    transform: translateY(-15px) scale(1);
    opacity: 0.9;
  }
  70% {
    transform: translateY(-35px) scale(1.2);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-60px) scale(0.8);
    opacity: 0;
  }
}

.heat-wave {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.8) 0%, rgba(255, 152, 0, 0.4) 50%, transparent 70%);
  border-radius: 50%;
  animation: heatWave 1.5s ease-in-out infinite;
}

@keyframes heatWave {
  0% { 
    transform: scale(0.5) translateY(0); 
    opacity: 0.8; 
  }
  50% { 
    transform: scale(1.5) translateY(-10px); 
    opacity: 0.5; 
  }
  100% { 
    transform: scale(2) translateY(-20px); 
    opacity: 0; 
  }
}

.gas-bubble {
  width: 8px;
  height: 8px;
  background: rgba(200, 200, 200, 0.7);
  border-radius: 50%;
  animation: gasRise 2s ease-out forwards;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes gasRise {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 1;
  }
  50% {
    transform: translateY(-40px) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-80px) scale(1.5);
    opacity: 0;
  }
}

.precipitation-particle {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  position: absolute;
  animation: precipitate 3s ease-out forwards;
}

@keyframes precipitate {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(60px);
    opacity: 0.8;
  }
}

.shake-animation {
  animation: shake 0.6s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* 液体动画效果 */
.liquid-animation {
  position: relative;
  overflow: hidden;
}

.liquid-animation::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: liquidWave 2s ease-in-out infinite;
}

@keyframes liquidWave {
  0%, 100% {
    transform: translateX(-10px) scaleX(1);
  }
  50% {
    transform: translateX(10px) scaleX(1.1);
  }
}

.liquid-shine {
  position: absolute;
  top: 10%;
  left: 20%;
  width: 30%;
  height: 60%;
  background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  border-radius: 50%;
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-5px);
  }
}

/* 容器样式 */
.bubble-container, .heat-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 倾倒效果 */
@keyframes pour {
  0% {
    height: 0px;
    opacity: 1;
  }
  50% {
    height: 30px;
    opacity: 0.8;
  }
  100% {
    height: 60px;
    opacity: 0;
  }
}

/* 试管内容物过渡效果 */
.tube-content {
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.5s ease,
              box-shadow 0.3s ease;
}

/* 搅拌动画 */
@keyframes stirLiquid {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(2deg) scale(1.02); }
  50% { transform: rotate(0deg) scale(1.05); }
  75% { transform: rotate(-2deg) scale(1.02); }
}

@keyframes stirRod {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(15deg); }
  50% { transform: translateX(-50%) rotate(0deg); }
  75% { transform: translateX(-50%) rotate(-15deg); }
}

@keyframes swirl {
  0% {
    transform: rotate(0deg) translateX(0px);
    opacity: 1;
  }
  100% {
    transform: rotate(360deg) translateX(15px);
    opacity: 0;
  }
}

.stirring {
  animation: tubeVibrate 2s ease-in-out;
}

@keyframes tubeVibrate {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-1px); }
  75% { transform: translateY(1px); }
}

/* 试管选择动画 */
@keyframes selectPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 爆炸和剧烈反应动画 */
.exploding {
  animation: explode 1.5s ease-out forwards;
}

@keyframes explode {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(5deg); }
  100% { transform: scale(1.5) rotate(10deg); opacity: 0.3; }
}

.explosion-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #ff4500 0%, #ff8c00 30%, #ffd700 60%, transparent 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: explosionBlast 1s ease-out forwards;
}

@keyframes explosionBlast {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.glass-fragment {
  position: absolute;
  width: 4px;
  height: 8px;
  background: linear-gradient(45deg, #e0e0e0, #bdbdbd);
  animation: fragmentFly 2s ease-out forwards;
}

@keyframes fragmentFly {
  0% { 
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% { 
    transform: translateY(-60px) translateX(var(--random-x, 20px)) rotate(720deg);
    opacity: 0;
  }
}

.liquid-splash {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: splash 1.5s ease-out forwards;
}

@keyframes splash {
  0% { 
    transform: translateY(0) translateX(0) scale(1);
    opacity: 1;
  }
  100% { 
    transform: translateY(-40px) translateX(var(--random-x, 15px)) scale(0.3);
    opacity: 0;
  }
}

.broken-tube {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.broken-tube::after {
  content: '💥';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  animation: brokenIndicator 2s ease-in-out infinite;
}

@keyframes brokenIndicator {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 剧烈震动动画 */
.violent-shake {
  animation: violentShake 3s ease-in-out;
}

@keyframes violentShake {
  0%, 100% { transform: translateX(0) translateY(0); }
  5% { transform: translateX(-3px) translateY(-2px); }
  10% { transform: translateX(3px) translateY(2px); }
  15% { transform: translateX(-2px) translateY(-3px); }
  20% { transform: translateX(2px) translateY(3px); }
  25% { transform: translateX(-3px) translateY(-1px); }
  30% { transform: translateX(3px) translateY(1px); }
  35% { transform: translateX(-1px) translateY(-3px); }
  40% { transform: translateX(1px) translateY(3px); }
  45% { transform: translateX(-2px) translateY(-2px); }
  50% { transform: translateX(2px) translateY(2px); }
  55% { transform: translateX(-3px) translateY(-1px); }
  60% { transform: translateX(3px) translateY(1px); }
  65% { transform: translateX(-1px) translateY(-2px); }
  70% { transform: translateX(1px) translateY(2px); }
  75% { transform: translateX(-2px) translateY(-3px); }
  80% { transform: translateX(2px) translateY(3px); }
  85% { transform: translateX(-1px) translateY(-1px); }
  90% { transform: translateX(1px) translateY(1px); }
  95% { transform: translateX(-1px) translateY(-1px); }
}

.intense-shake {
  animation: intenseShake 2s ease-in-out;
}

@keyframes intenseShake {
  0%, 100% { transform: translateX(0) translateY(0); }
  10% { transform: translateX(-2px) translateY(-1px); }
  20% { transform: translateX(2px) translateY(1px); }
  30% { transform: translateX(-1px) translateY(-2px); }
  40% { transform: translateX(1px) translateY(2px); }
  50% { transform: translateX(-2px) translateY(-1px); }
  60% { transform: translateX(2px) translateY(1px); }
  70% { transform: translateX(-1px) translateY(-1px); }
  80% { transform: translateX(1px) translateY(1px); }
  90% { transform: translateX(-1px) translateY(0); }
}

/* 剧烈气泡 */
.violent-bubble {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: violentBubble 1.5s ease-out infinite;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

@keyframes violentBubble {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 1;
  }
  20% {
    transform: translateY(-10px) scale(1.2);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-30px) scale(1.5);
    opacity: 0.7;
  }
  100% {
    transform: translateY(-70px) scale(0.8);
    opacity: 0;
  }
}

.moderate-bubble {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: moderateBubble 2s ease-out infinite;
}

@keyframes moderateBubble {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translateY(-50px) scale(1);
    opacity: 0;
  }
}

/* 沸腾效果 */
.boiling {
  animation: boil 0.3s ease-in-out infinite;
}

@keyframes boil {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(-1px); }
}

/* 嘶嘶声粒子 */
.fizz-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: fizz 0.8s ease-out forwards;
}

@keyframes fizz {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-15px) scale(0.3);
    opacity: 0;
  }
}

/* 蒸汽云 */
.steam-cloud {
  position: absolute;
  width: 12px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: steamRise 3s ease-out forwards;
}

@keyframes steamRise {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-30px) scale(1.2);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-60px) scale(2);
    opacity: 0;
  }
}

/* 沉淀层 */
.precipitate-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  border-radius: 0 0 18px 18px;
  opacity: 0.9;
}

@keyframes precipitateSettle {
  0% {
    height: 0%;
    opacity: 0;
  }
  100% {
    height: 25%;
    opacity: 0.9;
  }
}

/* 危险闪烁 */
.danger-flashing {
  animation: dangerFlash 0.5s ease-in-out infinite;
}

@keyframes dangerFlash {
  0%, 100% { 
    border-color: #1565c0;
    box-shadow: none;
  }
  50% { 
    border-color: #ff0000;
    box-shadow: 0 0 20px #ff0000;
  }
}

.color-change {
  animation: colorTransition 1s ease-in-out;
}

@keyframes colorTransition {
  0% { opacity: 0.5; }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .lab-layout {
    grid-template-columns: 1fr;
  }
  
  .materials-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  
  .tube-slots {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bench-area {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
}

/* 工具提示 */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}