
/* 页面整体样式设置 */
/* 使用线性渐变背景，结合深蓝、银灰和青蓝色调，营造科技感 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #ffffff;
    font-family: 'Roboto', 'Open Sans', sans-serif;
    line-height: 1.6;
}

/* 导航栏样式 */
/* 固定在顶部，半透明背景，使用Flexbox进行布局 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(32, 58, 67, 0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
    z-index: 1000;
    transition: background 0.3s ease;
}

/* 导航链接样式 */
/* 白色文字，去除下划线，添加悬停效果 */
.navbar a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.navbar a:hover {
    background: #2c5364;
    border-radius: 5px;
    transform: scale(1.05);
}

/* 主内容区域样式 */
/* 使用Grid布局，保证响应式设计 */
.container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    grid-gap: 20px;
    padding: 100px 50px 50px 50px; /* 上方留出导航栏空间 */
}

/* 侧边导航栏样式 */
/* 固定宽度，使用垂直Flexbox布局 */
.sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 100px;
}

.sidebar a {
    color: #00aaff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 18px;
    transition: color 0.3s ease;
}

.sidebar a:hover {
    color: #ffffff;
}

/* 文章内容样式 */
/* 清晰的排版与层次 */
article {
    max-width: 800px;
}

article h2, article h3, article h4 {
    color: #00aaff;
    margin-top: 30px;
}

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

/* 代码块样式 */
/* 使用深色背景，圆角，内边距，区分于正文 */
pre {
    background: #1e2a38;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

code {
    color: #00ffea;
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
/* 圆角，阴影，悬停放大效果 */
img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

/* 提示文字样式 */
/* 突出显示，使用大字体和特定颜色 */
.highlight {
    color: #ff4081;
    font-size: 18px;
    font-weight: bold;
}

/* 响应式设计 */
/* 适配不同屏幕宽度 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr 2fr;
        padding: 100px 30px 30px 30px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }
    .sidebar {
        display: none;
    }
}

@media (max-width: 480px) {
    .navbar a {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    article p, article h2, article h3, article h4 {
        font-size: 14px;
    }
}

/* 按钮样式 */
/* 科技感按钮，添加渐变与阴影 */
.button {
    background: linear-gradient(45deg, #00aaff, #004aad);
    border: none;
    padding: 10px 20px;
    color: #ffffff;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

/* 折叠区域样式 */
/* 隐藏内容，点击展开 */
.collapsible {
    background-color: #203a43;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    margin-top: 20px;
    border-radius: 5px;
}

.active, .collapsible:hover {
    background-color: #2c5364;
}

.content {
    padding: 0 18px;
    display: none;
    background-color: #2c5364;
    overflow: hidden;
    border-radius: 5px;
}

.content p {
    margin: 15px 0;
}

/* 悬浮提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%; 
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* 代码示例块样式 */
/* 高亮显示代码块 */
.code-example {
    background: #1e2a38;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #00ffea;
    font-family: 'Courier New', Courier, monospace;
}

/* 定义动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in;
}

