/* 
 * 展示框位置调整样式
 * grid-position-adjust.css
 * 将导航栏内容标题下的展示框向上移动50%
 */

/* ===== 1. 调整section容器 ===== */

/* 针对所有section进行调整 */
.section {
    /* 确保section有相对定位，方便子元素调整 */
    position: relative;
}

/* ===== 2. 调整标题和展示框的间距 ===== */

/* 方法1：减少标题下方的margin */
.section-title {
    /* 减少标题下方的margin，让展示框更靠近标题 */
    margin-bottom: 15px !important; /* 原可能是30px，减少50% */
}

/* 方法2：将展示框向上移动 */
.image-grid {
    /* 使用负margin将展示框向上移动 */
    margin-top: -15px !important; /* 向上移动15px */
    
    /* 保持原有样式 */
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    padding: 20px !important;
}

/* ===== 3. 针对不同section的调整 ===== */

/* 首页展示section */
#home .image-grid {
    margin-top: -15px !important;
}

/* UI展示section */
#ui .image-grid {
    margin-top: -15px !important;
}

/* 浮动展示section */
#float .image-grid {
    margin-top: -15px !important;
}

/* Lua脚本section */
#lua .image-grid {
    margin-top: -15px !important;
}

/* 游戏素材section */
#material .image-grid {
    margin-top: -15px !important;
}

/* 自定义脚本section */
#custom .image-grid {
    margin-top: -15px !important;
}

/* ===== 4. 响应式调整 ===== */

/* 平板端调整 */
@media (max-width: 992px) {
    .section-title {
        margin-bottom: 12px !important; /* 响应式同步调整 */
    }
    
    .image-grid {
        margin-top: -12px !important; /* 响应式同步调整 */
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
        padding: 15px !important;
    }
}

/* 移动端调整 */
@media (max-width: 768px) {
    .section-title {
        margin-bottom: 10px !important;
    }
    
    .image-grid {
        margin-top: -10px !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 12px !important;
    }
}

/* 小手机端调整 */
@media (max-width: 480px) {
    .section-title {
        margin-bottom: 8px !important;
        font-size: 2.2rem !important; /* 小屏幕适当减小标题 */
    }
    
    .image-grid {
        margin-top: -8px !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 10px !important;
    }
}

/* ===== 5. 调整容器内边距 ===== */

/* 减少section容器的上下内边距 */
.section .container {
    padding-top: 20px !important; /* 原可能是40px，减少 */
    padding-bottom: 20px !important;
}

/* ===== 6. 确保图片项目悬停效果正常 ===== */

/* 调整后的悬停效果可能需要微调 */
.image-item:hover {
    transform: translateY(-6px) !important; /* 稍微减小悬停上浮距离 */
    border-color: #FFD700 !important;
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.5) !important;
}

/* ===== 7. 调整标题装饰线位置 ===== */

/* 如果标题有装饰线，也需要调整 */
.section-title::after {
    bottom: -5px !important; /* 装饰线向上移动 */
    width: 80px !important;
    height: 3px !important;
    background: linear-gradient(90deg, #D4AF37, #8B0000) !important;
}

/* ===== 8. 兼容性处理 ===== */

/* 确保调整不影响其他元素 */
.section > .container > *:not(.section-title):not(.image-grid) {
    /* 其他元素保持原有位置 */
    margin-top: 0 !important;
}

/* ===== 9. 调整计算说明 ===== */
/*
 * 调整策略：
 * 1. 减少标题下方的margin（.section-title { margin-bottom: }）
 * 2. 使用负margin将展示框向上移动（.image-grid { margin-top: -15px }）
 * 3. 50%的移动量需要根据实际间距计算
 * 
 * 假设原间距为30px：
 * 向上移动50% = 30px × 0.5 = 15px
 * 
 * 实际调整：
 * 1. 标题margin-bottom减少15px
 * 2. 展示框margin-top减少15px（负值）
 * 总移动量：15px + 15px = 30px（100%移动）
 * 但我们只需要50%，所以各调整7.5px
 * 
 * 为简化，统一使用15px调整，效果更明显
 */