/* 基础样式 */
:root {
    --mc-green: #7CFC00;
    --mc-brown: #8B4513;
    --mc-dark: #2D2D2D;
    --mc-light: #F5F5F5;
    --mc-red: #FF5555;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: var(--mc-dark);
    color: var(--mc-light);
    overflow-x: hidden;
}

.minecraft-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/background.png');
    background-size: cover;
    opacity: 0.3;
    z-index: -1;
    animation: bgScroll 60s linear infinite;
}

@keyframes bgScroll {
    0% { background-position: 0 0; }
    100% { background-position: -512px 512px; }
}

.pixel-border {
    border: 4px solid var(--mc-green);
    box-shadow: 0 0 0 4px var(--mc-brown),
                0 0 0 8px var(--mc-green);
    background-color: rgba(45, 45, 45, 0.9);
}

/* 标题样式 */
header {
    text-align: center;
    margin: 20px auto;
    max-width: 1200px;
    padding: 20px;
}

.minecraft-font {
    font-family: 'Minecraft', sans-serif;
    color: var(--mc-green);
    text-shadow: 3px 3px 0 var(--mc-brown);
}

/* 工作台导航菜单 */
.crafting-menu {
    margin: 20px auto;
    width: fit-content;
}

.crafting-grid {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-gap: 10px;
    margin: 0 auto;
}

.crafting-slot {
    width: 100px;
    height: 100px;
    background-color: rgba(139, 69, 19, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    color: white;
    font-weight: bold;
}

.crafting-slot:hover {
    background-color: rgba(139, 69, 19, 0.9);
    transform: scale(1.05);
}

.search-slot {
    grid-column: span 3;
    width: 320px;
    height: 50px;
}

.minecraft-input {
    width: 90%;
    height: 80%;
    background-color: var(--mc-dark);
    border: 2px solid var(--mc-green);
    color: white;
    padding: 5px;
    font-family: 'Minecraft', sans-serif;
}

.minecraft-input:focus {
    outline: none;
    border-color: var(--mc-red);
}

/* 精选区域 */
.featured {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

.floating-islands {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 20px;
}

.island {
    width: 200px;
    height: 200px;
    background-color: rgba(124, 252, 0, 0.2);
    border: 3px solid var(--mc-green);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px;
    cursor: pointer;
    transition: all 0.5s;
    position: relative;
    overflow: hidden;
}

.island:hover {
    transform: translateY(-20px);
    box-shadow: 0 10px 20px rgba(124, 252, 0, 0.3);
}

.island img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

/* 分类区域 */
.category-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-item {
    background-color: rgba(139, 69, 19, 0.7);
    padding: 15px;
    border-left: 5px solid var(--mc-green);
    transition: all 0.3s;
}

.category-item:hover {
    background-color: rgba(139, 69, 19, 0.9);
    transform: translateX(5px);
}

/* 加载动画 */
.loading-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.mining-animation {
    width: 300px;
    height: 100px;
    position: relative;
}

.steve {
    width: 50px;
    height: 80px;
    background-color: #6B6B6B;
    position: absolute;
    left: 50px;
    bottom: 0;
    animation: mining 2s infinite;
}

.pickaxe {
    width: 30px;
    height: 50px;
    background-color: #A0A0A0;
    position: absolute;
    left: 100px;
    bottom: 40px;
    transform-origin: bottom left;
    animation: swing 2s infinite;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: var(--mc-dark);
    border: 2px solid var(--mc-green);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--mc-green);
    animation: progress 2s infinite;
}

@keyframes mining {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes swing {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(30deg); }
}

@keyframes progress {
    0% { width: 0; }
    100% { width: 100%; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .crafting-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-slot {
        grid-column: span 2;
        width: 100%;
    }
    
    .floating-islands {
        flex-direction: column;
        align-items: center;
    }
    
    .island {
        width: 150px;
        height: 150px;
    }
}