﻿:root {
  color-scheme: light;
  --bg-top: #ebf6ff;
  --bg-bottom: #fff6eb;
  --line: #eddcc6;
  --ink: #22202b;
  --muted: #6d655f;
  --brand: #0f6c64;
  --brand-strong: #084c45;
  --accent: #c96d2b;
  --sky: #d4ecff;
  --shadow: 0 22px 50px rgba(100, 72, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(212, 236, 255, 0.95), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 214, 166, 0.6), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 12px 10px 28px;
}

.container {
  width: min(430px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(217, 184, 141, 0.55);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 18px 16px;
  color: #fff8ef;
  background:
    linear-gradient(140deg, rgba(15, 108, 100, 0.95), rgba(18, 65, 96, 0.92)),
    linear-gradient(40deg, rgba(201, 109, 43, 0.25), transparent 52%);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.species-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.species-switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  color: rgba(255, 248, 239, 0.92);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 248, 239, 0.32);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.species-switch-button.active {
  color: var(--brand-strong);
  background: rgba(255, 248, 239, 0.92);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark,
.species-photo-button {
  padding: 0;
  border: 0;
  background: transparent;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  background: rgba(255, 248, 239, 0.18);
  border: 1px solid rgba(255, 248, 239, 0.3);
  border-radius: 50%;
}

.brand-mark-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.zoomable-image {
  cursor: zoom-in;
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 248, 239, 0.76);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel .eyebrow {
  color: var(--brand);
}

.hero h1,
.panel h2,
.help-card h2 {
  margin: 0;
  font-family: inherit;
}

.hero h1 {
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.18;
}

.hero-summary {
  margin: 0;
  color: rgba(255, 248, 239, 0.92);
  font-size: 14px;
  line-height: 1.65;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badges span {
  padding: 7px 11px;
  background: rgba(255, 248, 239, 0.12);
  border: 1px solid rgba(255, 248, 239, 0.22);
  border-radius: 999px;
  font-size: 12px;
}

.hero-help {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-species-photo {
  display: block;
  width: 100%;
  height: 164px;
  object-fit: cover;
  border: 1px solid rgba(255, 248, 239, 0.18);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.help-card {
  width: 100%;
  padding: 16px;
  background: rgba(255, 248, 239, 0.12);
  border: 1px solid rgba(255, 248, 239, 0.18);
  border-radius: 14px;
}

.help-card p {
  margin: 10px 0 0;
  color: rgba(255, 248, 239, 0.92);
  line-height: 1.7;
}

.hero-contact {
  color: #fff4d6;
  font-weight: 700;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #fffbf5, #fff5e8);
  border-bottom: 1px solid var(--line);
}

.tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 66px;
  padding: 8px 6px;
  color: var(--brand-strong);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tabs button:hover {
  background: rgba(15, 108, 100, 0.05);
  border-color: rgba(15, 108, 100, 0.12);
  transform: translateY(-1px);
}

.tabs button.active {
  color: #fff8ef;
  background: linear-gradient(180deg, #124160, #0f6c64);
  box-shadow: 0 10px 22px rgba(15, 108, 100, 0.22);
}

.tabs button span {
  text-align: center;
  font-size: 12px;
}

.tab-icon {
  font-size: 18px;
  line-height: 1;
}

.panel {
  padding: 18px 14px;
}

.page-panel[hidden] {
  display: none;
}

.panel-spacious {
  padding-top: 20px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.panel h2,
.help-card h2 {
  font-size: clamp(22px, 6vw, 28px);
}

.section-note,
.guide-meta,
.muted {
  color: var(--muted);
}

.section-note {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
}

.guide-layout,
.phenotype-grid,
.parents-grid,
.form-grid,
.gene-grid,
.gene-summary-grid {
  display: grid;
  gap: 16px;
}

.guide-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.guide-column {
  display: grid;
  gap: 14px;
}

.guide-column.wide {
  align-self: stretch;
}

.guide-note,
.phenotype-card,
.parent-card,
.tips-inline,
.gene-summary-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.95), rgba(255, 255, 255, 0.95));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(92, 74, 46, 0.06);
}

.guide-note h3 {
  margin: 0 0 8px;
}

.guide-note p,
.guide-meta {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.searchable-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 72px 9px 12px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid #d6c0a2;
  border-radius: 8px;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid #d6c0a2;
  border-radius: 8px;
}

select option {
  color: inherit;
  background-color: #fffdf9;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(15, 108, 100, 0.16);
}

.directional-clear-chip {
  position: absolute;
  top: 10px;
  right: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--brand-strong);
  background: rgba(15, 108, 100, 0.08);
  border: 0;
  border-radius: 999px;
}

.search-dropdown-arrow {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--brand-strong);
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
  background: #fffdf9;
  border: 1px solid #d6c0a2;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(92, 74, 46, 0.14);
}

.search-dropdown[hidden] {
  display: none;
}

.search-option {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(214, 192, 162, 0.45);
}

.search-option[hidden] {
  display: none;
}

.search-option:last-child {
  border-bottom: 0;
}

.search-option:hover,
.search-option.active {
  background: rgba(15, 108, 100, 0.08);
}

.phenotype-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phenotype-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.phenotype-photo-button {
  width: 148px;
  height: 148px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fff2df, #ffe1b4);
  border: 0;
  border-radius: 999px;
}

.guide-phenotype-image {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: cover;
  border: 3px solid rgba(255, 248, 239, 0.88);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(92, 74, 46, 0.14);
  transition: transform 180ms ease;
}

.phenotype-photo-button:hover .guide-phenotype-image {
  transform: scale(1.04);
}

.phenotype-card strong {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 42px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.phenotype-detail {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.thumb {
  width: 30px;
  height: 30px;
  padding: 0;
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid #d6c0a2;
  border-radius: 999px;
}

.thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 108, 100, 0.15);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  color: var(--ink);
  background: #fff8ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  color: #fff8ef;
  background: linear-gradient(180deg, var(--accent), #a9531c);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(201, 109, 43, 0.2);
}

.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.icon-only {
  width: 46px;
  padding: 0;
  font-size: 20px;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
}

.image-preview-overlay[hidden] {
  display: none;
}

.image-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.image-preview-media {
  max-width: min(92vw, 960px);
  max-height: 88vh;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.image-preview-caption {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 18px;
  margin: 0;
  color: #fff8ef;
  font-weight: 700;
  text-align: center;
}

.image-fallback {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  padding: 16px;
  color: var(--muted);
  background: #fff8ef;
  border-radius: 999px;
  font-weight: 700;
}

.page-title-block {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-bottom: 16px;
  text-align: center;
}

.page-title-block .eyebrow {
  color: var(--brand);
}

.tips-inline {
  margin-bottom: 18px;
}

.tips-inline h3,
.parent-card h3,
.gene-summary-card h3 {
  margin: 0 0 10px;
  color: var(--brand-strong);
}

.tips-inline ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.parents-grid {
  grid-template-columns: 1fr;
}

.parent-card {
  display: grid;
  gap: 14px;
}

.parent-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.parent-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.parent-avatar,
.parent-placeholder {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 999px;
  border: 3px solid rgba(255, 248, 239, 0.88);
  box-shadow: 0 10px 24px rgba(92, 74, 46, 0.14);
}

.parent-avatar img,
.result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parent-placeholder {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  font-size: 38px;
  font-weight: 800;
}

.parent-placeholder.female {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: #be185d;
}

.sex-badge {
  position: absolute;
  right: -2px;
  bottom: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #dbeafe;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #2563eb;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.sex-badge.female {
  background: #fce7f3;
  color: #db2777;
}

.parent-card-title {
  min-width: 0;
}

.parent-card-title strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.parent-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 700;
}

.form-grid {
  grid-template-columns: 1fr;
}

.gene-grid {
  grid-template-columns: 1fr;
}

.gene-summary-card {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(255, 253, 249, 0.96));
  border-color: #dbe7ff;
}

.gene-summary-grid {
  grid-template-columns: 1fr;
}

.gene-line {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gene-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  color: #0d486d;
  background: var(--sky);
  border-radius: 6px;
}

.image-map {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.result-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff8ef;
  border: 2px solid rgba(255, 248, 239, 0.88);
}

.image-map-list {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 20px 0 12px;
}

.contact-note {
  margin: 10px 0 0;
  color: #3156d3;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.inline-warning {
  margin: 12px 0 0;
  color: #b45309;
  font-weight: 700;
  text-align: center;
}

.placeholder-panel {
  text-align: center;
}

#genePanel.section,
#basicPanel.section,
#precisePanel.section,
#bestPanel.section {
  background: #fff;
  border: 1px solid #dbeafe66;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.08), 0 5px 15px rgba(59, 130, 246, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  margin: 0;
  padding: 25px 18px 40px;
}

#genePanel .page-title,
#basicPanel .page-title,
#precisePanel .page-title,
#bestPanel .page-title {
  margin: 0;
  padding: 10px 0 20px;
  color: #667eea;
  background: linear-gradient(135deg, #667eea, #764ba2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 800;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(102, 126, 234, 0.2);
}

#genePanel .tips-inline,
#basicPanel .tips-inline,
#precisePanel .tips-inline,
#bestPanel .tips-inline {
  max-width: 700px;
  margin: 0 auto 16px;
  padding: 14px 18px;
  text-align: center;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(129, 199, 132, 0.08));
  border: 1.5px solid rgba(76, 175, 80, 0.18);
  border-radius: 12px;
  box-shadow: none;
}

