:root {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-dark: #0d1b2a;
  --bg-panel: #10263f;
  --ink: #10233a;
  --ink-soft: #41566f;
  --muted: #6d7d91;
  --line: #d7e1ec;
  --line-strong: #b6c7da;
  --brand: #0f4c81;
  --brand-strong: #0a395f;
  --brand-soft: #e8f1f9;
  --accent: #0d9488;
  --accent-soft: #e6f7f5;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --shadow-sm: 0 10px 24px rgba(16, 35, 58, 0.06);
  --shadow-md: 0 18px 42px rgba(16, 35, 58, 0.1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font-body: "Source Han Sans SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "Source Han Serif SC", "Songti SC", "Noto Serif SC", Georgia, serif;
}

html {
  font-size: 14px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(15, 76, 129, 0.08), transparent 28%),
    linear-gradient(180deg, #f9fbfd 0%, #f4f7fb 100%);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
}

.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #1f669f 100%);
  border-color: transparent;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
  border-color: transparent;
}

.btn-outline-light,
.btn-ghost-light {
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.btn-outline-light:hover,
.btn-ghost-light:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 19, 31, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__bar {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-header__brand {
  flex: 0 0 auto;
}

.site-header__brand-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: #ffffff;
}

.site-header__brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1b6ca8 0%, #0d9488 100%);
  box-shadow: 0 14px 30px rgba(13, 148, 136, 0.22);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-header__brand-text {
  display: flex;
  flex-direction: column;
}

.site-header__brand-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.site-header__brand-text small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.site-nav__link {
  color: rgba(255, 255, 255, 0.72);
  padding: 0.68rem 0.95rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.site-main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3.5rem;
}

.site-footer {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-toast {
  margin-bottom: 1rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-sm);
  background: #eefaf6;
  border: 1px solid #bbe8d3;
  color: #0a6847;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-toast__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.15rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: 1rem;
}

.auth-panel__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d8e8f7 0%, #9ed9d2 100%);
  color: var(--brand-strong);
  font-weight: 700;
}

.auth-panel__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.auth-panel__meta strong,
.auth-panel__hint {
  color: #ffffff;
  font-size: 0.9rem;
}

.auth-panel__meta small {
  color: rgba(255, 255, 255, 0.58);
}

.research-hero,
.catalog-hero,
.detail-hero {
  margin-bottom: 1.4rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 20%, rgba(22, 163, 148, 0.14), transparent 25%),
    radial-gradient(circle at 20% 25%, rgba(42, 117, 174, 0.22), transparent 25%),
    linear-gradient(135deg, #0a1624 0%, #143252 58%, #0f4c81 100%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.research-hero {
  padding: 2.4rem;
}

.catalog-hero,
.detail-hero {
  padding: 1.75rem 2rem;
}

.research-hero__grid,
.catalog-hero__content,
.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.research-hero__main,
.detail-hero__main {
  max-width: 860px;
}

.research-kicker,
.catalog-hero__eyebrow,
.detail-hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 0.9rem;
}

.research-hero__title,
.catalog-hero__title,
.detail-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.catalog-hero--compact .catalog-hero__title {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
}

.research-hero__intro,
.catalog-hero__desc,
.detail-hero__subtitle {
  margin-top: 0.9rem;
  color: rgba(255, 255, 255, 0.76);
  max-width: 880px;
}

.global-search-bar,
.catalog-hero__search {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.global-search-bar__input,
.catalog-hero__input,
.catalog-input,
.catalog-select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.95rem 1.1rem;
  color: var(--ink);
}

.global-search-bar__button {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  padding: 0 1.5rem;
  font-weight: 700;
}

.research-hero__actions,
.catalog-hero__actions,
.detail-hero__actions,
.import-form__actions,
.catalog-pagination__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.research-hero__panel,
.database-section {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.research-hero__panel {
  width: 360px;
  padding: 1.35rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.hero-panel__title,
.database-section__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.hero-panel__list,
.detail-kv-stack,
.note-stack,
.search-result-list,
.sidebar-link-list {
  display: grid;
  gap: 0.85rem;
}

.hero-panel__row,
.detail-kv-stack__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
}

.metrics-grid,
.import-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.metric-card {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.metric-card--accent {
  background: linear-gradient(135deg, var(--brand-soft) 0%, #edf7f4 100%);
}

.metric-card__label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.metric-card__value {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--brand-strong);
  margin: 0.4rem 0;
}

.metric-card__hint {
  color: var(--ink-soft);
}

.dashboard-grid,
.detail-layout,
.catalog-shell,
.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 1.25rem;
}

.catalog-shell {
  grid-template-columns: 320px minmax(0, 1fr);
}

.database-section {
  padding: 1.35rem;
  margin-bottom: 1.1rem;
}

.database-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.database-section__desc,
.catalog-help,
.timeline-item__subtitle,
.species-record__latin,
.species-spotlight__latin,
.search-result-list__sub {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-link {
  font-size: 0.92rem;
  font-weight: 600;
}

.timeline-list,
.data-list,
.related-compound-table,
.species-record-list,
.compound-record-list {
  display: grid;
  gap: 0.95rem;
}

.timeline-item,
.data-list__row,
.related-compound-table__row,
.species-record,
.compound-record,
.species-spotlight,
.species-search-card,
.search-result-list__item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.timeline-item:hover,
.data-list__row:hover,
.related-compound-table__row:hover,
.species-record:hover,
.compound-record:hover,
.species-spotlight:hover,
.species-search-card:hover,
.search-result-list__item:hover {
  transform: translateY(-2px);
  border-color: #a7c1da;
  box-shadow: var(--shadow-sm);
}

.timeline-item,
.data-list__row,
.related-compound-table__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.05rem;
}

/* 窄屏下三列排不开，改为纵向堆叠，否则超长化合物名会把行撑出屏幕 */
@media (max-width: 560px) {
  .timeline-item,
  .data-list__row,
  .related-compound-table__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }
}

.data-list__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.data-list__extra,
.timeline-item__time,
.search-result-list__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline-item__badge,
.meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 600;
}

.meta-chip--soft {
  background: #eef3f8;
}

.meta-chip--accent {
  background: var(--accent-soft);
  color: #0f766e;
}

.species-spotlight-list,
.species-search-grid {
  display: grid;
  gap: 0.9rem;
}

.species-spotlight,
.species-search-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  padding: 0.95rem;
}

.species-spotlight__thumb,
.species-search-card__thumb,
.species-record__thumb {
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #edf4fa 0%, #dbe9f6 100%);
}

.species-spotlight__thumb img,
.species-search-card__thumb img,
.species-record__thumb img,
.detail-figure__image,
.spectrum-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.species-record {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.1rem;
  padding: 1rem;
}

.species-record__thumb {
  min-height: 160px;
}

.species-record__placeholder,
.species-spotlight__placeholder,
.species-search-card__placeholder,
.detail-figure__placeholder,
.spectrum-card__placeholder {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--muted);
  font-weight: 600;
  background: linear-gradient(135deg, #eef3f8 0%, #dde7f2 100%);
}

.species-record__header,
.compound-record__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.species-record__title,
.compound-record__title,
.timeline-item__title,
.data-list__title,
.related-compound-table__title,
.species-spotlight__title,
.species-search-card__title,
.search-result-list__title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
}

.species-record__meta,
.detail-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.latin-name,
.species-record__latin,
.species-search-card__latin {
  font-style: italic;
}

.species-record__actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.compound-record {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
}

.compound-record__main {
  flex: 1;
}

.compound-record__grid,
.detail-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.compound-metric,
.detail-kv {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #f6f9fc;
  border: 1px solid #e4ebf3;
}

.compound-metric span,
.detail-kv span,
.detail-kv-stack__item span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.compound-record__activity,
.timeline-item__summary,
.species-spotlight__desc {
  margin-top: 0.9rem;
  color: var(--ink-soft);
}

.detail-figure {
  border-radius: 18px;
  overflow: hidden;
  min-height: 280px;
  background: #f6f9fc;
  border: 1px solid #e3ebf2;
}

.detail-figure--wide {
  min-height: 360px;
}

.detail-figure__anchor {
  display: block;
  height: 100%;
}

.spectrum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.spectrum-card {
  padding: 1rem;
}

.spectrum-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.spectrum-card__header h3,
.feedback-panel h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.spectrum-card__links {
  display: flex;
  gap: 0.9rem;
  font-size: 0.88rem;
}

.spectrum-card__figure {
  min-height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #f6f9fc;
}

.note-stack__item {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: #f8fbfd;
  border: 1px solid #e6edf4;
}

.note-stack__item strong {
  display: block;
  margin-bottom: 0.5rem;
}

.sidebar-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  color: var(--ink);
  background: #f9fbfd;
  border: 1px solid #e7edf4;
}

.sidebar-link.is-active {
  border-color: #8eb4d8;
  background: linear-gradient(135deg, #eef5fb 0%, #f4fbfa 100%);
}

.sidebar-link small,
.catalog-pagination__page,
.catalog-pagination__info {
  color: var(--muted);
}

.catalog-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(220px, 0.8fr) auto;
  gap: 1rem;
  align-items: end;
}

.catalog-filter-grid__item--wide {
  grid-column: span 1;
}

.catalog-filter-grid__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.catalog-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.empty-panel,
.status-banner,
.feedback-panel {
  padding: 1rem 1.1rem;
  border-radius: 16px;
}

.empty-panel {
  background: #f8fbfd;
  border: 1px dashed #cfdbe8;
}

.status-banner {
  margin-bottom: 1rem;
  background: #edf6ff;
  border: 1px solid #c9def3;
  color: var(--brand-strong);
}

