
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1E272E 70%, #00BFFF 25%, #FF9F43 5%);
    color: #ffffff;
    line-height: 1.6;
}

/* 容器布局 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(30, 39, 46, 0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    transition: color 0.3s, background-color 0.3s;
}

.navbar a:hover {
    color: #00BFFF;
    background-color: rgba(255, 159, 67, 0.2);
    border-radius: 5px;
}

/* 主要内容区域 */
.main-content {
    padding-top: 80px; /* 为固定导航栏预留空间 */
}

/* 章节导航 */
.section-nav {
    position: fixed;
    top: 100px;
    left: 20px;
    display: flex;
    flex-direction: column;
}

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

.section-nav a:hover {
    color: #00BFFF;
}

/* 文章样式 */
article {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    margin-bottom: 40px;
}

article h2, article h3 {
    color: #00BFFF;
}

article p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 图片样式 */
.article-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;
}

.article-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

/* 代码块样式 */
code {
    background-color: rgba(0, 191, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

pre {
    background-color: rgba(255, 159, 67, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

pre code {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #FFFFFF;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #FF9F43;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

.btn:hover {
    background-color: #00BFFF;
    transform: scale(1.05);
}

/* 背景动态几何图形 */
.geometric-shape {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: #00BFFF;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotateShape 10s linear infinite;
    border-radius: 10px;
}

@keyframes rotateShape {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 社区入口样式 */
.community-section {
    display: flex;
    justify-content: space-around;
    padding: 40px 0;
    background-color: rgba(15, 20, 30, 0.9);
    border-top: 2px solid #FF9F43;
}

.community-item {
    background-color: rgba(30, 39, 46, 0.8);
    border-radius: 8px;
    padding: 20px;
    width: 30%;
    text-align: center;
    transition: background-color 0.3s, transform 0.3s, color 0.3s;
}

.community-item:hover {
    background-color: #00BFFF;
    transform: scale(1.05);
    color: #ffffff;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* 工具提示位置 */
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .section-nav {
        display: none;
    }

    .community-section {
        flex-direction: column;
        align-items: center;
    }

    .community-item {
        width: 80%;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    article {
        padding: 20px;
    }

    .navbar a {
        padding: 8px 10px;
        font-size: 14px;
    }

    article p {
        font-size: 14px;
    }

    .tooltip .tooltiptext {
        width: 100px;
        margin-left: -50px;
    }
}

