
/* 基础样式重置，确保不同浏览器下的一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局字体与背景设置 */
body {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 正文字号设置为16px */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 主色调渐变背景 */
    color: #ffffff; /* 文字颜色设为白色，确保对比度 */
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动条出现 */
}

/* 顶部导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    backdrop-filter: blur(10px); /* 背景模糊效果 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* 边框 */
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ff9800; /* 点缀色橙色 */
}

.navbar .button {
    background-color: #4caf50; /* 辅助色绿色按钮 */
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.navbar .button:hover {
    background-color: #45a049;
}

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

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

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

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

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

/* 主内容区块样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    display: none; /* 移动端隐藏 */
}

@media (min-width: 768px) {
    .sidebar {
        display: block;
    }
}

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 文章标题样式 */
article h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ff9800; /* 点缀色橙色 */
}

/* 文章副标题样式 */
article h3 {
    font-size: 20px;
    margin: 15px 0;
    color: #4caf50; /* 辅助色绿色 */
}

/* 文章段落样式 */
article p {
    margin-bottom: 15px;
    font-size: 16px;
}

/* 代码示例块样式 */
article pre {
    background: #2a5298;
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 15px;
}

article code {
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 图片样式 */
.article-image {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* 加载动画样式 */
.loader {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid #ffffff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 100px auto;
}

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

/* 响应式网格布局 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px;
}

/* 卡片式设计样式 */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    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);
    transition: transform 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

/* 数据图表样式 */
.data-chart {
    width: 100%;
    height: 300px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.data-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    opacity: 0.5;
    animation: fadeIn 2s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

/* 交互元素样式 */
.interactive-element {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.interactive-element:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.button:active {
    transform: scale(0.95);
}

/* 移动端优化样式 */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .grid-container {
        padding: 20px;
        grid-template-columns: 1fr;
    }

    .data-chart {
        height: 200px;
    }

    .chapter-nav {
        display: none; /* 小屏幕隐藏章节导航 */
    }
}

/* 强调“这是一个网页样式设计参考” */
.reference-note {
    text-align: center;
    font-size: 18px;
    margin: 30px 0;
    color: #ff9800;
    font-weight: bold;
}

