/* 基础样式和变量 */
:root {
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --primary: #8a2be2;
    --secondary: #8b0000;
    --accent: #9932cc;
    --text: #e0d8e6;
    --text-dark: #b8a8c0;
    --card-bg: rgba(30, 20, 40, 0.8);
    --shadow: 0 10px 30px rgba(138, 43, 226, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MedievalSharp', cursive;
    background-color: var(--dark-bg);
    color: var(--text);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 80% 30%, rgba(139, 0, 0, 0.1) 0%, transparent 20%),
        repeating-linear-gradient(45deg, var(--darker-bg) 0px, var(--darker-bg) 10px, transparent 10px, transparent 20px);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 悬浮导航栏 */
.floating-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 10, 15, 0.95);
    border: 2px solid var(--primary);
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: var(--shadow);
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.floating-nav:hover {
    box-shadow: 0 10px 40px rgba(138, 43, 226, 0.5);
}

.skull-icon {
    font-size: 28px;
    animation: pulse 2s infinite;
    cursor: pointer;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 页面头部 */
header {
    /* min-height: 50vh; */
    min-height: 35vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: 100px;
}

.header-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    color: var(--primary);
    text-shadow: 3px 3px 10px rgba(138, 43, 226, 0.5);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-dark);
    max-width: 800px;
    margin: 0 auto;
}

/* 主内容区 */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px 20px;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* 游戏库网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.game-card {
    background-color: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(138, 43, 226, 0.4);
}

.game-card:hover .game-image {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.game-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--primary);
}

.game-info {
    padding: 20px;
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 10px;
}

.game-description {
    font-size: 1rem;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 魔法阵效果 */
.magic-circle-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='90' stroke='%238a2be2' stroke-width='1' fill='none' stroke-dasharray='5,5'/%3E%3Ccircle cx='100' cy='100' r='80' stroke='%238a2be2' stroke-width='1' fill='none'/%3E%3Ccircle cx='100' cy='100' r='70' stroke='%238a2be2' stroke-width='1' fill='none'/%3E%3Cpath d='M100 10 L100 30 M100 170 L100 190 M170 100 L190 100 M10 100 L30 100' stroke='%238a2be2' stroke-width='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.6s ease;
    pointer-events: none;
}

.game-card:hover .magic-circle-effect {
    opacity: 0.8;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* 地下城公告 */
.announcements {
    margin-bottom: 80px;
}

.announcement-scroll {
    background-color: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 300px;
}

.announcement-scroll::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 5px;
    pointer-events: none;
}

.announcement-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-title {
    font-family: 'Cinzel', serif;
    color: var(--secondary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.announcement-date {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* 页脚 */
footer {
    background-color: var(--darker-bg);
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--primary);
}

/* 游戏详情模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 15, 0.95);
    z-index: 2000;
    overflow-y: auto;
}

/* 传送门加载效果 */
.modal.show .modal-content > div:last-child {
    position: relative;
    overflow: hidden;
}

.modal.show .modal-content > div:last-child::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(138, 43, 226, 0.3), transparent);
    animation: portalGlow 1s linear;
}

.magic-circle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='90' stroke='%238a2be2' stroke-width='2' fill='none'/%3E%3Ccircle cx='100' cy='100' r='80' stroke='%238a2be2' stroke-width='2' fill='none'/%3E%3Ccircle cx='100' cy='100' r='70' stroke='%238a2be2' stroke-width='2' fill='none'/%3E%3Cpath d='M100 10 L100 30 M100 170 L100 190 M170 100 L190 100 M10 100 L30 100' stroke='%238a2be2' stroke-width='2'/%3E%3Cpath d='M30 30 L50 50 M150 30 L170 50 M30 150 L50 170 M150 150 L170 170' stroke='%238a2be2' stroke-width='2'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: all 1s ease;
    z-index: 2100;
}

.modal.show .magic-circle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(10);
}

.modal-content {
    position: relative;
    background-color: var(--card-bg);
    margin: 100px auto;
    padding: 40px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(138, 43, 226, 0.5);
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: 0.5s;
}

.modal.show .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text);
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--secondary);
}

/* 蝙蝠群动画 */
#bat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
}

.bat {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    transform: scale(0.5);
    animation: fly linear infinite;
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fly {
    0% {
        left: -10%;
        top: calc(20% + var(--random-y) * 60%);
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        left: 110%;
        top: calc(20% + var(--random-y) * 60% + var(--drift) * 20%);
        opacity: 0;
        transform: scale(0.5) rotate(10deg);
    }
}

@keyframes portalGlow {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-dark);
    animation: pulse 1.5s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .floating-nav {
        gap: 15px;
        padding: 8px 15px;
    }
    
    .nav-links a {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .modal-content {
        margin: 50px auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .floating-nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px 10px;
    }
    
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
    }
}