
/* 全局样式设置 */
/* 设置页面的基本字体、背景颜色和文字颜色 */
body {
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体 */
    font-size: 16px; /* 正文字号设置为16px */
    color: #0D1B2A; /* 文字颜色使用深蓝色 */
    background: linear-gradient(135deg, #1B263B 70%, #778DA9 25%, #415A77 5%); /* 应用渐变背景，符合黄金比例 */
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* 设置导航栏样式 */
.navbar {
    background: linear-gradient(90deg, #0D1B2A, #E0E1DD); /* 渐变导航栏背景 */
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 17px; /* 标题字号设置为17px */
    transition: color 0.3s;
}

.navbar a:hover {
    color: #778DA9; /* 悬停时颜色变化 */
}

/* 设置主要内容区域的样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px; /* 留出导航栏的空间 */
    padding: 20px;
}

/* 章节样式 */
section {
    background-color: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    border-radius: 10px; /* 圆角 */
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影 */
    backdrop-filter: blur(10px); /* 背景模糊效果 */
    transition: transform 0.3s, box-shadow 0.3s; /* 动画过渡 */
}

section:hover {
    transform: translateY(-5px); /* 悬停时略微提升 */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
h2, h3, h4 {
    color: #E0E1DD; /* 标题颜色 */
    margin-bottom: 15px;
}

h2 {
    font-size: 24px; /* h2标题字号 */
}

h3 {
    font-size: 20px; /* h3标题字号 */
}

h4 {
    font-size: 18px; /* h4标题字号 */
}

/* 段落和文本样式 */
p {
    font-size: 16px; /* 正文字号 */
    color: #E0E1DD;
    margin-bottom: 20px;
}

/* 强调文字样式 */
b {
    color: #415A77; /* 重点文字颜色 */
}

/* 链接样式 */
a {
    color: #778DA9; /* 链接颜色 */
    text-decoration: underline;
}

a:hover {
    color: #415A77;
}

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影 */
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 代码块样式 */
pre {
    background-color: rgba(0, 0, 0, 0.7);
    color: #E0E1DD;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 行动按钮样式 */
.button, .call-to-action {
    background-color: #415A77; /* 按钮背景色 */
    color: #ffffff; /* 按钮文字颜色 */
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.button:hover, .call-to-action:hover {
    background-color: #778DA9; /* 悬停时背景色变化 */
    transform: scale(1.05); /* 悬停时放大 */
}

/* 导航系统样式 */
.nav-links {
    display: flex;
    flex-wrap: wrap;
}

.nav-links a {
    margin: 0 10px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .nav-links a {
        margin: 10px 0;
    }

    .container {
        margin: 120px 20px 20px;
        padding: 10px;
    }

    img {
        max-width: 100%;
    }
}

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

.page-content {
    animation: fadeIn 1.5s ease-in-out;
}

.element-slide-in {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.element-slide-in.visible {
    opacity: 1;
    transform: translateX(0);
}

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

th, td {
    padding: 12px;
    border: 1px solid #415A77;
    text-align: left;
}

th {
    background-color: #415A77;
    color: #ffffff;
}

td {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 提示框样式 */
.alert {
    background-color: #2A9D8F;
    color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-warning {
    background-color: #E9C46A;
    color: #264653;
}

/* 表单元素样式 */
input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #415A77;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 16px;
}

input:focus, textarea:focus, select:focus {
    border-color: #778DA9;
    outline: none;
}

/* 背景装饰元素 */
.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, #415A77, #778DA9);
    margin: 40px 0;
    border: none;
}

.decorative-element {
    width: 50px;
    height: 50px;
    background: #415A77;
    border-radius: 50%;
    margin: 20px auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* 底部样式 */
.footer {
    background-color: #0D1B2A;
    color: #E0E1DD;
    text-align: center;
    padding: 20px;
}

.footer a {
    color: #778DA9;
    text-decoration: none;
}

.footer a:hover {
    color: #415A77;
}

/* 提示文字样式 */
.highlight {
    color: #E9C46A;
    font-weight: bold;
}

/* 响应式图片布局 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.image-grid img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

/* 代码示例高亮 */
.code-example {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    color: #E0E1DD;
    margin-bottom: 20px;
}

.code-example code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 动态饼图样式 */
.pie-chart path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPie 2s forwards;
}

@keyframes drawPie {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* SVG线条动画 */
.svg-line {
    stroke: #415A77;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 3s ease-in-out forwards;
}

@keyframes drawLine {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}


