:root {
    --bg-color: #ffffff;
    --nv-green: #76B900;
    --nv-green-glow: rgba(118, 185, 0, 0.25);
    --nv-green-dim: rgba(118, 185, 0, 0.1);
    --text-main: #111111;
    --text-sub: #6e6e73;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-blur: 24px;
    --glass-border: rgba(0, 0, 0, 0.04);
    --sidebar-width: 280px;
    --radius-xl: 24px;
    --radius-md: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh; display: flex; overflow: hidden;
}

/* --- Canvas Layers (Now 6 layers!) --- */
/* 1. Hero Grid (Home) */
#hero-grid { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; opacity: 1; transition: opacity 0.8s ease; pointer-events: none; }
/* 2. Circuit Grid (Unused currently, kept for backup) */
#gpu-grid { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; opacity: 0; transition: opacity 0.8s ease; }
/* 3. Fluid Orbs (Blog) */
#orb-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; opacity: 0; transition: opacity 0.8s ease; }
/* 4. 3D Geometry (Projects) */
#geo-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -3; opacity: 0; transition: opacity 0.8s ease; }
/* 5. Flow Lines (Arsenal) */
#flow-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -4; opacity: 0; transition: opacity 0.8s ease; }
/* 6. [NEW] Neural Mesh (Hobbies) */
#mesh-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -5; opacity: 0; transition: opacity 0.8s ease; }
#special-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* 位于 Hero Grid(0) 之上，但在文字内容之下 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* --- UI Hidden State --- */
aside, main { transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease; }
.ui-hidden { opacity: 0; pointer-events: none; transform: scale(0.98); filter: blur(10px); }

/* Sidebar */
aside {
    width: var(--sidebar-width); height: 100vh;
    background: rgba(255,255,255,0.3); backdrop-filter: blur(30px);
    border-right: 1px solid rgba(0,0,0,0.06); padding: 40px 30px;
    display: flex; flex-direction: column; justify-content: space-between; z-index: 20;
}
.sidebar-top { display: flex; flex-direction: column; gap: 40px; }
.profile-area { display: flex; align-items: center; gap: 16px; }
.avatar {
    width: 56px; height: 56px; background: linear-gradient(135deg, #1a1a1a, #333);
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.6rem; box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.nav-item {
    padding: 12px 16px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 14px;
    color: var(--text-sub); font-size: 0.95rem; font-weight: 500; transition: all 0.2s;
}
.nav-item:hover { background: rgba(0,0,0,0.04); color: var(--text-main); transform: translateX(4px); }
.nav-item.active { background: var(--nv-green-dim); color: var(--nv-green); font-weight: 600; }
.sidebar-footer { font-size: 0.75rem; color: #aaa; font-family: 'JetBrains Mono'; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.05); }
.traffic-monitor { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; background: rgba(0,0,0,0.02); padding: 10px; border-radius: 8px; }
.stat-highlight { color: var(--nv-green); font-weight: 700; text-shadow: 0 0 8px rgba(118, 185, 0, 0.4); }

/* Main Content */
main { flex: 1; height: 100vh; overflow-y: auto; padding: 0 80px; scroll-behavior: smooth; position: relative; z-index: 1; }

.page-section { display: none; max-width: 1080px; margin: 0 auto; padding-bottom: 100px; }
.page-section.active { display: block; animation: sectionFadeIn 0.4s ease-out; }
@keyframes sectionFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-section header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: 40px;
    padding-bottom: 20px;
    margin-bottom: 20px;

    /* 修改 1: 背景改为极淡的半透明白 (0.85 -> 0.2) */
    background: rgba(255, 255, 255, 0.2);

    /* 修改 2: 依靠模糊来虚化背景干扰 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* 修改 3: 加强一点底部分割线，代替阴影 */
    border-bottom: 1px solid rgba(0,0,0,0.08);

    /* 修改 4: 去掉原本遮挡视线的纯白阴影 */
    box-shadow: none;
}
header h1 { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
header p { color: var(--text-sub); font-size: 1.1rem; margin: 0; }

.scroll-reveal { opacity: 0; transform: translateY(60px) scale(0.96); transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.scroll-reveal.visible { opacity: 1; transform: translateY(0) scale(1); }

/* Hero */
#home { position: relative; }
#home.active {
    /* 修改：使用 min-height 允许内容超出屏幕时滚动 */
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 修改：增加上下内边距，防止小屏幕下内容贴着浏览器边缘 */
    padding-top: 40px;
    padding-bottom: 40px;
}

/* --- New Hero Styles (更加极客、动态) --- */

/* 给 Hero 卡片增加呼吸灯效果 */
#hero-content {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    padding: 50px 60px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    max-width: 900px;
    position: relative;
    overflow: hidden;
    animation: borderBreath 4s infinite ease-in-out;
}

@keyframes borderBreath {
    0%, 100% { border-color: rgba(118, 185, 0, 0.1); box-shadow: 0 20px 60px rgba(0,0,0,0.05); }
    50% { border-color: rgba(118, 185, 0, 0.5); box-shadow: 0 20px 70px rgba(118, 185, 0, 0.15); }
}

/* 伪终端命令行顶部 */
.terminal-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 25px;
    background: rgba(0,0,0,0.03);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.05);
}
.cmd-prompt { color: var(--nv-green); font-weight: 700; margin-right: 8px; }
.cmd-input { color: #333; }

/* 故障风标题 (Glitch Title) */
.hero-title {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 20px;
    color: #111;
    position: relative;
    display: inline-block;
}

/* 故障动画关键帧 */
.glitch-effect {
    position: relative;
}
.glitch-effect::before,
.glitch-effect::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color); /* 遮挡背景 */
}
.glitch-effect::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch-effect::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(12px, 9999px, 32px, 0); }
    5% { clip: rect(85px, 9999px, 96px, 0); }
    10% { clip: rect(10px, 9999px, 2px, 0); }
    15% { clip: rect(62px, 9999px, 83px, 0); }
    20% { clip: rect(2px, 9999px, 92px, 0); }
    100% { clip: rect(0, 0, 0, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(52px, 9999px, 12px, 0); }
    5% { clip: rect(15px, 9999px, 6px, 0); }
    10% { clip: rect(90px, 9999px, 12px, 0); }
    15% { clip: rect(2px, 9999px, 53px, 0); }
    100% { clip: rect(0, 0, 0, 0); }
}

