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: 550px;
  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: 620px;
  /* 或者你想要的宽度 */
}

/* 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;
}

/* 全局枪管类型选择器样式 */
#globalBarrelType {
  min-width: 115px;
}

/* 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;      /* 根据文字长度自适应 */
}


.prob-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.prob-actions button {
  padding: 5px 12px;
  font-size: 0.92rem;
}

.prob-hint {
  color: #666;
  font-size: 0.88rem;
}


/* 枪口初速精校滑块样式 */
.velocity-precision-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.velocity-precision-slider {
  flex: 1;
  min-width: 80px;
  height: 20px;
  background: #ddd;
  outline: none;
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}

.velocity-precision-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #4caf50;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.velocity-precision-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #4caf50;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.velocity-precision-value {
  font-size: 0.9rem;
  font-weight: bold;
  color: #333;
  min-width: 35px;
  text-align: center;
}

/* 副本武器的只读精校显示 */
.velocity-precision-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 4px 8px;
  background-color: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.velocity-precision-display .velocity-precision-value {
  color: #666;
  font-style: italic;
}

/* 再减小一下项内间距 */
.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(9),
#attachmentTable td:nth-child(10) {
  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: inline-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 {
  margin-left: 6px;
  background-color: #dc3545;
  color: white;
}

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

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


#ttkChart {
  cursor: pointer;
}

.weapon-detail-modal.hidden {
  display: none;
}

.weapon-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.weapon-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.weapon-detail-dialog {
  position: relative;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  overflow: auto;
  padding: 20px 20px 24px;
}

.weapon-detail-close {
  position: sticky;
  top: 0;
  float: right;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  z-index: 2;
}

.weapon-detail-header {
  margin-bottom: 14px;
}

.weapon-detail-header h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.weapon-detail-subtitle,
.weapon-detail-note {
  color: #555;
  font-size: 0.95rem;
  margin: 4px 0;
}

.weapon-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.weapon-detail-card {
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
}

.weapon-detail-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.weapon-detail-list {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.weapon-detail-list .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.weapon-detail-list .label {
  color: #666;
  white-space: nowrap;
}

.weapon-detail-list .value {
  text-align: right;
  word-break: break-word;
}

.weapon-detail-sequence {
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: #f6f9ff;
  border: 1px solid #d7e4ff;
  border-radius: 10px;
}

.weapon-detail-sequence strong {
  display: block;
  margin-bottom: 6px;
}


.weapon-detail-sequence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
}

.weapon-detail-sequence-note {
  color: #556;
  font-size: 0.9rem;
  margin-top: 6px;
  line-height: 1.5;
}

.weapon-detail-table-wrap {
  overflow-x: auto;
}

.weapon-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.weapon-detail-table th,
.weapon-detail-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.weapon-detail-table th {
  background: #f1f1f1;
}

.weapon-detail-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.weapon-detail-controls {
  margin-top: 14px;
}

.weapon-detail-current-sequence {
  margin: 8px 0 10px;
  padding: 10px 12px;
  min-height: 22px;
  background: #ffffff;
  border: 1px dashed #b8c8e6;
  border-radius: 8px;
  line-height: 1.6;
  word-break: break-word;
}

.weapon-detail-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.weapon-detail-button-row.utility {
  margin-top: 10px;
}

.weapon-detail-action-btn {
  min-width: 88px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.weapon-detail-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.weapon-detail-action-btn.secondary {
  background: #6b7280;
}

.weapon-detail-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.weapon-detail-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: #fff;
}

.weapon-detail-status.idle {
  background: #7c8798;
}

.weapon-detail-status.pending {
  background: #d97706;
}

.weapon-detail-status.success {
  background: #15803d;
}

.weapon-detail-empty {
  color: #666;
  text-align: center;
  line-height: 1.6;
}


.rank-filter-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fafafa;
  flex-wrap: wrap;
}

.rank-filter-control label {
  width: auto;
  font-size: 0.92rem;
  color: #333;
}

#rankFilterMode {
  min-width: 92px;
}

#keepTopCount,
#trimBottomCount {
  width: 56px;
  max-width: 56px;
}

.rank-filter-hint {
  color: #666;
  font-size: 0.88rem;
}

.rank-filter-control input:disabled,
.rank-filter-control select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
