:root {
  --och-ink: #1f2933;
  --och-muted: #667085;
  --och-line: #d9e2df;
  --och-soft: #f4f8f6;
  --och-accent: #0f766e;
  --och-accent-strong: #0b5f59;
  --och-warm: #a15c38;
  --och-paper: #fffdf8;
  --och-shadow: 0 18px 45px rgba(31, 41, 51, 0.1);
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--och-ink);
  background: #fbfcfb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--och-accent);
  text-decoration: none;
}

a:hover {
  color: #0b5f59;
  text-decoration: underline;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(216, 226, 223, 0.86);
  backdrop-filter: blur(14px);
}

.navbar-brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 0.65rem;
  letter-spacing: 0;
}

.brand-mark {
  align-items: center;
  background: #132926;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.nav-link {
  border-radius: 999px;
  color: #4b5563;
  font-weight: 600;
  padding-inline: 0.85rem !important;
}

.nav-link:hover {
  background: var(--och-soft);
  color: var(--och-accent-strong);
  text-decoration: none;
}

.compact-search {
  gap: 0.5rem;
}

.compact-search .form-control {
  min-width: 16rem;
}

.btn-primary-ink {
  background: #132926;
  border-color: #132926;
  color: #fff;
  font-weight: 700;
}

.btn-primary-ink:hover,
.btn-primary-ink:focus {
  background: var(--och-accent-strong);
  border-color: var(--och-accent-strong);
  color: #fff;
}

