* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.2em;
  opacity: 0.9;
}

/* Форма ученика */
.student-form {
  padding: 40px;
  max-width: 600px;
  margin: 0 auto;
}

.student-form h2 {
  color: #667eea;
  margin-bottom: 30px;
  font-size: 1.8em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

/* Кнопки */
.btn-primary, .btn-action, .btn-export {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
  margin-top: 20px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-action {
  background: #4CAF50;
  color: white;
  margin-top: 20px;
}

.btn-action:hover {
  background: #45a049;
  transform: translateY(-2px);
}

.btn-export {
  background: #FF6B6B;
  color: white;
  margin: 10px;
}

.btn-export:hover {
  background: #EE5A5A;
  transform: translateY(-2px);
}

/* Контент лабораторной */
.lab-content {
  padding: 40px;
}

.lab-section {
  margin-bottom: 40px;
}

.lab-section h2 {
  color: #667eea;
  font-size: 1.8em;
  margin-bottom: 20px;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

.equipment-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.equipment-list li {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

/* Шаги эксперимента */
.step {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 2px solid #e0e0e0;
}

.step h3 {
  color: #764ba2;
  font-size: 1.5em;
  margin-bottom: 15px;
}

/* Анимация прибора */
.apparatus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  margin: 20px 0;
  min-height: 300px;
}

.flask {
  position: relative;
}

.flask-body {
  width: 120px;
  height: 150px;
  background: transparent;
  border: 4px solid #333;
  border-radius: 0 0 60px 60px;
  position: relative;
  overflow: hidden;
}

.flask-neck {
  width: 40px;
  height: 60px;
  background: transparent;
  border: 4px solid #333;
  border-bottom: none;
  margin: 0 auto;
  position: relative;
  top: -4px;
}

.tube {
  width: 150px;
  height: 8px;
  background: #333;
  border-radius: 4px;
  position: relative;
}

.tube.flowing::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, #87CEEB 50%, transparent 100%);
  animation: flow 2s linear infinite;
}

@keyframes flow {
  0% { left: -100%; }
  100% { left: 100%; }
}

.test-tube {
  width: 60px;
  height: 200px;
  background: transparent;
  border: 4px solid #333;
  border-top: none;
  border-radius: 0 0 30px 30px;
  position: relative;
  overflow: hidden;
}

.hydrogen-gas {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%);
  height: 0%;
  animation: fillTube 3s ease-in-out forwards;
}

@keyframes fillTube {
  0% { height: 0%; }
  100% { height: 80%; }
}

/* Цинк */
.zinc-particles {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 30px;
  background: #C0C0C0;
  border-radius: 8px;
}

.zinc-particles.reacting {
  animation: react 2s ease-in-out infinite;
}

@keyframes react {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(0.95); }
}

/* Кислота */
.acid-solution {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(180deg, transparent 0%, #FFF8DC 100%);
  animation: pour 1s ease-in-out;
}

@keyframes pour {
  0% { height: 0%; opacity: 0; }
  100% { height: 60%; opacity: 1; }
}

/* Пузырьки */
.bubbles {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 80px;
}

.bubbles::before,
.bubbles::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #87CEEB;
  border-radius: 50%;
  animation: bubble 2s ease-in-out infinite;
}

.bubbles::before {
  left: 10px;
  animation-delay: 0s;
}

.bubbles::after {
  right: 10px;
  animation-delay: 1s;
}

@keyframes bubble {
  0% {
    bottom: 0;
    opacity: 1;
  }
  100% {
    bottom: 80px;
    opacity: 0;
  }
}

/* Тест на горение */
.test-section {
  display: flex;
  justify-content: center;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  margin: 20px 0;
}

.test-tube-holder {
  position: relative;
  width: 100px;
}

.test-tube-full {
  width: 60px;
  height: 200px;
  background: transparent;
  border: 4px solid #333;
  border-top: none;
  border-radius: 0 0 30px 30px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.hydrogen-full {
  width: 100%;
  height: 80%;
  background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%);
  position: absolute;
  bottom: 0;
}

.match {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 40px;
  background: #8B4513;
  border-radius: 2px;
}

.match::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #FF6347;
  border-radius: 50%;
}

.flame {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 60px;
  background: linear-gradient(180deg, #FFD700 0%, #FF6347 50%, #FF4500 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.2s ease-in-out infinite;
  filter: blur(2px);
}

@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

/* Наблюдения */
.observation {
  background: #E8F5E9;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
  margin-top: 20px;
}

.observation p {
  color: #2E7D32;
  font-weight: 500;
  margin: 5px 0;
}

/* Свойства */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.property-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  transition: transform 0.3s, box-shadow 0.3s;
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.property-card h4 {
  color: #667eea;
  font-size: 1.3em;
  margin-bottom: 15px;
}

.property-card ul {
  list-style: none;
}

.property-card li {
  padding: 8px 0;
  color: #555;
}

/* Вывод */
#conclusionText {
  width: 100%;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  resize: vertical;
  margin-top: 10px;
}

#conclusionText:focus {
  outline: none;
  border-color: #667eea;
}

.suggestion {
  background: #FFF3E0;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #FF9800;
  margin-top: 20px;
}

.suggestion p {
  color: #E65100;
  margin: 5px 0;
}

/* Экспорт */
.export-section {
  text-align: center;
  padding: 30px;
  background: #f5f5f5;
  border-radius: 12px;
}

.export-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8em;
  }
  
  .apparatus {
    flex-direction: column;
    gap: 10px;
  }
  
  .tube {
    width: 80px;
    transform: rotate(90deg);
  }
  
  .properties-grid {
    grid-template-columns: 1fr;
  }
}

/* Анимация появления */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step {
  animation: fadeIn 0.5s ease-in-out;
}