#genePanel .tips-title-centered,
#basicPanel .tips-title-centered,
#precisePanel .tips-title-centered,
#bestPanel .tips-title-centered {
  margin: 0 0 10px;
  color: #4caf50;
  font-size: 1.05em;
  font-weight: 600;
  text-align: center;
}

#genePanel .tips-list,
#basicPanel .tips-list,
#precisePanel .tips-list,
#bestPanel .tips-list {
  margin: 0;
  padding-left: 20px;
  color: #495057;
  line-height: 1.8;
  text-align: left;
}

.breeding-calculator-content,
.calculator-section {
  display: block;
}

.parent-selectors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin: 20px 0;
}

.parent-phenotype-selectors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin: 20px 0;
}

.parent-with-offspring,
.parent-phenotype-selector {
  min-width: 0;
}

.parent-selector {
  padding: 25px;
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.parent-phenotype-selector {
  display: grid;
  gap: 16px;
  padding: 25px;
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.parent-phenotype-selector:hover {
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.parent-selector:hover {
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.gene-parent-header {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.gene-parent-avatar {
  margin: 0 auto;
}

.parent-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 0 20px;
  padding: 8px 15px;
  border-bottom: 2px solid #e9ecef;
  font-size: 3em;
  font-weight: 900;
}

.quaker-parent-input-identity-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.parent-avatar-inline {
  padding: 0;
  background: transparent;
  border: 0;
}

.pairing-parent-avatar {
  position: relative;
  display: inline-block;
  width: 96px;
  height: 96px;
}

.pairing-parent-avatar img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.pairing-parent-sex-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.pairing-parent-sex-badge.male {
  color: #2563eb;
  background: #eff6ff;
}

.pairing-parent-sex-badge.female {
  color: #db2777;
  background: #fdf2f8;
}

.male-symbol {
  color: #1976d2;
}

.female-symbol {
  color: #e91e63;
}

.phenotype-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  margin: 20px 0;
  padding: 20px 25px;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #dee2e6;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.phenotype-display.active {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: #28a745;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
  transform: translateY(-2px);
}

.phenotype-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.phenotype-display.active .phenotype-text {
  color: #155724;
  font-size: 20px;
  font-weight: 800;
}

.gene-inputs {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.gene-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gene-input-group label {
  color: #495057;
  font-size: 16px;
  font-weight: 700;
}

.phenotype-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phenotype-input-group label {
  color: #495057;
  font-size: 16px;
  font-weight: 700;
}

.feature-group {
  margin-top: 8px;
}

#genePanel select,
#basicPanel input,
#precisePanel input,
#precisePanel select,
#bestPanel input,
#directionalPanel input,
#directionalPanel select {
  min-height: 58px;
  padding: 18px 24px;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  color: #2c3e50;
  font-size: 16px;
  font-weight: 500;
}

#genePanel select:focus,
#basicPanel input:focus,
#precisePanel input:focus,
#precisePanel select:focus,
#bestPanel input:focus,
#directionalPanel input:focus,
#directionalPanel select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  outline: none;
  transform: translateY(-1px);
}

#basicPanel .search-dropdown,
#precisePanel .search-dropdown,
#bestPanel .search-dropdown,
#directionalPanel .search-dropdown {
  border-color: #dee2e6;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.directional-calculator {
  display: grid;
  gap: 18px;
}

.directional-input-section {
  display: grid;
  gap: 16px;
}

.selector-card,
.directional-selector-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  border: 2px solid #e9ecef;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.directional-avatar-group {
  display: grid;
  justify-items: center;
  margin: 0;
}

.directional-selector-card .phenotype-input-group,
.directional-selector-card .field {
  width: 100%;
  max-width: 400px;
}

.directional-advanced-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.advanced-filter-btn {
  min-height: 42px;
  padding: 10px 20px;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.advanced-filter-btn:disabled {
  cursor: not-allowed;
  color: #8b8f99;
  background: linear-gradient(135deg, #eceff3, #d8dde5);
  box-shadow: none;
}

.directional-filter-section {
  position: relative;
  display: grid;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  border: 2px solid #667eea;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.filter-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #20c997);
}

.directional-filter-section h3 {
  margin: 0;
  color: #333;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.directional-filter-grid,
.directional-result-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.directional-results {
  text-align: left;
}

.results-section {
  display: grid;
  gap: 18px;
}

.directional-table-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.directional-table-heading h5 {
  margin: 0;
  color: #333;
  font-size: 16px;
  font-weight: 800;
}

.directional-table-heading .muted {
  color: #667085;
  font-size: 13px;
  font-weight: 600;
}

.directional-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.avatar-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #667eea;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 20px;
  transform: translateY(-50%);
}

.avatar-toggle-btn:hover {
  background: rgba(102, 126, 234, 0.08);
}

.results-title {
  display: grid;
  gap: 4px;
  margin: 0;
  text-align: center;
}

.results-title-main {
  color: #333;
  font-size: 20px;
  font-weight: 800;
}

.results-title-detail {
  color: #667085;
  font-size: 14px;
  font-weight: 600;
}

.result-filter-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 12px;
}

.result-filter-section p {
  margin: 0;
  color: #667085;
  text-align: center;
}

.results-table-container {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
}

.results-table th,
.results-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e9ecef;
  color: #2c3e50;
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
}

.results-table th {
  color: #4f46e5;
  background: #f4f6ff;
  font-weight: 800;
}

.gene-results-section {
  gap: 20px;
}

.gene-summary-box h3 {
  margin: 0;
}

.gene-summary-box p {
  margin: 0;
  text-align: center;
}

.gene-summary-parents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.gene-summary-parent {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(102, 126, 234, 0.12);
  border-radius: 12px;
}

.gene-result-block {
  display: grid;
  gap: 12px;
}

.gene-result-block-title {
  margin: 0;
  color: #334155;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
}

.gene-result-sex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.gene-result-group {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
}

.gene-result-group.male {
  border-top: 4px solid #2563eb;
}

.gene-result-group.female {
  border-top: 4px solid #db2777;
}

.gene-result-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e9ecef;
}

.gene-result-group-header h4 {
  margin: 0;
  color: #334155;
  font-size: 15px;
  font-weight: 900;
}

