/* ------------------------------------
 * Theme: Blueprint & Aero (Future Lab)
 * Concept: Engineering Precision & Glassmorphism
 * Author: Gemini for Typecho (Tuned for Musk)
 * --------------------------------- */

:root {
    /* 核心色盘 */
    --color-primary: #0052D4;    /* 工业深蓝 */
    --color-accent: #4364F7;     /* 活力亮蓝 */
    --color-vivid: #6FB1FC;      /* 天空青 */

    /* 文字系统 */
    --text-main: #1d1d1f;
    --text-muted: #86868b;

    /* 界面材质 */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    --blur-strength: 20px;

    /* 布局参数 */
    --radius-lg: 16px;
    --radius-sm: 8px;
    --grid-color: rgba(0, 82, 212, 0.03);
}

/* ------------------------------------
 * 1. 基础环境 (Environment)
 * ------------------------------------ */

body {
    /* 工程网格纸背景 */
    background-color: #f5f7fa;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;

    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "PingFang SC", "Microsoft Yahei", sans-serif;
    font-size: 16px;
    line-height: 1.8;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------
 * 2. 头部导航 (Aero Header)
 * ------------------------------------ */

#header {
    position: sticky;
    top: 20px;
    z-index: 100;

    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));

    margin: 0 auto 40px;
    padding: 15px 30px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: var(--glass-shadow);

    max-width: 960px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.description {
    display: none; /* 极简 */
}

/* 顶部导航菜单 */
#nav-menu {
    margin: 0;
    display: flex;
    gap: 10px;
}

#nav-menu a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

#nav-menu a:hover,
#nav-menu .current {
    background: rgba(0, 82, 212, 0.06);
    color: var(--color-primary);
}

/* 搜索框（修复按钮掉到下面的问题） */
#search {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#search input {
    background: rgba(0,0,0,0.03);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.85rem;
    width: 150px;
    transition: all .3s ease;
}

#search input:focus {
    background: #fff;
    width: 200px;
    outline: none;
    box-shadow: 0 0 0 3px rgba(67,100,247,0.1);
}

#search button {
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: .5;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#search button:hover {
    opacity: .9;
}

/* ------------------------------------
 * 3. 内容区域 (Main & Posts)
 * ------------------------------------ */

/* 让主内容区域有独立的最大宽度，和 header 对齐 */
#main {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 如果你有 .container 类也一并控制 */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 文章卡片 */
.post {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}

/* 装饰性顶部线条（hover 时点亮） */
.post::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-vivid));
    opacity: 0;
    transition: opacity .3s ease;
}
.post:hover::before { opacity: 1; }

/* 标题 */
.post-title {
    font-size: 2rem;
    margin-bottom: .5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.post-title a {
    color: var(--text-main);
}
.post-title a:hover {
    color: var(--color-primary);
}

/* ------------------------------------
 * 4. 文章 Meta 信息（作者/时间/分类/评论）
 *    针对你的 <ul class="post-meta"><li>…</li></ul>
 *    设计：一行展示，小点分隔，窄屏自动优雅换行
 * ------------------------------------ */

.post-meta {
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-size: 0.85rem;
    color: var(--text-muted);

    display: flex;
    align-items: center;
    flex-wrap: wrap;      /* 小屏可换行 */
    column-gap: 16px;
    row-gap: 4px;

    margin-bottom: 30px;
    padding: 0;
    list-style: none;
}

.post-meta li {
    margin: 0;
    padding: 0;
    position: relative;
    white-space: nowrap;  /* 每个模块保持在一行 */
    padding-left: 10px;   /* 为分隔点预留空间 */
}

/* 第一项（作者）左侧不要点 */
.post-meta li:first-child {
    padding-left: 0;
}

/* 之后的项左侧加一个点 */
.post-meta li + li::before {
    content: "·";
    position: absolute;
    left: 0;
    top: 0;
}

/* ------------------------------------
 * 5. 文章正文排版
 * ------------------------------------ */

.post-content {
    font-size: 1.05rem;
    color: #374151;
}

.post-content h2,
.post-content h3 {
    position: relative;
    margin-top: 2em;
    margin-bottom: 1em;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.post-content h2::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--color-primary);
}

/* 代码块：Mac 窗口风格 */
pre {
    background: #282c34;
    color: #abb2bf;
    border-radius: var(--radius-sm);
    padding: 40px 20px 20px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
}

/* 模拟 Mac 红绿灯 */
pre::before {
    content: "● ● ●";
    position: absolute;
    top: 10px;
    left: 15px;
    color: rgba(255,255,255,0.2);
    font-size: 12px;
    letter-spacing: 2px;
}

code {
    background: rgba(0, 82, 212, 0.08);
    color: var(--color-primary);
    font-family: "Fira Code", monospace;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* 引用块：学术笔记风格 */
blockquote {
    background: #f9fafb;
    border-left: 4px solid var(--color-accent);
    margin: 2em 0;
    padding: 20px 30px;
    font-style: italic;
    color: #555;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 图片 */
.post-content img {
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 20px 0;
    display: block;
    max-width: 100%;
}

/* ------------------------------------
 * 6. 分页、侧栏、页脚
 * ------------------------------------ */

/* 分页导航 */
.page-navigator {
    margin: 50px 0;
}
.page-navigator li {
    display: inline-block;
    margin: 0 5px;
}
.page-navigator a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all .2s;
}
.page-navigator a:hover,
.page-navigator .current a {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 82, 212, 0.3);
}

/* 侧边栏组件 */
.widget {
    margin-bottom: 40px;
}
.widget-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 700;
}
.widget-list li {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}

/* 页脚 */
#footer {
    margin-top: 60px;
    padding: 40px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.03);
}

/* ------------------------------------
 * 7. 响应式调整
 * ------------------------------------ */

@media (max-width: 768px) {
    #header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        top: 0;
        border-radius: 0 0 20px 20px;
    }

    #main,
    .container {
        padding: 0 15px;
    }

    .post {
        padding: 20px;
    }

    .post-title {
        font-size: 1.5rem;
    }
}