/* 8位二进制实验器样式 */
.binary-playground-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Bradley Hand', cursive;
}

.bit-lights {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 10px;
}

.bit-lights button {
  position: relative;
  width: 85px;
  height: 110px;
  border: none;
  border-radius: 15px;
  background: linear-gradient(145deg, #e0e0e0, #b0b0b0);
  box-shadow: 5px 5px 10px #a0a0a0, -5px -5px 10px #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  overflow: hidden;
  flex-shrink: 0;
}

.bit-lights button:hover {
  transform: translateY(-3px);
  box-shadow: 7px 7px 12px #a0a0a0, -7px -7px 12px #ffffff;
}

.bit-lights button[aria-pressed="true"] {
  background: linear-gradient(145deg, #ffeb3b, #ffc107);
  box-shadow: 5px 5px 10px #d0a000, -5px -5px 10px #ffffff;
}

.bit-lights button[aria-pressed="true"]::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, #fff9c4 0%, #ffeb3b 40%, #ffc107 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px #ffeb3b, 0 0 15px #ffc107;
  animation: glow 1.5s infinite alternate;
  z-index: 1;
}

@keyframes glow {
  from {
    box-shadow: 0 0 8px #ffeb3b, 0 0 12px #ffc107;
  }
  to {
    box-shadow: 0 0 10px #ffeb3b, 0 0 15px #ffc107;
  }
}

.bit-lights button i {
  font-size: 2.2rem;
  color: #666;
  margin-bottom: 5px;
  transition: all 0.3s ease;
  z-index: 2;
}

.bit-lights button[aria-pressed="true"] i {
  color: #ff6f00;
  text-shadow: 0 0 5px #ff6f00;
}

.bit-lights button b {
  font-size: 1.6rem;
  font-weight: bold;
  color: #333;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 5px;
  padding: 2px 8px;
  z-index: 2;
}

.bit-lights button[aria-pressed="true"] b {
  background: rgba(255, 255, 255, 0.9);
  color: #d84315;
}



.tool-result {
  margin-top: 30px;
  padding: 20px;
  background: linear-gradient(145deg, #e6e6e6, #ffffff);
  border-radius: 15px;
  box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.binary-display {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  color: #2196F3;
  margin-bottom: 15px;
  letter-spacing: 5px;
  font-weight: bold;
}



.character-display {
  font-size: 2.5rem;
  color: #4CAF50;
  background: #f0f0f0;
  padding: 10px 20px;
  border-radius: 10px;
  margin-top: 10px;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 2px 2px 5px #bebebe, inset -2px -2px 5px #ffffff;
}

.character-display.empty {
  color: #999;
  font-size: 1.5rem;
}

.character-hint {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

/* 操作按钮区域 */
.playground-actions {
  margin: 20px 0;
  text-align: center;
}

.modal-trigger-btn {
  background: linear-gradient(145deg, #4CAF50, #45a049);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-trigger-btn:hover {
  background: linear-gradient(145deg, #45a049, #4CAF50);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.modal-trigger-btn i {
  font-size: 1.2rem;
}

/* 模态窗口样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: #f8f9fa;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: slideIn 0.4s ease;
  overflow: hidden;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: linear-gradient(145deg, #3f51b5, #303f9f);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-modal {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 20px;
}

.close-modal:hover {
  color: #f0f0f0;
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px;
}

.modal-instructions {
  background: linear-gradient(145deg, #e1f5fe, #b3e5fc);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 3px 3px 6px #bebebe, -3px -3px 6px #ffffff;
  font-size: 1.1rem;
  color: #0277bd;
}

/* 16位灯泡样式 */
.bit-lights-16 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.bit-lights-16 button {
  position: relative;
  width: 45px;
  height: 60px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #e0e0e0, #b0b0b0);
  box-shadow: 3px 3px 6px #a0a0a0, -3px -3px 6px #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  overflow: hidden;
  flex-shrink: 0;
}

.bit-lights-16 button:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 8px #a0a0a0, -4px -4px 8px #ffffff;
}

.bit-lights-16 button[aria-pressed="true"] {
  background: linear-gradient(145deg, #ffeb3b, #ffc107);
  box-shadow: 3px 3px 6px #d0a000, -3px -3px 6px #ffffff;
}

.bit-lights-16 button[aria-pressed="true"]::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #fff9c4 0%, #ffeb3b 40%, #ffc107 100%);
  border-radius: 50%;
  box-shadow: 0 0 5px #ffeb3b, 0 0 8px #ffc107;
  animation: glow-16 1.5s infinite alternate;
  z-index: 1;
}

@keyframes glow-16 {
  from {
    box-shadow: 0 0 4px #ffeb3b, 0 0 6px #ffc107;
  }
  to {
    box-shadow: 0 0 5px #ffeb3b, 0 0 8px #ffc107;
  }
}

.bit-lights-16 button i {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 2px;
  transition: all 0.3s ease;
  z-index: 2;
}

.bit-lights-16 button[aria-pressed="true"] i {
  color: #ff6f00;
  text-shadow: 0 0 3px #ff6f00;
}

.bit-lights-16 button b {
  font-size: 0.9rem;
  font-weight: bold;
  color: #333;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  padding: 1px 4px;
  z-index: 2;
}

.bit-lights-16 button[aria-pressed="true"] b {
  background: rgba(255, 255, 255, 0.9);
  color: #d84315;
}

/* 16位结果显示样式 */
.tool-result-16 {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(145deg, #e6e6e6, #ffffff);
  border-radius: 15px;
  box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.binary-display-16 {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  color: #2196F3;
  margin-bottom: 10px;
  letter-spacing: 2px;
  font-weight: bold;
}

.character-display-16 {
  font-size: 2rem;
  color: #4CAF50;
  background: #f0f0f0;
  padding: 10px 20px;
  border-radius: 10px;
  margin-top: 10px;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 2px 2px 5px #bebebe, inset -2px -2px 5px #ffffff;
}

.character-display-16.empty {
  color: #999;
  font-size: 1.2rem;
}

.character-hint-16 {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

.playground-instructions {
  background: linear-gradient(145deg, #e1f5fe, #b3e5fc);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 3px 3px 6px #bebebe, -3px -3px 6px #ffffff;
  font-size: 1.1rem;
  color: #0277bd;
}

.playground-title {
  font-size: 2.5rem;
  color: #3f51b5;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .binary-playground-container {
    padding: 15px;
  }
  
  .playground-title {
    font-size: 2rem;
  }
  
  .playground-instructions {
    font-size: 1rem;
    padding: 12px;
  }
  
  .bit-lights {
    gap: 6px;
    margin: 20px 0;
  }
  
  .bit-lights button {
    width: 65px;
    height: 85px;
    padding: 8px 0;
  }
  
  .bit-lights button i {
    font-size: 1.8rem;
  }
  
  .bit-lights button b {
    font-size: 1.3rem;
    padding: 2px 6px;
  }
  
  
  
  .bit-lights button[aria-pressed="true"]::before {
    width: 40px;
    height: 40px;
  }
  
  .binary-display {
    font-size: 1.8rem;
    letter-spacing: 3px;
  }
  
  .character-display {
    font-size: 2rem;
    min-width: 50px;
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  .bit-lights {
    gap: 4px;
  }
  
  .bit-lights button {
    width: 55px;
    height: 75px;
  }
  
  .bit-lights button i {
    font-size: 1.5rem;
  }
  
  .bit-lights button b {
    font-size: 1.1rem;
  }
  
  
  
  .bit-lights button[aria-pressed="true"]::before {
    width: 35px;
    height: 35px;
  }
  
  .binary-display {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }
  
  .character-display {
    font-size: 1.8rem;
  }
  
  /* 模态窗口响应式设计 */
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .modal-header {
    padding: 15px;
  }
  
  .modal-header h2 {
    font-size: 1.3rem;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .modal-instructions {
    font-size: 1rem;
    padding: 12px;
  }
  
  .bit-lights-16 {
    gap: 5px;
  }
  
  .bit-lights-16 button {
    width: 40px;
    height: 55px;
  }
  
  .bit-lights-16 button i {
    font-size: 1rem;
  }
  
  .bit-lights-16 button b {
    font-size: 0.8rem;
  }
  
  .bit-lights-16 button[aria-pressed="true"]::before {
    width: 18px;
    height: 18px;
  }
  
  .binary-display-16 {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
  
  .character-display-16 {
    font-size: 1.8rem;
  }
}