body {
    background-color: #e7eefc;
}

.sect-top {
    background-color: #102d71;
    width: 100%;
    height: 80vh;
    margin-top: 20vh;
    position: absolute;
    box-shadow: rgba(26, 29, 32, 0.56) 2px 4px;
    left: 0;
    top: 0;
    overflow: hidden;
}

.topbar-container {
    display: flex;
    flex-direction: row;
    height: 100%;
}

@font-face {
    font-family: 'BLSFB';
    src: url('https://static.igem.wiki/teams/5855/fonts/brlnsr.ttf') format('truetype');
}

@font-face {
    font-family: 'BLSSB';
    src: url('https://static.igem.wiki/teams/5855/fonts/brlnsb.ttf') format('truetype');
}

@font-face {
    font-family: 'NATS';
    src: url('https://static.igem.wiki/teams/5855/fonts/nats-regular.ttf') format('truetype');
}

.main-head {
    color: white;
    font-size: 6rem;
    margin-left: 5%;
    margin-top: 10vh;
    font-family: "BLSFB", serif;
    font-weight: 100;
}

.secondary-head {
    color: white;
    font-family: "NATS", serif;
    font-size: 1.5rem;
    margin-left: 5%;
    margin-top: 2vh;
    margin-bottom: 5vh;

}

.finger {
    margin-top: 4vh;
    margin-left: 1vw;
    margin-right: auto;
    display: block;
    width: 30%;
}

.text-container {
    flex: 0.2; /* 3:7 比例中的 3 */
    display: flex;
    margin: 5vh;
    flex-direction: column;
    position: relative;
    z-index: 3;
}

.pic-container {
    position: relative;
    background-color: #1a1d20;
    flex: 0 0 auto;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 900 / 606; /* 需求：使用展示比例（轻微偏离原图），允许轻微拉伸 */
    margin: 5vh 7vh 7vh;
    border-radius: 2rem;
    overflow: hidden;
}

.top-img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* 改为 fill 防止裁剪，确保热点与人物对应位置不变（允许轻微拉伸） */
    display: block;
    filter: brightness(0.9);

}

.mask-overlay {
    display: none; /* 改为真正 mask，不再需要覆盖层 */
}

/* 第二部分整体与布局 */
.sect-2 {
    position: relative;
    margin-top: 100vh; /* 让第二部分在头图下面 */
    padding: 6rem 4rem 8rem;
}

.team-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.team-nav {
    flex: 0 0 25%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 12rem; /* 贴住顶部 */
}

.team-nav .nav-title {
    font-family: "BLSSB", serif;
    font-weight: 900;
    font-size: 2.6rem;
    color: #0b43ce;
    margin-bottom: 0.5rem;
}

.team-nav a {
    text-decoration: none;
    font-family: "BLSFB", serif;
    padding: 0.55rem 0;
    color: #0b43ce;
    border-radius: 0.75rem;
    font-size: 2.2rem;
    transition: background .25s, transform .25s;
}

.team-nav a:hover,
.team-nav a:focus {
    transform: translateX(4px);
}

.team-nav a:active {
}

.team-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.team-section {
    position: relative;
    /* 原 margin-top 若仅用于视觉分隔可保留，不影响锚点偏移 */
    scroll-margin-top: 150px; /* 预留导航高度 + 间距 */
}

/* 兼容不支持 scroll-margin-top 的旧浏览器：创建负外边距占位 */
.team-section::before {
    content: "";
    display: block;
    height: 150px; /* 与 scroll-margin-top 一致 */
    margin-top: -150px;
    visibility: hidden;
    pointer-events: none;
}

.section-tab {
    position: relative;
    width: min(851px, 100%);
    margin: 0 auto 2.5rem;
    text-align: center;
}

.section-tab .tab-bg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.section-tab .tab-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "BLSFB", serif;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 成员卡片布局 */
.member-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
}