.gene-result-group-header span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.gene-result-table-container {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gene-result-table {
  min-width: 520px;
  border-radius: 0;
}

.gene-result-empty {
  margin: 0;
  padding: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.gene-sample-cell {
  min-width: 280px;
}

.gene-sample-cell code {
  margin: 2px 4px;
}

.genotype-code {
  display: inline-block;
  max-width: 100%;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.pairing-card-phenotype-detail .genotype-code,
.gene-line .genotype-code,
.genotype-cell .genotype-code {
  color: inherit;
  background: rgba(248, 250, 252, 0.9);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f8fbff;
}

.phenotype-cell-inner {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  line-height: 1.15;
}

.result-avatar-inline {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.gene-result-avatar {
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.gene-result-avatar .pairing-parent-sex-badge {
  right: -5px;
  bottom: -5px;
  width: 16px;
  height: 16px;
  border-width: 1px;
  font-size: 10px;
}

.result-avatar-inline img,
.pair-detail-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f8f9fa;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.phenotype-cell .phenotype-main {
  font-weight: 700;
}

.phenotype-cell .phenotype-detail {
  color: #667085;
  font-size: 12px;
}

.genotype-cell {
  color: #475467;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 12px;
}

.probability-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 10px;
  color: #047857;
  background: #d1fae5;
  border-radius: 999px;
  font-weight: 900;
}

.sex-female {
  color: #db2777;
  font-weight: 800;
}

.sex-any {
  color: #7c3aed;
  font-weight: 800;
}

.no-results {
  padding: 32px 18px;
  color: #8b8f99;
  text-align: center;
}

.progress-section {
  display: grid;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 12px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  background: #e9ecef;
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #20c997);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.progress-text {
  margin: 0;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.pair-detail-view {
  display: grid;
  gap: 20px;
}

.pair-detail-back {
  justify-self: center;
}

.pair-detail-view h3 {
  margin: 0;
  color: #667eea;
  font-size: 1.6em;
  font-weight: 800;
  text-align: center;
}

.directional-detail-pair {
  padding: 14px 0;
}

.directional-parent-trace-btn {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.24);
}

.directional-parent-trace-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.32);
}

.pairing-parent-avatar-wrapper {
  position: relative;
  display: inline-flex;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 50%;
  width: 96px;
  height: 96px;
}

.gene-summary-avatar {
  cursor: zoom-in;
}

.gene-summary-avatar:disabled {
  cursor: default;
}

.gene-summary-avatar .pairing-parent-sex-badge {
  right: -5px;
  bottom: -5px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-width: 1px;
  font-size: 11px;
}

.pair-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.pair-detail-summary div,
.pair-origin-box {
  padding: 14px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.94), rgba(255, 255, 255, 0.98));
  border: 1px solid #e9ecef;
  border-radius: 12px;
  text-align: center;
}

.pair-detail-summary span {
  display: block;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.pair-detail-summary strong {
  color: #2c3e50;
  font-size: 18px;
}

.pair-origin-box {
  text-align: left;
}

.pair-origin-box h4 {
  margin: 0 0 10px;
  color: #495057;
  text-align: center;
}

.pair-origin-box p {
  margin: 6px 0;
  color: #475467;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 13px;
}

.origin-retained-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.origin-retained-grid div {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
}

.origin-retained-grid span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.origin-retained-grid strong {
  color: #334155;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.origin-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.origin-source-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.14);
  border-radius: 12px;
}

.origin-source-card.empty {
  place-items: center;
  min-height: 150px;
}

.origin-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.origin-source-header h5,
.origin-source-card h5 {
  margin: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.origin-source-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.origin-bird-card {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 10px 8px;
  background: #f8fafc;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  text-align: center;
}

.origin-bird-avatar {
  position: relative;
  display: inline-flex;
  width: 64px;
  height: 64px;
}

.origin-bird-avatar img,
.origin-bird-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.origin-bird-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #667085;
  background: #e9ecef;
  font-weight: 900;
}

.origin-bird-label {
  font-size: 12px;
  font-weight: 900;
}

.origin-bird-label.male {
  color: #2563eb;
}

.origin-bird-label.female {
  color: #db2777;
}

.origin-bird-card strong {
  max-width: 100%;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.origin-bird-genotype {
  max-width: 100%;
  color: #667085;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.precise-parent-card {
  gap: 18px;
}

#precisePanel .parent-phenotype-selectors {
  align-items: start;
  gap: 18px;
}

#precisePanel .parent-phenotype-selector {
  gap: 14px;
  padding: 28px 32px 30px;
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
}

#precisePanel .parent-phenotype-selector:hover {
  border-color: transparent;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
}

#precisePanel .quaker-parent-input-identity-slot {
  min-height: 120px;
}

#precisePanel .pairing-parent-avatar,
#precisePanel .pairing-parent-avatar img {
  width: 96px;
  height: 96px;
}

#precisePanel .phenotype-input-group label {
  font-size: 14px;
  font-weight: 800;
}

#precisePanel .phenotype-input-group > label:first-child {
  text-align: center;
}

#precisePanel .phenotype-input-group > .field + .precise-card-count {
  margin-top: 12px;
}

#precisePanel input {
  min-height: 58px;
  padding: 16px 78px 16px 24px;
  border: 1px solid #d9dce3;
  border-radius: 8px;
  box-shadow: 0 4px 11px rgba(15, 23, 42, 0.12);
  font-size: 14px;
}

#precisePanel .directional-clear-chip {
  top: 17px;
  right: auto;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #8da0bc;
  background: transparent;
  font-size: 14px;
}

#precisePanel .search-dropdown-arrow {
  top: 17px;
  right: 14px;
  width: 18px;
  height: 18px;
  color: #666;
  background: transparent;
  font-size: 12px;
}

.precise-card-count {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 46px;
  margin-top: 0;
  padding: 10px 14px;
  color: #2563eb;
  background: #eef2ff;
  border: 2px solid #16a34a;
  border-radius: 6px;
  font-weight: 800;
}

.precise-card-count.empty {
  color: #64748b;
}

.precise-card-count strong {
  color: #4f46e5;
}

.precise-card-count span {
  font-size: 18px;
}

.precise-constraint-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 12px;
  padding: 12px 0 0;
  overflow: visible;
}

.precise-parent-constraints {
  display: none;
}

.precise-parent-fold[open] + .precise-parent-constraints {
  display: grid;
}

.precise-fold {
  display: grid;
  gap: 12px;
  padding: 0;
  background: #f4f2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  overflow: hidden;
}

#precisePanel .precise-parent-fold {
  background: #f3f1ff;
}

.precise-fold summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 16px;
  color: #495057;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.precise-fold summary::-webkit-details-marker {
  display: none;
}

.precise-fold summary::before {
  content: "▶";
  color: #667eea;
  font-size: 14px;
}

.precise-fold[open] summary::before {
  content: "▼";
}

.precise-fold summary span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.precise-fold .offspring-constraint {
  margin: 0 14px 14px;
}

.precise-parent-feature {
  margin-top: 0;
}

.precise-parent-feature label {
  text-align: center;
}

.constraint-label {
  display: grid;
  gap: 2px;
  text-align: center;
}

.constraint-label small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

.offspring-constraint {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.05));
  border: 1px solid rgba(102, 126, 234, 0.14);
  border-radius: 14px;
}

.precise-offspring-constraint {
  grid-column: 1 / -1;
}

.precise-pair-offspring-constraint {
  width: min(760px, 100%);
  margin: 18px auto 0;
}

.precise-pair-offspring-constraint .offspring-header > div {
  display: grid;
  gap: 4px;
}

.precise-pair-offspring-constraint .offspring-header p {
  margin: 0;
}

.precise-sibling-constraint .offspring-header > div {
  display: grid;
  gap: 4px;
}

.precise-sibling-constraint .offspring-header p {
  margin: 0;
}

.precise-ancestor-fold {
  grid-column: 1 / -1;
}

.precise-ancestor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 0 14px 14px;
}

.offspring-header,
.offspring-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offspring-header strong,
.offspring-row-title span {
  color: #495057;
  font-weight: 800;
}

.offspring-empty {
  margin: 0;
  text-align: center;
}

.offspring-list,
.offspring-row {
  display: grid;
  gap: 12px;
}

.offspring-row {
  padding: 12px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
}

.offspring-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.precise-analysis-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
}

