/* SERtool fstran page-specific styles */

.container { width: 100%; max-width: 960px; margin: 40px auto; padding: 0 20px; flex: 1; }

.page-header {
  text-align: center;
  margin: 0 auto 32px;
  padding: 28px 24px;
  background: linear-gradient(135deg, #14304f 0%, #1c4a76 50%, #266a9c 100%);
  border-radius: 12px;
  color: white;
  box-shadow: 0 6px 20px rgba(20, 48, 79, 0.18);
  max-width: 960px;
}
.page-title {
  font-size: 26px;
  color: #ffffff;
  margin: 0 0 12px;
  font-weight: 700;
  text-shadow: 0 1px 10px rgba(0, 20, 45, 0.5);
}
.intro-text {
  text-align: left;
  max-width: 960px;
  margin: 0 auto;
  line-height: 1.7;
  font-size: 14px;
  color: #dbeafe;
  text-shadow: 0 1px 6px rgba(0, 20, 45, 0.4);
}

.search-section {
  background: #ffffff;
  padding: 28px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  max-width: 1000px;
  margin: 0 auto 32px;
}
.search-wrapper { display: flex; flex-direction: column; width: 100%; gap: 16px; }

.gene-tx-selector { display: flex; gap: 12px; align-items: stretch; }
.selector-group { flex: 1; display: flex; flex-direction: column; gap: 4px; position: relative; }
.selector-label { font-size: 12px; font-weight: 600; color: #4a5569; padding-left: 4px; letter-spacing: 0.02em; }
.selector-input, .selector-select {
  padding: 12px 16px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  color: #2d3748;
}
.selector-input:focus, .selector-select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}
.selector-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.selector-select:disabled { background-color: #f1f5f9; color: #a0aec0; cursor: not-allowed; }

.gene-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: none;
}
.gene-suggestions.active { display: block; }
.gene-suggestion-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  color: #334155;
}
.gene-suggestion-item:hover, .gene-suggestion-item.highlighted { background-color: #ebf4ff; color: #1a365d; font-weight: 600; }
.gene-suggestion-item .match-highlight { color: #3182ce; font-weight: 700; }

.hgvs-input-row { display: flex; gap: 0; box-shadow: 0 4px 14px rgba(0, 25, 55, 0.06); border-radius: 8px; }
.search-input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid #cbd5e0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #2d3748;
}
.search-input:focus {
  outline: none;
  border-color: #3182ce;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 3px rgba(49, 130, 206, 0.08);
}
.search-btn {
  background: #1a365d;
  color: white;
  border: 1px solid #1a365d;
  padding: 14px 32px;
  border-radius: 0 8px 8px 0;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}
.search-btn:hover:not(:disabled) { background: #2c5282; border-color: #2c5282; }
.search-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.search-examples { text-align: center; margin-top: 4px; color: #718096; font-size: 13px; }
.search-examples span {
  margin: 0 4px;
  background-color: #ebf8ff;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: monospace;
  color: #2c5282;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-block;
  border: 1px solid #bee3f8;
}
.search-examples span:hover { background-color: #bee3f8; color: #1a365d; }

/* ========== 结果区域 ========== */
#results { margin-top: 24px; display: none; }
#results.force-visible { display: block !important; }
.results-frame {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.results-header {
  padding: 16px 24px;
  background: linear-gradient(135deg, #14304f 0%, #1c4a76 60%, #266a9c 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.results-table-container { padding: 0; overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; font-size: 14px; background: white; table-layout: fixed; }
.results-table td.field-label {
  width: 20%;
  background-color: #f8fafc;
  font-weight: 600;
  color: #1e293b;
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
  text-align: left;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.results-table td:nth-child(2) {
  width: 80%;
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
  color: #334155;
  word-wrap: break-word;
  word-break: break-all;
  white-space: normal;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background-color: #f8fafc; }
.results-table tr:hover td.field-label { background-color: #f1f5f9; }

.sequence-value {
  font-family: 'Monaco','Menlo','Courier New',monospace;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
  white-space: pre-wrap;
  background-color: #f8fafc;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #edf2f7;
}
.diff-wildtype { background-color: #dcfce7; color: #166534; font-weight: 600; padding: 0 2px; border-radius: 2px; }
.diff-mutant { background-color: #fee2e2; color: #991b1b; font-weight: 600; padding: 0 2px; border-radius: 2px; }
.compare-row { display: flex; flex-direction: column; gap: 12px; }
.compare-item {
  border-left: 3px solid;
  padding-left: 12px;
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px 10px 14px;
}
.compare-item.wild { border-left-color: #22c55e; }
.compare-item.mutant { border-left-color: #ef4444; }
.compare-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.02em; }
.compare-label.wild { color: #166534; }
.compare-label.mutant { color: #991b1b; }
.compare-sequence {
  font-family: 'Monaco','Menlo','Courier New',monospace;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
  white-space: pre-wrap;
  color: #1e293b;
}

.nmd-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nmd-tag.nmder1 { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.nmd-tag.nmder2 { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.nmd-tag.nmder3 { background-color: #fed7aa; color: #9a3412; border: 1px solid #fdba74; }
.nmd-tag.nmd    { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.nmd-tag.noptc  { background-color: #e2e3e5; color: #4b5563; border: 1px solid #d1d5db; }
.nmd-desc { display: inline; margin-left: 8px; font-size: 12px; color: #64748b; line-height: 1.5; }

.vcf-info-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.vcf-info-item {
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12.5px;
  border: 1px solid #e2e8f0;
  color: #334155;
}
.vcf-info-item strong { color: #475569; }

.gene-name {
  display: inline-block;
  background: #e0e7ff;
  color: #1e40af;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid #c7d2fe;
}
.hgvs-value {
  font-family: 'Monaco','Menlo','Courier New',monospace;
  font-size: 13px;
  word-break: break-all;
  background: #f8fafc;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #edf2f7;
  color: #2d3748;
}

.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: #2b6cb0;
  font-weight: 500;
  background: #f8fafc;
}
.results-error {
  color: #c53030;
  padding: 18px 20px;
  background-color: #fff5f5;
  border-radius: 8px;
  margin: 16px;
  border: 1px solid #feb2b2;
  border-left: 4px solid #e53e3e;
  text-align: center;
  font-size: 14px;
  white-space: pre-wrap;
}
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.9s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {

  .container { margin: 24px auto; padding: 0 12px; }
  .page-header { padding: 20px 16px; margin-bottom: 20px; }
  .intro-text { font-size: 13px; }

  .search-section { padding: 20px 16px; margin-bottom: 20px; }
  .gene-tx-selector { flex-direction: column; gap: 10px; }
  .hgvs-input-row { flex-direction: column; gap: 0; box-shadow: none; }
  .search-input { border-radius: 8px; border-right: 1px solid #cbd5e0; margin-bottom: 8px; box-shadow: 0 4px 14px rgba(0, 25, 55, 0.06); }
  .search-btn { border-radius: 8px; width: 100%; box-shadow: 0 4px 14px rgba(0, 25, 55, 0.1); }
  .search-examples { font-size: 12px; }
  .search-examples span { padding: 3px 8px; font-size: 11px; }

  .results-table td.field-label, .results-table td:nth-child(2) { padding: 10px 12px; word-break: break-word; }
  .results-table td.field-label { font-size: 12.5px; }

}

@media (max-width: 480px) {
  .vcf-info-grid { flex-direction: column; gap: 6px; }
  .vcf-info-item { display: inline-block; }
  .compare-item { padding: 8px 10px 8px 12px; }
  .compare-sequence { font-size: 11.5px; }
}
  
