/*
 * 实验室知识库视觉系统
 * 以 Material for MkDocs 的语义变量为基础，避免改动主题模板。
 */

:root {
  --wiki-navy: #3b1813;
  --wiki-teal: #c2410c;
  --wiki-teal-bright: #f97316;
  --wiki-cyan: #fb923c;
  --wiki-amber: #d97706;
  --wiki-orange: #e24a1d;
  --wiki-violet: #9f1239;
  --wiki-red: #b91c1c;
  --wiki-surface: #fffdfa;
  --wiki-surface-soft: #fff7f1;
  --wiki-line: #efd8cc;
  --wiki-text-muted: #765d54;
  --wiki-focus: #9a3412;
  --wiki-radius-sm: 0.55rem;
  --wiki-radius-md: 0.9rem;
  --wiki-radius-lg: 1.35rem;
  --wiki-shadow-sm: 0 8px 24px rgba(124, 45, 18, 0.09);
  --wiki-shadow-md: 0 18px 50px rgba(124, 45, 18, 0.16);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #c2410c;
  --md-primary-fg-color--light: #f97316;
  --md-primary-fg-color--dark: #9a3412;
  --md-accent-fg-color: #e24a1d;
  --md-default-bg-color: #fffaf6;
  --md-default-fg-color: #321c16;
  --md-typeset-a-color: #b9380a;
  --md-code-bg-color: #fff0e6;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #9a3412;
  --md-primary-fg-color--light: #fb923c;
  --md-primary-fg-color--dark: #7c2d12;
  --md-accent-fg-color: #fb923c;
  --md-default-bg-color: #17100f;
  --md-default-fg-color: #f8ede7;
  --md-typeset-a-color: #fdba74;
  --md-code-bg-color: #2b1a17;
  --wiki-surface: #241714;
  --wiki-surface-soft: #2a1b17;
  --wiki-line: #4b2d26;
  --wiki-text-muted: #c8aaa0;
  --wiki-focus: #fdba74;
  --wiki-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
  --wiki-shadow-md: 0 18px 50px rgba(0, 0, 0, 0.34);
}

html {
  scroll-behavior: smooth;
}

body,
input {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
}

