body {
  font-family: sans-serif;
  margin: 20px;
}

/* 标题容器样式 */
.title-container {
  text-align: left;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.title-image {
  width: 270px;
  height: auto;
}

.title-container h2 {
  margin: 0;
  color: #333;
  font-size: 1.8rem;
}

/* 版本信息样式 */
.version-info {
  position: absolute;
  top: 20px;
  right: 20px;
  text-align: right;
  font-size: 0.75rem;
  color: #666;
  line-height: 1.2;
}

.version-info .update-date {
  display: block;
  color: #666;
}

.version-info .date-label {
  color: #666;
}

.version-info .date-value {
  color: #4caf50;
  font-weight: bold;
}

.version-info .author {
  display: block;
  margin-top: 4px;
}

/* 作者链接样式 */
.version-info .author a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.version-info .author a:hover {
  color: #4caf50;
  text-decoration: underline;
}

.version-info .author-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  object-fit: contain;
  border-radius: 2px;
  transition: transform 0.2s ease;
}

.version-info .author a:hover .author-icon {
  transform: scale(1.1);
}

/* 作者名字样式 */
.version-info .author-name {
  color: #ff69b4;
  font-weight: bold;
}

/* 社交媒体链接样式 */
.version-info .social-links {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.version-info .social-link {
  color: #999;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px;
  border-radius: 3px;
}

.version-info .social-link:hover {
  color: #4caf50;
  background-color: rgba(76, 175, 80, 0.1);
  transform: scale(1.1);
}

.version-info .social-icon {
  font-size: 0.9rem;
}

/* 为body添加相对定位，让绝对定位的版本信息能正确定位 */
body {
  position: relative;
}

.control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /* 如果实在太窄会自动换行 */
  gap: 4px 12px;
  /* 行间距 4px，控件间距 12px */
  margin-bottom: 8px;
  /* 底部留点空 */
}

/* 2. 对“交战距离”那一行强制不换行 */
.control-group#distance-group {
  white-space: nowrap;
}

/* 3. fieldset 下的击中概率 改成两列 grid */
fieldset.control-group {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  padding: 8px;
  max-width: 340px;
  /* 或者你想要的宽度 */
}

/* 4. 让 label 宽度自适应，控件更紧凑 */
.control-group label {
  width: auto;
  min-width: 45px;
  font-size: 0.9rem;
  margin-right: 0px; /* 进一步减少label和控件之间的间距 */
}


/* 5. select 和 input 宽度微调 */
.control-group select,
.control-group input[type="number"] {
  width: auto;
  max-width: 50px;
  font-size: 0.9rem;
}

/* 6. checkbox 样式调整，让它们更紧凑 */
.control-group input[type="checkbox"] {
  margin: 0;
  margin-left: -10px; /* 进一步减少checkbox和label之间的间距 */
}

label {
  display: inline-block;
  width: 100px;
}

input[type="number"] {
  width: 60px;
}

/* 美化按钮 */
button {
  background-color: #4caf50;
  color: #fff;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color .2s;
}

button:hover {
  background-color: #45a049;
}

/* 按钮区水平排列 */
.buttons-container {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* 画布也放卡片里 */
.canvas-container {
  background: #fff;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.prob-item label {
  width: auto;      /* 根据文字长度自适应 */
  min-width: 1;     /* 取消原来给 control-group label 的最小宽 */
  margin: 0;        /* 去掉多余外边距 */
  padding: 0;       /* 去掉内边距 */
  font-size: 0.9rem;
}

/* 再减小一下项内间距 */
.prob-item {
  display: flex;
  align-items: center;
  gap: 4px;         /* 原来是 4px，可根据需要再调小 */
}

/* 表格基础数据居中显示 */
#attachmentTable td {
  text-align: center;
  vertical-align: middle;
}

/* 武器名称列左对齐 */
#attachmentTable td:first-child {
  text-align: left;
}

/* 枪管和枪口列左对齐 */
#attachmentTable td:nth-child(8),
#attachmentTable td:nth-child(9) {
  text-align: left;
}

/* 附件选择列左对齐 */
#attachmentTable .barrelSel {
  margin: 0;
  display: inline-block;
  width: 160px; 
  min-width: 160px;
  max-width: 160px;
}
#attachmentTable .muzzleSel {
  margin: 0;
  display: inline-block;
  width: 130px; 
  min-width: 130px;
  max-width: 130px;
}

#attachmentTable .bulletSel {
  margin: 0;
  display: inline-block;
  width: 70px; 
  min-width: 70px;
  max-width: 70px;
}

/* 副本行样式 */
.clone-row {
  background-color: #f5f5f5;  /* 淡灰色背景 */
  font-size: 16px;  /* 调整字体大小 */
}

.clone-row:hover {
  background-color: #e9e9e9;  /* 悬停时稍微深一点 */
}

/* 确保背景色覆盖整行 */
.clone-row td {
  background-color: inherit;
  border-top: 1px solid #dee2e6;
  font-size: inherit;  /* 继承行的字体大小 */
}

/* 操作按钮样式 */
.add-clone-btn, .remove-clone-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  
  /* 使用 Flexbox 精确居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* 确保文字居中 */
  text-align: center;
  line-height: 1;
  padding: 0;
}

.add-clone-btn {
  background-color: #5abb56;
  color: white;
}

.add-clone-btn:hover {
  background-color: #5abb56;
}

.remove-clone-btn {
  background-color: #dc3545;
  color: white;
}

.remove-clone-btn:hover {
  background-color: #c82333;
}

/* 禁用状态的加号按钮 */
.add-clone-btn:disabled {
  background-color: #d2d4d6;
  cursor: not-allowed;
  transform: none;
}