/* =========================================
   静思小栈 — Personal Blog
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #fafaf9;
    --color-surface: #ffffff;
    --color-text: #292524;
    --color-text-secondary: #78716c;
    --color-text-tertiary: #a8a29e;
    --color-border: #e7e5e4;
    --color-primary: #1c1917;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-code-bg: #f5f5f4;
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --max-width: 720px;
    --radius: 8px;
}

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.75;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

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

.logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo:hover {
    opacity: 0.7;
}

.site-nav {
    display: flex;
    gap: 2rem;
}

.site-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--color-primary);
}

/* --- Main --- */
.site-main {
    flex: 1;
    padding: 3rem 0 5rem;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
}

/* --- Post Cards --- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.post-card:hover {
    border-color: #d6d3d1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.post-category {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent);
    background: #eff6ff;
    padding: 0.15rem 0.65rem;
    border-radius: 100px;
}

.post-date {
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.post-card-title a:hover {
    color: var(--color-accent);
}

.post-card-summary {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.65;
}

.post-card-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.post-card-link:hover {
    color: var(--color-accent-hover);
}

/* --- Single Post --- */
.single-post {
    padding-top: 1.5rem;
}

.single-post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.single-post-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-top: 0.5rem;
}

.single-post-content {
    font-size: 1rem;
    line-height: 1.85;
}

.single-post-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border);
}

.single-post-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
}

.single-post-content p {
    margin-bottom: 1.25rem;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.single-post-content li {
    margin-bottom: 0.4rem;
}

.single-post-content strong {
    font-weight: 600;
}

.single-post-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: #d97706;
}

.single-post-content pre {
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.single-post-content pre code {
    background: none;
    padding: 0;
    color: var(--color-text);
    font-size: 0.85rem;
}

.single-post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.single-post-content a:hover {
    color: var(--color-accent-hover);
}

/* --- About Page --- */
.about-page {
    padding-top: 1.5rem;
}

.about-page h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.about-page h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.about-content p {
    margin-bottom: 1rem;
    line-height: 1.85;
}

.about-content ul {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.about-content li {
    margin-bottom: 0.4rem;
    line-height: 1.75;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    text-align: center;
}

.site-footer p {
    color: var(--color-text-tertiary);
    font-size: 0.85rem;
    line-height: 1.8;
}

.beian {
    margin-top: 0.25rem;
}

.beian a {
    color: var(--color-text-tertiary);
    text-decoration: none;
    transition: color 0.15s;
}

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

.site-footer p:has(.beian) {
    margin-top: 0;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .post-card {
        padding: 1.25rem 1.25rem;
    }

    .post-card-title {
        font-size: 1.1rem;
    }

    .single-post-header h1 {
        font-size: 1.5rem;
    }

    .single-post-content pre {
        padding: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}