/* 无限打字机 */
.hero-subtitle {
    font-size: 1.5rem;
    color: #444;
    min-height: 1.6em; /* 防止高度抖动 */
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.static-text { color: var(--text-sub); margin-right: 10px; font-weight: 300; font-family: 'Inter', sans-serif;}
.dynamic-text { color: var(--nv-green); font-weight: 700; position: relative; }
.cursor {
    display: inline-block; /* 防止被意外换行 */
    color: var(--nv-green);
    font-weight: 900; /* 加粗，让这个下划线更有存在感 */
    animation: blink 1s infinite step-end; /* step-end 让闪烁更像老式终端（硬切换） */
    margin-left: 2px;
}

/* 移动端适配调整 */
@media (max-width: 1024px) {
    .hero-title { font-size: 3rem; }
    .glitch-effect::before, .glitch-effect::after { display: none; } /* 移动端性能优化，关掉故障动画 */
    #hero-content { padding: 30px; }
}

.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(255,255,255,0.9); border: 1px solid rgba(0,0,0,0.05); border-radius: 100px; font-family: 'JetBrains Mono'; font-size: 0.75rem; color: var(--text-sub); margin-bottom: 30px; }
.status-dot { width: 8px; height: 8px; background: var(--nv-green); border-radius: 50%; box-shadow: 0 0 10px var(--nv-green); animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title { font-size: 5.5rem; font-weight: 800; line-height: 1; margin-bottom: 30px; letter-spacing: -0.04em; color: #111; }
.typing-cursor::after { content: '|'; animation: blink 1s infinite; color: var(--nv-green); }
.hero-subtitle { font-size: 1.4rem; color: #555; max-width: 650px; margin-bottom: 60px; line-height: 1.6; font-weight: 300; min-height: 3.2em; }
.stat-row { display: flex; gap: 60px; padding-top: 30px; border-top: 1px solid rgba(0,0,0,0.05); }
.stat-number { font-size: 3rem; font-weight: 800; font-family: 'JetBrains Mono'; margin-bottom: 4px; color: var(--text-main); }
.stat-label { font-size: 0.85rem; color: var(--text-sub); text-transform: uppercase; letter-spacing: 1px; }
.social-row { display: flex; gap: 16px; margin-top: 40px; }
.social-btn { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,0.5); border: 1px solid rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--text-main); text-decoration: none; transition: all 0.3s; }
.social-btn:hover { background: #fff; transform: translateY(-5px); color: var(--nv-green); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: var(--nv-green); }

/* Cards */
.glass-card {
    background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border); border-radius: var(--radius-xl);
    padding: 32px; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative;
}
.glass-card:hover { transform: translateY(-8px) scale(1.01); box-shadow: 0 15px 35px var(--nv-green-glow); border-color: var(--nv-green); z-index: 2; }
.glass-card.clickable { cursor: pointer; }

.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; grid-auto-rows: 280px; }
.project-card { display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.blog-list { display: flex; flex-direction: column; gap: 20px; }
.blog-card { display: grid; grid-template-columns: 140px 1fr; gap: 30px; cursor: pointer; }
.tech-item { font-family: 'JetBrains Mono'; font-size: 0.75rem; padding: 5px 10px; background: rgba(0,0,0,0.04); border-radius: 6px; margin-right: 6px; color: #444; }

.hobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.hobby-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: 360px; }
.hobby-img-wrapper { height: 220px; width: 100%; position: relative; overflow: hidden; background: #f0f0f0; }
.hobby-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.hobby-card:hover .hobby-img-wrapper img { transform: scale(1.1); }
.hobby-content { padding: 24px; flex: 1; display: flex; flex-direction: column; justify-content: center; }

#arsenal-categories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.arsenal-cat-card { cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; height: 240px; }
#arsenal-detail { display: none; height: 650px; }
#arsenal-detail.visible { display: grid; grid-template-columns: 260px 1fr; }
.arsenal-sidebar { background: rgba(249,249,251,0.6); padding: 20px; border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; }
.arsenal-content { padding: 40px; overflow-y: auto; }
.back-btn { display: flex; align-items: center; gap: 8px; color: var(--text-sub); font-size: 0.9rem; margin-bottom: 20px; cursor: pointer; padding: 8px 12px; border-radius: 8px; transition: 0.2s; font-weight: 600; }
.back-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }
.tree-item { padding: 10px 14px; border-radius: 10px; cursor: pointer; font-family: 'JetBrains Mono'; font-size: 0.9rem; color: var(--text-sub); margin-bottom: 4px; transition:0.2s; }
.tree-item:hover { background: #fff; color: var(--text-main); }
.tree-item.active { background: #fff; color: var(--nv-green); font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }

.markdown-body { color: #222; line-height: 1.8; font-size: 1.1rem; }
.markdown-body pre { background: #1e1e1e; padding: 20px; border-radius: 12px; overflow-x: auto; margin: 20px 0; position: relative; }
.markdown-body code { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
.copy-btn { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; color: #aaa; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.2s ease; }
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.markdown-body pre:hover .copy-btn { opacity: 1; }
/* --- 修复及增强 Markdown 样式 --- */
.markdown-body {
    color: #222;
    line-height: 1.8;
    font-size: 1.1rem;
    padding-bottom: 50px; /* 底部留白 */
}

/* 修复：恢复列表的缩进和符号 */
.markdown-body ul,
.markdown-body ol {
    padding-left: 2em; /* 关键：恢复左侧缩进 */
    margin-bottom: 1em;
    margin-top: 1em;
}

.markdown-body ul {
    list-style-type: disc; /* 确保显示圆点 */
}

.markdown-body ol {
    list-style-type: decimal; /* 确保显示数字 */
}

.markdown-body li {
    margin-bottom: 0.5em; /* 列表项之间增加一点间距 */
}

/* 修复：嵌套列表的样式 */
.markdown-body ul ul,
.markdown-body ol ul,
.markdown-body ul ol,
.markdown-body ol ol {
    margin-top: 0;
    margin-bottom: 0;
}

/* 增强：其他 Markdown 元素的排版 */
.markdown-body p {
    margin-bottom: 1.5em; /* 段落间距 */
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 700;
    line-height: 1.3;
    border-bottom: 1px solid rgba(0,0,0,0.05); /* 给标题加个淡淡的下划线区分 */
    padding-bottom: 0.3em;
}

.markdown-body blockquote {
    margin: 1.5em 0;
    padding-left: 1em;
    border-left: 4px solid var(--nv-green); /* 引用块使用你的主题色 */
    color: #666;
    background: rgba(0,0,0,0.02);
    padding: 10px 16px;
    border-radius: 0 8px 8px 0;
}

.markdown-body a {
    color: var(--nv-green);
    text-decoration: none;
    border-bottom: 1px dashed var(--nv-green);
}
.markdown-body a:hover {
    border-bottom-style: solid;
}

/* 保持你原本的代码块样式 */
.markdown-body pre {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* 稍微加点阴影更好看 */
}
.markdown-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}
/* 行内代码样式 (非代码块) */
.markdown-body p code,
.markdown-body li code {
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    color: #d63384; /* 类似 GitHub 的洋红色，或者用你的主题色 */
    font-size: 0.85em;
}

.copy-btn {
    /* 保持你原有的 copy-btn 样式不变 */
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px; color: #aaa; cursor: pointer; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; opacity: 0;
    transition: all 0.2s ease;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.markdown-body pre:hover .copy-btn { opacity: 1; }

/* Modal */
#article-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px); z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
#article-modal.visible { opacity: 1; pointer-events: auto; }

.article-container {
    max-width: 850px;
    margin: 40px auto;
    height: 90vh;
    /* 关键改动 1: 自身不滚动，改为隐藏溢出 */
    overflow: hidden;
    /* 关键改动 2: 去掉内边距 (移给内容区) */
    padding: 0;

    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.1);
    transform: translateY(60px) scale(0.95);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);

    /* 关键改动 3: 启用 Flex 布局，让内容填充剩余空间 */
    display: flex;
    flex-direction: column;
    position: relative; /* 保证 Close 按钮绝对定位是相对于这个卡片的 */
}
#article-modal.visible .article-container { transform: translateY(0) scale(1); opacity: 1; }

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;

    /* 修改：增强背景，因为文字会从它下面滑过，加点毛玻璃效果更精致 */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);

    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.4rem;
    color: #555;

    /* 关键：确保按钮永远在文字上面 */
    z-index: 100;
}
.close-btn:hover { background: var(--nv-green); color: white; transform: rotate(90deg); }

@media (max-width: 1024px) {
    body { flex-direction: column; overflow: auto; }
    aside { width: 100%; height: auto; padding: 20px; position: sticky; top: 0; backdrop-filter: blur(20px); border-bottom: 1px solid #eee; }
    .sidebar-top { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 0; }
    .nav-menu { flex-direction: row; overflow-x: auto; gap: 10px; }
    .sidebar-footer { display: none; }
    main { padding: 30px 20px; }
    .bento-grid, #arsenal-categories, #arsenal-detail { grid-template-columns: 1fr; }
    #arsenal-detail.visible { display: flex; flex-direction: column; }
    .arsenal-sidebar { border-right: none; border-bottom: 1px solid #eee; max-height: 200px; overflow-y: auto; }
    .hero-title { font-size: 3.5rem; }
    .stat-row { gap: 30px; }
    /* 覆盖原本的样式 */
    .article-container { padding: 0; }
    /* 调整移动端内容内边距 */
    #markdown-content { padding: 30px 20px; }
}
/* --- 极客风格 Hero 增强 (追加到样式表末尾) --- */

/* 1. 呼吸灯卡片效果 */
#hero-content {
    /* 覆盖原有的背景设置 */
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(118, 185, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    animation: borderBreath 4s infinite ease-in-out;
    position: relative;
    overflow: hidden;
}
@keyframes borderBreath {
    0%, 100% { border-color: rgba(118, 185, 0, 0.15); box-shadow: 0 10px 40px rgba(118, 185, 0, 0.05); }
    50% { border-color: rgba(118, 185, 0, 0.6); box-shadow: 0 10px 60px rgba(118, 185, 0, 0.2); }
}

/* 2. 伪终端头部 */
.terminal-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #666;
    background: rgba(0,0,0,0.04);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 24px;
    border: 1px solid rgba(0,0,0,0.06);
}
.cmd-prompt { color: var(--nv-green); font-weight: 700; margin-right: 8px; }

/* 3. 故障风标题 */
.hero-title {
    position: relative;
    color: #000;
    /* 保持原有大小，但增加相对定位 */
}
.glitch-effect::before, .glitch-effect::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8); /* 遮罩背景 */
}
.glitch-effect::before {
    left: 2px; text-shadow: -1px 0 #ff00c1; clip-path: inset(44% 0 61% 0);
    animation: glitch-anim 4s infinite linear alternate-reverse;
}
.glitch-effect::after {
    left: -2px; text-shadow: -1px 0 #00fff9; clip-path: inset(5% 0 80% 0);
    animation: glitch-anim2 4s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { clip-path: inset(10% 0 90% 0); }
    20% { clip-path: inset(80% 0 10% 0); }
    100% { clip-path: inset(40% 0 60% 0); }
}
@keyframes glitch-anim2 {
    0% { clip-path: inset(60% 0 40% 0); }
    20% { clip-path: inset(10% 0 80% 0); }
    100% { clip-path: inset(30% 0 50% 0); }
}

/* 4. 打字机区域布局 */
.hero-subtitle {
    display: flex;
    align-items: baseline; /* 关键：这会让光标乖乖躺在文字的基线上，不再悬空 */
    font-family: 'JetBrains Mono', monospace;
    min-height: 1.5em;
    margin-bottom: 60px; /* 保持原本的间距 */
}
.static-text { color: #888; margin-right: 10px; font-weight: 400; }
.dynamic-text { color: var(--nv-green); font-weight: 700; }
.cursor {
    /* 1. 关键：清除之前的所有形状样式 */
    background: none !important;   /* 去掉背景色（那个绿色小矩形） */
    border: none !important;       /* 去掉边框 */
    width: auto !important;        /* 宽度由文字决定 */
    height: auto !important;       /* 高度由文字决定 */

    /* 2. 文字样式 */
    display: inline-block;
    color: var(--nv-green);        /* 文字颜色设为绿色 */
    font-weight: 900;              /* 加粗 */
    margin-left: 2px;

    /* 3. 动画 */
    animation: blink 1s infinite step-end;
}

/* --- Filter & Search UI --- */
.filter-container { margin-bottom: 40px; }

.search-box {
    position: relative;
    max-width: 400px;
    margin-bottom: 20px;
}
.search-box i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-sub);
}
.search-box input {
    width: 100%;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 12px 12px 12px 42px;
    border-radius: 12px;
    font-family: 'JetBrains Mono';
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s;
}
.search-box input:focus {
    background: #fff;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 4px var(--nv-green-dim);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-tag {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono';
    cursor: pointer;
    border: 1px solid transparent;
    background: rgba(0,0,0,0.04);
    color: var(--text-sub);
    transition: 0.2s;
}
.filter-tag:hover { background: rgba(0,0,0,0.08); }
.filter-tag.active {
    background: var(--nv-green);
    color: #fff;
    box-shadow: 0 4px 12px rgba(118, 185, 0, 0.3);
}

/* 新增：让文章内容区域负责滚动 */
#markdown-content {
    flex: 1; /* 占满卡片剩余高度 */
    overflow-y: auto; /* 这里开启滚动 */
    padding: 60px; /* 把原本容器的内边距移到这里 */
    scroll-behavior: smooth;
}

