.bing-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  color: #666;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.bing-search-btn:hover {
  color: #0067b8; /* 必应主题色 */
  background-color: rgba(0, 0, 0, 0.05);
}

.bing-search-btn svg {
  display: block;
}

/* 帕鲁配种计算器样式文件 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: #f5f6fa;
  height: 100vh;
  padding: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.container {
  max-width: 1200px;
  height: calc(100vh - 40px);
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-content {
  padding: 30px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.filter-bar-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px 25px 5px 25px; /* 上20px 右25px 下15px 左25px */
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
}

.breeding-section {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 1fr auto;
  gap: 20px;
  margin-bottom: 25px;
  align-items: end;
}

/* 重置按钮的特殊对齐 */
.breeding-section .frame-select:last-child {
  align-self: center;
  margin-top: 22px; /* 补偿label的高度 */
}

/* 当配种代数选择器隐藏时，调整网格布局 */
.breeding-section:has(.generation-selector.hidden) {
  grid-template-columns: 1fr 1fr 1fr auto;
}

/* 配种代数选择器隐藏时不占用空间 */
.generation-selector.hidden {
  display: none;
}

.frame-select {
  position: relative;
}

.frame-select label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.frame-select select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  transition: border-color 0.15s ease-in-out;
  line-height: normal;
  height: auto;
  box-sizing: border-box;
}

.frame-select select:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.frame-button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

/* 统一的危险按钮样式 */
.danger-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.danger-btn:hover {
  background: #c82333;
}

.frame-button.reset {
  margin-top: -4px;
}

/* 配种代数选择器样式 - 与其他输入框保持一致 */
.generation-selector {
  position: relative;
}

/* 亲属关系下拉框的特殊样式 */
#dropdownGeneration .dropdown-item {
  justify-content: flex-start;
  text-align: left;
}

#dropdownGeneration .dropdown-item span {
  text-align: left;
}

/* 亲属关系输入框文字左对齐 */
input#searchGeneration.search-input {
  text-align: left !important;
  direction: ltr !important;
  text-indent: 0 !important;
  padding-left: 12px !important;
}

/* 二代配种结果样式 */
.breeding-result.multi-generation {
  height: 120px;
  padding: 5px;
  width: 100%;
  overflow: hidden; /* 防止内容溢出 */
}

.breeding-result.multi-generation .breeding-formula {
  display: grid;
  grid-template-columns: 1fr 14px 1fr 14px 1fr 14px 1fr 14px 1fr;
  gap: 3px;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
}

.breeding-result.multi-generation .pal-card {
  padding: 5px;
  min-height: 95px;
  margin: 0;
  width: 100%;
  max-width: none;
  flex-shrink: 1;
  box-sizing: border-box;
}

.breeding-result.multi-generation .pal-image {
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
}

