/* body, html: 更新背景为动态马卡龙渐变色 */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #ffafcc, #a2d2ff, #bde0fe, #ffc8dd, #f9c74f, #f9844a);
    background-size: 400% 400%;
    animation: gradientBG 5s ease infinite;
    font-family: sans-serif;
    overflow: hidden;
}

/* 新增: 背景渐变动画 */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* content-wrapper: 保持不变 */
#content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* --- 动态背景样式 --- */
#dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

/* .bubble: 更新为更大、更立体的3D泡泡 */
.bubble {
    position: absolute;
    /* 更新: 将泡泡固定在底部，并使用transform将其移出屏幕外作为初始状态 */
    bottom: 0;
    transform: translateY(200px);
    opacity: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 新增3D效果 */
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), #ffafcc4d);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 10px rgba(255, 255, 255, 0.4) inset;
    /* 更新: 分解动画属性以确保只播放一次，而不是无限循环 */
    /* 注意: animation-duration 和 animation-delay 由 script.js 动态设置 */
    animation-name: rise;
    animation-timing-function: linear;
    animation-iteration-count: 1; /* 确保动画只播放一次 */
    animation-fill-mode: forwards; /* 动画结束后保持最后状态 */
}

/* 新增: 泡泡内的文字样式 */
.bubble-text {
    opacity: 0.87;
    color: #fff;
    font-family: 'KaiTi', 'SimSun', serif;
    text-shadow: 0 0 5px #fff, 0 0 10px #ffc8dd;
}

/* 更新: 使用 transform 来控制泡泡上升动画，确保更平滑的渲染 */
@keyframes rise {
    0% {
        transform: translateY(200px) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) scale(0.5);
        opacity: 0;
    }
}

/* --- 转盘样式保持不变 --- */
#turntable-viewport {
    width: 800px;
    height: 450px;
    overflow: hidden;
    position: relative;
}

#turntable {
    width: 800px;
    height: 800px;
    position: absolute;
    left: 50%;
    top: 50px;
    transform: translateX(-50%);
    transform-origin: center center;
    transition: transform 0.3s ease-out;
}

.turntable-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.turntable-panel:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.petal-link {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    display: block;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    z-index: 10;
}

.turntable-panel .petal-link:nth-of-type(1),
.enlarged-panel-clone .petal-link:nth-of-type(1) {
    background-color: rgba(255, 0, 0, 0.3);
}
.turntable-panel .petal-link:nth-of-type(1):hover,
.enlarged-panel-clone .petal-link:nth-of-type(1):hover {
    background-color: rgba(255, 0, 0, 0.6);
    transform: translate(-50%, -50%) scale(1.15);
}

.turntable-panel .petal-link:nth-of-type(2),
.enlarged-panel-clone .petal-link:nth-of-type(2) {
    background-color: rgba(255, 165, 0, 0.3);
}
.turntable-panel .petal-link:nth-of-type(2):hover,
.enlarged-panel-clone .petal-link:nth-of-type(2):hover {
    background-color: rgba(255, 165, 0, 0.6);
    transform: translate(-50%, -50%) scale(1.15);
}

.petal-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 100;
}

.petal-link:hover::after {
    visibility: visible;
    opacity: 1;
}

.hover-trigger {
    position: absolute;
    top: 0;
    height: 100%;
    width: 20%;
    z-index: 5;
}
#left-hover-trigger { left: 0; cursor: w-resize; }
#right-hover-trigger { right: 0; cursor: e-resize; }

#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    cursor: pointer;
    display: none;
}

.enlarged-panel-clone {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50vw;
    height: 50vh;
    max-width: 700px;
    max-height: 500px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 3px solid white;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    z-index: 1001;
    box-sizing: border-box;
    display: none;
    cursor: pointer;
}

.enlarged-panel-clone .petal-link::after {
    z-index: 1002;
}