.feedback-panel {
  margin-top: 1rem;
  background: #f7fbff;
  border: 1px solid #d5e5f3;
}

.feedback-panel--danger {
  background: var(--danger-soft);
  border-color: #f3c2bf;
}

.feedback-panel ul {
  margin: 0.75rem 0 0;
}

.import-form__group {
  margin-bottom: 1rem;
}

.import-options {
  display: grid;
  gap: 0.8rem;
}

.import-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 16, 28, 0.56);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-overlay.is-active {
  display: flex;
}

.loading-overlay__card {
  width: min(420px, calc(100vw - 2rem));
  padding: 1.6rem;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.loading-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 4px solid #d8e5f1;
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

.loading-overlay__title {
  font-size: 1.15rem;
  font-weight: 700;
}

.loading-overlay__text {
  margin: 0.65rem 0 0;
  color: var(--muted);
}

.wrap-anywhere {
  word-break: break-word;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1200px) {
  .metrics-grid,
  .import-result-grid,
  .dashboard-grid,
  .detail-layout,
  .catalog-shell,
  .import-layout {
    grid-template-columns: 1fr;
  }

  .catalog-shell__sidebar {
    order: 2;
  }
}

@media (max-width: 960px) {
  .site-header__bar,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav,
  .auth-panel {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .global-search-bar,
  .catalog-hero__search,
  .catalog-filter-grid,
  .compound-record__grid,
  .detail-kv-grid,
  .spectrum-grid,
  .metrics-grid,
  .import-result-grid {
    grid-template-columns: 1fr;
  }

  .species-record,
  .species-spotlight,
  .species-search-card,
  .research-hero__grid,
  .catalog-hero__content,
  .detail-hero {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .compound-record,
  .species-record__header {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-main {
    padding: 1rem 1rem 2.5rem;
  }

  .research-hero,
  .catalog-hero,
  .detail-hero {
    padding: 1.35rem;
  }

  .database-section {
    padding: 1rem;
  }
}

/* Legacy-inspired scientific theme */

.site-body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(67, 111, 181, 0.12), transparent 22%),
    radial-gradient(circle at 78% 12%, rgba(60, 167, 189, 0.08), transparent 20%),
    linear-gradient(180deg, #edf3f9 0%, #f7fafc 46%, #f2f7fb 100%);
}

.site-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("/img/nature-background.png") center top / cover no-repeat;
  opacity: 0.035;
  pointer-events: none;
  z-index: -2;
}

.site-body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1), transparent 35%);
  pointer-events: none;
  z-index: -1;
}

.site-body--showcase {
  background:
    radial-gradient(circle at 14% 12%, rgba(31, 78, 160, 0.14), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(13, 148, 136, 0.1), transparent 22%),
    linear-gradient(180deg, #e9f0f7 0%, #f6f9fc 42%, #eef4fa 100%);
}

.site-shell {
  position: relative;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

.modern-navbar {
  padding: 0.95rem 1.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 252, 0.96) 50%, rgba(241, 245, 249, 0.94) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(79, 172, 254, 0.24);
  box-shadow: 0 10px 28px rgba(32, 74, 135, 0.08);
}

.modern-navbar__inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.modern-navbar__nav-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: flex-end;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
  color: var(--ink);
}

.brand-container:hover {
  color: var(--brand-strong);
}

.brand-container__logo {
  position: relative;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-container__logo-image {
  width: 46px;
  height: 46px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.brand-container__glow {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(64, 166, 134, 0.2) 0%, rgba(64, 166, 134, 0.02) 70%, transparent 100%);
  animation: brandGlow 4.4s ease-in-out infinite;
}

.brand-container__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.brand-container__text strong {
  font-size: 1rem;
  line-height: 1.2;
}

.brand-container__text small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0;
}

.site-nav__link {
  color: rgba(16, 35, 58, 0.72);
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  transition: all 0.25s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: #17477a;
  background: rgba(79, 172, 254, 0.12);
  box-shadow: inset 0 0 0 1px rgba(79, 172, 254, 0.14);
}

.auth-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.25rem;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(148, 163, 184, 0.26);
}

.auth-panel__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dcecf8 0%, #c4efe6 100%);
  color: #13446d;
  box-shadow: 0 8px 16px rgba(20, 68, 109, 0.08);
}

.auth-panel__meta strong,
.auth-panel__hint {
  color: var(--ink);
}

.auth-panel__meta small {
  color: var(--muted);
}

.site-main {
  max-width: 1480px;
  padding: 1.6rem 1.5rem 3rem;
}

