
/* 
 * 页面整体样式设计
 * 本样式应用于智能投顾与量化交易平台的网页，结合现代Web技术与视觉美学原则，确保页面在不同设备上的响应性与美观性。
 */

/* 基本全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，确保阅读舒适 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 深蓝色渐变背景，符合主色调 */
    color: #ffffff; /* 文字颜色为白色，确保与深色背景对比鲜明 */
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(32, 58, 67, 0.9); /* 半透明背景，增强层次感 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5); /* 阴影效果，增强立体感 */
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
}

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

.navbar .nav-links a:hover {
    color: #feb47b; /* 橙色点缀，增强互动性 */
}

.menu-icon {
    display: none;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
}

/* 响应式设计：小屏幕下隐藏导航链接，显示菜单图标 */
@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
    }
    .menu-icon {
        display: block;
    }
}

/* 侧边导航菜单样式 */
.side-menu {
    position: fixed;
    top: 0;
    right: -250px; /* 初始位置在视口外 */
    width: 250px;
    height: 100%;
    background: rgba(32, 58, 67, 0.95);
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 60px 20px;
}

.side-menu.active {
    right: 0; /* 显示菜单 */
}

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

.side-menu a:hover {
    color: #feb47b;
}

/* 背景星河动画 */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
    z-index: -1; /* 置于背景层 */
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 5s infinite;
}

/* 星星闪烁动画 */
@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 星星移动动画 */
@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

.starfield .star {
    top: calc(100% * var(--top));
    left: calc(100% * var(--left));
    animation: twinkle 5s infinite, moveStars 100s linear infinite;
}

/* 主要内容容器 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 顶部留出导航栏空间 */
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

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

h2 {
    font-size: 24px;
    border-bottom: 2px solid #feb47b; /* 点缀色强调标题 */
    padding-bottom: 10px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

/* 段落样式 */
p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* 代码块样式 */
pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    margin-bottom: 20px;
}

code {
    color: #feb47b; /* 点缀色区分代码内容 */
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* 阴影效果 */
    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.5);
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(32, 58, 67, 0.9);
    padding: 15px;
    border-radius: 8px;
    z-index: 999;
}

.chapter-nav h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

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

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

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

.chapter-nav ul li a:hover {
    color: #feb47b;
}

/* 提示语样式 */
.prominent-message {
    text-align: center;
    font-size: 20px;
    color: #feb47b;
    margin-bottom: 40px;
    animation: fadeIn 2s ease-in-out;
}

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

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    border: none;
    color: #ffffff;
    padding: 15px 30px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 25px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.button:hover {
    background: linear-gradient(45deg, #feb47b, #ff7e5f);
}

/* 仪表盘样式 */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-gap: 20px;
    padding: 20px;
}

.dashboard .widget {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.dashboard .widget:hover {
    transform: scale(1.05);
}

/* 图表样式 */
.chart {
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.chart .bar {
    fill: #69b3a2;
    transition: height 0.5s ease, fill 0.3s ease;
}

.chart .bar:hover {
    fill: #40a287;
    opacity: 0.8;
}

/* 按钮与图标的微动效 */
.icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.icon:hover {
    transform: scale(1.2) rotate(10deg);
}

/* 字体优化 */
@font-face {
    font-family: 'Roboto';
    src: url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.8;
}

/* 响应式网格布局 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 动态导航栏背景 */
.navbar.scrolled {
    background: rgba(32, 58, 67, 0.95);
    transition: background 0.3s ease;
}

/* CSS3代码示例样式 */
.code-example {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 30px;
}

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

/* 留白与装饰元素 */
.section {
    padding: 60px 20px;
    background: rgba(32, 58, 67, 0.8);
    border-radius: 10px;
}

/* 装饰性渐变线条 */
.decorative-line {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
    margin: 20px 0;
    border-radius: 2px;
}

/* 过渡效果 */
.transition-effect {
    transition: all 0.3s ease;
}

/* 3D变换示例 */
.three-d-transform {
    transform: perspective(600px) rotateY(10deg) rotateX(10deg);
    transition: transform 0.5s ease;
}

.three-d-transform:hover {
    transform: perspective(600px) rotateY(0deg) rotateX(0deg);
}

