/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #0a0e17;
    color: #e0e0e0;
    line-height: 1.6;
}

/* 预加载动画 */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0e17;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dot {
    width: 20px;
    height: 20px;
    background-color: #4dabf7;
    border-radius: 50%;
    margin: 0 10px;
    animation: bounce 1.5s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* 导航栏样式 */
.navbar {
    background-color: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: -80px; /* 初始位置在屏幕上方 */
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #1a2332;
    animation: slideIn 0.1s forwards;
}

@keyframes slideIn {
    to {
        top: 0;
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1600px;
    margin: 0 auto;
}

.nav-logo h2 {
    color: #4dabf7;
    font-size: 1.8rem;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.1s forwards;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.2s forwards;
}

/* 为每个导航项设置不同的动画延迟 */
.nav-item:nth-child(1) {
    animation-delay: 0.2s;
}

.nav-item:nth-child(2) {
    animation-delay: 0.3s;
}

.nav-item:nth-child(3) {
    animation-delay: 0.4s;
}

.nav-item:nth-child(4) {
    animation-delay: 0.5s;
}

.nav-item:nth-child(5) {
    animation-delay: 0.6s;
}

.nav-link {
    color: #a0a0a0;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #4dabf7;
}

/* 英雄区域样式 */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(10, 14, 23, 0.7), rgba(10, 14, 23, 0.9)), 
                url('../../images/000.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: optimizeQuality;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(77, 171, 247, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(77, 171, 247, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.3s forwards;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #b0b0b0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.5s forwards;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.7s forwards;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.btn.primary {
    background-color: #4dabf7;
    color: #0a0e17;
}

.btn.primary:hover {
    background-color: #339af0;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(77, 171, 247, 0.4);
}

.btn.primary:active {
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: transparent;
    color: #4dabf7;
    border: 2px solid #4dabf7;
}

.btn.secondary:hover {
    background-color: rgba(77, 171, 247, 0.1);
    transform: translateY(-3px);
}

.btn.secondary:active {
    transform: translateY(-1px);
}

.btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* 内容区域通用样式 */
section {
    padding: 80px 0;
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #4dabf7;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: #4dabf7;
    margin: 15px auto;
}

/* 为每个章节标题设置不同的动画延迟 */
#story h2 {
    animation-delay: 0.1s;
}

#characters h2 {
    animation-delay: 0.1s;
}

#gallery h2 {
    animation-delay: 0.1s;
}

#download h2 {
    animation-delay: 0.1s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 故事简介区域 */
.story-section {
    background-color: #0d1321;
}

.story-content {
    max-width: 900px;
    margin: 0 auto;
}

.story-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: justify;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.story-content p:nth-child(1) {
    animation-delay: 0.1s;
}

.story-content p:nth-child(2) {
    animation-delay: 0.3s;
}

/* 角色展示区域 */
.characters-section {
    background: linear-gradient(to bottom, #0d1321, #0a0e17);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.character-card {
    background-color: #1a2332;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #2a3a50;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.character-card h3 {
    color: #4dabf7;
    margin-bottom: 15px;
    font-size: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.7s forwards;
}

.character-card p {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.9s forwards;
}

/* 为每个角色卡片设置不同的动画延迟 */
.character-card:nth-child(1) {
    animation-delay: 0.1s;
}

.character-card:nth-child(2) {
    animation-delay: 0.3s;
}

.character-card:nth-child(3) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 画廊区域 */
.gallery-section {
    background-color: #0d1321;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    height: 250px;
    background-color: #1a2332;
    border-radius: 8px;
    border: 1px solid #2a3a50;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.gallery-item:hover::before {
    opacity: 1;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    text-align: center;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

#modal-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.4s forwards;
}

.modal.show #modal-image {
    opacity: 1;
    transform: translateY(0);
}

.modal-caption {
    margin-top: 15px;
    color: #e0e0e0;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.5s forwards;
}

.modal.show .modal-caption {
    opacity: 1;
    transform: translateY(0);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #4dabf7;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.3s forwards;
}

.modal.show .close {
    opacity: 1;
    transform: translateY(0);
}

.close:hover,
.close:focus {
    color: #fff;
}

/* 下载区域 */
.download-section {
    text-align: center;
    background: linear-gradient(rgba(10, 14, 23, 0.9), rgba(10, 14, 23, 0.95)), 
                radial-gradient(circle, #1a2332 0%, #0a0e17 100%);
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.download-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 0%, rgba(77, 171, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 50%, rgba(77, 171, 247, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(77, 171, 247, 0.05) 0%, transparent 50%);
    z-index: -1;
}

.download-section h2 {
    font-size: 2.8rem;
}

.download-section p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #b0b0b0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.2s forwards;
}

.btn.large {
    padding: 15px 40px;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 0.4s forwards;
}

/* 页脚样式 */
.footer {
    background-color: #080b11;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #1a2332;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s 1.2s forwards;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: -70px; /* 初始位置在屏幕下方 */
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #4dabf7;
    color: #0a0e17;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
}

.back-to-top.show {
    bottom: 20px;
    opacity: 1;
}

.back-to-top:hover {
    background-color: #339af0;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(77, 171, 247, 0.4);
}

.back-to-top:hover {
    background-color: #339af0;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(77, 171, 247, 0.4);
}

.arrow-up {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-left: 3px solid #0a0e17;
    border-bottom: 3px solid #0a0e17;
    transform: rotate(135deg);
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }
    
    .nav-menu {
        margin-top: 15px;
    }
    
    .nav-item {
        margin: 0 10px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 80%;
        margin-bottom: 10px;
    }
    
    section h2 {
        font-size: 2rem;
    }
}
