/*
Theme Name: Bear CHZHC
Theme URI: https://chzhc.cn
Author: chzhc
Description: A minimal blog theme inspired by Bear Blog.
Version: 1.0
License: MIT
Text Domain: bear-chzhc
*/

:root {
    --bg: #fff;
    --heading: #222;
    --text: #444;
    --link: #3273dc;
    --link-visited: #8b6fcb;
    --code-bg: #f2f2f2;
    --border: #ddd;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #01242e;
        --heading: #eee;
        --text: #ddd;
        --link: #8cc2dd;
        --link-visited: #8b6fcb;
        --code-bg: #000;
        --border: #333;
    }
}

* { box-sizing: border-box; }

body {
    font-family: 'Kalam', Verdana, sans-serif;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 16px;
}

/* Notes: LaTeX-style Latin Modern Roman */
body.category-note,
.category-note main {
    font-family: 'Latin Modern Roman', 'Computer Modern', serif;
    line-height: 1.65;
    font-size: 17px;
}
.category-note pre,
.category-note code {
    font-family: monospace;
}
.category-note .post-list time,
.category-note .post-meta,
.category-note .timeline-label {
    font-family: monospace;
}

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

h1, h2, h3, h4, h5, h6 { color: var(--heading); line-height: 1.3; }
h1 { font-size: 1.5em; }
h2 { font-size: 1.3em; }
h3 { font-size: 1.1em; }

.site-header { margin-bottom: 2em; }
.site-title { font-size: 1.5em; margin: 0 0 0.3em 0; }
.site-title a { color: var(--heading); text-decoration: none; }
.site-title a:visited { color: var(--heading); }
nav a { margin-right: 8px; font-size: 0.9em; }

main { line-height: 1.6; }

.post-list { list-style: none; padding: 0; }
.post-list li { display: flex; align-items: baseline; margin-bottom: 0.4em; }
.post-list time {
    font-family: monospace; font-size: 15px;
    color: var(--text); opacity: 0.6;
    flex-shrink: 0; width: 130px;
}
.post-list a { flex: 1; }

.post-meta {
    font-family: monospace; font-size: 14px;
    color: var(--text); opacity: 0.6;
    margin-bottom: 1.5em;
}

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

pre, code {
    background: var(--code-bg); color: var(--heading);
    padding: 1px 5px; border-radius: 3px; font-size: 0.9em;
}
pre { padding: 12px 15px; overflow-x: auto; }
pre code { padding: 0; }

blockquote {
    border-left: 1px solid #999; padding-left: 20px;
    margin-left: 0; font-style: italic; color: var(--heading);
}

hr { border: none; border-top: 1px dashed var(--border); margin: 2em 0; }

.site-footer {
    margin-top: 3em; padding: 25px 0;
    text-align: center; font-size: 0.85em;
}
.site-footer a { margin: 0 4px; }

.wp-block-group { display: contents; }
.wp-block-list { padding-left: 1.5em; }

table { border-collapse: collapse; width: 100%; margin: 1em 0; }
th, td { border: 1px solid var(--border); padding: 8px; text-align: left; }

/* KaTeX math display */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.5em 0; }
.katex { font-size: 1.05em; }

/* Timeline ruler navigation */
.timeline {
    position: relative;
    margin: 2em 0;
    padding: 1.5em 0 0.5em;
}
.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
}
.timeline-nodes {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}
.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    text-decoration: none;
    color: var(--text);
    opacity: 0.5;
    transition: opacity 0.2s;
}
.timeline-node:hover {
    opacity: 0.8;
}
.timeline-node.active {
    opacity: 1;
}
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--text);
    background: var(--bg);
    transition: all 0.2s;
}
.timeline-node.active .timeline-dot {
    width: 14px;
    height: 14px;
    background: var(--link);
    border-color: var(--link);
}
.timeline-label {
    font-size: 0.85em;
    font-family: monospace;
}
.timeline-node.active .timeline-label {
    font-weight: bold;
}

/* About section on homepage */
.about-section {
    text-align: center;
    margin-bottom: 2em;
}
.about-section h2 {
    margin-top: 1em;
}
.about-section p {
    margin: 0.3em 0;
}
.ucup-cred {
    color: #fff;
    user-select: all;
}
@media (prefers-color-scheme: dark) {
    .ucup-cred {
        color: #fff;
    }
}