.breeding-result.multi-generation .pal-chinese {
  font-size: 11px;
  line-height: 1.2;
  margin: 0;
  word-break: break-all;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breeding-result.multi-generation .math-symbol {
  font-size: 14px;
  padding: 0;
  margin: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: bold;
}

.breeding-result.multi-generation .pal-name-container {
  margin-top: 4px;
}

.pal-info-display {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.breeding-results-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
  align-content: start;
}

.breeding-results-container::-webkit-scrollbar {
  width: 8px;
}

.breeding-results-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.breeding-results-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.breeding-results-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.breeding-result {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breeding-formula {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  height: 100%;
}

.pal-info-display.hidden {
  display: none;
}

.pal-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.pal-image {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #e9ecef;
  margin: 0 auto 8px;
  display: block;
  opacity: 1;
  flex-shrink: 0;
}

.pal-name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  flex-shrink: 0;
}

.pal-chinese {
  font-weight: 600;
  color: #000000;
  font-size: 14px;
  text-align: center;
  line-height: 1.2;
}

.gender-symbol {
  font-size: 16px;
  font-weight: 900;
  display: none;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.gender-symbol.male {
  color: #0056b3;
  text-shadow: 0 0 2px rgba(0, 86, 179, 0.4);
}

.gender-symbol.female {
  color: #c21e56;
  text-shadow: 0 0 2px rgba(194, 30, 86, 0.4);
}

.math-symbol {
  font-size: 20px;
  font-weight: bold;
  color: #495057;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-size: 16px;
  color: #495057;
}

.loading-overlay.hidden {
  display: none;
}

.search-input.loading {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgcj0iOCIgc3Ryb2tlPSIjNmM3NTdkIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiB2YWx1ZXM9IjAgMTAgMTA7MzYwIDEwIDEwIi8+CjwvY2lyY2xlPgo8L3N2Zz4=");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}

.dropdown-item.highlighted {
  background: #007bff;
  color: white;
}

.dropdown-item.highlighted .dropdown-item-image {
  border-color: white;
}

.search-container {
  position: relative;
  margin-bottom: 8px;
}

.search-input {
  width: 100%;
  padding: 8px 30px 8px 40px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  text-align: left;
}

.search-input.no-image {
  padding-left: 12px;
}

.search-input:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.dropdown-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.dropdown-arrow:hover {
  color: #495057;
}

.dropdown-arrow.open {
  transform: translateY(-50%) rotate(180deg);
}

/* 筛选部分的箭头位置调整 */
.exclude-search .dropdown-arrow,
.select-search .dropdown-arrow {
  top: calc(50% + 4px);
}

.exclude-search .dropdown-arrow.open,
.select-search .dropdown-arrow.open {
  transform: translateY(-50%) rotate(180deg);
}

.input-image {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  z-index: 10;
  display: none;
}

.input-image img {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid #e9ecef;
}

.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 432px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  padding: 12px 15px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f8f9fa;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dropdown-item:hover {
  background: #f8f9fa;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item-image {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
}

.dropdown-item-text {
  flex: 1;
  font-size: 16px;
}

/* 帕鲁筛选控件样式 */
.filter-controls {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}

.filter-controls.hidden {
  display: none;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.clear-all-btn {
  padding: 15px 12px;
  font-size: 12px;
  white-space: nowrap;
  align-self: flex-start;
  width: 80px;
  flex-shrink: 0;
}

.exclude-search {
  position: relative;
  width: 180px;
  flex-shrink: 0;
}

/* 统一的筛选输入框样式 */
.filter-input {
  width: 100%;
  padding: 8px 30px 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  margin-top: 8px;
}

.filter-input:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.exclude-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.exclude-dropdown .dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f8f9fa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exclude-dropdown .dropdown-item:hover {
  background: #f8f9fa;
}

.exclude-dropdown .dropdown-item:last-child {
  border-bottom: none;
}

.exclude-dropdown .dropdown-item-image {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
}

.exclude-dropdown .dropdown-item-text {
  flex: 1;
  font-size: 13px;
}

.selected-excludes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  box-sizing: border-box;
  align-items: flex-start;
  align-content: flex-start;
  flex: 1;
  min-width: 250px;
}

.exclude-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #b3d9ff;
  color: #0056b3;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.exclude-tag-image {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.exclude-tag-remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  padding: 0;
  margin-left: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background-color 0.2s;
}

.exclude-tag-remove:hover {
  background: rgba(0, 86, 179, 0.2);
}

/* 筛选行布局 */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: nowrap;
  min-height: 40px;
  width: 100%;
}

.filter-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  width: 80px;
  flex-shrink: 0;
  text-align: left;
  margin-left: 25px;
}

#selectPalSection.hidden {
  display: none;
}

.select-search {
  position: relative;
  width: 180px;
  flex-shrink: 0;
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.select-dropdown .dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s;
}

.select-dropdown .dropdown-item:hover {
  background: #f8f9fa;
}

.select-dropdown .dropdown-item:last-child {
  border-bottom: none;
}

.select-dropdown .dropdown-item-image {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.select-dropdown .dropdown-item-text {
  flex: 1;
  font-size: 13px;
}

.selected-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  box-sizing: border-box;
  align-items: flex-start;
  align-content: flex-start;
  flex: 1;
  min-width: 250px;
}

.select-tag {
  display: flex;
  align-items: center;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 16px;
  padding: 4px 8px;
  font-size: 12px;
  color: #1565c0;
  gap: 4px;
}

.select-tag-image {
  width: 16px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

.select-tag-remove {
  background: none;
  border: none;
  color: #1565c0;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  padding: 0;
  margin-left: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background-color 0.2s;
}

.select-tag-remove:hover {
  background: rgba(21, 101, 192, 0.2);
}

.result-count {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
  line-height: 1.5;
  margin-top: 8px;
}

/* 隐藏的配种结果样式 */
.breeding-result.filtered-hidden {
  display: none !important;
}

/* 清空选项样式 */
.dropdown-item.clear-option {
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  font-weight: 500;
}

.dropdown-item.clear-option:hover {
  background: #e9ecef;
}
