/* MCIF Demo — 浅色生物科技感主题 */

:root {
  --bg-deep: #eef5ff;
  --bg-mid: #f8fbff;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-panel-solid: #ffffff;
  --border-subtle: rgba(37, 99, 235, 0.18);
  --border-glow: rgba(37, 99, 235, 0.45);
  --accent-cyan: #0ea5e9;
  --accent-blue: #2563eb;
  --accent-mint: #0d9488;
  --accent-violet: #6366f1;
  /* 雾霾绿 — 全站标题 / 表头 / 主按钮 */
  --sage-heading: #2f4b42;
  --sage-text: #49675d;
  --sage-table-head-bg: #e3ece7;
  --sage-table-head-border: #c9d8cf;
  --sage-soft-bg: #eef5f1;
  --sage-soft-bg-2: #e8f0ec;
  --sage-soft-gradient: linear-gradient(180deg, #f2f7f4, #e3ece7);
  --sage-active-gradient: linear-gradient(180deg, #dff0e8, #cfe0d6);
  --sage-accent: #5f7f74;
  --sage-accent-light: #95aea2;
  --sage-btn-bg: #dbe8e0;
  --sage-btn-border: #a9beb3;
  --sage-btn-hover: #5f7f74;
  --sage-hint-border: #a9beb3;
  --sage-hint-bg: #eef5f1;
  --text: #0b2a5b;
  --text-muted: #35507f;
  --text-dim: #617ba3;
  --danger: #f87171;
  --nav-height: 56px;
  --desktop-chrome-height: 0px;
  --layout-top-inset: 0px;
  /* 顶栏底边 → 页面首块内容（全站统一） */
  --page-content-top: 0.5rem;
  /* 浏览器窗口左/右边缘 → 顶栏文字、页面标题、卡片外缘（全宽布局，仅留此 padding） */
  --page-inset-x: 15px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
  --fs-base: 17px;
  --fs-sm: 0.95rem;
  --fs-xs: 0.9rem;
  --ui-font-scale: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  font-size: calc(var(--fs-base) * var(--ui-font-scale, 1));
  background: #ecefee;
}

/* English desktop: hide flat Imaging Control tabs until grouped into dropdown */
html.mcif-desktop-app.mcif-lang-en:not(.mcif-nav-ready) .topnav .nav-links > a.nav-link[data-page="calibration"],
html.mcif-desktop-app.mcif-lang-en:not(.mcif-nav-ready) .topnav .nav-links > a.nav-link[data-page="fluidics"],
html.mcif-desktop-app.mcif-lang-en:not(.mcif-nav-ready) .topnav .nav-links > a.nav-link[data-page="fluidics-prep"],
html.mcif-desktop-app.mcif-lang-en:not(.mcif-nav-ready) .topnav .nav-links > a.nav-link[data-page="realtime"] {
  display: none !important;
}

/* Desktop: hide demo login pills before auth-nav injects real user */
html.mcif-desktop-app .nav-actions a.nav-pill[href^="/login/"] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--bg-mid);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(14, 165, 233, 0.08), transparent 45%),
    linear-gradient(var(--bg-mid) 0%, var(--bg-deep) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(37, 99, 235, 0.035) 31px,
      rgba(37, 99, 235, 0.035) 32px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 31px,
      rgba(37, 99, 235, 0.035) 31px,
      rgba(37, 99, 235, 0.035) 32px
    );
  background-attachment: fixed;
}

/* —— 顶栏（参考横向管理条 + 玻璃态） —— */
.topnav {
  position: sticky;
  top: var(--layout-top-inset);
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid rgba(108, 131, 156, 0.26);
  background: linear-gradient(90deg, rgba(242, 247, 253, 0.94) 0%, rgba(232, 240, 249, 0.92) 48%, rgba(240, 246, 252, 0.94) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 3px 14px rgba(41, 58, 78, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.topnav-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 var(--page-inset-x);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
  box-sizing: border-box;
}

/* —— 双行顶栏：首行系统名 + 用户操作，次行标签菜单 —— */
html.mcif-topnav-dual {
  --nav-bar-height: 52px;
  --nav-menu-height: 44px;
  --nav-height: calc(var(--nav-bar-height) + var(--nav-menu-height));
}

html.mcif-topnav-dual .topnav {
  height: auto;
  min-height: var(--nav-height);
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

html.mcif-topnav-dual .topnav-inner {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  height: auto;
  padding: 0;
}

html.mcif-topnav-dual .topnav-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-bar-height);
  padding: 0 var(--page-inset-x);
  overflow: hidden;
  border-bottom: 1px solid rgba(38, 88, 102, 0.4);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.03) 62%,
      rgba(255, 255, 255, 0.06) 88%,
      rgba(255, 255, 255, 0.05) 100%
    ),
    linear-gradient(
      90deg,
      #12384A 0%,
      #1D5A70 42%,
      #1a5364 62%,
      #1c5d6e 80%,
      #206674 94%,
      #206674 100%
    );
  box-shadow:
    0 4px 20px rgba(18, 56, 74, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html.mcif-topnav-dual .topnav-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      rgba(255, 255, 255, 0.022) 47px,
      rgba(255, 255, 255, 0.022) 48px
    ),
    radial-gradient(ellipse 42% 125% at 90% 50%, rgba(32, 102, 116, 0.2), transparent 66%),
    radial-gradient(ellipse 38% 110% at 10% 50%, rgba(18, 56, 74, 0.16), transparent 58%);
}

html.mcif-topnav-dual .topnav-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(70, 115, 125, 0.28) 30%,
    rgba(90, 130, 140, 0.42) 88%,
    rgba(90, 130, 140, 0.42) 100%
  );
}

html.mcif-topnav-dual .topnav-bar .brand {
  position: relative;
  z-index: 1;
  display: inline-flex !important;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ecf8fb;
  text-shadow: 0 0 18px rgba(94, 234, 212, 0.22);
}

html.mcif-topnav-dual .topnav-bar .brand::before {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 8px rgba(94, 234, 212, 0.35));
}

html.mcif-topnav-dual .topnav-bar .nav-actions {
  position: relative;
  z-index: 1;
  margin-left: auto;
  flex-shrink: 0;
}

html.mcif-topnav-dual .topnav-bar .nav-actions .nav-pill {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(148, 210, 200, 0.38) !important;
  color: #e8f6f3 !important;
  backdrop-filter: blur(6px);
}

html.mcif-topnav-dual .topnav-bar .nav-actions a.nav-pill:hover,
html.mcif-topnav-dual .topnav-bar .nav-actions button.nav-pill:hover {
  background: rgba(94, 234, 212, 0.16) !important;
  border-color: rgba(94, 234, 212, 0.55) !important;
  color: #ffffff !important;
}

html.mcif-topnav-dual .topnav-bar .nav-actions .nav-pill.danger,
html.mcif-topnav-dual .topnav-bar .nav-actions a.nav-pill[href="/logout"] {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(148, 210, 200, 0.38) !important;
  color: #e8f6f3 !important;
}

html.mcif-topnav-dual .topnav-bar .nav-actions .nav-pill.danger:hover,
html.mcif-topnav-dual .topnav-bar .nav-actions a.nav-pill[href="/logout"]:hover {
  background: rgba(94, 234, 212, 0.16) !important;
  border-color: rgba(94, 234, 212, 0.55) !important;
  color: #ffffff !important;
}

