@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;
}

@font-face {
    font-family: 'Alkatra';
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/geyan.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

: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;
}

.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;
}

.zhegai {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    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;
    transform: translateY(10.5vh);
}

.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;
}

.title-stack {
    position: relative;
    will-change: transform;
}

.hero__title,
.hero__title2 {
    font-family: "KN Yuanmo SC Hero", "Inter", sans-serif;
    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;
    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;
}

.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;
}

.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;
}

@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;
    }
}

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;
    overflow-x: hidden;
}

/* 2. 改造 .page-container，去掉 margin-top，改用 padding-top 避免外边距塌陷 */
.page-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 0 auto 80px;
    /* 将 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;
}

.sidebar-nav {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 90px;
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: none;
    margin-left: 20px;
    transform: translateX(-50px);
}

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

.toc-container {
    position: static;
    padding: 40px 0 80px 120px;
}

.toc-container h3 {
    display: none;
}

.ruler-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10px;
    width: 35px;
    z-index: 1;
    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;
}

.water-drop-indicator {
    position: absolute;
    top: 125px;
    left: -0.5px;
    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;
}

@media (max-width: 1024px) {
    .ruler-container {
        display: none;
    }
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    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: 0px;
    position: relative;
    height: 50px;
}

.toc-list>li>a {
    text-decoration: none;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.35em;
    letter-spacing: 1.5px;
    color: #0070C0;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.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;
    top: 50%;
    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;
    margin-top: 0;
    margin-bottom: 0;
    display: none;
}

.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.08em;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6FA6D6;
    height: 50px;
    display: inline-flex;
    align-items: center;
    padding: 0 0 0 8px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toc-sublist a:hover {
    color: #0070C0;
    padding-left: 14px;
}

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

.toc-sublist a::before {
    display: none;
}

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

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

.content-wrapper {
    flex: 1;
    min-width: 0;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    margin-left: -40px;
}

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

.capsule-title {
    position: relative;
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    min-width: 420px;
    height: 120px;
    margin: 40px auto 35px auto;
    padding: 0 40px;
    background-image: url("https://static.igem.wiki/teams/6419/wiki/common/teamtitle.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    color: var(--white);
    font-size: 2.2em;
    font-weight: bold;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    -webkit-text-stroke: 0.7px currentColor;
    letter-spacing: 2px;
    border: none;
    filter: drop-shadow(0 10px 15px rgba(0, 112, 192, 0.2));
}

.capsule-title::before,
.capsule-title::after {
    display: none !important;
}

.text-box {
    background-color: transparent;
    padding: 30px 50px;
    margin-left: 0px;
    border-radius: 24px;
    box-shadow: none;
    border: none;
    transition: box-shadow 0.3s ease;
}

.text-box:hover {
    box-shadow: none;
}

.text-box h3 {
    position: relative;
    width: fit-content;
    margin: 40px auto 35px;
    color: var(--primary-blue);
    font-size: 1.6em;
    font-weight: bold;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    -webkit-text-stroke: 0.35px currentColor;
    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: 20px;
    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;
    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;
}

::-webkit-scrollbar-track {
    background-color: #f5f7fa;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #0070C0, #51bddd);
    border-radius: 10px;
    border: 3px solid #f5f7fa;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #005A9E, #3da8c9);
}

:root {
    --deep-blue: #10275f;
    --deep-blue-soft: rgba(16, 39, 95, .62);
    --accent-teal: #378e9d;
}

.cards-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: clamp(30px, 3.4vw, 52px) clamp(18px, 2vw, 30px);
    padding: 10px 0 20px 10px;
}

@media (min-width: 1025px) {
    .cards-row {
        justify-content: center;
    }
}

.zcard-stage {
    --card-w: clamp(190px, 22vw, 320px);
    --radius: 22px;
    --ink: var(--deep-blue);
    --ink-soft: #0070C0;
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zcard-perspective {
    position: relative;
    z-index: 1;
    perspective: 1200px;
    perspective-origin: 50% 50%;
}

.zcard-floor {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 12%;
    bottom: -4%;
    border-radius: var(--radius);
    background: radial-gradient(closest-side, rgba(16, 39, 95, .38), rgba(16, 39, 95, 0) 62%);
    filter: blur(24px);
    opacity: .55;
    pointer-events: none;
}

.zcard {
    --rx: 0deg;
    --ry: 0deg;
    position: relative;
    width: var(--card-w);
    aspect-ratio: 2537 / 3383;
    border-radius: var(--radius);
    transform-style: preserve-3d;
    transform: translateZ(0) rotateX(var(--rx)) rotateY(var(--ry));
    color: var(--ink);
    will-change: transform;
    cursor: pointer;
    --rise-dist: calc(var(--card-w) * 1.34);
    box-shadow: 0 34px 60px -30px rgba(11, 74, 102, .55), 0 12px 28px -18px rgba(11, 74, 102, .38);
}

.zcard:focus-visible {
    outline: 3px solid rgba(55, 142, 157, .65);
    outline-offset: 4px;
}

.zcard-slab {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(120deg, #63c3cb, #378e9d);
    transform: translateZ(-16px);
    pointer-events: none;
}

.zcard-face {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: none;
}

.zcard-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(118deg, rgba(255, 255, 255, .60) 0%, rgba(255, 255, 255, .20) 13%, rgba(255, 255, 255, 0) 28%), linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 20%), linear-gradient(0deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, 0) 12%);
}

.zcard-glare {
    --sx: -14%;
    --gop: .1;
    position: absolute;
    inset: 2%;
    border-radius: var(--radius);
    overflow: hidden;
    transform: translateZ(44px);
    pointer-events: none;
    will-change: transform, opacity;
    transition: opacity .4s ease;
}

.zcard-glare::after {
    content: "";
    position: absolute;
    top: -30%;
    bottom: -30%;
    left: -55%;
    right: -55%;
    opacity: var(--gop);
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 44%, rgba(255, 255, 255, .10) 48%, rgba(255, 255, 255, .34) 50%, rgba(255, 255, 255, .10) 52%, rgba(255, 255, 255, 0) 56%);
    filter: blur(6px);
    transform: translateX(var(--sx));
}

.zcard.is-active .zcard-glare {
    opacity: 0;
}

.zcard-person {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    overflow: hidden;
    pointer-events: none;
}

.zcard-person img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    user-select: none;
    -webkit-user-drag: none;
}

.zcard-name-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 0;
    background: rgba(23, 83, 160, 0.837);
    backdrop-filter: blur(4px);
    color: #FFFFFF;
    text-align: center;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    font-size: calc(var(--card-w) * 0.08);
    font-weight: 800;
    letter-spacing: 1px;
    will-change: transform, opacity;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 2;
}

.zcard.is-active .zcard-name-bar {
    opacity: 0;
    transform: translateY(10px);
}

.zcard-mask {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(to bottom, rgba(164, 208, 228, 1) 0%, rgba(178, 215, 230, 1) 40%, rgba(249, 247, 238, 1) 80%);
    opacity: 0;
    transform: scale(.9);
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform .6s cubic-bezier(.16, 1, .3, 1), opacity .45s ease;
}

.zcard.is-active .zcard-mask {
    opacity: 1;
    transform: scale(1);
}

.zcard-quote {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14% 12%;
    text-align: center;
    color: #6885c0;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .5s ease, transform .6s cubic-bezier(.16, 1, .3, 1);
}

.zcard.is-active .zcard-quote {
    opacity: 1;
    transform: translateY(0);
    transition-delay: .12s;
}

.zcard-quote-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: calc(var(--card-w) * .05);
    line-height: 1.5;
    text-shadow: 0 2px 12px rgba(0, 40, 80, .35);
    /* 保留 data-quote 原文中的换行（其余空白照常折叠） */
    white-space: pre-line;
}