.site-toast {
  background: linear-gradient(135deg, #eef9f6 0%, #f7fffd 100%);
  border-color: #bfe7da;
}

.site-footer {
  padding-top: 0.6rem;
  align-items: center;
  /* 版权行要独占最后一整行，所以页脚允许换行 */
  flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-footer__brand strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.site-footer__brand span,
.site-footer__support {
  color: var(--muted);
}

.site-footer__support {
  max-width: 720px;
  text-align: right;
}

/* ── 版权 / 备案（.cnzz-link）──────────────────────────────
   全站页脚、登录注册页、错误页都用同一条，所以基础样式放在这里，
   各处只补自己的间距。窄屏两个链接会各占一行。 */
.cnzz-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 1rem;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.cnzz-link a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cnzz-link a:hover,
.cnzz-link a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

/* 页脚里独占最后一行，并用一条细线跟上面的信息分开 */
.site-footer .cnzz-link {
  width: 100%;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.scientific-hero,
.compound-hero {
  position: relative;
  margin-bottom: 1.4rem;
}

.scientific-hero__surface,
.compound-hero__surface {
  position: relative;
  overflow: hidden;
  padding: 1.3rem 2.2rem 0.72rem;
  min-height: 304px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(135deg, #1d3f85 0%, #2956a6 45%, #1f4590 100%);
  box-shadow: 0 18px 48px rgba(20, 44, 88, 0.22);
  color: #fff;
}

.scientific-hero__surface::before,
.compound-hero__surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 72% 68%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 45% 48%, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.04) 50%, transparent 52%);
  background-size: 86px 86px, 120px 120px, 58px 58px, 200px 200px;
  animation: backgroundFloat 25s ease-in-out infinite;
  opacity: 0.78;
}

/* 首页 hero 采用居中对称布局：右侧插画已移除，标题、项目说明、搜索框与
   数据指标都沿中轴排布，两侧留白相等。 */
.scientific-hero__surface {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 1.4rem;
}

.scientific-hero__institution {
  position: absolute;
  top: 0.8rem;
  right: 1.6rem;
  z-index: 4;
}

.scientific-hero__institution img {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.scientific-hero__lead,
.compound-hero__main {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1.34rem;
}

.scientific-hero__showcase {
  position: relative;
  z-index: 3;
  display: block;
  max-width: 980px;
  width: 100%;
}

.scientific-hero .scientific-hero__lead {
  justify-content: center;
}

.scientific-hero .scientific-hero__titles {
  max-width: 720px;
  text-align: center;
}

.scientific-hero__lead--compact {
  align-items: flex-start;
}

.scientific-hero__logo {
  width: 118px;
  height: 118px;
  flex: 0 0 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoFloat 6s ease-in-out infinite;
}

.scientific-hero__logo img {
  width: 106px;
  height: 106px;
  object-fit: contain;
  filter:
    drop-shadow(0 8px 24px rgba(34, 197, 94, 0.45))
    drop-shadow(0 0 26px rgba(34, 197, 94, 0.22))
    brightness(1.08);
}

.scientific-hero__logo--compact {
  width: 104px;
  height: 104px;
  flex-basis: 104px;
}

.scientific-hero__logo--compact img {
  width: 92px;
  height: 92px;
}

.scientific-hero__titles,
.compound-hero__main {
  max-width: 860px;
}

.scientific-hero__visual {
  position: relative;
  min-height: 372px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.scientific-hero__visual-glow {
  position: absolute;
  inset: 26px 24px 14px 42px;
  border-radius: 36px;
  background:
    radial-gradient(circle at 32% 26%, rgba(148, 221, 255, 0.38), transparent 34%),
    radial-gradient(circle at 72% 24%, rgba(124, 239, 222, 0.26), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  filter: blur(10px);
}

.scientific-hero__visual-panel {
  position: relative;
  width: min(100%, 420px);
  min-height: 372px;
  overflow: hidden;
  border-radius: 34px;
  padding: 0;
  background:
    radial-gradient(circle at 28% 24%, rgba(126, 209, 255, 0.22), transparent 30%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 35%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(9, 23, 49, 0.2);
}

.scientific-hero__visual-panel::before {
  content: "";
  position: absolute;
  inset: 12% 14% auto 22%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(149, 214, 255, 0.16) 32%, transparent 72%);
  filter: blur(18px);
}

.scientific-hero__visual-backdrop,
.scientific-hero__visual-grid {
  position: absolute;
  inset: 0;
}

.scientific-hero__visual-backdrop {
  background:
    linear-gradient(180deg, rgba(10, 35, 76, 0.18) 0%, rgba(6, 20, 44, 0.42) 100%),
    url("/images/home-lab-bg.jpg") center center / cover no-repeat;
  opacity: 0.58;
  transform: scale(1.08);
  filter: saturate(1.08) blur(1px);
}

.scientific-hero__visual-grid {
  background:
    linear-gradient(rgba(188, 226, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(188, 226, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.28) 68%, transparent 100%);
  opacity: 0.46;
}

.scientific-hero__visual-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(11, 29, 58, 0) 0%, rgba(10, 25, 51, 0.55) 70%, rgba(8, 18, 38, 0.76) 100%);
}

.scientific-hero__visual-photo {
  position: absolute;
  right: -8px;
  bottom: 0;
  width: min(92%, 390px);
  height: auto;
  display: block;
  object-fit: contain;
  object-position: right bottom;
  box-shadow:
    0 22px 54px rgba(8, 20, 42, 0.18),
    drop-shadow(0 12px 28px rgba(7, 18, 37, 0.22));
  filter: saturate(1.02) contrast(1.02) brightness(1.02);
}

.scientific-hero__eyebrow,
.compound-hero__eyebrow {
  font-size: 0.84rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0.84rem;
}

.scientific-hero__title,
.compound-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.14;
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 30px rgba(11, 26, 55, 0.25);
}

.scientific-hero__subtitle,
.compound-hero__subtitle {
  margin: 0.58rem 0 0;
  font-size: 0.98rem;
  color: rgba(227, 237, 255, 0.9);
  font-style: italic;
}

.scientific-hero__summary,
.compound-hero__summary {
  margin: 0.92rem 0 0;
  max-width: 760px;
  color: rgba(236, 244, 255, 0.88);
  line-height: 1.66;
}

.project-badge {
  position: relative;
  z-index: 5;
  margin-top: 1rem;
  margin-inline: auto;
  padding: 0.6rem 1.4rem;
  width: min(1180px, 100%);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 24px rgba(12, 28, 57, 0.18);
  backdrop-filter: blur(16px);
}

.project-badge--compact {
  max-width: 920px;
}

/* ── 资助声明（.fund-note）─────────────────────────────────
   首页/检索页 banner、化合物详情顶栏、全站页脚、登录注册页脚共用同一份资助信息。
   两项基金固定各占一行（不并排、不随宽度回流），也不写「支持项目」字样。
   竖排 flex 而不是普通 ul，是为了用 align-items 统一控制四处的对齐方向；
   颜色走 currentColor，外壳只要定字号、颜色和对齐即可。 */
.fund-note {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* banner 里这两行是重点信息，字号取到「compact 变体（920px）也排得下单行」的上限：
   实测 1.4rem 时第一条约 740px，离 875px 的可用宽度还有富余。
   首页要更醒目，见下面的 --lead。 */
.fund-note--hero {
  align-items: center;
  gap: 0.3rem;
  color: #fff;
  text-align: center;
  font-size: clamp(0.95rem, 1.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.26);
}

/* 首页 banner：这两行是最需要被看到的信息，再放大一档，只在首页用。
   上限卡在首页 badge 的可用宽度上 —— badge 是 width:min(1180px,100%)，
   减去左右各 1.4rem 内边距后内宽约 1141px；第一条在 1.9rem 时约 984px，
   还留着约 14% 余量，任何桌面宽度都不会折行。
   （检索页/目录页的 badge 只有 920px，排不下这个字号，所以不共用。） */
.fund-note--lead {
  gap: 0.34rem;
  font-size: clamp(1.1rem, 1.85vw, 1.9rem);
}

/* 1.1rem 的下限在平板段会追不上 badge 的收缩（badge 比视口缩得快），
   所以 960 以下换一条更缓的曲线，宽度占用稳定在八成左右，不会折行。 */
@media (max-width: 960px) {
  .fund-note--lead {
    font-size: clamp(0.95rem, 1.75vw, 1.7rem);
  }
}

/* 页脚整体右对齐（配 .site-footer__support） */
.fund-note--footer {
  align-items: flex-end;
  font-size: 0.8rem;
}

.scientific-hero__controls {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
  gap: 1.2rem;
  margin-top: 1.35rem;
}

.hero-search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-self: start;
}

.hero-search-panel--single {
  position: relative;
  z-index: 5;
  margin: 0.95rem auto 0;
  width: 100%;
  max-width: 780px;
}

.hero-search-panel__input {
  width: 100%;
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 0.95rem 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hero-search-panel__button {
  min-width: 136px;
  /* 窄屏下表单变成单列，按钮不再跟输入框同行拉伸，
     而它上下没有内边距，没有 min-height 就会塌成一行文字的高度 */
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f977f 0%, #0b7765 100%);
  color: #fff;
  padding: 0 1.4rem;
  font-weight: 700;
  box-shadow: 0 12px 22px rgba(12, 119, 101, 0.28);
}

.hero-actions {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.74rem;
}

/* 首页 hero 底部一整行：左边检索框、右边三个指标卡。
   两者都比各自独立成行时小一档，省下的高度让给上面的项目说明。
   flex-wrap 兜底：宽度不够时检索框先占满一行，指标卡整组落到下一行。 */
.hero-actionbar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  /* stretch 让检索框自动长到跟指标卡一样高，两边不用各自写死高度 */
  align-items: stretch;
  justify-content: center;
  gap: 0.6rem 1rem;
  width: 100%;
  max-width: 1000px;
  margin: 0.85rem auto 0;
}

.hero-actionbar .hero-search-panel--single {
  flex: 1 1 380px;
  align-self: stretch; /* 盖掉 .hero-search-panel 的 align-self: start */
  max-width: 560px;
  margin: 0;
  gap: 0.55rem;
}

.hero-actionbar .hero-search-panel__input {
  min-height: 48px;
  padding: 0.6rem 1rem;
  border-radius: 14px;
}

.hero-actionbar .hero-search-panel__button {
  min-width: 104px;
  min-height: 48px;
  padding: 0 1.05rem;
  border-radius: 14px;
  font-size: 0.9rem;
  box-shadow: 0 8px 16px rgba(12, 119, 101, 0.24);
}

/* 指标卡整组跟检索框等宽（两边都 flex:1 + 同一个 max-width），高度靠 stretch 对齐 */
.hero-actionbar .hero-metrics {
  flex: 1 1 380px;
  max-width: 560px;
  gap: 0.5rem;
}

/* 卡片内容整体垂直居中；读数用等宽数字避免刷新时左右跳动，
   顶部一道青色细高光 + 悬停微亮，做出仪表盘读数的观感。 */
.hero-actionbar .hero-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.04rem;
  min-height: 48px;
  padding: 0.28rem 0.5rem;
  border-radius: 12px;
  border-color: rgba(150, 220, 255, 0.26);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-actionbar .hero-metric-card::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 226, 255, 0.85), transparent);
}

.hero-actionbar .hero-metric-card:hover {
  border-color: rgba(160, 226, 255, 0.56);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 30px rgba(9, 24, 50, 0.2);
}

.hero-actionbar .hero-metric-card__value {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.hero-actionbar .hero-metric-card__hint {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(178, 227, 255, 0.86);
}

.hero-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0;
  width: 100%;
}

.hero-metric-card {
  position: relative;
  min-height: 62px;
  padding: 0.42rem 0.55rem 0.48rem;
  text-align: center;
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 48%, rgba(255, 255, 255, 0.07) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 36px rgba(9, 24, 50, 0.14);
  overflow: hidden;
  isolation: isolate;
}

.hero-metric-card::before {
  display: none;
}

.hero-metric-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -34px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(148, 220, 255, 0.16) 36%, transparent 72%);
  z-index: -1;
}

.hero-metric-card__label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.18rem 0.72rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(236, 244, 255, 0.94);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-metric-card__value {
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  font-weight: 800;
  margin: 0.16rem 0 0.02rem;
  line-height: 1.08;
  color: #ffffff;
  text-shadow: 0 8px 20px rgba(8, 18, 38, 0.18);
}

.hero-metric-card__hint {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  color: rgba(226, 236, 255, 0.76);
  letter-spacing: 0.03em;
}

.hero-note-card {
  padding: 1.2rem 1.25rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 18px 36px rgba(16, 35, 58, 0.14);
}

.hero-note-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.hero-note-card__list {
  display: grid;
  gap: 0.75rem;
}

.hero-note-card__row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--ink-soft);
}

.hero-note-card__row strong {
  color: var(--ink);
}

