/* --- 全局变量 (低饱和柑橼配色) --- */
:root { 
    color-scheme: light;
    --primary-color: #637967;
    --primary-deep: #435448;
    --primary-soft: #edf2ea;
    --accent-color: #c6a875;
    --accent-soft: #f4ebd8;
    --clay-color: #b88774;
    --clay-soft: #f1e2dc;
    --blue-color: #7f9da4;
    --blue-soft: #e6eef0;
    --bg-color: #ffffff;
    --card-bg: rgba(255, 255, 252, 0.92);
    --surface-soft: rgba(247, 248, 243, 0.76);
    --text-color: #46564c;
    --ink-color: #26312b;
    --muted-color: #768178;
    --line-color: #dde4db;
    --card-radius: 8px; 
    --shadow: 0 8px 24px rgba(58, 72, 63, 0.07);
    --shadow-hover: 0 18px 46px rgba(58, 72, 63, 0.12);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --serif-title: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --sans-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    
    /* RBH 勋章特供颜色 */
    --rbh-gold: linear-gradient(135deg, #ffd700, #ffb300);
    --rbh-silver: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    --rbh-bronze: linear-gradient(135deg, #d7ccc8, #a1887f);
}

body { 
    background-color: var(--bg-color);
    background: var(--bg-color);
    font-family: var(--sans-ui); 
    padding-bottom: 60px; 
    color: var(--text-color); 
    overflow-x: hidden; 
    animation: pageFadeIn 0.55s ease both;
}

html {
    background: var(--bg-color);
    color-scheme: light;
}

.home-page {
    position: relative;
    background: var(--bg-color);
}
.home-page > * {
    position: relative;
    z-index: 1;
}
.home-page::before,
.home-page::after {
    content: "";
    position: fixed;
    top: 0;
    width: min(36vw, 520px);
    height: min(42vw, 460px);
    background: url('/static/img/citron-corner-background.png') left top / 680px auto no-repeat;
    opacity: 0.78;
    pointer-events: none;
    z-index: 0;
}
.home-page::before {
    left: 0;
}
.home-page::after {
    right: 0;
    transform: scaleX(-1);
}

.home-page .container {
    max-width: 1420px;
}

/* --- 导航栏 --- */
.navbar { 
    background: rgba(255, 255, 252, 0.86); 
    box-shadow: 0 8px 30px rgba(58, 72, 63, 0.08); 
    border-bottom: 1px solid rgba(221, 228, 219, 0.82);
    backdrop-filter: blur(18px);
    padding: 0.78rem 0; 
}
.navbar .navbar-brand,
.navbar .text-white {
    color: var(--ink-color) !important;
}
.navbar .badge {
    background: var(--primary-soft) !important;
    color: var(--primary-deep);
    border: 1px solid rgba(99, 121, 103, 0.2);
}
.lab-header { 
    background: transparent;
    min-height: 276px; 
    color: var(--ink-color); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
    margin-bottom: -4px; 
    padding: 24px 0 34px;
}
.hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-color);
    margin-bottom: 14px;
}
.hero-brand > i {
    color: var(--accent-color);
    font-size: 1.7rem;
    transform: rotate(-18deg);
}
.hero-brand strong {
    display: block;
    font-size: 1.34rem;
    line-height: 1.1;
    letter-spacing: 0;
}
.hero-brand span {
    display: block;
    color: var(--muted-color);
    font-size: 0.88rem;
    line-height: 1.2;
}
.hero-title {
    font-family: var(--serif-title);
    font-size: clamp(2.35rem, 4.0vw, 4.15rem);
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: 0;
    color: #1f3a2f;
    margin: 0 0 10px;
    text-shadow: 0 8px 22px rgba(67, 84, 72, 0.12);
}
.hero-subtitle {
    color: #7b8581;
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    margin: 0 0 8px;
    letter-spacing: 0.01em;
}
.hero-team {
    color: #68756d;
    font-size: 0.98rem;
    margin: 0 0 12px;
}
.slogan-badge { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--accent-color); 
    font-weight: 700;
    letter-spacing: 0.16em;
    margin-top: 4px;
    font-size: 1.06rem;
}
.slogan-badge i {
    color: var(--primary-color);
    font-size: 0.92rem;
}

