/* NMR interactive prototype — wider layout than main site */

.nmr-lab {
  max-width: 1280px;
}

.nmr-lab .chat-panel + .chat-panel {
  margin-top: 1.25rem;
}

.nmr-lab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin: 1rem 0;
}

.nmr-lab-toolbar label {
  flex: 1 1 280px;
  font-size: 0.85rem;
  color: var(--muted);
}

.nmr-lab-toolbar input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--bg);
}

.nmr-lab-status {
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.4em;
  margin-bottom: 0.75rem;
}

.nmr-lab-status.error {
  color: var(--error-text);
}

.nmr-mapnum-contract {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.84rem;
  line-height: 1.5;
}

.nmr-mapnum-contract strong {
  color: #b45309;
}

.nmr-mapnum-contract code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.nmr-lab-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.68fr) minmax(420px, 1.42fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .nmr-lab-grid {
    grid-template-columns: 1fr;
  }
}

.nmr-lab-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.nmr-lab-card-head {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nmr-lab-card-body {
  padding: 0.5rem;
}

.nmr-head-note {
  margin-left: 0.6rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.nmr-mol-viewport-wrap {
  position: relative;
}

#mol-viewport {
  width: 100%;
  height: 280px;
  position: relative;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}

.nmr-clear-select {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.nmr-clear-select:hover {
  background: #fff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.nmr-result-actions {
  margin-top: 0.35rem;
  padding: 0 0.1rem;
}

.nmr-result-actions .btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.nmr-x-axis-label {
  text-align: center;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: #64748b;
  font-family: "DM Sans", sans-serif;
}

.nmr-x-axis-label i {
  font-style: italic;
}

.nmr-lab-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.nmr-groups-table-wrap {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.nmr-groups-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.nmr-groups-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.nmr-groups-table tbody td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.nmr-groups-table tbody tr:last-child td {
  border-bottom: 0;
}

.nmr-groups-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.nmr-groups-row:hover,
.nmr-groups-row.hover {
  background: #f1f5f9;
}

.nmr-groups-row.active {
  background: #fef3c7;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.nmr-groups-row.partner {
  background: #f3e8ff;
  box-shadow: inset 3px 0 0 #7c3aed;
}

.nmr-groups-row.active.partner {
  background: linear-gradient(90deg, #fef3c7 0%, #f3e8ff 100%);
  box-shadow: inset 3px 0 0 #f59e0b, inset -3px 0 0 #7c3aed;
}

.nmr-groups-table .nmr-nuc {
  color: var(--muted);
  font-size: 0.72rem;
  margin-right: 0.15rem;
}

.nmr-groups-table .nmr-num {
  font-family: var(--mono);
  white-space: nowrap;
}

.nmr-groups-table .nmr-j {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: #475569;
  line-height: 1.55;
}

.nmr-j-partner {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #7c3aed;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.nmr-j-partner:hover {
  color: #5b21b6;
}

.nmr-j-sep {
  color: #94a3b8;
}

.nmr-spectrum-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nmr-uplot-host {
  width: 100%;
  min-height: 300px;
  position: relative;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}

.nmr-uplot-host .uplot {
  font-family: var(--font);
}

.nmr-uplot-host .u-legend {
  display: none !important;
}

.nmr-uplot-host .u-cursor-pt {
  display: none !important;
}

.nmr-uplot-host .u-axis .u-label {
  font-style: italic;
}

.nmr-uplot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.nmr-spectrum-canvas {
  display: none;
}

.nmr-selection-info {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.55;
}

.nmr-selection-info strong {
  color: var(--accent);
}

.nmr-selection-info.empty {
  color: var(--muted);
}

.nmr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.nmr-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nmr-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.nmr-legend .dot-h {
  background: #2563eb;
}

.nmr-legend .dot-c {
  background: #059669;
}

.nmr-legend .dot-atom {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.nmr-legend .dot-partner {
  background: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

.nmr-legend .dot-curve {
  background: #8b0000;
}

/* ── 生产页（nmr-predict）嵌入：更宽布局 + 下载菜单 ── */
#nmr-main {
  max-width: 1200px;
}

.nmr-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nmr-download {
  position: relative;
  flex: 0 0 auto;
}

.nmr-download-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* [hidden] 默认 display:none 会被上面的 display:flex 覆盖，这里显式收起。 */
.nmr-download-menu[hidden] {
  display: none;
}

.nmr-download-menu button {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.nmr-download-menu button:hover {
  background: #f1f5f9;
}