.hero-data-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.hero-data-strip__item {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-data-strip__item span {
  color: rgba(232, 239, 255, 0.76);
  font-size: 0.8rem;
}

.hero-data-strip__item strong {
  color: #fff;
}

.hero-data-strip__item--action {
  align-items: flex-start;
  justify-content: center;
}

.chemical-structures {
  --structure-size: 240px;
  --structure-gap: 140px;
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  gap: var(--structure-gap);
  width: max-content;
  z-index: 2;
  will-change: transform;
  animation: moveLeftContinuous 180s linear infinite;
  pointer-events: none;
}

.chemical-structures--compact {
  opacity: 0.88;
}

.structure-image {
  width: var(--structure-size);
  height: var(--structure-size);
  flex: 0 0 var(--structure-size);
  object-fit: contain;
  opacity: 0.36;
  filter: grayscale(16%) contrast(0.82);
  animation: chemicalFloat 8s ease-in-out infinite;
}

.structure-image:nth-child(2n) {
  animation-delay: 1.4s;
}

.structure-image:nth-child(3n) {
  animation-delay: 2.8s;
}

.legacy-workbench,
.detail-workbench {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.home-workbench {
  display: block;
  width: 100%;
}

.home-content {
  width: 100%;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(19, 50, 96, 0.08);
  border: 1px solid rgba(186, 200, 216, 0.45);
  overflow: hidden;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-workbench {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
}

.legacy-sidebar,
.legacy-content,
.detail-workbench__main,
.detail-workbench__side {
  min-width: 0;
}

.legacy-sidebar,
.legacy-content {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(19, 50, 96, 0.08);
  border: 1px solid rgba(186, 200, 216, 0.45);
  overflow: hidden;
}

.legacy-sidebar--home {
  display: grid;
  gap: 1rem;
  background: transparent;
  box-shadow: none;
  border: 0;
  overflow: visible;
}

.legacy-sidebar__header {
  padding: 1.4rem 1.3rem 1rem;
  border-bottom: 1px solid #e8eef5;
  background: linear-gradient(135deg, #fbfdff 0%, #f2f7fb 100%);
}

.legacy-sidebar__header h2,
.panel-card__header h2,
.panel-card__header h3,
.database-section__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.legacy-sidebar__header p,
.panel-card__header p,
.database-section__desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.sidebar-search {
  margin-top: 1rem;
}

.sidebar-search__input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #d7e3ef;
  padding: 0.82rem 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-search__input:focus {
  border-color: #74a3d4;
  box-shadow: 0 0 0 0.18rem rgba(59, 130, 246, 0.12);
  outline: none;
}

.legacy-species-list {
  display: grid;
  gap: 0;
  max-height: 980px;
  overflow-y: auto;
}

.legacy-species-list--compact {
  gap: 0.8rem;
  max-height: none;
  overflow: visible;
}

.legacy-species-list__empty {
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
}

.legacy-species-item {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.15rem;
  color: var(--ink);
  border-bottom: 1px solid rgba(229, 236, 244, 0.9);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.96) 100%);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.legacy-species-list--compact .legacy-species-item {
  border: 1px solid #e5ecf5;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(22, 47, 87, 0.05);
}

.legacy-species-item:hover,
.legacy-species-item.is-active {
  transform: translateX(4px);
  background: linear-gradient(135deg, #eef5ff 0%, #ebf7f5 100%);
  box-shadow: inset 4px 0 0 #4f93da;
}

.legacy-species-item__thumb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #edf3fb 0%, #d8e8f9 100%);
  border: 2px solid rgba(79, 147, 218, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #27507a;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.legacy-species-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.legacy-species-item__thumb--placeholder {
  border-radius: 18px;
}

.legacy-species-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.legacy-species-item__body strong {
  color: var(--ink);
}

.legacy-species-item__body small {
  color: var(--muted);
}

.legacy-species-item__body em {
  color: #5b7190;
  font-style: normal;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.legacy-content {
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.panel-card,
.database-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 252, 255, 0.98) 100%);
  border: 1px solid rgba(219, 228, 237, 0.9);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(18, 46, 84, 0.06);
  padding: 1.3rem;
}

.panel-card--flush {
  padding: 0;
  overflow: hidden;
}

.panel-card__header,
.database-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.selected-species-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #fdfefe 0%, #f2f7fb 100%);
  border: 1px solid rgba(209, 222, 235, 0.86);
  box-shadow: 0 14px 26px rgba(16, 35, 58, 0.06);
}

.selected-species-card__thumb {
  overflow: hidden;
  border-radius: 18px;
  height: 150px;
  background: linear-gradient(135deg, #edf3fb 0%, #d9e8f7 100%);
}

.selected-species-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-species-card__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5b7aa2;
  margin-bottom: 0.5rem;
}

.selected-species-card__body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  color: #204c7b;
}

.selected-species-card__body p {
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
}

.selected-species-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.selected-species-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
}

.fact-list,
.research-update-list,
.research-record-list,
.search-result-list {
  display: grid;
  gap: 0.9rem;
}

.fact-list__item,
.research-update-item,
.research-record,
.search-result-list__item {
  border-radius: 18px;
  border: 1px solid #e2e9f1;
  background: linear-gradient(135deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
}

.fact-list__item {
  padding: 1rem 1.05rem;
}

.fact-list__item strong {
  display: block;
  margin-bottom: 0.45rem;
}

.research-update-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.05rem;
}

.research-update-item__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #edf5ff 0%, #e7f7f4 100%);
  color: #24507d;
  font-weight: 700;
}

.research-update-item__title,
.research-record__title,
.research-table__title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}

.research-update-item__subtitle,
.research-record__subtitle,
.research-table__sub {
  margin-top: 0.2rem;
  color: var(--muted);
}

.research-update-item__summary,
.research-table__note {
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.research-update-item__time {
  color: var(--muted);
  font-size: 0.9rem;
}

.research-record {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.05rem;
}

.research-record__meta,
.research-record__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.research-filterbar {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(220px, 0.8fr) auto;
  gap: 1rem;
  align-items: end;
}

.research-filterbar__field--wide {
  min-width: 0;
}

.research-filterbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.research-table-wrap {
  overflow-x: auto;
}

.research-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.research-table thead th {
  padding: 1rem 1.05rem;
  background: linear-gradient(135deg, #f5f9ff 0%, #edf4fb 100%);
  color: #355e89;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid #dfe9f3;
}

.research-table tbody td {
  padding: 1rem 1.05rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
  color: var(--ink-soft);
}

.research-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(243, 248, 255, 0.75) 0%, rgba(238, 248, 246, 0.7) 100%);
}

.research-table code {
  color: #1f4f87;
  font-family: "Consolas", "Courier New", monospace;
  background: transparent;
  padding: 0;
}

.compound-hero__surface {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1.5rem;
  align-items: center;
  min-height: 380px;
}

.compound-hero__main {
  display: block;
}

.compound-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.compound-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  position: relative;
  z-index: 3;
}

