/* 小吾的博客 · 现代简约风 v2（2025-2026）
   暖纸白画布 + 墨色文字 + 松绿点缀，封面区、渐变配图、彩色标签、信息页脚，
   层次更丰富、有设计感，手机优先。纯手写 CSS，不依赖 Bootstrap / Node 构建。 */

:root {
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --ink: #1B1B18;
    --muted: #6E6C64;
    --accent: #1E6B4F;
    --accent-soft: #E8F0EB;
    --accent-deep: #14503B;
    --border: #E8E6DE;
    --radius: 18px;
    --shadow: 0 2px 12px rgba(27, 27, 24, 0.06);
    --shadow-lg: 0 10px 28px rgba(20, 80, 59, 0.16);
    /* 分类 / 标签配色：松绿、陶土、琥珀、青蓝、梅紫 */
    --c1: #1E6B4F;
    --c2: #C25E3E;
    --c3: #D9A441;
    --c4: #2F7D8C;
    --c5: #7A5C8E;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-size: 17px;
    line-height: 1.75;
}

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

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 顶栏 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(250, 250, 247, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-avatar { width: 36px; height: 36px; border-radius: 10px; display: block; }

.nav-toggle {
    margin-left: auto;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 15px;
    cursor: pointer;
}

.site-nav { display: none; }
.site-nav.open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 12px;
}
.site-nav a {
    color: var(--ink);
    font-size: 16px;
    padding: 10px 4px;
    border-top: 1px solid var(--border);
}

/* ---------- 搜索 ---------- */
.search-row { padding: 0 20px 12px; }
.search { position: relative; }
.search input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    padding: 0 18px;
    font-size: 16px;
    color: var(--ink);
    outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: 52px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.search-count {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.search-item {
    display: block;
    padding: 12px 16px;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover { background: var(--accent-soft); text-decoration: none; }
.search-item-title { font-weight: 700; font-size: 16px; }
.search-item-meta { font-size: 13px; color: var(--muted); }
.search-empty { padding: 16px; color: var(--muted); font-size: 15px; }

/* ---------- 首页封面区 ---------- */
.hero { padding: 24px 0 8px; }
.hero-cover {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 30px 24px 26px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.22) 0 6px, transparent 7px),
        radial-gradient(circle at 72% 78%, rgba(255, 255, 255, 0.14) 0 4px, transparent 5px),
        radial-gradient(circle at 12% 88%, rgba(255, 255, 255, 0.12) 0 8px, transparent 9px),
        linear-gradient(135deg, #2A7D5E 0%, #1E6B4F 46%, #14503B 100%);
    box-shadow: var(--shadow-lg);
}
.hero-cover::after {
    content: "吾";
    position: absolute;
    right: -14px;
    bottom: -58px;
    font-size: 180px;
    line-height: 1;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.hero-cover h1 { font-size: 32px; line-height: 1.3; margin: 0 0 8px; letter-spacing: 0.02em; }
.hero-cover p { margin: 0; color: rgba(255, 255, 255, 0.88); font-size: 16px; max-width: 34em; }
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}
.hero-stats span {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
}
.hero-stats b { font-weight: 800; }

/* ---------- 栏目小标题 ---------- */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 32px 0 4px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ink);
}
.section-head h2 { font-size: 20px; margin: 0; }
.section-head span { font-size: 13px; color: var(--muted); }

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
    overflow: hidden;
}
.post-card h2 { font-size: 21px; line-height: 1.45; margin: 0 0 6px; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--accent); }
.post-card-body { padding: 18px 22px 18px; }

