@supports (padding: max(0px)) {
    body {
        padding-top: max(env(safe-area-inset-top), 0px);
    }
}
body {
    box-sizing: border-box;
    background: url('/static/img/background.jpg') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    background-color: #f7f6f3;
    margin: 0;
}
.tree {
    box-sizing: border-box;
    position: relative;
    height: 100vh;
    min-height: 720px;
    overflow: auto;
    padding-top: 80px /* 底部预留出空间给固定菜单阴影 */
}
/* SVG 铺满 tree 容器 */
svg.links {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    z-index: 0;
}
.nodes {
    position: relative;
    z-index: 1;
    min-height: 1px;
}
.node {
    position: absolute;
    transform: translate(-50%, -50%);
}
.card.person {
    min-width: 130px;     /* 原160px → 缩短约1字宽 */
    max-width: 200px;     /* 原240px → 同步略缩 */
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.person .card-body {
    padding: .8rem 1rem;
    text-align: left;              /* 改为靠左对齐 */
    display: flex;                 /* 使用 flex 布局 */
    align-items: center;           /* 垂直居中 */
    justify-content: flex-start;   /* 靠左对齐文字 */
}
.name {
    font-weight: 600;
    letter-spacing: .3px;
    white-space: nowrap;
    text-decoration: none;
    color: #333;
}
.toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    border: 1px solid #cfe2ff;
    background: #e7f1ff;
    color: #0d6efd;
    user-select: none;
}
.toggle[aria-busy="true"] {
    opacity: .6;
    cursor: wait;
}
/* 固定底部菜单 */
.bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #2b2d31;
    border-top: 1px solid #3b3e42;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    padding: 10px 0;
    user-select: none;
}