:root {
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #2c3444;
    --muted: #6b7684;
    --accent: #2563eb;
    --border: #e5e9f0;
    --code-bg: #f0f2f5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 24px;
}

.site-nav a {
    color: var(--muted);
    font-size: 15px;
}

.site-nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* 首页 Hero */
.hero {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #ffffff;
    padding: 72px 0 64px;
    text-align: center;
}

.hero h1 {
    font-size: 38px;
    letter-spacing: 2px;
}

.hero-sub {
    margin-top: 14px;
    font-size: 18px;
    color: #cbd5e1;
}

.hero-note {
    margin-top: 20px;
    font-size: 14px;
    color: #94a3b8;
}

/* 通用区块与文章卡片 */
.section {
    padding: 44px 0 30px;
}

.section-title {
    font-size: 22px;
    margin-bottom: 22px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 18px;
    transition: box-shadow 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.post-card time,
.article .meta {
    font-size: 13px;
    color: var(--muted);
}

.post-card h3 {
    margin-top: 6px;
    font-size: 18px;
}

.post-card p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 15px;
}

/* 文章页 */
.article {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 42px;
    margin: 36px auto 56px;
}

.article h1 {
    font-size: 28px;
    line-height: 1.4;
}

.article h2 {
    font-size: 21px;
    margin-top: 30px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.article p,
.article ul,
.article ol {
    margin-top: 14px;
}

.article ul,
.article ol {
    padding-left: 24px;
}

.article pre {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.6;
}

.article code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
}

.article pre code {
    background: none;
    padding: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 14px;
}

/* 页脚 */
.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    padding: 26px 0 30px;
    text-align: center;
}

.footer-inner p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 14px;
}

.beian-line a {
    color: var(--muted);
}

.beian-line a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* 移动端 */
@media (max-width: 640px) {
    .hero {
        padding: 52px 0 46px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .article {
        padding: 26px 20px;
        margin: 20px auto 40px;
    }

    .site-nav {
        gap: 14px;
    }
}