.precise-analysis-title {
  color: #334155;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.precise-analysis-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.precise-analysis-stats div {
  display: grid;
  gap: 4px;
  min-height: 72px;
  place-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.precise-analysis-stats strong {
  color: #2563eb;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.precise-analysis-stats span,
.precise-preview-grid span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.precise-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.precise-preview-grid > div {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.precise-preview-grid code {
  display: block;
  padding: 7px 8px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  white-space: normal;
  word-break: break-word;
}

.precise-pairing-advice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
  padding: 0 12px;
}

.precise-pairing-advice-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.precise-pairing-advice,
.precise-pairing-advice-owner {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.precise-pairing-advice {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding: 8px 9px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.precise-pairing-advice-avatar {
  width: 48px;
  height: 48px;
}

.precise-pairing-advice-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.precise-pairing-advice-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.precise-pairing-advice-label,
.precise-pairing-advice-owner {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.precise-pairing-advice-phenotype {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.precise-pairing-advice-result {
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.precise-pairing-advice .genotype-code {
  margin: 0;
}

.precise-offspring-genotype {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin: 6px 0;
}

.precise-offspring-genotype .genotype-code {
  margin: 0;
}

.precise-suggestion-toggle {
  min-height: 32px;
  padding: 6px 10px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.precise-suggestion-toggle:hover {
  background: #ccfbf1;
}

.precise-suggestion-toggle:disabled {
  cursor: wait;
  opacity: 0.7;
}

.precise-suggestion-panel {
  grid-column: 1 / -1;
}

.precise-offspring-panel {
  border-top: 1px solid #e9ecef;
}

.precise-analysis-muted,
.precise-preview-empty {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.records-btn {
  min-height: 46px;
  padding: 12px 24px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border: 0;
  border-radius: 24px;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.28);
  font-size: 16px;
  font-weight: 800;
}

.records-btn:hover {
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.36);
  transform: translateY(-2px);
}

.best-pairing-selectors {
  align-items: start;
}

.best-list-header {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-align: center;
}

.best-list-header h3 {
  margin: 0;
  color: #667eea;
  font-size: 1.35em;
  font-weight: 800;
}

.best-parent-list {
  display: grid;
  gap: 16px;
}

.best-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.92), rgba(233, 236, 239, 0.72));
  border: 2px dashed #dee2e6;
  border-radius: 15px;
  text-align: center;
}

.best-parent-card {
  margin-bottom: 16px;
}

.best-parent-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.best-parent-title .parent-symbol {
  margin-bottom: 0;
  font-size: 1.45em;
}

.best-parent-card .parent-avatar-inline {
  align-self: center;
}

.best-constraint-grid {
  display: grid;
  gap: 14px;
}

.add-parent-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.gene-preview-line {
  margin-top: 14px;
}

.calculate-button-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 25px 0;
  text-align: center;
}

.symmetric-layout {
  position: relative;
}

.calculate-btn {
  min-height: 68px;
  padding: 22px 55px;
  color: #fff;
  background: linear-gradient(135deg, #28a745, #20c997, #17a2b8);
  border: 0;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: #e2a8b0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(240, 200, 205, 0.6);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(224, 162, 170, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

.swap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: #667eea;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  font-size: 22px;
  font-weight: 800;
}

.results {
  margin-top: 24px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.results[hidden] {
  display: none;
}

.results h4 {
  color: #333;
  font-size: 18px;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .hero,
  .panel {
    padding: 14px;
  }

  .guide-note,
  .phenotype-card,
  .parent-card,
  .tips-inline,
  .gene-summary-card {
    padding: 14px;
  }

  .brand-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs button {
    min-height: 66px;
    padding: 8px 6px;
  }

  .tabs button span {
    font-size: 12px;
  }

  .results {
    padding: 10px;
  }

  .gene-result-block-title {
    text-align: center;
    font-size: 16px;
  }

  .gene-result-sex-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gene-result-table-container {
    overflow-x: visible;
  }

  .gene-result-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
  }

  .gene-sample-cell {
    min-width: 0;
  }

  .precise-pairing-advice-grid {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }

  .gene-result-table thead {
    display: none;
  }

  .gene-result-table,
  .gene-result-table tbody,
  .gene-result-table tr,
  .gene-result-table td {
    display: block;
    width: 100%;
  }

  .gene-result-table tr {
    padding: 10px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
  }

  .gene-result-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 9px 7px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    text-align: left;
  }

  .gene-result-table td:last-child {
    border-bottom: 0;
  }

  .gene-result-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-weight: 900;
  }

  .gene-result-table .phenotype-cell-inner {
    align-items: flex-start;
  }

  .gene-result-table .probability-cell {
    text-align: left;
  }

  .gene-result-table code {
    width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .gene-result-table td code,
  .directional-table td code {
    grid-column: 2;
    display: block;
    width: 100%;
    margin: 3px 0;
  }
}

@media (max-width: 420px) {
  .phenotype-grid {
    grid-template-columns: 1fr;
  }

  .phenotype-photo-button,
  .guide-phenotype-image,
  .image-fallback {
    width: 164px;
    height: 164px;
  }
}

@media (min-width: 1024px) {
  .app-shell {
    padding: 28px 24px 42px;
  }

  .container {
    width: min(1440px, calc(100vw - 48px));
    border-radius: 16px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
    align-items: stretch;
    gap: 24px;
    padding: 28px 32px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-summary {
    max-width: 760px;
    font-size: 16px;
  }

  .hero-help {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: stretch;
  }

  .hero-species-photo {
    height: 100%;
    min-height: 168px;
  }

  .tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 18px;
  }

  .tabs button {
    flex-direction: row;
    gap: 8px;
    min-height: 54px;
    padding: 10px 12px;
  }

  .tabs button span {
    font-size: 14px;
  }

  .panel {
    padding: 28px 32px 34px;
  }

  .section-heading {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .panel h2,
  .help-card h2 {
    font-size: 30px;
  }

  .guide-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .phenotype-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }

  .parents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .gene-grid,
  .gene-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #genePanel.section,
  #basicPanel.section,
  #precisePanel.section,
  #bestPanel.section {
    padding: 25px 40px 40px;
  }

  .parent-selectors,
  .parent-phenotype-selectors {
    grid-template-columns: 1fr 1fr;
  }

  .offspring-fields {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
}

@media (min-width: 1280px) {
  .gene-result-sex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gene-result-table {
    min-width: 0;
    width: 100%;
  }
}

/* Professional mobile-first refresh */
:root {
  --bg-top: #f6f8f7;
  --bg-bottom: #eef3f1;
  --line: #d8e1dc;
  --line-strong: #bdcbc4;
  --ink: #17231e;
  --muted: #66736d;
  --muted-2: #8b9891;
  --brand: #17675c;
  --brand-strong: #0d473f;
  --brand-soft: #e5f1ee;
  --accent: #c46b2e;
  --accent-strong: #9d4f1f;
  --accent-soft: #fff0e5;
  --sky: #e7f1f7;
  --danger: #c24142;
  --shadow: 0 18px 44px rgba(19, 35, 29, 0.1);
  --shadow-soft: 0 8px 22px rgba(19, 35, 29, 0.07);
  --radius: 8px;
  --radius-sm: 6px;
  --control: 44px;
}

html {
  background: var(--bg-bottom);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 247, 0.94) 44%, var(--bg-bottom)),
    var(--bg-bottom);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  letter-spacing: 0;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 103, 92, 0.2);
  outline-offset: 2px;
}

.app-shell {
  padding: 8px;
}

.container {
  width: min(430px, 100%);
  overflow: clip;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff, #f7faf8);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  min-width: 0;
  gap: 8px;
}

.species-switch {
  margin: 0;
  gap: 6px;
}

.species-switch-button {
  min-height: 28px;
  padding: 0 9px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: rgba(23, 103, 92, 0.16);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
}

.species-switch-button.active {
  color: #fff;
  background: var(--brand-strong);
}

.brand-line {
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: #fff;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-eyebrow {
  display: none;
}

