* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

header {
    background-color: dimgray;
    height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

header img {
    max-height: 80px;
    width: auto;
}

.nav ul {
    list-style: none;
    justify-content: center;
    align-items: center;
    display: flex;
    height: 50px;
    background-color: gray;
}

.nav ul li {
    display: block;
    font-size: large;
    width: 100%;
    text-align: center;
}

.nav a {
    color: aliceblue;
    padding: 10px 20px;
    display: block;
}

.nav a:hover {
    color: aqua;
}

.banner {
    background-image: url(./banner.jpg);
    height: 400px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.banner-title {
    color: aliceblue;
    font-size: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.content {
    display: flex;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1200px; /* 限制最大宽度 */
    margin: 0 auto; /* 居中 */
}

/* 修改这里 - 全屏时一行四个 */
dl {
    flex: 0 0 calc(25% - 20px); /* 固定25%宽度，不拉伸 */
    min-width: 200px;
    margin: 0;
}

/* 关键修改 - 图片保持原始比例 */
dl img {
    width: 100%;
    height: auto; /* 高度自动，保持原始比例 */
    max-height: 150px; /* 限制最大高度 */
    object-fit: contain; /* 保持原始比例，不拉伸 */
    border-radius: 8px;
}

/* Footer 样式 */
footer {
    background-color: #333;
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 0 20px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: 30px;
    padding: 0 15px;
}

.footer-section h3 {
    color: #f8f8f8;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
}

.footer-section p, .footer-section a {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-section a:hover {
    color: aqua;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    color: white;
    font-size: 20px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: aqua;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    margin-top: 20px;
    color: #999;
    font-size: 14px;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #333;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 20px;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    opacity: 1;
    background-color: #555;
}

/* 响应式设计 - 关键修改 */
@media (min-width: 1200px) {
    /* 在大屏幕上保持四列 */
    dl {
        flex: 0 0 calc(25% - 20px); /* 固定25%宽度 */
        max-width: calc(25% - 20px);
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    /* 在中等屏幕上保持两列 */
    dl {
        flex: 0 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    header {
        height: 80px;
        justify-content: center;
    }
    
    header img {
        max-height: 60px;
    }
    
    .nav ul {
        flex-direction: column;
        height: auto;
    }
    
    .nav ul li {
        width: 100%;
        border-bottom: 1px solid #555;
    }
    
    .nav a {
        padding: 15px;
    }
    
    .banner {
        height: 300px;
    }
    
    .banner-title {
        font-size: 28px;
        padding: 0 20px;
    }
    
    .content {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    /* 在小屏幕上变为单列 */
    dl {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    header {
        height: 60px;
    }
    
    header img {
        max-height: 40px;
    }
    
    .banner {
        height: 200px;
    }
    
    .banner-title {
        font-size: 22px;
    }
    
    dl {
        width: 100%;
    }
}