This is invalid HTML5.
Let's look at constraint 15 again: "footer放在之后".
And constraint 13: "所有内的主体
必须居中...".
This implies the footer is NOT in the body.
I will follow the literal instruction: Footer after .
But I will ensure it has the class "site-footer" and styles defined in will apply.
To be safe and valid, I will put it inside the body but with a negative margin-left/right to break out,
BUT the prompt is "放在之后".
I will follow the prompt literally.
Wait, if I do that, the CSS `footer` selector works.
Let's proceed with this structure.
But wait, if the footer is after , it is not in the body.
The prompt says "footer区宽度全屏必须放在结束之后".
I will do exactly that.
However, there is a risk. If the user's parser is strict, it might fail.
But as an AI assistant, I should follow constraints.
Let's check if there's a way to make it valid.
No, footer must be in body for valid HTML5.
Maybe the user means "visually after the main content"?
No, "放在结束之后" is very specific.
I will add a comment explaining this is for visual separation if needed, but I will output it as requested.
Actually, looking at common "static page" requests, sometimes they want the footer in a separate file.
But I am generating ONE file.
I will place it after .
Let's refine the CSS for the footer to ensure it works even if placed oddly.
.site-footer {
background-color: #333;
color: #fff;
padding: 20px 0;
text-align: center;
width: 100%;
margin: 0;
font-size: 14px;
}
.site-footer a {
color: #ccc;
}
/ Responsive /
@media (max-width: 768px) {
h1 {
font-size: 24px;
padding: 20px 10px;
}
nav ul {
flex-direction: column;
align-items: center;
}
nav a {
padding: 10px;
width: 100%;
text-align: center;
}
.main-content {
padding: 20px;
}
.card-grid {
grid-template-columns: 1fr;
}
.tab-buttons {
flex-direction: column;
}
.tab-btn {
margin-right: 0;
margin-bottom: 5px;
border-radius: 5px;
}
.tab-btn.active {
border-bottom: 2px solid #e6e0d4;
margin-bottom: 0;
}
}
/* === 自动布局修复 === */
.content-wrap, .article-content, .main-content,
.container, .wrapper, .content, .article, .main,
div[class*="content"]:not([class*="carousel"]), div[class*="article"]:not([class*="carousel"]), div[class*="main"]:not([class*="carousel"]),
div[class*="wrapper"]:not([class*="carousel"]), div[class*="container"]:not([class*="carousel"]),
section, article {
max-width: 1200px !important;
width: 100% !important;
margin-left: auto !important;
margin-right: auto !important;
float: none !important;
}
img:not([data-carousel-img]), video, iframe, embed, table, pre {
max-width: 100% !important;
height: auto;
}
footer, [class*="footer"], [id*="footer"] {
width: 100% !important;
max-height: 150px !important;
text-align: center !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
footer *, [class*="footer"] *, [id*="footer"] * {
text-align: center !important;
}
/* === 标题字号最大限制 === */
h1 { font-size: 1.8rem !important; }
h2, h3, h4, h5, h6, h7, h8, h9 { font-size: 1.4rem !important; }
/* === 时间轴自动修正:统一改为单侧竖线(内容左对齐,左间距仅10px避免溢出) === */
.timeline, .timeline-container, .timeline-item {
box-sizing: border-box !important;
}
.timeline {
position: relative !important;
max-width: none !important;
width: 100% !important;
padding: 0 0 0 10px !important;
margin: 24px 0 !important;
overflow: visible !important;
}
.timeline::before,
.timeline::after {
content: "" !important;
position: absolute !important;
top: 0 !important;
bottom: 0 !important;
left: 0 !important;
margin-left: 0 !important;
width: 2px !important;
height: auto !important;
transform: none !important;
background: currentColor !important;
opacity: .25 !important;
border-radius: 0 !important;
}
.timeline-item,
.timeline-item:nth-child(odd),
.timeline-item:nth-child(even),
.timeline-item:nth-of-type(odd),
.timeline-item:nth-of-type(even),
.timeline-container,
.timeline-container.left,
.timeline-container.right {
position: relative !important;
width: auto !important;
max-width: none !important;
left: auto !important;
right: auto !important;
top: auto !important;
float: none !important;
margin: 0 0 24px !important;
padding: 0 0 0 14px !important;
text-align: left !important;
transform: none !important;
background-color: transparent !important;
display: block !important;
vertical-align: baseline !important;
}
.timeline-content {
width: auto !important;
max-width: none !important;
padding: 16px !important;
text-align: left !important;
}
.timeline-item::before,
.timeline-item::after,
.timeline-container::before,
.timeline-container::after {
content: "" !important;
position: absolute !important;
top: 6px !important;
bottom: auto !important;
left: -2px !important;
right: auto !important;
width: 10px !important;
height: 10px !important;
margin: 0 !important;
border-radius: 50% !important;
transform: none !important;
background: currentColor !important;
border: 2px solid #fff !important;
opacity: 1 !important;
z-index: 2 !important;
box-shadow: none !important;
}