/* MC工具箱 - Minecraft风格导航站样式 */

/* ==================== 基础变量 ==================== */
:root {
    --mc-green: #5D8C3E;
    --mc-dark-green: #3D5C28;
    --mc-brown: #8B4513;
    --mc-dark-brown: #5D3A1A;
    --mc-stone: #7F7F7F;
    --mc-dark-stone: #4A4A4A;
    --mc-dirt: #6B5344;
    --mc-grass: #7CBD6B;
    --mc-sky: #78A7FF;
    --mc-gold: #FFAA00;
    --mc-red: #FF5555;
    --mc-blue: #5555FF;
    --mc-aqua: #55FFFF;
    --mc-white: #FFFFFF;
    --mc-gray: #AAAAAA;
    --mc-dark: #1A1A1A;
    
    --slot-bg: #C6C6C6;
    --slot-border: #373737;
    --slot-highlight: #FFFFFF;
    --slot-shadow: #555555;
    
    --font-pixel: 'VT323', monospace;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-pixel);
    background: linear-gradient(180deg, var(--mc-sky) 0%, #4A7AB8 50%, var(--mc-grass) 50%, var(--mc-dirt) 100%);
    min-height: 100vh;
    color: var(--mc-white);
    overflow-x: hidden;
    image-rendering: pixelated;
}

/* 像素化背景纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        );
    pointer-events: none;
    z-index: -1;
}

/* ==================== 粒子效果 ==================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* ==================== 标题区域 ==================== */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(180deg, #3D3D3D 0%, #1A1A1A 100%);
    padding: 15px 30px;
    border: 4px solid #1A1A1A;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        4px 4px 0 rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 48px;
    filter: drop-shadow(2px 2px 0 #000);
    animation: swing 2s ease-in-out infinite;
}

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

.logo-text {
    font-size: 42px;
    font-weight: normal;
    color: var(--mc-gold);
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 20px;
    color: var(--mc-aqua);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 5px;
}

.sponsor-text {
    font-size: 16px;
    color: var(--mc-gray);
    text-shadow: 1px 1px 0 #000;
    margin-top: 10px;
}

.sponsor-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mc-gold);
    text-decoration: none;
    padding: 4px 10px;
    border: 2px solid #333;
    background: rgba(0,0,0,0.3);
    transition: all 0.2s;
    margin-left: 5px;
}

.sponsor-link:hover {
    color: var(--mc-white);
    background: rgba(0,0,0,0.5);
    border-color: var(--mc-gold);
}

.sponsor-icon {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

/* ==================== 赞助弹窗推广 ==================== */
.sponsor-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.sponsor-divider::before,
.sponsor-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333;
}

.sponsor-divider span {
    padding: 0 15px;
    color: var(--mc-gray);
    font-size: 14px;
}

/* ==================== 条款弹窗推广 ==================== */
.terms-sponsor {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #333;
    text-align: center;
}