.member-card {
    position: relative;
    width: 260px;
    height: 340px; /* 统一总高度 */
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.member-photo {
    width: 100%;
    height: 260px;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
    background: #d5def1;
    position: relative;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.member-toggle-bar {
    margin: 0;
    padding: 0.75rem 0.75rem;
    width: 100%;
    height: 80px;
    background: #0b43ce;
    color: #fff;
    border: none;
    font-family: "BLSSB", serif;
    font-size: 1.65rem;
    letter-spacing: .5px;
    border-radius: 0 0 1rem 1rem;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background .3s;
}

.member-name{
    margin-left: 40px;
    width: 90%;
    text-align: left;
    display: inline-block;
    white-space: nowrap;
}
/* 左侧箭头装饰 */
.member-toggle-bar::before {
    content: "";
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px; /* 根据 SVG 尺寸可微调 */
    background: url('https://static.igem.wiki/teams/5855/members/team-arrow.svg') center/contain no-repeat;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
    transition: transform .35s ease;
    pointer-events: none;
}

.member-card.open .member-toggle-bar::before {
    transform: translateY(-50%) rotate(90deg);
}

/* 展开时旋转 */
.member-toggle-bar span {
    position: relative;
    z-index: 1;
    padding-left: 0.35rem;
}

/* 覆盖式简介：占满整张卡片 */
.member-info {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px) saturate(160%) brightness(1.05);
    -webkit-backdrop-filter: blur(12px) saturate(160%) brightness(1.05);
    color: #102d71;
    padding: 1rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    box-shadow: 0 8px 24px -6px rgba(16, 45, 113, .35);
    transition: opacity .35s ease, transform .45s ease;
    overflow-y: auto;
}

.member-card.open .member-info {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.member-info::-webkit-scrollbar {
    width: 6px;
}

.member-info::-webkit-scrollbar-track {
    background: transparent;
}

.member-info::-webkit-scrollbar-thumb {
    background: rgba(11, 67, 206, 0.35);
    border-radius: 3px;
}

.member-info h3 {
    margin: .25rem 0 .75rem;
    font-size: 1.15rem;
    font-family: "BLSSB", serif;
}

.member-info p {
    margin: 0;
    line-height: 1.55;
    font-size: .92rem;
    font-family: "BLSFB", serif;
}

/* 打开时底图轻微缩放而不再单独模糊 */
.member-card.open .member-photo img {
    filter: brightness(.85);
    transform: scale(1.02);
}

.member-photo img {
    transition: filter .4s, transform .5s;
}

/* 头图热点 */
.team-hotspots {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.team-hotspots .hotspot {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px; /* 可按需要调整尺寸 */
    background: transparent;
    border: 4px dashed transparent; /* 初始透明，hover 显示橘色 */
    border-radius: 8px; /* 矩形轻微圆角 */
    box-shadow: none;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* 默认不可见 */
    transition: opacity .18s ease, border-color .18s ease;
}

.team-hotspots .hotspot:hover,
.team-hotspots .hotspot:focus-visible {
    border-color: #ff8a00; /* 橘色 */
    opacity: 1;
}

/* 移除旧的 after 光晕效果 */
.team-hotspots .hotspot::after {
    content: none;
}

.hotspot-float {
    position: absolute;
    z-index: 15;
    /* 初始不占文档高度：高度为0，去掉内边距与边框并禁止指针事件 */
    height: 0;
    padding: 0;
    border: 0;
    width: 300px; /* 保留宽度（不影响文档高度，因为 absolute） */
    max-width: none;
    font-size: .9rem;
    line-height: 1.45;
    font-family: "BLSFB", serif;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    color: #102d71;
    border-radius: 1rem;
    box-shadow: 0 10px 28px -6px rgba(16, 45, 113, .38);
    pointer-events: none; /* 隐藏状态不响应事件 */
    opacity: 0;
    transform: scale(.95);
    transition: opacity .18s ease, transform .25s cubic-bezier(.4, .12, .2, 1);
    overflow: hidden; /* 高度为0时隐藏内容 */
    word-break: break-word;
}

.hotspot-float.visible {
    /* 可见时恢复尺寸与滚动 */
    padding: 0.85rem 1rem 1rem;
    height: auto; /* 替代固定 height，内容多时滚动 */
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(255, 255, 255, .8);
    pointer-events: auto;
    opacity: 0.8;
    transform: scale(1);
}


@media (max-width: 900px) {
    .team-hotspots .hotspot {
        width: 18px;
        height: 18px;
    }

    .hotspot-float {
        max-width: 160px;
        font-size: .75rem;
    }
}

@media (max-width: 600px) {
    .member-card {
        width: 70%;
        flex: 1 1 70%;
    }
}

@media (max-width: 1100px) {
    .topbar-container {
        flex-direction: column;
    }

    .text-container {
        flex: unset;
        margin: 3vh 5vw;
    }

    /* 移除小屏重新设置的 50vh 高度，继续使用固定比例缩放 */
    .pic-container {
        flex: unset;
        width: 100%;
        max-width: 1057px;
        margin: 0 auto 5vh;
    }

    .main-head {
        font-size: 4rem;
        margin-top: 4vh;
    }

    .secondary-head {
        margin-top: 4vh;
    }

    .sect-top {
        height: auto;
        padding-bottom: 4rem;
        position: relative;
        margin-top: 10vh;
    }

    .sect-2 {
        margin-top: 0;
        padding-top: 4rem;
    }

    .team-layout {
        flex-direction: column;
    }

    .team-nav {
        position: relative;
        top: 0;
        flex-direction: row;
        flex-wrap: wrap;
        max-width: none;
    }

    .team-nav a {
        flex: 1 1 auto;
    }
}