@font-face {
    font-family: 'Zpix';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font@v3.1.11/website/zpix.woff2') format('woff2');
}

:root {
    --bg: #f6f5f3;
    --fg: #2c2c2c;
    --fg-sec: #555;
    --accent: #3d5a80;
    --line: #d8d5d0;
    --line-light: #e8e6e2;
    --font: 'Zpix', 'PingFang SC', 'Microsoft YaHei', cursive;
}

::selection { color: #fff; background: var(--accent); }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    line-height: 2;
    letter-spacing: 0.03em;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration-line: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover { text-decoration-color: var(--fg); color: var(--fg); }

/* ── Layout ── */
.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    min-height: 100vh;
}

/* ── Header ── */
.site-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid var(--line);
}
.site-header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    margin-bottom: 0.6rem;
}
.site-header .logo img {
    height: 36px;
    width: auto;
}
.site-header .logo .site-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: 0.08em;
}
.site-header .site-desc {
    font-size: 0.75rem;
    color: var(--fg-sec);
    margin-bottom: 0.8rem;
}
.site-nav {
    display: flex;
    gap: 1.2rem;
    font-size: 0.82rem;
}
.site-nav a {
    color: var(--fg-sec);
    text-decoration: none;
    transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active {
    color: var(--accent);
}

/* ── Post list ── */
.post-list { list-style: none; }
.post-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--line-light);
}
.post-item:last-child { border-bottom: none; }
.post-item .post-date {
    font-size: 0.72rem;
    color: var(--fg-sec);
    letter-spacing: 0.05em;
}
.post-item .post-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.1rem 0 0.2rem;
}
.post-item .post-title a {
    color: var(--fg);
    text-decoration: none;
}
.post-item .post-title a:hover {
    color: var(--accent);
}
.post-item .post-summary {
    font-size: 0.82rem;
    color: var(--fg-sec);
    line-height: 1.8;
}
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}
.post-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--fg-sec);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.post-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Single post ── */
.post-header {
    margin-bottom: 2rem;
}
.post-header .post-date {
    font-size: 0.75rem;
    color: var(--fg-sec);
    letter-spacing: 0.05em;
}
.post-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fg);
    margin: 0.3rem 0 0.5rem;
    line-height: 1.6;
}
.post-header .post-meta {
    font-size: 0.75rem;
    color: var(--fg-sec);
}

.post-content {
    font-size: 0.88rem;
    line-height: 2.2;
    color: var(--fg);
}
.post-content h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    margin: 2rem 0 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}
.post-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--fg);
    margin: 1.5rem 0 0.5rem;
}
.post-content p {
    margin-bottom: 1rem;
}
.post-content ul, .post-content ol {
    margin: 0.5rem 0 1rem 1.5rem;
}
.post-content li {
    margin-bottom: 0.3rem;
}
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(61,90,128,0.03);
    color: var(--fg-sec);
    font-size: 0.85rem;
}
.post-content pre {
    background: #2c2c2c;
    color: #e8e6e2;
    padding: 1rem;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 0.78rem;
    line-height: 1.7;
    margin: 1rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
}
.post-content p code, .post-content li code {
    background: var(--line-light);
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    font-size: 0.78rem;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid var(--line);
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.82rem;
}
.post-content th {
    background: rgba(61,90,128,0.06);
    color: var(--accent);
    font-weight: 700;
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid var(--line);
}
.post-content td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--line-light);
}
.post-content hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}

/* ── Post nav ── */
.post-nav {
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}
.post-nav a {
    color: var(--fg-sec);
    text-decoration: none;
    max-width: 45%;
}
.post-nav a:hover { color: var(--accent); }
.post-nav .label {
    font-size: 0.68rem;
    color: var(--fg-sec);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
}
.pagination a, .pagination span {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    text-decoration: none;
    color: var(--fg-sec);
    transition: border-color 0.2s, color 0.2s;
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination .active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Archives ── */
.archive-year {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent);
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--line);
}
.archive-list { list-style: none; }
.archive-list li {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}
.archive-list .date {
    font-size: 0.72rem;
    color: var(--fg-sec);
    flex-shrink: 0;
    width: 5rem;
}
.archive-list a {
    color: var(--fg);
    text-decoration: none;
}
.archive-list a:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.72rem;
    color: var(--fg-sec);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.site-footer a {
    color: var(--fg-sec);
    font-size: 0.72rem;
}
.site-footer a:hover { color: var(--fg); }

/* ── Mobile ── */
@media (max-width: 600px) {
    .page { padding: 2rem 1.2rem 1.5rem; }
    .site-header .logo img { height: 28px; }
    .site-nav { gap: 0.8rem; font-size: 0.75rem; }
    .post-header h1 { font-size: 1.1rem; }
    .post-content { font-size: 0.82rem; }
    .site-footer { flex-direction: column; gap: 0.3rem; }
}
