
/* 
主样式设置
设置整个网页的基础样式，包括字体、颜色、背景等。
*/
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0F2027, #2C5364);
    color: #ffffff;
    line-height: 1.6;
}

/* 
导航栏样式
固定在顶部，包含主导航项和下拉菜单，使用渐变背景和阴影效果。
*/
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(90deg, #0F2027, #2C5364);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar ul li {
    margin-left: 20px;
}

.navbar ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #00c6ff;
}

/* 
主提示样式
在显著位置提示“这是一个网页样式设计参考”。
*/
.main-notice {
    margin-top: 80px; /* 避免被固定导航栏遮挡 */
    text-align: center;
    font-size: 1.2rem;
    color: #ff6ec7;
    padding: 20px 0;
}

/* 
章节导航系统样式
侧边导航栏，帮助用户快速定位内容区域。
*/
.chapter-nav {
    position: fixed;
    top: 100px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-nav ul li {
    margin-bottom: 10px;
}

.chapter-nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #00c6ff;
}

/* 
内容区块样式
每个段落设置为独立的视觉区块，使用渐变线条和留白进行分隔。
*/
.section-block {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-block:nth-child(even) {
    background: rgba(44, 83, 100, 0.8);
}

.section-block:nth-child(odd) {
    background: rgba(15, 32, 39, 0.8);
}

.section-block h2, .section-block h3, .section-block h4 {
    color: #00c6ff;
    margin-bottom: 20px;
}

.section-block p {
    font-size: 1rem;
    color: #ffffff;
}

/* 
图片样式
圆角、阴影、悬浮效果、精致边框。
*/
.image-decor {
    width: 320px;
    height: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 
按钮样式
使用主色和点缀色，悬停时产生颜色变化和微动画。
*/
.button {
    background-color: #00c6ff;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 1rem;
}

.button:hover {
    background-color: #ff6ec7;
    transform: translateY(-3px);
}

/* 
代码示例样式
区别于文章内容，使用深色背景和等宽字体，添加滚动条。
*/
.code-example {
    background-color: #1a1a2e;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #00c6ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* 
按钮和图标悬停效果
使用transform和transition，赋予元素生命。
*/
.icon-hover {
    transition: transform 0.2s ease, color 0.2s ease;
    color: #00c6ff;
}

.icon-hover:hover {
    transform: rotate(10deg);
    color: #ff6ec7;
}

/* 
加载指示器样式
圆形进度条，使用border和animation实现旋转效果。
*/
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #00c6ff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* 
响应式设计
使用媒体查询和弹性单位，确保跨设备兼容。
*/
@media (max-width: 1920px) {
    body {
        font-size: 16px;
    }
}

@media (max-width: 1200px) {
    .navbar ul li {
        margin-left: 15px;
    }
    .chapter-nav {
        left: 10px;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .navbar ul {
        flex-direction: column;
        background: rgba(15, 32, 39, 0.9);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        display: none;
    }
    .navbar ul.active {
        display: flex;
    }
    .chapter-nav {
        display: none;
    }
    .main-notice {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .section-block {
        padding: 40px 10px;
    }
    .image-decor {
        width: 100%;
        height: auto;
    }
}

/* 
按钮加载动画
用于页面加载时的视觉提示。
*/
.button-load {
    position: relative;
}

.button-load::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: transparent;
    border: 4px solid #ffffff;
    border-top: 4px solid #00c6ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: button-spin 1s linear infinite;
    display: none;
}

.button-load.loading::after {
    display: block;
}

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

/* 
链接样式
所有内部链接添加rel="nofollow"并设置样式。
*/
a[rel="nofollow"] {
    color: #00c6ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a[rel="nofollow"]:hover {
    color: #ff6ec7;
}

/* 
卡片式布局
使用flexbox和grid实现模块化展示，增强内容可读性。
*/
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(26, 26, 46, 0.9);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.05);
}

/* 
动画效果
为元素添加渐变、阴影和立体感，提升整体设计质感。
*/
.background-gradient {
    background: linear-gradient(135deg, #0F2027, #2C5364);
    background: radial-gradient(circle, #2C5364, #203A43, #0F2027);
}

.box-shadow-effect {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.box-shadow-effect:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
}

/* 
文字样式
设置标题和正文的字体大小和颜色，确保阅读体验。
*/
h2, h3, h4 {
    font-family: 'Helvetica', sans-serif;
    margin-bottom: 10px;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    font-size: 1rem;
    color: #f1f1f1;
}

/* 
过渡效果
为不同的交互元素添加过渡动画，提升用户体验。
*/
.transition-effect {
    transition: all 0.3s ease;
}

.transition-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 
装饰线条
使用渐变和阴影为段落分隔线添加装饰效果。
*/
.decorative-line {
    height: 4px;
    width: 50px;
    background: linear-gradient(to right, #00c6ff, #ff6ec7);
    margin: 20px 0;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 
响应式图片布局
确保图片在不同设备上自适应显示，保持美观。
*/
.responsive-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.responsive-image:hover {
    transform: scale(1.05);
}