html.mcif-topnav-dual .topnav-menu-row {
  display: flex;
  align-items: center;
  min-height: var(--nav-menu-height);
  padding: 0 var(--page-inset-x);
  background: linear-gradient(180deg, rgba(251, 252, 253, 0.98) 0%, rgba(240, 245, 243, 0.96) 100%);
  border-bottom: 1px solid rgba(108, 131, 156, 0.26);
  box-shadow: 0 3px 12px rgba(41, 58, 78, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html.mcif-topnav-dual .topnav-menu-row .nav-links {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0;
}

html.mcif-desktop-app.mcif-topnav-dual:not(.mcif-lang-en) {
  --fs-base: 14px;
  --nav-bar-height: 46px;
  --nav-menu-height: 42px;
  --nav-height: calc(var(--nav-bar-height) + var(--nav-menu-height));
  --page-content-top: 0.35rem;
  --page-inset-x: 12px;
  overflow-x: clip;
}

html.mcif-desktop-app.mcif-topnav-dual:not(.mcif-lang-en) .topnav-bar .brand {
  font-size: 0.98rem;
  letter-spacing: 0.03em;
}

html.mcif-desktop-app.mcif-topnav-dual:not(.mcif-lang-en) .topnav-bar .brand::before {
  width: 22px;
  height: 22px;
}

html.mcif-desktop-app.mcif-topnav-dual .topnav-bar .brand {
  display: inline-flex !important;
}

html.mcif-topnav-dual:not(.mcif-lang-en) .topnav {
  overflow: visible;
  z-index: 100;
}

html.mcif-topnav-dual:not(.mcif-lang-en) .topnav-menu-row,
html.mcif-topnav-dual:not(.mcif-lang-en) .topnav-menu-row .nav-links {
  overflow: visible;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--sage-heading);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: url("/static/mcif-icon.png") center / contain no-repeat;
  box-shadow: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  color: #334155;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 0.4rem 0.76rem;
  border-radius: 999px;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: linear-gradient(180deg, #78988c 0%, #5f7f74 58%, #49675d 100%);
  border-color: rgba(184, 205, 197, 0.72);
  font-weight: 700;
  box-shadow:
    0 0 12px rgba(123, 156, 143, 0.28),
    0 6px 16px rgba(73, 103, 93, 0.28);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.topnav .nav-actions .nav-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  padding: 0.3rem 0.72rem !important;
  border-radius: 999px;
  border: 1px solid #c7dbff !important;
  background: #f2f7f4 !important;
  color: #49675d !important;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.topnav .nav-actions span.nav-pill {
  cursor: default;
  opacity: 0.92;
}

.topnav .nav-actions a.nav-pill:hover {
  background: #dbe8e0 !important;
  border-color: #95aea2 !important;
  color: #2f4b42 !important;
  box-shadow: none !important;
}

.topnav .nav-actions button.nav-pill {
  cursor: pointer;
  font-family: inherit;
}

.topnav .nav-actions button.nav-pill:hover {
  background: #dbe8e0 !important;
  border-color: #95aea2 !important;
  color: #2f4b42 !important;
}

.topnav .nav-actions .nav-pill.danger,
.topnav .nav-actions a.nav-pill[href="/logout"] {
  color: #49675d !important;
  border-color: #c7dbff !important;
  background: #f2f7f4 !important;
}

.topnav .nav-actions .nav-pill.danger:hover,
.topnav .nav-actions a.nav-pill[href="/logout"]:hover {
  color: #2f4b42 !important;
  background: #dbe8e0 !important;
  border-color: #95aea2 !important;
  box-shadow: none !important;
}

/* Topnav tabs: never inherit page-level button font-weight overrides */
.topnav .nav-link,
.topnav button.nav-dropdown-trigger,
.topnav .nav-dropdown-trigger {
  font-weight: 700 !important;
}

/* 桌面 exe 内嵌窗口：导航单行不换行，品牌标题与标签页同字号 */
html.mcif-desktop-app .topnav-inner {
  gap: 0.55rem;
}

html.mcif-desktop-app .topnav .brand {
  font-size: 0.93rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0;
  gap: 0.45rem;
  max-width: none;
  overflow: visible;
}

html.mcif-desktop-app .topnav .brand::before {
  width: 18px;
  height: 18px;
}

html.mcif-desktop-app .nav-link {
  font-size: 0.93rem;
  padding: 0.36rem 0.62rem;
}

/* 中文桌面版（旧单行顶栏）：隐藏品牌；双行顶栏时由 .mcif-topnav-dual 规则显示 */
html.mcif-desktop-app:not(.mcif-lang-en):not(.mcif-topnav-dual) .topnav .brand {
  display: none !important;
}

/* 中文桌面版：1920×1080 紧凑字号与布局 */
html.mcif-desktop-app:not(.mcif-lang-en):not(.mcif-topnav-dual) {
  --fs-base: 14px;
  --nav-height: 48px;
  --page-content-top: 0.35rem;
  --page-inset-x: 12px;
  overflow-x: clip;
}

html.mcif-desktop-app:not(.mcif-lang-en) body {
  overflow-x: clip;
  max-width: 100%;
}

html.mcif-desktop-app:not(.mcif-lang-en) .page,
html.mcif-desktop-app:not(.mcif-lang-en) .topnav-inner,
html.mcif-desktop-app:not(.mcif-lang-en) main {
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
}

html.mcif-desktop-app:not(.mcif-lang-en) .card {
  max-width: 100%;
  box-sizing: border-box;
}

/* 中文界面：循环染色 hover/click 下拉（网页版与中文桌面） */
html:not(.mcif-lang-en) .topnav {
  overflow: visible;
  z-index: 100;
}

html:not(.mcif-lang-en) .nav-links {
  overflow: visible;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-trigger {
  cursor: pointer;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700 !important;
  white-space: nowrap;
  color: #334155 !important;
  padding: 0.4rem 0.76rem;
  border-radius: 999px;
  line-height: 1.1;
  box-shadow: none !important;
  letter-spacing: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

html.mcif-desktop-app:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-trigger {
  font-size: 0.94rem;
  padding: 0.34rem 0.56rem;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-trigger::after {
  content: " ▾";
  font-size: 0.85em;
  opacity: 0.75;
  line-height: 1;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 100200;
  min-width: 12.5rem;
  flex-direction: column;
  align-items: stretch;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(108, 131, 156, 0.28);
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
  box-shadow: 0 10px 28px rgba(41, 58, 78, 0.14);
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] button.nav-dropdown-trigger:hover,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-trigger:hover,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] button.nav-dropdown-trigger:focus-visible,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-trigger:focus-visible,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] button.nav-dropdown-trigger.active,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-trigger.active,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"].is-open .nav-dropdown-trigger,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"]:focus-within .nav-dropdown-trigger,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"]:hover .nav-dropdown-trigger {
  color: #ffffff !important;
  background: linear-gradient(180deg, #78988c 0%, #5f7f74 58%, #49675d 100%) !important;
  border-color: rgba(184, 205, 197, 0.72) !important;
  box-shadow:
    0 0 12px rgba(123, 156, 143, 0.28),
    0 6px 16px rgba(73, 103, 93, 0.28) !important;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"]:hover .nav-dropdown-menu,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"]:focus-within .nav-dropdown-menu,
html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"].is-open .nav-dropdown-menu {
  display: flex;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-menu .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 8px;
}

html:not(.mcif-lang-en) .nav-dropdown[data-nav-group="staining-cycle"] .nav-dropdown-menu .nav-link:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #78988c 0%, #5f7f74 58%, #49675d 100%);
  border-color: rgba(184, 205, 197, 0.72);
  box-shadow: 0 4px 12px rgba(73, 103, 93, 0.2);
}

/* 宽表格仅在容器内横向滚动，不撑开整页 */
html.mcif-desktop-app:not(.mcif-lang-en) .table-wrap,
html.mcif-desktop-app:not(.mcif-lang-en) .ab-table-wrap,
html.mcif-desktop-app:not(.mcif-lang-en) .sr-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

html.mcif-desktop-app:not(.mcif-lang-en) table.lines {
  max-width: 100%;
}

html.mcif-desktop-app:not(.mcif-lang-en) .sample-list-pane table.lines:not(.block-folder) {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}

html.mcif-desktop-app:not(.mcif-lang-en) .nav-link {
  font-size: 0.94rem;
  padding: 0.34rem 0.56rem;
}