.md-header {
  background: linear-gradient(115deg, #8f2d15 0%, #c2410c 58%, #ea580c 100%);
  background-size: 180% 180%;
  box-shadow: 0 2px 18px rgba(124, 45, 18, 0.24);
  animation: header-gradient 16s ease-in-out infinite alternate;
}

.md-tabs {
  background: linear-gradient(115deg, #8f2d15 0%, #c2410c 62%, #ea580c 100%);
  background-size: 180% 180%;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  animation: header-gradient 16s ease-in-out infinite alternate;
}

[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-tabs {
  background: linear-gradient(115deg, #321411 0%, #7f1d1d 58%, #9a3412 100%);
}

.md-header__button.md-logo {
  transition: transform 180ms ease;
}

.md-header__button.md-logo:hover {
  transform: rotate(-6deg) scale(1.06);
}

/* Keep the brand stable instead of swapping it with the current page title. */
.md-header__title .md-header__topic:first-child {
  z-index: 0 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  transition: none !important;
}

.md-header__title .md-header__topic[data-md-component="header-topic"] {
  display: none;
}

.md-search__form {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.7rem;
}

.md-header__option[data-md-component="palette"] {
  display: inline-flex;
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0.36rem 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
  box-shadow: none;
  transition: none;
}

.md-header__option[data-md-component="palette"] > label.md-header__button[hidden] {
  display: none !important;
}

.md-header__option[data-md-component="palette"] > label.md-header__button:not([hidden]) {
  display: inline-grid !important;
  width: 1.9rem;
  min-width: 1.9rem;
  max-width: 1.9rem;
  height: 1.9rem;
  min-height: 1.9rem;
  max-height: 1.9rem;
  flex: 0 0 1.9rem;
  place-items: center;
  margin: 0;
  padding: 0.4rem;
  border-radius: 0.48rem;
  box-sizing: border-box;
  color: #c2410c;
  background: #fff7ed;
  opacity: 1;
  transform: none !important;
  transition: color 150ms ease, background-color 150ms ease;
}

.md-header__option[data-md-component="palette"] .md-header__button:hover {
  background: #fff;
  color: #9a3412;
}

.md-tabs__inner,
.md-tabs__list {
  justify-content: center;
}

.md-tabs__inner {
  display: flex;
}

.md-status--draft::after {
  background-color: var(--wiki-amber);
}

.md-main__inner {
  margin-top: 1.4rem;
}

.md-content__inner {
  padding-bottom: 3.5rem;
  animation: page-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.78;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: var(--md-default-fg-color);
  font-weight: 730;
  letter-spacing: -0.025em;
}

.md-typeset h1 {
  margin-bottom: 0.8rem;
}

.md-typeset h2 {
  margin-top: 2.1rem;
  padding-bottom: 0.38rem;
  border-bottom: 1px solid var(--wiki-line);
}

.md-typeset h2 .headerlink,
.md-typeset h3 .headerlink {
  color: var(--wiki-teal-bright);
}

.md-typeset a:not(.md-button):not(.portal-card) {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

.md-typeset a:focus-visible,
.md-button:focus-visible,
.portal-card:focus-visible {
  outline: 3px solid var(--wiki-focus);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

.home-hero .md-button:focus-visible,
.md-header__button:focus-visible,
.md-tabs__link:focus-visible {
  outline: 3px solid #fef08a;
  outline-offset: 3px;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  border: 1px solid var(--wiki-line);
  border-radius: var(--wiki-radius-md);
  overflow: hidden;
  box-shadow: var(--wiki-shadow-sm);
}

.md-typeset table:not([class]) th {
  padding: 0.75rem 0.8rem;
  background: color-mix(in srgb, var(--wiki-teal) 11%, var(--wiki-surface));
  color: var(--md-default-fg-color);
  font-weight: 720;
}

.md-typeset table:not([class]) td {
  padding: 0.72rem 0.8rem;
  vertical-align: top;
  border-top-color: var(--wiki-line);
}

.md-typeset table:not([class]) tbody tr {
  transition: background-color 150ms ease;
}

.md-typeset table:not([class]) tbody tr:hover {
  background: color-mix(in srgb, var(--wiki-teal) 5%, transparent);
}

.md-typeset code {
  border-radius: 0.35rem;
}

.md-typeset .instrument-id,
.md-typeset .member-id {
  font-family: var(--md-text-font-family), sans-serif;
  font-size: 0.95em;
  font-weight: 720;
  letter-spacing: 0.035em;
  color: var(--md-default-fg-color);
  white-space: nowrap;
}

.md-typeset .admonition,
.md-typeset details {
  border-width: 0 0 0 0.22rem;
  border-radius: var(--wiki-radius-md);
  box-shadow: var(--wiki-shadow-sm);
}

.md-typeset .admonition.incomplete,
.md-typeset details.incomplete {
  border-color: var(--wiki-orange);
  background: color-mix(in srgb, var(--wiki-amber) 8%, var(--wiki-surface));
}

.md-typeset .incomplete > .admonition-title,
.md-typeset .incomplete > summary {
  background: color-mix(in srgb, var(--wiki-amber) 15%, transparent);
}

.md-typeset .incomplete > .admonition-title::before,
.md-typeset .incomplete > summary::before {
  background-color: var(--wiki-orange);
  -webkit-mask-image: none;
  mask-image: none;
  content: "!";
  color: #fff;
  width: 1.05rem;
  height: 1.05rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  width: max-content;
  max-width: 100%;
  padding: 0.18rem 0.52rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: 0.015em;
  text-align: left;
  white-space: normal;
  box-shadow: 0 2px 8px color-mix(in srgb, currentColor 12%, transparent);
}

.status-badge::before {
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 0.42rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-fill {
  color: #c2410c;
  background: #fff7ed;
}

.status-confirm {
  color: #b45309;
  background: #fffbeb;
}

.status-create {
  color: #6d28d9;
  background: #f5f3ff;
}

.status-link {
  color: #0369a1;
  background: #f0f9ff;
}

.status-critical {
  color: #b91c1c;
  background: #fef2f2;
}

.status-draft {
  color: #9f1239;
  background: #fff1f2;
}

[data-md-color-scheme="slate"] .status-fill {
  color: #fdba74;
  background: #431407;
}

[data-md-color-scheme="slate"] .status-confirm {
  color: #fde68a;
  background: #422006;
}

[data-md-color-scheme="slate"] .status-create {
  color: #c4b5fd;
  background: #2e1065;
}

[data-md-color-scheme="slate"] .status-link {
  color: #7dd3fc;
  background: #082f49;
}

[data-md-color-scheme="slate"] .status-critical {
  color: #fca5a5;
  background: #450a0a;
}

[data-md-color-scheme="slate"] .status-draft {
  color: #fecdd3;
  background: #4c0519;
}

.status-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.6rem;
}

.status-legend > div {
  padding: 0.9rem 1rem;
  border: 1px solid var(--wiki-line);
  border-radius: var(--wiki-radius-md);
  background: var(--wiki-surface);
}

.status-legend p {
  margin: 0.55rem 0 0;
  color: var(--wiki-text-muted);
  font-size: 0.75rem;
}

.home-hero {
  --spot-x: 76%;
  --spot-y: 22%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 0 0.9rem;
  padding: clamp(1.15rem, 2.5vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--wiki-radius-lg);
  background:
    radial-gradient(circle at 88% 18%, rgba(253, 186, 116, 0.32), transparent 24%),
    radial-gradient(circle at 72% 92%, rgba(251, 146, 60, 0.26), transparent 27%),
    linear-gradient(135deg, #4c1d1d 0%, #9a3412 54%, #ea580c 100%);
  background-size: 130% 130%;
  color: #fff7ed;
  box-shadow: var(--wiki-shadow-md);
  animation: hero-gradient 14s ease-in-out infinite alternate;
}

[data-md-color-scheme="slate"] .home-hero {
  border-color: rgba(253, 186, 116, 0.16);
  background:
    radial-gradient(circle at 88% 18%, rgba(194, 65, 12, 0.3), transparent 24%),
    radial-gradient(circle at 72% 92%, rgba(127, 29, 29, 0.34), transparent 27%),
    linear-gradient(135deg, #25100e 0%, #4c1d1d 56%, #7c2d12 100%);
}

.home-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at var(--spot-x) var(--spot-y), rgba(255, 237, 213, 0.24), transparent 24%),
    radial-gradient(circle, rgba(255, 255, 255, 0.14) 0.06rem, transparent 0.07rem);
  background-position: center, 0 0;
  background-size: auto, 1.05rem 1.05rem;
  content: "";
  opacity: 0.72;
  transition: background-position 120ms linear;
  animation: dot-drift 18s linear infinite;
}

.home-hero::after {
  position: absolute;
  z-index: -1;
  right: -2.5rem;
  bottom: -4.5rem;
  width: 9rem;
  height: 9rem;
  border: 1.25rem solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
  animation: ring-float 8s ease-in-out infinite alternate;
}

.home-hero .hero-kicker {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: #fed7aa;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 1.2rem rgba(254, 215, 170, 0.45);
}

.home-hero h1 {
  max-width: 26ch;
  margin: 0 0 0.45rem;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 0.18rem 1.4rem rgba(69, 10, 10, 0.2);
}

.home-hero h1 .headerlink {
  display: none;
}

.home-hero > p {
  max-width: 44rem;
  margin: 0;
  color: #ffedd5;
  font-size: 0.78rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.hero-actions > p {
  display: contents;
}

.hero-actions .md-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-width: 1px;
  border-radius: 0.65rem;
  font-size: 0.75rem;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.hero-actions .md-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, 0.42) 50%, transparent 72%);
  content: "";
  transform: translateX(-145%);
  transition: transform 520ms ease;
}

.hero-actions .md-button--primary {
  border-color: #fff7ed;
  background: #fff7ed;
  color: #9a3412;
}

.hero-actions .md-button:not(.md-button--primary) {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.hero-actions .md-button:hover {
  border-color: #fff;
  background: #fff;
  color: #9a3412;
  transform: translateY(-2px);
}

.hero-actions .md-button:hover::after {
  transform: translateX(145%);
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.9rem 0 1.35rem;
}

.home-metric {
  position: relative;
  overflow: hidden;
  padding: 0.85rem 1rem;
  border: 1px solid var(--wiki-line);
  border-radius: var(--wiki-radius-md);
  background: var(--wiki-surface);
}

.home-metric::before {
  position: absolute;
  inset: 0 0 auto;
  height: 0.16rem;
  background: linear-gradient(90deg, #9a3412, #f97316, #fdba74);
  content: "";
  transform: scaleX(0.34);
  transform-origin: left;
  transition: transform 320ms ease;
}

.home-metric:hover::before {
  transform: scaleX(1);
}

.home-metric strong {
  display: block;
  color: var(--wiki-teal);
  font-size: 0.95rem;
}

[data-md-color-scheme="slate"] .home-metric strong {
  color: #fdba74;
}

.home-metric span {
  color: var(--wiki-text-muted);
  font-size: 0.68rem;
}

.section-lead {
  max-width: 48rem;
  margin: -0.3rem auto 0.5rem;
  color: var(--wiki-text-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

h2[id="快速入口"] {
  max-width: 45rem;
  margin-right: auto;
  margin-left: auto;
}

.portal-grid {
  display: grid;
  width: 100%;
  max-width: 45rem;
  grid-template-columns: repeat(auto-fit, 6rem);
  gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem auto 1rem;
}

.portal-card {
  --card-x: 50%;
  --card-y: 50%;
  --card-accent: #e24a1d;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
  border: 1px solid var(--wiki-line);
  border-radius: var(--wiki-radius-md);
  background: linear-gradient(145deg, var(--wiki-surface), color-mix(in srgb, var(--card-accent) 4%, var(--wiki-surface)));
  color: var(--md-default-fg-color) !important;
  text-decoration: none !important;
  box-shadow: var(--wiki-shadow-sm);
  touch-action: manipulation;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, box-shadow 220ms ease;
}

.portal-card:nth-child(3n + 2) {
  --card-accent: #f59e0b;
}

.portal-card:nth-child(3n) {
  --card-accent: #be123c;
}

.portal-card::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: radial-gradient(circle at var(--card-x) var(--card-y), color-mix(in srgb, var(--card-accent) 18%, transparent), transparent 42%);
  content: "";
  opacity: 0;
  transition: opacity 220ms ease;
}

.portal-card > * {
  position: relative;
  z-index: 1;
}

.portal-card::after {
  display: none;
}

.portal-card:hover {
  border-color: color-mix(in srgb, var(--wiki-teal) 55%, var(--wiki-line));
  transform: translateY(-4px) scale(1.008);
  box-shadow: var(--wiki-shadow-md);
}

.portal-card:hover::before,
.portal-card:focus-visible::before {
  opacity: 1;
}

.portal-card:hover::after {
  transform: none;
}

.portal-card__icon {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  margin-bottom: 0.55rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--wiki-teal) 12%, var(--wiki-surface));
  color: var(--card-accent);
  font-size: 0.9rem;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease;
}

.portal-card__icon .twemoji,
.portal-card__icon svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.portal-card:hover .portal-card__icon {
  background: color-mix(in srgb, var(--card-accent) 15%, var(--wiki-surface));
  transform: translateY(-2px) rotate(-4deg) scale(1.08);
}

.portal-card strong {
  display: block;
  margin-bottom: 0;
  font-size: 0.65rem;
  line-height: 1.35;
  text-align: center;
}

.portal-card .status-badge {
  margin-top: auto;
  transform: scale(0.75);
  transform-origin: left bottom;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 1rem 0 2rem;
  counter-reset: workflow;
}

.workflow__step {
  position: relative;
  padding: 1rem 1rem 1rem 3.2rem;
  border: 1px solid var(--wiki-line);
  border-radius: var(--wiki-radius-md);
  background: var(--wiki-surface-soft);
  counter-increment: workflow;
  transition: transform 200ms ease, border-color 180ms ease, background-color 180ms ease;
}

.workflow__step:hover {
  border-color: color-mix(in srgb, var(--wiki-teal) 38%, var(--wiki-line));
  background: color-mix(in srgb, var(--wiki-teal) 5%, var(--wiki-surface-soft));
  transform: translateY(-2px);
}

.workflow__step::before {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--wiki-teal);
  color: #fff;
  content: counter(workflow, decimal-leading-zero);
  font-size: 0.58rem;
  font-weight: 800;
}

.workflow__step strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.workflow__step span {
  color: var(--wiki-text-muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.motion-reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 520ms ease var(--reveal-delay, 0ms), transform 620ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

.motion-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes header-gradient {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes hero-gradient {
  from { background-position: 0% 35%; }
  to { background-position: 100% 65%; }
}

@keyframes dot-drift {
  from { background-position: center, 0 0; }
  to { background-position: center, 1.05rem 1.05rem; }
}

@keyframes ring-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-0.8rem, -0.65rem, 0) scale(1.05); }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(0.45rem); }
  to { opacity: 1; transform: translateY(0); }
}

.md-footer {
  border-top: 1px solid var(--wiki-line);
}

.md-typeset__scrollwrap {
  margin-right: -0.5rem;
  margin-left: -0.5rem;
  padding: 0.2rem 0.5rem 0.65rem;
  scrollbar-color: color-mix(in srgb, var(--wiki-teal) 42%, transparent) transparent;
  scrollbar-width: thin;
}

.md-typeset__scrollwrap::-webkit-scrollbar {
  height: 0.42rem;
}

.md-typeset__scrollwrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--wiki-teal) 42%, transparent);
}

