
/* 复古风格智能投顾与量化交易平台样式表 */

/* 根元素定义主色调、辅色调和点缀色 */
:root {
  --primary-color: #8B4513; /* 棕色，主色调 */
  --secondary-color: #F5F5DC; /* 米色，背景色 */
  --accent-color: #B87333; /* 铜金色，点缀色 */
  --highlight-color: #228B22; /* 深绿色，辅助色 */
  --data-color: #00008B; /* 深蓝色，数据区强调色 */
  --font-primary: 'Roboto', sans-serif; /* 无衬线字体，主要用于正文 */
  --font-secondary: 'Georgia', serif; /* 衬线字体，用于标题 */
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-family: var(--font-primary);
  line-height: 1.6;
  animation: fadeIn 1s ease-in;
}

/* 页面加载淡入效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 顶部导航栏样式 */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 15px 0;
  text-align: center;
  font-size: 18px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 导航链接样式 */
.navbar a {
  color: var(--secondary-color);
  text-decoration: none;
  margin: 0 15px;
  font-size: 16px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.navbar a:hover {
  color: var(--highlight-color);
  transform: scale(1.05);
}

/* 容器样式，使用Grid布局 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 100px 20px 50px 20px; /* 顶部留出导航栏空间 */
}

/* 模块样式 */
.module {
  background-color: white;
  border: 1px solid var(--accent-color);
  border-radius: 10px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
  transform: translateY(-5px);
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
h1, h2, h3, h4 {
  font-family: var(--font-secondary);
  color: var(--primary-color);
  margin-bottom: 15px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 20px;
}

h4 {
  font-size: 18px;
}

/* 段落样式 */
p {
  font-size: 16px;
  margin-bottom: 15px;
}

/* 按钮样式 */
.button {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.button:hover {
  background-color: var(--highlight-color);
  transform: scale(1.05);
}

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

img.decorative:hover {
  transform: scale(1.02);
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
}

/* 图表样式 */
.chart {
  position: relative;
  width: 100%;
  height: 400px;
  background: linear-gradient(to bottom, var(--secondary-color), var(--primary-color));
  filter: grayscale(50%) sepia(20%);
  border-radius: 10px;
  overflow: hidden;
}

.chart::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 数据线条样式 */
.line {
  stroke: var(--highlight-color);
  stroke-width: 2;
  fill: none;
  animation: draw 2s ease-in-out forwards;
}

@keyframes draw {
  from {
    stroke-dasharray: 0, 1000;
  }
  to {
    stroke-dasharray: 1000, 0;
  }
}

/* 字体样式 */
body, p, span {
  font-family: var(--font-primary);
}

h1, h2, h3, h4 {
  font-family: var(--font-secondary);
}

/* 鼠标悬停图标与按钮效果 */
.icon:hover, .button:hover {
  filter: brightness(90%);
  transform: scale(1.02);
}

/* 章节导航样式 */
.chapter-nav {
  position: sticky;
  top: 80px; /* 导航栏高度 */
  background-color: var(--secondary-color);
  padding: 10px;
  border: 1px solid var(--accent-color);
  border-radius: 5px;
}

.chapter-nav a {
  display: block;
  color: var(--primary-color);
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 16px;
  transition: color 0.3s ease;
}

.chapter-nav a:hover {
  color: var(--highlight-color);
}

/* 底部样式 */
.footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  text-align: center;
  padding: 20px 0;
  margin-top: 50px;
}

