/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    /* 确保 html 和 body 都透明，以显示 aaaaa-js 画布 */
    background: transparent;
}

body {
    font-family: 'Fusion Pixel', monospace;
    line-height: 1.6;
    color: #2c3e50;
    overflow-x: hidden;
}

/* Fusion Pixel 字体 */
@font-face {
    font-family: 'Fusion Pixel';
    src: url('../fonts/fusion-pixel-12px-proportional-zh_hans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 新的背景和遮罩 */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://uss-pan.chunshengserver.cn/%E5%8F%91%E5%B8%83%E9%A1%B5/files/CSSHeadFigure.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -3;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -2;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(139, 69, 19, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 4px solid #8B4513;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border: 2px solid #654321;
    border-radius: 4px;
    animation: blockBounce 2s ease-in-out infinite;
}

.logo-text {
    color: #FFFFFF;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #FFFFFF;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: #654321;
    border-color: #D2691E;
    transform: translateY(-2px);
}

/* 主横幅 */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    /* 移除 hero 背景，让 aaaaa-js 显示出来 */
    background: transparent;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
}

.minecraft-title {
    position: relative; /* Make this the positioning context for the canvas */
}

.minecraft-title h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    cursor: pointer; /* Indicate it's interactive */
    /* color, text-shadow, and animation will be handled by utility classes */
}

/* Initial state: Stone texture with outer stroke */
.text-stone {
    background-image: url('../images/stone_1280x720(mcicons.ccleaf.com).jpg');
    background-size: cover;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Create outer stroke using drop-shadow filter */
    filter: drop-shadow(1px 1px 0 #000)
            drop-shadow(-1px -1px 0 #000)
            drop-shadow(1px -1px 0 #000)
            drop-shadow(-1px 1px 0 #000);
}

/* Final state: White text with outer stroke */
.text-white {
    color: #FFFFFF;
    /* Create outer stroke using drop-shadow filter */
    filter: drop-shadow(1px 1px 0 #000)
            drop-shadow(-1px -1px 0 #000)
            drop-shadow(1px -1px 0 #000)
            drop-shadow(-1px 1px 0 #000);
}

/* Canvas for the shatter animation */
.minecraft-title canvas {
    position: absolute; /* Position relative to .minecraft-title */
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none; /* Prevent canvas from blocking clicks */
}


.subtitle {
    font-size: 1.5rem;
    color: #FFFFFF;
    margin-bottom: 2rem;
    min-height: 2rem; /* 确保在打字机动画前有固定高度 */
    line-height: 1.33; /* 设置行高以匹配最小高度 */
}


@keyframes blockBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.arrow-down {
    width: 30px;
    height: 30px;
    border: 3px solid #2c3e50;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
    40% { transform: translateY(-10px) rotate(45deg); }
    60% { transform: translateY(-5px) rotate(45deg); }
}

/* 章节标题 */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 3rem;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 2px;
}

/* 服务器区域 */
.servers-section {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.9);
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.server-card {
    background-color: #C6C6C6;
    border: 3px solid #555555;
    border-radius: 0;
    padding: 2rem;
    text-align: center;
    box-shadow: inset 0 0 0 3px #FFFFFF, 5px 5px 0px #555555;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.server-card:hover::before {
    left: 100%;
}

.server-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.server-icon {
    margin-bottom: 1rem;
    height: 64px; /* 确保容器有高度 */
}

@keyframes iconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.server-card h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.server-address {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    border: 2px dashed #4CAF50;
}

.address-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.server-ip {
    background: #2c3e50;
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.server-ip:hover {
    background: #34495e;
    transform: scale(1.05);
}

.copy-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.server-desc {
    color: #666;
    font-style: italic;
}

/* 链接区域 */
.links-section {
    padding: 100px 0;
    background: url('../images/wall_15_QcViARwajW.jpg');
    background-size: cover;
    background-position: center;
}

.links-section .section-title {
    color: white;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.link-card {
    background-color: #C6C6C6;
    border: 3px solid #555555;
    border-radius: 0;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 0 3px #FFFFFF, 5px 5px 0px #555555;
    transform: perspective(1000px) rotateX(0deg);
}

.link-card:hover {
    transform: perspective(1000px) rotateX(5deg) translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.link-icon {
    margin-bottom: 1rem;
    height: 64px; /* 确保容器有高度 */
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.link-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.link-card p {
    color: #666;
    margin-bottom: 1rem;
}

.link-url {
    color: #4CAF50;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
}

/* 特色功能区域 */
.features-section {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.9);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #4CAF50;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px) rotate(2deg);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

.feature-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-evenly; /* 使用 space-evenly 实现自适应间隔 */
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.footer-section {
    /* 移除固定的 margin */
    text-align: center; /* 将内部文本居中 */
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #4CAF50;
    font-size: 1.5rem; /* 放大标题字号 */
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: underline;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #4CAF50;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

.footer-bottom a {
    color: #bdc3c7;
    text-decoration: underline !important;
}

.footer-bottom a p {
    color: inherit !important;
}

/* 粒子效果 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: -1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .minecraft-title h1 {
        font-size: 2.5rem;
    }
    
    .servers-grid,
    .links-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .server-card {
        padding: 1.5rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* 复制成功动画 */
.copy-success {
    animation: copyPulse 0.5s ease-in-out;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: #2ecc71; }
    100% { transform: scale(1); }
}

/* 滚动动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}