.md-typeset__scrollwrap::-webkit-scrollbar-track {
  background: transparent;
}

/* Documentation screenshots: preserve aspect ratio and fit the reading column. */
.wiki-screenshot {
  width: min(100%, 58rem);
  margin: 1.35rem auto;
}

.wiki-screenshot > img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--wiki-line) 76%, var(--wiki-teal));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--wiki-surface) 90%, var(--wiki-teal) 10%);
  box-shadow:
    0 1.15rem 2.5rem color-mix(in srgb, var(--wiki-ink) 13%, transparent),
    0 0 0 0.2rem color-mix(in srgb, var(--wiki-surface) 82%, transparent);
}

.wiki-screenshot figcaption {
  margin-top: 0.65rem;
  color: var(--wiki-text-muted);
  font-size: 0.68rem;
  line-height: 1.55;
  text-align: center;
}

@media screen and (min-width: 76.25em) {
  .md-grid {
    max-width: 78rem;
  }

  .md-sidebar--primary {
    border-right: 1px solid color-mix(in srgb, var(--wiki-line) 72%, transparent);
    background: color-mix(in srgb, var(--wiki-surface) 18%, transparent);
  }
}

@media screen and (max-width: 60em) {
  .portal-grid {
    grid-template-columns: repeat(auto-fit, 7.25rem);
  }

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

@media screen and (max-width: 44.984375em) {
  .md-main__inner {
    margin-top: 0.6rem;
  }

  .md-typeset {
    font-size: 0.78rem;
  }

  .home-hero {
    border-radius: 1rem;
  }

  .home-metrics,
  .status-legend {
    grid-template-columns: 1fr;
  }

  .portal-grid {
    grid-template-columns: repeat(auto-fit, minmax(6.75rem, 7.25rem));
  }

  .portal-card {
    min-height: 0;
  }

  .md-header__button[for="__drawer"]:not([hidden]),
  .md-header__button[for="__search"]:not([hidden]) {
    display: inline-grid;
    place-items: center;
  }

  .md-header__option[data-md-component="palette"] > label.md-header__button:not([hidden]) {
    min-height: 1.9rem;
  }

  .md-typeset__scrollwrap {
    margin-right: -0.8rem;
    margin-left: -0.8rem;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .md-typeset table:not([class]) {
    display: block;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .md-typeset table:not([class]):has(th:nth-child(4)) {
    min-width: 40rem;
  }

  .md-typeset table:not([class]) th,
  .md-typeset table:not([class]) td {
    min-width: 7.5rem;
  }

  .md-typeset table:not([class]) th:first-child,
  .md-typeset table:not([class]) td:first-child {
    min-width: 6.8rem;
  }

  .md-typeset pre,
  .md-typeset code {
    overflow-wrap: normal;
  }

  .wiki-screenshot {
    margin: 1.1rem auto;
  }

  .wiki-screenshot > img {
    border-radius: 0.8rem;
  }
}

@media screen and (max-width: 29.984375em) {
  .home-hero {
    padding: 1.05rem 1rem;
  }

  .home-hero h1 {
    font-size: 1.45rem;
  }

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

  .hero-actions .md-button {
    width: auto;
    padding-right: 0.55rem;
    padding-left: 0.55rem;
    font-size: 0.68rem;
  }

  .md-typeset .admonition,
  .md-typeset details {
    margin-right: 0;
    margin-left: 0;
  }
}

@media (hover: none), (pointer: coarse) {
  .portal-card:hover,
  .workflow__step:hover,
  .hero-actions .md-button:hover {
    transform: none;
  }

  .portal-card::before {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .motion-reveal {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  .md-typeset a:focus-visible,
  .md-button:focus-visible,
  .portal-card:focus-visible,
  .md-header__button:focus-visible,
  .md-tabs__link:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 3px;
  }

  .status-badge {
    border-width: 2px;
  }

  .home-hero::before,
  .home-hero::after,
  .portal-card::before,
  .home-metric::before,
  .hero-actions .md-button::after {
    display: none;
  }
}

/* Scientific collage theme: one shared image, tuned per color scheme. */
:root {
  --wiki-navy: #1d2a2b;
  --wiki-teal: #176b68;
  --wiki-teal-bright: #258c83;
  --wiki-cyan: #397e89;
  --wiki-amber: #9b6b22;
  --wiki-orange: #a44035;
  --wiki-violet: #75405d;
  --wiki-red: #96343c;
  --wiki-focus: #176b68;
  --wiki-surface: rgba(253, 251, 246, 0.92);
  --wiki-surface-soft: rgba(244, 241, 232, 0.88);
  --wiki-line: rgba(44, 63, 63, 0.2);
  --wiki-text-muted: #596563;
  --wiki-shadow-sm: 0 0.35rem 1.15rem rgba(28, 39, 39, 0.1);
  --wiki-shadow-md: 0 0.8rem 2.4rem rgba(28, 39, 39, 0.16);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #315c59;
  --md-primary-fg-color--light: #4b7d78;
  --md-primary-fg-color--dark: #203f3e;
  --md-accent-fg-color: #9b3d35;
  --md-default-bg-color: #eee9de;
  --md-default-fg-color: #202a29;
  --md-typeset-a-color: #176b68;
  --md-code-bg-color: rgba(232, 227, 215, 0.94);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #182728;
  --md-primary-fg-color--light: #31504f;
  --md-primary-fg-color--dark: #10191a;
  --md-accent-fg-color: #d47767;
  --md-default-bg-color: #101617;
  --md-default-fg-color: #e7ece8;
  --md-typeset-a-color: #73b9b0;
  --md-code-bg-color: rgba(27, 37, 38, 0.96);
  --wiki-surface: rgba(20, 29, 30, 0.92);
  --wiki-surface-soft: rgba(27, 38, 39, 0.9);
  --wiki-line: rgba(150, 181, 176, 0.23);
  --wiki-text-muted: #afbfbb;
  --wiki-focus: #85c8bf;
  --wiki-shadow-sm: 0 0.4rem 1.3rem rgba(0, 0, 0, 0.28);
  --wiki-shadow-md: 0 0.9rem 2.6rem rgba(0, 0, 0, 0.42);
}

body[data-md-color-scheme="default"] {
  background-color: #e9e3d7;
  background-image:
    linear-gradient(rgba(248, 246, 239, 0.18), rgba(238, 234, 224, 0.3)),
    url("../images/backgrounds/scientific-collage.webp");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}

body[data-md-color-scheme="slate"] {
  background-color: #0d1314;
  background-image:
    linear-gradient(rgba(8, 15, 16, 0.68), rgba(11, 17, 18, 0.78)),
    url("../images/backgrounds/scientific-collage.webp");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  background-blend-mode: multiply, luminosity;
}

.md-container,
.md-main {
  background: transparent;
}

.md-content {
  background: rgba(246, 243, 235, 0.68);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--wiki-line) 72%, transparent);
  border-radius: 0.7rem;
  -webkit-backdrop-filter: blur(0.22rem);
  backdrop-filter: blur(0.22rem);
  box-shadow: 0 0.4rem 1.4rem rgba(24, 38, 37, 0.07);
}

body:has(.home-hero) .md-main__inner {
  max-width: 52.5rem;
}

body:has(.home-hero) .md-content {
  background: rgba(246, 243, 235, 0.46);
}

body[data-md-color-scheme="slate"] .md-content {
  background: rgba(12, 22, 23, 0.72);
}

body[data-md-color-scheme="slate"]:has(.home-hero) .md-content {
  background: rgba(12, 22, 23, 0.54);
}

.md-content__inner {
  padding: 1rem 1.2rem 3.5rem;
}

.md-sidebar--primary,
.md-sidebar--secondary {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body[data-md-color-scheme="default"] .md-sidebar--primary,
body[data-md-color-scheme="default"] .md-sidebar--secondary {
  background: transparent;
}

body[data-md-color-scheme="slate"] .md-sidebar--primary,
body[data-md-color-scheme="slate"] .md-sidebar--secondary {
  background: transparent;
}

.md-sidebar--primary {
  border-right: 0;
  box-shadow: none;
}

.md-sidebar--secondary {
  border-left: 0;
  box-shadow: none;
}

.md-sidebar__inner > .md-nav {
  overflow: hidden;
  padding: 0.5rem 0;
  border: 1px solid color-mix(in srgb, var(--wiki-line) 76%, transparent);
  border-radius: 0.55rem;
  -webkit-backdrop-filter: blur(0.55rem) saturate(0.86);
  backdrop-filter: blur(0.55rem) saturate(0.86);
  box-shadow: 0 0.35rem 1.1rem rgba(24, 38, 37, 0.09);
}

body[data-md-color-scheme="default"] .md-sidebar__inner > .md-nav {
  background: rgba(246, 243, 235, 0.68);
}

body[data-md-color-scheme="slate"] .md-sidebar__inner > .md-nav {
  background: rgba(12, 22, 23, 0.72);
}

.md-sidebar__inner > .md-nav > .md-nav__title {
  min-height: 0;
  margin: 0;
  padding: 0 0.7rem 0.25rem;
  background: transparent;
  line-height: 1.45;
}

.md-sidebar__inner > .md-nav > .md-nav__list {
  padding: 0 0.7rem;
}

.md-sidebar__inner > .md-nav > .md-nav__list > .md-nav__item:first-child > .md-nav__link {
  margin-top: 0.25rem;
}

.md-sidebar__inner > .md-nav > .md-nav__list > .md-nav__item:last-child > .md-nav__link {
  margin-bottom: 0;
}

@media screen and (max-width: 76.234375em) {
  .md-sidebar__inner > .md-nav.md-nav--primary > .md-nav__title[for="__drawer"] {
    min-height: 5.6rem;
    padding: 3rem 0.8rem 0.2rem;
    line-height: 2.4rem;
  }
}

body[data-md-color-scheme="default"] .md-sidebar .md-nav__link {
  color: #263230;
  opacity: 1;
}

body[data-md-color-scheme="slate"] .md-sidebar .md-nav__link {
  color: #e4ebe7;
  opacity: 1;
}

body[data-md-color-scheme="default"] .md-sidebar .md-nav__link--active,
body[data-md-color-scheme="default"] .md-sidebar .md-nav__link:hover {
  color: #0d6963;
}

body[data-md-color-scheme="slate"] .md-sidebar .md-nav__link--active,
body[data-md-color-scheme="slate"] .md-sidebar .md-nav__link:hover {
  color: #83d0c5;
}

.md-header,
.md-tabs {
  background-color: #183333;
  background-image:
    linear-gradient(90deg, rgba(12, 42, 41, 0.84), rgba(28, 39, 38, 0.8) 58%, rgba(52, 35, 40, 0.84)),
    url("../images/backgrounds/scientific-collage.webp");
  background-repeat: no-repeat;
  background-size: 100% auto;
  animation: none;
}

.md-header {
  background-position: center top;
  box-shadow: 0 0.12rem 0.8rem rgba(11, 24, 24, 0.28);
}

.md-tabs {
  background-color: #244140;
  background-image: none;
  border-top-color: rgba(255, 255, 255, 0.12);
}

[data-md-color-scheme="slate"] .md-header {
  background-color: #101e1f;
  background-image:
    linear-gradient(90deg, rgba(8, 25, 25, 0.92), rgba(19, 27, 27, 0.9) 58%, rgba(36, 25, 30, 0.92)),
    url("../images/backgrounds/scientific-collage.webp");
}

[data-md-color-scheme="slate"] .md-tabs {
  background-color: #172b2b;
  background-image: none;
}

.md-tabs__link {
  color: rgba(247, 250, 247, 0.86);
  font-weight: 650;
  opacity: 1;
}

.md-tabs__item--active .md-tabs__link,
.md-tabs__link:hover,
.md-tabs__link:focus-visible {
  color: #fff;
  opacity: 1;
}

.md-header__title,
.md-tabs__link {
  text-shadow: 0 0.06rem 0.32rem rgba(0, 0, 0, 0.52);
}

.md-header__option[data-md-component="palette"] > label.md-header__button:not([hidden]) {
  color: #255f5b;
  background: #eef1e9;
}

.md-header__option[data-md-component="palette"] .md-header__button:hover {
  color: #7e302f;
  background: #fff;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.home-hero .hero-kicker,
.home-hero h1 {
  letter-spacing: 0;
}

.home-hero {
  min-height: clamp(6.2rem, 13vw, 7.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.2rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  background-image: none !important;
  color: #202a29;
  box-shadow: none;
  text-align: center;
  animation: none;
}

.home-hero::before,
.home-hero::after {
  display: none;
}

.home-hero .hero-kicker {
  margin-bottom: 0.18rem;
  color: #8e3b35;
  font-size: 0.56rem;
  text-shadow: none;
}

.home-hero h1 {
  max-width: 24ch;
  margin-bottom: 0.2rem;
  color: #1e2928;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  text-shadow: 0 0.08rem 0.65rem rgba(255, 252, 244, 0.9);
}

.home-hero > p {
  font-size: 0.7rem;
  line-height: 1.45;
  color: #465452;
}

@media screen and (min-width: 76.25em) {
  body:has(.home-hero) .md-sidebar--primary {
    display: none;
  }
}

body:has(.home-hero) .md-footer {
  display: none;
}

body:has(.home-hero) .md-content__inner {
  padding-top: 0.35rem;
}

[data-md-color-scheme="slate"] .home-hero,
[data-md-color-scheme="slate"] .home-hero h1 {
  color: #eff3ef;
}

[data-md-color-scheme="slate"] .home-hero h1 {
  text-shadow: 0 0.12rem 1rem rgba(0, 0, 0, 0.85);
}

[data-md-color-scheme="slate"] .home-hero .hero-kicker {
  color: #d98979;
}

[data-md-color-scheme="slate"] .home-hero > p {
  color: #c6d2ce;
}

.hero-actions {
  justify-content: center;
}

.hero-actions .md-button--primary {
  border-color: #1d6561;
  background: #1d6561;
  color: #fff;
}

.hero-actions .md-button:not(.md-button--primary) {
  border-color: rgba(38, 65, 63, 0.42);
  background: rgba(250, 248, 242, 0.72);
  color: #273b39;
}

[data-md-color-scheme="slate"] .hero-actions .md-button:not(.md-button--primary) {
  border-color: rgba(142, 181, 175, 0.45);
  background: rgba(19, 30, 31, 0.72);
  color: #e5ece8;
}

.local-services {
  display: grid;
  max-width: 48rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 auto 1rem;
}

.local-services > p {
  display: contents;
}

.local-services a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 0.75rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--wiki-line);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--wiki-surface) 92%, transparent);
  color: var(--md-default-fg-color) !important;
  text-decoration: none !important;
  box-shadow: var(--wiki-shadow-sm);
}

.local-services a:hover {
  border-color: var(--wiki-teal);
  background: var(--wiki-surface);
}

.local-services span {
  color: var(--wiki-text-muted);
  font-size: 0.62rem;
}

.local-services strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--wiki-teal);
  font-size: 0.9rem;
}

