
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，确保可读性 */
    background: linear-gradient(135deg, #0d1b2a, #1b263b); /* 主色调渐变背景，营造科技感 */
    color: #dcdcdc; /* 正文字体颜色，保证与背景对比，易于阅读 */
    overflow-x: hidden; /* 禁止水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部，随页面滚动 */
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8); /* 半透明黑色背景 */
    padding: 20px;
    z-index: 1000;
    display: flex;
    justify-content: center; /* 内容居中对齐 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 添加阴影，增强层次感 */
}

.navbar a {
    color: #00aaff; /* 辅色，吸引注意力 */
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    margin: 0 15px;
    transition: color 0.3s, transform 0.3s; /* 平滑过渡效果 */
}

.navbar a:hover {
    color: #ffffff; /* 悬停时变为白色 */
    transform: scale(1.05); /* 略微放大 */
}

/* 主要内容区域 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 响应式网格布局 */
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 顶部留出导航栏空间 */
}

.article-content {
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    padding: 20px;
    border-radius: 8px; /* 圆角效果 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影，增加立体感 */
}

.article-content h2,
.article-content h3 {
    font-family: 'Helvetica', sans-serif; /* 主标题使用Helvetica，体现现代感 */
    color: #ffffff;
}

.article-content p {
    font-size: 16px; /* 正文字号 */
    line-height: 1.6;
    color: #dcdcdc;
}

.article-content pre {
    background: #1b263b; /* 深色背景，突出代码块 */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-content code {
    color: #00aaff; /* 代码颜色，匹配辅色 */
    font-family: 'Courier New', Courier, monospace;
}

/* 提示信息样式 */
.notice {
    grid-column: 1 / -1; /* 横跨所有列 */
    text-align: center;
    font-size: 18px;
    color: #ffcc00; /* 点缀色，吸引视线 */
    margin-bottom: 40px;
    animation: fadeIn 2s ease-in-out; /* 进入动画 */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 图片装饰样式 */
.decorative-image {
    width: 100%;
    max-width: 320px;
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* 阴影效果 */
    transition: transform 0.3s, box-shadow 0.3s; /* 动效 */
}

.decorative-image:hover {
    transform: scale(1.05); /* 悬停放大 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); /* 加深阴影 */
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column; /* 垂直排列导航项 */
        align-items: center;
    }

    .navbar a {
        margin: 10px 0;
    }

    .container {
        padding: 100px 20px 20px 20px;
    }

    .article-content {
        padding: 15px;
    }

    .notice {
        font-size: 16px;
    }
}

/* 动态星河背景 */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 5s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

body:hover .star {
    transform: translate(var(--mouse-x), var(--mouse-y));
}

/* 渐变与层次感 */
.background {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gradient-overlay {
    background: radial-gradient(circle, rgba(255,255,255,0.1), rgba(0,0,0,0.9));
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 按钮与链接的互动效果 */
.button, .link {
    padding: 10px 20px;
    background: #00aaff;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    transition: background 0.3s, transform 0.3s;
    cursor: pointer;
}

.button:hover, .link:hover {
    background: #0088cc;
    transform: scale(1.05);
}

/* 分层设计 */
.layer1 {
    position: relative;
    z-index: 1;
}

.layer2 {
    position: absolute;
    top: 50px;
    left: 50px;
    z-index: 2;
}

.layer3 {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3;
}

/* 过渡动画 */
.page-transition {
    transition: opacity 0.5s ease-in-out;
}

.page-transition.hidden {
    opacity: 0;
}

.page-transition.visible {
    opacity: 1;
}