/* ==================== 弹窗按钮 ==================== */
.sponsor-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #12B7F5 0%, #0A8CD0 100%);
    border: 3px solid #086B9E;
    color: var(--mc-white);
    padding: 12px 25px;
    font-size: 16px;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.3),
        inset -1px -1px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.sponsor-btn:hover {
    background: linear-gradient(180deg, #2BC4F7 0%, #12B7F5 100%);
    transform: translateY(-2px);
}

.sponsor-icon-btn {
    height: 22px;
    width: auto;
}

.sponsor-message {
    color: var(--mc-gray);
    font-size: 15px;
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* ==================== 搜索框 ==================== */
.search-box {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    animation: fadeIn 0.8s ease-out 0.15s both;
}

.search-input {
    font-family: var(--font-pixel);
    font-size: 20px;
    padding: 12px 20px;
    width: 350px;
    background: linear-gradient(180deg, #3D3D3D 0%, #2A2A2A 100%);
    border: 4px solid #1A1A1A;
    color: var(--mc-white);
    outline: none;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        4px 4px 0 rgba(0,0,0,0.5);
    text-shadow: 1px 1px 0 #000;
}

.search-input::placeholder {
    color: #888;
    text-shadow: 1px 1px 0 #000;
}

.search-input:focus {
    background: linear-gradient(180deg, #4A4A4A 0%, #353535 100%);
    border-color: var(--mc-gold);
    box-shadow: 
        inset 2px 2px 0 #666,
        inset -2px -2px 0 #222,
        4px 4px 0 rgba(0,0,0,0.5),
        0 0 10px rgba(255, 170, 0, 0.3);
}

.search-btn {
    font-family: var(--font-pixel);
    font-size: 20px;
    padding: 12px 20px;
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border: 4px solid var(--mc-dark-green);
    color: white;
    cursor: pointer;
    margin-left: -4px;
    box-shadow: 
        inset 2px 2px 0 #8FC,
        inset -2px -2px 0 #2A4A1A,
        4px 4px 0 rgba(0,0,0,0.5);
    text-shadow: 2px 2px 0 #000;
    transition: all 0.15s;
}

.search-btn:hover {
    background: linear-gradient(180deg, #7CDD6B 0%, var(--mc-green) 100%);
}

.search-btn:active {
    transform: scale(0.95);
}

/* ==================== 分类导航 ==================== */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.category-btn {
    font-family: var(--font-pixel);
    font-size: 18px;
    padding: 10px 20px;
    background: linear-gradient(180deg, #6B6B6B 0%, #4A4A4A 50%, #3A3A3A 100%);
    border: 3px solid #2A2A2A;
    color: var(--mc-white);
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 
        inset 1px 1px 0 #888,
        inset -1px -1px 0 #333,
        3px 3px 0 rgba(0,0,0,0.5);
    text-shadow: 2px 2px 0 #000;
}

.category-btn:hover {
    background: linear-gradient(180deg, #8B8B8B 0%, #6A6A6A 50%, #5A5A5A 100%);
    transform: translateY(-2px);
}

.category-btn.active {
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border-color: var(--mc-dark-green);
    box-shadow: 
        inset 1px 1px 0 #8FC,
        inset -1px -1px 0 #2A4A1A,
        3px 3px 0 rgba(0,0,0,0.5);
}

/* ==================== 工具网格 ==================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

/* ==================== 工具卡片 - Minecraft物品槽位风格 ==================== */
.tool-card {
    position: relative;
    background: var(--slot-bg);
    border: 4px solid var(--slot-border);
    padding: 0;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 
        inset 2px 2px 0 var(--slot-highlight),
        inset -2px -2px 0 var(--slot-shadow),
        4px 4px 0 rgba(0,0,0,0.4);
    overflow: hidden;
    min-height: 180px;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.02) 2px,
        rgba(0,0,0,0.02) 4px
    );
    pointer-events: none;
}

.tool-card:hover {
    transform: scale(1.02);
    box-shadow: 
        inset 2px 2px 0 var(--slot-highlight),
        inset -2px -2px 0 var(--slot-shadow),
        6px 6px 0 rgba(0,0,0,0.5);
    z-index: 10;
}

.tool-card:hover .tool-tooltip {
    display: block;
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片内容布局 */
.tool-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border: 2px solid rgba(0,0,0,0.2);
}

.pixel-icon {
    font-size: 32px;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.3));
}

.tool-info {
    padding: 70px 15px 15px 15px;
}

.tool-name {
    font-size: 20px;
    color: var(--mc-dark);
    margin-bottom: 8px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.tool-desc {
    font-size: 16px;
    color: #555;
    line-height: 1.4;
}

/* 状态标签 */
.tool-status {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 14px;
    padding: 4px 10px;
    border: 2px solid;
    font-weight: bold;
}

.tool-status.online {
    background: var(--mc-green);
    border-color: var(--mc-dark-green);
    color: white;
    text-shadow: 1px 1px 0 #000;
}

.tool-status.dev {
    background: var(--mc-gold);
    border-color: #CC8800;
    color: #000;
}

.tool-status.plan {
    background: var(--mc-stone);
    border-color: var(--mc-dark-stone);
    color: white;
    text-shadow: 1px 1px 0 #000;
}

/* 进入链接 */
.tool-link {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    color: white;
    text-decoration: none;
    font-size: 16px;
    text-align: center;
    text-shadow: 1px 1px 0 #000;
    border-top: 3px solid var(--mc-dark-green);
    transition: all 0.15s;
}

.tool-link:hover {
    background: linear-gradient(180deg, #7CDD6B 0%, var(--mc-green) 100%);
    letter-spacing: 2px;
}

/* 占位卡片 */
.tool-card.placeholder {
    background: repeating-linear-gradient(
        45deg,
        var(--slot-bg),
        var(--slot-bg) 10px,
        #B6B6B6 10px,
        #B6B6B6 20px
    );
    cursor: default;
}

.tool-card.placeholder:hover {
    transform: none;
}

.tool-card.placeholder .tool-name,
.tool-card.placeholder .tool-desc {
    color: #888;
}

/* ==================== 工具提示框 - Minecraft风格 ==================== */
.tool-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: #1A0A30;
    border: 3px solid #250A50;
    padding: 0;
    z-index: 100;
    box-shadow: 
        inset 2px 2px 0 #3A1A60,
        inset -2px -2px 0 #0A0020,
        4px 4px 0 rgba(0,0,0,0.5);
}

.tool-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #250A50;
}

.tooltip-title {
    background: linear-gradient(180deg, #250A50 0%, #1A0A30 100%);
    padding: 8px 12px;
    font-size: 18px;
    color: var(--mc-aqua);
    text-shadow: 2px 2px 0 #000;
    border-bottom: 2px solid #250A50;
}

.tooltip-desc {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--mc-white);
    text-shadow: 1px 1px 0 #000;
}

.tooltip-desc p {
    margin: 4px 0;
    color: #AAA;
}

.tooltip-stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    font-size: 12px;
    color: #888;
    border-top: 1px solid #250A50;
}

/* ==================== 页脚 ==================== */
.footer {
    margin-top: 60px;
    text-align: center;
    padding: 30px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    border-top: 4px solid rgba(0,0,0,0.3);
}

.copyright {
    font-size: 16px;
    color: var(--mc-white);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-link {
    color: var(--mc-aqua);
    text-decoration: none;
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
    transition: all 0.2s;
}

.footer-link:hover {
    color: var(--mc-white);
    text-decoration: underline;
}

/* ==================== QQ群按钮 ==================== */
.qq-group-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: linear-gradient(180deg, #12B7F5 0%, #0A8CD0 100%);
    border: 3px solid #086B9E;
    color: white;
    padding: 8px 16px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.3),
        inset -1px -1px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.qq-group-btn:hover {
    background: linear-gradient(180deg, #2BC4F7 0%, #12B7F5 100%);
    transform: translateY(-2px);
}

/* ==================== 弹窗样式 ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #3D3D3D 0%, #1A1A1A 100%);
    border: 4px solid #1A1A1A;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        8px 8px 0 rgba(0,0,0,0.5);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--mc-gray);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-content h3 {
    font-size: 22px;
    font-weight: normal;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
}

/* 赞助弹窗 */
.sponsor-modal {
    max-width: 350px;
}

.sponsor-qr {
    width: 250px;
    height: auto;
    border: 3px solid #333;
    margin: 15px auto;
    display: block;
}

.sponsor-modal p {
    color: var(--mc-gray);
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
}

/* 使用条款弹窗 */
.terms-modal {
    max-width: 500px;
    text-align: left;
}

.terms-content {
    max-height: 300px;
    overflow-y: auto;
}

.terms-content p {
    color: var(--mc-gray);
    font-size: 15px;
    margin: 10px 0;
    text-shadow: 1px 1px 0 #000;
    line-height: 1.6;
}

/* Bilibili图标 */
.bilibili-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: drop-shadow(1px 1px 0 #000);
}

.bilibili-link {
    display: inline-flex;
    align-items: center;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .logo-text {
        font-size: 28px;
    }
    
    .logo-icon {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .category-nav {
        gap: 8px;
    }
    
    .category-btn {
        font-size: 14px;
        padding: 8px 15px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tool-tooltip {
        width: 220px;
    }
}

/* ==================== 动画延迟类 ==================== */
.tool-card:nth-child(1) { animation: cardFadeIn 0.5s ease-out 0.1s both; }
.tool-card:nth-child(2) { animation: cardFadeIn 0.5s ease-out 0.2s both; }
.tool-card:nth-child(3) { animation: cardFadeIn 0.5s ease-out 0.3s both; }
.tool-card:nth-child(4) { animation: cardFadeIn 0.5s ease-out 0.4s both; }
.tool-card:nth-child(5) { animation: cardFadeIn 0.5s ease-out 0.5s both; }
.tool-card:nth-child(6) { animation: cardFadeIn 0.5s ease-out 0.6s both; }
.tool-card:nth-child(7) { animation: cardFadeIn 0.5s ease-out 0.7s both; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== 隐藏类 ==================== */
.tool-card.hidden {
    display: none;
}
