/* =========================================
   PROJECT: TERRA-ZERO (Theme Arknights Modified)
   VERSION: 2.0 (High Contrast & Dynamic)
   ========================================= */

/* --- 核心变量 (Core Variables) --- */
:root {
    --bg-color: #121212;        /* 网页深黑背景 */
    --card-bg: #1E1E1E;         /* 卡片背景 */
    --accent: #F2C94C;          /* 罗德岛黄 (Rhodes Island Yellow) */
    --text-main: #E0E0E0;       /* 主文字 (亮灰) */
    --text-sub: #888;           /* 副文字 (中灰) */
    --line: #333;               /* 分割线 */
    
    /* 字体栈 */
    --font-main: 'Roboto Condensed', sans-serif;
    --font-header: 'Oswald', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

/* --- 全局基础 (Global Reset) --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.7;
    position: relative;
    overflow-x: hidden; /* 防止背景动画撑开滚动条 */
}

a { color: inherit; text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent); }

/* --- 动态网格背景 (Dynamic Grid Background) --- */
body::before {
    content: "";
    position: fixed;
    top: -50%; left: -50%; 
    width: 200%; height: 200%;
    
    /* 深色网格线 */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    
    /* 极慢的旋转动画，制造视差感 */
    animation: bg-drift 60s linear infinite;
    z-index: -999;
    pointer-events: none;
}

@keyframes bg-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, 20px) rotate(2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* --- 布局容器 (Layout) --- */
.container {
    max-width: 1200px; /* 稍微加宽 */
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 280px 1fr; /* 左侧定宽，右侧自适应 */
    gap: 60px;
}

@media (max-width: 860px) {
    .container { grid-template-columns: 1fr; }
}

/* 顶部装饰条 */
.top-line {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: var(--accent);
    z-index: 999;
    box-shadow: 0 0 10px var(--accent);
}

/* 底部水印 */
.watermark {
    position: fixed; bottom: 20px; right: 20px; font-family: var(--font-header);
    font-size: 80px; opacity: 0.03; font-weight: 900; pointer-events: none; z-index: -1;
}

/* =========================================
   侧边栏 (SIDEBAR)
   ========================================= */

/* 个人终端卡片 */
.profile-card {
    background: var(--card-bg);
    padding: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
    border-top: 2px solid var(--accent);
    margin-bottom: 40px;
    position: relative;
}

/* 头像 */
/* --- 修复：头像质感 (Noise & Scanlines) --- */
.avatar-box {
    width: 100%; height: 220px; 
    position: relative; overflow: hidden; background: #000;
}

/* 图片处理：增强对比度，带一点旧电视的偏色 */
.avatar-img {
    width: 100%; height: 100%; object-fit: cover;
    /* 核心：高对比 + 灰度 + 微弱的深褐色(sepia)带来陈旧感 */
    filter: grayscale(100%) contrast(150%) sepia(20%) brightness(0.9);
    transition: 0.3s;
    opacity: 0.9;
}

/* 悬停时恢复真彩 */
.profile-card:hover .avatar-img {
    opacity: 1; filter: grayscale(0%);
}

/* 核心：噪点与扫描线层 */
.avatar-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* 第一层：扫描线 (repeating-linear) */
    /* 第二层：噪点模拟 (radial-gradient 叠加) */
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.5) 3px
        ),
        radial-gradient(rgba(0,0,0,0.2) 20%, transparent 20%) 0 0,
        radial-gradient(rgba(0,0,0,0.2) 20%, transparent 20%) 2px 2px;
        
    background-size: 100% 4px, 4px 4px, 4px 4px; /* 控制噪点颗粒大小 */
    pointer-events: none; z-index: 1;
    mix-blend-mode: overlay; /* 混合模式让噪点融合进图片 */
}

.status-indicator {
    position: absolute; top: 15px; right: 15px; width: 8px; height: 8px;
    background: #00FF00; box-shadow: 0 0 5px #00FF00; z-index: 2;
}

/* ID信息 */
.id-info {
    padding: 20px 25px 10px; display: flex; justify-content: space-between; align-items: flex-end;
}
.id-name {
    font-family: var(--font-header); font-size: 2rem; line-height: 1; color: #FFF;
    text-transform: uppercase; letter-spacing: 1px;
}
.id-rank {
    background: #333; color: var(--accent); padding: 2px 6px;
    font-size: 0.75rem; font-family: var(--font-code); border-radius: 2px;
}

