/* 重置样式，减少默认边距和填充 */
/* 添加到CSS顶部，解决导航栏上方空间问题 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 确保modal不占用布局空间 */
.modal {
  position: fixed;
  z-index: 1050;
  background-color: transparent;
  pointer-events: none;
}

.d-none {
  display: none !important;
}

/* 现代简约风格 CSS */

/* 基础样式和变量 */
:root {
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --secondary-color: #2ecc71;
  --secondary-hover: #27ae60;
  --dark-color: #2c3e50;
  --gray-color: #95a5a6;
  --light-gray: #ecf0f1;
  --border-color: #dcdfe6;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --success-color: #27ae60;
  --info-color: #3498db;
  --box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  --border-radius: 6px;
  --transition: all 0.3s ease;
}

/* 全局样式 */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html {
  margin: 0;
  padding: 0;
}

/* 导航栏样式 */
.navbar {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin: 0;
  padding: 0.6rem 0;
}

/* 导航栏Logo */
.navbar-brand {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.navbar .logo {
  height: 40px;
  margin: 0;
  padding: 0;
}

.navbar .nav-link {
  color: var(--dark-color);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  margin: 0 0.2rem;
  display: inline-flex;
  align-items: center;
}

.navbar .nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(52, 152, 219, 0.1);
  transform: translateY(-2px);
}

.navbar .nav-link.active {
  color: var(--primary-color);
  background-color: rgba(52, 152, 219, 0.1);
  position: relative;
}

.navbar .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.navbar .icon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
}

/* 主容器样式 */
#main {
  margin: 0;
  padding: 0;
}

/* 容器样式 */
.container {
  max-width: 1300px;
  padding: 0 1rem;
  margin: 0 auto;
  width: 100%;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: none;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* 按钮样式 */
.btn {
  border-radius: var(--border-radius);
  padding: 0.5rem 1.2rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
}

.btn-outline-dark {
  border: 1px solid var(--dark-color);
  color: var(--dark-color);
}

.btn-outline-dark:hover {
  background-color: var(--dark-color);
  color: white;
}

.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background-color: white;
  color: var(--dark-color);
  line-height: 1;
  min-height: 40px;
  box-shadow: var(--box-shadow);
}

.app-button:hover {
  background-color: var(--light-gray);
  border-color: var(--gray-color);
}

.app-button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* TOML 切换按钮样式 */
.toml-switch-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.toml-switch {
  transition: var(--transition);
  font-weight: 500;
  min-width: 130px;
  position: relative;
  border-radius: var(--border-radius);
  background-color: white;
  border: 1px solid #e0e0e0;
  color: var(--dark-color);
}

.toml-switch:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.toml-switch.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.toml-switch.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--primary-color);
}

/* 表单元素样式 */
/* 移除不再使用的.form-container相关样式 */
/* 
.form-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
*/

.field-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.field-container label {
  font-weight: 500;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
}

.field {
  margin-bottom: 0.75rem;
}

.form-check-input {
  width: 18px;
  height: 18px;
}

.form-check-label {
  margin-left: 0.5rem;
  color: var(--dark-color);
}

select, input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  transition: var(--transition);
}

select:focus, input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
  outline: none;
}

/* 警告和提示信息 */
.alert {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow);
  padding: 1rem 1.25rem;
}

/* 终端区域 */
#terminal {
  background-color: #282c34;
  border-radius: var(--border-radius);
  padding: 1rem;
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

/* 标题样式 */
h5 {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 1.5rem;
}