.compound-hero__preview {
  position: relative;
  z-index: 3;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compound-hero__preview-frame,
.compound-hero__preview-placeholder {
  width: 100%;
  min-height: 280px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.compound-hero__preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
}

.compound-hero__preview-placeholder {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.detail-inline-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.detail-inline-metric,
.detail-kv-stack__item,
.detail-kv,
.compound-metric {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #f0f6fb 100%);
  border: 1px solid #e0e9f2;
}

.detail-inline-metric span,
.detail-kv-stack__item span,
.detail-kv span,
.compound-metric span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.detail-kv-stack {
  display: grid;
  gap: 0.85rem;
}

.detail-figure {
  min-height: 320px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef4fa 100%);
  border: 1px solid #e0e8f0;
}

.detail-figure--wide {
  min-height: 420px;
}

.detail-figure__placeholder,
.spectrum-card__placeholder {
  color: var(--muted);
  font-weight: 700;
}

.spectrum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.spectrum-card {
  border-radius: 20px;
  border: 1px solid #e2e9f1;
  background: linear-gradient(135deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
  padding: 1rem;
}

.spectrum-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.spectrum-card__header h3 {
  margin: 0;
}

.spectrum-card__links {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.88rem;
}

.spectrum-card__figure {
  min-height: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #f4f8fd 0%, #edf4fb 100%);
}

.search-result-list__item,
.species-search-card,
.species-record,
.species-spotlight,
.compound-record,
.timeline-item,
.data-list__row,
.related-compound-table__row {
  background: linear-gradient(135deg, #fbfdff 0%, #f5f9fd 100%);
  border-color: #e2e9f1;
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
}

.species-record,
.species-spotlight,
.species-search-card {
  border-radius: 20px;
}

.catalog-hero,
.detail-hero,
.research-hero {
  border-radius: 24px;
  background: linear-gradient(135deg, #1d3f85 0%, #2956a6 45%, #1f4590 100%);
}

.catalog-shell,
.dashboard-grid,
.detail-layout,
.import-layout {
  gap: 1.2rem;
}

.empty-panel {
  border-style: dashed;
  background: linear-gradient(135deg, #fbfdff 0%, #f5f9fd 100%);
}

.sidebar-link {
  border-radius: 16px;
  background: linear-gradient(135deg, #fbfdff 0%, #f6faff 100%);
}

.sidebar-link.is-active {
  background: linear-gradient(135deg, #eef5ff 0%, #eaf8f4 100%);
}

@keyframes backgroundFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.78;
  }
  33% {
    transform: translateY(-5px) rotate(1deg);
    opacity: 0.86;
  }
  66% {
    transform: translateY(5px) rotate(-1deg);
    opacity: 0.68;
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes brandGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
  }
}

@keyframes chemicalFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes moveLeftContinuous {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(calc((var(--structure-size) + var(--structure-gap)) * -8), 0, 0);
  }
}

@media (max-width: 1280px) {
  .scientific-hero__showcase {
    max-width: 920px;
  }

  .hero-data-strip,
  .detail-inline-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 指标卡已整体缩小，中等屏幕也保持一行三列 */
  .hero-metrics {
    gap: 0.5rem;
  }

  .scientific-hero__controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .legacy-workbench,
  .detail-workbench,
  .compound-hero__surface {
    grid-template-columns: 1fr;
  }

  .selected-species-card {
    grid-template-columns: 1fr;
  }

  .selected-species-card__actions {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .modern-navbar {
    padding: 0.85rem 1rem;
  }

  .modern-navbar__inner,
  .modern-navbar__nav-wrap,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__support {
    text-align: left;
  }

  .fund-note--footer {
    align-items: flex-start;
  }

  .site-nav,
  .auth-panel {
    width: 100%;
    flex-wrap: wrap;
  }

  .auth-panel {
    padding-left: 0;
    border-left: 0;
  }

  .scientific-hero__surface,
  .compound-hero__surface {
    padding: 1.15rem 1.05rem 0.78rem;
    min-height: auto;
  }

  .scientific-hero__lead,
  .scientific-hero__lead--compact {
    flex-direction: column;
    align-items: flex-start;
  }

  .scientific-hero__showcase {
    max-width: none;
  }

  .hero-actionbar {
    max-width: 560px;
    margin-top: 0.56rem;
  }

  .hero-search-panel,
  .hero-data-strip,
  .research-filterbar,
  .detail-inline-metrics,
  .spectrum-grid {
    grid-template-columns: 1fr;
  }

  /* 指标卡已经很小，窄屏也保持一行三列，避免 hero 被拉长 */
  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .research-update-item,
  .research-record {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .research-table {
    min-width: 760px;
  }

  .scientific-hero__institution {
    position: static;
    margin-bottom: 0.9rem;
  }

  .chemical-structures {
    --structure-size: 180px;
    --structure-gap: 100px;
    animation-duration: 150s;
  }
}

@media (max-width: 640px) {
  .site-main {
    padding: 1rem 1rem 2.2rem;
  }

  .scientific-hero__title,
  .compound-hero__title {
    font-size: 1.85rem;
  }

  .scientific-hero__surface,
  .compound-hero__surface {
    padding: 1rem 0.9rem 0.72rem;
  }

  .hero-actionbar {
    margin-top: 0.4rem;
  }

  /* 窄屏每条基金自己也会折行，字号只要保证读得清。
     这一档首页不再单独放大：手机上第一条无论多大都要折行，
     再加字号只会多占几行，所以跟其它页统一。 */
  .fund-note--hero {
    font-size: 1rem;
    gap: 0.24rem;
  }

  /* 卡片只剩 110px 出头，字距收一档，"STRUCTURE CLASSES" 才不会顶到边 */
  .hero-actionbar .hero-metric-card__hint {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
  }

  .legacy-content,
  .panel-card,
  .database-section {
    padding: 1rem;
  }

  .selected-species-card__thumb {
    height: 220px;
  }

  .chemical-structures {
    --structure-size: 140px;
    --structure-gap: 80px;
    animation-duration: 120s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scientific-hero__surface::before,
  .compound-hero__surface::before,
  .scientific-hero__logo,
  .brand-container__glow {
    animation: none !important;
  }
}

.upload-guide {
  border: 1px solid rgba(201, 216, 232, 0.9);
  border-radius: 20px;
  background: linear-gradient(135deg, #fbfdff 0%, #f3f8fc 100%);
  box-shadow: 0 12px 26px rgba(18, 46, 84, 0.05);
  overflow: hidden;
}

.upload-guide__header {
  padding: 1.1rem 1.2rem 0.85rem;
  border-bottom: 1px solid #e2ebf4;
}

.upload-guide__header h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.upload-guide__header p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.upload-guide__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.upload-guide__table th,
.upload-guide__table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e8eef5;
  text-align: left;
  vertical-align: top;
}

.upload-guide__table thead th {
  background: rgba(235, 243, 251, 0.72);
  color: #315b86;
  font-size: 0.85rem;
  font-weight: 700;
}

.upload-guide__table tbody tr:last-child td {
  border-bottom: 0;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #edf5ff 0%, #e8f7f3 100%);
  border: 1px solid #cfe1ef;
  color: #24507d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.file-asset-card,
.detail-file-panel {
  border-radius: 18px;
  border: 1px solid #dee8f1;
  background: linear-gradient(135deg, #fbfdff 0%, #f6faff 100%);
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
  padding: 1rem 1.05rem;
}

.file-asset-card__meta,
.detail-file-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.file-asset-card__hint,
.detail-file-panel__hint,
.spectrum-card__hint {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-asset-card__preview {
  margin-top: 0.85rem;
}

.detail-file-panel--compact {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-file-panel--standalone {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-file-panel__name {
  margin-top: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.detail-file-panel__embed {
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #f8fbff;
}

.file-asset-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
  color: var(--ink);
}

.file-asset-inline--small {
  margin-top: 0.45rem;
  font-size: 0.85rem;
}

.spectrum-card__assets {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

@media (max-width: 960px) {
  .upload-guide__table {
    min-width: 720px;
  }

  .detail-file-panel__embed {
    min-height: 320px;
  }
}

.compound-hero__preview-frame--structure-data {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(247, 243, 234, 0.98) 0%, rgba(238, 231, 216, 0.95) 100%);
}

.mol-preview {
  display: grid;
  gap: 1.25rem;
}

.detail-figure--structure,
.mol-preview--structure {
  max-width: min(100%, 860px);
  margin-inline: auto;
}

.detail-figure--structure {
  min-height: 240px;
}

.detail-figure--structure .detail-figure__image {
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
}

.detail-figure--structure .detail-file-panel__embed {
  min-height: 360px;
}

.mol-preview--structure .mol-preview__canvas {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mol-preview--structure .mol-preview__svg {
  width: 100%;
  max-height: 420px;
}

.mol-preview__canvas {
  border: 1px solid rgba(98, 74, 37, 0.14);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #faf7f0 0%, #f0e8da 100%);
  padding: 1rem;
}

.mol-preview__svg {
  width: 100%;
  height: auto;
  display: block;
}

.mol-preview__meta {
  display: grid;
  gap: 0.9rem;
}

.mol-preview__stats {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mol-preview__properties {
  display: grid;
  gap: 0.75rem;
}

.mol-preview__property {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: rgba(250, 248, 243, 0.92);
  border: 1px solid rgba(98, 74, 37, 0.1);
}

.mol-preview__property span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(74, 58, 34, 0.62);
}

.mol-preview__property strong {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #25324a;
  word-break: break-word;
}

.spectral-json-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(247, 243, 234, 0.9) 0%, rgba(240, 233, 220, 0.92) 100%);
  border: 1px solid rgba(98, 74, 37, 0.12);
}

.spectral-json-panel__header {
  display: grid;
  gap: 0.25rem;
}

.spectral-json-panel__header h3 {
  margin: 0;
  font-size: 1rem;
  color: #25324a;
}

.spectral-json-panel__header p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(37, 50, 74, 0.72);
}

.spectral-json-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.spectral-json-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(98, 74, 37, 0.1);
  box-shadow: 0 10px 24px rgba(24, 35, 52, 0.05);
}

.spectral-json-card__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #25324a;
}

.spectral-json-card__meta {
  font-size: 0.8rem;
  color: rgba(37, 50, 74, 0.64);
}

.spectral-json-card__section {
  display: grid;
  gap: 0.55rem;
}

.spectral-json-card__section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b5e1a;
}

.spectral-json-card__record {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  background: rgba(247, 243, 234, 0.82);
}

.spectral-json-card__record strong {
  font-size: 0.86rem;
  color: #25324a;
  line-height: 1.45;
}

.spectral-json-card__links {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.spectral-json-card__links a {
  color: #7a4f17;
  font-size: 0.78rem;
  text-decoration: none;
}

.spectral-json-card__links a:hover {
  text-decoration: underline;
}

.home-panel-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
}

.home-random-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
}

.home-workbench .home-panel-grid,
.home-workbench .home-random-grid {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 1rem;
  align-items: start;
}

.home-panel-grid > .panel-card,
.home-random-grid > .panel-card {
  flex: 1 1 0;
  min-width: 0;
}

.home-random-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.home-random-card > .panel-card__header,
.home-random-card > .home-random-list,
.home-random-card > .home-compound-list,
.home-random-card > .empty-panel {
  width: 100%;
}

.home-random-card > .home-random-list,
.home-random-card > .home-compound-list,
.home-random-card > .empty-panel {
  flex: 1 1 auto;
}

.home-random-list,
.home-compound-list {
  display: grid;
  gap: 0.85rem;
}

.home-random-list__item {
  border: 1px solid #e5ecf5;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(22, 47, 87, 0.05);
}

.home-compound-list__item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: center;
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid #e2e9f1;
  background: linear-gradient(135deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-compound-list__item:hover {
  transform: translateY(-2px);
  border-color: #a7c1da;
  box-shadow: 0 14px 28px rgba(18, 46, 84, 0.08);
}

.home-compound-list__thumb {
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e1e9f1;
  background:
    radial-gradient(circle at top right, rgba(39, 87, 157, 0.08), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-compound-list__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
}

.home-compound-list__structure {
  width: 100%;
  height: 100%;
}

.home-compound-list__structure .mol-preview__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.home-compound-list__placeholder {
  color: var(--muted);
  font-size: 0.85rem;
}

.home-compound-list__body {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.home-compound-list__body strong,
.home-compound-list__body small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-compound-list__body strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.45;
}

.home-compound-list__body small {
  color: var(--muted);
  font-size: 0.84rem;
}

.home-compound-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.home-marquee-card {
  margin-top: 1rem;
}

.home-spotlight {
  display: grid;
}

.home-spotlight__header {
  padding: 1.3rem 1.3rem 0.45rem;
}

.home-spotlight__layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.1fr);
  gap: 1.2rem;
  padding: 0 1.3rem 1.2rem;
  align-items: stretch;
}

.home-spotlight__media {
  min-height: 430px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #dfe8f0;
  background:
    radial-gradient(circle at top right, rgba(40, 90, 160, 0.08), transparent 28%),
    linear-gradient(180deg, #fdfefe 0%, #f3f7fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-spotlight__media-link {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.home-spotlight__media-link--structure {
  background: linear-gradient(180deg, rgba(247, 243, 234, 0.92) 0%, rgba(240, 233, 220, 0.98) 100%);
}

.home-spotlight__media-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
}

.home-spotlight__structure-svg,
.home-compound-marquee__structure {
  width: 100%;
  height: 100%;
}

.home-spotlight__structure-svg .mol-preview__svg,
.home-compound-marquee__structure .mol-preview__svg {
  width: 100%;
  height: auto;
  display: block;
}

.home-spotlight__media-placeholder {
  display: grid;
  gap: 0.4rem;
  text-align: center;
  color: var(--ink-soft);
  padding: 1.5rem;
}

.home-spotlight__media-placeholder strong {
  font-size: 1.2rem;
  color: var(--ink);
}

.home-spotlight__info {
  display: grid;
  gap: 1rem;
}

.home-spotlight__card {
  padding: 1.1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid #e0e8f0;
  background: linear-gradient(135deg, rgba(253, 254, 255, 0.98) 0%, rgba(245, 249, 253, 0.98) 100%);
  box-shadow: 0 12px 26px rgba(18, 46, 84, 0.05);
}

.home-spotlight__card--compound {
  background: linear-gradient(135deg, rgba(249, 252, 255, 0.98) 0%, rgba(242, 248, 250, 0.98) 100%);
}

.home-spotlight__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #5c7ca4;
  margin-bottom: 0.55rem;
}

.home-spotlight__title,
.home-spotlight__compound-name {
  margin: 0;
  color: #204c7b;
}

.home-spotlight__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.8vw, 2.3rem);
}

.home-spotlight__compound-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.home-spotlight__latin {
  margin-top: 0.35rem;
  color: var(--muted);
  font-style: italic;
}

.home-spotlight__text {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
}

.home-spotlight__chips,
.home-spotlight__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.95rem;
}

.home-spotlight__compound-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.home-spotlight__empty {
  margin: 0 1.3rem 1.3rem;
}

.home-compound-marquee {
  padding: 1rem 0 1.2rem;
  border-top: 1px solid rgba(225, 234, 242, 0.9);
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.86) 0%, rgba(245, 249, 253, 0.9) 100%);
}