/* 简介与数据 */
.data-line {
    margin: 10px 25px; border-bottom: 1px dashed #444; color: #555;
    font-size: 0.7rem; font-family: var(--font-code); text-align: right;
}
.bio-text {
    padding: 0 25px 20px; font-size: 0.9rem; color: #999; line-height: 1.4;
}

/* 社交矩阵 */
.social-matrix {
    display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #333;
}
.social-btn {
    display: flex; justify-content: center; align-items: center; height: 50px;
    color: #666; border-right: 1px solid #333; background: #1a1a1a;
}
.social-btn:hover { background: var(--accent); color: #000; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }

/* --- 导航菜单 (已修复太暗问题) --- */
.nav-item { margin-bottom: 5px; }
.nav-link {
    display: flex; justify-content: space-between; padding: 12px 0;
    border-bottom: 1px solid #222; 
    font-family: var(--font-header); letter-spacing: 1px;
    color: #bbbbbb; /* 提亮 */
    font-weight: 600;
}
.nav-link:hover {
    color: #ffffff; padding-left: 10px; border-bottom-color: var(--accent);
}

/* --- 侧边栏分类库 (Database Index) --- */
.category-widget { margin-top: 40px; border-top: 1px solid #333; padding-top: 20px; }
.widget-title {
    font-family: var(--font-code); color: #666; font-size: 0.8rem; margin-bottom: 15px;
}
.category-list { list-style: none; }
.category-item { margin-bottom: 8px; }
.category-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 15px; background: #161616; border: 1px solid #2a2a2a;
    color: #a0a0a0; /* 提亮 */
    font-family: var(--font-header); font-size: 0.9rem;
    border-left: 3px solid transparent; transition: all 0.2s;
}
.category-link:hover {
    background: #222; border-color: #444; border-left-color: var(--accent);
    color: #fff; transform: translateX(5px); padding-left: 20px;
}
.cate-count { font-family: var(--font-code); font-size: 0.75rem; color: #555; }
.category-link:hover .cate-count { color: var(--accent); }


/* =========================================
   主内容区 (MAIN CONTENT)
   ========================================= */

.section-header {
    font-family: var(--font-code); color: #666; margin-bottom: 20px; font-size: 0.9rem;
}

/* --- 首页文章卡片 (Card) --- */
.article-card {
    position: relative; background: var(--card-bg); margin-bottom: 30px;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    transition: transform 0.3s; border-left: 0; 
}
.article-card:hover { transform: translateX(10px); background: #252525; }
.article-card:hover .card-decoration { background: var(--accent); }

.card-decoration {
    position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: #333; transition: 0.3s; z-index: 2;
}
.article-content { padding: 30px 40px 30px 50px; }

/* 元数据头 */
.meta-header {
    display: flex; justify-content: space-between; margin-bottom: 15px;
    font-family: var(--font-code); font-size: 0.85rem; color: #888;
}
.meta-date i { margin-right: 5px; color: var(--accent); }
.category-label {
    color: var(--accent); font-weight: bold; text-transform: uppercase; opacity: 0.8;
}

/* 标题摘要 */
.article-title a {
    display: block; color: #FFF; font-family: var(--font-header);
    font-size: 1.8rem; margin-bottom: 15px; text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.article-excerpt {
    color: #AAA; font-size: 1rem; margin-bottom: 25px; line-height: 1.6;
    border-left: 2px solid #333; padding-left: 15px;
}

/* 底部栏 */
.card-footer {
    display: flex; justify-content: space-between; border-top: 1px dashed #333; padding-top: 20px;
}
.read-more-btn {
    border: 1px solid var(--accent); color: var(--accent); padding: 5px 15px;
    font-family: var(--font-header); font-size: 0.9rem; text-transform: uppercase;
}
.read-more-btn:hover {
    background: var(--accent); color: #000; box-shadow: 0 0 15px rgba(242, 201, 76, 0.4);
}

/* 标签芯片 */
/* --- 修复：标签 (Tags) --- */
.tags-group {
    display: flex; 
    align-items: center; /* 垂直居中 */
    gap: 8px; /* 标签间距 */
}

.tag-chip {
    display: inline-block;
    background: #111; 
    color: #777; 
    /* 紧凑的内边距 */
    padding: 0 6px; 
    height: 24px;
    line-height: 22px; /* 确保文字垂直居中 */
    
    font-size: 0.75rem;
    font-family: var(--font-code);
    border: 1px solid #333;
    border-radius: 0; /* 保持直角 */
    transition: 0.2s;
    text-decoration: none; /* 防止下划线干扰 */
}

/* 悬停效果：变成实心高亮 */
.tag-chip:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    text-decoration: none;
}



/* =========================================
   文章阅读页 (POST DETAIL)
   ========================================= */

/* --- 新增：沉浸式阅读容器 (The Container) --- */
/* 解决背景太黑看不清正文的问题 */
.post-full {
    /* 半透明玻璃背景，从深色网页中隔离出内容 */
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    
    padding: 50px; /* 给文字留呼吸空间 */
    margin-bottom: 50px;
    border: 1px solid #333;
    border-top: 4px solid var(--accent);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6); /* 增加悬浮感 */
}

@media (max-width: 768px) { .post-full { padding: 20px; } }

.post-header { margin-bottom: 40px; border-bottom: 2px solid #333; padding-bottom: 20px; }
.post-title-large { font-family: var(--font-header); font-size: 2.5rem; color: #FFF; text-transform: uppercase; }
.post-meta { font-family: var(--font-code); color: #888; margin-top: 10px; }


/* =========================================
   MARKDOWN TYPOGRAPHY (正文排版)
   ========================================= */

.markdown-body { color: #d0d0d0; /* 正文稍微提亮 */ }

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: var(--font-header); color: #FFF;
    margin-top: 1.5em; margin-bottom: 0.8em;
    border-left: 4px solid var(--accent); padding-left: 15px;
}

.markdown-body p { margin-bottom: 1.5em; font-size: 1.05rem; line-height: 1.8; }

/* --- 修复：代码块太黑看不清的问题 --- */
.markdown-body pre {
    background: #181818 !important; /* 深枪灰背景 */
    color: #e6e6e6 !important;      /* 浅灰白文字，强制覆盖 highlight.js */
    border: 1px solid #444;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown-body code {
    font-family: var(--font-code);
    /* 行内代码：黄色高亮 */
    color: var(--accent) !important;
    background: rgba(242, 201, 76, 0.1) !important;
    padding: 2px 6px; border-radius: 2px;
}

.markdown-body blockquote {
    border-left: 4px solid #444; background: rgba(255,255,255,0.05);
    padding: 15px 20px; color: #aaa; margin: 20px 0;
}

.markdown-body ul { padding-left: 20px; margin-bottom: 20px; }
.markdown-body li { margin-bottom: 8px; }

/* 链接优化 */
.markdown-body a {
    color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.markdown-body a:hover {
    background: var(--accent); color: #000; text-decoration: none;
}

/* =========================================
   分页器 (Paginator)
   ========================================= */
.paginator-bar { display: flex; justify-content: center; gap: 15px; margin-top: 50px; font-family: var(--font-header); }
.paginator-bar .page-number, .paginator-bar .extend {
    background: var(--card-bg); color: #666; padding: 10px 20px; border: 1px solid #333;
}
.paginator-bar .current {
    background: var(--accent); color: #000; font-weight: bold; transform: skewX(-10deg); border-color: var(--accent);
}
.paginator-bar a:hover { border-color: var(--accent); color: var(--accent); }

/* --- [PRIVATE GOODS] Sanity Monitor --- */
.sanity-container {
    margin: 15px 25px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid #333;
    border-radius: 4px;
}

.sanity-label {
    font-size: 0.7rem; color: #666; font-family: var(--font-header); margin-bottom: 5px;
}

.sanity-bar-bg {
    width: 100%; height: 6px; background: #111; border-radius: 3px; overflow: hidden; margin-bottom: 5px;
}

.sanity-bar-fill {
    height: 100%; width: 0%; background: #2D9CDB; /* 默认理智蓝 */
    transition: width 1s ease, background 0.3s;
    box-shadow: 0 0 8px rgba(45, 156, 219, 0.5);
}

.sanity-value {
    font-size: 0.75rem; font-family: var(--font-code); color: #ccc; text-align: right;
}
