/* V3.0 神级样式表 */
:root {
    --primary-gold: #c9a466;
    --ink-black: #0a0a0a;
    --paper-white: #f0f0f0;
    --accent-red: #b22c2c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background-color: var(--ink-black);
    font-family: 'Noto Serif SC', serif;
    color: #fff;
    perspective: 1000px;
    height: 100vh;
}

/* WebGL 画布 */
#fluidCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* 让鼠标事件透过 */
    /* 稍微加一点模糊，营造梦幻感 */
    filter: contrast(1.2) brightness(1.1);
}

/* Loading 层 */
#loading-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}

#loading-layer.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 墨滴动画 */
.ink-drop {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background: radial-gradient(circle at 30% 30%, #555, #000);
    animation: drop 1.5s ease-in infinite;
    margin-bottom: 30px;
}

@keyframes drop {
    0% {
        transform: translateY(-200px) scale(0.8);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1.2);
        opacity: 0;
    }
}

.loading-text {
    font-family: 'Zhi Mang Xing', cursive;
    color: #666;
    font-size: 1.5rem;
    letter-spacing: 5px;
    opacity: 0;
    animation: textFade 2s ease-in-out infinite;
}

@keyframes textFade {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* 开场动画层 */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s;
}

#intro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    animation: fadeUp 1s ease-out;
}

.intro-content h1 {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 6rem;
    color: var(--primary-gold);
    margin-bottom: 20px;
    letter-spacing: 15px;
}

.intro-content p {
    letter-spacing: 10px;
    color: #666;
    margin-bottom: 40px;
}

#enter-btn {
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 10px 40px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 5px;
}

#enter-btn:hover {
    background: var(--primary-gold);
    color: #000;
    box-shadow: 0 0 20px rgba(201, 164, 102, 0.5);
}

/* 主 Logo */
.header {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 10;
}

.logo {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    writing-mode: vertical-rl;
    /* 竖排文字 */
    text-orientation: upright;
    letter-spacing: 5px;
    opacity: 0;
    /* 进场后再显示 */
    transform: translateY(-20px);
    transition: all 1s 1.5s;
    /* 延迟显示 */
}

body.active .logo {
    opacity: 0.8;
    transform: translateY(0);
}

/* 3D 容器 */
.gallery-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    z-index: 5;
    opacity: 0;
    transition: opacity 2s 1s;
}

body.active .gallery-container {
    opacity: 1;
}

#drag-container,
#spin-container {
    position: relative;
    display: flex;
    margin: auto;
    transform-style: preserve-3d;
    transform: rotateX(-10deg);
}

#spin-container img {
    transform-style: preserve-3d;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    /* 倒影淡化 */
    -webkit-box-reflect: below 10px linear-gradient(transparent, transparent, rgba(0, 0, 0, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    filter: saturate(0.8);
    /* 初始稍微去色，更有年代感 */
}

#spin-container img:hover {
    box-shadow: 0 0 30px rgba(201, 164, 102, 0.6);
    border-color: var(--primary-gold);
    transform: scale(1.1) translateZ(20px);
    filter: saturate(1.2) contrast(1.1);
    /* 悬停时鲜艳 */
    z-index: 100;
}

#ground {
    width: 900px;
    height: 900px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(90deg);
    background: radial-gradient(center center, farthest-side, rgba(201, 164, 102, 0.05), transparent);
}

/* 诗词面板 (竖排) */
#poem-panel {
    position: fixed;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    text-align: center;
    pointer-events: none;
    /* 不干扰点击 */
    mix-blend-mode: difference;
    /* 这种混合模式在水墨背景下很高级 */
}

#poem-title {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 3rem;
    color: var(--primary-gold);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s;
}

#poem-content {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.8rem;
    line-height: 2;
    color: #ddd;
    /* 尝试竖排 */
    writing-mode: vertical-rl;
    text-orientation: upright;
    height: 300px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s 0.2s;
    text-shadow: 1px 1px 2px #000;
}

/* 激活状态 */
#poem-panel.active #poem-title,
#poem-panel.active #poem-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 底部 */
.controls {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 1s 2s;
}

body.active .controls {
    opacity: 0.6;
}

.controls p {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: #888;
}

/* Lightbox - 画中人活化特效 */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* 诗词对联样式 */
.couplet {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 2.2rem;
    color: var(--primary-gold);
    background: rgba(0, 0, 0, 0.6);
    padding: 30px 10px;
    border-radius: 50px;
    border: 1px solid rgba(201, 164, 102, 0.2);
    writing-mode: vertical-rl;
    /* 竖排 */
    text-orientation: upright;
    letter-spacing: 12px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 1s 0.5s;
    /* 延迟显示，营造仪式感 */
    max-height: 80vh;
}

#lightbox.active .couplet {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* 上联贴右，下联贴左 (留出足够呼吸感) */
.couplet.right {
    right: 8%;
}

.couplet.left {
    left: 8%;
}

/* 容器：限制光影范围 + 呼吸动画 */
.lb-container {
    position: relative;
    padding: 10px;
    /* 边框留白 */
    border: 1px solid #333;
    background: #000;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
    animation: breathe 5s ease-in-out infinite;
    overflow: hidden;
    /* 裁剪光影 */
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 90px rgba(0, 0, 0, 1);
    }
}

#lb-img {
    display: block;
    max-height: 85vh;
    max-width: 90vw;
    object-fit: contain;
    /* 稍微调暗，等待光影照亮 */
    filter: brightness(0.9) contrast(1.1);
}

/* 交互光影层 */
.lb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 径向渐变模拟光源：中间暖白微亮，四周压暗 */
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%),
            rgba(255, 240, 200, 0.15) 0%,
            /* 核心高光 */
            rgba(0, 0, 0, 0.0) 40%,
            /* 过渡 */
            rgba(0, 0, 0, 0.5) 100%
            /* 边缘压暗 */
        );
    mix-blend-mode: soft-light;
    /* 柔光混合，保留细节 */
    z-index: 2;
    pointer-events: none;
    /* 让鼠标事件穿透给容器处理 */
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 音乐按钮 */
.music-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    font-size: 1.5rem;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.5s 2s;
    /* 延迟显示 */
    background: rgba(0, 0, 0, 0.2);
}

body.active .music-btn {
    opacity: 0.8;
}

.music-btn:hover {
    background: var(--primary-gold);
    color: #000;
    box-shadow: 0 0 15px var(--primary-gold);
}

.music-btn.playing {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(201, 164, 102, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(201, 164, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(201, 164, 102, 0);
    }
}