html.mcif-desktop-app .topnav .nav-actions .nav-pill {
  font-size: 0.82rem;
  padding: 0.3rem 0.72rem;
  white-space: nowrap;
}

/* English desktop: hide in-app brand (native title bar already shows app name) */
html.mcif-desktop-app.mcif-lang-en .topnav .brand {
  display: none !important;
}

/* English desktop: nav overflow must not clip Imaging Control dropdown */
html.mcif-desktop-app.mcif-lang-en .topnav {
  overflow: visible;
  z-index: 100;
}

html.mcif-desktop-app.mcif-lang-en .nav-links {
  overflow: visible;
}

/* English desktop: Imaging Control hover/click dropdown */
html.mcif-desktop-app.mcif-lang-en .nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
}

html.mcif-desktop-app.mcif-lang-en button.nav-dropdown-trigger,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown-trigger {
  cursor: pointer;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 700 !important;
  white-space: nowrap;
  color: #334155 !important;
  padding: 0.36rem 0.62rem;
  border-radius: 999px;
  line-height: 1.1;
  box-shadow: none !important;
  letter-spacing: normal;
}

html.mcif-desktop-app.mcif-lang-en .nav-dropdown-trigger::after {
  content: " ▾";
  font-size: 0.72em;
  opacity: 0.75;
}

html.mcif-desktop-app.mcif-lang-en .nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 100200;
  min-width: 12.5rem;
  flex-direction: column;
  align-items: stretch;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(108, 131, 156, 0.28);
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
  box-shadow: 0 10px 28px rgba(41, 58, 78, 0.14);
}

html.mcif-desktop-app.mcif-lang-en button.nav-dropdown-trigger:hover,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown-trigger:hover,
html.mcif-desktop-app.mcif-lang-en button.nav-dropdown-trigger:focus-visible,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown-trigger:focus-visible,
html.mcif-desktop-app.mcif-lang-en button.nav-dropdown-trigger.active,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown-trigger.active,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown.is-open .nav-dropdown-trigger,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown:focus-within .nav-dropdown-trigger,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown:hover .nav-dropdown-trigger {
  color: #ffffff !important;
  background: linear-gradient(180deg, #78988c 0%, #5f7f74 58%, #49675d 100%) !important;
  border-color: rgba(184, 205, 197, 0.72) !important;
  box-shadow:
    0 0 12px rgba(123, 156, 143, 0.28),
    0 6px 16px rgba(73, 103, 93, 0.28) !important;
}

html.mcif-desktop-app.mcif-lang-en .nav-dropdown:hover .nav-dropdown-menu,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown:focus-within .nav-dropdown-menu,
html.mcif-desktop-app.mcif-lang-en .nav-dropdown.is-open .nav-dropdown-menu {
  display: flex;
}

html.mcif-desktop-app.mcif-lang-en .nav-dropdown-menu .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 8px;
}

html.mcif-desktop-app.mcif-lang-en .nav-dropdown-menu .nav-link:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #78988c 0%, #5f7f74 58%, #49675d 100%);
  border-color: rgba(184, 205, 197, 0.72);
  box-shadow: 0 4px 12px rgba(73, 103, 93, 0.2);
}

.font-scale-control {
  margin-top: 0.65rem;
  max-width: 28rem;
}

.font-scale-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.font-scale-head strong {
  font-size: 1.15rem;
  color: #2f4b42;
  font-variant-numeric: tabular-nums;
}

.font-scale-slider {
  width: 100%;
  margin: 0;
  accent-color: #5f7f74;
  cursor: pointer;
}

.font-scale-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #667079;
  font-variant-numeric: tabular-nums;
}

.font-scale-preview {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed #c9d8cf;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  line-height: 1.55;
}

/* —— 主内容 —— */
main.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--page-content-top) var(--page-inset-x) 2.2rem;
  box-sizing: border-box;
}

.page-lead {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  max-width: 52rem;
}

.page-lead code {
  font-size: 0.82em;
}

h1.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #2f4b42;
  -webkit-text-fill-color: #2f4b42;
}

/* 循环染色二级页：内容区首行显示当前子页名称 */
h1.mcif-subnav-page-heading {
  display: block !important;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2f4b42;
  margin: 0 0 0.65rem;
  padding: 0;
  letter-spacing: 0.025em;
  line-height: 1.3;
  height: auto !important;
  overflow: visible !important;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--sage-heading);
  margin: 0 0 0.65rem;
  letter-spacing: 0.02em;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0;
  align-items: center;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  margin: 0 0 1rem;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
}

/* 流路卡片：一行 3 个 */
.line-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 1280px) {
  .line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .line-grid {
    grid-template-columns: 1fr;
  }
}

.line-card {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  background: rgba(246, 250, 255, 0.95);
  box-shadow: inset 0 0 10px rgba(37, 99, 235, 0.08);
}

.line-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.line-slot {
  font-weight: 700;
  color: var(--sage-heading);
}

/* 流路卡片：左标签区可收缩，右侧体积列保留最小宽度避免挤在一起 */
.line-card-mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, auto);
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.35rem 0 0;
  width: 100%;
  min-width: 0;
}

.line-label-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 默认每行 2 个蛋白+通道组合（2 列等宽，子项拉满格内宽度） */
.line-label-visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem 0.42rem;
  align-content: start;
  justify-items: stretch;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.4rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(37, 99, 235, 0.12);
  line-height: 1.35;
  overflow: visible;
}

.line-label-visual--empty {
  color: var(--text-muted);
}

.line-label-visual-placeholder {
  grid-column: 1 / -1;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0.15rem 0;
}

.line-label-token {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 0.14rem;
  padding: 0.14rem 0.26rem;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.28);
  border: 1px solid rgba(100, 116, 139, 0.28);
  box-sizing: border-box;
}

/* 与页面青蓝主色互补：橙框均分灰框内剩余宽度，文字过长省略 */
.line-label-protein {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.1rem 0.28rem;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.84rem;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.28), rgba(245, 158, 11, 0.2));
  color: #78350f;
  border: 1px solid rgba(217, 119, 6, 0.38);
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 通道标签：与弹窗 .fluid-ch-tag 共用六色（488/647/532/555/594/750） */
.line-label-ch {
  flex-shrink: 0;
  padding: 0.08rem 0.28rem;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  border: 1.5px solid transparent;
  box-sizing: border-box;
  align-self: center;
}

/* 卡片内通道格固定最小宽度，使左右两列橙框剩余宽度一致 */
.line-label-token .line-label-ch {
  min-width: 3.1rem;
  text-align: center;
}

.line-label-ch--488,
.fluid-ch-tag--488 {
  border-color: #0284c7;
  background: linear-gradient(180deg, rgba(186, 230, 253, 0.92), rgba(125, 211, 252, 0.5));
  color: #0c4a6e;
}

.line-label-ch--647,
.fluid-ch-tag--647 {
  border-color: #e11d48;
  background: linear-gradient(180deg, rgba(254, 205, 211, 0.95), rgba(251, 113, 133, 0.45));
  color: #881337;
}

.line-label-ch--532,
.fluid-ch-tag--532 {
  border-color: #16a34a;
  background: linear-gradient(180deg, rgba(187, 247, 208, 0.95), rgba(134, 239, 172, 0.5));
  color: #14532d;
}

.line-label-ch--555,
.fluid-ch-tag--555 {
  border-color: #ca8a04;
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.95), rgba(253, 224, 71, 0.45));
  color: #713f12;
}

.line-label-ch--594,
.fluid-ch-tag--594 {
  border-color: #ea580c;
  background: linear-gradient(180deg, rgba(255, 237, 213, 0.95), rgba(253, 186, 116, 0.5));
  color: #7c2d12;
}

.line-label-ch--750,
.fluid-ch-tag--750 {
  border-color: #6d28d9;
  background: linear-gradient(180deg, rgba(221, 214, 254, 0.95), rgba(196, 181, 253, 0.55));
  color: #3b0764;
}