.hero h1 {
  font-size: clamp(21px, 5.8vw, 25px);
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-summary {
  max-width: 24em;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.hero-badges {
  gap: 5px;
}

.hero-badges span {
  padding: 4px 7px;
  color: var(--brand-strong);
  background: #f3f7f5;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.hero-help {
  grid-column: 2;
  grid-row: 1 / span 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  min-width: 0;
}

.species-photo-button {
  min-width: 0;
  border-radius: var(--radius);
}

.hero-species-photo {
  height: 96px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.help-card {
  padding: 7px;
  color: var(--muted);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.help-card h2 {
  display: none;
}

.help-card p {
  display: none;
}

.help-card .hero-contact {
  display: block;
  margin: 0;
  color: var(--brand-strong);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  min-width: 0;
  min-height: 50px;
  gap: 3px;
  padding: 6px 4px;
  color: var(--muted);
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tabs button:hover {
  background: var(--brand-soft);
  border-color: rgba(23, 103, 92, 0.22);
  transform: translateY(-1px);
}

.tabs button.active {
  color: #fff;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(13, 71, 63, 0.18);
}

.tabs button span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.18;
}

.tab-icon {
  font-size: 14px;
  line-height: 1;
}

.panel,
#genePanel.section,
#basicPanel.section,
#precisePanel.section,
#bestPanel.section,
#directionalPanel.section {
  margin: 0;
  padding: 14px 12px 20px;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.panel-spacious {
  padding-top: 14px;
}

.section-heading {
  gap: 6px;
  margin-bottom: 12px;
}

.eyebrow,
.panel .eyebrow,
.page-title-block .eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.panel h2,
.help-card h2,
#genePanel .page-title,
#basicPanel .page-title,
#precisePanel .page-title,
#bestPanel .page-title,
#directionalPanel .page-title {
  margin: 0;
  padding: 0 0 12px;
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 900;
  line-height: 1.18;
  text-align: left;
  text-shadow: none;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.guide-layout,
.guide-column,
.phenotype-grid,
.parents-grid,
.form-grid,
.gene-grid,
.gene-summary-grid,
.parent-selectors,
.parent-phenotype-selectors,
.best-parent-list,
.offspring-list,
.offspring-row,
.pair-detail-view {
  gap: 10px;
}

.guide-note,
.phenotype-card,
.parent-card,
.tips-inline,
.gene-summary-card,
.parent-selector,
.parent-phenotype-selector,
.directional-selector-card,
.directional-filter-section,
.result-filter-section,
.results-section,
.gene-result-group,
.precise-analysis-panel,
.offspring-constraint,
.best-empty,
.pair-detail-summary div,
.pair-origin-box,
.progress-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.guide-note {
  padding: 12px;
}

.guide-note h3,
.tips-title-centered,
#genePanel .tips-title-centered,
#basicPanel .tips-title-centered,
#precisePanel .tips-title-centered,
#bestPanel .tips-title-centered,
.best-list-header h3,
.directional-filter-section h3,
.gene-result-block-title {
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
}

.guide-note p,
.guide-meta,
.muted,
.section-note {
  color: var(--muted);
}

.searchable-select {
  min-width: 0;
}

input,
select,
#precisePanel input {
  min-height: var(--control);
  padding: 10px 42px 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
  font-size: 14px;
  line-height: 1.25;
}

input::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
#precisePanel input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(23, 103, 92, 0.14);
}

.directional-clear-chip,
#precisePanel .directional-clear-chip {
  top: 10px;
  right: 34px;
  left: auto;
  width: 24px;
  height: 24px;
  color: var(--muted);
  background: #f0f4f2;
  border: 1px solid var(--line);
  font-size: 15px;
}

.search-dropdown-arrow,
#precisePanel .search-dropdown-arrow {
  top: 10px;
  right: 8px;
  width: 24px;
  height: 24px;
  color: var(--brand-strong);
  font-size: 12px;
}

.search-dropdown {
  max-height: 260px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 34px rgba(19, 35, 29, 0.18);
}

.search-option {
  min-height: 40px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef3f0;
  font-size: 13px;
}

.search-option:hover,
.search-option.active {
  background: var(--brand-soft);
}

.phenotype-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.phenotype-card {
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

.phenotype-photo-button {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #edf3f0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guide-phenotype-image,
.image-fallback {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
  box-shadow: none;
}

.phenotype-card strong {
  min-height: 38px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.32;
}

.phenotype-detail,
.phenotype-cell .phenotype-detail,
.pairing-card-phenotype-detail {
  color: var(--muted);
}

.thumbs {
  justify-content: flex-start;
  gap: 4px;
}

.thumb {
  width: 25px;
  height: 25px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(23, 103, 92, 0.12);
}

.empty-state,
.no-results,
.gene-result-empty {
  color: var(--muted);
  background: #f8faf9;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.tips-inline,
#genePanel .tips-inline,
#basicPanel .tips-inline,
#precisePanel .tips-inline,
#bestPanel .tips-inline {
  max-width: none;
  margin: 0 0 12px;
  padding: 12px;
  text-align: left;
  background: #f8faf9;
  border: 1px solid var(--line);
}

.tips-inline ol,
#genePanel .tips-list,
#basicPanel .tips-list,
#precisePanel .tips-list,
#bestPanel .tips-list {
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.parent-selectors,
.parent-phenotype-selectors {
  margin: 12px 0;
}

.parent-selector,
.parent-phenotype-selector,
#precisePanel .parent-phenotype-selector {
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.parent-selector:hover,
.parent-phenotype-selector:hover,
#precisePanel .parent-phenotype-selector:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: none;
}

.parent-symbol {
  min-height: 32px;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  font-size: 2.1em;
}

.quaker-parent-input-identity-slot,
#precisePanel .quaker-parent-input-identity-slot {
  min-height: 76px;
}

.pairing-parent-avatar,
.pairing-parent-avatar img,
#precisePanel .pairing-parent-avatar,
#precisePanel .pairing-parent-avatar img,
.pairing-parent-avatar-wrapper {
  width: 76px;
  height: 76px;
}

.pairing-parent-avatar img,
.result-avatar-inline img,
.pair-detail-avatar {
  border: 1px solid #fff;
  box-shadow: 0 6px 14px rgba(19, 35, 29, 0.12);
}

.pairing-parent-sex-badge {
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  font-size: 14px;
}

.phenotype-input-group,
.input-group,
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.phenotype-input-group label,
.field-label,
#precisePanel .phenotype-input-group label {
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 900;
  text-align: left;
}

.phenotype-display {
  min-height: 56px;
  margin: 12px 0;
  padding: 12px;
  color: var(--muted);
  background: #f8faf9;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
}

.phenotype-display.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-style: solid;
}

.gene-preview-line,
.precise-card-count {
  min-height: 38px;
  padding: 8px 10px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid rgba(23, 103, 92, 0.18);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 850;
}

.calculate-button-container {
  gap: 10px;
  margin: 16px 0;
}