/* --- Custom Scrollbar (全局美化滚动条) --- */

/* 1. Webkit 核心 (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 6px;  /* 竖向滚动条宽度 */
    height: 6px; /* 横向滚动条高度 (用于代码块) */
}

/* 轨道：完全透明，不遮挡背景 */
::-webkit-scrollbar-track {
    background: transparent;
}

/* 滑块：平时是淡淡的半透明灰 */
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px; /* 圆角 */
    border: 1px solid rgba(255,255,255,0.1); /* 微微的内描边增加质感 */
}

/* 交互：鼠标悬停时变身主题绿 */
::-webkit-scrollbar-thumb:hover {
    background: var(--nv-green);
    cursor: pointer;
}

/* 2. Firefox 适配 */
* {
    scrollbar-width: thin; /* 变细 */
    scrollbar-color: rgba(0,0,0,0.2) transparent; /* 滑块颜色 轨道颜色 */
}

/* 3. 特别优化：代码块的滚动条 */
/* 让代码块的滚动条稍微明显一点，因为它背景是黑的 */
.markdown-body pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}
.markdown-body pre::-webkit-scrollbar-thumb:hover {
    background: var(--nv-green);
}

/* --- Arsenal Layout & Animation Fix --- */
#arsenal {
    position: relative; /* 关键：作为定位基准 */
    min-height: 800px;  /* 关键：给容器一个最小高度，防止详情页绝对定位后，下方内容塌陷 */
}