.line-label-ch--other,
.fluid-ch-tag--other {
  border-color: rgba(37, 99, 235, 0.55);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.22), rgba(37, 99, 235, 0.12));
  color: #1e1b4b;
}

/* 二抗流路：宿主标签（尺寸与 .line-label-ch 一致；i0–i5 与六通道同色） */
.line-label-host {
  flex-shrink: 0;
  padding: 0.08rem 0.28rem;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  border: 1.5px solid transparent;
  box-sizing: border-box;
  align-self: center;
}

.line-label-token .line-label-host {
  min-width: 3.1rem;
  text-align: center;
}

.line-label-host--empty {
  border-color: rgba(71, 85, 105, 0.42);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(226, 232, 240, 0.62));
  color: #334155;
}

.line-label-host--i0 {
  border-color: #0284c7;
  background: linear-gradient(180deg, rgba(186, 230, 253, 0.92), rgba(125, 211, 252, 0.5));
  color: #0c4a6e;
}

.line-label-host--i1 {
  border-color: #e11d48;
  background: linear-gradient(180deg, rgba(254, 205, 211, 0.95), rgba(251, 113, 133, 0.45));
  color: #881337;
}

.line-label-host--i2 {
  border-color: #16a34a;
  background: linear-gradient(180deg, rgba(187, 247, 208, 0.95), rgba(134, 239, 172, 0.5));
  color: #14532d;
}

.line-label-host--i3 {
  border-color: #ca8a04;
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.95), rgba(253, 224, 71, 0.45));
  color: #713f12;
}

.line-label-host--i4 {
  border-color: #ea580c;
  background: linear-gradient(180deg, rgba(255, 237, 213, 0.95), rgba(253, 186, 116, 0.5));
  color: #7c2d12;
}

.line-label-host--i5 {
  border-color: #6d28d9;
  background: linear-gradient(180deg, rgba(221, 214, 254, 0.95), rgba(196, 181, 253, 0.55));
  color: #3b0764;
}

.line-label-raw {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.14rem 0.36rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-label-frag {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.line-label-frag .line-label-token {
  flex: 1 1 0%;
  min-width: 0;
}

.line-label-frag-remove {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 5px;
  font-size: 0.85rem;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.line-label-frag:hover .line-label-frag-remove,
.line-label-frag:focus-within .line-label-frag-remove {
  opacity: 1;
  pointer-events: auto;
}

.line-label-frag-remove:hover {
  background: rgba(239, 68, 68, 0.28);
}

.line-vol-cluster {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding-left: 0.15rem;
}

.line-vol-fields {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.line-vol-fields label {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  line-height: 1.15;
}

/* 输入在上，/ max uL 在下；右列加宽后略放大输入便于阅读 */
.line-vol-fields input.vol {
  width: 4.35rem;
  max-width: 5rem;
  padding: 0.16rem 0.32rem;
  font-size: 0.86rem;
  text-align: right;
  box-sizing: border-box;
}

.line-vol-fields .vol-max {
  display: block;
  font-size: 0.78rem;
  line-height: 1.15;
}

@media (max-width: 640px) {
  .line-card-mid {
    grid-template-columns: 1fr;
  }

  .line-label-cell {
    min-width: 0;
  }

  .line-vol-cluster {
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-left: 0;
  }
}

@media (max-width: 420px) {
  .line-label-visual {
    grid-template-columns: 1fr;
  }
}

.muted {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* 按钮 */
a.btn,
button {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--sage-btn-border);
  background: var(--sage-btn-bg);
  color: var(--sage-heading);
  text-decoration: none;
  font-size: 0.96rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}

a.btn:hover,
button:hover:not(:disabled) {
  background: var(--sage-btn-hover);
  border-color: var(--sage-btn-hover);
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.2);
  color: #fff;
}

button:disabled,
a.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

a.btn.secondary,
button.secondary {
  border-color: var(--sage-btn-border);
  background: var(--sage-btn-bg);
  color: var(--sage-heading);
}

a.btn.secondary:hover,
button.secondary:hover {
  border-color: var(--sage-btn-hover);
  background: var(--sage-btn-hover);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.2);
}

a.btn.danger,
button.danger {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(251, 113, 133, 0.22);
  color: #6b1028;
  font-weight: 700;
}

a.btn.danger:hover,
button.danger:hover {
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.28);
  color: #4a0d1d;
}

/* 实验流程页：确保粉色按钮文字不被通用按钮样式覆盖 */
.map-editor button.danger,
.map-editor a.btn.danger,
.step-row button.danger {
  color: #6b1028 !important;
  border-color: rgba(244, 63, 94, 0.48) !important;
  background: rgba(251, 113, 133, 0.24) !important;
}

.map-editor button.danger:hover,
.step-row button.danger:hover {
  color: #4a0d1d !important;
}

a.btn.outline {
  background: transparent;
  border-color: var(--sage-accent-light);
  color: var(--sage-heading);
}

a.btn.outline:hover {
  background: var(--sage-soft-bg);
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.16);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}

