
/* 基本样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 设置全局字体 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 背景渐变 */
    color: #ffffff; /* 正文字体颜色 */
    overflow-x: hidden; /* 禁止水平滚动 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.8); /* 半透明背景 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000; /* 确保导航栏在最上层 */
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #00e6e6; /* 悬停颜色变化 */
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
}

.chapter-nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #ffcc00; /* 悬停时变为点缀色 */
}

/* 主内容样式 */
.main-content {
    padding: 100px 20px 50px 20px; /* 顶部留白以避开导航栏 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 文章标题 */
.main-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    color: #00e6e6;
    margin-bottom: 20px;
}

/* 章节标题 */
.main-content h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    color: #ffcc00;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* 段落样式 */
.main-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 代码块样式 */
.main-content pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.main-content code {
    font-family: 'Courier New', Courier, monospace;
    color: #ffcc00;
}

/* 卡片样式 */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex: 1 1 calc(33.333% - 20px);
    min-width: 250px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

/* 图片样式 */
.card img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

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

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

/* 加载动效 */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
}

.loader .planet {
    width: 40px;
    height: 40px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center / contain;
    border-radius: 50%;
    animation: rotatePlanet 2s linear infinite;
}

@keyframes rotatePlanet {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-container {
        flex-direction: column;
    }
    .chapter-nav {
        display: none; /* 移动设备隐藏章节导航 */
    }
}

