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

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #2b6cb0;
    --accent-hover: #1a4f8b;
    --border: #e8e8e8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --max-width: 720px;
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
                 Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo:hover {
    color: var(--accent);
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

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

/* ===== Main ===== */
.main {
    flex: 1;
    padding: 2.5rem 0;
}

/* ===== Article List (Home) ===== */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

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

.post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.post-tag {
    display: inline-block;
    background: #edf2f7;
    color: var(--accent);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Article Detail ===== */
.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
}

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

.article-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.article-content {
    font-size: 1rem;
    line-height: 2;
    color: var(--text);
}

.article-content h2 {
    font-size: 1.35rem;
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.article-content h3 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}

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

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

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

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    background: #f7fafc;
    color: var(--text-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-content code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.article-content pre {
    background: #f6f8fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
}

.article-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
}

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

.article-back {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.5rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.article-back:hover {
    background: var(--bg);
    color: var(--accent);
    border-color: var(--accent);
}

/* ===== About Page ===== */
.about {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
}

.about-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
}

.about h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.about .bio {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-section {
    margin-top: 2rem;
}

.about-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.about-section ul {
    list-style: none;
    padding: 0;
}

.about-section li {
    padding: 0.4rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-section li::before {
    content: "→ ";
    color: var(--accent);
}

/* ===== Footer ===== */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer p + p {
    margin-top: 0.3rem;
}

.footer a {
    color: var(--text-muted);
}

.footer a:hover {
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    :root {
        --max-width: 100%;
    }

    .container {
        padding: 0 1rem;
    }

    .header .container {
        padding: 0 1rem;
    }

    .article {
        padding: 1.5rem;
    }

    .about {
        padding: 1.5rem;
    }

    .post-card {
        padding: 1.25rem;
    }

    .article-title {
        font-size: 1.4rem;
    }

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

    .nav {
        gap: 1rem;
    }
}