/* 栅格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.grid .card {
  margin: 0;
}

img.thumb {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.08);
}

img.thumb.wb-zoomable {
  cursor: zoom-in;
}

pre {
  background: rgba(241, 247, 255, 0.95);
  border: 1px solid var(--border-subtle);
  color: #0f766e;
  padding: 0.85rem 1rem;
  overflow: auto;
  font-size: 0.9rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  box-shadow: inset 0 0 14px rgba(37, 99, 235, 0.08);
}

label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--sage-accent-light);
  box-shadow: 0 0 0 2px rgba(149, 174, 162, 0.24);
}

/* 流路页：芯片 */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 720px) {
  .chip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chip {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem 0.75rem;
  text-align: center;
  cursor: pointer;
  background: rgba(248, 252, 255, 1);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chip:hover {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.chip.active {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18), inset 0 0 20px rgba(34, 211, 238, 0.05);
  font-weight: 600;
}

.chip .t {
  font-size: 1.05rem;
  color: var(--text);
}

.chip .s {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

/* 表格 */
table.lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

table.lines th,
table.lines td {
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: middle;
}

table.lines th {
  background: var(--sage-table-head-bg);
  color: var(--sage-heading);
  border-color: var(--sage-table-head-border);
  font-weight: 700;
}

table.lines tbody tr:hover {
  background: rgba(95, 127, 116, 0.06);
}

table.lines input.vol {
  width: 5rem;
}

table.lines input.lbl {
  width: 100%;
  max-width: 14rem;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.vol-wrap input.vol {
  width: 6rem;
}

.vol-max {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.vol-viz {
  position: relative;
  width: 22px;
  height: 64px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: rgba(248, 252, 255, 1);
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
}

.vol-viz .fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(0deg, #22d3ee, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  transition: height 0.2s ease;
  z-index: 1;
  max-height: 64px;
}

.vol-viz .label {
  position: absolute;
  top: -1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.vol-viz .vol-viz-max {
  position: absolute;
  right: -2.35rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 500;
}

.b-ab {
  background: rgba(14, 165, 233, 0.2);
  color: #0b4a86;
  border: 1px solid rgba(14, 165, 233, 0.38);
  font-weight: 700;
}

.b-buf {
  background: rgba(13, 148, 136, 0.18);
  color: #0f4f53;
  border: 1px solid rgba(13, 148, 136, 0.34);
  font-weight: 700;
}

.b-aux {
  background: rgba(99, 102, 241, 0.18);
  color: #3730a3;
  border: 1px solid rgba(99, 102, 241, 0.34);
  font-weight: 700;
}

textarea.params {
  width: 100%;
  min-height: 2.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.step-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 11rem 4rem 2.6rem 2.6rem;
  gap: 0.45rem;
  align-items: center;
  margin: 0.45rem 0;
  padding: 0.45rem 0.4rem;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #dbe7f5;
}

.step-row.step-row--no-view {
  grid-template-columns: 2.5rem 1fr 11rem 2.6rem 2.6rem;
}

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

.step-row .icon-btn {
  min-width: 2.1rem;
  width: 2.3rem;
  height: 2rem;
  padding: 0;
  text-align: center;
  line-height: 1;
  font-weight: 700;
  justify-self: center;
}

.step-row input[readonly] {
  background: #eef3f9 !important;
  border-color: #d8e3f0;
  cursor: move;
  user-select: none;
}

/* 实验流程：抗体孵育步骤内嵌流路同款蛋白+通道标签 */
.step-row-incubation {
  align-items: flex-start;
}

.step-title-incubation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.35rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.28rem 0.45rem;
  min-height: 2.35rem;
  background: #eef3f9;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.step-incubation-prefix,
.step-incubation-suffix {
  flex-shrink: 0;
  color: var(--sage-heading);
  font-weight: 600;
  white-space: nowrap;
}

/* 不伸展，避免把「, 30min)」挤到最右侧 */
.step-embed-label-visual {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  width: max-content;
  margin: 0;
}

/* 实验流程内嵌：单行紧凑排列（不用流路卡片的 2 列网格） */
.step-embed-label-visual.line-label-visual {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.26rem;
  padding: 0.12rem 0;
  background: transparent;
  border: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.step-embed-label-visual .line-label-visual-placeholder {
  grid-column: unset;
  flex-shrink: 0;
}

.step-embed-label-visual .line-label-raw {
  grid-column: unset;
  flex-shrink: 0;
}

.step-embed-label-visual .line-label-token {
  flex-shrink: 0;
  width: max-content;
  max-width: none;
  align-items: center;
}

.step-embed-label-visual .line-label-protein {
  flex: 0 0 auto;
  width: auto;
  max-width: 11rem;
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 0.11rem 0.28rem;
  border: 1.5px solid rgba(217, 119, 6, 0.38);
  justify-content: flex-start;
}

.step-embed-label-visual .line-label-ch {
  font-size: 0.76rem;
  line-height: 1.2;
  padding: 0.11rem 0.28rem;
  align-self: center;
  min-width: 2.85rem;
}

@media (max-width: 900px) {
  .step-embed-label-visual {
    flex: 0 1 auto;
    max-width: 100%;
    width: max-content;
  }
}

.plus-menu {
  position: relative;
}

.plus-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent-cyan);
  border-radius: 8px;
}

.plus-menu summary::-webkit-details-marker {
  display: none;
}

.plus-menu summary:hover {
  background: rgba(14, 165, 233, 0.18);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.16);
}

.plus-menu-pop {
  position: absolute;
  top: 2.2rem;
  right: 0;
  z-index: 30;
  min-width: 8.6rem;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
  padding: 0.25rem;
}

.plus-opt {
  width: 100%;
  text-align: left;
  margin: 0.1rem 0;
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  font-size: 0.88rem;
}

#mcifDialogRoot {
  z-index: 100500;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(760px, 96vw);
  background: #eaf3ff;
  border: 2px solid rgba(37, 99, 235, 0.55);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(30, 64, 175, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.75) inset;
  padding: 1.05rem 1.35rem;
  color: var(--sage-heading);
}

.modal-card h3 {
  margin: 0 0 0.6rem;
  color: #1452b8;
  font-size: 1.15rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(37, 99, 235, 0.18);
}

.mcif-dialog-body {
  margin: 0.1rem 0 0.05rem;
}

.mcif-dialog-msg {
  margin: 0 0 0.75rem;
  color: var(--sage-text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.mcif-dialog-field {
  display: block;
  margin: 0;
}

.mcif-dialog-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.15rem;
  padding: 0.48rem 0.62rem;
  border: 1px solid #a9beb3;
  border-radius: 8px;
  background: #fff;
  color: #1f252a;
  font: inherit;
}

.mcif-dialog-input:focus {
  outline: none;
  border-color: #95aea2;
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.28);
}

.mcif-dialog-err {
  margin: 0.45rem 0 0;
  color: #be123c;
  font-size: 0.9rem;
}

.modal-channel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  margin-top: 0.25rem;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #143a72;
  font-size: 0.88rem;
}

.fluid-add-channel-rows {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fluid-add-ch-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.fluid-add-ch-row .fluid-ch-tag {
  flex: 0 0 3.35rem;
  box-sizing: border-box;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 0.3rem 0.35rem;
  border-radius: 7px;
  font-size: 0.88rem;
  border: 1.5px solid transparent;
}

.fluid-add-ch-row input.fluid-add-protein {
  flex: 1;
  min-width: 0;
}

/* 直标模式不展示宿主列；二抗模式与通道色块行并排 */
.fluid-add-ch-row input.fluid-add-host {
  display: none;
  flex: 0 0 7.75rem;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.28);
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.92);
}

#fluidAddModal.fluid-add--secondary .fluid-add-ch-row input.fluid-add-host {
  display: block;
}

.err {
  color: var(--danger);
  font-size: 1rem;
  padding: 0.5rem 0;
}

.err:empty {
  display: none;
  padding: 0;
  margin: 0;
}

select option {
  background: var(--bg-panel-solid);
  color: var(--text);
}

/* 实验 Map：步骤块与参数面板（人机表单，非 JSON） */
.step-block {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.65rem 0;
  background: rgba(250, 253, 255, 1);
}

.step-row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.step-row-head .step-num {
  min-width: 1.5rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.step-row-head .st-title {
  flex: 1;
  min-width: 12rem;
}

.step-row-head .st-key {
  width: 11rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.param-panel {
  padding: 0.5rem 0 0.25rem;
  border-top: 1px dashed var(--border-subtle);
  margin-top: 0.35rem;
}

.param-field {
  margin: 0.45rem 0;
}

.param-field > label:first-child {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.param-field input[type="text"],
.param-field input[type="number"],
.param-field textarea,
.param-field select {
  width: 100%;
  max-width: 36rem;
}

.param-field textarea {
  min-height: 3rem;
  resize: vertical;
}

.param-hint {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.slot-grid label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.slot-grid input[type="checkbox"] {
  accent-color: var(--accent-cyan);
}

.step-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  align-items: flex-end;
}

.step-block-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  .step-block-wrap {
    grid-template-columns: 1fr;
  }
}

/* 实验Map：左侧树 + 右侧编辑区 */
.map-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0.9rem;
}

main.page.workbench-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--page-content-top) var(--page-inset-x) 1rem;
  box-sizing: border-box;
}

main.page.workbench-page .page-lead {
  max-width: none;
}

.workbench-layout.map-layout,
.workbench-page .workbench-layout.map-layout {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(220px, 16vw) minmax(0, 1fr) minmax(300px, 22vw);
  gap: 0.65rem;
}

@media (max-width: 1280px) {
  .workbench-layout.map-layout,
  .workbench-page .workbench-layout.map-layout {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  }
  .wb-protein-detail-sidebar {
    display: none;
  }
}

.map-sidebar {
  position: sticky;
  top: calc(var(--layout-top-inset) + var(--nav-height) + 10px);
  max-height: calc(100vh - var(--nav-height) - 26px);
  overflow: auto;
}

.map-tree {
  margin-top: 0.45rem;
}

.map-tree details {
  border-left: 1px dashed var(--border-subtle);
  margin-left: 0.35rem;
  padding-left: 0.45rem;
  margin: 0.2rem 0;
}

.map-tree .tree-click {
  cursor: pointer;
  user-select: none;
}

.map-tree summary {
  cursor: pointer;
  color: #334155;
  font-size: 0.88rem;
  padding: 0.18rem 0;
  margin: 0.2rem 0;
  list-style-position: inside;
}

.map-tree .tree-list {
  list-style: none;
  margin: 0.15rem 0 0.5rem;
  padding: 0;
}

