
/* 主体色彩变量 */
:root {
    --primary-color: #0D2C54; /* 主色调，深蓝色 */
    --secondary-color: #F7F9FC; /* 辅色调，柔和灰色 */
    --accent-color: #FF8C00; /* 点缀色，温暖橙色 */
    --background-gradient: linear-gradient(135deg, #0D2C54, #6A5ACD); /* 渐变背景 */
    --quantitative-gradient: linear-gradient(135deg, #0D2C54, #20B2AA); /* 量化交易渐变 */
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--secondary-color);
    background: var(--background-gradient);
    transition: background 0.5s ease;
    overflow-x: hidden;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(13, 44, 84, 0.9);
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    z-index: 1000;
}

.navbar a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 18px;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--accent-color);
}

/* 主要容器样式 */
.full-screen-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    padding-top: 60px; /* 预留导航栏空间 */
}

.section {
    flex: 0 0 100vh;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
}

.gradient-background {
    background: var(--background-gradient);
    color: var(--secondary-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.5s ease;
}

.quantitative-trading {
    background: var(--quantitative-gradient);
}

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

h2, h3, h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

h2 {
    font-size: 24px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 20px;
    margin-top: 2rem;
}

p {
    font-size: 16px;
    margin-bottom: 1rem;
}

pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

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

table, th, td {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

th, td {
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: rgba(13, 44, 84, 0.7);
}

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

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    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: 1rem 0;
}

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

/* 折叠内容样式 */
.collapsible {
    background-color: rgba(13, 44, 84, 0.8);
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.5rem;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}

.active, .collapsible:hover {
    background-color: var(--accent-color);
    color: #000;
}

.content {
    padding: 0 1rem;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 预加载动画样式 */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeOut 2s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* 页面过渡效果 */
body {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* CSS3代码块样式 */
.code-example {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-left: 4px solid var(--accent-color);
    border-radius: 5px;
    margin: 1rem 0;
    overflow-x: auto;
}

/* 导航链接样式 */
.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

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

    .navbar a {
        padding: 0.5rem 0;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

    p, li {
        font-size: 14px;
    }
}

