/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #1a1a1a;
    --secondary-dark: #2d2d2d;
    --accent-gray: #4a4a4a;
    --light-gray: #e0e0e0;
    --text-gray: #666666;
    --white: #ffffff;
    --accent-blue: #0066cc;
    --accent-blue-hover: #0052a3;
    --shadow: rgba(0, 0, 0, 0.1);
    --max-width: 1200px;
    --markdown-bg: #ffffff;
    --markdown-text: #24292f;
    --markdown-border: #d0d7de;
    --markdown-code-bg: #f6f8fa;
    --markdown-blockquote-border: #0969da;
    --markdown-table-border: #d0d7de;
    --markdown-link: #0969da;
    --markdown-link-hover: #1a7f37;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--primary-dark);
    background-color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 72px;
    height: 72px;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin-left: 0;
    padding-left: 0;
    justify-content: flex-start;
    width: 100%;
}

.nav-link {
    color: var(--accent-gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary-dark);
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--primary-dark);
    transition: transform 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background-color: #fafafa;
}

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-gray);
    margin-bottom: 0.25rem;
}

.hero-affiliation {
    font-size: 1.125rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.hero-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.hero-link:hover {
    color: var(--accent-blue-hover);
}

.hero-image img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 20px var(--shadow);
}

/* About Section */
.about {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent-blue);
}

