Files
haopengzhan f52b3fe9e4 feat(migration): complete WordPress migration and UX refinements
- Migrate historical posts, localized assets, and 103 comments
- Colocate media into posts/<slug>/images/ and remove wp-content
- Add native bilingual support for ai-can-change post (English default, /zh variant)
- Support clean taxonomy routing (/category/:category and /tag/:tag)
- Dynamically populate categories and tags in sitemap.xml
- Fix header scroll padding/margin offsets for anchor and reference links
- Constrain image and media widths to prevent content overflow
- Redesign homepage recent posts to 4 compact editorial cards
- Restore valid binary favicon.ico and high-res icon assets
- Remove placeholder content and sample test comments
2026-09-16 23:09:09 -07:00

412 lines
7.8 KiB
CSS

:root {
--color-bg: #f9f9f9;
--color-surface: #ffffff;
--color-surface-soft: #f4f4f5;
--color-text-main: #111111;
--color-text-secondary: #4b5563;
--color-text-muted: #6b7280;
--color-border: #e5e7eb;
--color-border-hover: #d1d5db;
--color-accent: #111111;
--color-mark-bg: #fef08a;
--color-mark-text: #111111;
--font-serif: 'Cardo', 'Iowan Old Style', 'Palatino Linotype', 'Songti SC', 'STSong', Georgia, serif;
--font-mono: 'Maple Mono NF CN', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
--max-width: 1180px;
--content-width: 820px;
--header-height: 64px;
--radius-sm: 6px;
--radius-md: 12px;
--radius-lg: 20px;
--radius-full: 9999px;
--transition-fast: 0.15s ease;
--transition-normal: 0.25s ease;
}
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 16px;
scroll-behavior: smooth;
scroll-padding-top: calc(var(--header-height) + 1.5rem);
-webkit-text-size-adjust: 100%;
}
/* Ensure hash navigation (#) and footnotes never hide under sticky header */
:target,
[id],
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id],
.footnote-ref,
.footnote-item,
li[id^="fn"] {
scroll-margin-top: calc(var(--header-height) + 1.5rem);
}
/* Responsive media constraint - never wider than parent container */
img, video, iframe, embed, object {
max-width: 100%;
height: auto;
}
body {
font-family: var(--font-serif);
color: var(--color-text-main);
background-color: var(--color-bg);
line-height: 1.8;
letter-spacing: 0.01em;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.container {
width: 100%;
max-width: var(--max-width);
margin: 0 auto;
padding: 0 2rem;
}
.content-container {
width: 100%;
max-width: var(--content-width);
margin: 0 auto;
}
/* Header */
.site-header {
position: sticky;
top: 0;
z-index: 100;
background: rgba(249, 249, 249, 0.95);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
height: var(--header-height);
display: flex;
align-items: center;
}
.header-inner {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.brand {
text-decoration: none;
color: var(--color-text-main);
}
.brand-title {
font-size: 1.55rem;
font-family: var(--font-serif);
font-weight: 700;
letter-spacing: -0.01em;
}
.site-nav {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
text-decoration: none;
font-family: var(--font-serif);
font-size: 1.05rem;
color: var(--color-text-main);
transition: opacity var(--transition-fast);
padding: 0.25rem 0;
}
.nav-link:hover {
opacity: 0.65;
}
.nav-link.active {
text-decoration: underline;
text-underline-offset: 4px;
}
/* Mobile Hamburger Menu Toggle */
.mobile-menu-toggle {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
flex-direction: column;
justify-content: center;
gap: 5px;
width: 40px;
height: 40px;
}
.hamburger-line {
display: block;
width: 22px;
height: 2px;
background-color: var(--color-text-main);
border-radius: 2px;
transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
opacity: 0;
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
transform: translateY(-7px) rotate(-45deg);
}
/* Mobile Slide-Down Navigation Drawer */
.mobile-nav-drawer {
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
background: var(--color-bg);
border-bottom: 1px solid var(--color-border);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
padding: 0.75rem 1.25rem 1.25rem;
z-index: 999;
}
.mobile-nav-drawer.is-open {
display: block;
animation: slideDown 0.25s ease;
}
@keyframes slideDown {
from { opacity: 0; transform: translateY(-8px); }
to { opacity: 1; transform: translateY(0); }
}
.mobile-nav-links {
display: flex;
flex-direction: column;
}
.mobile-nav-link {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.85rem 0.5rem;
text-decoration: none;
color: var(--color-text-main);
font-family: var(--font-serif);
font-size: 1.15rem;
border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.05));
transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.mobile-nav-link:last-child {
border-bottom: none;
}
.mobile-nav-link:hover, .mobile-nav-link:active {
color: var(--color-accent);
padding-left: 0.75rem;
}
.mobile-nav-link.active {
font-weight: 600;
color: var(--color-accent);
}
.mobile-nav-arrow {
font-size: 1rem;
opacity: 0.4;
}
/* Main Content area */
.site-main {
flex: 1;
padding: 2.5rem 0 4rem;
}
/* Footer */
.site-footer {
border-top: 1px solid var(--color-border);
background-color: var(--color-surface);
padding: 2.5rem 0;
font-family: var(--font-sans);
font-size: 0.88rem;
color: var(--color-text-muted);
}
.footer-inner {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1.5rem;
}
.social-links {
display: flex;
gap: 1.25rem;
align-items: center;
}
.social-link {
color: var(--color-text-secondary);
display: flex;
align-items: center;
justify-content: center;
transition: color var(--transition-fast), transform var(--transition-fast);
}
.social-link:hover {
color: var(--color-text-main);
transform: translateY(-2px);
}
.social-link svg {
width: 19px;
height: 19px;
fill: currentColor;
}
/* Headings & Typography */
h1, h2, h3, h4, h5, h6 {
color: var(--color-text-main);
line-height: 1.35;
margin-bottom: 1rem;
font-weight: 700;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.65rem; margin-top: 2rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; }
p {
margin-bottom: 1.25rem;
}
a {
color: var(--color-accent);
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 3px;
transition: color var(--transition-fast);
}
a:hover {
color: #000000;
}
mark {
background-color: var(--color-mark-bg);
color: var(--color-mark-text);
padding: 0.1em 0.25em;
border-radius: 3px;
font-weight: 500;
}
blockquote {
border-left: 3px solid var(--color-border-hover);
padding: 0.5rem 0 0.5rem 1.25rem;
margin: 1.5rem 0;
color: var(--color-text-secondary);
font-style: italic;
}
hr {
border: 0;
height: 1px;
background: var(--color-border);
margin: 2.5rem 0;
}
/* Responsive */
@media (max-width: 768px) {
:root {
--header-height: 64px;
--content-padding: 1.25rem;
}
.site-header {
position: sticky;
top: 0;
z-index: 990;
}
/* Hide inline desktop nav and show hamburger */
.site-nav.desktop-nav {
display: none;
}
.mobile-menu-toggle {
display: flex;
}
.brand-title {
font-size: 1.25rem;
}
.brand-tagline {
font-size: 0.68rem;
display: block;
margin-top: 0.1rem;
opacity: 0.85;
}
/* Centered, balanced editorial mobile footer */
.site-footer {
padding: 2.5rem 1.25rem 3rem;
}
.footer-inner {
flex-direction: column;
align-items: center;
text-align: center;
gap: 1.4rem;
}
.footer-left {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.45rem;
}
.footer-tagline {
font-family: var(--font-serif);
font-size: 1.05rem;
color: var(--color-text-main);
}
.footer-copyright {
font-size: 0.82rem;
color: var(--color-text-muted);
}
.social-links {
justify-content: center;
gap: 1.5rem;
}
.social-link {
display: flex;
align-items: center;
justify-content: center;
min-width: 44px;
min-height: 44px;
}
}