* {
  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: 1000px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

header {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  padding: 30px;
  text-align: center;
  color: white;
}

header h1 {
  font-size: 2.5em;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.controls_info {
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.info {
  background: white;
  margin: 10px 0;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid #4facfe;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-size: 0.95em;
  color: #666;
}

.controls {
  padding: 30px;
  text-align: center;
  background: #f8f9fa;
}

#connect-device {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.2em;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#connect-device:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

#statusText {
      white-space: pre-line; /* 合并空格，保留换行符 */
}

.status {
  margin-top: 15px;
  font-size: 1.1em;
  color: #666;
  font-weight: bold;
}

.function_block {
  padding: 30px;
  margin: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  display: none;
}

.function_block.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.device-header {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.device-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  font-weight: bold;
  margin-right: 15px;
  color: white;
}

.icon-a {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.icon-b {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.device-title {
  color: #333;
  font-size: 1.4em;
  margin: 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.feature-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

fieldset {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  background: white;
}

legend {
  font-weight: bold;
  color: #495057;
  padding: 0 10px;
  font-size: 1.1em;
}

.fileSelect {
  width: 100%;
  padding: 10px;
  border: 2px dashed #dee2e6;
  border-radius: 5px;
  background: #f8f9fa;
  margin: 10px 0;
}

.update {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  margin: 10px 0;
  font-size: 1em;
  transition: all 0.3s ease;
  width: 100%;
}

.update:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.update:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

progress {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
  border: none;
  background: #e9ecef;
}

progress::-webkit-progress-bar {
  background: #e9ecef;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  transition: width 0.3s ease;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2em;
  }

  .container {
    margin: 10px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .controls {
    padding: 20px;
  }
}