.calculate-btn,
.records-btn,
.add-parent-btn,
.advanced-filter-btn,
.pair-detail-back,
.directional-parent-trace-btn,
.primary {
  min-height: 44px;
  padding: 10px 16px;
  color: #fff;
  background: var(--brand-strong);
  border: 1px solid var(--brand-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(13, 71, 63, 0.18);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.calculate-btn {
  min-width: 150px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-strong);
  box-shadow: 0 9px 20px rgba(196, 107, 46, 0.22);
}

.records-btn,
.add-parent-btn,
.advanced-filter-btn {
  background: var(--brand-strong);
}

.clear-btn,
.swap-btn,
.secondary,
.icon-only {
  color: var(--brand-strong);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
}

.clear-btn {
  width: 42px;
  height: 42px;
  color: var(--danger);
  font-size: 15px;
}

.swap-btn {
  width: 42px;
  height: 42px;
  font-size: 20px;
}

.results {
  margin-top: 14px;
  padding: 10px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.results-section {
  display: grid;
  gap: 12px;
  padding: 10px;
  text-align: left;
}

.results-title {
  gap: 4px;
  margin: 0;
  color: var(--ink);
}

.results-title-main {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.results-title-detail {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.result-filter-section,
.gene-summary-box {
  padding: 10px;
  background: #fff;
}

.directional-filter-grid,
.directional-result-filter-grid,
.precise-analysis-stats,
.precise-preview-grid,
.best-constraint-grid,
.offspring-fields,
.precise-constraint-block,
.precise-ancestor-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.directional-input-section,
.directional-calculator {
  gap: 12px;
}

.directional-selector-card {
  padding: 12px;
}

.precise-fold,
#precisePanel .precise-parent-fold {
  background: #f7faf8;
  border-color: var(--line);
}

.precise-fold summary {
  color: var(--brand-strong);
}

.precise-fold summary::before {
  color: var(--brand);
}

.precise-parent-constraints {
  padding-top: 10px;
}

.precise-offspring-constraint {
  padding: 10px;
  background: #fffdf8;
}

.precise-offspring-constraint .offspring-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.precise-offspring-constraint .offspring-header strong {
  align-self: center;
  color: var(--brand-strong);
}

.precise-offspring-constraint .add-parent-btn {
  min-height: 38px;
  padding: 8px 14px;
}

.offspring-row {
  padding: 10px;
}

.directional-advanced-row,
.best-list-header {
  margin: 12px 0;
}

.results-table-container {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.results-table {
  min-width: 680px;
  background: #fff;
  border-radius: 0;
}

.results-table th,
.results-table td {
  padding: 10px 9px;
  color: var(--ink);
  border-bottom: 1px solid #eef3f0;
  font-size: 13px;
}

.results-table th {
  color: var(--brand-strong);
  background: #f1f6f4;
  font-weight: 950;
}

.gene-result-block {
  gap: 10px;
}

.gene-result-sex-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.gene-result-group {
  overflow: hidden;
  box-shadow: none;
}

.gene-result-group.male {
  border-top: 3px solid #2f74c0;
}

.gene-result-group.female {
  border-top: 3px solid #be5b79;
}

.gene-result-group-header {
  padding: 9px 10px;
  background: #f8faf9;
  border-bottom: 1px solid var(--line);
}

.gene-result-group-header h4 {
  color: var(--ink);
  font-size: 14px;
}

.gene-result-group-header span {
  color: var(--muted);
  font-size: 11.5px;
}

.gene-summary-parents {
  grid-template-columns: 1fr;
  gap: 10px;
}

.gene-summary-parent {
  padding: 10px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.probability-value {
  min-width: 50px;
  padding: 4px 8px;
  color: #0f6b4f;
  background: #def4ea;
  border: 1px solid rgba(15, 107, 79, 0.14);
  border-radius: 999px;
}

code,
.genotype-code,
.pairing-card-phenotype-detail .genotype-code,
.gene-line .genotype-code,
.genotype-cell .genotype-code {
  color: #25423a;
  background: #edf3f0;
  border: 1px solid #dfe8e3;
  border-radius: var(--radius-sm);
}

.progress-fill {
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.image-preview-overlay {
  background: rgba(12, 20, 17, 0.84);
}

.image-preview-close {
  border-radius: var(--radius);
}

.image-preview-media {
  border-radius: var(--radius);
}

@media (max-width: 370px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .hero-species-photo {
    height: 82px;
    min-height: 82px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .hero-badges span {
    font-size: 10.5px;
  }

  .tabs button span {
    font-size: 10.5px;
  }
}

@media (max-width: 420px) {
  .phenotype-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phenotype-photo-button,
  .guide-phenotype-image,
  .image-fallback {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 760px) {
  .brand-line {
    align-items: center;
    flex-direction: row;
  }

  .hero,
  .panel,
  #genePanel.section,
  #basicPanel.section,
  #precisePanel.section,
  #bestPanel.section,
  #directionalPanel.section {
    padding: 12px;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tabs button {
    min-height: 50px;
    padding: 6px 4px;
  }

  .tabs button span {
    font-size: 11.5px;
  }

  .gene-result-table-container {
    overflow-x: visible;
  }

  .gene-result-table,
  .directional-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
  }

  .gene-result-table thead,
  .directional-table thead {
    display: none;
  }

  .gene-result-table,
  .gene-result-table tbody,
  .gene-result-table tr,
  .gene-result-table td,
  .directional-table,
  .directional-table tbody,
  .directional-table tr,
  .directional-table td {
    display: block;
    width: 100%;
  }

  .gene-result-table tr,
  .directional-table tr {
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
  }

  .gene-result-table td,
  .directional-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 8px 4px;
    border-bottom: 1px solid #eef3f0;
    font-size: 12px;
    text-align: left;
  }

  .gene-result-table td:last-child,
  .directional-table td:last-child {
    border-bottom: 0;
  }

  .gene-result-table td::before,
  .directional-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 900;
  }

  .gene-result-table .phenotype-cell-inner,
  .directional-table .phenotype-cell-inner {
    align-items: flex-start;
  }

  .directional-table .route-source-cell,
  .gene-result-table .phenotype-cell-inner {
    justify-content: flex-start;
  }

  .directional-results .results-table-container {
    overflow-x: visible;
  }

  .directional-results .directional-table tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 14px 12px 12px;
  }

  .directional-results .directional-table td {
    display: block;
    width: 100%;
    padding: 0;
    border-bottom: 0;
    text-align: left;
  }

  .directional-results .directional-table td::before {
    display: block;
    margin-bottom: 5px;
    color: #7b6b58;
    font-size: 11.5px;
    font-weight: 900;
    line-height: 1.2;
  }

  .directional-results .directional-table td[data-label="序号"] {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    min-width: 28px;
    padding: 3px 8px;
    color: #75664f;
    background: #fff6c7;
    border: 1px solid rgba(185, 134, 90, 0.18);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
  }

  .directional-results .directional-table td[data-label="序号"]::before {
    display: none;
  }

  .directional-results .directional-table .phenotype-cell-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    width: 100%;
    gap: 8px;
    padding-right: 42px;
  }

  .directional-results .directional-table .phenotype-detail {
    grid-column: 2;
  }

  .directional-results .directional-table .genotype-cell {
    min-width: 0;
  }

  .directional-results .directional-table .genotype-cell code,
  .directional-results .directional-table .genotype-code {
    display: block;
    width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .directional-results .directional-table .probability-cell .probability-value {
    display: inline-flex;
    justify-content: center;
    width: min(100%, 220px);
  }

  .precise-offspring-panel .gene-result-table tr {
    padding: 12px 10px 14px;
  }

  .precise-offspring-panel .gene-result-table td {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    min-height: 48px;
  }

  .precise-offspring-panel .gene-result-table td[data-label="子代表现型"] {
    align-items: start;
  }

  .precise-offspring-panel .gene-result-table td[data-label="整体概率"] .probability-value {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    max-width: 180px;
  }

  .precise-offspring-panel .gene-result-table td[data-label="示例基因型"] {
    display: block;
    align-items: start;
    padding-top: 10px;
  }

  .precise-offspring-panel .gene-result-table td[data-label="示例基因型"]::before {
    display: block;
    margin-bottom: 8px;
  }

  .precise-offspring-panel .gene-result-table td[data-label="示例基因型"] .gene-sample-cell,
  .precise-offspring-panel .gene-result-table td[data-label="示例基因型"] code {
    width: 100%;
  }

  .precise-offspring-panel .precise-offspring-genotype {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    margin: 0 0 12px;
  }

  .precise-offspring-panel .precise-offspring-genotype .genotype-code {
    grid-column: 1;
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
  }

  .precise-offspring-panel .precise-suggestion-toggle {
    justify-self: start;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    text-align: center;
  }

  .precise-offspring-panel .precise-suggestion-panel {
    width: 100%;
  }

  .precise-offspring-panel .precise-suggestion-panel .precise-pairing-advice {
    grid-template-columns: 56px minmax(0, 1fr);
    width: 100%;
    margin-top: 2px;
    padding: 10px;
    align-items: start;
  }

  .precise-offspring-panel .precise-suggestion-panel .precise-pairing-advice-avatar {
    width: 52px;
    height: 52px;
  }

  .precise-offspring-panel .precise-suggestion-panel .precise-pairing-advice .genotype-code {
    width: 100%;
  }
}

@media (min-width: 760px) {
  .container {
    width: min(720px, calc(100vw - 28px));
  }
}

@media (min-width: 1024px) {
  .app-shell {
    padding: 24px;
  }

  .container {
    width: min(1180px, calc(100vw - 48px));
    border-radius: 14px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
    padding: 18px 22px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-summary {
    font-size: 14px;
  }

  .hero-help {
    grid-template-columns: 1fr;
  }

  .hero-species-photo {
    height: 128px;
    min-height: 128px;
  }

  .help-card {
    padding: 9px;
  }

  .help-card p {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .help-card .hero-contact {
    margin-top: 5px;
    text-align: left;
  }

  .tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 10px 14px;
  }

  .tabs button {
    flex-direction: row;
    min-height: 46px;
    gap: 7px;
    padding: 8px 10px;
  }

  .tabs button span {
    font-size: 13px;
  }

  .tab-icon {
    font-size: 15px;
  }

  .panel,
  #genePanel.section,
  #basicPanel.section,
  #precisePanel.section,
  #bestPanel.section,
  #directionalPanel.section {
    padding: 22px 24px 28px;
  }

  .guide-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
  }

  .phenotype-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .parent-selectors,
  .parent-phenotype-selectors,
  .gene-result-sex-grid,
  .gene-summary-parents,
  .directional-filter-grid,
  .directional-result-filter-grid,
  .best-pairing-selectors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .precise-analysis-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .precise-preview-grid,
  .offspring-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .container {
    width: min(1280px, calc(100vw - 56px));
  }

  .phenotype-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Rainbow monk sweet field-guide theme */
:root {
  --bg-top: #fffaf5;
  --bg-bottom: #f4f0ef;
  --paper: #fffdf8;
  --paper-warm: #fff8ed;
  --feather-white: #fffdf6;
  --lemon: #f6efad;
  --lemon-soft: #fff8cf;
  --mist-blue: #cfe5ed;
  --mist-blue-soft: #edf7f8;
  --lavender-gray: #b9b4c2;
  --lavender-soft: #f3f0f5;
  --peach: #e9a28f;
  --peach-strong: #c97867;
  --peach-soft: #fff0ea;
  --wood: #b9865a;
  --wood-soft: #f4e5d3;
  --line: #eadfd6;
  --line-strong: #d9c7bb;
  --ink: #2f2928;
  --muted: #786f6c;
  --muted-2: #a29691;
  --brand: #8f9f79;
  --brand-strong: #6e805a;
  --brand-soft: #f2f6df;
  --accent: #e79a83;
  --accent-strong: #c87564;
  --accent-soft: #fff0ea;
  --sky: #eaf6f8;
  --danger: #c97867;
  --shadow: 0 22px 54px rgba(132, 105, 88, 0.16);
  --shadow-soft: 0 10px 26px rgba(132, 105, 88, 0.09);
}

html {
  background:
    linear-gradient(180deg, #fffdf8, #f7f0ea 48%, #edf4f2);
}

body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    radial-gradient(circle at 16% 4%, rgba(246, 239, 173, 0.42), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(207, 229, 237, 0.48), transparent 26%),
    linear-gradient(180deg, #fffdf8 0%, #fff8ed 44%, #eff6f4 100%);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

.app-shell {
  padding: 8px;
}

.container {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 245, 0.97)),
    var(--paper);
  border-color: rgba(217, 199, 187, 0.92);
  box-shadow: var(--shadow);
}

.container::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    radial-gradient(circle at 18px 18px, rgba(233, 162, 143, 0.08) 0 1px, transparent 1.5px);
  background-size: auto, 18px 18px;
  mix-blend-mode: multiply;
}

.hero,
.tabs,
.panel,
#genePanel.section,
#basicPanel.section,
#precisePanel.section,
#bestPanel.section,
#directionalPanel.section {
  position: relative;
  z-index: 1;
}

.hero {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.98), rgba(255, 244, 237, 0.9) 56%, rgba(237, 247, 248, 0.92)),
    var(--paper);
  border-bottom-color: var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 5px;
  background:
    linear-gradient(90deg, var(--wood), var(--lemon), var(--mist-blue), var(--lavender-gray), var(--peach));
  border-radius: 999px;
  opacity: 0.7;
}