.arsenal-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 60; /* 保证在侧边栏之上 */

    width: 44px;
    height: 44px;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.2rem;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* 弹性过渡 */
}

.arsenal-back-btn:hover {
    background: var(--nv-green);
    color: #fff;
    transform: translateX(-4px) scale(1.05); /* 向左位移提示“返回” */
    box-shadow: 0 8px 20px var(--nv-green-glow);
    border-color: transparent;
}

#arsenal-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 分类列表淡出状态 */
#arsenal-categories.faded {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

.arsenal-cat-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 240px;
}

/* 详情页 - 绝对定位 + 动画核心 */
#arsenal-detail {
    display: none; /* JS 控制开关 */
    position: absolute; /* 绝对定位实现覆盖动画 */
    z-index: 50;
    overflow: hidden; /* 动画时隐藏内部溢出 */

    /* 继承 .glass-card 的样式 */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);

    /* 关键布局：强制左右分栏，与原来保持一致 */
    grid-template-columns: 260px 1fr;

    /* 动画参数 */
    transform-origin: center center;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* 详情页内部元素 - 初始隐藏，防止动画时错位 */
.arsenal-sidebar, .arsenal-content {
    opacity: 0;
    transition: opacity 0.3s ease 0.2s; /* 延迟显示，等盒子变大后再出来 */
}