/* 成像工作台 / 染色结果汇总 · 统一 MAP 行与蛋白数徽章 */
.map-tree-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0.2rem 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #c9d8cf;
  background: #f2f6f4;
  color: #2f4b42;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.map-tree-row__check {
  flex: 0 0 auto;
  margin: 0;
}

.map-tree-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.map-tree-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.map-tree-protein-count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.02rem 0.38rem;
  border-radius: 999px;
  background: #f5e6d3;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  flex-shrink: 0;
}

label.map-tree-row {
  cursor: pointer;
}

button.tree-map-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  margin: 0.2rem 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #c9d8cf;
  background: #f2f6f4;
  color: #2f4b42;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
}

.tree-map-btn.active {
  border-color: #95aea2;
  background: linear-gradient(180deg, #e8f0eb, #dbe8e0);
  box-shadow: inset 0 0 0 1px rgba(95, 127, 116, 0.15);
  color: #2f4b42;
}

.map-editor {
  min-width: 0;
}

.workbench-layout .map-editor #wbCycleImageHost {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.workbench-layout .map-editor #wbCycleImageHost > .card {
  margin: 0;
}

.wb-protein-panel {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.92);
}

.wb-protein-checklist {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  margin-top: 0.35rem;
  overflow: visible;
  align-items: center;
  padding-top: 0.06rem;
}

.wb-protein-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(100, 116, 139, 0.28);
  background: rgba(148, 163, 184, 0.2);
  cursor: pointer;
  padding: 0.08rem 0.14rem;
  gap: 0.08rem;
  align-items: center;
  display: inline-flex;
  width: max-content;
  flex: 0 0 auto;
  max-width: none;
}

.wb-protein-chip.active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22);
  transform: none;
}

/* 成像工作台蛋白标签：压缩字号与间距，避免出现滚动框并尽量一行显示 */
.wb-protein-checklist .wb-protein-chip .line-label-protein {
  font-size: 0.72rem;
  padding: 0.06rem 0.18rem;
  max-width: 5.5rem;
}

.wb-protein-checklist .wb-protein-chip .line-label-ch {
  font-size: 0.68rem;
  padding: 0.06rem 0.18rem;
  min-width: 2.45rem;
}

@media (max-width: 1320px) {
  .workbench-layout .map-editor #wbCycleImageHost {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .workbench-layout .map-editor #wbCycleImageHost {
    grid-template-columns: 1fr;
  }
}

.realtime-state-card strong {
  color: var(--sage-heading);
}

.realtime-dual-pane {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.8rem;
}

.realtime-pane {
  min-width: 0;
}

.realtime-pane-title {
  margin: 0 0 0.35rem;
  color: var(--sage-heading);
  font-size: 1.02rem;
}

.realtime-frame {
  border: 1px solid var(--sage-table-head-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sage-soft-bg-2);
}

#rtMosaicCanvas {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 980px) {
  .realtime-dual-pane {
    grid-template-columns: 1fr;
  }
}

.wb-zoom-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: hidden;
}

.wb-zoom-viewport {
  margin-top: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #0b1220;
  min-height: 60vh;
  max-height: 72vh;
  overflow: auto;
  display: grid;
  place-items: center;
}

.wb-zoom-viewport img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  transition: transform 0.06s linear;
  user-select: none;
  -webkit-user-drag: none;
}

/* 实验管理：左侧略窄（约 15%～22%），右侧 Map 列表 */
.map-layout.exp-mgmt-map-layout {
  grid-template-columns: minmax(200px, 20%) minmax(0, 1fr);
  align-items: start;
}

.map-list-card.map-card-flash {
  outline: 2px solid rgba(34, 211, 238, 0.65);
  outline-offset: 2px;
  transition: outline 0.2s ease;
}

.exp-mgmt-tree-actions {
  gap: 0.35rem;
}

.exp-mgmt-tree-actions .btn-sm {
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
}

.map-list-card strong {
  font-size: 0.98rem;
}

.map-list-card .muted {
  font-size: 0.8rem;
}

/* 右侧 Map 列表行高继续压缩（覆盖全局 .row 的默认外边距） */
.map-list-card {
  padding: 0.44rem 0.62rem !important;
}

.map-list-card .row {
  margin: 0 !important;
}

.exp-mgmt-map-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.exp-mgmt-map-actions {
  gap: 0.22rem;
}

.exp-mgmt-map-actions button {
  padding: 0.2rem 0.52rem;
  font-size: 0.76rem;
  line-height: 1.15;
}

.exp-mgmt-list-groups details {
  border-left: 1px dashed var(--border-subtle);
  margin-left: 0.2rem;
  padding-left: 0.42rem;
}

.exp-mgmt-list-year {
  margin: 0.18rem 0 0.45rem;
}

.exp-mgmt-list-month {
  margin: 0.12rem 0 0.28rem;
}

.exp-mgmt-list-year > summary,
.exp-mgmt-list-month > summary {
  font-size: 0.95rem;
}

.exp-mgmt-list-month-body {
  margin-top: 0.22rem;
}

.exp-mgmt-list-year > summary b,
.exp-mgmt-list-month > summary b {
  font-weight: 800;
  color: var(--sage-heading);
}

.exp-mgmt-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.16rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(219, 234, 254, 0.52);
  color: var(--sage-text);
  font-size: 0.78rem;
  line-height: 1.1;
}

.exp-mgmt-metric-pill b {
  font-weight: 800;
  color: var(--sage-heading);
}

/* 实验管理统计标签：复用流路页通道色系（488/647/532） */
.exp-mgmt-metric-pill--steps {
  border-color: #0284c7;
  background: linear-gradient(180deg, rgba(186, 230, 253, 0.92), rgba(125, 211, 252, 0.5));
  color: #0c4a6e;
}

.exp-mgmt-metric-pill--cycle {
  border-color: #e11d48;
  background: linear-gradient(180deg, rgba(254, 205, 211, 0.95), rgba(251, 113, 133, 0.45));
  color: #881337;
}

.exp-mgmt-metric-pill--protein {
  border-color: #16a34a;
  background: linear-gradient(180deg, rgba(187, 247, 208, 0.95), rgba(134, 239, 172, 0.5));
  color: #14532d;
}

.exp-mgmt-metric-pill--steps b,
.exp-mgmt-metric-pill--cycle b,
.exp-mgmt-metric-pill--protein b {
  color: inherit;
}

@media (max-width: 1080px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
  .map-layout.exp-mgmt-map-layout {
    grid-template-columns: 1fr;
  }
  .map-sidebar {
    position: static;
    max-height: none;
  }
}

.cycle-toolbar {
  align-items: center;
  gap: 0.5rem;
}

.cycle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cycle-tab.active {
  border-color: var(--sage-accent-light);
  color: var(--sage-heading);
  box-shadow: inset 0 0 0 1px rgba(95, 127, 116, 0.14);
}

/* 芯片校准页 */
.calib-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 0.9rem;
  align-items: start;
}

.calib-side,
.calib-main,
.calib-right {
  min-width: 0;
}

.calib-slot-list {
  display: grid;
  gap: 0.45rem;
}

.calib-slot-group {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(250, 253, 255, 1);
  padding: 0.45rem;
}

.calib-slot-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.calib-pos-btn {
  width: 100%;
  margin: 0.15rem 0;
  text-align: left;
  font-size: 0.88rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(250, 253, 255, 1);
  color: var(--text);
}

.calib-pos-btn.active {
  border-color: var(--sage-accent-light);
  color: var(--sage-heading);
  background: var(--sage-soft-bg);
  box-shadow: inset 0 0 0 1px rgba(95, 127, 116, 0.14);
}

.calib-viewport {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  background: #1a1f28;
}

.calib-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at center, #5d646f, #373d47 55%, #232833 100%);
}

.calib-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.calib-crosshair::before,
.calib-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(95, 127, 116, 0.72);
}

