/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Minecraft 字体导入（如果可以的话） */
@font-face {
    font-family: 'Minecraftia';
    src: url('https://fonts.cdnfonts.com/s/14718/Minecraftia.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #2B2D42;
}

::-webkit-scrollbar-thumb {
    background: #57A773;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4A8D65;
}

/* 通用按钮效果增强 */
.btn-minecraft {
    position: relative;
    transition: all 0.15s ease;
    transform-style: preserve-3d;
    overflow: hidden;
}

.btn-minecraft:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 101px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-minecraft:hover:before {
    transform: translateX(300%);
}

/* 悬浮卡片效果增强 */
.bg-dark\/50.backdrop-blur-sm {
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.bg-dark\/50.backdrop-blur-sm:hover {
    box-shadow: 0 10px 25px -5px rgba(87, 167, 115, 0.3);
}

/* 游戏入口卡片效果 */
#games > .grid > div {
    overflow: hidden;
}

#games > .grid > div > div:first-child {
    transition: transform 0.5s ease;
}

#games > .grid > div:hover > div:first-child {
    transform: scale(1.1);
}

/* 图标动画 */
.text-primary i {
    transition: transform 0.3s ease;
}

.bg-dark\/50.backdrop-blur-sm:hover .text-primary i {
    transform: rotate(15deg) scale(1.2);
}

/* 粒子效果 - 方块风格 */
.particle {
    position: absolute;
    width: 16px;
    height: 16px;
    background-image: url('https://minecraft.wiki/images/Grass_Block.png');
    background-size: cover;
    pointer-events: none;
    opacity: 0.7;
    animation: floatParticle 3s ease-in-out forwards;
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
}

/* 添加方块风格的边框 */
.block-border {
    position: relative;
    border: 8px solid transparent;
    border-image: url('https://minecraft.wiki/images/Stone_Brick.png') 8 repeat;
}

/* 渐入动画增强 */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 鼠标跟随效果 */
.cursor-follow {
    position: fixed;
    width: 40px;
    height: 40px;
    background-image: url('https://minecraft.wiki/images/Creeper.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
}

/* 服务器信息卡片的特殊效果 */
#info > .container > .grid > div {
    position: relative;
    overflow: hidden;
}

#info > .container > .grid > div:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #57A773, transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

#info > .container > .grid > div:hover:after {
    transform: translateX(100%);
}

/* 导航栏链接效果 */
nav a {
    position: relative;
}

nav a:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #57A773;
    transition: width 0.3s ease;
}

nav a:hover:after {
    width: 100%;
}

/* 游戏加载动画增强 */
@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#game-loading-overlay .fa-cog {
    animation: spin-slow 3s linear infinite;
}

/* 响应式字体大小调整 */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
}

/* 方块阴影效果 */
.minecraft-shadow {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

/* 方块按钮按下效果 */
.minecraft-btn-active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
}

/* 强调文本效果 */
.text-highlight {
    position: relative;
    display: inline-block;
}

.text-highlight:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(87, 167, 115, 0.3);
    z-index: -1;
}

/* 闪烁效果 - 用于重要信息 */
@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

.blink {
    animation: blink 2s ease-in-out infinite;
}

/* 渐变文本效果 */
.gradient-text {
    background: linear-gradient(90deg, #57A773, #3C6E71, #57A773);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s linear infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 背景方块动画 */
@keyframes floatBlocks {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.floating-block {
    animation: floatBlocks 6s ease-in-out infinite;
}

/* 自定义滚动条 */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #57A773 #2B2D42;
}

/* 平滑过渡效果 */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 卡片悬停效果增强 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* 分隔线样式 */
.minecraft-divider {
    height: 4px;
    background-image: url('https://minecraft.wiki/images/Stone_Brick.png');
    background-repeat: repeat-x;
    background-size: auto 100%;
    margin: 2rem 0;
}

/* 工具提示样式 */
.minecraft-tooltip {
    position: relative;
}

.minecraft-tooltip:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #2B2D42;
    color: #EDF2F4;
    border: 2px solid #57A773;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.minecraft-tooltip:hover:before {
    opacity: 1;
}

/* 方块选中效果 */
.block-select {
    position: relative;
}

.block-select::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #57A773;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.block-select:hover::before {
    opacity: 1;
}

/* 加载屏幕效果 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2B2D42;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* 进度条样式 */
.minecraft-progress {
    width: 300px;
    height: 20px;
    background: #333;
    border: 2px solid #555;
    overflow: hidden;
    margin: 20px 0;
}

.minecraft-progress-bar {
    height: 100%;
    background: #57A773;
    transition: width 0.3s ease;
    position: relative;
}

.minecraft-progress-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 计数器动画 */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-animate {
    animation: count-up 0.5s ease-out;
}

/* 移动设备触摸优化 */
@media (hover: none) {
    .btn-minecraft:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 0 #2D5A40;
    }
}

/* 打印样式 */
@media print {
    nav, footer, .btn-minecraft {
        display: none;
    }
    body {
        background: white !important;
        color: black !important;
    }
}