/* 展开完成后的状态 */
#arsenal-detail.expanded .arsenal-sidebar,
#arsenal-detail.expanded .arsenal-content {
    opacity: 1;
}

#arsenal-detail:hover {
    border-color: var(--nv-green);
    /* 保持详情页较大的阴影扩散半径(60px)，但颜色换成主题绿 */
    box-shadow: 0 20px 60px var(--nv-green-glow);
}

/* 内部原有样式保持不变 */
.arsenal-sidebar {
    background: rgba(249,249,251,0.6);
    border-right: 1px solid var(--glass-border);

    display: flex;
    flex-direction: column;

    /* 关键修改： */
    /* 1. 顶部留出 80px 给按钮，作为死区域 */
    padding-top: 80px;
    /* 2. 自身隐藏溢出，禁止整个侧边栏滚动 */
    overflow: hidden;
}

/* 2. 列表容器：负责滚动 */
/* 我们需要给列表容器单独设置样式，HTML 中它是 #arsenal-item-list */
#arsenal-item-list {
    flex: 1; /* 占满剩余高度 */
    overflow-y: auto; /* 只有这部分区域滚动 */
    padding: 0 20px 20px 20px; /*原本侧边栏的内边距移到这里 */

    /* 锦上添花：顶部增加透明渐变遮罩 */
    /* 让文字滚到顶部时有一点柔和的淡出效果，而不是生硬切断 */
    mask-image: linear-gradient(to bottom, transparent 0px, black 12px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 12px);
}
.arsenal-content {
    padding: 40px;
    overflow-y: auto;
}