/* 文章配图占位：纯 CSS 渐变封面，每篇按序号轮换 5 套配色 */
.post-cover {
    position: relative;
    height: 132px;
    overflow: hidden;
}
.post-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1.5px, transparent 1.6px);
    background-size: 18px 18px;
    opacity: 0.5;
}
.post-cover::after {
    content: "吾";
    position: absolute;
    right: 10px;
    bottom: -42px;
    font-size: 120px;
    line-height: 1;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.18);
}
.post-cover.cover-0 { background: linear-gradient(135deg, #2A7D5E, #14503B); }
.post-cover.cover-1 { background: linear-gradient(135deg, #D97B54, #A44A2A); }
.post-cover.cover-2 { background: linear-gradient(135deg, #E0B45C, #B07E1E); }
.post-cover.cover-3 { background: linear-gradient(135deg, #4A9AA8, #1F5E6B); }
.post-cover.cover-4 { background: linear-gradient(135deg, #8E6FA8, #5B3E73); }
.post-cover-cat {
    position: absolute;
    left: 16px;
    bottom: 12px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 700;
}
.post-date { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.post-excerpt { margin: 0 0 12px; color: #3A3A33; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag-list a {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 13px;
}
.tag-list a:hover { text-decoration: none; background: var(--accent); color: #fff; }
/* 标签按序号轮换 5 种配色 */
.tag-list li:nth-child(5n+2) a { background: #FBEFE9; color: #A44A2A; }
.tag-list li:nth-child(5n+2) a:hover { background: #C25E3E; color: #fff; }
.tag-list li:nth-child(5n+3) a { background: #FBF3DC; color: #8A6510; }
.tag-list li:nth-child(5n+3) a:hover { background: #D9A441; color: #fff; }
.tag-list li:nth-child(5n+4) a { background: #E4F1F3; color: #1F5E6B; }
.tag-list li:nth-child(5n+4) a:hover { background: #2F7D8C; color: #fff; }
.tag-list li:nth-child(5n+5) a { background: #F1EAF6; color: #5B3E73; }
.tag-list li:nth-child(5n+5) a:hover { background: #7A5C8E; color: #fff; }

/* ---------- 文章页 ---------- */
.article-cover {
    position: relative;
    overflow: hidden;
    height: 148px;
    margin-top: 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22) 0 6px, transparent 7px),
        radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.12) 0 8px, transparent 9px),
        linear-gradient(135deg, #2A7D5E 0%, #1E6B4F 50%, #14503B 100%);
    box-shadow: var(--shadow-lg);
}
.article-cover::after {
    content: "吾";
    position: absolute;
    right: 6px;
    bottom: -52px;
    font-size: 150px;
    line-height: 1;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
}
.article-cover-cat {
    position: absolute;
    left: 18px;
    bottom: 14px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 700;
}
.article { padding: 28px 0 8px; }
.article h1 { font-size: 27px; line-height: 1.4; margin: 0 0 8px; }
.article h2 { font-size: 21px; margin: 28px 0 10px; padding-top: 4px; }
.article h3 { font-size: 18px; margin: 24px 0 8px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { margin-bottom: 6px; }
.article blockquote {
    margin: 0 0 16px;
    padding: 12px 18px;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    color: #2E4A3E;
}
.article img { max-width: 100%; height: auto; border-radius: 12px; }
.article pre {
    background: #23241F;
    color: #F2F2EC;
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article p code {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 0.9em;
}
.article-meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.post-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 28px 0 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.post-nav a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--ink);
}
.post-nav a:hover { text-decoration: none; border-color: var(--accent); }
.post-nav small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- 归档 / 分类 / 标签 ---------- */
.page-head { padding: 28px 0 4px; }
.page-head h1, .page-head h2 { font-size: 26px; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; }
.archive-month { font-size: 18px; margin: 26px 0 8px; color: var(--accent); }
.archive-item {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 11px 4px;
    border-bottom: 1px solid var(--border);
}
.archive-item time { flex: none; font-size: 13px; color: var(--muted); }
.archive-item a { color: var(--ink); font-weight: 600; }
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.chip-list a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    color: var(--ink);
    font-size: 15px;
}
.chip-list a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.chip-list small { color: var(--muted); }

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 8px;
}
.pager a {
    flex: 1;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 11px 10px;
    color: var(--ink);
    font-size: 15px;
}
.pager a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.pager .pager-empty { flex: 1; }

/* ---------- 页脚 ---------- */
.site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--border);
    background: #F1EFE8;
    color: var(--muted);
    font-size: 14px;
}
.footer-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 20px 8px;
    max-width: 760px;
    margin: 0 auto;
}
.footer-grid h3 { font-size: 15px; color: var(--ink); margin: 0 0 8px; }
.footer-grid p { margin: 0 0 8px; line-height: 1.7; }
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--ink); }
.footer-grid a:hover { color: var(--accent); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand img { width: 36px; height: 36px; border-radius: 10px; display: block; }
.footer-brand span { font-size: 17px; font-weight: 800; color: var(--ink); }
.footer-bottom {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 16px 20px 28px;
}
.footer-bottom p { margin: 4px 0; }
.footer-sub { font-size: 13px; }

/* ---------- 桌面端 ---------- */
@media (min-width: 768px) {
    body { font-size: 18px; }
    .nav-toggle { display: none; }
    .site-nav {
        display: flex;
        gap: 4px;
        margin-left: auto;
        align-items: center;
    }
    .site-nav.open { flex-direction: row; padding: 0; }
    .site-nav a { border-top: 0; padding: 8px 12px; border-radius: 999px; }
    .site-nav a:hover { background: var(--accent-soft); text-decoration: none; color: var(--accent); }
    .hero { padding: 32px 0 12px; }
    .hero-cover { padding: 38px 32px 32px; }
    .hero-cover h1 { font-size: 38px; }
    .post-cover { height: 150px; }
    .footer-grid {
        flex-direction: row;
        gap: 32px;
        padding-top: 36px;
    }
    .footer-grid > div { flex: 1; }
    .post-nav { flex-direction: row; }
    .post-nav a { flex: 1; }
}