.home-compound-marquee__header {
  padding: 0 1.3rem;
  margin-bottom: 0.9rem;
}

.home-compound-marquee__header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.home-compound-marquee__header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.home-compound-marquee__viewport {
  overflow: hidden;
  padding: 0 1.3rem;
}

.home-compound-marquee__track {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  width: max-content;
  animation: homeCompoundMarquee 96s linear infinite;
}

.home-compound-marquee:hover .home-compound-marquee__track {
  animation-play-state: paused;
}

.home-compound-marquee__group {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.home-compound-marquee__item {
  width: 240px;
  flex-shrink: 0;
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: 20px;
  border: 1px solid #e1e9f1;
  background: linear-gradient(135deg, #fbfdff 0%, #f4f8fc 100%);
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
  color: var(--ink);
}

.home-compound-marquee__item--image-only {
  width: 220px;
  padding: 0.75rem;
}

.home-compound-marquee__item--image-only .home-compound-marquee__media {
  height: 160px;
}

.home-compound-marquee__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(18, 46, 84, 0.08);
}

.home-compound-marquee__media {
  height: 172px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e3eaf1;
  background:
    radial-gradient(circle at top right, rgba(39, 87, 157, 0.08), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-compound-marquee__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
}

.home-compound-marquee__placeholder {
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.home-compound-marquee__content {
  display: grid;
  gap: 0.25rem;
}

.home-compound-marquee__content strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.45;
}

.home-compound-marquee__content span {
  color: var(--muted);
  font-size: 0.84rem;
}

@keyframes homeCompoundMarquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 0.5rem));
  }
}

@media (max-width: 760px) {
  .home-panel-grid,
  .home-spotlight__layout,
  .home-spotlight__compound-meta {
    grid-template-columns: 1fr;
  }

  .home-random-grid,
  .home-panel-grid,
  .home-workbench .home-random-grid,
  .home-workbench .home-panel-grid {
    flex-direction: column !important;
  }

  .home-spotlight__media {
    min-height: 300px;
  }

  .home-compound-marquee__item {
    width: 200px;
  }

  .home-compound-list__item {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

.operations-log-view {
  max-height: 560px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(27, 58, 92, 0.12);
  background: linear-gradient(180deg, rgba(10, 22, 42, 0.96), rgba(18, 39, 72, 0.96));
  padding: 1rem 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.operations-log-line {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(233, 242, 252, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.16rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.operations-log-line:last-child {
  border-bottom: 0;
}

/* ===== Enhanced Spectrum Display (5 standard categories) ===== */

.spectrum-standard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .spectrum-standard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.spectrum-standard-card {
  border: 1px solid rgba(27, 58, 92, 0.12);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.spectrum-standard-card--empty {
  background: #f8fafc;
  border-style: dashed;
  border-color: rgba(27, 58, 92, 0.08);
}

.spectrum-standard-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(27, 58, 92, 0.08);
  background: #f1f5f9;
}

.spectrum-standard-card--empty .spectrum-standard-card__header {
  background: #f8fafc;
}

.spectrum-standard-card__header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a3a5c;
}

.spectrum-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 500;
}

.spectrum-badge--available {
  background: #0891b2;
  color: #fff;
}

.spectrum-badge--pending {
  background: #e2e8f0;
  color: #64748b;
}

/* 课题组自测数据与外部文献数据要一眼分得开 */
.spectrum-badge--measured {
  background: var(--spectrum-accent, #214995);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.spectrum-standard-card__body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.spectrum-chart-container {
  width: 100%;
  height: 300px;
  min-height: 250px;
}

.spectrum-sources {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.spectrum-source-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(27, 58, 92, 0.06);
  font-size: 0.85rem;
}

.spectrum-source-item:last-child {
  border-bottom: 0;
}

.spectrum-source-name {
  color: #1a3a5c;
  flex: 1;
  margin-right: 0.5rem;
}

.spectrum-source-links a {
  color: #0891b2;
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.spectrum-source-links a:hover {
  text-decoration: underline;
}

.spectrum-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
}

.spectrum-pending p {
  margin: 0;
}

/* Structure file links */
.structure-file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(27, 58, 92, 0.08);
}

.structure-file-links .file-asset-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(27, 58, 92, 0.12);
  border-radius: 6px;
  font-size: 0.82rem;
  color: #1a3a5c;
  transition: border-color 0.2s, background 0.2s;
}

.structure-file-links .file-asset-inline:hover {
  border-color: #0891b2;
  background: rgba(8, 145, 178, 0.04);
}

/* ===== Spectrum card refinements ===== */

/* 有图表的卡片占满整行，谱图才有足够宽度 */
@media (min-width: 768px) {
  .spectrum-standard-card--chart {
    grid-column: 1 / -1;
  }
}

.spectrum-standard-card__header h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spectrum-standard-card__ordinal {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0891b2;
  letter-spacing: 0.02em;
}

.spectrum-standard-card__header h3 small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.spectrum-source-group + .spectrum-source-group {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(27, 58, 92, 0.08);
}

.spectrum-source-group h4 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.spectrum-source-link {
  color: #0891b2;
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.spectrum-source-link:hover {
  text-decoration: underline;
}

.spectrum-source-more,
.spectrum-note {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.spectrum-chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.spectrum-chart-fallback {
  margin: 0;
  padding: 2rem 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.panel-card__aside {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.detail-inline-metric--wide {
  grid-column: 1 / -1;
}

.copy-inline-btn {
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid rgba(27, 58, 92, 0.18);
  border-radius: 5px;
  background: #fff;
  color: #0891b2;
  font-size: 0.72rem;
  line-height: 1.5;
  cursor: pointer;
}

.copy-inline-btn:hover {
  border-color: #0891b2;
  background: rgba(8, 145, 178, 0.06);
}

.detail-source-note {
  margin: 0.9rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(27, 58, 92, 0.08);
  font-size: 0.78rem;
  color: #94a3b8;
}

.detail-source-note a {
  color: #0891b2;
}

/* ===== 天然产物详情页（重构版） ===== */

.compound-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* 详情页顶部细条：左侧操作按钮 + 居中的项目支持说明。
   原来的大幅 banner（机构标识、CAS/分子式/分子量信息块）已删除。 */
.compound-topbar {
  --topbar-ink: #214995;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.42rem 1rem;
  border: 1px solid rgba(33, 73, 149, 0.18);
  border-radius: 999px;
  background: rgba(33, 73, 149, 0.05);
  color: var(--topbar-ink);
}

.compound-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.compound-topbar__actions .btn {
  --bs-btn-padding-y: 0.18rem;
  --bs-btn-padding-x: 0.7rem;
  --bs-btn-font-size: 0.78rem;
  border-radius: 999px;
}

/* 两项基金各占一行，原来的绝对居中会顶出细条（绝对定位不撑高父元素），
   所以改成靠右的常规流：细条随内容长高，也不会压到左侧按钮。 */
.compound-topbar__support {
  margin: 0 0 0 auto;
  max-width: min(74%, 780px);
  text-align: right;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--topbar-ink);
}

.fund-note--bar {
  align-items: flex-end;
}

.compound-section {
  margin-bottom: 1.25rem;
  border: 1px solid rgba(27, 58, 92, 0.1);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 34, 56, 0.05);
}

.compound-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.35rem;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
}

/* 标题配色与 .form-section h5 保持一致 */
.compound-section__head h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
}

.compound-section__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.compound-section__aside {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.compound-section__body {
  padding: 1.35rem;
}

.compound-section__hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.spec-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.85rem;
}

.spec-card {
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  background: #f6f9fc;
  border-left: 3px solid var(--brand);
  min-width: 0;
}

.spec-card__label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.spec-card__value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}

.smiles-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(27, 58, 92, 0.12);
}

.smiles-row__label {
  font-size: 0.78rem;
  color: #64748b;
}

.smiles-row__value {
  flex: 1 1 20rem;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  color: #1a3a5c;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(27, 58, 92, 0.08);
}