/* 移动端适配 */
@media (max-width: 1024px) {
    #arsenal-detail {
        grid-template-columns: 1fr; /* 移动端改为单列 */
    }
    .arsenal-sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;
        max-height: 200px;
    }
}

@media (max-width: 1024px) {
    .arsenal-sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;

        padding-top: 80px;
        /* 移动端需要限制总高度，否则会撑破屏幕 */
        height: 300px;
        max-height: 40vh;
    }
}
/* --- Search Box Styles (Fixed) --- */
.search-box {
    position: relative;
    max-width: 400px;
    margin-bottom: 20px;
}

/* 1. 专门针对左侧搜索图标的样式 */
/* 使用 :first-of-type 确保只选中第一个图标(放大镜) */
.search-box i:first-of-type {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
    pointer-events: none; /* 关键：让鼠标穿透图标，直接点到输入框 */
    z-index: 5;
}

/* 2. 专门针对右侧清除按钮的样式 */
.search-box .clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    /* 关键修复：重置 left 属性，防止被上面的通用样式拉伸 */
    left: auto;

    color: var(--text-sub);
    cursor: pointer;
    display: none; /* 默认隐藏 */

    /* 定义固定大小的点击区域，不再覆盖整个框 */
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;

    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10; /* 确保浮在输入框上面 */
}

.search-box .clear-btn:hover {
    color: #fff; /* 悬浮变白 */
    background: var(--nv-green); /* 背景变绿，更明显的交互反馈 */
    transform: translateY(-50%) scale(1.1); /* 微微放大 */
}

.search-box input {
    width: 100%;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);

    /* 内边距：左边留给放大镜，右边留给清除按钮 */
    padding: 12px 40px 12px 42px;

    border-radius: 12px;
    font-family: 'JetBrains Mono';
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s;
}
.search-box input:focus {
    background: #fff;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 4px var(--nv-green-dim);
}