.content-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.mods-section,
.shaders-section,
.modpack-section {
    margin-bottom: 40px;
}

h2 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.mod-card,
.shader-card,
.modpack-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mod-card img,
.shader-card img,
.modpack-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5em;
}

h4 {
    color: #34495e;
    margin: 15px 0 10px;
}

ul {
    list-style-type: disc;
    margin-left: 20px;
    color: #666;
}

li {
    margin: 5px 0;
}

@media (min-width: 768px) {
    .mod-card,
    .shader-card,
    .modpack-card {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 20px;
    }

    .mod-card img,
    .shader-card img,
    .modpack-card img {
        height: 250px;
        margin-bottom: 0;
    }
}

.content-block {
    padding: 80px 20px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.mods-section {
    background-color: #f8f9fa;
    position: relative;
}

.shaders-section {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    position: relative;
}

.modpack-section {
    background-color: #f8f9fa;
    position: relative;
}

.content-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, transparent, rgba(44, 62, 80, 0.1), transparent);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
    position: relative;
    padding: 0 20px;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 2.8em;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #3498db, #2ecc71);
    border-radius: 2px;
}

.section-desc {
    color: #666;
    font-size: 1.2em;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.cards-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
}

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

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(52, 152, 219, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover::after {
    opacity: 1;
}

.card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    background-color: #f9f9f9;
    padding: 20px;
    display: block;
    min-height: 400px;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.03);
}

.card-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,0.03);
}

.card h3 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 12px;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #3498db, #2ecc71);
    border-radius: 2px;
}

.card p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.05em;
}

.card h4 {
    color: #34495e;
    font-size: 1.2em;
    margin: 20px 0 12px;
    font-weight: 600;
}

.card ul {
    list-style-type: none;
    margin-left: 5px;
    color: #666;
}

.card li {
    margin: 10px 0;
    position: relative;
    padding-left: 25px;
    line-height: 1.5;
}

.card li::before {
    content: '•';
    color: #3498db;
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: -3px;
}

@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .content-block {
        padding: 100px 20px;
    }
}

@media (min-width: 1024px) {
    .card {
        display: grid;
        grid-template-columns: 1fr 1.5fr;
        align-items: center;
        min-height: 500px;
    }

    .card img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        align-self: stretch;
        min-height: 500px;
    }

    .card-content {
        height: 100%;
        padding: 30px;
    }

    .modpack-section::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(to right, transparent, rgba(44, 62, 80, 0.1), transparent);
    }
}

@media (max-width: 1023px) {
    .card img {
        min-height: 500px;
        max-height: 600px;
    }
}

.content-block + .content-block {
    margin-top: -1px;
}

/* 下载按钮样式 */
.download-button {
    margin-top: 25px;
    text-align: center;
}

.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
    position: relative;
    overflow: hidden;
}

.download-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.download-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #2980b9, #27ae60);
}

.download-link:hover::before {
    left: 100%;
}

.download-icon {
    margin-right: 10px;
    font-size: 1.3em;
}

/* 确保链接文字颜色在悬停时保持白色 */
.download-link:hover,
.download-link:visited {
    color: white;
}

/* 为机械动力图片添加特殊样式 */
.mods-section .card:first-child img {
    aspect-ratio: 16 / 9; /* 设置16:9的宽高比 */
    object-fit: contain;
    padding: 10px;
    min-height: 300px; /* 减小最小高度 */
}

@media (min-width: 1024px) {
    .mods-section .card:first-child {
        grid-template-columns: 2fr 1.5fr; /* 为机械动力卡片调整图片和内容的比例 */
    }

    .mods-section .card:first-child img {
        min-height: 400px; /* 在大屏幕上适当增加高度 */
    }
}

@media (max-width: 1023px) {
    .mods-section .card:first-child img {
        max-height: 400px; /* 在小屏幕上限制最大高度 */
    }
}

/* 光影部分的布局调整 */
@media (min-width: 768px) {
    .shaders-section .cards-container {
        grid-template-columns: 1fr;
        max-width: 1000px;
        margin: 0 auto;
    }

    .shaders-section .card {
        display: grid;
        grid-template-columns: 2fr 1.2fr; /* 所有光影卡片使用相同的宽比例 */
        gap: 30px;
    }

    .shaders-section .card img {
        min-height: 400px;
        object-fit: cover; /* 所有光影图片使用cover */
        padding: 0;
        background-color: transparent;
    }
}

@media (min-width: 1024px) {
    .shaders-section .card {
        min-height: 600px; /* 所有卡片使用相同的高度 */
    }

    .shaders-section .card img {
        min-height: 600px;
    }
}

