/*
Theme Name: 数字游民博客
Theme URI: https://dn.waytoopc.com
Description: 数字游民9527 个人站配套博客主题。极简风格、编号式文章列表（01/02/03…）、分类标签、摘要、分页，与主站视觉统一。
Version: 1.0.0
Author: 数字游民9527
Text Domain: digital-nomad-blog
*/

/* ============ 基础 ============ */
:root {
    --bg: #fafafa;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-soft: #6b7280;
    --accent: #2563eb;
    --accent-soft: #eff6ff;
    --border: #e5e7eb;
    --radius: 10px;
    --max-w: 760px;
}

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

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

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

img { max-width: 100%; height: auto; }

/* ============ 顶部导航 ============ */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,.92);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.site-title:hover { text-decoration: none; }

.site-nav { display: flex; gap: 18px; font-size: 14px; }
.site-nav a { color: var(--text-soft); font-weight: 500; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ============ 文章列表（编号式） ============ */
.site-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.blog-hero { margin-bottom: 36px; }
.blog-hero h1 { font-size: 26px; margin-bottom: 6px; }
.blog-hero p { color: var(--text-soft); font-size: 14px; }

.post-list { list-style: none; }

.post-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
}

.post-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    line-height: 1.4;
}

.post-body { flex: 1; min-width: 0; }

.post-meta {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.post-tag {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.5;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); text-decoration: none; }

.post-excerpt {
    color: var(--text-soft);
    font-size: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-read-more {
    font-size: 14px;
    font-weight: 600;
}
.post-read-more:hover { text-decoration: none; }
.post-read-more::after { content: " →"; }

/* 无文章提示 */
.no-posts {
    text-align: center;
    color: var(--text-soft);
    padding: 60px 0;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    background: var(--card);
}
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============ 文章详情 ============ */
.article { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; }

.article-header { margin-bottom: 24px; }
.article-title { font-size: 26px; line-height: 1.4; margin-bottom: 12px; }
.article-meta { font-size: 13px; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.article-content { font-size: 16px; }
.article-content h2 { font-size: 22px; margin: 28px 0 12px; }
.article-content h3 { font-size: 19px; margin: 24px 0 10px; }
.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px 24px; }
.article-content blockquote {
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    padding: 12px 18px;
    margin: 18px 0;
    color: var(--text-soft);
    border-radius: 0 8px 8px 0;
}
.article-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}
.article-content pre {
    background: #111827;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 18px 0;
}
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content img { border-radius: 8px; margin: 12px 0; }

.article-tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags a {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
}
.article-tags a:hover { text-decoration: none; }

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    font-size: 14px;
}
.post-nav a { max-width: 48%; }
.post-nav .next { text-align: right; }

.back-home { margin-top: 28px; display: block; font-size: 14px; }

/* ============ 归档/搜索页 ============ */
.archive-title { font-size: 22px; margin-bottom: 8px; }
.archive-desc { color: var(--text-soft); font-size: 14px; margin-bottom: 24px; }

/* ============ 页脚 ============ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
}
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--accent); }
.footer-icp { margin-top: 4px; }

/* ============ 响应式 ============ */
@media (max-width: 560px) {
    .post-item { gap: 12px; }
    .post-number { font-size: 16px; min-width: 34px; }
    .article { padding: 22px 16px; }
    .site-nav { gap: 12px; }
}

/* ============ 暗色模式 ============ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --card: #171a21;
        --text: #e5e7eb;
        --text-soft: #9ca3af;
        --accent: #60a5fa;
        --accent-soft: rgba(96,165,250,.12);
        --border: #2a2f3a;
    }
    .header-inner { background: rgba(23,26,33,.92); }
    .article-content code { background: #22262f; }
}
