
/* 
    本CSS样式表用于智能投顾与量化交易的现代化卡片式设计平台。
    主要包括响应式布局、卡片样式、导航样式、按钮样式、动画效果等。
    色彩搭配基于科技蓝、亮橙和绿色作为主色及点缀色，搭配深色背景，营造科技感。
    使用CSS3的Flexbox和Grid布局，提高页面的响应式和模块化布局能力。
    阴影和过渡效果用于增强界面层次感和互动性。
    页面设计确保在320px到1920px宽度范围内良好展示，无左右滚动条。
*/

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

body {
    font-family: 'Roboto', sans-serif;
    background: #1e1e2f; /* 深色背景 */
    color: #ffffff;
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden; /* 避免左右滚动 */
}

/* 顶部导航栏 */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: #2a2a40;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #21cbf3; /* 科技蓝 */
}

header nav a {
    color: #ffffff;
    margin-left: 20px;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #ff9800; /* 亮橙色 */
}

/* 侧边导航栏 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 200px;
    height: calc(100% - 60px);
    background: #2a2a40;
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 15px;
}

.sidebar ul li a {
    color: #ffffff;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.sidebar ul li a:hover {
    background: #21cbf3; /* 科技蓝 */
}

/* 主内容区 */
.main-content {
    margin-left: 220px;
    padding: 80px 20px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    background: #1e1e2f;
}

/* 卡片样式 */
.card {
    background: linear-gradient(135deg, #2a2a40, #1e1e2f);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: grab;
}

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

/* 图片样式 */
.card img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
}

/* 标题样式 */
h2, h3, h4 {
    color: #ffffff;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.8em;
}

h3 {
    font-size: 1.6em;
}

h4 {
    font-size: 1.4em;
}

/* 文本内容 */
section {
    margin-bottom: 20px;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(45deg, #2196f3, #21cbf3);
    border: none;
    border-radius: 5px;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn:active {
    transform: scale(0.95);
    background: linear-gradient(45deg, #1976d2, #1e88e5);
}

/* 代码块样式 */
code, pre {
    background: #2a2a40;
    color: #ffffff;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
}

pre {
    margin-bottom: 20px;
}

code {
    font-size: 0.9em;
}

/* 章节导航 */
.navbar {
    margin-bottom: 20px;
}

.navbar a {
    color: #21cbf3;
    text-decoration: none;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ff9800;
}

/* 提示信息 */
.notice {
    background: #21cbf3;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 10px 10px 10px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 动画效果 */
@keyframes grow {
    from { height: 0; }
    to { height: var(--bar-height); }
}

/* 虚拟助手样式 */
.virtual-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #21cbf3, #2196f3);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.virtual-assistant:hover {
    transform: rotate(360deg);
}

/* 数据变化过渡 */
.data-value {
    transition: all 0.5s ease-in-out;
    font-size: 2em;
    color: #4caf50;
}

.data-value.updating {
    color: #ff9800;
    transform: scale(1.1);
}

