/* Hero Section for Posts */
    header.post-hero {
        position: relative;
        min-height: 50vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 80px 5% 40px;
        background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,1)), url('/static/img/wallpaper.jpg');
        background-size: cover;
        background-position: center;
        overflow: hidden;
    }

    .hero-inner {
        max-width: 1800px;
        margin: 0 auto;
        width: 100%;
    }

    header.post-hero h1 {
        font-size: clamp(32px, 6vw, 64px);
        font-weight: 700;
        line-height: 1.2;
        margin-bottom: 30px;
        letter-spacing: -2px;
        background: linear-gradient(to right, #fff, #a1a1a6);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .post-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
        color: var(--secondary-text);
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 20px;
    }

    .post-meta i {
        color: var(--accent-color);
        margin-right: 8px;
    }

    .post-meta .unit {
        margin-left: 2px;
        opacity: 0.8;
    }

    .post-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .post-tag {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--accent-color);
        background: rgba(0, 113, 227, 0.1);
        padding: 4px 12px;
        border-radius: 20px;
        border: 1px solid rgba(0, 113, 227, 0.2);
        text-decoration: none;
        transition: all 0.2s;
    }

    .post-tag:hover {
        background: rgba(0, 113, 227, 0.2);
        border-color: var(--accent-color);
    }

    /* Content Area Styling */
    .post-layout-wrapper {
        display: flex;
        max-width: 1800px;
        margin: 0 auto;
        padding: 60px 5% 120px;
        gap: 60px;
    }

    /* Left placeholder to balance the layout and keep content centered */
    .post-layout-left {
        width: 250px;
        flex-shrink: 0;
    }

    .post-content {
        flex: 1;
        max-width: 1100px; /* Standard reading width for focus */
        min-width: 0;
        font-size: 18px;
        line-height: 1.8;
        color: #d1d1d6;
    }

    /* TOC Styling */
    .post-toc-aside {
        width: 250px;
        position: sticky;
        top: 120px;
        align-self: flex-start;
        display: block;
        flex-shrink: 0;
    }

    .toc-title {
        font-size: 12px;
        font-weight: 700;
        color: var(--secondary-text);
        letter-spacing: 1px;
        margin-bottom: 20px;
        text-transform: uppercase;
    }

    .toc-content {
        font-size: 14px;
        line-height: 1.6;
    }

    .toc-content ul {
        list-style-type: disc;
        padding-left: 1.2em;
        margin: 0;
    }

    .toc-content li {
        margin-bottom: 10px;
    }

    .toc-content a {
        color: var(--secondary-text);
        text-decoration: none;
        transition: color 0.2s;
        display: block;
        line-height: 1.4;
    }

    .toc-content a:hover {
        color: #fff;
    }

    .toc-content .is-active-link {
        color: var(--accent-color) !important;
        font-weight: 600;
    }

    .toc-content .toc-list {
        margin-left: 0.2em;
        border-left: 1px solid var(--border-color);
        padding-left: 1.2em;
        margin-top: 8px;
        list-style-type: circle;
    }

    @media (max-width: 1300px) {
        .post-toc-aside, .post-layout-left { display: none; }
        .post-layout-wrapper { padding: 40px 6% 80px; justify-content: center; }
    }

    /* Code Blocks Enhancement */
    .code-block-wrapper {
        position: relative;
        margin: 2em 0;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid var(--border-color);
        background: #1e1e1e;
    }

    .code-block-wrapper pre {
        background: #1e1e1e !important;
        padding: 45px 20px 20px !important; /* Space for header */
        margin: 0 !important;
        border: none !important;
        overflow-x: auto;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
        font-size: 0.9em;
        line-height: 1.5;
        position: relative;
    }

    .code-header {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 35px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 15px !important;
        border-bottom: 1px solid var(--border-color) !important;
        z-index: 100 !important;
        pointer-events: none !important;
    }

    .code-lang {
        font-size: 10px !important;
        text-transform: uppercase !important;
        letter-spacing: 1.5px !important;
        color: var(--secondary-text) !important;
        font-weight: 700 !important;
        pointer-events: none !important;
    }

    .copy-btn {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
        font-size: 9px !important;
        padding: 3px 10px !important;
        border-radius: 4px !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
        pointer-events: auto !important;
    }

    .copy-btn:hover {
        background: var(--accent-color) !important;
        border-color: var(--accent-color) !important;
    }

    .post-content h1, .post-content h2, .post-content h3, .post-content h4 {
        color: #fff;
        margin-top: 2em;
        margin-bottom: 1em;
        font-weight: 700;
        letter-spacing: -1px;
    }

    .post-content h2 { font-size: 32px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
    .post-content h3 { font-size: 24px; }

    .post-content p { margin-bottom: 1.5em; }

    .post-content strong, .post-content b {
        color: var(--accent-color);
        font-weight: 700;
    }

    /* List Styling */
    .post-content ul, .post-content ol {
        padding-left: 2em;
        margin-bottom: 1.5em;
    }

    .post-content li {
        margin-bottom: 0.5em;
    }

    .post-content ul ul, .post-content ul ol, .post-content ol ul, .post-content ol ol {
        margin-top: 0.5em;
        margin-bottom: 0;
    }

    .post-content img {
        max-width: 100%;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        margin: 2em 0;
    }

    .post-content blockquote {
        border-left: 4px solid var(--accent-color);
        padding: 10px 24px;
        background: var(--glass);
        margin: 2em 0;
        border-radius: 0 8px 8px 0;
    }

    .post-content blockquote p { margin-bottom: 0; font-style: italic; }

    /* Tables Styling */
    .post-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 2em 0;
        font-size: 16px;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 8px;
        overflow: hidden;
    }

    .post-content th, .post-content td {
        padding: 12px 16px;
        border: 1.5px solid #888;
        text-align: left;
    }

    .post-content th {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
        font-weight: 600;
    }

    .post-content tr:nth-child(even) { background: rgba(255, 255, 255, 0.01); }

    .post-content pre code {
        background: none;
        padding: 0;
        border-radius: 0;
        border: none;
    }

    /* Mermaid Center */
    .mermaid {
        display: flex;
        overflow-x: auto;
        margin: 2em 0;
    }
    .mermaid svg {
        margin: 0 auto;
        flex-shrink: 0;
    }

    /* Wavedrom Center */
    .wavedrom {
        display: flex;
        overflow-x: auto;
        margin: 2em 0;
    }
    .wavedrom svg, script[type="WaveDrom"] + svg {
        margin: 0 auto;
        flex-shrink: 0 !important;
        filter: invert(1) hue-rotate(180deg) brightness(1.2) !important;
        background: transparent !important;
    }
    /* Enhance WaveDrom grid lines (vertical dashed lines) */
    .wavedrom svg path[stroke-dasharray], 
    script[type="WaveDrom"] + svg path[stroke-dasharray] {
        stroke: #666 !important; /* Lighter color after inversion */
        stroke-width: 0.5px !important;
    }

    /* Mobile Adaptions */
    @media (max-width: 900px) {
        header.post-hero { padding: 80px 6% 30px; }
        .post-content { padding: 40px 6% 80px; font-size: 16px; }
        .post-meta { gap: 15px; }
    }

    /* Comments Section */
    .comment-card {
        background: var(--glass);
        padding: 40px;
        border-radius: 20px;
        border: 1px solid var(--border-color);
        backdrop-filter: blur(10px);
    }

    /* Valine Custom Styling */
    .v * { color: var(--text-color) !important; }
    .v .vlist .vcard .vhead .vname { color: var(--accent-color) !important; font-weight: 600; }
    .v .vlist .vcard .vh { border-bottom: 1px solid var(--border-color) !important; }
    .v .vbtn {
        background: var(--accent-color) !important;
        border: none !important;
        color: white !important;
        border-radius: 40px !important;
        padding: 8px 24px !important;
        font-weight: 600 !important;
    }
    .v .vlist .vcard .vcontent { color: #d1d1d6 !important; }
    .v .vpanel { background: rgba(255, 255, 255, 0.03) !important; border: 1px solid var(--border-color) !important; }
    .v .vheader .vinput { border-bottom: 1px solid var(--border-color) !important; }
    .v .vsys { background: rgba(255, 255, 255, 0.05) !important; color: var(--secondary-text) !important; }
    .v .vinfo { border-bottom: 1px solid var(--border-color) !important; }

    @media (max-width: 900px) {
        .comment-card { padding: 20px; }
    }
