/* === Loading Screen === */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffe4e1, #ffb6c1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s ease;
}
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader {
    font-size: 2em;
    color: white;
    animation: bounce 1s infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.loader .progress-bar {
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.loader .progress {
    height: 100%;
    background: linear-gradient(90deg, #fff, #ffb6c1);
    border-radius: 5px;
    animation: fillProgress 3s forwards;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* === Avatar 动效 === */
.avatar-wrapper {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
}
#avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    user-select: none;
    -webkit-user-drag: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.2), 0 0 50px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
    transition: box-shadow 0.8s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
/*#avatar:hover {*/
/*    box-shadow: 0 0 60px rgba(255, 255, 255, 1);*/
/*    cursor: pointer;*/
/*    transform: scale(1.03);*/
/*    transition: transform 0.2s ease, box-shadow 0.2s ease;*/
/*}*/
#avatar:active {
    transform: scale(0.95);
}
#avatar.rotating {
    animation: spin 5s linear infinite, strongGlow 2s infinite;
    transform: translateY(-4px) scale(1.05);
    border: 2px solid rgba(255, 255, 255, 0.4);
}
#avatar.rotating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    animation: ripple 1.8s infinite ease-out;
    z-index: 0;
    pointer-events: none;
}
#avatar.stopping {
    animation: slowSpinBack 1s ease-out forwards;
}


/* === Header / Footer === */
#header {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 2em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    animation: textGlow 1.5s infinite alternate;
    user-select: none;
}
#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    font-size: 1em;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    z-index: 100;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

#footer a {
    color: white;
    text-decoration: none;
    animation: textGlow 1s infinite;
    transition: transform 0.3s ease;
}

#footer a:active {
    transform: scale(0.95);
}


/* === 内容卡片（时间 / IP） === */
#time,
#ip-info {
    padding: 20px 28px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
    font-size: clamp(1rem, 2vw + 0.5rem, 1.6rem);
    line-height: 1.4;
    max-width: 90%;
    word-break: break-word;
    animation: floatUp 1.2s ease-out;
}
#time:hover,
#ip-info:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 32px rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* === 背景模糊层 === */
#background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(3px);
    background-color: rgba(0, 0, 0, 0.25);
    z-index: 0;
}
#header,
#content,
#footer {
    z-index: 1;
}

/* === 全局样式 === */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    font-size: 16px;
    background-image: url(https://www.dmoe.cc/random.php);
    background-size: cover;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: hidden;
    touch-action: pan-y;
    box-sizing: border-box;
}
#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 20px;
    color: white;
    user-select: text;
    min-height: calc(100vh - 100px);
    box-sizing: border-box;
}
audio {
    display: none;
}

/* === 动画定义 === */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}
@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0.2;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

/*@keyframes spin {*/
/*    0% {*/
/*        transform: rotate(0deg);*/
/*    }*/
/*    100% {*/
/*        transform: rotate(360deg);*/
/*    }*/
/*}*/

@keyframes glow {
    0% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 1);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }
}

@keyframes strongGlow {
    0% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 255, 255, 1);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
    }
}

@keyframes slowSpinBack {
    from {
        transform: rotate(360deg) scale(1.05);
    }
    to {
        transform: rotate(0deg) scale(1);
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 0 0 5px white;
    }
    100% {
        text-shadow: 0 0 20px white;
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}


/* === 深色模式适配 === */
@media (prefers-color-scheme: dark) {
    #time,
    #ip-info {
        border: 2px solid rgba(255, 255, 255, 0.12);
        background: linear-gradient(135deg, rgba(30, 30, 30, 0.4), rgba(30, 30, 30, 0.2));
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
        color: #e0e0e0;
        text-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
    }
}

/* === 响应式断点 === */
@media (max-width: 1200px) {
    #time {
        font-size: 3em;
    }
    #ip-info {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    #time {
        font-size: 2em;
    }
    #ip-info {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 18px;
    }
    .avatar-wrapper {
        width: 100px;
        height: 100px;
    }
    #avatar {
        width: 100px;
        height: 100px;
    }
    #time {
        font-size: 1.5em;
    }
    #ip-info {
        font-size: 0.9em;
    }
    #header {
        font-size: 1.5em;
        padding: 8px;
    }
    #footer {
        font-size: 1em;
        padding: 8px;
    }
    #content {
        gap: 16px;
        padding: 16px;
    }
}