.btn,
.quick-link {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.btn:active,
.quick-link:active {
  transform: scale(0.96);
}

.home-search {
  background:
    radial-gradient(circle at 10% 16%, rgba(15, 118, 110, 0.1), transparent 26rem),
    radial-gradient(circle at 78% 22%, rgba(161, 92, 56, 0.12), transparent 24rem),
    linear-gradient(180deg, #f7fbf9 0%, #ffffff 100%);
  border-bottom: 1px solid var(--och-line);
  padding: 4.5rem 0 3.6rem;
  position: relative;
}

.home-search::after {
  color: rgba(15, 118, 110, 0.09);
  content: "C6H6  +  RCOCl  ->  ArCOR";
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(1.2rem, 3vw, 3rem);
  font-weight: 800;
  pointer-events: none;
  position: absolute;
  right: 5vw;
  top: 1rem;
}

.eyebrow {
  color: var(--och-accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-panel .form-control,
.search-panel .btn {
  min-height: 3.5rem;
}

.search-panel .form-control {
  border-color: var(--och-line);
  box-shadow: 0 14px 32px rgba(31, 41, 51, 0.06);
}

.hero-metrics {
  color: var(--och-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-metrics span {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(216, 226, 223, 0.9);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}

.hero-metrics strong {
  color: var(--och-ink);
  font-variant-numeric: tabular-nums;
}

.frontend-status-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 226, 223, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(31, 41, 51, 0.07);
  max-width: 42rem;
  padding: 0.9rem 1rem;
}

.frontend-status-title {
  align-items: center;
  color: var(--och-accent-strong);
  display: flex;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.frontend-status-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.frontend-status-grid span {
  background: var(--och-soft);
  border-radius: 8px;
  color: var(--och-muted);
  font-size: 0.9rem;
  padding: 0.55rem 0.65rem;
}

.frontend-status-grid strong {
  color: var(--och-ink);
  font-variant-numeric: tabular-nums;
}

.frontend-status-note {
  color: var(--och-warm);
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 0.65rem;
}

.visit-counter-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 226, 223, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(31, 41, 51, 0.07);
  margin-top: 1rem;
  padding: 0.9rem 1rem;
}

.side-panel + .visit-counter-panel,
.visit-counter-panel + .side-panel {
  margin-top: 1rem;
}

.col-lg-4 > .visit-counter-panel:first-child {
  margin-top: 0;
}

.visit-counter-panel__title {
  align-items: center;
  color: var(--och-accent-strong);
  display: flex;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.visit-counter-panel__grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visit-counter-panel__grid span {
  background: var(--och-soft);
  border-radius: 8px;
  color: var(--och-muted);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.6rem 0.7rem;
}

.visit-counter-panel__grid strong {
  color: var(--och-ink);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.visit-counter-panel__grid em {
  font-size: 0.82rem;
  font-style: normal;
  white-space: nowrap;
}

.quick-panel,
.taxonomy-panel,
.side-panel,
.reaction-card {
  border: 1px solid rgba(216, 226, 223, 0.92);
  border-radius: 8px;
  background: #fff;
  padding: 1.25rem;
}

.quick-panel {
  box-shadow: var(--och-shadow);
}

.quick-link {
  align-items: center;
  border: 1px solid var(--och-line);
  border-radius: 8px;
  color: var(--och-ink);
  display: flex;
  font-weight: 700;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
}

.quick-link:hover {
  background: var(--och-soft);
  border-color: #b4c9c5;
  color: var(--och-accent-strong);
  text-decoration: none;
}

.reaction-card {
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reaction-card:hover {
  border-color: #b4c9c5 !important;
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
  transform: translateY(-2px);
}

.reaction-card h3 {
  text-wrap: balance;
}

.reaction-card p {
  text-wrap: pretty;
}

.mini-thumb {
  margin-bottom: 0.75rem;
  text-align: center;
}
.mini-thumb img {
  background: #fff;
  border: 1px solid #e3e9e6;
  border-radius: 6px;
  max-height: 80px;
  max-width: 100%;
  object-fit: contain;
  padding: 4px;
}

.reaction-result-item__thumb {
  flex-shrink: 0;
  margin-left: 1rem;
}
.reaction-result-item__thumb img {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  height: 60px;
  max-width: 100%;
  object-fit: contain;
  padding: 2px;
  width: 80px;
}

.reaction-image-gallery {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-top: 1rem;
}

.reaction-image-gallery__item {
  background: #fff;
  border: 1px solid var(--och-line);
  border-radius: 8px;
  margin: 0;
  padding: 0.75rem;
}

.reaction-image-gallery__item img {
  display: block;
  max-height: 18rem;
  object-fit: contain;
  width: 100%;
}

.reaction-image-gallery__item figcaption {
  color: var(--och-muted);
  font-size: 0.86rem;
  margin-top: 0.55rem;
  text-align: center;
}

.content-band {
  padding: 3.5rem 0;
}

.reaction-map-hero {
  background:
    linear-gradient(90deg, rgba(22, 54, 154, 0.96), rgba(38, 66, 176, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 9rem, rgba(255, 255, 255, 0.08) 9rem 9.1rem);
  color: #fff;
  overflow: hidden;
  padding: 2.6rem 0 3rem;
  position: relative;
}

.reaction-map-hero::before {
  color: rgba(255, 255, 255, 0.09);
  content: "Li Be B C N O F Na Mg Al Si P S Cl K Ca Cr Mn Fe Co Ni Cu Zn";
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 800;
  left: 0;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0.2rem;
  white-space: nowrap;
}

.reaction-map-hero::after {
  color: rgba(255, 255, 255, 0.34);
  content: "C=O  +  Nu-  ->  C-C";
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(1.5rem, 3vw, 3.4rem);
  font-weight: 800;
  position: absolute;
  right: 10vw;
  top: 2.1rem;
}

.reaction-map-hero--general {
  background:
    linear-gradient(90deg, rgba(8, 97, 84, 0.98), rgba(17, 128, 113, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 8rem, rgba(255, 255, 255, 0.08) 8rem 8.1rem);
}

.reaction-map-hero--general::before {
  content: "Addition Substitution Elimination Oxidation Reduction";
}

.reaction-map-hero--general::after {
  content: "C=C  +  HX  ->  C-C";
  color: rgba(222, 247, 239, 0.42);
}

.reaction-map-hero__copy {
  margin-left: clamp(0rem, 4vw, 4rem);
  max-width: 46rem;
  position: relative;
  z-index: 1;
}

.reaction-map-hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 900;
  margin: 0 0 0.45rem;
}

.reaction-map-hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
  margin: 0;
}

.reaction-map-hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.reaction-browser-wrap {
  background: #eef3f8;
  padding: 1rem 0 3rem;
}

.reaction-browser-wrap--general {
  background: #edf7f3;
}

.reaction-browser {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr);
  margin-top: -0.25rem;
}

.reaction-browser__sidebar,
.reaction-browser__content {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 226, 223, 0.7);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 36, 52, 0.08);
}

.reaction-browser__sidebar {
  padding: 1rem;
  position: sticky;
  top: 5rem;
}

.reaction-browser__search {
  display: grid;
  gap: 0.75rem;
}

.reaction-browser__search .input-group {
  flex-wrap: nowrap;
}

.reaction-browser__search .form-control,
.reaction-browser__search .btn {
  min-height: 2.75rem;
}

.reset-link {
  color: var(--och-muted);
  font-weight: 700;
  justify-self: end;
  margin-top: -3.45rem;
  padding: 0.8rem 0 0.8rem 0.8rem;
  position: relative;
  right: -3.2rem;
}

.reaction-browser__filters {
  display: grid;
  gap: 0.55rem;
}

.reaction-browser__filters .form-select {
  border-color: #e1e8ee;
  color: #435160;
}

.browser-check {
  color: #435160;
  margin: 0.1rem 0 0;
}

.reaction-index {
  display: grid;
  gap: 0.2rem;
  margin-top: 1rem;
  max-height: 45rem;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.reaction-index::-webkit-scrollbar {
  width: 0.45rem;
}

.reaction-index::-webkit-scrollbar-thumb {
  background: #d6e0e8;
  border-radius: 999px;
}

.reaction-index a {
  border-radius: 6px;
  color: #42505f;
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  overflow: hidden;
  padding: 0.55rem 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reaction-index a:hover,
.reaction-index a:focus {
  background: #edf4fb;
  color: #0c55a0;
  text-decoration: none;
}

.reaction-browser--general .reaction-index a:hover,
.reaction-browser--general .reaction-index a:focus {
  background: #e8f7f1;
  color: #087061;
}

.reaction-browser__content {
  padding: 1.6rem;
}

.browser-result-head {
  align-items: start;
  border-bottom: 1px solid #e5ebf0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.browser-result-head h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0 0 0.25rem;
}

.browser-result-head p {
  color: var(--och-muted);
  margin: 0;
}

.browser-result-head p span {
  color: #0c55a0;
  font-weight: 800;
  margin-left: 0.5rem;
}

.reaction-browser--general .browser-result-head p span {
  color: #087061;
}

.browser-result-head__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.browser-result-head__chips span {
  background: #edf4fb;
  border-radius: 999px;
  color: #0c55a0;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
}

.reaction-browser--general .browser-result-head__chips span {
  background: #e8f7f1;
  color: #087061;
}

.reaction-result-list {
  display: grid;
  gap: 0.85rem;
}

.reaction-result-item {
  background: #fff;
  border: 1px solid #e1e8ee;
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem);
  padding: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.reaction-result-item:hover {
  border-color: #bfd4e8;
  box-shadow: 0 14px 30px rgba(18, 36, 52, 0.08);
  transform: translateY(-1px);
}

.reaction-browser--general .reaction-result-item:hover {
  border-color: #9ed6c8;
}

.reaction-result-item__title {
  color: #0c55a0;
  display: inline-block;
  font-size: 1.12rem;
  font-weight: 900;
  margin-bottom: 0.2rem;
}

.reaction-browser--general .reaction-result-item__title {
  color: #087061;
}

.reaction-result-item h3 {
  color: #435160;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.55rem;
}

.reaction-result-item p {
  color: #4f5d6b;
  margin: 0 0 0.8rem;
}


.pagination-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

.pagination-shell .page-link {
  border-color: #dfe8ef;
  color: #0c55a0;
  font-weight: 800;
  min-width: 2.8rem;
  text-align: center;
}

.pagination-shell .active .page-link {
  background: #0c55a0;
  border-color: #0c55a0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
}

.bg-soft,
.page-band {
  background: var(--och-soft);
}

.detail-hero {
  border-bottom: 1px solid var(--och-line);
  padding: 2.25rem 0;
}

.empty-state {
  border: 1px dashed var(--och-line);
  border-radius: 8px;
  color: var(--och-muted);
  padding: 1.5rem;
  text-align: center;
}

.search-highlight {
  background: #fff1a8;
  border-radius: 3px;
  color: inherit;
  padding: 0 0.12rem;
}

.recommend-panel {
  border: 1px solid var(--och-line);
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
}

.recommend-panel h2 {
  margin-bottom: 0.75rem;
}

.tag-cloud,
.tag-row,
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud a,
.tag-row span,
.tag-row a,
.detail-badges span {
  border: 1px solid var(--och-line);
  border-radius: 999px;
  background: #fff;
  color: var(--och-ink);
  font-size: 0.875rem;
  padding: 0.25rem 0.65rem;
}

.detail-section {
  border-bottom: 1px solid var(--och-line);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.detail-section h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.smiles-box {
  background: #172026;
  border-radius: 8px;
  color: #e9f5ef;
  overflow-x: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.structure-viewer {
  background: var(--och-paper);
  border: 1px solid #eadfcf;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(90, 63, 36, 0.08);
  overflow: hidden;
}

.structure-viewer__head {
  align-items: center;
  background: #fff8ed;
  border-bottom: 1px solid #eadfcf;
  display: flex;
  font-weight: 800;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.structure-viewer__status {
  background: #fff;
  border: 1px solid #eadfcf;
  border-radius: 999px;
  color: var(--och-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

.structure-viewer__status[data-state="ready"] {
  color: var(--och-accent-strong);
}

.structure-viewer__status[data-state="warning"] {
  color: var(--och-warm);
}

.structure-viewer__stage {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  min-height: 13rem;
  padding: 1rem;
}

.structure-image-stage {
  background: #fff;
  min-height: 10rem;
}

.structure-viewer__placeholder {
  color: var(--och-muted);
}

.structure-image-frame {
  align-items: center;
  display: grid;
  justify-items: center;
  margin: 0;
  width: 100%;
}

.structure-image-frame img {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  display: block;
  max-height: 34rem;
  max-width: 100%;
  object-fit: contain;
  padding: 0.75rem;
}

.structure-image-frame figcaption {
  color: var(--och-muted);
  font-size: 0.84rem;
  margin-top: 0.6rem;
  text-align: center;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-step {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 1rem;
}

.timeline-step > div:last-child {
  background: #fff;
  border: 1px solid var(--och-line);
  border-radius: 8px;
  padding: 1rem;
}

.step-number {
  align-items: center;
  background: var(--och-warm);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-weight: 700;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.check-list {
  display: grid;
  gap: 0.65rem;
  padding-left: 1.2rem;
}

.resource-table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.06);
}

.resource-row {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 7rem 5rem 5rem 6rem;
  padding: 0.9rem 1rem;
}

.resource-row + .resource-row {
  border-top: 1px solid var(--och-line);
}

.resource-head {
  background: var(--och-soft);
  color: var(--och-muted);
  font-size: 0.875rem;
  font-weight: 700;
}

@media (max-width: 576px) {
  .compact-search {
    width: 100%;
  }

  .compact-search .form-control {
    min-width: 0;
  }

  .search-panel .input-group {
    display: grid;
    gap: 0.75rem;
  }

  .home-search {
    padding: 3rem 0;
  }

  .home-search::after {
    display: none;
  }

  .search-panel .form-control,
  .search-panel .btn {
    border-radius: 0.375rem !important;
    width: 100%;
  }

  .frontend-status-grid,
  .visit-counter-panel__grid {
    grid-template-columns: 1fr;
  }

  .resource-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .resource-head {
    display: none;
  }

  .reaction-browser {
    grid-template-columns: 1fr;
  }

  .reaction-browser__sidebar {
    position: static;
  }

  .reaction-index {
    max-height: 18rem;
  }

  .reaction-result-item {
    grid-template-columns: 1fr;
  }

  .structure-viewer__stage {
    justify-content: stretch;
  }

  .structure-image-frame img {
    padding: 0.4rem;
  }

  .reaction-result-item__thumb {
    margin-left: 0;
  }
}