.section-title {
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* 表单网格布局 */
/* 
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .form-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}
*/

/* 表单元素样式 */
.chipset-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-check-inline {
  margin-bottom: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.form-check-inline:hover {
  background-color: #e9ecef;
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--dark-color);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  appearance: none;
}

.form-select:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* 设备类型选择框美化 */
#device option {
  padding: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .toml-switch {
    min-width: 110px;
  }
  
  .navbar .nav-link {
    padding: 0.4rem 0.75rem;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* 宣传图片和视频容器样式 */
.banner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 20px;
}

.banner-img {
  height: 340px;
  width: auto;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.banner-video {
  width: 604px; /* 16:9比例下，高度340px对应的宽度 */
  height: 340px;
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow);
}

@media (max-width: 991.98px) {
  .banner-img {
    width: 100%;
    height: auto;
    max-height: 340px;
  }
  
  .banner-video {
    width: 100%;
    max-width: 604px;
    height: auto;
    aspect-ratio: 16/9;
    max-height: 340px;
  }
}

/* 介绍文字和视频链接样式 */
.container.intro-text {
  padding: 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* 视频教程组样式 - 添加边框 */
.video-links {
  border-radius: var(--border-radius);
  padding: 1rem;
  background-color: #f8f9fa;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.video-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.video-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
}

.tutorial-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.tutorial-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  text-decoration: none;
  color: var(--dark-color);
}

.tutorial-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.tutorial-num {
  background-color: var(--primary-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.85rem;
}

.tutorial-num-2 {
  background-color: #ff0000;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.85rem;
}

.tool-description {
  margin: 1.5rem 0;
  line-height: 1.8;
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tool-description span {
  display: block;
  margin-bottom: 0.75rem;
}

.tool-description span:first-child {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--dark-color);
}

.tool-description br {
  display: none;
}

.warning-text {
  color: var(--danger-color);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  background-color: rgba(231, 76, 60, 0.1);
  border-radius: var(--border-radius);
  display: inline-block;
  margin-top: 0.5rem;
}

.helper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.helper-link {
  color: var(--dark-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  background-color: rgba(44, 62, 80, 0.1);
  transition: var(--transition);
  font-weight: 500;
}

.helper-link:hover {
  background-color: rgba(44, 62, 80, 0.2);
  text-decoration: none;
  color: var(--dark-color);
  transform: translateY(-2px);
}

.link-icon {
  margin-right: 8px;
  font-style: normal;
}

/* 页脚样式 */
footer {
  background-color: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-img {
  width: 30px;
  height: 30px;
}

.footer-text {
  font-weight: 600;
  color: var(--dark-color);
  font-size: 1.2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0;
}

.footer-link {
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.footer-link:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.footer-copyright {
  color: var(--gray-color);
  font-size: 0.9rem;
}

/* 修改Modal样式，取消背景变暗效果 */
.modal-backdrop {
  display: none !important;
  opacity: 0 !important;
}

.modal {
  background-color: transparent;
  pointer-events: none;
}

.modal-dialog {
  pointer-events: all;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 模态框内容样式 */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1.2rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1.2rem 1.5rem;
}

/* 恢复选项卡内容面板样式 */
.tabs-section {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.container.tabs-section {
  max-width: 1300;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* QR码容器样式 */
#qrcodeContainer, #qrcodeContainerQS {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* 统一图标大小 */
.icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* 开发板类型选项 */
.kit-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* 应用程序描述 */
.app-description {
  display: block;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  font-style: italic;
  margin-top: 0.5rem;
}

/* 操作区域 */
.action-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

/* 刷写按钮 */
.flash-button {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
}

.flash-button:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

.flash-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-icon {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 信息链接 */
.info-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  font-weight: 500;
}

.info-link:hover {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--primary-hover);
  text-decoration: none;
}

.info-icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

#connectButton {
  color: var(--secondary-color);
}

#connectButton:hover {
  background-color: rgba(46, 204, 113, 0.1);
}

#disconnectButton {
  color: var(--danger-color);
}

#disconnectButton:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

main {
  flex: 1;
}

#mainContainer {
  padding-top: 0;
  margin-top: 0;
}

/* 精简后的表单结构样式 */
.form-simplified {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
  margin: 1.5rem 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-group label {
  font-weight: 500;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
}

.field-group select {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  background-color: white;
  transition: var(--transition);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.field-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
  outline: none;
}

/* 修改操作区域样式以适应新结构 */
.action-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

/* 芯片组和开发板选项样式 */
.chipset-options,
.kit-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* 应用程序描述样式 */
.app-description {
  display: block;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  font-style: italic;
}

/* 单选框标签样式 */
.form-check-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.form-check-input {
  margin-left: 0.25rem;
  cursor: pointer;
  vertical-align: middle;
}

.action-button {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-height: 48px;
  line-height: 1;
}

/* 视频教程横向布局 */
.video-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.video-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
}

.tutorial-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* 向下箭头指引样式 */
.scroll-arrow-container {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  margin-top: -30px;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.scroll-arrow {
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  animation: bounce 2s infinite;
  transition: all 0.3s ease;
}

.scroll-arrow:hover {
  transform: translateY(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-arrow svg {
  width: 20px;
  height: 20px;
  fill: var(--primary-color);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
} 