/* --- 1. 基础设置与变量 --- */
:root {
    --bg-color: #F0F2F5;
    --blue: #0033CC;
    --orange: #FF4500;
    --yellow: #FFD700;
    --black: #111;
    --card-bg: rgba(255, 255, 255, 0.90);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    cursor: none; /* 隐藏默认鼠标 */
}

a, button, input, textarea {
    cursor: none; /* 强制所有元素隐藏默认鼠标 */
}

body {
    background-color: var(--bg-color);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--black);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- 2. 自定义光标 (核心交互) --- */
.cursor-dot {
    width: 30px;
    height: 30px;
    background-color: var(--blue);
    border-radius: 50%;
    position: fixed;
    top: -15px; /* 居中校正 */
    left: -15px;
    pointer-events: none; /* 必须！防止遮挡点击 */
    z-index: 9999;
    mix-blend-mode: difference; /* 反色效果 */
    /* 仅对透明度做过渡，位置变化不做过渡，解决延迟感 */
    transition: opacity 0.2s; 
    opacity: 0;
}

/* 鼠标点击时变小 */
body:active .cursor-dot {
    transform: scale(0.8);
}

/* --- 3. 动态背景 (New Ugly 风格) --- */
.kinetic-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* 视差层 */
.layer {
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    pointer-events: none;
    transition: transform 0.1s linear; /* 视差平滑度 */
}

/* 形状通用样式 */
.shape {
    position: absolute;
    mix-blend-mode: multiply; 
}

/* 蓝色圆形 */
.shape-circle-blue {
    width: 45vw; height: 45vw;
    background: var(--blue);
    border-radius: 50%;
    top: -15%; left: -10%;
    opacity: 0.8;
}
.floating { animation: float 10s ease-in-out infinite alternate; }

/* 橙色扇形 */
.shape-arc-orange {
    width: 40vw; height: 40vw;
    background: var(--orange);
    border-radius: 0 0 100% 0;
    bottom: 5%; right: -10%;
    opacity: 0.8;
}
.rotating { animation: rotate-arc 25s linear infinite; transform-origin: top left; }

/* 黄色三角 */
.shape-triangle-yellow {
    width: 0; height: 0;
    border-left: 15vw solid transparent;
    border-right: 15vw solid transparent;
    border-bottom: 25vw solid var(--yellow);
    top: 30%; left: 40%;
    opacity: 0.7;
}
.drifting { animation: drift 18s ease-in-out infinite alternate-reverse; }

/* 装饰网格背景 */
.shape-grid-line {
    width: 100%; height: 100%;
    background-image: radial-gradient(#aaa 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.15;
}

/* --- 4. 动画关键帧 --- */
@keyframes float { 0% {transform:translateY(0)} 100% {transform:translateY(40px)} }
@keyframes rotate-arc { 0% {transform:rotate(0deg)} 100% {transform:rotate(360deg)} }
@keyframes drift { 0% {transform:rotate(0deg)} 100% {transform:rotate(15deg) scale(1.1)} }

/* --- 5. 布局与导航 --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
    background: transparent;
    position: relative;
    z-index: 100;
}

.logo {
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: -1px;
    font-family: 'Arial Black', sans-serif;
}
.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.links a {
    text-decoration: none;
    color: var(--black);
    margin-left: 30px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    position: relative;
}
.links a::after {
    content: '';
    position: absolute;
    width: 0; height: 3px;
    bottom: -5px; left: 0;
    background: var(--blue);
    transition: width 0.3s;
}
.links a:hover::after, .links a.active::after { width: 100%; }

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
}

/* --- 6. 头部与卡片 --- */
.hero-section {
    margin-bottom: 100px;
    text-align: center;
}

.hero-section h1 {
    font-size: 6rem;
    line-height: 0.85;
    font-weight: 800;
    letter-spacing: -3px;
    margin-bottom: 25px;
    color: var(--black);
}

.highlight {
    color: transparent;
    -webkit-text-stroke: 2px var(--blue);
    font-style: italic;
}

.blog-card {
    background: var(--card-bg);
    padding: 45px;
    margin-bottom: 50px;
    border: 2px solid var(--black);
    box-shadow: 15px 15px 0 var(--black); /* 硬阴影 */
    transition: transform 0.2s;
    position: relative;
}

.blog-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 20px 20px 0 var(--blue); /* 悬停变色 */
}