.download-btn {
  display: inline-block;
  padding: 0.5rem 1.05rem;
  border-radius: 6px;
  border: 1px solid rgba(27, 58, 92, 0.18);
  background: #fff;
  color: #1a3a5c;
  font-size: 0.84rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.download-btn:hover {
  border-color: #1a3a5c;
  background: #1a3a5c;
  color: #fff;
}

.download-btn--primary {
  background: #1a3a5c;
  border-color: #1a3a5c;
  color: #fff;
}

.download-btn--primary:hover {
  background: #12263a;
  border-color: #12263a;
}

.structure-figure {
  margin: 0;
  text-align: center;
}

.structure-figure img,
.structure-figure svg {
  max-width: min(420px, 100%);
  height: auto;
  border: 1px solid rgba(27, 58, 92, 0.12);
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
}

.structure-figure figcaption {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.compound-placeholder {
  padding: 3rem 1rem;
  text-align: center;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed rgba(27, 58, 92, 0.14);
  border-radius: 8px;
}

.spectrum-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spectrum-panel {
  border: 1px solid rgba(27, 58, 92, 0.12);
  border-radius: 10px;
  overflow: hidden;
  --spectrum-accent: #1a3a5c;
}

.spectrum-panel--carbon { --spectrum-accent: #c62828; }
.spectrum-panel--proton { --spectrum-accent: #1565c0; }
.spectrum-panel--ms     { --spectrum-accent: #00838f; }
.spectrum-panel--ir     { --spectrum-accent: #6a1b9a; }
.spectrum-panel--uv     { --spectrum-accent: #ef6c00; }

.spectrum-panel--empty {
  border-style: dashed;
  border-color: rgba(27, 58, 92, 0.1);
  background: #fafbfc;
}

.spectrum-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.05rem;
  background: #f6f8fb;
  border-bottom: 1px solid rgba(27, 58, 92, 0.08);
  border-left: 4px solid var(--spectrum-accent);
}

.spectrum-panel--empty .spectrum-panel__head {
  border-left-color: rgba(27, 58, 92, 0.14);
  background: #fafbfc;
}

.spectrum-panel__head h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a3a5c;
}

.spectrum-panel__ordinal {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--spectrum-accent);
}

.spectrum-panel__head h3 small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.spectrum-panel__body {
  padding: 1rem 1.05rem;
}

.spectrum-panel .spectrum-chart-container {
  height: 360px;
}

/* MS / IR / UV 三类以实测谱图图片呈现 */
.spectrum-figure {
  margin: 0;
  text-align: center;
}

.spectrum-figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(27, 58, 92, 0.12);
  border-radius: 8px;
  background: #fff;
}

.spectrum-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.spectrum-conditions {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* 谱图交互说明：纵向缩放不点开工具栏看不出来，得写一句 */
.spectrum-hint {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #94a3b8;
}

.spectrum-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.species-brief {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.species-brief__thumb {
  flex: 0 0 auto;
  width: 150px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(27, 58, 92, 0.12);
}

.species-brief__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.species-brief__body {
  flex: 1 1 22rem;
  min-width: 0;
}

.species-brief__body h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a3a5c;
}

.species-brief__latin {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: #64748b;
}

.species-brief__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.species-brief__item {
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: #f6f8fb;
}

.species-brief__item--wide {
  grid-column: 1 / -1;
}

.species-brief__item span {
  display: block;
  font-size: 0.74rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.species-brief__item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a3a5c;
  min-width: 0;
}

.species-brief__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.other-species {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(27, 58, 92, 0.1);
}

.other-species h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a3a5c;
}

.other-species__hint {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.other-species__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.other-species__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(27, 58, 92, 0.14);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: #1a3a5c;
  transition: border-color 0.2s, background 0.2s;
}

.other-species__item:hover {
  border-color: #0891b2;
  background: rgba(8, 145, 178, 0.05);
}

.other-species__item strong {
  font-size: 0.85rem;
  font-weight: 600;
}

.other-species__item small {
  font-size: 0.7rem;
  color: #94a3b8;
}

.sdf-source {
  margin: 0;
  padding: 1rem;
  max-height: 340px;
  overflow: auto;
  border-radius: 8px;
  background: #263238;
  color: #eceff1;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 640px) {
  .compound-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    border-radius: 14px;
    padding: 0.6rem 0.9rem;
  }

  .compound-topbar__support {
    margin-left: 0;
    max-width: none;
    text-align: left;
  }

  .fund-note--bar {
    align-items: flex-start;
  }

  .compound-section__body {
    padding: 1rem;
  }

  .spectrum-panel .spectrum-chart-container {
    height: 280px;
  }
}

/* 页脚浏览次数：做成一枚小胶囊，数字用等宽字形，滚动时不会左右跳动 */
.view-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.24rem 0.78rem 0.24rem 0.55rem;
  border: 1px solid rgba(15, 76, 129, 0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(232, 241, 249, 0.9) 0%, rgba(255, 255, 255, 0.75) 100%);
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.view-counter:hover {
  border-color: rgba(15, 76, 129, 0.3);
  box-shadow: 0 4px 12px rgba(15, 76, 129, 0.1);
  transform: translateY(-1px);
}

.view-counter__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 76, 129, 0.1);
  color: var(--brand);
}

.view-counter__label,
.view-counter__unit {
  color: var(--muted);
  letter-spacing: 0.01em;
}

.view-counter__value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.02em;
}

/* 滚动结束时轻轻定一下，暗示数字已经是最终值 */
.view-counter__value.is-ready {
  animation: viewCounterSettle 0.45s ease-out;
}

@keyframes viewCounterSettle {
  0% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .view-counter,
  .view-counter__value.is-ready {
    transition: none;
    animation: none;
  }
}

/* ===== 数据库团队页 ===== */

.team-hero .catalog-hero__content {
  align-items: center;
}

.team-hero__main {
  max-width: 620px;
}

.team-hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem;
  margin: 0;
  flex: 0 0 auto;
}

.team-hero__fact {
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.team-hero__fact dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.team-hero__fact dd {
  margin: 0.18rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.team-panel {
  margin-bottom: 1.25rem;
}

.team-panel__head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.team-panel__no {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(15, 76, 129, 0.28);
}

.team-panel__head h2 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--ink);
}

.team-panel__head p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* 介绍正文 + 右侧示意图。图不抢戏，宽度固定，正文占剩余空间 */
.team-about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);
  align-items: center;
  gap: 1.6rem;
}

.team-intro {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.9;
  text-align: justify;
}

.team-about__figure {
  margin: 0;
}

.team-about__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #f7fafd;
}

.team-capabilities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.team-capability {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: #f7fafd;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
}

.team-capability h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.team-capability p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.85rem;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.team-member:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* 没有成员照片，用姓氏首字做字母标；五种色调轮换，避免整片同色 */
.team-member__avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0f4c81 0%, #1f669f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.team-member__avatar[data-tone="1"] { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); }
.team-member__avatar[data-tone="2"] { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); }
.team-member__avatar[data-tone="3"] { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%); }
.team-member__avatar[data-tone="4"] { background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%); }

.team-member__body {
  min-width: 0;
}

.team-member__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.team-member__affiliation {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.team-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.85rem;
}

.team-contact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.05rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f7fafd 0%, #ffffff 100%);
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.team-contact:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  color: inherit;
}

.team-contact__role {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.team-contact__name {
  font-size: 1.08rem;
  color: var(--ink);
}

.team-contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--brand);
  word-break: break-all;
}