.calib-crosshair::before {
  left: calc(50% - 1px);
  top: 0;
  width: 2px;
  height: 100%;
}

.calib-crosshair::after {
  top: calc(50% - 1px);
  left: 0;
  width: 100%;
  height: 2px;
}

.calib-dot {
  position: absolute;
  left: calc(50% - 7px);
  top: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.35);
}

.calib-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  gap: 0.35rem;
  justify-content: center;
  margin: 0.45rem 0 0.65rem;
}

.calib-joy {
  width: 52px;
  height: 40px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.calib-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.btn-primary-strong {
  border-color: rgba(34, 211, 238, 0.75);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.26), rgba(56, 189, 248, 0.22));
  color: #dffbff;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.2);
}

@media (max-width: 1280px) {
  .calib-layout {
    grid-template-columns: 220px 1fr;
  }
  .calib-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .calib-layout {
    grid-template-columns: 1fr;
  }
}

/* —— 试剂准备：左侧试剂池 + 右侧流路配置 —— */
main.page.fluidics-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--page-content-top) var(--page-inset-x) 2.2rem;
  box-sizing: border-box;
}

.fluidics-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: stretch;
}

@media (max-width: 1040px) {
  .fluidics-workbench {
    grid-template-columns: 1fr;
  }

  .fluidics-palette {
    position: relative;
    top: auto;
    min-height: 0;
    border-right: none;
    padding-right: 0;
  }
}

.fluidics-palette {
  position: sticky;
  top: 0.65rem;
  margin-top: 0;
  align-self: stretch;
  min-height: calc(100vh - 6.5rem);
  border-right: 1px solid rgba(148, 163, 184, 0.35);
  padding-right: 1rem;
  box-sizing: border-box;
}

.fluidics-main {
  min-width: 0;
}

.fluidics-page-title {
  margin-top: 0;
}

.fluidics-map-hint {
  margin: 0.2rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sage-hint-border);
  border-radius: 10px;
  background: var(--sage-hint-bg);
  color: var(--sage-heading);
  font-weight: 700;
}

.fluidics-flow-panel {
  margin-top: 0.25rem;
}

.fluidics-flow-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sage-heading);
  letter-spacing: 0.02em;
}

.fluidics-flow-lead {
  margin: 0 0 0.65rem;
}

.fluidics-inner-card {
  margin-top: 0.75rem;
}

.fluidics-inner-card:first-of-type {
  margin-top: 0.5rem;
}

/* 实验方案：与「芯片选择」同级标题 + 两枚 chip 风格按钮 */
.fluidics-scheme-h2 {
  margin: 1rem 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sage-heading);
  letter-spacing: 0.02em;
}

.fluidics-scheme-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.35rem;
}

.fluidics-scheme-chip {
  min-height: 4.35rem;
}

.fluidics-scheme-status {
  margin-top: 0.55rem;
  font-size: 0.88rem;
}

/* 试剂池：仅去掉最外层 #paletteChannelStack 的滚动条；各通道/宿主块内仍保留滚动 */
.fluidics-palette .palette-channel-stack {
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
  scrollbar-gutter: auto;
}

.palette-host-block .palette-channel-h {
  color: var(--sage-heading);
}

.fluidics-palette h2 {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.fluidics-palette-field {
  margin-bottom: 0.75rem;
}

.fluidics-palette-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.28rem;
}

.fluidics-palette-field select,
.fluidics-palette-field input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.38rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.fluidics-palette h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-mint);
  margin: 1rem 0 0.45rem;
  letter-spacing: 0.03em;
}

.palette-channel-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(62vh, 36rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-gutter: stable;
}

.palette-channel-block {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 0.45rem 0.55rem 0.55rem;
  background: rgba(255, 255, 255, 0.45);
}

.palette-channel-block--misc {
  border-style: dashed;
  background: rgba(254, 243, 199, 0.22);
}

.palette-channel-h {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sage-heading);
}

.palette-channel-h--misc {
  color: #92400e;
}

.palette-misc-note {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.palette-chip-main--abbr {
  justify-content: center;
}

.palette-chip-title--abbr {
  max-width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: 0.82rem;
}

.palette-chip--misc-ab {
  border-color: rgba(217, 119, 6, 0.45);
  background: linear-gradient(180deg, rgba(254, 252, 232, 0.98), rgba(253, 230, 138, 0.35));
}

.palette-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-content: flex-start;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.35rem 0.15rem 0.35rem 0;
  margin: 0 -0.15rem 0 0;
  scrollbar-gutter: stable;
}

.palette-channel-block .palette-chip-wrap {
  max-height: 8.5rem;
}

.palette-chip-wrap--short {
  max-height: 120px;
}

.palette-chip-main {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  min-width: 0;
  width: 100%;
}

.palette-chip-signal {
  display: block;
  width: 100%;
  margin-top: 0.18rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.2;
  word-break: break-all;
}

.palette-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
  max-width: 100%;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: grab;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.95), rgba(191, 219, 254, 0.55));
  color: var(--sage-heading);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  user-select: none;
  touch-action: none;
}

.palette-chip:active {
  cursor: grabbing;
}

.palette-chip--preset {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(167, 243, 208, 0.45));
  border-color: rgba(16, 185, 129, 0.35);
  color: #064e3b;
}

.palette-chip--custom {
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.95), rgba(253, 224, 71, 0.35));
  border-color: rgba(217, 119, 6, 0.35);
  color: #713f12;
  padding-right: 0.28rem;
}

.palette-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 11rem;
}

.palette-chip-code {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.palette-chip-remove {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border: none;
  border-radius: 4px;
  background: rgba(185, 28, 28, 0.12);
  color: #991b1b;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.palette-chip-remove:hover {
  background: rgba(239, 68, 68, 0.22);
}

.line-card--drop-hover {
  outline: 2px dashed var(--accent-cyan);
  outline-offset: 2px;
  background: rgba(224, 242, 254, 0.55);
}

.line-card--drop-hover .line-label-visual {
  border-color: rgba(6, 182, 212, 0.55);
}

/* 重复通道禁止追加：红框 + 大卡面「圆圈斜杠」图标（HTML5 拖放时系统光标常被浏览器固定，不依赖光标） */
.line-card.line-card--drop-hover.line-card--drop-invalid {
  outline: 2px dashed #b91c1c;
  outline-offset: 2px;
  background: rgba(254, 226, 226, 0.72);
}

.line-card.line-card--drop-hover.line-card--drop-invalid .line-label-visual {
  border-color: rgba(220, 38, 38, 0.45);
}

/* 禁止放置：小号圆圈 + 斜杠，轻量遮罩（避免过大挡内容） */
.line-card.line-card--drop-hover.line-card--drop-invalid::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  border-radius: 9px;
  background-color: rgba(254, 226, 226, 0.32);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none'%3E%3Ccircle cx='50' cy='50' r='38' stroke='%23b91c1c' stroke-width='6'/%3E%3Cline x1='28' y1='72' x2='72' y2='28' stroke='%23b91c1c' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 40%;
  background-size: min(2.65rem, 22vw) min(2.65rem, 22vw);
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.22);
}

