/* ===== 全局变量（调节速度和幅度） ===== */
:root {
    --float-speed: 0.3s;        /* 浮动周期 */
    --float-amplitude: 40px;  /* 浮动幅度 */
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Arial Black', 'Impact', 'Helvetica Neue', sans-serif;
    user-select: none;
}

/* Three.js 渲染器容器 */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* 让鼠标事件穿透给文字交互 */;
}

/* Three.js 内部 canvas 自动由库管理，无需额外样式 */

.scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    perspective: 900px;
}

/* ===== 3D容器：只做旋转，不浮动 ===== */
.text-3d {
    position: relative;
    width: 500px;
    height: 300px;
    transform-style: preserve-3d;
    animation: rotateOnly 5s ease-in-out infinite;
}

/* ===== 数字包装 ===== */
.digit-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

/* 6 左，先上后下 */
.digit-6 {
    animation: float6 var(--float-speed) ease-in-out infinite alternate;
}
/* 7 右，先下后上（反向） */
.digit-7 {
    animation: float7 var(--float-speed) ease-in-out infinite alternate;
}

@keyframes float6 {
    0%   { transform: translate(-80px, calc(-1 * var(--float-amplitude))); }
    100% { transform: translate(-80px, var(--float-amplitude)); }
}
@keyframes float7 {
    0%   { transform: translate(80px, var(--float-amplitude)); }
    100% { transform: translate(80px, calc(-1 * var(--float-amplitude))); }
}

/* ===== 纯旋转动画（无位移） ===== */
@keyframes rotateOnly {
    0%   { transform: rotateX(-10deg) rotateY(-15deg); }
    25%  { transform: rotateX(8deg) rotateY(18deg); }
    50%  { transform: rotateX(-12deg) rotateY(-25deg); }
    75%  { transform: rotateX(10deg) rotateY(22deg); }
    100% { transform: rotateX(-10deg) rotateY(-15deg); }
}

/* ===== 各层样式（不变） ===== */
.layer {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 220px;
    font-weight: 900;
    letter-spacing: 18px;
    text-shadow:
        0 0 30px rgba(255, 200, 50, 0.6),
        0 0 60px rgba(255, 100, 0, 0.4),
        0 0 120px rgba(255, 50, 150, 0.3);
    backface-visibility: hidden;
}

.layer-1 {
    transform: translateZ(0px);
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #a29bfe, #fd79a8);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 40px rgba(255, 200, 100, 0.5));
    z-index: 5;
}
.layer-2 {
    transform: translateZ(-6px) scale(0.98);
    color: #ff9a56;
    text-shadow: 0 0 40px rgba(255, 150, 50, 0.7), 0 0 80px rgba(255, 80, 0, 0.5);
    opacity: 0.85;
    z-index: 4;
}
.layer-3 {
    transform: translateZ(-14px) scale(0.94);
    color: #d6336c;
    text-shadow: 0 0 50px rgba(214, 51, 108, 0.8), 0 0 100px rgba(214, 51, 108, 0.4);
    opacity: 0.7;
    z-index: 3;
}
.layer-4 {
    transform: translateZ(-24px) scale(0.88);
    color: #6c2ebd;
    text-shadow: 0 0 60px rgba(108, 46, 189, 0.8), 0 0 120px rgba(108, 46, 189, 0.4);
    opacity: 0.5;
    z-index: 2;
}
.layer-5 {
    transform: translateZ(-36px) scale(0.80);
    color: #1a1a4e;
    text-shadow: 0 0 70px rgba(26, 26, 78, 0.9), 0 0 140px rgba(26, 26, 78, 0.5);
    opacity: 0.3;
    z-index: 1;
}

@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== 光晕环 ===== */
.glow-ring {
    position: absolute;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    border: 2px solid rgba(255, 200, 100, 0.15);
    box-shadow: 0 0 80px rgba(255, 150, 50, 0.1), inset 0 0 80px rgba(255, 150, 50, 0.05);
    animation: ringPulse 5s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}
.glow-ring-2 {
    position: absolute;
    width: 750px;
    height: 750px;
    border-radius: 50%;
    border: 1px solid rgba(100, 200, 255, 0.08);
    box-shadow: 0 0 100px rgba(100, 200, 255, 0.05);
    animation: ringPulse2 6s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -2;
}
@keyframes ringPulse {
    0%   { transform: scale(0.9) rotate(0deg); opacity: 0.6; }
    100% { transform: scale(1.2) rotate(30deg); opacity: 1; }
}
@keyframes ringPulse2 {
    0%   { transform: scale(0.8) rotate(-10deg); opacity: 0.3; }
    100% { transform: scale(1.3) rotate(20deg); opacity: 0.7; }
}

/* ===== 底部信息 ===== */
.info {
    position: fixed;
    bottom: 36px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 2;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Georgia', serif;
    font-size: 14px;
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(255, 200, 100, 0.1);
    animation: infoPulse 4s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes infoPulse {
    0%   { opacity: 0.2; letter-spacing: 8px; }
    100% { opacity: 0.6; letter-spacing: 14px; }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .layer { font-size: 100px; letter-spacing: 8px; }
    .text-3d { width: 260px; height: 160px; }
    .digit-6 { animation: float6-mobile var(--float-speed) ease-in-out infinite alternate; }
    .digit-7 { animation: float7-mobile var(--float-speed) ease-in-out infinite alternate; }
    @keyframes float6-mobile {
        0%   { transform: translate(-40px, calc(-1 * var(--float-amplitude))); }
        100% { transform: translate(-40px, var(--float-amplitude)); }
    }
    @keyframes float7-mobile {
        0%   { transform: translate(40px, var(--float-amplitude)); }
        100% { transform: translate(40px, calc(-1 * var(--float-amplitude))); }
    }
    .glow-ring { width: 320px; height: 320px; }
    .glow-ring-2 { width: 440px; height: 440px; }
    .info { font-size: 10px; bottom: 20px; letter-spacing: 4px; }
}
@media (max-width: 480px) {
    .layer { font-size: 64px; letter-spacing: 4px; }
    .text-3d { width: 180px; height: 110px; }
    .digit-6 { animation: float6-mobile2 var(--float-speed) ease-in-out infinite alternate; }
    .digit-7 { animation: float7-mobile2 var(--float-speed) ease-in-out infinite alternate; }
    @keyframes float6-mobile2 {
        0%   { transform: translate(-20px, calc(-1 * var(--float-amplitude))); }
        100% { transform: translate(-20px, var(--float-amplitude)); }
    }
    @keyframes float7-mobile2 {
        0%   { transform: translate(20px, var(--float-amplitude)); }
        100% { transform: translate(20px, calc(-1 * var(--float-amplitude))); }
    }
    .glow-ring { width: 220px; height: 220px; }
    .glow-ring-2 { width: 320px; height: 320px; }
    .info { font-size: 8px; bottom: 16px; letter-spacing: 3px; }
}