Files
sproutblog/public/css/app.css
2026-04-15 13:20:51 +08:00

279 lines
4.6 KiB
CSS

:root {
--page-max: 920px;
--page-pad-x: 24px;
--page-pad-y: 24px;
--page-gap: 24px;
--text: #111;
--muted: #555;
--line: #e8e8e8;
}
html {
margin: 0;
padding: 0;
background: #fff;
color: var(--text);
font-family: "FangSong", serif;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
}
body {
margin: 0;
padding: 0;
background: #fff;
color: var(--text);
font-family: "FangSong", serif;
line-height: 1.7;
overflow-x: hidden;
}
main {
width: min(100%, var(--page-max));
margin: 0 auto;
padding: var(--page-pad-y) var(--page-pad-x) 32px;
box-sizing: border-box;
}
.site-footer {
width: min(100%, var(--page-max));
margin: 0 auto;
padding: 20px var(--page-pad-x) 28px;
box-sizing: border-box;
border-top: 1px solid var(--line);
text-align: center;
font-size: 0.88rem;
color: var(--muted);
}
.site-footer p {
margin: 0;
line-height: 1.6;
}
header.site-header {
margin-bottom: var(--page-gap);
padding-bottom: 16px;
border-bottom: 1px solid var(--line);
}
.site-brand {
display: flex;
align-items: center;
gap: 12px;
}
.site-titles {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
min-width: 0;
}
.site-title-link {
text-decoration: none;
color: inherit;
font-weight: 700;
font-size: 1.25rem;
line-height: 1.2;
}
.site-title-en {
font-size: 0.82rem;
font-weight: 500;
color: var(--muted);
letter-spacing: 0.02em;
}
.site-logo {
flex-shrink: 0;
width: 40px;
height: 40px;
object-fit: contain;
cursor: pointer;
}
.admin-gate {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
padding: 16px;
box-sizing: border-box;
}
.admin-gate[hidden] {
display: none !important;
}
.admin-gate-panel {
background: #fff;
padding: 16px 18px;
border-radius: 6px;
border: 1px solid #ccc;
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
width: min(100%, 420px);
box-sizing: border-box;
}
.admin-gate-panel input[type="password"] {
width: 100%;
box-sizing: border-box;
min-width: 0;
}
h1,
h2,
h3 {
line-height: 1.3;
margin: 0 0 12px;
word-break: break-word;
}
article,
section {
margin: 0 0 24px;
}
p {
margin: 0 0 12px;
word-break: break-word;
}
a {
color: inherit;
}
input,
textarea,
button {
font: inherit;
max-width: 100%;
}
input[type="text"],
input[type="password"],
textarea {
width: 100%;
box-sizing: border-box;
min-width: 0;
}
textarea {
min-height: 320px;
resize: vertical;
}
pre {
white-space: pre-wrap;
word-break: break-word;
overflow-x: auto;
}
img {
max-width: 100%;
height: auto;
}
hr {
border: 0;
border-top: 1px solid #ddd;
margin: 24px 0;
}
.post-card {
padding-bottom: 16px;
border-bottom: 1px solid #efefef;
}
.post-card:last-of-type {
padding-bottom: 0;
border-bottom: 0;
}
.post-card .post-excerpt {
margin: 0 0 10px;
}
.post-card .post-meta {
font-size: 0.9em;
color: #555;
margin: 0 0 16px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 16px;
}
.post-detail-meta {
font-size: 0.95em;
color: #555;
margin: 0 0 16px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 16px;
}
.post-detail-views {
color: #666;
}
.post-comments {
margin-top: 36px;
padding-top: 28px;
border-top: 1px solid var(--line);
}
.post-comments__title {
font-size: 1.35rem;
margin: 0 0 16px;
}
form {
margin: 0;
}
@media (max-width: 1024px) {
:root {
--page-max: 840px;
--page-pad-x: 20px;
--page-pad-y: 20px;
--page-gap: 20px;
}
}
@media (max-width: 768px) {
:root {
--page-max: 100%;
--page-pad-x: 16px;
--page-pad-y: 16px;
--page-gap: 18px;
}
.site-logo {
width: 36px;
height: 36px;
}
.site-title-link {
font-size: 1.1rem;
}
.post-card .post-meta,
.post-detail-meta {
gap: 6px 12px;
}
}
@media (max-width: 480px) {
:root {
--page-pad-x: 14px;
--page-pad-y: 14px;
--page-gap: 16px;
}
body {
line-height: 1.68;
}
header.site-header {
padding-bottom: 12px;
}
textarea {
min-height: 240px;
}
.site-brand {
gap: 10px;
align-items: flex-start;
}
.site-logo {
width: 32px;
height: 32px;
}
.site-title-link {
font-size: 1rem;
}
.post-card .post-meta,
.post-detail-meta {
font-size: 0.82em;
flex-direction: row;
flex-wrap: wrap;
align-items: baseline;
gap: 4px 10px;
row-gap: 4px;
}
.post-card .post-meta span,
.post-detail-meta span {
white-space: nowrap;
}
.admin-gate-panel {
padding: 14px 14px;
}
}