/* 🌸 輕量級開場動畫 (Preloader Splash Screen) */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #f3f7fa;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 22vh;
    user-select: none;
    pointer-events: none;
    position: relative; /* 確保角括弧絕對定位基準正確 */
}

.splash-char {
    font-family: 'Noto Serif TC', serif;
    font-weight: 200;
    color: var(--main-dark-color);
    font-size: clamp(48px, 10vh, 80px);
    line-height: 1.3;
    opacity: 0;
    filter: blur(20px);
    will-change: transform, opacity, filter;
}

.char-yi {
    animation: splashTextFadeInYi 2.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
}

.char-yuan {
    animation: splashTextFadeInYuan 2.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.35s;
}

/* 🌸 裝飾性角括弧 「」 框線動畫 */
.splash-bracket {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.bracket-lt {
    top: -16px;
    left: -22px;
    border-top: 1px solid var(--accent-color);
    border-left: 1px solid var(--accent-color);
    animation: bracketFadeInLT 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.6s;
}

.bracket-rb {
    bottom: -16px;
    right: -22px;
    border-bottom: 1px solid var(--accent-color);
    border-right: 1px solid var(--accent-color);
    animation: bracketFadeInRB 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.85s;
}

@keyframes bracketFadeInLT {
    0% {
        opacity: 0;
        transform: translate(6px, 6px);
    }
    100% {
        opacity: 0.75;
        transform: translate(0, 0);
    }
}

@keyframes bracketFadeInRB {
    0% {
        opacity: 0;
        transform: translate(-6px, -6px);
    }
    100% {
        opacity: 0.75;
        transform: translate(0, 0);
    }
}

@keyframes splashTextFadeInYi {
    0% {
        opacity: 0;
        filter: blur(20px);
        transform: translateY(3.5vh) scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes splashTextFadeInYuan {
    0% {
        opacity: 0;
        filter: blur(20px);
        transform: translateY(-3.5vh) scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

.splash-line {
    position: relative;
    width: 1px;
    height: 0;
    background-color: var(--accent-color);
    margin-top: 25px;
    opacity: 0.5;
    animation: splashLineGrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.5s;
    will-change: height;
}

/* 🌸 露珠 (Dewdrop) 動畫：沿著細線向下加速滴落 */
.splash-line::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    animation: splashDewdropSlide 1.0s cubic-bezier(0.4, 0, 0.8, 0.4) forwards;
    animation-delay: 1.6s; /* 在豎線生長到一半時開始下滑 */
    will-change: top, opacity;
}

/* 🌸 漣漪 (Ripple) 動畫：露珠滴落底部的瞬間，向外擴散消退 */
.splash-line::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%) scale(0);
    width: 36px;
    height: 14px; /* 扁橢圓形增加透視與水面感 */
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    animation: splashRippleAnim 1.6s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    animation-delay: 2.5s; /* 露珠觸底的時刻 */
    will-change: transform, opacity;
}

@keyframes splashLineGrow {
    to {
        height: 60px;
    }
}

@keyframes splashDewdropSlide {
    0% {
        top: 0;
        opacity: 0;
    }
    30% {
        opacity: 0.95;
    }
    90% {
        opacity: 0.95;
        top: 100%;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        top: 100%;
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

@keyframes splashRippleAnim {
    0% {
        transform: translate(-50%, 50%) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, 50%) scale(2.0);
        opacity: 0;
    }
}

/* 開場播放期間禁止主體滾動 */
html:not(.splash-done) body {
    overflow: hidden !important;
}

@keyframes splashLineGrowMobile {
    to {
        height: 45px;
    }
}

@media (min-width: 1025px) { 
    /* 電腦版開場期間防版面跳動之內距補償 */
    html:not(.splash-done) {
        padding-right: var(--scrollbar-width, 0px);
    }
}

@media (max-width: 1024px) { 
    /* 🌸 手機版開場動畫自適應與比例調優 (Splash Screen Mobile Scaling) */
    .splash-content {
        transform: translateY(-4vh);
    }
    .splash-text-container {
        min-height: 16vh;
    }
    .splash-char {
        font-size: clamp(38px, 7vh, 48px);
    }
    .splash-bracket {
        width: 10px;
        height: 10px;
    }
    .bracket-lt {
        top: -10px;
        left: -14px;
    }
    .bracket-rb {
        bottom: -10px;
        right: -14px;
    }
    .splash-line {
        margin-top: 15px;
        animation-name: splashLineGrowMobile;
    }
    .splash-line::before {
        width: 3.5px;
        height: 3.5px;
    }
    .splash-line::after {
        width: 24px;
        height: 10px;
    }
}