/* 移除之前的特殊样式 */
.shaders-section .card:nth-child(2),
.shaders-section .card:nth-child(3) {
    grid-column: auto;
}

/* 材质包和优化板块样式 */
.resource-pack-section {
    background-color: #ffffff;
    position: relative;
}

.optimization-section {
    background-color: #f8f9fa;
    position: relative;
}

/* 服务端软件部分样式 */
.server-section {
    background-color: #ffffff;
    position: relative;
}

/* 服务端软件部分的布局调整 */
@media (min-width: 768px) {
    .server-section .cards-container {
        grid-template-columns: 1fr; /* 改为单列布局 */
        max-width: 1200px;
        margin: 0 auto;
    }

    .server-section .card {
        grid-template-columns: 2fr 1.2fr; /* 使用与其他部分相同的比例 */
        gap: 40px;
    }
}

@media (min-width: 1024px) {
    .server-section .card {
        min-height: 600px;
    }

    .server-section .card img {
        min-height: 600px;
        object-fit: cover;
        padding: 0;
        background-color: transparent;
    }
}

/* 调整材质包图片显示 */
.resource-pack-section .card {
    grid-template-columns: 1.5fr 1.5fr; /* 更均衡的图文比例 */
}

/* 优化板块的卡片布局 */
@media (min-width: 768px) {
    .optimization-section .cards-container {
        grid-template-columns: 1fr; /* 改为单列布局 */
        max-width: 1200px; /* 增加最大宽度 */
        margin: 0 auto;
    }

    .optimization-section .card {
        grid-template-columns: 2fr 1.2fr; /* 使用更宽的图片区域 */
        gap: 40px; /* 增加图片和内容之间的间距 */
    }

    /* Java优化卡片使用更宽的布局 */
    .optimization-section .card:last-child {
        max-width: 1200px;
        margin: 0 auto;
        grid-template-columns: 2fr 1.2fr;
    }
}

@media (min-width: 1024px) {
    .optimization-section .card {
        min-height: 600px; /* 增加卡片高度 */
    }

    .optimization-section .card img {
        min-height: 600px;
    }
}

/* 确保图片显示效果一致 */
.optimization-section .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    background-color: transparent;
}

/* 材质包部分的布局调整 */
@media (min-width: 768px) {
    .resource-pack-section .cards-container {
        grid-template-columns: 1fr; /* 改为单列布局 */
        max-width: 1200px;
        margin: 0 auto;
    }

    .resource-pack-section .card {
        grid-template-columns: 2fr 1.2fr; /* 使用与其他部分相同的比例 */
        gap: 40px;
    }
}

@media (min-width: 1024px) {
    .resource-pack-section .card {
        min-height: 600px;
    }

    .resource-pack-section .card img {
        min-height: 600px;
        object-fit: cover;
        padding: 0;
        background-color: transparent;
    }
}

/* 调整Faithful材质包图片显示 */
.resource-pack-section .card:first-child img {
    object-fit: contain; /* 改为contain以显示完整图片 */
    padding: 20px; /* 添加内边距 */
    background-color: #f5f5f5; /* 添加背景色 */
}

@media (min-width: 1024px) {
    .resource-pack-section .card:first-child {
        min-height: 600px;
    }

    .resource-pack-section .card:first-child img {
        min-height: 600px;
        width: 100%;
        height: 100%;
    }
}

/* 安装步骤样式 */
.install-steps {
    list-style-type: none;
    margin: 20px 0;
    padding-left: 0;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.install-steps li {
    margin: 0;
    line-height: 1.6;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    position: relative;
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
}

.install-steps li:hover {
    background-color: #f0f7ff;
    transform: translateX(2px);
}

/* 调整Java优化卡片内容间距 */
.optimization-section .card:last-child .card-content {
    padding: 35px;
}

.optimization-section .card:last-child h4 {
    margin-top: 20px;
}

/* 懒加载图片样式 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background: #f0f0f0;
}

.lazy-image.loaded {
    opacity: 1;
}

/* 图片加载占位符 */
.lazy-image::before {
    content: '';
    display: block;
    padding-top: 75%; /* 4:3 宽高比 */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    border: none;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

.back-to-top svg {
    transition: transform 0.2s ease;
}

.back-to-top:hover svg {
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* 代码块样式 */
code {
    display: block;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin: 10px 0;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #3498db;
}

.install-steps strong {
    color: #3498db;
    font-weight: 600;
    font-size: 1.05em;
}

.install-steps li:hover code {
    background-color: #34495e;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    code {
        font-size: 12px;
        padding: 10px 12px;
        overflow-x: scroll;
    }
} 