.zcard-frame {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 4px #caca8a48, inset 0 0 22px rgba(245, 245, 197, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease;
}

.zcard.is-active .zcard-frame {
    opacity: 1;
}

.bubble-field {
    position: absolute;
    inset: 0;
    z-index: 6;
    border-radius: var(--radius);
    overflow: hidden;
    pointer-events: none;
    transform: translateZ(24px);
}

.bubble {
    position: absolute;
    bottom: -60px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .15), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .5);
    box-shadow: inset 3px 3px 8px rgba(255, 255, 255, .6), inset -3px -3px 8px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .08);
    opacity: 0;
}

.bubble::before {
    content: "";
    position: absolute;
    top: 18%;
    left: 18%;
    width: 22%;
    height: 22%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 0 3px rgba(255, 255, 255, .8);
    filter: blur(1px);
}

.zcard.is-active .bubble {
    animation: riseBubble var(--duration) ease-in var(--delay) infinite;
}

@keyframes riseBubble {
    0% {
        transform: translateY(0) scale(.6);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    80% {
        opacity: .9;
    }

    100% {
        transform: translateY(calc(-1 * var(--rise-dist))) translateX(var(--drift)) scale(1.1);
        opacity: 0;
    }
}

/* ============================================================
   照片墙区域专属样式 —— 宽屏居中长条版 + 红钉子
============================================================ */
.photowall-wrapper {
    position: relative;
    width: 100%;
    min-height: 600px;
    padding: 20px 0 80px 0;
    margin-top: 0;
    background-color: transparent;
    background-image: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
}

#corkboard {
    position: relative;
    width: 94vw;
    max-width: 1300px;
    height: 38vw;
    max-height: 560px;
    min-height: 350px;

    border-radius: 18px;
    border: 24px solid #578bd6;
    background-color: #cca480;

    box-shadow: 0 35px 60px rgba(0, 40, 80, 0.25);
    overflow: visible;
    z-index: 300;
}