.btn-success,
.btn-primary,
.btn-warning {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff !important;
}
.btn-success:hover,
.btn-primary:hover,
.btn-warning:hover,
.btn-success:focus,
.btn-primary:focus,
.btn-warning:focus {
    background-color: var(--primary-deep);
    border-color: var(--primary-deep);
    color: #fff !important;
}
.btn-info {
    background-color: var(--blue-color);
    border-color: var(--blue-color);
    color: #fff !important;
}
.btn-info:hover,
.btn-info:focus {
    background-color: #657f86;
    border-color: #657f86;
    color: #fff !important;
}
.btn-outline-success {
    color: var(--primary-deep);
    border-color: rgba(99, 121, 103, 0.42);
}
.btn-outline-success:hover,
.btn-outline-success:focus {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.form-control:focus,
.form-select:focus {
    border-color: rgba(99, 121, 103, 0.55);
    box-shadow: 0 0 0 0.18rem rgba(99, 121, 103, 0.15);
}
.form-control,
.form-select {
    border-color: rgba(221, 228, 219, 0.95);
    background-color: rgba(255, 255, 252, 0.9);
}
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.text-success { color: var(--primary-color) !important; }
.text-primary { color: var(--blue-color) !important; }
.text-warning { color: var(--accent-color) !important; }
.text-info { color: var(--blue-color) !important; }
.text-secondary { color: var(--muted-color) !important; }
.bg-white { background-color: rgba(255, 255, 252, 0.92) !important; }
.hover-bg-light:hover { background-color: var(--surface-soft); }

/* --- 布局模式 (Focus Mode) --- */
.layout-col { transition: all var(--transition); }
.layout-hidden { display: none !important; }
.layout-expanded { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }

/* --- 模块独占预览 / 折叠控制 --- */
.module-expand-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--primary-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: none;
    opacity: 0.82;
    transform: translateY(-3px);
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.module-expand-btn:hover,
.module-expand-btn:focus-visible,
.module-expand-btn.is-active {
    background: var(--primary-soft);
    color: var(--primary-deep);
    opacity: 1;
    transform: translateY(-5px);
}
.module-expand-btn.is-active { background: var(--primary-color); color: #fff; }
.module-expanded-mode .home-page,
.module-expanded-mode .container {
    scroll-behavior: smooth;
}
.module-expanded-mode #mainArea,
.module-expanded-mode #sideArea {
    transition: all 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.module-expanded-mode #mainArea:not(:has(.module-expanded-card)),
.module-expanded-mode #sideArea:not(:has(.module-expanded-card)),
.module-expanded-mode #mainArea > .row > [class*="col-"]:not(:has(.module-expanded-card)) {
    display: none !important;
}
.module-expanded-mode #mainArea:has(.module-expanded-card),
.module-expanded-mode #sideArea:has(.module-expanded-card),
.module-expanded-mode #mainArea > .row > [class*="col-"]:has(.module-expanded-card) {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}
.module-expanded-card {
    animation: moduleExpandIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
    margin-bottom: 34px;
}
.module-expanded-card .lab-card-body {
    animation: moduleBodyFade 0.26s ease both;
}
.module-hidden-card {
    opacity: 0;
    transform: scale(0.985);
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
}
@keyframes moduleExpandIn {
    from { opacity: 0.82; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes moduleBodyFade {
    from { opacity: 0.84; }
    to { opacity: 1; }
}

/* 悬浮恢复按钮 */
.focus-toggle-btn { 
    position: fixed !important;
    inset: auto max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) auto !important;
    z-index: 2050;
    display: none; 
    width: 55px; height: 55px; border-radius: 50%; 
    background: var(--primary-color); color: white; 
    box-shadow: 0 10px 28px rgba(58, 72, 63, 0.24); 
    align-items: center; justify-content: center; font-size: 1.4rem;
    cursor: pointer; border: 3px solid white;
    transition: transform 0.2s;
}
.focus-toggle-btn:hover { transform: scale(1.1); background: var(--primary-deep); }

/* --- 核心卡片 (高对比度) --- */
.lab-card { 
    background: var(--card-bg); 
    border-radius: var(--card-radius); 
    box-shadow: var(--shadow); 
    border: 1px solid var(--line-color); 
    border-top: 4px solid var(--primary-color); 
    margin-bottom: 25px; 
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}
.lab-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(99, 121, 103, 0.24); }
.lab-card-header { 
    padding: 15px 20px; 
    background: rgba(255, 255, 252, 0.84); 
    border-bottom: 1px solid var(--line-color); 
    font-weight: 700; color: var(--ink-color); 
    display: flex; align-items: center; justify-content: space-between; 
}
.lab-card-body { padding: 25px; }

#cardSearch .lab-card-body > .row {
    flex-direction: column;
}
#cardSearch .lab-card-body > .row > [class*="col-"] {
    width: 100%;
}
#cardSearch .border-end {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 14px;
}
#cardTools .lab-card-header span,
#cardTools .tab-pane h5,
#cardTools .tab-pane h6,
.lab-card h5 {
    font-family: var(--sans-ui) !important;
    font-weight: 800;
    color: var(--ink-color);
}
#cardTools .tab-pane h5,
#cardTools .tab-pane h6 {
    font-weight: 800 !important;
}
#cardTools {
    margin-bottom: 34px;
}
#cardTools .lab-card-body {
    overflow: hidden;
}
#cardTools .tab-content {
    padding-bottom: 14px;
}

.ortho-mode-tabs {
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 5px;
    background: rgba(247, 248, 243, 0.7);
    gap: 6px;
}
.ortho-mode-tabs .nav-item {
    min-width: 0;
}
.ortho-mode-tabs .nav-link {
    width: 100%;
    height: 100%;
    border: 0 !important;
    border-radius: 6px;
    color: var(--muted-color);
    background: rgba(232, 236, 229, 0.58);
    opacity: 0.76;
    padding: 10px 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.ortho-mode-tabs .nav-link:hover {
    opacity: 0.92;
    background: rgba(237, 242, 234, 0.95);
    transform: translateY(-1px);
}
.ortho-mode-tabs .nav-link.active {
    opacity: 1;
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 8px 18px rgba(58, 72, 63, 0.16);
}
.ortho-mode-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.2;
}
.ortho-mode-subtitle {
    font-size: 0.72rem;
    color: inherit;
    opacity: 0.78;
    line-height: 1.2;
}
.rbh-grade-guide {
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: rgba(247, 248, 243, 0.72);
    padding: 12px;
}
.rbh-grade-guide-title {
    color: var(--primary-deep);
    font-size: 0.86rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.rbh-grade-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
}
.rbh-grade-grid > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.rbh-grade-grid small {
    color: var(--muted-color);
    line-height: 1.3;
}
.rbh-grade-footnote {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed var(--line-color);
    color: var(--muted-color);
    font-size: 0.74rem;
}
.rbh-species-swap {
    margin-top: 150px;
}

/* --- 工作台导航 (Workbench Sidebar) --- */
.wb-nav .nav-link {
    color: var(--muted-color);
    border-radius: 0;
    padding: 12px 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    
    /* [修复] 强制开启 Flex 布局以确保图标和文字完美垂直居中 */
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important; /* 确保 <a> 标签无下划线 */
}
.wb-nav .nav-link:hover {
    background-color: var(--primary-soft);
    color: var(--primary-deep);
}
.wb-nav .nav-link.active {
    background-color: rgba(255, 255, 252, 0.92);
    color: var(--primary-deep);
    border-left-color: var(--clay-color);
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(58, 72, 63, 0.06);
}
.wb-nav .nav-link > span:last-child {
    min-width: 0;
    text-align: left;
    line-height: 1.35;
}
.icon-box {
    width: 20px;
    text-align: center;
    margin-right: 12px; /* 微调间距 */
    display: flex;
    justify-content: center;
}
.wb-section-header {
    font-size: 0.7rem;
    color: #a5aea6;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 15px 20px 5px;
    text-transform: uppercase;
}
.workbench-embedded-card {
    margin-bottom: 0;
    box-shadow: none;
}
.workbench-embedded-card .lab-card-header {
    border-radius: 0;
}

#structModal .modal-body {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 搜索结果 --- */
.result-group { margin-bottom: 20px; border: 1px solid var(--line-color); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 14px rgba(58, 72, 63, 0.06); }
.result-group-header { 
    background: var(--primary-soft); padding: 10px 15px; 
    display: flex; justify-content: space-between; align-items: center; 
    border-bottom: 1px solid var(--line-color); 
    border-left: 5px solid var(--primary-color); 
}
.seq-item { padding: 12px 15px; border-bottom: 1px solid var(--line-color); background: rgba(255, 255, 252, 0.95); }
.seq-item:hover { background-color: var(--surface-soft); }
.seq-meta { font-size: 0.95rem; margin-bottom: 5px; display: flex; align-items: center; justify-content: space-between; }
.seq-desc { 
    font-size: 0.85rem; color: var(--text-color); 
    background-color: var(--accent-soft); padding: 4px 8px; border-radius: 4px; 
    margin: 5px 0; border-left: 3px solid var(--accent-color); 
}
.seq-text { 
    font-family: Consolas, monospace; font-size: 0.85rem; color: var(--ink-color); 
    background: rgba(247, 248, 243, 0.78); padding: 10px; border: 1px solid var(--line-color); 
    white-space: pre-wrap; word-break: break-all; max-height: 100px; overflow-y: hidden; cursor: pointer; 
}
.seq-text:hover { max-height: none; overflow-y: auto; border-color: rgba(99, 121, 103, 0.42); }

