/* ===================================================================== */
/* 自定义字体 */
@font-face {
    font-family: 'BRLNSR';
    /* 你给这个字体起的名字，后面用它 */
    src: url('https://static.igem.wiki/teams/5855/fonts/brlnsr.ttf') format('truetype');
    font-weight: normal;
    /* 字重：normal, bold, 400, 700 等 */
    font-style: normal;
    /* 字体样式：normal, italic */
    font-display: swap;
    /* 关键！提升加载体验，避免字体闪烁 */
}

/* ===================================================================== */
/* 中心主图容器 */
.center-container {
    position: relative;
    text-align: center;
}

/* 中心主图 - 静止不动 */
.main-logo {
    width: 250px;
    height: auto;
}

/* 加载文字占位区 */
#loading-text {
    font-size: 24px;
    color: white;
    letter-spacing: 2px;
    font-weight: bold;
}

/* ===================================================================== */
/* 四个黄色星星动画元素容器 */
.star-element {
    position: absolute;
    animation-fill-mode: both; /* ✅ 关键：保持 0% 状态作为默认 */
    animation: breathe-shine-spin 3s ease-in-out infinite;
    /* 初始状态与 0% 一致，避免跳动 */
    transform: scale(0.95) rotate(-5deg);
    opacity: 0.7;
}

/* 左上角星星圆环 */
.star-top-left {
    top: -10%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: url('https://static.igem.wiki/teams/5855/loading/starzs.svg') no-repeat center center;
    background-size: contain;
    animation-delay: 0.2s;
}

/* 左下角星星 */
.star-bottom-left {
    top: 0%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: url('https://static.igem.wiki/teams/5855/loading/starleft1.svg') no-repeat center center;
    background-size: contain;
    animation-delay: 0.5s;
}

/* 右上角星星 */
.star-top-right {
    top: 10%;
    left: 0%;
    width: 300px;
    height: 300px;
    background: url('https://static.igem.wiki/teams/5855/loading/starright1.svg') no-repeat center center;
    background-size: contain;
    animation-delay: 0.8s;
}

/* 右边中间小星星 */
.star-middle-right {
    top: 0%;
    left: 0%;
    width: 300px;
    height: 300px;
    background: url('https://static.igem.wiki/teams/5855/loading/starright2.svg') no-repeat center center;
    background-size: contain;
    animation-delay: 1.1s;
}

/* 呼吸 + 闪烁 + 旋转 动画关键帧 */
@keyframes breathe-shine-spin {
    0% {
        transform: scale(0.95) rotate(-5deg);
        opacity: 0.7;
    }
    25% {
        transform: scale(1.05) rotate(5deg);
        opacity: 1;
    }
    50% {
        transform: scale(0.98) rotate(0deg);
        opacity: 0.8;
    }
    75% {
        transform: scale(1.02) rotate(3deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(0.95) rotate(-5deg);
        opacity: 0.7;
    }
}

/* ===================================================================== */
/* 顶部两个大丝线SVG动画容器 */
.top-decoration {
    position: absolute;
    width: 400px;
    height: 400px;
    animation-fill-mode: both; /* ✅ 关键：保持 0% 状态作为默认 */
    animation: float-sway 5s ease-in-out infinite;
    /* 初始状态与 0% 一致，避免跳动 */
    transform: translate(0px, 0px) rotate(-1deg) scale(0.98);
}

/* 左上角大丝线 */
.deco-top-left {
    top: -40px;
    left: -14px;
    background: url('https://static.igem.wiki/teams/5855/generalimg/zuo.avif') no-repeat center center;
    background-size: contain;
    animation-delay: 0.3s;
}

/* 右上角大丝线 */
.deco-top-right {
    top: -40px;
    right: 8px;
    background: url('https://static.igem.wiki/teams/5855/generalimg/you.avif') no-repeat center center;
    background-size: contain;
    animation-delay: 0.6s;
}

/* 丝线浮动动画关键帧 */
@keyframes float-sway {
    0% {
        transform: translate(0px, 0px) rotate(-1deg) scale(0.98);
    }
    25% {
        transform: translate(-20px, 15px) rotate(2deg) scale(1.05);
    }
    50% {
        transform: translate(0px, 0px) rotate(0deg) scale(1);
    }
    75% {
        transform: translate(20px, -15px) rotate(-2deg) scale(1.03);
    }
    100% {
        transform: translate(0px, 0px) rotate(-1deg) scale(0.98);
    }
}

/* 为动画添加缓动过渡（非动画时也平滑） */
.star-element,
.top-decoration {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===================================================================== */
/* 打字动画容器 */
.typing-container {
    position: fixed;
    top: 70%;
    left: 44%;
    text-align: left;
    z-index: 1000;
    pointer-events: none;
    font-family: 'BRLNSR', monospace;
    white-space: nowrap;
    opacity: 0; /* ✅ 默认透明 */
    animation: fade-in 0.8s ease-out forwards; /* ✅ 淡入效果 */
}

.typing {
    margin: 0;
    font-size: 40px;
    color: white;
    font-weight: bold;
    letter-spacing: 5px;
    display: inline-block;
}

/* 打字文字淡入动画 */
@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}