@media (max-width: 960px) {
  .team-hero .catalog-hero__content {
    flex-direction: column;
    align-items: stretch;
  }

  .team-hero__facts {
    width: 100%;
  }

  /* 窄屏没有右侧留白可用，图挪到正文下方 */
  .team-about {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

@media (max-width: 640px) {
  .team-hero__facts {
    grid-template-columns: 1fr;
  }

  .team-panel__head {
    gap: 0.6rem;
  }
}

.site-footer__views strong {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* 列表页：有波谱数据的标记 */
.research-table__titleline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.research-table__titleline .research-table__title {
  min-width: 0;
}

.spectra-flag {
  flex: 0 0 auto;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: rgba(8, 145, 178, 0.12);
  color: #0e7490;
  border: 1px solid rgba(8, 145, 178, 0.28);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

/* ===== 长文本截断（溢出显示省略号，悬停看全文） ===== */

.text-clamp {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* 截断的元素可点开提示，给一点交互暗示 */
  vertical-align: bottom;
}

.text-clamp--multi {
  display: -webkit-box;
  -webkit-line-clamp: var(--clamp-lines, 2);
  line-clamp: var(--clamp-lines, 2);
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 只有真的被截断了才提示可查看全文 */
.text-clamp.is-truncated {
  cursor: help;
  text-decoration: underline dotted rgba(27, 58, 92, 0.35);
  text-underline-offset: 3px;
}

/*
  表格里必须给一个绝对上限。表格是 auto 布局，列宽由内容的 max-content 决定，
  而 .text-clamp 的 white-space:nowrap 会让 445 字符的 IUPAC 名产生 3000px+ 的
  固有宽度，把整张表连同外层容器一起撑破（百分比 max-width 在这里约束不住）。
*/
td .text-clamp,
th .text-clamp,
.research-table td .text-clamp,
.research-table th .text-clamp {
  max-width: 26rem;
}

/* 表格容器与卡片都不允许被内容撑宽，超宽表格在容器内横向滚动 */
.page-card,
.table-responsive,
.research-table-wrap {
  max-width: 100%;
  min-width: 0;
}

.text-tooltip {
  position: fixed;
  z-index: 1080;
  max-width: min(30rem, 88vw);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: #12263a;
  color: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.55;
  box-shadow: 0 10px 30px rgba(15, 34, 56, 0.28);
  overflow-wrap: anywhere;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.text-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 布局溢出修正 ===== */

/*
  网格/弹性子项默认 min-width:auto，遇到超长且不可断行的化合物名
  （最长 445 字符的 IUPAC 名）会拒绝收缩，把整页撑出横向滚动条。
  凡是承载可截断文本的容器，都要显式允许其子项收缩。
*/
.dashboard-grid > *,
.search-result-list > *,
.search-result-list__item,
.home-compound-list > *,
.home-random-list > *,
.legacy-species-list > *,
.spectrum-list > *,
.detail-layout__main,
.detail-layout__side,
.dashboard-grid__main,
.dashboard-grid__side,
.related-compound-table > *,
.species-record-list > *,
.compound-record-list > *,
.timeline-item > *,
.data-list__row > *,
.related-compound-table__row > * {
  min-width: 0;
}

/* 卡片内的弹性/网格文本块同样要能收缩 */
.legacy-species-item__body,
.home-compound-list__body,
.species-record__body,
.search-result-list__item > * {
  min-width: 0;
}

/* ===== 页面骨架（数据维护 / 用户 / 角色等后台页）===== */

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.page-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.page-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

/* 表单分区：横向留白同时消化 Bootstrap row 的负外边距 */
.form-section {
  padding: 1.25rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section > h5 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--brand);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.import-form {
  display: block;
}

.spectra-upload-item {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  height: 100%;
}

/* 碳谱/氢谱能画出交互谱图，用左侧色条把这两格提出来 */
.spectra-upload-item--curve {
  border-left: 3px solid var(--brand);
  background: linear-gradient(135deg, #f7fafd 0%, #ffffff 100%);
}

.spectra-upload-item__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--line);
}

.spectra-upload-item__ordinal {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--brand);
}

.spectra-upload-item__head strong {
  color: var(--ink);
}

.spectra-upload-item__head small {
  font-size: 0.75rem;
  color: var(--muted);
}

.spectra-upload-item__flag {
  margin-left: auto;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  white-space: nowrap;
}

.spectra-upload-field + .spectra-upload-field {
  margin-top: 0.7rem;
}

.spectra-upload-field > label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.spectra-upload-field > label em {
  margin-left: 0.35rem;
  font-style: normal;
  font-weight: 400;
  color: var(--brand);
}

.spectra-upload-current {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.spectra-upload-current a {
  color: var(--brand);
  word-break: break-all;
}

.spectra-upload-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0 auto;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.07);
  cursor: pointer;
  white-space: nowrap;
}

.spectra-upload-remove input {
  margin: 0;
}

/* ===== 表格内元素 ===== */

.structure-type-badge {
  display: inline-block;
  max-width: 14rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 600;
}

.action-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.action-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.action-btn-danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* ===== 空状态 ===== */

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.empty-title,
.empty-panel__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.empty-desc,
.empty-panel__desc {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===== 详情栅格 ===== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
}

.detail-item {
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #f6f9fc;
  border-left: 3px solid var(--brand);
}

.detail-label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.detail-value {
  display: block;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ===== 删除确认页 ===== */

.delete-card {
  border: 1px solid #f3c3bd;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.delete-card-header {
  padding: 1rem 1.5rem;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  border-bottom: 1px solid #f3c3bd;
}

.delete-divider {
  height: 1px;
  margin: 1.25rem 0;
  background: var(--line);
  border: 0;
}

.compound-count-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ===== 角色 / 用户 ===== */

/* 角色卡片是纵向居中布局（视图里带 text-center），不能用横向 flex */
.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.role-card > * {
  min-width: 0;
  max-width: 100%;
}

.role-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
}

.role-card-icon-admin { background: rgba(180, 35, 24, 0.1); color: var(--danger); }
.role-card-icon-zyadmin { background: var(--accent-soft); color: #0f766e; }
.role-card-icon-viewer,
.role-card-icon-editor { background: var(--brand-soft); color: var(--brand); }

.role-badge {
  display: inline-block;
  margin: 0.1rem 0.2rem 0.1rem 0;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.role-badge-admin { background: rgba(180, 35, 24, 0.1); color: var(--danger); }
.role-badge-editor { background: var(--accent-soft); color: #0f766e; }
.role-badge-viewer { background: var(--brand-soft); color: var(--brand); }

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #1f669f 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  flex: 0 0 auto;
}

/* ===== 错误页 ===== */

.error-page {
  max-width: 34rem;
  margin: 3rem auto;
  padding: 2.5rem 2rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.error-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.error-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.error-message {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.error-request-id {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .page-card {
    padding: 1rem;
  }

  .page-title-row {
    align-items: flex-start;
  }
}

/* ===== 物种详情页（/Species/Details）===== */

/*
  这一页几乎所有字段都可能是长英文：拉丁名、445 字符的 IUPAC 化合物名、整段英文综述。
  弹性/网格子项默认 min-width:auto，遇到 .text-clamp 的 white-space:nowrap 会拒绝收缩，
  把行连同整页一起撑出横向滚动条，所以承载文本的容器一律显式允许收缩。
*/
.species-detail .detail-hero__main,
.species-detail .detail-layout__main,
.species-detail .detail-layout__side,
.species-detail__kv,
.species-compound__main,
.species-compound__meta {
  min-width: 0;
}

.species-detail__hero {
  align-items: center;
  gap: 1.75rem;
}

.species-detail__hero .detail-hero__main {
  flex: 1 1 auto;
}

.species-detail__hero .detail-hero__title {
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  overflow-wrap: anywhere;
}

.species-detail__hero .detail-hero__subtitle {
  margin-top: 0.55rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
}

.species-detail__hero .detail-hero__chips {
  align-items: center;
}

.species-detail__hero .detail-hero__actions {
  flex: 0 0 auto;
}

/* 深色 hero 上的胶囊，过长的药用部位截断成一行，悬停看全文 */
.species-detail__hero-chip {
  max-width: min(24rem, 100%);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #eaf3ff;
}

.species-detail__hero-chip--accent {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(94, 234, 212, 0.42);
  color: #e8fffb;
}

.species-detail__hero-chip.is-truncated {
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

/* 固定三列：字段正好三个，auto-fit 在宽屏会排出第四列空格 */
.species-detail__kv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.species-detail__kv {
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #f0f6fb 100%);
  border: 1px solid #e0e9f2;
}

.species-detail__kv > span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.species-detail__kv > strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.species-detail__notes {
  display: grid;
  gap: 0.9rem;
}

.species-note {
  padding: 1.05rem 1.15rem;
  border-radius: 16px;
  background: #f8fbfd;
  border: 1px solid #e6edf4;
  border-left: 4px solid var(--note-accent);
}

.species-note--value {
  --note-accent: #0f4c81;
  --note-accent-soft: #e8f1f9;
}

.species-note--component {
  --note-accent: #0d7a6f;
  --note-accent-soft: #e3f6f3;
}

.species-note--inflammation {
  --note-accent: #b45309;
  --note-accent-soft: #fdf1e3;
}

.species-note--vasculitis {
  --note-accent: #b42318;
  --note-accent-soft: #fdecea;
}

.species-note--hepatic {
  --note-accent: #6d28d9;
  --note-accent-soft: #efe9fd;
}

.species-note--review {
  --note-accent: #475569;
  --note-accent-soft: #eef1f5;
}

.species-note__label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.55rem;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  background: var(--note-accent-soft);
  color: var(--note-accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.species-note__body {
  position: relative;
  color: var(--ink-soft);
  line-height: 1.8;
  /* 英文长句、DOI、化学名断不开时会顶破卡片 */
  overflow-wrap: anywhere;
}

/* 折叠高度必须与 Details.cshtml 里的 COLLAPSED_HEIGHT 保持一致 */
.species-note__body.is-clamped {
  max-height: 220px;
  overflow: hidden;
}

.species-note__body.is-clamped::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3.4rem;
  background: linear-gradient(180deg, rgba(248, 251, 253, 0) 0%, #f8fbfd 82%);
  pointer-events: none;
}

.species-note__toggle {
  margin-top: 0.65rem;
  padding: 0.26rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.species-note__toggle:hover {
  border-color: var(--note-accent);
  color: var(--note-accent);
  background: var(--note-accent-soft);
}

.species-detail__compounds {
  display: grid;
  gap: 0.75rem;
}

.species-compound {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) minmax(0, 17rem);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid #e2e9f1;
  border-radius: 16px;
  background: linear-gradient(135deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow: 0 10px 22px rgba(18, 46, 84, 0.05);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.species-compound:hover {
  transform: translateY(-2px);
  border-color: #a7c1da;
  box-shadow: 0 14px 28px rgba(18, 46, 84, 0.09);
  color: var(--ink);
}

.species-compound__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.species-compound__main {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.species-compound__title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}

.species-compound__sub {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.species-compound__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.species-compound__tag {
  max-width: 100%;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  background: #eef3f8;
  border: 1px solid #dde7f1;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.species-compound__tag--formula {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.species-compound__tag--relation {
  background: var(--accent-soft);
  border-color: #cbe9e4;
  color: #0f766e;
}

.species-detail__figure {
  min-height: 260px;
  aspect-ratio: 4 / 3;
}

/*
  窄屏下 .detail-hero 变成纵向弹性容器，此时子项的宽度走 fit-content，
  而 fit-content 不小于 min-content —— 拉丁名那一行 white-space:nowrap，
  min-content 就是整串拉丁名的宽度，于是整块 hero 被顶出屏幕。
  改成 stretch，子项宽度直接取容器宽度，超长文本才会正常省略。
*/
@media (max-width: 960px) {
  .species-detail__hero {
    align-items: stretch;
  }

  .species-detail__hero .detail-hero__main {
    max-width: 100%;
  }
}

/* 三列排不下时，标签移到标题下方，避免化合物名被挤成一列窄条 */
@media (max-width: 820px) {
  .species-detail__kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .species-compound {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    align-items: start;
  }

  .species-compound__meta {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 0.15rem;
  }
}

@media (max-width: 560px) {
  .species-detail__kv-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

