/* General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #fff;
    background-color: #0c0a1f;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #0c0c1e;
    /* 移除了 opacity 和 transition */
}

/* 移除了 body.loaded 规则 */

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 20px 20px 200px;
    background-image: url('../images/u_bg_9.png');
    background-size: cover;
    background-position: center;
    opacity: 0; /* 初始不可见 */
    transition: opacity 1s ease-in-out; /* 添加淡入过渡效果 */
    /* 移除了 animation 属性 */
}

.container.loaded {
    opacity: 1; /* 加载后可见 */
}

/* Preloader */
#preloader {
    width: 150px;
    height: 150px;
    border: 2px solid transparent;
    border-top-color: #9b59b6;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    position: relative;
}

/* Header */
.page-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.lang-icon {
    width: 20px;
    height: 20px;
    background: #fff;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-weight: bold;
    font-family: sans-serif;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%; 
    max-width: 300px; 
}

/* 新增：定义一个通用的向上淡入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.page-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.language-selector {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    padding: 5px;
    display: flex;
    align-items: center;
}

.language-selector .fa-globe {
    margin-right: 8px;
}

.language-selector select {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    cursor: pointer;
}

.language-selector select option {
    background: #1e193c;
    border: none;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%; 
    max-width: 300px; 
    /* 移除旧的动画，为子元素动画做准备 */
}

/* 移除为动画元素设置的初始 opacity: 0 状态 */

/* 当容器加载后，为子元素启动动画 */
.container.loaded .logo-container,
.container.loaded .title,
.container.loaded .subtitle,
.container.loaded .description,
.container.loaded .btn,
.container.loaded .page-footer {
    /* 确保元素在动画开始前是不可见的 */
    opacity: 0; 
    animation: fadeInUp 0.7s ease-out forwards;
}

/* 设置每个元素的动画延迟，形成序列感 */
.container.loaded .logo-container { animation-delay: 0.2s; }
.container.loaded .title { animation-delay: 0.3s; }
.container.loaded .subtitle { animation-delay: 0.4s; }
.container.loaded .description { animation-delay: 0.5s; }
.container.loaded .btn-android { animation-delay: 0.6s; }
.container.loaded .btn-apple { animation-delay: 0.7s; }
.container.loaded .btn-web { animation-delay: 0.8s; }
.container.loaded .page-footer { animation-delay: 0.9s; }


.logo-container {
    margin-bottom: 15px;
}

.logo {
    width: 100px;
    height: auto;
    animation: float 3s ease-in-out infinite;
}

.title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
}

.description {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 50px;
}

.button-group {
    display: flex;
    flex-direction: column;
    /* gap: 20px; */
    width: 100%;
    max-width: 360px;
    margin-top: 25px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px 15px;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    background: url('../images/u_btn_4-1.png') no-repeat center center;
    background-size: 100% 100%;
    position: relative;
    border: none;
    border-radius: 0;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
}

.btn + .btn {
    margin-top: 20px;
}

.btn::before {
    content: '';
    position: absolute;
    /* 增加高度 */
    /* Inset the background to create the inner content area */
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    /* A slightly darker background for content */
    background-color: rgba(30, 30, 60, 0.6); 
    border-radius: 30px; /* Round the corners of the inner background */
    z-index: -1; /* Place it behind the button's content */
}

/* Ensure button content (icon and text) appears above the ::before element */
.btn > * {
    position: relative;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
    outline: none; /* 确保在点击状态下没有轮廓 */
}

.btn:active::before {
    background-color: rgba(10, 10, 40, 0.7);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.4);
}

.btn:focus {
    outline: none;
}

.btn img {
    width: 24px;
    height: 24px;
}

/* Footer */
.page-footer {
    width: 100%;
    padding: 30px 15px 50px;
    text-align: center;
    /* 移除旧的动画 */
}

.community-section {
    margin-bottom: 15px;
}

.community-section p {
    font-size: 18px;
    margin-bottom: 10px;
}

.community-icon {
    width: 28px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.community-icon:hover {
    transform: scale(1.2);
}

.copyright {
    font-size: 12px;
    color: #aaa;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes background-pan {
    from { background-position: 0% center; }
    to { background-position: 100% center; }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(41, 231, 205, 0.2); }
    50% { box-shadow: 0 0 25px rgba(41, 231, 205, 0.5); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        /* 调整手机端的内边距，保持内容基本居中 */
        padding: 30px 15px 50px;
    }

    .logo {
        width: 80px;
        height: auto;
    }

    .title {
        font-size: 18px;
    }

    .subtitle {
        font-size: 22px;
    }

    .description {
        font-size: 13px;
        margin-bottom: 40px;
    }

    .button-group {
        margin-top: 25px;
        /* 在手机端，按钮宽度由容器的内边距控制，这里不需要改变 max-width */
        
    }

    .btn {
        padding: 18px;
        font-size: 15px;
    }

    .community-section p {
        font-size: 16px;
    }
}