/* --- [新增] RBH 勋章/证据样式 --- */
.badge-rbh {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: help;
    border: 1px solid rgba(255,255,255,0.3);
    text-transform: uppercase;
    transition: transform 0.2s;
}
.badge-rbh:hover { transform: scale(1.05); }

.badge-rbh-gold { background: var(--rbh-gold); color: #5d4037; }
.badge-rbh-silver { background: var(--rbh-silver); color: #455a64; }
.badge-rbh-bronze { background: var(--rbh-bronze); color: #ffffff; }

/* 证据指标展示样式 */
.rbh-evidence-text {
    font-size: 0.75rem;
    color: var(--muted-color);
    font-family: 'Consolas', monospace;
    margin-left: 8px;
    background: var(--primary-soft);
    padding: 0 5px;
    border-radius: 3px;
}

/* --- 同源表格 --- */
.ortho-table th { background: var(--primary-soft); color: var(--primary-deep); font-size: 0.9rem; white-space: nowrap; }
.ortho-table td { vertical-align: middle; font-size: 0.85rem; background: rgba(255, 255, 252, 0.96); }
.hit-list-scroll { max-height: 150px; overflow-y: auto; min-width: 150px; }
.cell-found { 
    color: var(--primary-deep); font-weight: 600; font-family: monospace; 
    padding: 3px 0; border-bottom: 1px dashed #eee; display: block;
}
.cell-loss { color: #c62828; opacity: 0.6; font-style: italic; }

/* --- 可视化 (SVG) --- */
.viz-container { margin-bottom: 15px; }
.viz-label { font-size: 0.8rem; font-weight: bold; color: var(--text-color); margin-bottom: 5px; border-left: 4px solid var(--accent-color); padding-left: 8px; }
.struct-line { stroke: #999; stroke-width: 2; }
.struct-utr { fill: #cfd8dc; stroke: none; }
.struct-cds { fill: var(--primary-color); stroke: none; } 
.prot-line { stroke: #ccc; stroke-width: 5; stroke-linecap: round; }
.domain-rect { stroke: white; stroke-width: 1px; cursor: pointer; opacity: 0.85; rx: 4px; }
.domain-rect:hover { opacity: 1.0; stroke: #333; }
.dom-pfam { fill: #1e88e5; }
.dom-panther { fill: #d81b60; }
.dom-smart { fill: #fb8c00; }
.dom-other { fill: #546e7a; }

/* --- 建树 & 其它 --- */
.tool-entry-card { 
    background: rgba(255, 255, 252, 0.86); border-radius: 8px; border: 1px solid var(--line-color); padding: 18px 20px; 
    display: flex; align-items: center; transition: 0.2s; cursor: pointer; box-shadow: var(--shadow);
    min-height: 88px;
    position: relative;
    color: inherit;
    font: inherit;
}
.tool-entry-card::after {
    content: "\f105";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    color: #9aa59d;
    transition: transform 0.2s ease, color 0.2s ease;
}
.tool-entry-card:hover { transform: translateY(-4px); border-color: rgba(99, 121, 103, 0.34); box-shadow: var(--shadow-hover); }
.tool-entry-card:hover::after { transform: translateX(3px); color: var(--primary-color); }
.tool-icon { width: 45px; height: 45px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--primary-deep); margin-right: 15px; }
.bg-blast { background: var(--accent-soft); color: #80683d; border: 1px solid rgba(198, 168, 117, 0.28); } 
.bg-rstudio { background: var(--blue-soft); color: #47676e; border: 1px solid rgba(127, 157, 164, 0.24); } 
.bg-jbrowse { background: var(--clay-soft); color: #7f594e; border: 1px solid rgba(184, 135, 116, 0.24); }

/* --- 聊天窗口 --- */
.chat-container { height: 400px; display: flex; flex-direction: column; background: var(--surface-soft); }
.chat-row { display: flex; margin-bottom: 12px; padding: 0 15px; }
.chat-row.me { flex-direction: row-reverse; }
.chat-avatar { width: 32px; height: 32px; background: var(--accent-color); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; margin: 0 10px; flex-shrink: 0; }
.chat-bubble { background: rgba(255, 255, 252, 0.96); padding: 10px 15px; border-radius: 10px; border: 1px solid var(--line-color); font-size: 0.9rem; max-width: 75%; box-shadow: 0 4px 12px rgba(58, 72, 63, 0.05); }
.chat-row.me .chat-bubble { background: var(--primary-soft); border-color: rgba(99, 121, 103, 0.22); }
.chat-meta { display: block; font-size: 0.75rem; color: var(--muted-color); margin-bottom: 3px; }

/* --- 进化树容器 --- */
#treeViz { border: 1px solid #eee; background: #fff; overflow: auto; padding: 10px; min-height: 200px; max-height: 600px; }

/* --- 资源入口 --- */
.resource-link {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 18px;
    color: var(--ink-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(221, 228, 219, 0.78);
    transition: background-color 0.18s ease, color 0.18s ease;
}
.resource-link:last-child { border-bottom: 0; }
.resource-link:hover {
    background: var(--surface-soft);
    color: var(--primary-deep);
}
.resource-link > .fa-chevron-right {
    color: #9aa59d;
    font-size: 0.75rem;
    transition: transform 0.18s ease, color 0.18s ease;
}
.resource-link:hover > .fa-chevron-right {
    transform: translateX(3px);
    color: var(--primary-color);
}
.resource-mark,
.resource-text-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--primary-deep);
    font-weight: 800;
}
.resource-text-mark {
    font-size: 0.7rem;
    letter-spacing: 0;
}
.resource-blue { color: #4b7693; }
.resource-citrus { color: #d99a22; }

#sideArea .lab-card-header {
    padding: 13px 16px;
}
#sideArea .resource-link {
    grid-template-columns: 28px minmax(0, 1fr) 14px;
    gap: 9px;
    padding: 10px 14px;
    font-size: 0.88rem;
}
#sideArea .chat-container {
    height: 320px;
}

/* --- 子页面轻量头部 --- */
.tool-page-shell {
    padding-top: 24px;
    position: relative;
    z-index: 1;
}
.tool-page-shell::before,
.tool-page-shell::after {
    content: "";
    position: fixed;
    top: 0;
    width: min(30vw, 420px);
    height: min(36vw, 380px);
    background: url('/static/img/citron-corner-background.png') left top / 560px auto no-repeat;
    opacity: 0.16;
    filter: saturate(0.82);
    pointer-events: none;
    z-index: -1;
}
.tool-page-shell::before { left: 0; }
.tool-page-shell::after { right: 0; transform: scaleX(-1); }
.subpage-hero {
    background: rgba(255, 255, 252, 0.88);
    border: 1px solid var(--line-color);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.subpage-kicker {
    color: var(--muted-color);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 4px;
}
.subpage-title {
    color: var(--ink-color);
    font-weight: 800;
    margin: 0;
}
.subpage-title i {
    color: var(--primary-color);
}
.subpage-back {
    white-space: nowrap;
}

@media (max-width: 992px) {
    body {
        padding-bottom: 28px;
    }
    .home-page::before,
    .home-page::after {
        top: 54px;
        width: 46vw;
        height: 220px;
        background-size: 340px auto;
        opacity: 0.3;
    }
    .home-page .container,
    .tool-page-shell.container,
    .container-fluid.tool-page-shell,
    main.container {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    .lab-header {
        min-height: 0;
        padding: 28px 0 28px;
        margin-bottom: 0;
        overflow: hidden;
    }
    .hero-title,
    .hero-subtitle,
    .hero-team {
        max-width: min(680px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    .tool-entry-card {
        min-height: 78px;
    }
    .lab-card {
        margin-bottom: 18px;
    }
    .lab-card-header {
        padding: 14px 16px;
    }
    .lab-card-body {
        padding: 18px;
    }
    #cardTools .lab-card-body > .d-flex {
        min-height: 0 !important;
    }
    .wb-nav {
        max-width: none !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--line-color);
    }
    .wb-nav .nav-link {
        padding: 10px 16px;
    }
    #v-pills-tabContent {
        padding: 18px !important;
    }
    .subpage-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }
    .home-page {
        background: linear-gradient(180deg, #fffdfa 0%, #fbfbf7 78%, #f7f8f3 100%) !important;
    }
    .home-page::before,
    .home-page::after {
        top: 64px;
        width: 50vw;
        height: 160px;
        background-size: 250px auto;
        opacity: 0.18;
    }
    .home-page::before {
        left: -34px;
    }
    .home-page::after {
        right: -34px;
    }
    .lab-header {
        padding: 22px 0 24px;
        text-align: center;
    }
    .hero-brand {
        margin-bottom: 12px;
        padding: 7px 11px;
        border-radius: 999px;
        background: rgba(255, 255, 252, 0.72);
        border: 1px solid rgba(221, 228, 219, 0.78);
        backdrop-filter: blur(10px);
    }
    .hero-brand strong {
        font-size: 1.02rem;
    }
    .hero-brand span {
        font-size: 0.72rem;
    }
    .hero-title {
        font-size: clamp(1.95rem, 9.2vw, 2.36rem);
        line-height: 1.18;
        text-wrap: balance;
        margin-bottom: 8px;
    }
    .hero-subtitle {
        font-size: 0.92rem;
        line-height: 1.35;
        padding: 0 6px;
    }
    .hero-team {
        font-size: 0.82rem;
        line-height: 1.45;
        padding: 0 8px;
    }
    .slogan-badge {
        gap: 10px;
        font-size: 0.88rem;
        letter-spacing: 0.08em;
    }
    .row.g-3.mb-4 {
        --bs-gutter-x: 0.7rem;
        --bs-gutter-y: 0.7rem;
        margin-bottom: 1rem !important;
    }
    .tool-entry-card {
        min-height: 86px;
        padding: 12px;
        border-radius: 8px;
        gap: 10px;
    }
    .tool-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 1.2rem;
        margin-right: 0;
    }
    .tool-entry-card .fw-bold {
        font-size: 0.95rem;
        line-height: 1.15;
    }
    .tool-entry-card small {
        font-size: 0.78rem;
    }
    .tool-entry-card::after {
        right: 10px;
    }
    .lab-card {
        border-radius: 8px;
        border-top-width: 3px;
        margin-bottom: 16px;
    }
    .lab-card-header {
        padding: 13px 14px;
        gap: 10px;
        font-size: 0.98rem;
    }
    .lab-card-header span {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .module-expand-btn {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }
    .lab-card-body {
        padding: 15px;
    }
    #cardSearch .lab-card-body > .row {
        gap: 0 !important;
    }
    #cardSearch .form-check {
        min-width: calc(50% - 0.5rem);
        margin-bottom: 4px;
    }
    textarea.form-control {
        min-height: 120px;
    }
    #cardTools .tab-pane h5 {
        font-size: 1.05rem;
        line-height: 1.35;
    }
    .wb-nav .nav-link {
        font-size: 0.88rem;
        padding: 10px 14px;
    }
    .wb-section-header {
        padding: 12px 14px 5px;
    }
    .ortho-mode-tabs {
        flex-direction: column;
    }
    .ortho-mode-tabs .nav-link {
        text-align: left;
    }
    .rbh-grade-grid {
        grid-template-columns: 1fr;
    }
    .rbh-species-swap {
        margin-top: 0;
        transform: rotate(90deg);
    }
    .resource-link {
        min-height: 48px;
    }
    .chat-container {
        height: 300px;
    }
    .focus-toggle-btn {
        right: 16px !important;
        bottom: 16px !important;
    }
    .subpage-hero {
        padding: 16px;
        margin-bottom: 16px;
        gap: 12px;
    }
    .subpage-hero h1,
    .subpage-title {
        font-size: 1.45rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    .subpage-hero p {
        font-size: 0.9rem;
        line-height: 1.55;
    }
    .tool-page-shell {
        padding-top: 14px;
    }
    .container-fluid.tool-page-shell {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .tool-page-shell::before,
    .tool-page-shell::after {
        width: 48vw;
        height: 150px;
        background-size: 240px auto;
        opacity: 0.1;
    }
    .qpcr-plate-grid,
    .cryo-grid {
        min-width: 680px;
    }
    .qpcr-plate-wrap,
    .cryo-board .lab-card-body {
        overflow-x: auto;
    }
    .cryo-user-panel {
        width: 100%;
    }
    .cryo-user-panel .input-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .cryo-user-panel .input-group > * {
        width: 100% !important;
        border-radius: 6px !important;
    }
    .cryo-toolbar {
        flex-direction: column;
    }
    .cryo-cell {
        min-height: 68px;
    }
}

/* --- [新增] RNA-seq 模块样式 --- */
.hm-cell:hover { z-index: 10; transform: scale(1.1); box-shadow: 0 0 5px rgba(0,0,0,0.2); border: 1px solid #333; }
.hm-header { font-weight: bold; font-size: 0.75rem; text-align: center; padding: 5px; writing-mode: vertical-rl; transform: rotate(180deg); background: #f8f9fa; }
.hm-row-label { padding: 0 10px; font-family: monospace; font-weight: bold; display: flex; align-items: center; justify-content: flex-end; }

.qpcr-plate-wrap { overflow-x: auto; }
.qpcr-plate-grid { border-collapse: separate; border-spacing: 6px; width: 100%; }
.qpcr-plate-grid th { font-size: 0.75rem; color: var(--muted-color); text-align: center; padding: 2px; }
.qpcr-row-label { width: 24px; font-weight: 700; color: var(--primary-deep); text-align: center; }
.qpcr-well {
    min-width: 62px;
    height: 56px;
    border: 1.5px solid rgba(99, 121, 103, 0.42);
    border-radius: 10px;
    background: rgba(255, 255, 252, 0.92);
    cursor: pointer;
    transition: 0.15s ease;
    text-align: center;
    vertical-align: middle;
    padding: 4px;
    user-select: none;
}
.qpcr-well:hover { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(99, 121, 103, 0.16); }
.qpcr-well.annotated:not(.selected) { background: var(--surface-soft); border-color: rgba(99, 121, 103, 0.38); }
.qpcr-well.selected { border-color: var(--primary-deep); background: #dce8d8; box-shadow: inset 0 0 0 2px rgba(67, 84, 72, 0.22), 0 0 0 2px rgba(67, 84, 72, 0.1); }
.qpcr-well.target { background: var(--accent-soft); }
.qpcr-well.reference { background: var(--primary-soft); }
.qpcr-well.ntc, .qpcr-well.blank { background: var(--clay-soft); }
.qpcr-well.target.selected { background: #e9d4a8; }
.qpcr-well.reference.selected { background: #c8d8c4; }
.qpcr-well.ntc.selected, .qpcr-well.blank.selected { background: #ddc1b8; }
.qpcr-well.target.annotated:not(.selected) { background: #f5ead3; }
.qpcr-well.reference.annotated:not(.selected) { background: #e1eadc; }
.qpcr-well.ntc.annotated:not(.selected), .qpcr-well.blank.annotated:not(.selected) { background: #ecd8d2; }
.qpcr-well.problem {
    border-color: #c62828;
    box-shadow: inset 0 0 0 2px rgba(198,40,40,0.18), 0 0 0 2px rgba(198,40,40,0.12);
}
.qpcr-well-id { font-size: 0.7rem; font-weight: 700; color: var(--muted-color); line-height: 1.1; }
.qpcr-well-ct { font-size: 0.9rem; font-weight: 700; color: var(--ink-color); line-height: 1.2; }
.qpcr-well-meta { font-size: 0.62rem; color: #7f8b83; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qpcr-mini-chart { overflow-x: auto; background: rgba(255, 255, 252, 0.92); border: 1px solid var(--line-color); border-radius: 8px; padding: 10px; }
.qpcr-chip-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.qpcr-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-color);
    background: rgba(255, 255, 252, 0.9);
    color: var(--text-color);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
}
.qpcr-chip:hover {
    background: var(--primary-soft);
    border-color: rgba(99, 121, 103, 0.34);
    color: var(--primary-deep);
}
.qpcr-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.qpcr-status-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line-color);
    color: var(--text-color);
    font-size: 0.75rem;
}
.qpcr-editor-table input,
.qpcr-editor-table select {
    min-width: 88px;
}
.qpcr-editor-table td:first-child {
    background: var(--surface-soft);
}

#v-qpcr .nav-pills .nav-link,
#v-phylo .nav-tabs .nav-link {
    color: var(--text-color);
    border: 1px solid var(--line-color);
}
#v-qpcr .nav-pills .nav-link.active,
#v-phylo .nav-tabs .nav-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
#v-qpcr .border-primary,
#v-phylo .border-secondary,
#v-phylo .border-primary {
    border-color: var(--primary-color) !important;
}
#v-qpcr .text-primary,
#v-phylo .text-secondary,
#v-phylo .text-dark {
    color: var(--primary-deep) !important;
}
#v-phylo #btnBuildTree,
#v-phylo .btn-danger {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
#v-phylo #btnBuildTree:hover,
#v-phylo .btn-danger:hover {
    background: var(--primary-deep);
    border-color: var(--primary-deep);
}
#v-phylo .btn-secondary {
    background: var(--muted-color);
    border-color: var(--muted-color);
}
#v-phylo .btn-outline-dark,
#v-phylo .btn-outline-primary {
    color: var(--primary-deep);
    border-color: rgba(99, 121, 103, 0.42);
}
#v-phylo .btn-outline-dark:hover,
#v-phylo .btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
#v-phylo .accordion-button:not(.collapsed) {
    background: var(--primary-soft);
    color: var(--primary-deep);
    box-shadow: inset 0 -1px 0 var(--line-color);
}

/* --- Sequence & Solution Workbench --- */
.seq-output-box {
    min-height: 140px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
}
.solution-tool .btn-check:checked + .btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.solution-result-card {
    border: 1px solid rgba(99, 121, 103, 0.2);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(237, 242, 234, 0.72);
    padding: 14px 16px;
    color: var(--ink-color);
}

/* --- Cryo Boxes Tool --- */
.cryo-page.tool-page-shell { padding-top: 0; }
.cryo-page .container { max-width: 1420px; }
.cryo-user-panel {
    width: min(480px, 100%);
    background: rgba(255, 255, 252, 0.88);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.cryo-layout {
    display: grid;
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(220px, 260px);
    gap: 12px;
    align-items: start;
}
.cryo-search {
    grid-column: 1 / -1;
}
.cryo-sidebar,
.cryo-board,
.cryo-editor {
    margin-bottom: 22px;
    min-width: 0;
}
.cryo-page .lab-card-header {
    padding: 11px 16px;
}
.cryo-page .lab-card-body {
    padding: 16px;
}
.cryo-search-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
}
.cryo-search-results {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    max-height: 260px;
    overflow: auto;
}
.cryo-search-empty {
    border: 1px dashed var(--line-color);
    border-radius: 8px;
    color: var(--muted-color);
    padding: 14px;
    text-align: center;
}
.cryo-search-result {
    width: 100%;
    border: 1px solid var(--line-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(255, 255, 252, 0.9);
    color: var(--text-color);
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    text-align: left;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.cryo-search-result:hover {
    border-color: rgba(99, 121, 103, 0.38);
    box-shadow: 0 8px 20px rgba(58, 72, 63, 0.08);
    transform: translateY(-1px);
}
.cryo-result-position {
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 800;
}
.cryo-result-main {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cryo-result-main strong {
    color: var(--ink-color);
    font-size: 0.9rem;
}
.cryo-result-meta,
.cryo-result-notes {
    color: var(--muted-color);
    font-size: 0.76rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.cryo-box-list {
    display: grid;
    gap: 6px;
    max-height: 62vh;
    overflow: auto;
    padding-right: 2px;
}
.cryo-box-item {
    width: 100%;
    border: 1px solid var(--line-color);
    background: rgba(255, 255, 252, 0.84);
    color: var(--text-color);
    border-radius: 8px;
    text-align: left;
    padding: 8px 10px;
    display: grid;
    gap: 3px;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.cryo-box-item:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 121, 103, 0.34);
    background: var(--primary-soft);
}
.cryo-box-item.active {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.cryo-box-item small {
    color: inherit;
    opacity: 0.72;
}
.cryo-toolbar {
    display: flex;
    gap: 8px;
}
.cryo-board-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.cryo-batch-toolbar {
    align-items: center;
    background: var(--primary-soft);
    border: 1px solid rgba(99, 121, 103, 0.3);
    border-radius: 9px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 9px 11px;
}
.cryo-grid-empty {
    border: 1px dashed var(--line-color);
    border-radius: 10px;
    padding: 36px;
    text-align: center;
    color: var(--muted-color);
    background: rgba(255, 255, 252, 0.62);
}
.cryo-grid {
    display: grid;
    gap: 5px;
    overflow: auto;
    padding-bottom: 8px;
}
.cryo-board .lab-card-body {
    overflow-x: auto;
}
.cryo-grid-head {
    min-height: 26px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.72rem;
    color: var(--muted-color);
}
.cryo-cell {
    position: relative;
    min-height: 58px;
    border: 1px solid var(--line-color);
    border-radius: 7px;
    background: rgba(255, 255, 252, 0.82);
    color: var(--text-color);
    padding: 5px;
    text-align: left;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 2px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.cryo-cell:disabled {
    cursor: not-allowed;
}
.cryo-cell:disabled:hover {
    box-shadow: none;
    transform: none;
}
.cryo-cell:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 121, 103, 0.42);
    box-shadow: 0 8px 18px rgba(58, 72, 63, 0.08);
}
.cryo-cell.filled {
    background: linear-gradient(180deg, rgba(237, 242, 234, 0.96), rgba(255, 255, 252, 0.92));
}
.cryo-cell.type-ecoli {
    background: linear-gradient(180deg, rgba(227, 242, 253, 0.98), rgba(248, 252, 255, 0.94));
    border-color: rgba(49, 130, 206, 0.34);
}
.cryo-cell.type-agro {
    background: linear-gradient(180deg, rgba(232, 246, 236, 0.98), rgba(251, 254, 249, 0.94));
    border-color: rgba(47, 133, 90, 0.34);
}
.cryo-cell.type-bacteria {
    background: linear-gradient(180deg, rgba(224, 247, 244, 0.98), rgba(248, 255, 253, 0.94));
    border-color: rgba(44, 154, 140, 0.34);
}
.cryo-cell.type-yeast {
    background: linear-gradient(180deg, rgba(255, 244, 230, 0.98), rgba(255, 253, 248, 0.94));
    border-color: rgba(214, 140, 69, 0.34);
}
.cryo-cell.type-plasmid {
    background: linear-gradient(180deg, rgba(242, 232, 255, 0.98), rgba(253, 250, 255, 0.94));
    border-color: rgba(128, 90, 213, 0.32);
}
.cryo-cell.type-fungus {
    background: linear-gradient(180deg, rgba(235, 244, 214, 0.98), rgba(253, 255, 248, 0.94));
    border-color: rgba(104, 145, 61, 0.34);
}
.cryo-cell.type-rna {
    background: linear-gradient(180deg, rgba(255, 235, 238, 0.98), rgba(255, 250, 251, 0.94));
    border-color: rgba(197, 87, 112, 0.3);
}
.cryo-cell.type-dna {
    background: linear-gradient(180deg, rgba(229, 234, 255, 0.98), rgba(250, 251, 255, 0.94));
    border-color: rgba(87, 103, 197, 0.3);
}
.cryo-cell.type-protein {
    background: linear-gradient(180deg, rgba(255, 247, 204, 0.98), rgba(255, 254, 246, 0.94));
    border-color: rgba(186, 144, 20, 0.32);
}
.cryo-cell.type-tissue {
    background: linear-gradient(180deg, rgba(255, 226, 214, 0.98), rgba(255, 251, 248, 0.94));
    border-color: rgba(201, 103, 66, 0.32);
}
.cryo-cell.hit {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(198, 168, 117, 0.18);
}
.cryo-cell.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 121, 103, 0.2);
}
.cryo-cell.source-selected,
.cryo-cell.target-selected {
    border-color: #365f46;
    box-shadow: 0 0 0 3px rgba(54, 95, 70, 0.22);
}
.cryo-cell.target-occupied {
    opacity: 0.72;
}
.cryo-selection-badge {
    align-items: center;
    background: #365f46;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.62rem;
    font-weight: 900;
    gap: 2px;
    justify-content: center;
    min-height: 22px;
    min-width: 22px;
    padding: 2px 5px;
    position: absolute;
    right: -5px;
    top: -6px;
    z-index: 2;
}
.cryo-cell.transfer-highlight {
    animation: cryo-transfer-highlight 1.8s ease-out;
    border-color: #b78934;
    box-shadow: 0 0 0 4px rgba(183, 137, 52, 0.28);
}
@keyframes cryo-transfer-highlight {
    0%, 45% { box-shadow: 0 0 0 5px rgba(183, 137, 52, 0.38); }
    100% { box-shadow: 0 0 0 0 rgba(183, 137, 52, 0); }
}
.cryo-cell-label {
    font-size: 0.62rem;
    color: var(--muted-color);
    font-weight: 800;
}
.cryo-cell strong {
    font-size: 0.7rem;
    line-height: 1.15;
    word-break: break-word;
    color: var(--ink-color);
}
.cryo-cell small {
    color: var(--primary-deep);
    font-size: 0.6rem;
}
.cryo-type-chip,
.cryo-cell-type {
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    line-height: 1;
}
.cryo-type-chip {
    font-size: 0.68rem;
    padding: 5px 7px;
}
.cryo-cell-type {
    align-self: end;
    justify-self: start;
    padding: 3px 5px;
}
.cryo-type-chip.type-ecoli,
.cryo-cell-type.type-ecoli { background: #d6ecff; color: #1d5f99; }
.cryo-type-chip.type-agro,
.cryo-cell-type.type-agro { background: #d8f3df; color: #216744; }
.cryo-type-chip.type-bacteria,
.cryo-cell-type.type-bacteria { background: #d8f8f3; color: #17665d; }
.cryo-type-chip.type-yeast,
.cryo-cell-type.type-yeast { background: #ffe8c7; color: #8b4a12; }
.cryo-type-chip.type-plasmid,
.cryo-cell-type.type-plasmid { background: #eadcff; color: #6540a6; }
.cryo-type-chip.type-fungus,
.cryo-cell-type.type-fungus { background: #e5f2ca; color: #58752f; }
.cryo-type-chip.type-rna,
.cryo-cell-type.type-rna { background: #ffe0e7; color: #9d3957; }
.cryo-type-chip.type-dna,
.cryo-cell-type.type-dna { background: #e1e6ff; color: #3f4f9b; }
.cryo-type-chip.type-protein,
.cryo-cell-type.type-protein { background: #fff2b8; color: #765600; }
.cryo-type-chip.type-tissue,
.cryo-cell-type.type-tissue { background: #ffe1d4; color: #8a3c24; }
.cryo-type-chip.type-other,
.cryo-cell-type.type-other { background: #ece7dd; color: #6b6253; }
.cryo-transfer-dialog {
    --bs-modal-width: min(1180px, calc(100vw - 32px));
}
.cryo-transfer-box-picker {
    max-width: 520px;
}
.cryo-transfer-grid-shell {
    border: 1px solid var(--line-color);
    border-radius: 10px;
    overflow: auto;
    padding: 12px;
}
.cryo-target-grid {
    min-width: max-content;
}
.cryo-transfer-preview {
    background: rgba(247, 249, 245, 0.92);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 12px;
}
.cryo-transfer-mappings {
    display: grid;
    gap: 6px;
    max-height: 170px;
    overflow: auto;
}
.cryo-transfer-mapping {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(99, 121, 103, 0.18);
    border-radius: 7px;
    color: var(--text-color);
    display: grid;
    gap: 8px;
    grid-template-columns: 24px minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 7px 9px;
}
.cryo-transfer-mapping > span {
    background: #365f46;
    border-radius: 999px;
    color: #fff;
    display: grid;
    font-size: 0.68rem;
    font-weight: 900;
    height: 22px;
    place-items: center;
    width: 22px;
}
.cryo-transfer-mapping strong {
    overflow-wrap: anywhere;
}
@media (max-width: 1180px) {
    .cryo-layout { grid-template-columns: 1fr; }
    .cryo-box-list { max-height: none; }
}
@media (max-width: 575.98px) {
    .cryo-batch-toolbar,
    .cryo-board-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .cryo-transfer-grid-shell {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        margin-left: -16px;
        margin-right: -16px;
    }
    .cryo-transfer-mapping {
        grid-template-columns: 24px 1fr;
    }
    .cryo-transfer-mapping .fa-arrow-right {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .cryo-cell.transfer-highlight {
        animation: none;
    }
}

/* Integrated qPCR primer design */
.primer-design-app {
    --primer-green: #5f8069;
    --primer-blue: #2e6f95;
    --primer-border: #dce5e9;
    background: #fbfcfd;
    border: 1px solid var(--primer-border);
    border-radius: 12px;
    padding: 16px;
}
.primer-design-toolbar { border-bottom: 1px solid #e7ecef; padding-bottom: 12px; }
.primer-design-toolbar .btn { border-radius: 999px; }
.primer-design-app .form-label { color: #46555f; }
.primer-design-app .form-text { color: #71808a; font-size: .75rem; }
.primer-design-app select[multiple] { min-height: 118px; }
.primer-design-app .species-picker-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.primer-feature-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.primer-feature-tab {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 82px;
    padding: 13px 14px;
    text-align: left;
    color: #31424a;
    background: #fff;
    border: 1px solid #dbe4e8;
    border-radius: 11px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
.primer-feature-tab:hover { border-color: #abc8d5; box-shadow: 0 5px 16px rgba(36,73,89,.09); transform: translateY(-1px); }
.primer-feature-tab.is-active { border-color: var(--primer-blue); background: linear-gradient(135deg, #f1f8fb, #fff); box-shadow: 0 0 0 2px rgba(46,111,149,.1); }
.primer-feature-tab:focus-visible { outline: 3px solid rgba(46,111,149,.22); outline-offset: 2px; }
.primer-feature-tab > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.primer-feature-tab strong { font-size: .9rem; }
.primer-feature-tab small { color: #71808a; font-size: .74rem; line-height: 1.4; }
.primer-feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--primer-blue); background: #edf4f6; }
.primer-feature-tab.is-active .primer-feature-icon { color: #fff; background: var(--primer-blue); }
.primer-feature-running { align-self: start; padding: 2px 7px; color: #25546b; background: #dcebf2; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.primer-stepper { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.primer-step { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #71808a; font-size: .78rem; padding: 3px 0; font-weight: 700; }
.primer-step:disabled { opacity: .45; cursor: not-allowed; }
.primer-step.is-active { color: var(--primer-blue); }
.primer-step.is-done { color: var(--primer-green); }
.primer-step-number { width: 23px; height: 23px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cfd9de; border-radius: 50%; background: #fff; font-size: .72rem; }
.primer-step.is-active .primer-step-number { color: #fff; background: var(--primer-blue); border-color: var(--primer-blue); box-shadow: 0 0 0 3px rgba(46,111,149,.12); }
.primer-step.is-done .primer-step-number { color: #fff; background: var(--primer-green); border-color: var(--primer-green); }
.primer-step-divider { width: 24px; height: 1px; background: #d9e1e5; }
.primer-wizard-panel { border: 1px solid var(--primer-border); border-radius: 12px; background: #fbfcfd; padding: 16px; margin-bottom: 14px; }
.primer-wizard-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.primer-wizard-heading h6 { color: #263b45; font-weight: 800; }
.primer-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.primer-choice-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.primer-choice-card { display: flex; align-items: center; gap: 11px; text-align: left; width: 100%; min-height: 76px; border: 1px solid #dbe4e8; border-radius: 10px; background: #fff; color: #31424a; padding: 12px; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.primer-choice-card:hover:not(:disabled) { border-color: #abc8d5; box-shadow: 0 3px 12px rgba(36,73,89,.08); }
.primer-choice-card.is-selected { border-color: var(--primer-blue); background: #f1f8fb; box-shadow: 0 0 0 2px rgba(46,111,149,.1); }
.primer-choice-card.is-disabled { opacity: .58; cursor: not-allowed; background: #f6f8f9; }
.primer-choice-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; background: #edf4f6; color: var(--primer-blue); }
.primer-choice-card.is-selected .primer-choice-icon { background: #d7ebf2; }
.primer-choice-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.primer-choice-copy strong { font-size: .86rem; }
.primer-choice-copy small { color: #71808a; line-height: 1.35; }
.primer-choice-state { color: #6b7d86; font-size: .72rem; white-space: nowrap; }
.primer-choice-card.is-selected .primer-choice-state { color: var(--primer-blue); font-weight: 800; }
.primer-section-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; color: #263b45; }
.primer-section-kicker { color: var(--primer-blue); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.primer-section-heading strong { font-size: .96rem; }
.species-picker { padding: 9px; }
.species-picker-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.species-picker-toolbar .species-picker-search { min-width: 0; flex: 1; }
.species-picker-actions { display: flex; gap: 8px; white-space: nowrap; }
.species-picker-actions .btn { color: var(--primer-blue); font-size: .72rem; }
.species-picker .rbh-target-list { max-height: 220px; }
.species-picker .rbh-target-item { padding: 7px 9px; }
.primer-hit-database-list { display: grid; gap: 8px; }
.primer-hit-database { border: 1px solid #dbe4e8; border-radius: 9px; background: #fbfcfd; overflow: hidden; }
.primer-hit-database summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; padding: 10px 12px; list-style: none; font-size: .8rem; font-weight: 800; color: #31424a; }
.primer-hit-database summary::-webkit-details-marker { display: none; }
.primer-hit-database summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: #71808a; transition: transform .16s ease; }
.primer-hit-database[open] summary::after { transform: rotate(180deg); }
.primer-hit-database-body { padding: 0 9px 9px; display: grid; gap: 7px; }
.primer-hit-card { border: 1px solid #e3eaed; border-radius: 8px; background: #fff; padding: 9px 10px; }
.primer-hit-sequence { max-height: 160px; overflow: auto; padding: 8px; border: 1px solid #e6ecef; border-radius: 6px; background: #f7fafb; white-space: pre-wrap; word-break: break-all; font-size: .78rem; line-height: 1.5; }
.primer-hit-track { position: relative; height: 8px; margin: 4px 0 3px; border-radius: 99px; background: #e8eef1; overflow: hidden; }
.primer-hit-track-range { position: absolute; inset-block: 0; min-width: 4px; border-radius: 99px; background: linear-gradient(90deg, #5f8069, #2e6f95); }
.primer-product-warning { border-left: 3px solid #d39b2a; border-radius: 5px; background: #fff8e8; color: #72520f; padding: 7px 9px; font-size: .78rem; line-height: 1.45; }
.primer-binding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.primer-binding-detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; border: 1px solid #e3eaed; border-radius: 7px; background: #f8fafb; padding: 7px 8px; font-size: .75rem; }
.primer-binding-label { align-self: start; border-radius: 99px; background: #dcebf2; color: #25546b; padding: 2px 7px; font-weight: 800; }
.primer-gene-track { position: relative; height: 58px; border: 1px solid #e1e8ec; border-radius: 7px; background: #f8fafb; overflow: hidden; }
.primer-gene-line { position: absolute; top: 31px; left: 1%; right: 1%; height: 2px; background: #9badb5; }
.primer-gene-exon, .primer-gene-cds, .primer-gene-amplicon, .primer-gene-primer { position: absolute; min-width: 3px; }
.primer-gene-exon { top: 25px; height: 14px; background: #b8cad2; border-radius: 2px; }
.primer-gene-cds { top: 22px; height: 20px; background: #4c7d6c; border-radius: 2px; }
.primer-gene-amplicon { top: 47px; height: 4px; border-radius: 99px; background: #377da0; opacity: .9; }
.primer-gene-primer { top: 3px; height: 17px; border-radius: 4px; color: #fff; padding: 1px 4px; font-size: .65rem; font-weight: 800; line-height: 15px; white-space: nowrap; overflow: visible; z-index: 2; }
.primer-gene-primer-f { background: #26734d; }
.primer-gene-primer-r { background: #9a4d6a; }
@media (max-width: 680px) {
    .primer-feature-switcher { grid-template-columns: 1fr; }
    .primer-choice-grid-two { grid-template-columns: 1fr; }
    .primer-step-divider { width: 12px; }
    .primer-step { font-size: .72rem; }
    .species-picker-toolbar { align-items: stretch; flex-direction: column; }
    .species-picker-actions { justify-content: flex-end; }
    .primer-binding-grid { grid-template-columns: 1fr; }
}
.primer-resolved-target,
.primer-progress-card {
    border: 1px solid #cfe0d6;
    border-radius: 10px;
    background: linear-gradient(180deg, #f5fbf6 0%, #fff 100%);
    padding: 12px 14px;
}
.primer-progress-card { border-color: #d4e2ea; background: #f7fbfd; }
.primer-amplification-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #cfe0d6;
    border-radius: 10px;
    background: linear-gradient(135deg, #f3faf5, #fff);
}
.primer-result-table { border: 1px solid var(--primer-border); border-radius: 10px; overflow: auto; background: #fff; }
.primer-result-table th { white-space: nowrap; color: #60717b; font-size: .76rem; background: #f6f9fa; }
.primer-result-table td { vertical-align: middle; }
.primer-result-table .font-monospace { min-width: 150px; }
.primer-score-pill {
    display: inline-flex;
    min-width: 52px;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    color: #345b47;
    background: #e9f4ed;
    border: 1px solid #b9d5c1;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.primer-best-score {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #2e6f95;
    background: #edf6fb;
    border: 1px solid #c7e0ed;
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
}
.primer-score-breakdown {
    max-width: 320px;
    border-top: 1px solid #e5ecef;
    padding-top: 10px;
    color: #56656e;
}
.primer-recommendation-summary { color: #536273; font-size: .78rem; }
.primer-gate-note { border-radius: 9px; padding: 10px 12px; font-size: .82rem; }
.primer-gate-note ul { padding-left: 1.15rem; }
.primer-gate-pass { color: #155724; background: #edf8ef; border: 1px solid #b7dfbd; }
.primer-gate-review { color: #6b4e00; background: #fff8df; border: 1px solid #f0d98a; }
.primer-gate-fail { color: #842029; background: #fff0f1; border: 1px solid #f2b8bd; }

/* Functional enrichment: keep result files separate from figure formats. */
.functional-enrichment-export-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem 1rem;
    width: 100%;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--ui-line);
}
.functional-enrichment-export-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}
.functional-enrichment-export-label {
    color: var(--ui-muted);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}
@media (max-width: 767.98px) {
    .functional-enrichment-export-toolbar {
        align-items: stretch;
        justify-content: flex-start;
    }
    .functional-enrichment-export-group {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }
    .functional-enrichment-image-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem;
        width: 100%;
    }
    .functional-enrichment-image-buttons > .btn {
        width: 100%;
        margin-left: 0 !important;
        border-radius: 6px !important;
    }
}

.primer-feature-track { border: 1px solid #e1e8ec; background: #fbfcfd; border-radius: 9px; padding: 12px; }
.primer-track-line { position: relative; height: 26px; margin: 4px 8px 0; border-top: 2px solid #aab9c0; }
.primer-track-amplicon { position: absolute; top: -4px; height: 7px; border-radius: 6px; background: rgba(46, 111, 149, .28); border: 1px solid rgba(46, 111, 149, .55); }
.primer-track-marker { position: absolute; top: -16px; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; color: #fff; font-size: .68rem; font-weight: 700; text-align: center; transform: translateX(-50%); }
.primer-track-forward { background: var(--primer-green); }
.primer-track-reverse { background: var(--primer-blue); }
