body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
}

/* 多列布局核心代码 */
.adaptive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.adaptive-grid > div {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
}


/* 色块 */
.color-blocks > div {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}


/* 文本 */
.text-blocks > div {
    background-color: #f9f9f9;
}

.text-blocks h3 {
    margin-top: 0;
}


/* 图片 */
.image-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}


/* 这是一个媒体查询规则，用于定义在屏幕宽度小于或等于 400px 时应该应用的样式。典型场景：针对小屏设备（如手机）的布局优化。 */
@media (max-width: 400px) {
    .adaptive-grid {                    /* .adaptive-grid 的布局在窄屏设备上变为单列布局 */
        grid-template-columns: 1fr;     /* 表示此时只有一列，宽度占用整个可用空间 */
    }
}

