
/* 
智慧交汇 - 智能投顾与量化交易服务平台的整体样式表
此样式表采用现代化的CSS3特性，实现了响应式设计、渐变背景、卡片式布局、动态交互效果等，以确保页面在各种设备上的美观与流畅。
*/

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 */
:root {
    --primary-color: #0A2D61; /* 主色调：深蓝色，象征科技与信任 */
    --secondary-color: #FFFFFF; /* 辅色调：白色，保持简洁与清爽 */
    --accent-color: #6D28D9; /* 点缀色：蓝紫渐变，增强视觉吸引力 */
    --background-gradient: linear-gradient(135deg, #0A2D61, #1E3A8A, #3B82F6); /* 背景线性渐变 */
    --button-gradient: linear-gradient(45deg, #0A2D61, #6D28D9); /* 按钮渐变 */
    --font-family: 'Roboto', sans-serif; /* 统一字体 */
}

/* 主题切换 */
[data-theme="dark"] {
    --primary-color: #FFFFFF;
    --secondary-color: #0A2D61;
    --accent-color: #8B5CF6;
    --background-gradient: linear-gradient(135deg, #1E3A8A, #3B82F6, #818CF8);
    --button-gradient: linear-gradient(45deg, #1E3A8A, #8B5CF6);
}

/* 全局背景与字体设置 */
body {
    background: var(--background-gradient);
    color: var(--primary-color);
    font-family: var(--font-family);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    padding-top: 70px; /* 为固定导航栏留出空间 */
}

/* 固定导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 45, 97, 0.9);
    padding: 15px 0;
    z-index: 1000;
    transition: background 0.3s ease;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-color);
}

/* 章节导航系统 */
.section-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
}

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

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

.section-nav ul li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.section-nav ul li a:hover {
    color: var(--accent-color);
}

/* 主内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 文章样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

article h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

article h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

article p {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

article pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 图片样式 */
img {
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 卡片式布局 */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    background: rgba(255, 255, 255, 0.2);
    color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 300px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.card-content {
    flex-grow: 1;
}

/* 按钮样式 */
.btn-gradient {
    background: var(--button-gradient);
    border: none;
    padding: 10px 20px;
    color: var(--secondary-color);
    border-radius: 5px;
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: pointer;
    font-size: 16px;
}

.btn-gradient:hover {
    transform: scale(1.05);
    background: var(--accent-color);
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--button-gradient);
    color: var(--secondary-color);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent-color);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 15px;
    border-radius: 50%;
    display: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    font-size: 16px;
}

.back-to-top.visible {
    display: block;
    opacity: 1;
}

/* 折叠区域样式 */
.collapsible {
    background: rgba(255, 255, 255, 0.2);
    color: var(--secondary-color);
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background: var(--accent-color);
}

.collapsible:after {
    content: '\002B';
    color: var(--secondary-color);
    float: right;
    margin-left: 5px;
}

.collapsible.active:after {
    content: "\2212";
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 20px;
}

.content.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

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

    nav ul li {
        margin: 10px 0;
    }

    .section-nav {
        top: 100px;
        right: 10px;
    }

    .card {
        width: 90%;
    }

    .collapsible {
        font-size: 16px;
    }

    article h2 {
        font-size: 20px;
    }

    article h3 {
        font-size: 18px;
    }

    article p {
        font-size: 14px;
    }

    .btn-gradient {
        font-size: 14px;
        padding: 8px 16px;
    }
}

