
/* 
页面整体样式设计
本样式表采用CSS3技术，结合现代网页设计的最佳实践，旨在创建一个具有高端视觉效果和优秀用户体验的响应式网页。
*/

/* 设置全局字体和基本样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 使用无衬线字体，提升可读性 */
    font-size: 16px; /* 基础字体大小 */
    color: #ffffff; /* 设置全局文字颜色为白色，确保与背景的对比度 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 背景使用蓝色渐变，营造科技感 */
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    backdrop-filter: blur(10px); /* 模糊效果，增强玻璃拟态 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000; /* 确保导航栏位于最上层 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影，增加层次感 */
}

/* 导航链接样式 */
.navbar a {
    color: #ffffff;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #2a5298; /* 悬停时颜色变化，增强互动反馈 */
}

/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

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

.chapter-nav a:hover {
    color: #2a5298;
}

/* 主内容区样式 */
main {
    padding: 100px 20px 60px 20px; /* 顶部留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 文章标题样式 */
article h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #ffffff;
    text-align: center;
}

/* 文章副标题样式 */
article h3 {
    font-size: 1.5em;
    margin-top: 40px;
    color: #ffffff;
}

/* 文章段落样式 */
article p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #f0f0f0;
}

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

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

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

article th, article td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    text-align: left;
}

article th {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

article td {
    color: #f0f0f0;
}

/* 按钮样式 */
.button {
    background: #2a5298;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

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

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

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

/* 玻璃拟态卡片样式 */
.glass-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 20px;
    margin: 20px 0;
    color: #ffffff;
}

/* 响应式网格布局 */
.grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.grid-item {
    flex: 1 1 calc(33.333% - 20px);
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .grid-item {
        flex: 1 1 calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .grid-item {
        flex: 1 1 100%;
    }
}

/* 数据图表区域样式 */
.data-chart {
    width: 100%;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    margin-bottom: 20px;
}

.data-point {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 0;
    background: #2a5298;
    animation: grow 2s infinite;
}

@keyframes grow {
    0% { height: 0; }
    50% { height: 100px; }
    100% { height: 0; }
}

/* 按钮动画 */
@keyframes button-hover {
    0% { background-color: #2a5298; transform: scale(1); }
    100% { background-color: #1e3c72; transform: scale(1.05); }
}

/* 页脚样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
}

.footer input, .footer textarea {
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.footer button {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #2a5298;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.footer button:hover {
    background: #1e3c72;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .chapter-nav {
        top: 100px;
    }
}

/* 高级CSS3特性示例 */
.code-example {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 增强互动体验 */
.interactive-element {
    transition: all 0.3s ease;
}

.interactive-element:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}


