/* common.css - 修复版：漫天星空+流星雨+深色主题 完整样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================================== 核心：漫天星空背景 ================================== */
/* -------------- 终极版：高密度点阵星空 -------------- */
body {
    font-family: "Microsoft Yahei", -apple-system, BlinkMacSystemFont, sans-serif;
    background: #050510; /* 更深沉的底色 */
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    height: 100%;
}

/* 这里是核心：生成成百上千个小星星 */
/* --- 核心：动态星空 --- */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* 确保在最底层 */

    /* 1. 生成密集点阵背景（固定） */
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.8) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px);

    /* 2. 控制网格大小（决定星星密度） */
    background-size: 80px 80px, 160px 160px, 320px 320px;
    background-position: 0 0, 40px 40px, 80px 80px;

    /* 3. 关键：添加闪烁动画 */
    animation: stars-twinkle 3.5s infinite alternate ease-in-out;
}

/* 4. 闪烁动画逻辑（明暗变化） */
@keyframes stars-twinkle {
    0% { opacity: 0.4; } /* 暗 */
    100% { opacity: 0.9; } /* 亮 */
}

/* 流星雨动画保留 */
/* --- 流星雨效果 --- */
body::after {
    content: "";
    position: fixed;
    top: -100px;
    left: 30%;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7));
    border-radius: 5px;
    filter: blur(1px);
    z-index: -1;
    transform: rotate(35deg);
    animation: meteor-fall 8s linear infinite;
}

/* 流星轨迹动画 */
@keyframes meteor-fall {
    0% { transform: rotate(35deg) translate(0, 0); opacity: 1; }
    100% { transform: rotate(35deg) translate(-1500px, 1500px); opacity: 0; }
}

/* ================================== 全局布局样式 ================================== */
/* 修复版：降低内容透明度，提高星空可见度 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
    z-index: 2; /* 确保内容在最上层 */
    /* 这里的透明度调到 0.15，非常透明，能完全看到背后的星星 */
    background: rgba(15, 15, 30, 0.15);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 24px;
    /* 移除白色边框，让星星透过来 */
    border: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* ================================== 导航栏样式（适配深色星空） ================================== */
.blog-header {
    background: rgba(20, 20, 40, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0;
    margin: 0 auto;
    border: none;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}
.logo a:hover {
    color: #3498db;
    transform: scale(1.05);
}

.nav-menu > ul {
    display: flex;
    gap: 32px;
}

.nav-menu > ul > li {
    position: relative;
    height: 70px;
    line-height: 70px;
}

.nav-menu > ul > li > a {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    padding: 0 12px;
    display: block;
}

.nav-menu > ul > li > a:hover,
.nav-menu > ul > li.active > a {
    color: #3498db;
    border-bottom: 3px solid #3498db;
}

/* 下拉菜单 */
.nav-menu .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(30, 30, 50, 0.95);
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.dropdown li:last-child { border-bottom: none; }
.dropdown li a {
    color: #ddd;
    padding: 12px 0;
    display: block;
}
.dropdown li a:hover {
    color: #3498db;
    padding-left: 8px;
}

/* 搜索框 */
.search-box input {
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(40, 40, 60, 0.8);
    color: #fff;
    border-radius: 24px;
    width: 220px;
    font-size: 14px;
    transition: all 0.3s;
}
.search-box input:focus {
    outline: none;
    width: 240px;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
}

/* ================================== 文章卡片样式（优化显示） ================================== */
.post-card {
    background: rgba(30, 30, 50, 0.6);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(52, 152, 219, 0.3);
}
.post-card h2 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 22px;
}
.post-meta {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 12px;
}
.read-more {
    color: #3498db;
    font-weight: 500;
    display: inline-block;
    margin-top: 8px;
}
.read-more:hover {
    padding-left: 5px;
}

/* ========== 全局布局适配（让footer固定在最底部） ========== */
html, body {
    height: 100%; /* 让html和body占满整个浏览器视口高度 */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* 子元素垂直排列 */
    background-color: #0a0a12; /* 和你的深色背景保持一致 */
}

/* 主体内容自动撑开剩余空间，把footer挤到最底部 */
.container {
    flex: 1; /* 关键：让main占满所有剩余高度 */
    /* 你原来的.container样式可以保留，这里只需要加这一句 */
}

/* ========== 备案号底部样式（适配深色主题） ========== */
.site-footer {
    text-align: center;
    font-size: 12px;
    padding: 15px 0;
    color: #aaa; /* 深色背景下清晰可见，不刺眼 */
    border-top: 1px solid #222; /* 柔和分隔线，和深色主题协调 */
    margin-top: auto; /* 自动把footer推到最底部（核心！） */
}

.site-footer a {
    color: #aaa;
    text-decoration: none;
}

.site-footer a:hover {
    color: #ccc; /* 鼠标悬停时稍微变亮 */
}