/* 基础重置与星空背景容器 */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* 纯黑底色 */
    overflow-x: hidden;
}

/* 动态星空层 */
.starry-sky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;   /* 让星星不干扰点击 */
    z-index: 0;
}

/* 星星公用样式 */
.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle infinite alternate;
}

/* 星星闪烁动画 */
@keyframes twinkle {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* 标题区域 - 向上靠拢，位于页面顶部，不遮挡相册 */
.hovertreeinfo {
    text-align: center;
    position: fixed;
    top: 15px;
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 0;
}
.hovertreeinfo h2 {
    margin: 0;
    color: #ffdd99;
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 1.8rem;
    background: rgba(0,0,0,0.3);
    display: inline-block;
    padding: 5px 20px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
}

/* 外层容器 - 固定页面中心，放大后尺寸不变（400x400） */
.wrap {
    width: 400px;
    height: 400px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

/* 3D立方体包裹器 */
.cube {
    width: 400px;
    height: 400px;
    margin: 0 auto;
    transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(-80deg);
    animation: rotate 20s infinite linear;
}

/* 旋转动画 */
@keyframes rotate {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to   { transform: rotateX(360deg) rotateY(360deg); }
}

/* 暂停动画 */
.cube.pause {
    animation-play-state: paused;
}

/* 外立方体每个面 */
.cube div {
    position: absolute;
    width: 400px;
    height: 400px;
    opacity: 0.85;
    transition: all 0.4s;
}

/* 所有图片填满容器 */
.pic {
    width: 400px;
    height: 400px;
    object-fit: cover;   /* 保持比例填充，避免变形 */
}

/* 外立方体六个面的位移 (半边长200px) */
.out_front { transform: rotateY(0deg) translateZ(200px); }
.out_back  { transform: translateZ(-200px) rotateY(180deg); }
.out_left  { transform: rotateY(90deg) translateZ(200px); }
.out_right { transform: rotateY(-90deg) translateZ(200px); }
.out_top   { transform: rotateX(90deg) translateZ(200px); }
.out_bottom{ transform: rotateX(-90deg) translateZ(200px); }

/* 内部小立方体容器 */
.cube span {
    display: block;
    width: 200px;
    height: 200px;
    position: absolute;
    top: 100px;      /* 在大立方体中心 (400/2 - 200/2) */
    left: 100px;
}

/* 内立方体图片 */
.in_pic {
    width: 200px;
    height: 200px;
    object-fit: cover;
}

/* 内立方体六个面的位移 (半边长100px) */
.in_front  { transform: rotateY(0deg) translateZ(100px); }
.in_back   { transform: translateZ(-100px) rotateY(180deg); }
.in_left   { transform: rotateY(90deg) translateZ(100px); }
.in_right  { transform: rotateY(-90deg) translateZ(100px); }
.in_top    { transform: rotateX(90deg) translateZ(100px); }
.in_bottom { transform: rotateX(-90deg) translateZ(100px); }

/* 鼠标移入时外立方体面外扩 */
.cube:hover .out_front { transform: rotateY(0deg) translateZ(400px); }
.cube:hover .out_back  { transform: translateZ(-400px) rotateY(180deg); }
.cube:hover .out_left  { transform: rotateY(90deg) translateZ(400px); }
.cube:hover .out_right { transform: rotateY(-90deg) translateZ(400px); }
.cube:hover .out_top   { transform: rotateX(90deg) translateZ(400px); }
.cube:hover .out_bottom{ transform: rotateX(-90deg) translateZ(400px); }

/* 音乐播放器位置（底部左右） */
.music-right {
    position: fixed;
    right: 10px;
    bottom: 10px;
    z-index: 10;
}
.music-left {
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 10;
}

/* 图片预览模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    backdrop-filter: blur(5px);
}
.image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border-radius: 12px;
    transition: 0.2s;
}