
/* 定义颜色变量，遵循黄金比例配色法则 */
:root {
  /* 主色调 - 70% */
  --main-soft-orange: #FFA07A; /* 柔和的橙色 */
  --main-coral: #FF7F50;       /* 珊瑚色 */
  
  /* 辅助色 - 25% */
  --secondary-calm-blue: #4682B4; /* 冷静的蓝色 */
  --secondary-gray: #708090;       /* 灰色 */
  
  /* 点缀色 - 5% */
  --accent-deep-blue: #00008B; /* 深蓝色 */
  --accent-gold: #FFD700;      /* 金色 */
  
  /* 其他颜色 */
  --background-gradient: linear-gradient(135deg, var(--main-soft-orange), var(--main-coral));
  --button-hover-gradient: linear-gradient(45deg, var(--secondary-calm-blue), var(--accent-gold));
  --button-hover-active-gradient: linear-gradient(45deg, var(--accent-deep-blue), var(--secondary-calm-blue));
}

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

/* 设置字体 */
body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: var(--secondary-gray);
  background: var(--background-gradient);
  transition: background 0.5s ease;
}

/* 标题字体 */
h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  color: var(--accent-deep-blue);
  margin-bottom: 20px;
}

/* 链接样式 */
a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-calm-blue);
}

/* 固定导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(70, 130, 180, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  z-index: 1000;
  transition: background 0.3s ease;
}

.navbar:hover {
  background: rgba(70, 130, 180, 1);
}

/* 导航项样式 */
.nav-item {
  margin: 0 15px;
  color: #fff;
  cursor: pointer;
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--accent-gold);
  left: 0;
  bottom: -5px;
  transition: width 0.3s;
}

.nav-item:hover::after {
  width: 100%;
}

/* 主要内容区 */
.main-content {
  padding: 100px 50px 50px 50px; /* 避免导航栏遮挡内容 */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 按钮样式 */
.button {
  background: linear-gradient(45deg, var(--secondary-calm-blue), var(--accent-gold));
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button:hover {
  background: var(--button-hover-gradient);
}

.button:active {
  background: var(--button-hover-active-gradient);
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 章节导航 */
.section-nav {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(255, 255, 255, 0.8);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

.section-nav a {
  color: var(--accent-deep-blue);
  font-weight: bold;
}

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

/* 模块容器 */
.module-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  width: 100%;
  margin-top: 50px;
}

/* 单个模块样式 */
.module {
  background: rgba(255, 255, 255, 0.9);
  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;
  position: relative;
}

.module:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 模块标题 */
.module h3 {
  margin-bottom: 15px;
  color: var(--accent-deep-blue);
}

/* 模块描述 */
.module p {
  line-height: 1.6;
}

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

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

/* 代码块样式 */
pre code.language-css {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  display: block;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  color: #333;
  margin: 20px 0;
  position: relative;
}

pre code.language-css::before {
  content: "CSS3 代码示例";
  position: absolute;
  top: -25px;
  left: 0;
  background: var(--secondary-gray);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9rem;
}

/* 图表容器样式 */
.chart-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin: 50px 0;
}

.chart-container h3 {
  margin-bottom: 20px;
  color: var(--accent-deep-blue);
}

/* 动态数据条 */
.bar {
  width: 0;
  height: 30px;
  background: var(--secondary-calm-blue);
  margin: 10px 0;
  border-radius: 5px;
  transition: width 1s ease;
}

.bar.loaded {
  width: 80%;
}

/* 用户故事模块 */
.user-stories {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin: 50px 0;
}

.user-stories h3 {
  margin-bottom: 30px;
  color: var(--accent-deep-blue);
}

.story {
  display: flex;
  align-items: center;
  margin: 20px 0;
  opacity: 0;
  transform: translateX(-50px);
  animation: slideIn 0.6s forwards;
}

.story:nth-child(even) {
  flex-direction: row-reverse;
  transform: translateX(50px);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.story img {
  border-radius: 50%;
  width: 100px;
  height: 100px;
  margin: 0 20px;
  object-fit: cover;
}

.story .description {
  max-width: 600px;
  font-family: 'Roboto', sans-serif;
  color: var(--secondary-gray);
  line-height: 1.6;
}

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

  .section-nav {
    top: auto;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%);
  }

  .module-container {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .user-stories {
    padding: 30px 10px;
  }

  .story {
    flex-direction: column;
    text-align: center;
  }

  .story img {
    margin: 0 0 10px 0;
  }
}

@media (max-width: 480px) {
  .button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .chart-container {
    padding: 15px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .navbar {
    padding: 8px 15px;
  }

  .section-nav {
    display: none;
  }
}

