
    :root { 
        --bg: #f8fafc; --text: #334155; --heading: #0f172a; --primary: #3b82f6; --primary-hover: #2563eb; 
        --surface: #ffffff; --surface-highlight: #f1f5f9; --border: #e2e8f0; --muted: #64748b; 
        --radius: 12px; --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
        --header-bg: #ffffff;
    }
    
    [data-theme="dark"] {
        --bg: #000000; --text: #cbd5e1; --heading: #f1f5f9; --primary: #60a5fa; --primary-hover: #93c5fd; 
        --surface: #111111; --surface-highlight: #1e293b; --border: #334155; --muted: #94a3b8;
        --radius: 12px; --shadow: 0 1px 3px 0 rgb(255 255 255 / 0.05), 0 1px 2px -1px rgb(255 255 255 / 0.05); /* Subtle light shadow/border */
        --header-bg: #111111;
        
        color-scheme: dark;
    }

    * { box-sizing: border-box; }
    html { scrollbar-gutter: stable; }
    body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.6; transition: background 0.3s, color 0.3s; }
    
    /* Layout */
    .container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
    header { background: var(--header-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; margin-bottom: 40px; box-shadow: var(--shadow); transition: background 0.3s, border-color 0.3s; }
    .nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
    .brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--heading); display: flex; align-items: center; gap: 8px; }
    
    .main-grid { display: grid; gap: 48px; grid-template-columns: 1fr; align-items: start; }
    @media (min-width: 800px) { .main-grid { grid-template-columns: 260px 1fr; } }
    
    .right-sidebar-grid { display: grid; gap: 48px; grid-template-columns: 1fr; align-items: start; }
    @media (min-width: 800px) { .right-sidebar-grid { grid-template-columns: 1fr 280px; } }
    
    /* Sidebar */
    .sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 100px; }
    
    /* Common Card Style */
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: background 0.3s, border-color 0.3s; }

    .profile-card { padding: 32px 24px; text-align: center; }
    .avatar { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; box-shadow: var(--shadow); }
    
    .news-card { padding: 24px; }
    .news-title { font-size: 18px; font-weight: 700; color: var(--heading); margin: 0 0 16px 0; display: flex; align-items: center; gap: 8px; }
    .news-list { list-style: none; padding: 0; margin: 0; }
    .news-item { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
    .news-item a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--muted); transition: all 0.2s; }
    .news-item a:hover { color: var(--primary); border-bottom-color: var(--primary); }
    
    .profile-name { margin: 0; font-size: 22px; font-weight: 700; color: var(--heading); letter-spacing: -0.01em; }
    .profile-role { color: var(--muted); margin: 6px 0 0; font-size: 15px; font-weight: 400; }
    
    .contact-links { display: flex; justify-content: center; gap: 12px; margin: 24px 0; }
    .contact-icon { color: var(--muted); transition: all .2s; padding: 8px; border-radius: 50%; background: var(--surface-highlight); display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; }
    .contact-icon:hover { color: var(--primary); background: #e0f2fe; }
    [data-theme="dark"] .contact-icon:hover { background: #1e3a8a; } /* Dark mode hover bg */
    
    .location { display: flex; align-items: flex-start; justify-content: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 20px; text-align: left; line-height: 1.4; padding: 0 10px; }
    .location svg { flex-shrink: 0; margin-top: 2px; }

    /* Content Area */
    .content-area { display: flex; flex-direction: column; gap: 40px; padding: 40px; }
    
    .cv-section { animation: fadeIn 0.5s ease-out; }
    
    .section-title { font-size: 1.5rem; font-weight: 700; color: var(--heading); margin: 0 0 1.5rem 0; padding-left: 1rem; border-left: 5px solid var(--primary); letter-spacing: -0.02em; }
    
    /* Typography inside sections */
    .prose { font-size: 15px; color: var(--text); }
    .prose p { margin-bottom: 1rem; }
    .prose ul { padding-left: 1.25rem; margin-bottom: 1rem; list-style-type: disc; }
    .prose ol { padding-left: 1.25rem; margin-bottom: 1rem; list-style-type: decimal; }
    
    /* Layout for Article Detail */
    .article-container { display: grid; grid-template-columns: 1fr; gap: 40px; position: relative; }
    @media (min-width: 1000px) { .article-container { grid-template-columns: minmax(0, 1fr) 280px; } }
    
    .toc { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
    .toc ul { list-style: none; padding: 0; margin: 0; }
    .toc li { margin-bottom: 8px; font-size: 14px; }
    .toc a { color: var(--muted); text-decoration: none; transition: all .2s; display: block; }
    .toc a:hover { color: var(--primary); }
    
    /* News Card Markdown Styles override */
    .news-card ul { list-style: none; padding: 0; margin: 0; }
    .news-card li { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
    .news-card li:last-child { margin-bottom: 0; padding-bottom: 0; }
    .news-card p { margin: 0; } /* Reset p inside li if markdown adds it */
    .news-card strong { color: var(--heading); font-weight: 600; } /* Ensure date/strong is dark like name/title */

    .prose li { margin-bottom: 0.5rem; }
    .prose strong { color: var(--heading); font-weight: 600; }
    .prose em { color: var(--muted); font-style: italic; }
    
    /* Article Grid Layout */
    .article-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: stretch; }
    @media (min-width: 1024px) { .article-grid { grid-template-columns: 1fr 240px; } }

    /* Refined Typography for Article Body */
    .prose h1, .prose h2, .prose h3, .prose h4 { color: var(--heading); line-height: 1.3; font-weight: 700; }
    /* H1 in body (if any) or large section headers */
    .prose h1 { font-size: 1.8rem; margin-top: 2rem; margin-bottom: 1rem; letter-spacing: -0.02em; } 
    /* Standard section headers */
    .prose h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; letter-spacing: -0.01em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
    .prose h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; font-weight: 600; }
    .prose h4 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: 0.5rem; font-weight: 600; }
    
    .prose p { margin-bottom: 1.25rem; line-height: 1.75; font-size: 1.05rem; }
    .prose > *:first-child { margin-top: 0; }
    
    /* Blockquote */
    .prose blockquote {
        margin: 1.5rem 0;
        padding: 0.5rem 1.25rem;
        background: var(--surface-highlight);
        border-left: 4px solid var(--primary);
        border-radius: 0 8px 8px 0;
        color: var(--muted);
        font-style: italic;
    }
    .prose blockquote p {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .prose blockquote p:last-child {
        margin-bottom: 0.5rem;
    }

    /* Code Blocks */
    .code-block-container {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow: hidden;
        margin: 1.5rem 0;
        background: var(--surface-highlight);
        display: flex;
        flex-direction: column;
        transition: all 0.3s ease;
        min-height: 50px; /* Ensure visibility */
    }
    
    .code-block-container.maximized .code-content-wrapper {
        flex: 1;
    }
    .code-block-container.maximized {
        position: fixed;
        top: 20px; left: 20px; right: 20px; bottom: 20px;
        z-index: 10500;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        margin: 0;
    }
    
    .code-block-container.collapsed .code-content-wrapper {
        display: none;
    }
    
    .code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #e0f2fe; /* Light blue */
        padding: 0.6rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    [data-theme="dark"] .code-header {
        background: #1e3a8a; /* Dark blue */
    }
    
    .code-dots {
        display: flex;
        gap: 8px;
    }
    
    .code-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        border: none;
        outline: none;
        cursor: pointer;
        padding: 0;
        transition: transform 0.2s;
    }
    .code-dot:hover {
        transform: scale(1.15);
    }
    .code-dot.close { background-color: #ff5f56; }
    .code-dot.min { background-color: #ffbd2e; cursor: default; }
    .code-dot.min:hover { transform: none; }
    .code-dot.max { background-color: #27c93f; }
    
    .code-lang {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        font-size: 0.75rem;
        color: var(--text);
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.05em;
        opacity: 0.7;
    }
    
    .code-content-wrapper {
        
        overflow: auto;
    }

    .prose pre {
        display: block;
        width: 100%;
        min-height: 20px; /* Force minimum visibility */
        margin: 0;
        padding: 0;
        background: transparent;
        border: none;
    }
    
    .prose pre code {
        display: block;
        padding: 1rem;
        overflow-x: auto;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        font-size: 0.9em;
        line-height: 1.5;
        background: transparent;
        color: inherit;
        border-radius: 0;
    }
    
    .prose code {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        background: var(--surface-highlight);
        padding: 0.2em 0.4em;
        border-radius: 4px;
        font-size: 0.9em;
        color: var(--primary);
    }
    
    /* Override hljs background to match site theme */
    .prose pre code.hljs {
        background: transparent;
        padding: 1rem;
    }
    
    /* GitHub Repo Card */
    .github-repo-card {
        display: block;
        text-decoration: none !important;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px 20px;
        margin: 1.5rem 0;
        transition: all 0.2s ease;
        box-shadow: var(--shadow);
    }
    .github-repo-card:hover {
        border-color: var(--primary);
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    }
    [data-theme="dark"] .github-repo-card:hover {
        box-shadow: 0 10px 15px -3px rgb(255 255 255 / 0.05), 0 4px 6px -2px rgb(255 255 255 / 0.02);
    }
    .github-repo-top {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        color: var(--heading);
        font-weight: 600;
        font-size: 1.15rem;
    }
    .github-repo-top svg {
        color: var(--text);
    }
    .github-repo-desc {
        color: var(--muted);
        font-size: 0.95rem;
        margin-bottom: 16px;
        line-height: 1.5;
    }
    .github-repo-stats {
        display: flex;
        align-items: center;
        gap: 16px;
        color: var(--text);
        font-size: 0.85rem;
    }
    .github-repo-stat {
        display: flex;
        align-items: center;
        gap: 4px;
        font-weight: 500;
    }
    .github-repo-stat svg {
        color: var(--muted);
    }
    
    /* Animations */
    @keyframes pageLoad {
        0% { opacity: 0; transform: translateY(10px); }
        100% { opacity: 1; transform: translateY(0); }
    }
    
    .container.main-grid, .content-area, .upload-grid {
        animation: pageLoad 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
    
    /* Navigation Link Hover */
    .nav-links a { 
        display: inline-block; 
        transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), color 0.2s; 
    }
    .nav-links a:hover { 
        transform: scale(1.1); 
        color: var(--primary); 
    }
    .prose a { color: var(--primary); text-decoration: none; font-weight: 500; transition: color .2s; }
    .prose a:hover { color: var(--primary-hover); text-decoration: underline; }

    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    /* Upload UI (Keep mostly same but clean up) */
    .upload-grid { display: grid; gap: 32px; grid-template-columns: 1fr; margin-top: 32px; }
    @media (min-width: 860px) { .upload-grid { grid-template-columns: 320px 1fr; } }
    
    .drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 24px; text-align: center; transition: all .2s; cursor: pointer; background: var(--surface); position: relative; overflow: hidden; }
    .drop-zone:hover, .drop-zone.drag { border-color: var(--primary); background: var(--surface-highlight); }
    .drop-zone input { position: absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor: pointer; }
    
    .file-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
    .file-preview { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--surface-highlight); display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }
    
    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 500; cursor: pointer; transition: all .2s; font-size: 14px; text-decoration: none; border: none; }
    .btn-primary { background: var(--primary); color: white; width: 100%; }
    .btn-primary:hover { background: var(--primary-hover); }
    .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
    
    .action-btn { background: transparent; border: none; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--muted); transition: all .2s; display: inline-flex; }
    .action-btn:hover { background: var(--surface-highlight); color: var(--text); }
    .action-btn.danger:hover { background: #fee2e2; color: #ef4444; }
    
    .toast { position: fixed; bottom: 32px; right: 32px; background: #0f172a; color: white; padding: 12px 24px; border-radius: 8px; font-weight: 500; opacity: 0; transform: translateY(20px); transition: all .3s; pointer-events: none; z-index: 100; font-size: 14px; }
    .toast.show { opacity: 1; transform: translateY(0); }

    /* Lightbox Styles (Refined) */
    .lightbox-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4); /* Lighter shadow */
        backdrop-filter: blur(8px); /* Nice glass effect */
        z-index: 10000;
        display: none;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .lightbox-overlay.active { display: flex; opacity: 1; }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 12px;
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
        transform: scale(0.9);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy pop effect */
        background: var(--surface); /* Ensure background for content */
    }
    .lightbox-overlay.active .lightbox-content { transform: scale(1); }
    
    .lightbox-close {
        position: absolute;
        top: 20px;
        right: 30px;
        color: white;
        font-size: 50px;
        cursor: pointer;
        z-index: 10001;
        line-height: 0.8;
        background: transparent;
        border: none;
        padding: 0;
        font-family: serif; 
        opacity: 0.8;
        transition: opacity 0.2s;
    }
    /* For image lightbox specifically, button is white. For modal, we use internal button */
    
    /* Header Search Animation */
    .nav-links { transition: opacity 0.3s, transform 0.3s; transform-origin: right center; }
    .search-mode .nav-links { opacity: 0; pointer-events: none; transform: translateX(20px) scale(0.95); }
    .search-trigger { transition: opacity 0.2s; }
    .search-mode .search-trigger { opacity: 0; pointer-events: none; }
    
    .search-bar-container {
        position: absolute;
        right: 70px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
        background: var(--surface-highlight);
        border-radius: 20px;
        display: flex;
        align-items: center;
        /* overflow: hidden; Removed to allow dropdown to show */
        border: 1px solid transparent;
    }
    .search-mode .search-bar-container {
        width: 400px;
        opacity: 1;
        pointer-events: auto;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
        overflow: visible; /* Ensure dropdown is visible */
    }
    
    /* Search Dropdown */
    .search-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: var(--shadow);
        margin-top: 12px;
        max-height: 400px;
        overflow-y: auto;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: all 0.2s;
    }
    .search-mode .search-dropdown.has-results {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
