
/* 全局样式设置，包括字体、背景和基本布局 */
body {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，提升可读性 */
    color: #333; /* 正文字体颜色 */
    line-height: 1.6; /* 行高设置，增强阅读体验 */
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #00c6ff, #0072ff, #8e2de2, #4a00e0); /* 渐变极光背景 */
    background-size: 400% 400%; /* 背景尺寸，配合动画效果 */
    animation: gradientAnimation 15s ease infinite; /* 背景动画效果 */
}

/* 背景动画关键帧 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明背景，增加层次感 */
    padding: 15px 0;
    z-index: 1000; /* 确保导航栏在最上层 */
    transition: background 0.3s ease;
}

.navbar a {
    color: #fff; /* 导航链接颜色 */
    padding: 14px 20px;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
}

.navbar a:hover {
    background-color: #575757; /* 悬停背景色 */
    border-radius: 4px; /* 圆角效果 */
}

/* 导航栏响应式设计 */
@media (max-width: 768px) {
    .navbar a {
        display: none; /* 隐藏导航链接 */
    }

    .navbar .menu-icon {
        display: block; /* 显示菜单图标 */
        cursor: pointer;
    }

    .navbar.responsive a {
        display: block;
        text-align: center;
    }
}

/* 页眉区域样式 */
.header {
    padding: 100px 20px 60px 20px; /* 上方留白，避免内容被导航栏遮挡 */
    text-align: center;
    color: #fff;
}

.header h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.header p {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
}

/* 主要内容区域样式 */
.content {
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.8); /* 半透明白色背景，增强可读性 */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 章节导航栏样式 */
.section-nav {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-nav a {
    display: block;
    margin-bottom: 10px;
    color: #0072ff;
    text-decoration: none;
    font-size: 16px;
}

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

/* 文章内容样式 */
article {
    max-width: 1200px;
    margin: 0 auto;
}

article h2, article h3, article h4 {
    color: #4a00e0;
}

article h2 {
    font-size: 32px;
    margin-top: 40px;
    margin-bottom: 20px;
}

article h3 {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
}

article p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.8;
}

/* 图片样式，包括圆角、阴影和悬停效果 */
article img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

article img:hover {
    transform: scale(1.05); /* 悬停放大 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 代码块样式，与正文内容区分开 */
code {
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
}

/* 按钮样式，强调色用于CTA */
.button {
    background: #ff7e5f;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.button:hover {
    background: #e06b54;
    transform: scale(1.05);
}

/* 折叠区域样式，次要信息隐藏 */
.details {
    margin: 20px 0;
}

.summary {
    font-weight: bold;
    cursor: pointer;
    color: #0072ff;
}

.content-details {
    display: none;
    margin-top: 10px;
    font-size: 15px;
    color: #555;
}

.summary:hover {
    color: #ff7e5f;
}

.summary:after {
    content: ' ▼';
}

.open .content-details {
    display: block;
}

.open .summary:after {
    content: ' ▲';
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background: #4a00e0;
    color: #fff;
}

tr:nth-child(even) {
    background: #f5f5f5;
}

/* 页脚样式 */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 20px;
    text-align: center;
}

.footer a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 10px;
    display: inline-block;
}

.footer a:hover {
    color: #ff7e5f;
}

/* 多语言切换按钮样式 */
.language-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.language-switcher button {
    background: #34495e;
    border: none;
    color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.language-switcher button:hover {
    background: #1abc9c;
}

/* 代码示例部分样式，与正文区分 */
.code-example {
    background: #1a1a1a;
    color: #f1c40f;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin: 20px 0;
}

/* 留白与排版 */
.section {
    margin-bottom: 40px;
}

.section-title {
    margin-bottom: 20px;
}


