@font-face {
    font-family: "KN Yuanmo SC Hero";
    src: url("https://static.igem.wiki/teams/6419/wiki/fonts/kingnamypeyuanmosc.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: 'KN Yuanmo SC';
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/knyuanmo-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    /* 你可以自己给它起个名字，调用时就用这个名字 */
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/zhengwen500.woff2') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 标题字体：Montserrat（几何无衬线，笔画端点平齐），本地可变字重 100~900 */
@font-face {
    font-family: 'Montserrat Display';
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/montserrat-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alkatra';
    /* 这是你给这个字体起的名字，下面应用时会用到 */
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/geyan.woff2') format('woff2');
    /* 假设你把字体放在了 fonts 文件夹下 */
    font-weight: 600;
    /* Alkatra 我们下载的是 600 字重 */
    font-style: normal;
    font-display: swap;
}


/* 两处 :root 合并：自定义属性互不重叠，层叠结果不变 */
:root {
    --brand: #0070C0;
    --primary-blue: #0070C0;
    --light-blue: #93E3ED;
    --yellow: #FFFF00;
    --white: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
}

html {
    scroll-behavior: smooth;
}

.hero-pin,
.hero-pin * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hero {
    --p: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 1;
    background: #cdd9e5;
}

/* 原 safety 的 body 蓝底移到此处（hero 区域视觉不变），body 背景交给下方内容页 */
.hero-pin {
    position: relative;
    height: 260vh;
    background: var(--brand);
}

/* 底层图片：铺满全屏，随揭开进度轻微放大回落 */
.hero__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 25%;
    transform: scale(calc(1.06 - var(--p, 0) * 0.06));
    will-change: transform;
}

/* 过渡遮盖图：铺满 hero 全屏，只在 photo 之上、veil/标题之下 */
.zhegai {
    position: absolute;
    inset: 0;
    /* 铺满全屏 */
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* SVG 为竖版，按比例铺满裁切 */
    object-position: buttom;
    display: block;
    z-index: 1;
    transform: translateY(180px);
    /* 正数向下，负数向上 */
}

.hero__veil {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.veil-layer {
    position: absolute;
    inset: 0;
    -webkit-mask-image: radial-gradient(circle var(--arc-r, 1400px) at 50% var(--arc-y, -1400px), rgba(0, 0, 0, 0) 86%, #000 100%);
    mask-image: radial-gradient(circle var(--arc-r, 1400px) at 50% var(--arc-y, -1400px), rgba(0, 0, 0, 0) 86%, #000 100%);
}

.veil-layer>i {
    position: absolute;
    inset: -30%;
    background-image: radial-gradient(circle var(--dot, 30px) at 50% 50%, rgba(255, 255, 255, 0.2) 60%, rgba(255, 255, 255, 0) 100%);
    background-size: var(--cell, 60px) var(--cell, 60px);
    background-position: var(--offx, 0) calc(var(--offy, 0) + var(--p, 0) * -46px);
    transform: rotate(var(--rot, 0deg));
}

.veil-layer:nth-child(1)>i {
    --cell: 28px;
    --rot: 9deg;
    --offx: 0px;
    --offy: 0px;
}

.veil-layer:nth-child(2)>i {
    --cell: 21px;
    --rot: -17deg;
    --offx: 14px;
    --offy: 9px;
}

.veil-layer:nth-child(3)>i {
    --cell: 14px;
    --rot: 31deg;
    --offx: 6px;
    --offy: 17px;
}

.hero__shade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 30vh;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(to bottom,
            rgba(0, 112, 192, 0) 0%,
            rgba(0, 112, 192, 0.5) 50%,
            #0070C0 100%);
}

/* ===== 居中标题区 ===== */
.hero__caption {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 6vw 4vh;
    pointer-events: none;
    /* 固定初始偏移，上下移动由 GSAP 时间线控制 */
    transform: translateY(10.5vh);
}

/* GSAP 滚动动画作用层 */
.hero__caption-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: 50% 50%;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 两个标题 div 的叠放容器：黄字投影锚定蓝字 */
.title-stack {
    position: relative;
    will-change: transform;
}

/* 标题字体：标题荆南缘默体，副标题 Alkatra SemiBold。
全部使用 class 选择器，不用 h1/h2/h3 标签选择器，避免与其他页面样式冲突 */
.hero__title,
.hero__title2 {
    font-family: "KN Yuanmo SC Hero", "Inter", sans-serif;
    /* 初始即满尺寸，手机端约 58px 不溢出 */
    font-size: clamp(3.5rem, 16vw, 11rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.02em;
}

.hero__title {
    position: relative;
    z-index: 2;
    color: var(--brand);
}

/* 小钻覆盖层（裁进字形）：菱形切面 + 光晕 + 芒线，静态无动画 */
.hero__title::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    text-align: center;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image: url("https://static.igem.wiki/teams/6419/wiki/common/diamond.avif");
    background-size: 10px 10px;
    -webkit-background-clip: text;
    background-clip: text;
}

.hero__title2 {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    color: #FFFF00;
    /* em 相对字号：桌面 192px 时仍为 12px/14px，字号缩小时投影同比缩小 */
    transform: translate(0.0625em, 0.073em);
    pointer-events: none;
}

/* ===== 副标题：强力居中，署名紧贴右下角 ===== */
.fubiaoti {
    position: relative;
    width: fit-content;
    /* 自适应文字宽度，实现右下角精准对齐 */
    max-width: min(95vw, 1200px);
    margin: clamp(1.2rem, 3.2vw, 3rem) auto 0;
    pointer-events: none;
    text-align: center;
    /* 强力居中 */
}

.fubiaoti::before {
    /* 白色糊糊背景 */
    content: "";
    position: absolute;
    top: -15%;
    bottom: -25%;
    left: -30px;
    right: -30px;
    z-index: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 150px;
    filter: blur(22px);
    transform: translateY(-15px);
    will-change: transform;
}

.fubiaoti .line {
    position: relative;
    z-index: 1;
    font-family: "Alkatra", "Inter", sans-serif;
    font-weight: 600;
}

/* 兼容现有 HTML，取消原本 left/right 的强制偏移 */
.fubiaoti .quote,
.fubiaoti .left,
.fubiaoti .right {
    position: relative;
    z-index: 1;
    font-family: "Alkatra", "Inter", sans-serif;
    font-weight: 600;
    font-size: clamp(1.35rem, 5.2vw, 2.6rem);
    font-style: italic;
    line-height: 1.5;
    color: #286189;
    opacity: 0.92;
    text-align: center;
    transform: none !important;
    /* 清除原有错落效果 */
}

/* 署名部分 (NAUCHINA) */
.fubiaoti .right-very {
    position: relative;
    z-index: 1;
    margin-top: 0.3em;
    font-size: clamp(1.35rem, 5.2vw, 2rem);
    font-style: italic;
    letter-spacing: 0.08em;
    color: #286189;
    /* 颜色和格言一样 */
    text-align: right;
    /* 精确贴合格言文字的右下角 */
    transform: none !important;
    /* 清除原有偏移 */
    font-family: "Alkatra", "Inter", sans-serif;
    font-weight: 600;
}

/* ===== hero 区响应式与动效偏好 ===== */
@media (max-width: 700px) {
    .veil-layer:nth-child(1)>i {
        --cell: 30px;
    }

    .veil-layer:nth-child(2)>i {
        --cell: 22px;
    }

    .veil-layer:nth-child(3)>i {
        --cell: 16px;
    }

    /* 图片：焦点略偏上保留人物主体，初始放大收窄避免裁掉太多 */
    .hero__photo {
        object-position: 50% 45%;
        transform: scale(calc(1.03 - var(--p, 0) * 0.03));
    }

    .hero__shade {
        height: 38vh;
    }

    .hero__caption {
        padding: 0 5vw 5vh;
    }

    .hero__title::before {
        background-size: 18px 18px;
    }
}

/* 横屏矮屏（手机横放）：上下空间紧张，压缩副标题与间距，图片焦点上移 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero__photo {
        object-position: 50% 32%;
    }

    .fubiaoti {
        margin-top: 0.8rem;
    }

    .fubiaoti .quote,
    .fubiaoti .left,
    .fubiaoti .right {
        font-size: clamp(0.9rem, 2.4vw, 1.2rem);
        line-height: 1.35;
    }

    .fubiaoti .right-very {
        font-size: clamp(0.75rem, 2vw, 0.8rem);
        margin-top: 0.3em;
    }
}

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

/* ============================================================
正文区（完全采用 safety-and-security_2.html 新版样式）
============================================================ */
/* ---------------- 修改背景颜色与顶部渐变过渡 ---------------- */
/* 注意：不要在 body 上单设 overflow-x:hidden。footer.css 给了 html,body{height:100%}，
   一旦 body 一个轴为 hidden、另一轴为 visible，浏览器会把 visible 强制算成 auto，
   锁高的 body 就变成“内部滚动容器”，window 级滚动失效，导航栏 .scrolled 永不触发。 */
body {
    margin: 0;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    background-color: #F7F7EB;
    position: relative;
    z-index: 0;
}

/* 校正整页滚动模型：高度随内容增长，纵向交给窗口滚动（与 results 等正常页一致）；
   横向防溢出只放在 html 上，避免 body 成为独立滚动容器。 */
html,
body {
    height: auto;
    overflow-y: visible;
}

html {
    overflow-x: hidden;
}

/* 2. 改造 .page-container，去掉 margin-top，改用 padding-top 避免外边距塌陷 */
.page-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 0 auto;
    /* 将 120px auto 改为 0 auto，消除上方外边距断层 */
    padding: 120px 5% 0;
    /* 改用 padding-top 顶开正文距离 */
    gap: 5px;
    position: relative;
    z-index: 1;
}

/* 3. 让渐变伪元素精准贴齐正文最顶部（top: 0），向下方延伸过渡，彻底消除裂缝 */
.page-container::before {
    content: '';
    position: absolute;
    top: 0;
    /* 严丝合缝贴着 heroPin 的底边开始 */
    left: 0;
    right: 0;
    width: 100%;
    /* 不使用 100vw，使用 100% 避免因滚动条产生缝隙 */
    height: 360px;
    /* 渐变高度更柔和自然 */
    background: linear-gradient(180deg,
            #0070C0 0%,
            #6FA6D6 30%,
            #93C5D9 55%,
            #B5DCE6 75%,
            #DDF1F0 90%,
            #F7F7EB 100%);
    z-index: -1;
    pointer-events: none;
}

/* ---------------- 左侧导航栏 (TOC) 外层 ---------------- */
.sidebar-nav {
    width: 300px;
    /* 原为260px，加宽40px */
    flex-shrink: 0;
    position: sticky;
    top: 0;
    /* 【关键】改为 0，直接顶到屏幕最上方 */
    height: 100vh;
    /* 【关键】占满全屏高度 */
    padding-top: 90px;
    /* 【修复长文字被裁】overflow-y:auto 会把 overflow-x:visible 强制算成 auto，
       导致超出 180px 内容区的长单词（如 Electrophoresis）在 300px 边缘被切掉。
       用 padding-right 隐形扩展裁剪边界（裁剪发生在 padding box 边缘），
       配合负 margin-right 抵消布局影响，flex 布局完全不变 */
    padding-right: 120px;
    margin-left: 20px;
    /* 原为40px，向左微调平衡 */
    margin-right: -120px;
    transform: translateX(-50px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    /* 层级高于右侧内容区（capsule-title 等 relative 元素 DOM 顺序靠后，否则会盖住溢出文字） */
    z-index: 2;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

/* ---------------- 修改：左侧导航栏内部容器增大左内边距 ---------------- */
.toc-container {
    position: static;
    /* 【关键】改为 static，让内部的标尺直接以全屏侧边栏为基准 */
    padding: 40px 0 8px 120px;
}

.toc-container h3 {
    display: none;
}

.ruler-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10px;
    width: 35px;
    z-index: 1;

    /* 三层刻度叠加，利用不同的 background-size 和覆盖关系实现完美交替 */
    background-image:
        linear-gradient(to bottom, #5BA4D9 0px, #5BA4D9 4px, transparent 4px),
        linear-gradient(to bottom, #5BA4D9 0px, #5BA4D9 4px, transparent 4px),
        linear-gradient(to bottom, #5BA4D9 0px, #5BA4D9 4px, transparent 4px);
    background-size:
        100% 100px,
        60% 50px,
        30% 10px;
    background-position: center top, center top, center top;
    background-repeat: repeat-y, repeat-y, repeat-y;
}

/* =======================================================
   3. 水滴指示器
======================================================= */
.water-drop-indicator {
    position: absolute;
    top: 23px;
    /* 起点高度：视你的第一个 <li> 高度进行微调 */
    left: -11px;
    /* 居中偏移量 */
    width: 55px;
    height: 120px;
    background-image: url("https://static.igem.wiki/teams/6419/wiki/common/water.webp");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    z-index: 11;
    pointer-events: none;
    will-change: transform;
    /* 平滑移动由 safety.js 的 rAF 缓动接管，不再用 CSS transition（避免双重缓动发黏） */
}

/* 移动端自动隐藏特效 */
@media (max-width: 1024px) {
    .ruler-container {
        display: none;
    }
}

/* ---------------- 目录列表 ---------------- */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 20px;
    position: relative;
}

/* .toc-list::before {
    content: '';
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: -45px;
    width: 25px;
    background-image: radial-gradient(circle, #82A6C2 9px, transparent 9.5px);
    background-size: 25px 50px;
    background-repeat: repeat-y;
    background-position: center top;
    pointer-events: none;
    z-index: -1;
} */

.toc-list>li {
    /* 一级条目之间的间隙："最后一行 → 下一条第一行"恒等于此值，与换行无关。
       想调宽调窄只改这一个数，不会影响一级标题 → 二级菜单的距离 */
    margin-bottom: 24px;
    position: relative;
}

/* 一级标题文字 */
.toc-list>li>a {
    text-decoration: none;
    font-family: 'Montserrat Display', 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.38em;
    letter-spacing: 1.5px;
    color: #0070C0;
    height: auto;
    /* ★ 等间距机制：min-height 固定 26 = 一个行高（本站 box-sizing 为默认
       content-box，min-height 不含 padding），条目内不制造任何额外空白。
       条目之间的间隙全部由上方 .toc-list>li 的 margin-bottom（24px）提供，
       "最后一行 → 下一条第一行"恒等于该值，与换行无关。
       一级标题 → 二级菜单的距离只由 .toc-sublist 的 margin-top（14px）
       决定；两个距离已完全解耦，各自单独调，互不影响 */
    min-height: 26px;
    display: flex;
    align-items: flex-start;
    line-height: 26px;
    transition: all 0.3s ease;
    position: relative;
}

.toc-list>li>a:hover {
    color: #51bddd;
    transform: translateX(4px);
}

.toc-list>li>a.active {
    color: #0070C0;
    text-shadow: 5px 5px 2px rgba(255, 255, 0, 0.4);
}

/* ====== 常驻黄色圆点 ====== */
.toc-list>li>a::before {
    content: '';
    position: absolute;
    left: -44.5px;
    /* 13px = 行高 26px 的一半：首行文字中心，与换行与否无关 */
    top: 13px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-sizing: border-box;
    background-color: var(--yellow);
    border: 5px solid var(--primary-blue);
    box-shadow: none;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 1;
}

.toc-list>li>a.active::before,
.toc-list>li>a:hover::before {
    box-shadow: 0 0 8px rgba(0, 112, 192, 0.6);
    transform: translateY(-50%) scale(1.15);
}

/* ====== 二级子菜单 ====== */
.toc-sublist {
    list-style: none;
    padding-left: 0;
    /* 与上方一级标题的间距：想更宽就调大这个值（原为 0） */
    margin-top: 14px;
    margin-bottom: 0;
    display: none;
}

/* 桌面端：二级标题整体左移，贴近左侧圆点虚线装饰。
   -18px 让文字落在圆点线右侧约 10px 处；想更近就调大负值，更远就调小 */
@media (min-width: 1025px) {
    .toc-sublist {
        margin-left: -8px;
    }
}

.toc-list li.active .toc-sublist {
    display: block;
    animation: fadeInDown 0.4s ease forwards;
}

.toc-sublist>li {
    margin-bottom: 0;
}

/* ====== 二级子菜单项链接动画设置 ====== */
.toc-sublist a {
    text-decoration: none !important;
    font-size: 1.1em;
    font-family: 'Montserrat Display', 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: 1px;
    color: #6FA6D6;
    /* 高度自适应 + 统一 padding：所有条目"最后一行 → 下一条第一行"间隙恒为 padding-bottom 值。
       ★ min-height 必须等于 26(行高)+padding-bottom：若大于它，单行条目会被 min-height
       额外撑高，多余空白落在文字下方，单行与两行的间隙就不再相等 */
    height: auto;
    min-height: 31px;
    display: inline-flex;
    /* 同一级标题：顶部起排 + 行高 26px，首行中心恒在 13px，圆点恒对齐首行 */
    align-items: flex-start;
    /* 左 8px 预留 Hover 缩进；底 5px 统一条目间文字间隙 */
    padding: 0 0 5px 8px;
    line-height: 26px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 极简 Hover 与 Active 动效：仅变色与右移 */
.toc-sublist a:hover {
    color: #0070C0;
    padding-left: 14px;
}

.toc-sublist a.active {
    color: #0070C0;
}

/* 二级子菜单圆点：与一级标题同款（黄心 + 蓝边），贴在左侧虚线上 */
.toc-sublist a::before {
    content: '';
    position: absolute;
    /* -44.5px 为虚线上的标准位置（同一级圆点），+8px 抵消 .toc-sublist 的 margin-left:-8px；
       若调整 .toc-sublist 的 margin-left，此处需同步增减 */
    left: -36.5px;
    /* 13px = 行高 26px 的一半：首行文字中心 */
    top: 13px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-sizing: border-box;
    background-color: #e7e37d;
    border: 5px solid #3da8c9;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 1;
}

/* 与一级圆点一致的 Hover/Active 光晕放大 */
.toc-sublist a.active::before,
.toc-sublist a:hover::before {
    box-shadow: 0 0 8px rgba(0, 112, 192, 0.6);
    transform: translateY(-50%) scale(1.15);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------- 右侧主内容区 ---------------- */
.content-wrapper {
    flex: 0 0 auto;
    /* 不再用 flex:1 撑满 */
    width: 63vw;
    /* 视口宽度的 75% */
    max-width: 69vw;
    /* 移除原来的 1000px 限制 */
    min-width: 0;
    margin-left: auto;
    /* ★ 关键：把它推到右边 */
    margin-right: 12%;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    box-sizing: border-box;
}

.section-container {
    margin-bottom: 60px;
    scroll-margin-top: 140px;
}

/* ---------------- 一级标题样式 ---------------- */
.capsule-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: 75px;
    margin: 35px 80px 35px 10px;
    padding: 0 30px 0 35px;
    border-radius: 40px 0 0 40px;
    background: linear-gradient(to right, var(--primary-blue) 30%, #51bddd 100%);
    color: var(--white);
    font-size: 2.5em;
    font-weight: 900;
    font-family: 'Montserrat Display', 'Montserrat', sans-serif;
    letter-spacing: 2px;
    border: none;
    filter: drop-shadow(0 10px 15px rgba(0, 112, 192, 0.2));
}

.capsule-title::before {
    content: '';
    position: absolute;
    top: -35px;
    left: -20px;
    width: 100px;
    height: 115px;
    z-index: -1;
    background-image:
        radial-gradient(circle at 60px 40px, transparent 18px, var(--primary-blue) 19px, var(--primary-blue) 20.5px, transparent 21.5px),
        radial-gradient(circle at 32px 45px, transparent 28px, var(--primary-blue) 29px, var(--primary-blue) 30.5px, transparent 31.5px),
        radial-gradient(circle at 8px 98px, transparent 5px, var(--primary-blue) 6px, var(--primary-blue) 7px, transparent 8px);
    background-repeat: no-repeat;
}

.capsule-title::after {
    content: '';
    position: absolute;
    left: calc(100% - 1px);
    top: 0;
    height: 100%;
    width: 60px;
    background-image:
        radial-gradient(circle at 1px center, #51bddd 5.5px, transparent 6px),
        radial-gradient(circle at 14px center, #7acfe3 4px, transparent 4.5px),
        radial-gradient(circle at 25px center, #9ee3f2 2.5px, transparent 3px),
        radial-gradient(circle at 34px center, #c6f2fa 1.5px, transparent 2px);
    background-size: 100% 12px;
    background-repeat: repeat-y;
    background-position: 0 center;
}

.text-box {
    background-color: #FFFFFF;
    padding: 30px 50px;
    margin-left: 0px;
    border-radius: 24px;
    box-shadow:
        0 8px 25px rgba(0, 112, 192, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: box-shadow 0.3s ease;
}

.text-box:hover {
    box-shadow:
        0 12px 35px rgba(0, 112, 192, 0.12),
        0 4px 15px rgba(0, 0, 0, 0.04);
}

.text-box h3 {
    position: relative;
    width: fit-content;
    margin: 40px auto 35px;
    color: var(--primary-blue);
    font-size: 1.7em;
    font-weight: 900;
    font-family: 'Montserrat Display', 'Montserrat', sans-serif;
    text-align: center;
    letter-spacing: 1.5px;
    padding: 0 10px;
    z-index: 1;
}

.text-box h3::before,
.text-box h3::after {
    display: block;
}

.text-box h3::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--light-blue), var(--primary-blue));
    border-radius: 0 50% 50% 50%;
    transform: rotate(60deg);
    box-shadow:
        inset 3px 3px 5px rgba(255, 255, 255, 0.7),
        2px 2px 6px rgba(0, 112, 192, 0.15);
    z-index: -1;
    opacity: 0.9;
}

.text-box h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: -12px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: 0 50% 50% 50%;
    transform: rotate(30deg);
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.6),
        2px 2px 5px rgba(0, 112, 192, 0.15);
    z-index: -1;
    opacity: 0.85;
}

/* ---------------- 正文：更厚、更清晰的无衬线字体 ---------------- */
.text-box p {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    font-size: 1.25em;
    font-weight: 500;
    color: #2b2b2b;
    text-align: left;
    margin-bottom: 20px;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ==========================================
返回顶部按钮样式 (修改：无底色，纯图片)
========================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 2px;
    width: 90px;
    /* 控制图片的整体大小 */
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-8px);
    /* 悬浮时整体向上轻微浮动 */
}

/* 内部图片的样式 */
.back-to-top img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 为图片本身添加柔和的轮廓阴影，适合透明背景的 PNG/SVG */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.back-to-top:hover img {
    transform: scale(1.05);
    /* 悬浮时图片轻微放大 */
    filter: drop-shadow(0 8px 15px rgba(0, 112, 192, 0.3));
    /* 悬浮时加深阴影（带一点主题蓝色调） */
}

::-webkit-scrollbar {
    width: 13px;
    /* 你可以根据喜好调宽或调窄 */
}

/* 2. 滚动条的轨道 (背景) */
::-webkit-scrollbar-track {
    background-color: #f5f7fa;
    /* 极浅的灰蓝色背景，显得干净 */
    border-radius: 10px;
}

/* 3. 滚动条的滑块 (核心：蓝黄渐变与圆角) */
::-webkit-scrollbar-thumb {
    /* 线性渐变：从主题深蓝过渡到清新的亮蓝 */
    background: linear-gradient(to bottom, #0070C0, #51bddd);

    border-radius: 10px;
    /* 圆润的胶囊形状 */
    border: 3px solid #f5f7fa;
    /* 与轨道同色的边框，制造内嵌感 */
}

/* 4. 当鼠标悬浮在滚动条滑块上时的效果 (整体颜色稍微加深一点点) */
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #005A9E, #3da8c9);
}

/* ==========================================
移动端/小屏幕适配
========================================== */

@media (max-width: 1024px) {
    .page-container {
        flex-direction: column;
        padding: 0 5%;
        gap: 30px;
        margin-top: 120px;
    }

    .page-container::before {
        top: -120px;
        height: 240px;
    }

    .toc-list::before {
        display: none;
    }

    .toc-list>li>a::before,
    .toc-sublist a::before {
        display: none;
    }

    .toc-container {
        padding: 0;
    }

    .sidebar-nav {
        width: 100%;
        position: static;
        height: auto;
        overflow-y: visible;
        margin-left: 0;
    }

    .toc-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .toc-list>li {
        margin: 0;
    }

    .toc-list>li>a,
    .toc-sublist a {
        height: auto;
        padding: 10px 20px;
        background: #fff;
        border-radius: 20px;
        border: none;
    }

    .capsule-title {
        font-size: 1.5em;
        padding: 15px 40px 15px 40px;
        height: auto;
        min-height: 50px;
        margin: 20px 20px 20px 15px;
        border-radius: 30px 0 0 30px;
    }

    .capsule-title::before {
        transform: scale(0.7);
        transform-origin: left center;
        left: -10px;
    }

    .text-box {
        padding: 28px 30px;
        border-radius: 16px;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .page-container {
        margin-top: 80px;
        padding: 0 15px;
    }

    .page-container::before {
        top: -80px;
        height: 180px;
    }

    .toc-list {
        gap: 8px;
    }

    .toc-list>li>a,
    .toc-sublist a {
        padding: 8px 15px;
        font-size: 1em;
    }

    .capsule-title {
        font-size: 1.3em;
        padding: 12px 20px 12px 25px;
        margin: 15px 0;
        border-radius: 20px 0 0 20px;
    }

    .capsule-title::before {
        display: none;
    }

    .capsule-title::after {
        width: 30px;
    }

    .text-box {
        padding: 20px 20px;
    }

    .text-box h3 {
        font-size: 1.25em;
        margin: 25px auto 20px;
    }

    .text-box p {
        font-size: 1.08em;
        line-height: 1.75;
        font-weight: 500;
    }

    /* 移动端调整返回顶部按钮位置和大小 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 70px;
        /* 手机端图片稍小一点 */
        height: 70px;
    }
}

/* ============================================================
以下从 protocol.css 移入：四级标题 / 高亮框 / 表格
============================================================ */
.text-box h4 {
    font-family: 'Montserrat Display', 'Montserrat', sans-serif;
    font-size: 1.4em;
    font-weight: 800;
    color: #215e9a;
    margin: 30px 0 15px 0;
    text-align: left;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.highlight-box {
    background-color: #f6f8fa;
    /* 浅灰色背景 */
    border-left: 5px solid var(--primary-blue);
    /* 左侧的主题蓝粗线 */
    padding: 5px 25px;
    margin: 10px 0;
    border-radius: 0 10px 10px 0;
}

/* 调整框内段落的间距，让多行公式排列更紧凑 */
.highlight-box p {
    margin-bottom: 12px;
    font-size: 1em;
}

/* ==========================================
纯色极简版表格样式：经典蓝黄搭配
========================================== */
/* 表格标题：居中 */
.text-box p.table-caption {
    text-align: center;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 30px 0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 112, 192, 0.08);
    border: 1px solid rgba(0, 112, 192, 0.1);
}

.text-box table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    text-align: center;
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 1.1em;
    background-color: #ffffff;
}

.text-box table th {
    background-color: rgba(10, 113, 186, 0.847);
    color: var(--white);
    font-weight: 700;
    padding: 18px 12px;
    letter-spacing: 0.5px;
    border: none;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.text-box table thead tr th:first-child {
    border-top-left-radius: 12px;
}

.text-box table thead tr th:last-child {
    border-top-right-radius: 12px;
    border-right: none;
}

.text-box table td {
    padding: 15px 12px;
    color: #334455;
    border-bottom: 2px solid rgba(10, 121, 186, 0.51);
    font-weight: 600;
    border-right: 2px solid rgba(10, 121, 186, 0.51);
}

.text-box table td:last-child {
    border-right: none;
}

.text-box table tbody tr:last-child td {
    border-bottom: none;
}

.text-box table tbody tr:nth-child(even) {
    background-color: rgba(0, 112, 192, 0.055);
}

.text-box table tbody tr {
    transition: background-color 0.3s ease;
}

.text-box table tbody tr:hover {
    background-color: rgba(237, 242, 102, 0.219);
}

/* 移动端：h4 与表格字号适配（对应 protocol.css 的 768px 断点） */
@media (max-width: 768px) {
    .text-box h4 {
        font-size: 1.15em;
        margin: 20px 0 10px 0;
    }

    .text-box table {
        font-size: 0.95em;
    }
}

/* ============================================================
以下从 notebook.css 复制：notebook 页面专属图片/注释样式
============================================================ */
.notebook-subtitle {
    color: var(--primary-blue);
    font-weight: 900;
}

.notebook-image-placeholder {
    display: block;
    width: fit-content;
    max-width: 75%;
    margin: 28px auto 32px;
    padding: 0;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    /* 外框 */
    border: 4px solid rgba(0, 112, 192, 0.682);
    border-radius: 20px;
    /* 阴影 */
    box-shadow:
        0 8px 24px rgba(0, 112, 192, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.04);
    background: none;
}

/* 实际图片 */
.notebook-image-placeholder img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 650px;
    object-fit: contain;
    border-radius: 17px;
}

/* 专门为海报设置的放大样式 */
.notebook-image-poster {
    max-width: 95%;
}

.notebook-image-poster img {
    max-height: none;
}

.notebook-note {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.8;
    font-size: 1.05em;
    font-weight: 500;
    color: #666666;
    text-align: left;
    margin: 10px 0 80px;
}

.notebook-image-double {
    width: 82%;
    margin: 28px auto 32px;
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.notebook-image-double img {
    width: calc(50% - 8px);
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 17px;
}

/* 移动端图片适配 */
@media (max-width: 768px) {
    .notebook-image-placeholder {
        margin: 22px auto 26px;
        border-radius: 16px;
        max-width: 95%;
    }

    .notebook-note {
        font-size: 0.98em;
        margin-bottom: 50px;
    }

    .notebook-image-double {
        flex-direction: column;
    }

    .notebook-image-double img {
        width: 100%;
        height: auto;
    }
}

/* ============================================================
以下从 collaborations.css 复制：副标题/列表/图片/PDF 等专属样式
============================================================ */
/* ==== 小行字 (副标题 - 统一灰色斜体) ==== */
.section-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.05em;
    color: #777;
    font-style: italic;
    margin-top: -15px !important;
    margin-bottom: 25px !important;
    text-align: left;
}

/* ==== 全局加粗文字设为主题蓝色 ==== */
.text-box strong {
    color: var(--primary-blue);
    font-weight: 700;
}

/* ==== 列表及自定义蓝色圆点 ==== */
.text-box ul {
    list-style: none;
    padding-left: 20px;
    margin-bottom: 20px;
}

.text-box li {
    position: relative;
    font-family: "Inter", -apple-system, sans-serif;
    line-height: 1.65;
    font-size: 1.25em;
    font-weight: 500;
    color: #2b2b2b;
    margin-bottom: 12px;
    padding-left: 18px;
}

.text-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    background-color: var(--primary-blue);
    border-radius: 50%;
}

/* ==== 图片与下标效果 ==== */
.img-container {
    width: 100%;
    text-align: center;
    margin: 40px 0;
}

.img-placeholder {
    width: 90%;
    max-width: 650px;
    min-height: 180px;
    background-color: transparent;
    border-radius: 12px;
    margin: 0 auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.img-placeholder:hover {
    transform: scale(1.02) translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 112, 192, 0.18);
}

.img-caption {
    font-family: 'Inter', sans-serif;
    font-size: 0.95em !important;
    color: #666 !important;
    margin-top: 12px !important;
    /* font-style: italic; */
    font-weight: 400 !important;
    text-align: center !important;
}

/* 图注逐条独立成行；条与条的间距与段内自动换行的行距保持一致 */
.img-container .img-caption {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.65;
}

.img-container .img-caption:first-of-type {
    margin-top: 12px !important;
}

/* ==== 完整单页展示版 PDF 嵌入容器 ==== */
.pdf-container {
    width: 80%;
    max-width: 850px;
    /* 利用比例控制高度，1 / 1.15 接近标准竖版 A4 纸比例 */
    aspect-ratio: 1 / 1.15;
    /* 兜底高度：以防老旧浏览器不支持 aspect-ratio */
    min-height: 600px;
    margin: 40px auto;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #323639;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 双图并排 */
.img-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    width: 85%;
    max-width: 900px;
    margin: 0 auto;
}

.img-row .img-placeholder {
    width: calc(50% - 10px);
    margin: 0;
    max-width: none;
    object-fit: cover;
}

/* 移动端适配：PDF / 双图 / 列表 / 图片 */
@media (max-width: 768px) {
    .pdf-container {
        width: 100%;
        aspect-ratio: auto;
        height: 60vh;
        min-height: 400px;
    }

    .img-row {
        flex-direction: column;
        width: 95%;
        gap: 15px;
    }

    .img-row .img-placeholder {
        width: 100%;
    }

    .text-box li {
        font-size: 1.08em;
    }

    .img-placeholder {
        width: 95%;
    }
}

/* ==========================================
独立公式容器：居中显示，无背景、无边框、无竖线
专门用于 $$...$$ 独立公式（区别于 highlight-box 高亮框）
用法：<div class="formula-box"><p>$$公式$$</p></div>
========================================== */
.formula-box {
    padding: 5px 25px;
    margin: 10px 0;
}

/* 框内段落字号固定 1em：katex.css 的独立公式字号按此基准换算 */
.formula-box p {
    margin-bottom: 12px;
    font-size: 1em;
    text-align: center;
}

/* ============================================================
   专属 References (参考文献) 样式
============================================================ */
/* 移除默认缩进并重置列表 */
.reference-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
    margin-bottom: 0;
    text-align: left;
    /* 【新增】强制整个列表区域靠左对齐 */
}

/* 参考文献条目样式 */
.reference-list li {
    position: relative;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95em;
    line-height: 1.4;
    color: #555555;
    font-weight: 400;
    margin-bottom: 8px;
    padding: 4px 0 4px 1.6em;
    /* 【关键修改】将 2.5em 改为 1.6em，贴合 [1] 的宽度 */
    text-indent: -1.6em;
    /* 【关键修改】负缩进同步改为 -1.6em */
    word-wrap: break-word;
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: left;
    /* 确保整体左对齐 */
}

/* 覆盖掉 .text-box li 自带的主题蓝圆点 */
.text-box .reference-list li::before {
    display: none;
}

/* 鼠标悬停时的轻微高亮效果 */
.reference-list li:hover {
    background-color: rgba(0, 112, 192, 0.04);
    color: #2b2b2b;
}

/* 针对参考文献中可能会插入超链接的样式 */
.reference-list li a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
    text-indent: 0;
}

.reference-list li a:hover {
    text-decoration: underline;
    color: #3da8c9;
}

/* iGEM Registry 部件链接：蓝色、无下划线，底部细虚线做轻装饰，点击后变色 */
.text-box a[href*="registry.igem.org"] {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    padding-bottom: 1px;
    border-bottom: 1px dashed rgba(0, 112, 192, 0.4);
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.text-box a[href*="registry.igem.org"]:hover {
    color: #00518f;
    border-bottom-color: #00518f;
    background-color: rgba(0, 112, 192, 0.07);
}

.text-box a[href*="registry.igem.org"]:active {
    color: #003a66;
    border-bottom-color: transparent;
    background-color: rgba(0, 112, 192, 0.14);
}

/* 已访问链接保持与未访问一致，避免点过之后颜色不统一 */
.text-box a[href*="registry.igem.org"]:visited {
    color: var(--primary-blue);
    border-bottom-color: rgba(0, 112, 192, 0.4);
}

/* 同时限定 hover/active 在 visited 之后生效 */
.text-box a[href*="registry.igem.org"]:visited:hover {
    color: #00518f;
    border-bottom-color: #00518f;
    background-color: rgba(0, 112, 192, 0.07);
}

.text-box a[href*="registry.igem.org"]:visited:active {
    color: #003a66;
    border-bottom-color: transparent;
    background-color: rgba(0, 112, 192, 0.14);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .reference-list li {
        font-size: 0.9em;
        padding-left: 1.6em;   /* 【关键修改】手机端也改为 1.6em */
        text-indent: -1.6em;   /* 【关键修改】手机端也改为 -1.6em */
        margin-bottom: 6px;   
    }
}
.text-box h5 {
    font-family: 'Montserrat Display', 'Montserrat', sans-serif;
    font-size: 1.15em;
    font-weight: 800;
    color: #215e9a;
    margin: 24px 0 12px 0;
    text-align: left;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

/* 正文“跳转页面”整句：居中、圆角半透明胶囊，宽度随文字长度收缩 */
.text-box p.page-link-box {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 22px auto;
    padding: 9px 26px;
    border-radius: 999px;
    background-color: rgba(0, 112, 192, 0.08);
    border: 1px solid rgba(0, 112, 192, 0.28);
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.text-box p.page-link-box:hover {
    background-color: rgba(0, 112, 192, 0.16);
    border-color: rgba(0, 112, 192, 0.5);
}

.text-box p.page-link-box:active {
    transform: translateY(1px);
}

.text-box p.page-link-box a {
    text-decoration: none;
}

@media (max-width: 768px) {
    .text-box h5 {
        font-size: 1em;
        margin: 18px 0 10px 0;
    }
}