.board-bg-clip {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    overflow: hidden;
    z-index: 0;
    box-shadow: inset 0 8px 25px rgba(0, 0, 0, 0.35);
}

#corkboard .board-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.2);
    pointer-events: none;
    opacity: 0.95;
}

.board-photos {
    position: absolute;
    inset: 0;
    z-index: 2;
}

#cam-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 240px;
    z-index: 450;
}

.xiangji {
    position: relative;
    width: 100%;
    transform: rotate(-15deg);
    cursor: pointer;
    pointer-events: auto;
    filter: drop-shadow(0 16px 20px rgba(0, 30, 60, .3));
    transition: transform .18s cubic-bezier(.2, .9, .3, 1);
}

.xiangji:hover {
    transform: rotate(-15deg) scale(1.035);
}

.xiangji:active {
    transform: rotate(-15deg) scale(.975);
}

.xiangji.shake {
    animation: camShake .55s ease-out;
}

@keyframes camShake {
    0% {
        transform: rotate(-15deg) translateY(0) scale(1);
    }

    30% {
        transform: rotate(-16.4deg) translateY(-7px) scale(1.045);
    }

    62% {
        transform: rotate(-13.8deg) translateY(3px) scale(.988);
    }

    100% {
        transform: rotate(-15deg) translateY(0) scale(1);
    }
}

.xiangji img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    transform: scaleX(-1);
}

/* 小框、大照片的紧凑相纸 */
.photo {
    position: absolute;
    left: 0;
    top: 0;
    width: 150px;
    background: #fdfdfd;
    padding: 8px;
    /* 均匀的窄相框 */
    border-radius: 4px;
    cursor: grab;
    z-index: 1;
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.4), 0 2px 5px rgba(0, 0, 0, 0.1);
    touch-action: none;
    border: 1px solid #e0e0e0;
}

/* 强制隐藏照片底部标题 */
.photo .cap {
    display: none !important;
}

.photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    border-radius: 2px;
    pointer-events: none;
    background: #1a1a1a;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 1px solid #d0d0d0;
}

/* 原版可爱的红图钉 */
.photo::after {
    content: "📌";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    line-height: 1;
    text-shadow: 0 2px 3px rgba(0, 0, 0, .3);
    z-index: 2;
    pointer-events: none;
    background: transparent;
    box-shadow: none;
    width: auto;
    height: auto;
}

.photo.zoomed {
    position: fixed !important;
    left: 50vw !important;
    top: 50vh !important;
    transform: translate(-50%, -50%) scale(2.4) !important;
    z-index: 1000 !important;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
    cursor: zoom-out;
    transition: none !important;
}

.photo.dragging {
    cursor: grabbing;
    z-index: 900 !important;
    box-shadow: 10px 18px 28px rgba(0, 0, 0, .35);
}

.photo.hot img {
    outline: 3px solid rgba(92, 196, 245, .95);
    outline-offset: 2px;
}

.loose-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 400;
}

.loose-layer.above {
    z-index: 400;
}

.loose-layer .photo {
    pointer-events: auto;
}

.photo.ejecting {
    pointer-events: none;
}

.flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 460;
    opacity: 0;
    transition: opacity .5s ease-out;
    background: radial-gradient(260px 180px at var(--fx, 70%) var(--fy, 70%),
            rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%);
}

.flash.on {
    opacity: 1;
    transition: opacity .06s ease-in;
}

/* --- 底部英文提示语 --- */
.print-tip {
    margin-top: 35px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #4a7ab5;
    letter-spacing: 0.5px;
    text-align: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 40, 80, 0.08);
}

/* ============================================================
   移动端/小屏幕适配
============================================================ */
@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,
    .toc-list>li>a::before,
    .ruler-container {
        display: none;
    }

    .water-drop-indicator {
        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: 0 40px;
        height: 65px;
        min-width: 240px;
        margin: 30px auto 20px auto;
    }

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

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

    .zcard-stage {
        --card-w: min(28vw, 260px);
    }
}

@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: 0 30px;
        height: 55px;
        min-width: 200px;
        margin: 25px auto 15px auto;
    }

    .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;
    }

    .zcard-stage {
        --card-w: min(43vw, 230px);
    }

    .cards-row {
        gap: 26px 14px;
    }

    .photo {
        padding: 6px;
    }

    .photo::after {
        font-size: 18px;
        top: -10px;
    }

    #corkboard {
        width: 94vw;
        height: 120vw;
    }

    .print-tip {
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zcard.is-active .bubble {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}