.line-card.line-card--drop-hover.line-card--drop-invalid::before {
  content: "该流路已有此通道";
  position: absolute;
  left: 50%;
  bottom: 0.45rem;
  transform: translateX(-50%);
  z-index: 9;
  pointer-events: none;
  padding: 0.12rem 0.45rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #7f1d1d;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(185, 28, 28, 0.35);
  white-space: nowrap;
  max-width: calc(100% - 1.2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— 三页统一到蛋白组合面板风格（试剂准备 / 流路准备 / 实验流程） —— */
body.fluidics-body,
body.fluidics-prep-body,
body.experiment-body {
  background: linear-gradient(180deg, #ecefee 0%, #e6e9e8 55%, #f0f2f1 100%);
  color: #191c1f;
}

body.experiment-body .map-layout {
  width: 100%;
  max-width: none;
}

body.fluidics-body .page-lead,
body.fluidics-prep-body .page-lead,
body.experiment-body .page-lead,
body.fluidics-body .muted,
body.fluidics-prep-body .muted,
body.experiment-body .muted {
  color: #667079;
}

body.fluidics-body h2,
body.fluidics-prep-body h2,
body.experiment-body h2 {
  color: #2f3438;
  letter-spacing: 0.02em;
}

body.fluidics-body .card,
body.fluidics-prep-body .card,
body.experiment-body .card {
  background: #f9fafa;
  border: 1px solid #d8dde1;
  box-shadow: 0 2px 10px rgba(18, 22, 26, 0.06);
}

body.fluidics-body button,
body.fluidics-prep-body button,
body.experiment-body button {
  background: #dbe8e0;
  border-color: #a9beb3;
  color: #2f4b42;
}

body.fluidics-body button:hover:not(:disabled),
body.fluidics-prep-body button:hover:not(:disabled),
body.experiment-body button:hover:not(:disabled) {
  background: #5f7f74;
  border-color: #5f7f74;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(120, 152, 140, 0.2);
}

body.fluidics-body button.secondary,
body.fluidics-prep-body button.secondary,
body.experiment-body button.secondary,
body.fluidics-body a.btn.secondary,
body.fluidics-prep-body a.btn.secondary,
body.experiment-body a.btn.secondary {
  background: #dbe8e0;
  border-color: #a9beb3;
  color: #2f4b42;
}

body.fluidics-body button.secondary:hover:not(:disabled),
body.fluidics-prep-body button.secondary:hover:not(:disabled),
body.experiment-body button.secondary:hover:not(:disabled),
body.fluidics-body a.btn.secondary:hover,
body.fluidics-prep-body a.btn.secondary:hover,
body.experiment-body a.btn.secondary:hover {
  background: #5f7f74;
  border-color: #5f7f74;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.2);
}

body.fluidics-body button.danger,
body.fluidics-prep-body button.danger,
body.experiment-body button.danger,
body.fluidics-body a.btn.danger,
body.fluidics-prep-body a.btn.danger,
body.experiment-body a.btn.danger {
  background: #fff1f2;
  border-color: #f3c7cd;
  color: #8b1f31;
}

body.fluidics-body button.danger:hover:not(:disabled),
body.fluidics-prep-body button.danger:hover:not(:disabled),
body.experiment-body button.danger:hover:not(:disabled),
body.fluidics-body a.btn.danger:hover,
body.fluidics-prep-body a.btn.danger:hover,
body.experiment-body a.btn.danger:hover {
  background: #ffe6ea;
  border-color: #e9a9b3;
  color: #76192a;
}

body.fluidics-body input[type="text"],
body.fluidics-body input[type="number"],
body.fluidics-body input[type="search"],
body.fluidics-body select,
body.fluidics-body textarea,
body.fluidics-prep-body input[type="text"],
body.fluidics-prep-body input[type="number"],
body.fluidics-prep-body input[type="search"],
body.fluidics-prep-body select,
body.fluidics-prep-body textarea,
body.experiment-body input[type="text"],
body.experiment-body input[type="number"],
body.experiment-body input[type="search"],
body.experiment-body select,
body.experiment-body textarea {
  border: 1px solid #cfd5da;
  background: #ffffff;
  color: #1f252a;
}

body.fluidics-body input:focus,
body.fluidics-body select:focus,
body.fluidics-body textarea:focus,
body.fluidics-prep-body input:focus,
body.fluidics-prep-body select:focus,
body.fluidics-prep-body textarea:focus,
body.experiment-body input:focus,
body.experiment-body select:focus,
body.experiment-body textarea:focus {
  border-color: #95aea2;
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.24);
}

/* 实验流程页：标题与按钮强制统一（覆盖旧高优先级规则） */
body.experiment-body .map-sidebar h2,
body.experiment-body .map-editor h2,
body.experiment-body .card h2 {
  color: #2f3438 !important;
}

body.experiment-body .map-editor button,
body.experiment-body .map-sidebar button,
body.experiment-body .step-row button,
body.experiment-body .row button,
body.experiment-body .btn-primary-strong {
  background: #dbe8e0 !important;
  border-color: #a9beb3 !important;
  color: #2f4b42 !important;
  box-shadow: none !important;
}

body.experiment-body .map-editor button:hover:not(:disabled),
body.experiment-body .map-sidebar button:hover:not(:disabled),
body.experiment-body .step-row button:hover:not(:disabled),
body.experiment-body .row button:hover:not(:disabled),
body.experiment-body .btn-primary-strong:hover:not(:disabled) {
  background: #5f7f74 !important;
  border-color: #5f7f74 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.2) !important;
}

body.experiment-body button.secondary,
body.experiment-body a.btn.secondary,
body.experiment-body .step-row button.secondary,
body.experiment-body .step-row button.outline {
  background: #dbe8e0 !important;
  border-color: #a9beb3 !important;
  color: #2f4b42 !important;
}

body.experiment-body button.secondary:hover:not(:disabled),
body.experiment-body a.btn.secondary:hover,
body.experiment-body .step-row button.secondary:hover:not(:disabled),
body.experiment-body .step-row button.outline:hover:not(:disabled) {
  background: #5f7f74 !important;
  border-color: #5f7f74 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(149, 174, 162, 0.2) !important;
}

body.experiment-body button.danger,
body.experiment-body a.btn.danger,
body.experiment-body .step-row button.danger {
  background: #fff1f2 !important;
  border-color: #f3c7cd !important;
  color: #8b1f31 !important;
}

/* 各标签页主标题已移除：导航栏已标识当前页，内容区不再重复大标题 */
main.page > h1.page-title,
main.page.workbench-page > h1.page-title,
.fluidics-page-layout h1.page-title,
.fluidics-main > h1.page-title,
h1.page-title {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* —— 雾霾绿全站统一：表头 / 卡片标题 / 软提示 —— */
main.page .card h2,
main.page .map-sidebar h2,
main.page .map-editor h2,
.workbench-layout .card h2,
.calib-layout h2,
.fluidics-palette h2,
.fluidics-main h2,
.fluidics-flow-title,
.rounds-palette-sec-title,
.rounds-snapshot-head h3 {
  color: var(--sage-heading);
}

table.lines th,
.ab-table th,
.ab-table thead th,
.rounds-table th,
.rounds-snapshot-table th,
.rounds-dup-field-table thead th,
.sr-data-table th,
.sr-data-table th.sr-col-th,
.sr-data-table thead tr th,
.stain-ab-table th,
table.detail-sheet th,
#userTable th {
  background: var(--sage-table-head-bg);
  color: var(--sage-heading);
  border-color: var(--sage-table-head-border);
}

.ab-col-item,
.wb-protein-detail-sidebar .wb-protein-name {
  color: var(--sage-heading);
}

.wb-map-readonly-hint,
.exp-map-readonly-hint,
#currentExpHint {
  border-color: var(--sage-hint-border);
  background: var(--sage-hint-bg);
  color: var(--sage-heading);
}

.wb-notice-body {
  color: var(--sage-heading);
}

.exp-mgmt-list-year > summary,
.exp-mgmt-list-month > summary {
  background: var(--sage-soft-gradient);
  color: var(--sage-heading);
  border-bottom-color: var(--sage-table-head-border);
}

.exp-mgmt-list-year > summary::before,
.exp-mgmt-list-month > summary::before {
  color: var(--sage-text);
}

.exp-mgmt-all-root.exp-mgmt-list-year > summary.exp-mgmt-tree-node.is-active {
  background: var(--sage-active-gradient);
  color: var(--sage-heading);
  border-bottom-color: var(--sage-accent-light);
  box-shadow: inset 0 0 0 1px rgba(95, 127, 116, 0.18);
}

.exp-mgmt-map-name {
  color: var(--sage-heading);
}