/* --- 修复对齐问题 --- */

.card-meta {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    
    /* 关键修改 1：使用 Flex 布局 */
    display: flex; 
    
    /* 关键修改 2：强制垂直居中对齐 */
    align-items: center; 
    
    gap: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tag-pill {
    background: var(--blue);
    color: white;
    
    /* 关键修改 3：调整内边距，适应汉字高度 */
    padding: 4px 8px; 
    
    /* 关键修改 4：锁定行高为 1，防止汉字撑大格子 */
    line-height: 1; 
    
    /* 选做：微调位置，如果觉得汉字还是偏高，可以取消下面这行的注释 */
    /* transform: translateY(1px); */
}

.date-text {
    /* 确保日期数字也是垂直居中的 */
    line-height: 1;
    display: flex;
    align-items: center;
}

.card-title {
    font-size: 2.8rem;
    margin-bottom: 25px;
    line-height: 1;
    letter-spacing: -1px;
}

/* --- 7. Markdown 内容样式 --- */
.card-content {
    font-size: 1.1rem;
    line-height: 1.6;
}
.card-content h1, .card-content h2 { margin-top: 1.5em; color: var(--blue); }
.card-content blockquote { border-left: 4px solid var(--black); padding-left: 15px; font-style: italic; background: #eee; }
.card-content code { background: #eee; padding: 2px 5px; font-family: monospace; }
.card-content pre { background: #eee; padding: 15px; overflow-x: auto; }



.site-footer {
    text-align: center;
    margin-top: 100px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    border-top: 2px solid var(--black);
    padding-top: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 友链 */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.friend-card {
    background: white;
    padding: 20px;
    border: 2px solid var(--black);
    text-decoration: none;
    color: var(--black);
    transition: all 0.2s;
    text-align: center;
    display: block;
}
.friend-card:hover {
    background: var(--blue);
    color: white;
    box-shadow: 10px 10px 0 var(--black);
    transform: translate(-5px, -5px);
}
.friend-name { font-weight: 900; font-size: 1.2rem; display: block; margin-bottom: 5px; }
/* 修改前是 monospace，现在改成继承系统的无衬线字体 */
.friend-desc { 
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* 关键修改 */
    font-size: 0.9rem; 
    color: #666; /* 稍微深一点的灰色，增加可读性 */
    line-height: 1.4; /* 增加一点行高 */
    margin-top: 8px; /* 和名字拉开一点距离 */
    display: block; /* 确保它独占一行 */
}

/* 顺便优化一下名字的样式，让它更突出 */
.friend-name { 
    font-weight: 900; 
    font-size: 1.3rem; /* 稍微大一点 */
    display: block; 
    margin-bottom: 5px; 
    color: var(--black);
    text-transform: uppercase; /* 名字自动大写，更整齐 */
}

/* 悬停时，描述文字变白 */
.friend-card:hover .friend-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* 关于页 */
.about-layout { font-size: 1.2rem; line-height: 1.8; }
.stats-box {
    border: 2px dashed var(--black);
    padding: 20px;
    margin: 30px 0;
    font-family: monospace;
    background: rgba(255,255,255,0.5);
}

/* 编辑器 */
.editor-box { display: flex; flex-direction: column; gap: 20px; }
.editor-input, .editor-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--black);
    background: white;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
}
.editor-textarea {
    height: 300px;
    resize: vertical;
    font-family: monospace;
}
.code-output {
    background: #eee;
    padding: 20px;
    border: 1px dashed var(--black);
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    display: none;
}
.action-btn {
    background: var(--blue);
    color: white;
    border: none;
    padding: 15px;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
}
.action-btn:hover { background: var(--black); }

/* --- 9. 手机/平板 深度适配 --- */
/* --- 手机端导航栏与布局 (核心修改) --- */

/* 1. 默认状态（电脑端）隐藏切换按钮 */
.nav-toggle { display: none; }
.nav-header { display: contents; } /* 让内部元素像直接在父容器里一样 */

/* --- 2. 手机端深度适配 (小于 768px) --- */
@media (max-width: 768px) {
    /* A. 全局设定 */
    * { cursor: auto !important; }
    .cursor-dot { display: none !important; }
    body { overflow-x: hidden; width: 100%; }

    /* B. 导航栏：折叠式设计 */
    .top-nav {
        flex-direction: column; /* 改为垂直排列 */
        align-items: stretch; /* 宽度拉满 */
        padding: 0; /* 移除内边距，交给内部元素 */
        background: rgba(240, 242, 245, 0.95); /* 背景加深，防止透视干扰 */
        backdrop-filter: blur(10px);
        position: sticky; /* 粘在顶部 */
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .nav-header {
        display: flex; /* 恢复 Flex 布局 */
        justify-content: space-between;
        align-items: center;
        padding: 20px; /* 头部保留间距 */
    }

    .logo { font-size: 1.4rem; }

    /* 菜单开关按钮 */
    .nav-toggle {
        display: block; /* 手机上显示 */
        background: transparent;
        border: 2px solid var(--black);
        padding: 5px 12px;
        font-weight: bold;
        font-family: monospace;
        font-size: 1rem;
    }

    /* 链接列表容器 */
    .links {
        display: none; /* 默认隐藏 (收起来) */
        flex-direction: column;
        width: 100%;
        background: white;
        border-top: 1px solid var(--black);
        padding: 20px 0;
        animation: slideDown 0.3s ease-out; /* 展开动画 */
    }
    
    /* 当 JS 加上 .active 类时显示 */
    .links.active { display: flex; }

    .links a {
        margin: 0;
        padding: 15px 20px;
        font-size: 1.2rem; /* 菜单字号大一点，方便点 */
        border-bottom: 1px solid #eee;
        width: 100%;
        display: block;
        text-align: center; /* 居中对齐 */
    }
    .links a::after { display: none; } /* 手机上不要下划线动画了 */

    /* C. 头部标语比例调整 */
    .container { padding: 20px; }
    
    .hero-section { 
        margin-top: 20px; 
        margin-bottom: 40px; 
        text-align: left; /* 手机上左对齐更有设计感 */
    }
    
    .hero-section h1 {
        font-size: 4rem; /* 不用 vw 了，用固定的 rem 防止过大 */
        line-height: 0.9;
    }

    /* D. 文章卡片比例修复 (解决"很怪"的问题) */
    .blog-card {
        padding: 25px 20px;
        margin-bottom: 25px;
        box-shadow: 6px 6px 0 var(--black);
        /* 移除 flex 里的居中限制，让内容自然流式 */
    }

    .card-meta {
        font-size: 0.75rem;
        margin-bottom: 15px;
        gap: 10px;
    }

    .card-title {
        font-size: 1.8rem; /* 标题改小，更协调 */
        line-height: 1.2; /* 增加行高，防止拥挤 */
        margin-bottom: 15px;
    }

    .card-content p {
        font-size: 1rem;
        line-height: 1.6;
        color: #444;
        /* 限制摘要显示的行数，防止首页太长 */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .read-more {
        width: 100%;
        text-align: center;
        margin-top: 15px;
        padding: 12px;
    }
    
    /* 动画 */
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
/* --- 按钮样式整合 (Back 和 Enter) --- */
.read-more, .back-btn {
    display: inline-block;
    text-decoration: none;
    background: var(--black);
    color: white;
    padding: 12px 25px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    border: none;
    transition: all 0.2s;
    cursor: none; /* 保持自定义光标 */
}

/* 悬停效果 */
.read-more:hover, .back-btn:hover {
    background: var(--blue);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
    transform: translate(-2px, -2px);
}

/* Back 按钮特有的间距 */
.back-btn {
    margin-bottom: 30px;
}
/* Enter 按钮特有的间距 */
.read-more {
    margin-top: 20px;
}

html {
    /* 现代方案：预留滚动条空间 */
    scrollbar-gutter: stable;
}

/* --- 10. 滚动条美化 (Webkit内核: Chrome/Edge/Safari) --- */
::-webkit-scrollbar {
    width: 16px; /* 故意做宽一点，更有复古机械感 */
}

/* 轨道背景 */
::-webkit-scrollbar-track {
    background: #ffffff;
    border-left: 2px solid var(--black); /* 左侧加一条黑线分割 */
}

/* 滑块本身 */
::-webkit-scrollbar-thumb {
    background: var(--blue); /* 品牌蓝 */
    border: 2px solid var(--black); /* 黑色硬边框 */
    border-radius: 0; /* 不要圆角，要直角 */
}

/* 鼠标悬停在滑块上 */
::-webkit-scrollbar-thumb:hover {
    background: var(--black); /* 悬停变黑 */
}