@charset "utf-8";

/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Clearfix */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Set up the fonts */
body {
    font-family: Verdana, sans-serif;
    background-color: #fff;
}

h1, h2, h3, h4 {
    font-family: Georgia, serif;
}

/* Style a few links */
.box a {
    color: #212020;
    text-decoration: none;
}

.box a:hover {
    text-decoration: underline;
}

/* Position the content */
.wrapper {
    margin: 0 auto;
    width: 960px;
}

/* Style the header and footer */
#footer, #header {
    float: left;
    clear: both;
    padding: 10px;
    text-align: center;
    width: 100%;
}

/* Create the floating boxes */
#main-content {
    float: left;
    width: 100%;
}

.box {
    float: left;
    margin: 6px;
    padding: 10px;
    width: 285px;
    height: 480px;
    border: 1px solid black;
    background-color: white;
    overflow: hidden; /* 防止内容溢出 */
}

/* Style the box content */
.box img {
    width: 100%; /* 使用百分比宽度，自适应容器 */
    max-width: 260px; /* 留一些空间，285 - 20 - 5 = 260 */
    height: auto;
    display: block;
    margin: 0 auto;
}

.box h3, .box p {
    text-align: center;
}

#content {
    float: left;
    width: 100%;
    background-color: #F0ECEC;
}

/* Media Queries */
@media screen and (max-width: 960px) {
    .wrapper {
        width: 640px;
    }
}

@media screen and (max-width: 640px) {
    .wrapper {
        width: 320px;
    }
    
    h1, h2, h3, h4, p {
        word-wrap: break-word;
    }
    
    #header {
        padding: 0;
    }
}