.about-text {
    font-size: 1.125rem;
    color: var(--accent-gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.research-interests {
    margin-top: 3rem;
}

.research-interests h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    background-color: var(--secondary-dark);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Highlights Section */
.highlights {
    padding: 4rem 0;
    background-color: #fafafa;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.highlight-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px var(--shadow);
}

.highlight-card i {
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.highlight-card h3 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.highlight-card p {
    color: var(--text-gray);
}

/* Stats Section */
.stats {
    padding: 4rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-gray);
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: var(--secondary-dark);
    color: var(--light-gray);
    padding: 2rem 0;
    text-align: center;
    flex-shrink: 0;
}

.footer-content p {
    margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: -2px 0 10px var(--shadow);
        transition: right 0.3s ease;
    }

    .nav-menu.active {
        right: 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-links {
        justify-content: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Page-specific styles for subpages */
.page-header {
    background-color: var(--secondary-dark);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    height: 120px;
    padding-bottom: 0 !important;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    text-align: center;
}

.content-section {
    padding: 4rem 0;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Publication list styles */
.publication-item {
    background-color: #fafafa;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-blue);
    border-radius: 4px;
}

.publication-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.publication-authors {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.publication-venue {
    color: var(--accent-gray);
    font-style: italic;
}

.publication-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.publication-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.publication-link:hover {
    text-decoration: underline;
}

/* Sticky footer layout for all pages */
html, body {
    height: 100%;
}
.main-content {
    flex: 1 0 auto;
    margin-top: 0 !important;
    padding-top: 72px !important; /* matches navbar height */
}

/* Blog Styles */
.blog-list-item {
    background: var(--white);
    border: 1px solid var(--markdown-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.blog-list-item h3 {
    margin-bottom: 0.5rem;
}

.blog-list-item h3 a {
    color: var(--markdown-text);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.blog-list-item h3 a:hover {
    color: var(--markdown-link);
}

.blog-date {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.post-description {
    color: var(--accent-gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.category-badge {
    background: var(--accent-blue);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.tutorial {
    background: #1a7f37;
}

.category-badge.update {
    background: #0969da;
}

.category-badge.research {
    background: #8250df;
}

.read-time {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.post-tags-preview {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-preview {
    background: var(--markdown-code-bg);
    color: var(--accent-gray);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--markdown-border);
}

.tag-preview.more {
    background: var(--light-gray);
    color: var(--text-gray);
}

/* Blog Post Content Styles */
.blog-post-content,
.main-content .container,
.main-content .content-section {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.blog-post-content {
    background: var(--markdown-bg);
    border: 1px solid var(--markdown-border);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-post-content.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    color: var(--markdown-text);
}

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

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--markdown-text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 1.2em;
    font-size: 1em;
    white-space: nowrap;
    width: 100%;
    overflow-x: auto;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.post-meta i {
    color: var(--accent-blue);
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.7em;
}

.post-tag {
    background: var(--markdown-code-bg);
    color: var(--accent-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--markdown-border);
}

/* GitHub-style Markdown Body */
.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    color: var(--markdown-text);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--markdown-text);
}

.markdown-body h1 {
    font-size: 2em;
    border-bottom: 1px solid var(--markdown-border);
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--markdown-border);
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.25em;
}

.markdown-body h4 {
    font-size: 1em;
}

.markdown-body h5 {
    font-size: 0.875em;
}

.markdown-body h6 {
    font-size: 0.85em;
    color: var(--text-gray);
}

.markdown-body p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: var(--text-gray);
    border-left: 0.25em solid var(--markdown-blockquote-border);
    margin: 0 0 16px 0;
}

.markdown-body ul,
.markdown-body ol {
    margin-top: 0;
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-body li {
    margin-top: 0.25em;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background: #f6f8fa;
    color: #24292f;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    box-shadow: none;
}

.markdown-body pre {
    margin-top: 0;
    margin-bottom: 16px;
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: var(--markdown-code-bg);
    border-radius: 6px;
    border: 1px solid var(--markdown-border);
}

.markdown-body pre code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
    color: #24292f;
}

.markdown-body table {
    border-spacing: 0;
    border-collapse: separate;
    margin-top: 1.5em;
    margin-bottom: 1em;
    width: 100%;
    overflow: auto;
    break-inside: auto;
    text-align: left;
    background: #fff;
    box-shadow: none;
    border-radius: 8px;
}

.markdown-body table th {
    font-weight: 700;
    padding: 8px 18px;
    border: 1px solid #d0d7de;
    background: #f6f8fa;
    color: #24292f;
    font-size: 1em;
    letter-spacing: 0.01em;
}

.markdown-body table td {
    padding: 8px 18px;
    border: 1px solid #d0d7de;
    background: #fff;
    color: #24292f;
    font-size: 0.98em;
}

.markdown-body table tr {
    background: #fff;
    transition: background 0.18s;
}

.markdown-body table tr:nth-child(even) {
    background: #f6f8fa;
}

.markdown-body table tr:hover {
    background: #e9eaec;
}

.markdown-body table thead {
    border-top: 2px solid #b1b5ba;
    border-bottom: 2px solid #b1b5ba;
}

.markdown-body table {
    border: 1.5px solid #b1b5ba;
}

.markdown-table {
    border-radius: 8px;
    overflow: hidden;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

/* Enhanced Image Styles */
.markdown-image {
    margin: 1.5rem 0;
    text-align: center;
}

.markdown-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: none;
    transition: transform 0.3s ease;
    background: var(--markdown-bg) !important;
}

.markdown-image img:hover {
    transform: scale(1.02);
}

.markdown-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-gray);
    font-style: italic;
}

/* Table Container for Responsive Tables */
.table-container {
    overflow-x: auto;
    margin: 0;
    border-radius: 0;
    border: none;
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* Enhanced Blockquote Styles */
.markdown-blockquote {
    border-left: 4px solid var(--markdown-blockquote-border);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--markdown-code-bg);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.markdown-blockquote p:last-child {
    margin-bottom: 0;
}

/* Language Label for Code Blocks */
.language-label {
    position: absolute;
    top: 0.7em;
    left: 0.7em;
    background: #f3f4f6 !important;
    color: #24292f !important;
    border: 1px solid #d0d7de !important;
    border-radius: 6px !important;
    font-size: 0.72em !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    opacity: 1;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(140, 150, 160, 0.07) !important;
    padding: 0.12em 0.85em !important;
    display: flex;
    align-items: center;
    height: 1.7em;
    min-width: 2.5em;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 3rem;
    color: var(--text-gray);
    font-style: italic;
    background: var(--markdown-code-bg);
    border-radius: 8px;
    border: 1px solid var(--markdown-border);
}

.markdown-body a {
    color: var(--markdown-link);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: var(--markdown-border);
    border: 0;
}

/* LaTeX Equation Styles */
.katex {
    font-size: 1.1em;
}

.katex-display {
    margin: 0;
    text-align: center;
}

/* Enhanced Code Block Styles */
.markdown-body pre,
.pro-code-block {
    background: #eaf4fb !important;
    color: #24292f !important;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 1.25em 1em 1em 3em;
    position: relative;
    overflow: auto;
    font-size: 1em;
    margin-bottom: 2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pro-code-block code {
    background: none !important;
    color: #24292f !important;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
    font-size: 1em;
}

.hljs-ln-numbers {
    text-align: right;
    color: #57606a;
    background: #eaf4fb;
    user-select: none;
    border-right: 1px solid #d0d7de;
    padding-right: 0.75em;
    font-size: 0.95em;
}

.hljs-ln-code {
    padding-left: 1em;
}

.pro-code-block > .copy-btn,
.markdown-body .pro-code-block > .copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: absolute;
    top: 0.75em;
    right: 1.2em;
    background: #f3f4f6 !important;
    color: #24292f !important;
    border: 1px solid #d0d7de !important;
    border-radius: 3px !important;
    padding: 0.18em 1em !important;
    font-size: 0.98em !important;
    font-weight: 500 !important;
    cursor: pointer;
    opacity: 1 !important;
    transition: background 0.18s, border 0.18s, color 0.18s, box-shadow 0.18s;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(140, 150, 160, 0.07) !important;
    text-align: center;
}

.pro-code-block > .copy-btn:hover,
.markdown-body .pro-code-block > .copy-btn:hover {
    background: #e9eaec !important;
    border-color: #b1b5ba !important;
    box-shadow: 0 2px 8px rgba(140, 150, 160, 0.13) !important;
}

/* Professional code block styles for blog */
.pro-code-block {
    display: flex;
    align-items: stretch;
    position: relative;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #eaf4fb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    margin: 2em 0;
    padding: 0;
    padding-top: 2.2em !important;
}

.code-lines {
    font-size: 1em !important;
    line-height: 1.2815 !important;
    margin-top: -1.05em !important;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace !important;
}

.pro-code-block pre {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    flex: 1 1 auto;
    padding: 16px 0 16px 0 !important;
    overflow-x: auto;
    padding-top: 0 !important;
}

.pro-code-block pre code {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    font-size: 1em !important;
    line-height: 1.5 !important;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 32px;
    min-width: 32px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-gray);
    font-style: italic;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #d73a49;
    background: #ffeef0;
    border: 1px solid #f97583;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Back to List Button */
#back-to-list {
    background: var(--accent-blue);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

#back-to-list:hover {
    background: var(--accent-blue-hover);
}

/* Responsive Design for Blog */
@media (max-width: 768px) {
    .blog-post-content {
        padding: 1rem;
    }
    
    .blog-list-item {
        padding: 1rem;
    }
    
    .markdown-body {
        font-size: 14px;
    }
    
    .markdown-body h1 {
        font-size: 1.75em;
    }
    
    .markdown-body h2 {
        font-size: 1.5em;
    }
    
    .post-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    .pro-code-block {
        padding-top: 2.2em !important;
    }
    
    .copy-btn {
        font-size: 0.8em;
        padding: 0.2em 0.5em;
        min-height: 28px;
        min-width: 28px;
        top: 10px;
        right: 10px;
    }
    
    .language-label {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .blog-post-content {
        padding: 0.75rem;
    }
    
    .blog-list-item {
        padding: 0.75rem;
    }
    
    .markdown-body {
        font-size: 13px;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
    
    .markdown-body h1 {
        font-size: 1.5em;
    }
    
    .markdown-body h2 {
        font-size: 1.3em;
    }
    
    .markdown-body h3 {
        font-size: 1.1em;
    }
    .wrap-btn {
        min-width: 42px;
    }
}

/* Fixed Navbar Styles */
.fixed-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: #232323; /* Match footer background */
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-bottom: 1.5px solid #222;
    transition: background 0.2s;
    min-height: 72px;
    height: 72px;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

.navbar .nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    gap: 1rem;
}

.navbar .nav-brand {
    min-width: 320px;
    width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.navbar .nav-brand a {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.navbar .nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar .nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    background: #e3f0ff;
    color: #1976d2;
}

/* Responsive Hamburger */
.navbar .nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.navbar .hamburger {
    width: 24px;
    height: 3px;
    background: #fff;
    display: block;
    position: relative;
}

.navbar .hamburger::before,
.navbar .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 3px;
    background: #fff;
    transition: 0.3s;
}

.navbar .hamburger::before {
    top: -8px;
}

.navbar .hamburger::after {
    top: 8px;
}

/* Push content down below nav */
.main-content {
    margin-top: 64px; /* Height of nav + shadow */
}

@media (max-width: 900px) {
    .navbar .nav-container {
        padding: 0.5rem 1rem;
    }
    .main-content {
        margin-top: 56px;
    }
}

@media (max-width: 700px) {
    .navbar .nav-menu {
        display: none;
        flex-direction: column;
        background: #232323;
        position: absolute;
        top: 100%;
        left: 0;
        width: 40%;
        height: 100vh;
        box-shadow: 2px 0 16px rgba(0,0,0,0.12);
        padding: 1rem 0;
        z-index: 1001;
    }
    .navbar .nav-menu.open {
        display: flex;
    }
    .navbar .nav-toggle {
        display: block;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    .navbar .nav-menu {
        width: 40%;
        left: 0;
        right: auto;
    }
}

/* Responsive: On small screens, allow wrapping or reduce font size if needed */
@media (max-width: 600px) {
    .navbar .nav-brand {
        min-width: 0;
        width: auto;
        font-size: 1rem;
    }
    .post-meta {
        font-size: 0.95em;
        gap: 0.7em;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .post-meta span {
        font-size: 0.95em;
        white-space: nowrap;
        min-width: 0;
    }
}

/* --- FORCE LIGHT THEME FOR BLOG --- */
.markdown-body,
.blog-post-content {
    background: #fff !important;
    color: #24292f !important;
    border-color: #d0d7de !important;
}

.markdown-body pre,
.markdown-body code,
.pro-code-block,
.pro-code-block code,
.hljs-ln-numbers,
.hljs-ln-code {
    background: #eaf4fb !important;
    color: #24292f !important;
    border-color: #d0d7de !important;
}

body, html {
    background: #fff !important;
    color: #24292f !important;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
    color: #24292f !important;
}

.pro-code-block .copy-btn {
    background: #0969da !important;
    color: #fff !important;
}

.markdown-body a {
    color: #0969da !important;
}

.markdown-body a:hover {
    color: #1a7f37 !important;
}

.pro-code-block pre {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
}
.pro-code-block pre code {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
}
.copy-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: #0969da;
    background: none;
}
.copy-btn[style*="background: #d0f0d7"] svg {
    stroke: #28a745;
}

/* Make block equations scrollable and prevent overflow */
.math-block {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0;
  margin: 0;
}
.math-block .katex-display {
  min-width: 0 !important;
  width: max-content;
  max-width: 100%;
  margin: 0 !important;
}

/* Professional Callout Tip Block */
.callout-tip {
    display: flex;
    align-items: flex-start;
    background: #fffde7;
    border-left: 5px solid #ffd600;
    border-radius: 8px;
    padding: 1.1em 1.2em 1.1em 1em;
    margin: 1.5em 0;
    box-shadow: 0 2px 8px rgba(255, 214, 0, 0.07);
    color: #7a5c00;
    font-size: 1.05em;
    position: relative;
}
.callout-tip .callout-icon {
    flex-shrink: 0;
    margin-right: 0.85em;
    display: flex;
    align-items: center;
    height: 2em;
}
.callout-tip .callout-label {
    font-weight: 600;
    color: #bfa100;
    margin-right: 0.5em;
    font-size: 1em;
    letter-spacing: 0.01em;
    line-height: 1.4;
}
.callout-tip .callout-content {
    flex: 1 1 auto;
    color: #7a5c00;
    line-height: 1.6;
    word-break: break-word;
}
@media (max-width: 600px) {
    .callout-tip {
        flex-direction: column;
        align-items: stretch;
        padding: 1em;
    }
    .callout-tip .callout-icon {
        margin-bottom: 0.5em;
        margin-right: 0;
    }
    .callout-tip .callout-label {
        margin-bottom: 0.25em;
        margin-right: 0;
    }
}

@media (max-width: 900px) and (max-height: 500px) {
    .nav-menu {
        gap: 1rem;
    }
    .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem;
    }
}

.math-block-unnumbered .katex-display,
.math-block-unnumbered .mjx-block {
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

.math-block-unnumbered mjx-container,
.math-block-unnumbered mjx-container * {
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  justify-content: flex-start !important;
}

.callout-content {
  overflow-x: auto;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

.table-caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-gray);
  font-style: italic;
  text-align: left;
}

/* HTML App Block Styles */
.html-app-block {
  position: relative;
  width: 100%;
  margin: 2em 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

.html-app-container {
  width: 100%;
  min-height: 200px;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  overflow: visible;
}

.html-app-container iframe {
  width: 100%;
  border: none;
  border-radius: 8px 8px 0 0;
  background: white;
  min-height: 200px;
  transition: height 0.3s ease;
}

.html-app-code {
  background: #eaf4fb;
  border-top: 1px solid #d0d7de;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.html-app-code pre {
  margin: 0 !important;
  padding: 1rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.html-app-code code {
  background: transparent !important;
  border: none !important;
  color: #24292f !important;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

.html-app-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #0969da;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  transition: background 0.2s;
  font-weight: 500;
}

.html-app-toggle:hover {
  background: #1a7f37;
}

.html-app-toggle .toggle-icon svg {
  transition: transform 0.2s;
}

/* Responsive design for HTML app blocks */
@media (max-width: 768px) {
  .html-app-block {
    margin: 1.5em 0;
  }
  
  .html-app-container iframe {
    min-height: 150px;
  }
  
  .html-app-toggle {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* Reduce copy code button size */
.copy-code-btn {
  font-size: 0.75em !important;
  transform: scale(0.75);
  transform-origin: top right;
  padding: 0.3em 0.7em !important;
  border-radius: 6px !important;
  right: 0.7em !important;
  top: 0.7em !important;
}

/* Force smaller copy code button size */
.pro-code-block > .copy-btn, .copy-btn {
  font-size: 0.75em !important;
  transform: scale(0.75) !important;
  transform-origin: top right !important;
  padding: 0.2em 0.7em !important;
  border-radius: 6px !important;
  right: 0.7em !important;
  top: 0.7em !important;
  height: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.figure-caption {
  display: block;
  text-align: center;
  margin: 0.5rem auto 2rem auto;
  font-size: 0.95em;
  color: var(--text-gray);
  font-style: italic;
  max-width: 100%;
  padding: 0 1em;
}

/* Mermaid App Block Styles */
.mermaid-app-block {
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  min-width: 50%;
  aspect-ratio: 1 / 0.75;
  max-width: 100%;
  margin: 2em auto;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: visible;
  padding: 0;
}

.mermaid-app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: none;
  border-radius: 0;
  overflow: visible;
}

.mermaid-app-block iframe {
  display: block;
  margin: 0 auto;
}

.svg-app-block {
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  min-width: 50%;
  aspect-ratio: 1 / 0.75;
  max-width: 100%;
  margin: 2em auto;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: visible;
  padding: 0;
}

.svg-app-container {
  margin: 0.5em 1.0em !important;
  overflow: hidden !important;
  max-width: 100vw;
  max-height: 100vh;
}

.svg-app-container svg {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 80vh !important;
  display: block;
  overflow: visible !important;
}

.svg-app-block iframe {
  display: block;
  margin: 0 auto;
}

.mobile-nav-name {
  display: none;
  font-size: 1.5rem;
  font-weight: 500;
  margin-left: 0.75rem;
  color: var(--white);
  letter-spacing: 0.01em;
  vertical-align: middle;
}

@media (max-width: 600px) and (orientation: portrait) {
  .mobile-nav-name {
    display: inline-block;
  }
}

@media (max-width: 768px) {
  .svg-app-block {
    overflow-y: hidden !important;
    overflow-x: auto;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vw;
  }
  .svg-app-container {
    overflow-y: hidden !important;
    max-width: 100vw;
    max-height: 60vw;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .svg-app-container svg {
    max-width: 100% !important;
    max-height: 60vh !important;
    margin: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* --- Blog Code Block Wrap Button --- */
.wrap-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f6f8fa !important;
  color: #0969da !important;
  border: 1.5px solid #d0d7de !important;
  border-radius: 999px !important;
  padding: 0.16em 0.4em !important;
  font-size: 0.8em !important;
  font-weight: 500 !important;
  cursor: pointer;
  opacity: 1 !important;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(140, 150, 160, 0.09) !important;
  text-align: center;
  position: absolute;
  top: 10px;
  left: 50%;
  right: unset;
  transform: translateX(-50%);
  min-height: 32px;
  min-width: unset;
  justify-content: center;
}

.wrap-btn:hover {
  background: #e9eaec !important;
  border-color: #b1b5ba !important;
  color: #0a5ab7 !important;
  box-shadow: 0 4px 16px rgba(140, 150, 160, 0.13) !important;
}

.wrap-btn .wrap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
}

.wrap-btn .wrap-icon svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .wrap-btn {
    font-size: 0.64em !important;
    padding: 0.13em 0.32em !important;
    border-radius: 999px !important;
    left: 50%;
    right: unset !important;
    top: 10px !important;
    transform: translateX(-50%);
    min-height: 28px;
    min-width: unset;
  }
  .wrap-btn .wrap-icon {
    height: 12.8px;
  }
  .wrap-btn .wrap-icon svg {
    width: 12.8px;
    height: 12.8px;
  }
}

.pro-code-block.collapsed {
  min-height: 48px;
  background: #f6f8fa;
  border-radius: 8px;
  position: relative;
  transition: min-height 0.35s cubic-bezier(0.4,0,0.2,1), background 0.18s;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
}