.hero::after {
  content: "五彩和尚色系";
  position: absolute;
  right: 128px;
  bottom: 13px;
  display: none;
  color: #8f6c5e;
  font-size: 11px;
  font-weight: 900;
}

.species-switch-button {
  color: #806d52;
  background: rgba(255, 248, 207, 0.9);
  border-color: rgba(185, 134, 90, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.species-switch-button.active {
  color: #fffdf8;
  background: linear-gradient(180deg, #9baa78, #788b63);
}

.brand-mark {
  background:
    linear-gradient(180deg, #fffdf8, #fff2e8);
  border-color: rgba(217, 199, 187, 0.82);
  box-shadow: 0 9px 24px rgba(185, 134, 90, 0.16);
}

.hero h1 {
  color: #322927;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hero-summary {
  color: #746966;
}

.hero-badges span {
  color: #7a6950;
  background: rgba(255, 253, 248, 0.72);
  border-color: rgba(217, 199, 187, 0.82);
}

.hero-badges span:first-child {
  color: #5f7555;
  background: rgba(242, 246, 223, 0.9);
}

.hero-badges span:nth-child(2) {
  color: #9a6559;
  background: rgba(255, 240, 234, 0.88);
}

.species-photo-button {
  position: relative;
  overflow: hidden;
  background: #fffdf8;
  border: 1px solid rgba(217, 199, 187, 0.88);
  box-shadow: 0 12px 24px rgba(132, 105, 88, 0.12);
}

.species-photo-button::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 3px;
  background: linear-gradient(90deg, var(--lemon), var(--mist-blue), var(--lavender-gray));
  border-radius: 999px;
  opacity: 0.8;
}

.hero-species-photo {
  width: 100%;
  height: 112px;
  min-height: 112px;
  object-fit: cover;
  object-position: 50% 35%;
  border: 0;
  filter: saturate(1.04) brightness(1.04);
}

.help-card {
  background: rgba(255, 253, 248, 0.72);
  border-color: rgba(217, 199, 187, 0.78);
}

.help-card .hero-contact {
  color: #956c5f;
}

.tabs {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 248, 241, 0.96));
  border-bottom-color: var(--line);
}

.tabs button {
  color: #7f7773;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 247, 239, 0.92));
  border-color: rgba(217, 199, 187, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.tabs button:nth-child(3n + 1) {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 207, 0.5));
}

.tabs button:nth-child(3n + 2) {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(237, 247, 248, 0.7));
}

.tabs button:nth-child(3n) {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(243, 240, 245, 0.78));
}

.tabs button:hover {
  color: #5f7555;
  background: var(--brand-soft);
  border-color: rgba(143, 159, 121, 0.48);
}

.tabs button.active {
  color: #fffdf8;
  background: linear-gradient(180deg, #e9a28f, #c97867);
  border-color: rgba(190, 111, 94, 0.82);
  box-shadow: 0 11px 24px rgba(201, 120, 103, 0.2);
}

.panel,
#genePanel.section,
#basicPanel.section,
#precisePanel.section,
#bestPanel.section,
#directionalPanel.section {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 245, 0.98));
}

.eyebrow,
.panel .eyebrow,
.page-title-block .eyebrow {
  color: #a77b60;
}

.panel h2,
.help-card h2,
#genePanel .page-title,
#basicPanel .page-title,
#precisePanel .page-title,
#bestPanel .page-title,
#directionalPanel .page-title {
  color: #332a28;
}

.section-heading {
  position: relative;
}

.section-heading::after {
  content: "";
  width: 74px;
  height: 4px;
  margin-top: 3px;
  background: linear-gradient(90deg, var(--lemon), var(--mist-blue), var(--peach));
  border-radius: 999px;
}

.guide-note,
.phenotype-card,
.parent-card,
.tips-inline,
.gene-summary-card,
.parent-selector,
.parent-phenotype-selector,
.directional-selector-card,
.directional-filter-section,
.result-filter-section,
.results-section,
.gene-result-group,
.precise-analysis-panel,
.offspring-constraint,
.best-empty,
.pair-detail-summary div,
.pair-origin-box,
.progress-section {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 250, 246, 0.96));
  border-color: rgba(217, 199, 187, 0.82);
  box-shadow: var(--shadow-soft);
}

.guide-note h3,
.tips-title-centered,
#genePanel .tips-title-centered,
#basicPanel .tips-title-centered,
#precisePanel .tips-title-centered,
#bestPanel .tips-title-centered,
.best-list-header h3,
.directional-filter-section h3,
.gene-result-block-title,
.phenotype-input-group label,
.field-label,
#precisePanel .phenotype-input-group label {
  color: #6e805a;
}

input,
select,
#precisePanel input {
  background: rgba(255, 253, 248, 0.98);
  border-color: rgba(217, 199, 187, 0.95);
  box-shadow: 0 7px 16px rgba(132, 105, 88, 0.08);
}

input:focus,
select:focus,
#precisePanel input:focus {
  border-color: var(--peach);
  outline-color: rgba(233, 162, 143, 0.2);
}

.directional-clear-chip,
#precisePanel .directional-clear-chip {
  color: #9a7e72;
  background: rgba(255, 240, 234, 0.8);
  border-color: rgba(217, 199, 187, 0.88);
}

.search-dropdown {
  background: #fffdf8;
  border-color: rgba(217, 199, 187, 0.94);
}

.search-option {
  border-bottom-color: rgba(234, 223, 214, 0.82);
}

