/* ============================================================
   FML 球状族谱视图 · 独立样式（不修改 index.css）
   主色沿用 --primary #0089ff，字号/圆角与放射视图一致
   ============================================================ */

/* ---------- 视图切换按钮（仅加在族谱图卡片头部） ---------- */
.view-switch {
    display: inline-flex; align-items: center; gap: 2px;
    background: #eef3fb; border-radius: 9px; padding: 3px;
}
.view-switch button {
    appearance: none; -webkit-appearance: none;
    border: none; outline: none; cursor: pointer;
    background: transparent; color: #7b8ba5;
    font-size: 12px; font-weight: 500;
    padding: 6px 14px; border-radius: 7px;
    transition: background .2s, color .2s, box-shadow .2s;
}
.view-switch button:hover { color: #0089ff; }
.view-switch button.active {
    background: #fff; color: #0089ff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 60, 120, .12);
}

/* ---------- 球状画布容器 ---------- */
#globe_container {
    position: relative; display: none;
    width: 100%; height: 640px;
    border: 1px solid #eef1f7; border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #18305c 0%, #0d1b34 70%);
    cursor: grab;
}
#globe_container:active { cursor: grabbing; }
#globe_container canvas { display: block; }

/* ---------- CSS2D 节点：头像 + 名字 ---------- */
.globe-node {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: 60px; text-align: center;
    user-select: none; -webkit-user-select: none;
    cursor: pointer;
    transition: opacity .25s;
}
.gn-ava {
    position: relative;
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid #2b7cff;
    background: #dbe8ff; overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
    display: flex; align-items: center; justify-content: center;
}
.gn-ava img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
}
.gn-ch {
    font-size: 15px; font-weight: 600; color: #5b6b85;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .8);
}
.gn-ava img + .gn-ch { display: none; }
.gn-mark {
    position: absolute; right: -3px; top: -5px;
    font-size: 12px; line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.gn-mark.king { color: #ffd75e; }
.gn-mark.major { color: #ffe9a8; }
.gn-name {
    margin-top: 2px; font-size: 11px; font-weight: 600;
    line-height: 1.2; white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85), 0 0 6px rgba(0, 0, 0, .6);
}

@media (max-width: 720px) {
    #globe_container { height: 520px; }
}