.local-services small {
  color: var(--wiki-text-muted);
  font-size: 0.62rem;
}

.portal-card,
.home-metric,
.status-legend > div,
.workflow__step {
  background: color-mix(in srgb, var(--wiki-surface) 92%, transparent);
  -webkit-backdrop-filter: blur(0.18rem);
  backdrop-filter: blur(0.18rem);
}

.portal-card {
  border-radius: 0.45rem;
}

.portal-card:nth-child(3n + 2) {
  --card-accent: #9b6b22;
}

.portal-card:nth-child(3n) {
  --card-accent: #96343c;
}

.portal-card__icon {
  color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 11%, var(--wiki-surface));
  line-height: 0;
}

.portal-card__icon .twemoji {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  line-height: 0;
}

.portal-card__icon .twemoji svg {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.portal-card__icon:has(+ strong) {
  font-weight: 750;
}

.home-metric::before {
  background: linear-gradient(90deg, #176b68, #9b6b22, #96343c);
}

.home-metric strong,
[data-md-color-scheme="slate"] .home-metric strong {
  color: var(--wiki-teal-bright);
}

.status-fill {
  color: #7c3d34;
  background: #f5e7df;
}

.status-confirm {
  color: #785418;
  background: #f3ead2;
}

.status-create {
  color: #75405d;
  background: #eee4ea;
}

.status-link {
  color: #176b68;
  background: #dfedeb;
}

.status-critical,
.status-draft {
  color: #8d3039;
  background: #f3dfe1;
}

[data-md-color-scheme="slate"] .status-fill,
[data-md-color-scheme="slate"] .status-confirm,
[data-md-color-scheme="slate"] .status-create,
[data-md-color-scheme="slate"] .status-link,
[data-md-color-scheme="slate"] .status-critical,
[data-md-color-scheme="slate"] .status-draft {
  background: rgba(16, 24, 25, 0.86);
}

.md-footer {
  background: rgba(17, 28, 29, 0.94);
}

@media screen and (max-width: 44.984375em) {
  body[data-md-color-scheme] {
    background-attachment: scroll;
    background-position: center top;
  }

  .md-content__inner {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .home-hero {
    min-height: 7.5rem;
    padding: 0.8rem 0.35rem;
  }
}

@media screen and (max-width: 29.984375em) {
  .local-services {
    grid-template-columns: 1fr;
  }
}