.search-option:hover,
.search-option.active {
  background: var(--peach-soft);
}

.phenotype-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 239, 0.94));
}

.phenotype-card::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 6px;
  background: linear-gradient(90deg, var(--lemon), var(--mist-blue));
  border-radius: 999px;
  opacity: 0.55;
}

.phenotype-card[data-phenotype-card*="五彩"] {
  order: -30;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 234, 0.98) 48%, rgba(237, 247, 248, 0.7));
  border-color: rgba(233, 162, 143, 0.58);
  box-shadow: 0 14px 32px rgba(201, 120, 103, 0.12);
}

.phenotype-card[data-phenotype-card^="五彩和尚"] {
  order: -48;
}

.phenotype-card[data-phenotype-card^="清淡五彩和尚"] {
  order: -47;
}

.phenotype-card[data-phenotype-card^="清淡紫五彩"],
.phenotype-card[data-phenotype-card^="紫五彩"] {
  order: -46;
}

.phenotype-card[data-phenotype-card^="清淡莫夫五彩"],
.phenotype-card[data-phenotype-card^="莫夫五彩"] {
  order: -45;
}

.phenotype-card[data-phenotype-card*="五彩"]::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 34px;
  height: 7px;
  background: rgba(255, 240, 234, 0.9);
  border: 1px solid rgba(233, 162, 143, 0.44);
  border-radius: 999px;
}

.phenotype-photo-button {
  background:
    linear-gradient(135deg, var(--lemon-soft), var(--mist-blue-soft));
  border-color: rgba(217, 199, 187, 0.88);
}

.guide-phenotype-image,
.image-fallback {
  filter: saturate(1.03) brightness(1.03);
}

.phenotype-card strong {
  color: #342a28;
}

.thumb {
  background: #fffdf8;
}

.thumb.active {
  border-color: var(--peach);
  box-shadow: 0 0 0 2px rgba(233, 162, 143, 0.18);
}

.tips-inline,
#genePanel .tips-inline,
#basicPanel .tips-inline,
#precisePanel .tips-inline,
#bestPanel .tips-inline,
.empty-state,
.no-results,
.gene-result-empty {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(237, 247, 248, 0.48));
  border-color: rgba(217, 199, 187, 0.82);
}

.parent-selector,
.parent-phenotype-selector,
#precisePanel .parent-phenotype-selector {
  background:
    linear-gradient(180deg, #fffdf8, #fff9f0);
}

.parent-symbol {
  border-bottom-color: rgba(217, 199, 187, 0.82);
}

.male-symbol,
.sex-male {
  color: #6c91a7;
}

.female-symbol,
.sex-female {
  color: #c9788e;
}

.pairing-parent-sex-badge.male {
  color: #5d849b;
  background: var(--mist-blue-soft);
}

.pairing-parent-sex-badge.female {
  color: #b96d80;
  background: var(--peach-soft);
}

.phenotype-display,
.gene-summary-parent,
.result-filter-section,
.gene-summary-box,
.precise-fold,
#precisePanel .precise-parent-fold {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 248, 207, 0.28));
  border-color: rgba(217, 199, 187, 0.82);
}

.phenotype-display.active,
.gene-preview-line,
.precise-card-count {
  color: #738356;
  background: linear-gradient(180deg, rgba(242, 246, 223, 0.9), rgba(255, 248, 207, 0.55));
  border-color: rgba(143, 159, 121, 0.24);
}

.calculate-btn,
.primary {
  color: #fffdf8;
  background: linear-gradient(180deg, #eca891, #c97867);
  border-color: #c97867;
  box-shadow: 0 12px 24px rgba(201, 120, 103, 0.26);
}

.records-btn,
.add-parent-btn,
.advanced-filter-btn,
.pair-detail-back,
.directional-parent-trace-btn {
  color: #fffdf8;
  background: linear-gradient(180deg, #9baa78, #73865f);
  border-color: #73865f;
  box-shadow: 0 10px 22px rgba(115, 134, 95, 0.18);
}

.clear-btn,
.swap-btn,
.secondary,
.icon-only {
  color: #8a705f;
  background: rgba(255, 253, 248, 0.96);
  border-color: rgba(217, 199, 187, 0.95);
}

.results {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(237, 247, 248, 0.42));
  border-color: rgba(217, 199, 187, 0.82);
}

.results-title-main {
  color: #342a28;
}

.results-table-container {
  border-color: rgba(217, 199, 187, 0.82);
}

.results-table {
  background: #fffdf8;
}

.results-table th {
  color: #75664f;
  background: linear-gradient(180deg, var(--lemon-soft), rgba(237, 247, 248, 0.85));
}

.results-table th,
.results-table td {
  border-bottom-color: rgba(234, 223, 214, 0.86);
}

.gene-result-group.male {
  border-top-color: #98c2d1;
}

.gene-result-group.female {
  border-top-color: #e7a4b1;
}

.gene-result-group-header {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 207, 0.34));
  border-bottom-color: rgba(217, 199, 187, 0.82);
}

.probability-value {
  color: #75664f;
  background: linear-gradient(180deg, #fff7c7, #f6efad);
  border-color: rgba(185, 134, 90, 0.2);
}

code,
.genotype-code,
.pairing-card-phenotype-detail .genotype-code,
.gene-line .genotype-code,
.genotype-cell .genotype-code {
  color: #4f4b55;
  background: rgba(243, 240, 245, 0.82);
  border-color: rgba(185, 180, 194, 0.44);
}

.progress-fill {
  background: linear-gradient(90deg, var(--lemon), var(--mist-blue), var(--peach));
}

@media (max-width: 370px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .hero-species-photo {
    height: 92px;
    min-height: 92px;
  }
}

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 280px;
    min-height: 190px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-summary {
    max-width: 520px;
  }

  .hero::after {
    display: block;
  }

  .hero-species-photo {
    height: 144px;
    min-height: 144px;
  }

  .help-card {
    background: rgba(255, 253, 248, 0.82);
  }

  .guide-layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .phenotype-grid {
    grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  }

  .phenotype-card[data-phenotype-card*="五彩"] {
    grid-row: span 2;
  }

  .phenotype-card[data-phenotype-card*="五彩"] .phenotype-photo-button {
    aspect-ratio: 1 / 1.12;
  }
}

@media (max-width: 760px) {
  #directionalPanel .results-table-container {
    width: 100%;
    overflow-x: visible;
  }

  #directionalPanel .results-table {
    display: block;
    width: 100%;
    min-width: 0;
    background: transparent;
    border-collapse: separate;
    border-spacing: 0;
  }

  #directionalPanel .results-table thead {
    display: none;
  }

  #directionalPanel .results-table tbody {
    display: grid;
    width: 100%;
    gap: 10px;
  }

  #directionalPanel .results-table tr {
    position: relative;
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 14px 12px 12px;
    background: #fffdf8;
    border: 1px solid rgba(217, 199, 187, 0.82);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(112, 93, 78, 0.08);
  }

  #directionalPanel .results-table td {
    display: block !important;
    width: 100%;
    min-width: 0;
    grid-template-columns: none !important;
    padding: 0;
    border-bottom: 0;
    text-align: left;
  }

  #directionalPanel .results-table td::before {
    display: block;
    margin-bottom: 5px;
    content: attr(data-label);
    color: #7b6b58;
    font-size: 11.5px;
    font-weight: 900;
    line-height: 1.2;
  }

  #directionalPanel .directional-table td[data-label="序号"] {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    min-width: 28px;
    padding: 3px 8px;
    color: #75664f;
    background: #fff6c7;
    border: 1px solid rgba(185, 134, 90, 0.18);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
  }

  #directionalPanel .directional-table td[data-label="序号"]::before {
    display: none;
  }

  #directionalPanel .results-table .phenotype-cell-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    width: 100%;
    gap: 8px;
  }

  #directionalPanel .directional-table .phenotype-cell-inner {
    padding-right: 42px;
  }

  #directionalPanel .results-table .phenotype-detail {
    grid-column: 2;
  }

  #directionalPanel .results-table .genotype-cell code,
  #directionalPanel .results-table .genotype-code {
    display: block;
    width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  #directionalPanel .results-table .probability-value {
    display: inline-flex;
    justify-content: center;
    width: min(100%, 220px);
  }
}
