
/* 
  网站整体样式设计
  主题：科技魅影
  色彩搭配：主色70% 深蓝色与黑色渐变，辅色25% 亮橙色与翠绿色，点缀色5% 白色
  响应式设计，适配320px至1920px宽度
*/

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

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0d47a1 70%, #000000 30%);
  color: #ffffff;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

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

.navbar.scrolled {
  background: rgba(0, 0, 0, 0.9);
}

.nav-links {
  list-style: none;
  display: flex;
}

.nav-links li {
  margin-left: 20px;
}

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

.nav-links a:hover {
  color: #ff9800;
  transform: scale(1.1);
}

/* 主要内容区域 */
.main-content {
  padding: 100px 50px 50px 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  margin-bottom: 80px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease;
}

.section:hover {
  background: rgba(255, 255, 255, 0.2);
}

.section h2, .section h3, .section h4 {
  color: #ffffff;
}

.section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  border-bottom: 2px solid #ff9800;
  padding-bottom: 10px;
}

.section h3 {
  font-size: 20px;
  margin-bottom: 15px;
  border-bottom: 1px solid #4caf50;
  padding-bottom: 5px;
}

.section p {
  font-size: 16px;
  margin-bottom: 15px;
}

.code-block {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
}

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

/* 按钮样式 */
.button-highlight {
  background-color: #ff9800;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

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

/* 图片装饰样式 */
.decorative-image {
  width: 320px;
  height: 320px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 20px;
}

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

/* 响应式布局 */
@media (max-width: 1200px) {
  .main-content {
    padding: 100px 30px 30px 30px;
  }

  .decorative-image {
    width: 280px;
    height: 280px;
    margin: 15px;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
  }

  .nav-links li {
    margin-left: 0;
    margin-bottom: 10px;
  }

  .main-content {
    padding: 100px 20px 20px 20px;
  }

  .decorative-image {
    width: 240px;
    height: 240px;
    margin: 10px;
  }

  .section {
    padding: 20px;
  }

  .button-highlight {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .section h2 {
    font-size: 20px;
  }

  .section h3 {
    font-size: 18px;
  }

  .code-block code {
    font-size: 12px;
  }

  .decorative-image {
    width: 200px;
    height: 200px;
    margin: 5px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeIn 1s ease-in-out;
}

/* 粒子效果背景 */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}

.particle {
  width: 2px;
  height: 2px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  animation: move 10s linear infinite;
}

@keyframes move {
  from {
    transform: translate(0, 0);
    opacity: 1;
  }
  to {
    transform: translate(100px, 100px);
    opacity: 0;
  }
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  top: 60px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  z-index: 999;
}

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

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

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

.chapter-nav a:hover {
  color: #ff9800;
}

