/* main.css */
/* 基础样式 */
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    overflow-x: hidden;
    font-family: 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
    color: white;
}

/* 加载动画 */
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    z-index: 1000;
    transform: translate(-50%, -50%);
}

body.loaded::after {
    display: none;
}

/* 星空效果 */
.stars {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 1.5s infinite;
    will-change: opacity;
}

.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
}

.star.large {
    width: 3px;
    height: 3px;
}

/* 主要内容容器 */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

/* 月亮图标 */
.moon-logo {
    width: 150px;
    margin: 2rem 0;
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* 导航按钮 */
.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 3rem 0;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 页脚样式 */
footer {
    margin-top: auto;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

/* 文字样式 */
h1 {
    font-size: 2.8rem;
    margin-bottom: 0;
    letter-spacing: 2px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    font-size: 1.8rem;
    margin-top: -1rem;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 255, 255, 0.3);
    animation: subtitle-glow 2s ease-in-out infinite;
}

@keyframes subtitle-glow {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
        text-shadow:
            0 2px 6px rgba(0, 0, 0, 0.6),
            0 0 15px rgba(255, 255, 255, 0.5);
    }
}

/* 流星效果 */
.meteor {
    position: fixed;
    height: 3px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.8),
            rgba(255, 255, 255, 0.2) 70%,
            transparent);
    transform: rotate(calc(-45deg + (var(--angle-offset) * 1deg)));
    animation: meteor 1s linear;
    z-index: 0;
    will-change: transform, opacity;
}

@keyframes meteor {
    0% {
        transform: rotate(calc(-45deg + var(--angle-offset)*1deg)) translateX(-100%);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        transform: rotate(calc(-45deg + var(--angle-offset)*1deg)) translateX(250vw);
        /* 加长移动距离 */
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .moon-logo {
        width: 120px;
    }

    .btn {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
        margin-top: -0.5rem;
    }
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 新增月相样式 */
.moon-phase-container {
    width: 200px;
    height: 260px;
    margin: 20px auto;
    position: relative;
}

.moon-phase {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 保持原图比例 */
    background: transparent;
    /* 确保透明背景 */
    display: block;
    transition: opacity 0.3s ease;
}

.moon-phase.lazy-load {
    opacity: 0;
}

.moon-phase.loaded {
    opacity: 1;
}


.constellation-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 30% 40%,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px),
        radial-gradient(circle at 70% 60%,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

/* 修改原有加载动画 */
body::after {
    /* 保持原有样式 */
    background: radial-gradient(circle,
            rgba(112, 86, 255, 0.3) 0%,
            rgba(16, 14, 32, 0.8) 70%);
}

/* 错误提示样式 */
.error-box {
    padding: 1rem;
    background: rgba(255, 148, 148, 0.15);
    border-radius: 8px;
    text-align: center;
}

.error-box button {
    margin-top: 0.5rem;
    padding: 0.3rem 1rem;
    background: #ff6b6b;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

/* 调试边框 */
.debug-border {
    border: 2px solid #ffd700 !important;
}