
/* 全局样式设置 */
/* 引入Google字体 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* 根元素变量定义 */
:root {
  --primary-color: #0A2342; /* 主色调：深蓝色 */
  --secondary-color: #E8E9EB; /* 辅色调：灰色 */
  --accent-color-1: #00B4FF; /* 辅助色1：电光蓝 */
  --accent-color-2: #FF6F00; /* 辅助色2：橙色 */
  --text-color: #333333; /* 正文字体颜色 */
  --background-color: #ffffff; /* 背景色 */
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 盒子阴影 */
  --transition-speed: 0.3s; /* 过渡速度 */
}

/* 全局字体和背景 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
  transition: background-color var(--transition-speed) ease;
}

/* 固定导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--primary-color);
  color: #fff;
  padding: 15px 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar a {
  color: #fff;
  margin: 0 15px;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-speed) ease;
}

.navbar a:hover {
  color: var(--accent-color-1);
}

/* 主容器样式 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 20px;
  padding: 100px 30px 50px; /* 上方留出导航栏空间 */
  max-width: 1920px;
  margin: 0 auto;
}

/* 模块样式 */
.module {
  background-color: var(--background-color);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

/* 模块中的标题样式 */
.module h2, .module h3, .module h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: 700;
}

.module h2 {
  font-size: 1.8rem;
}

.module h3 {
  font-size: 1.6rem;
}

.module h4 {
  font-size: 1.4rem;
}

/* 段落样式 */
.module p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 15px;
}

/* 图片样式 */
.module img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

/* 按钮样式 */
.button {
  background-color: var(--accent-color-1);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
  font-size: 1rem;
}

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

.button:active {
  transform: scale(0.95);
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

table th, table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

table th {
  background-color: var(--primary-color);
  color: #fff;
}

table tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* 代码块样式 */
pre {
  background-color: #f4f4f4;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
}

code {
  font-family: 'Courier New', Courier, monospace;
  color: #d6336c;
}

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

  .container {
    padding: 80px 20px 40px;
  }

  .module h2 {
    font-size: 1.6rem;
  }

  .module h3 {
    font-size: 1.4rem;
  }

  .module h4 {
    font-size: 1.2rem;
  }
}

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

  .navbar a {
    margin: 5px 0;
  }

  .container {
    padding: 60px 15px 30px;
  }

  .module {
    padding: 15px;
  }

  .button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* 渐变背景 */
.background {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color-1));
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

/* 几何图形样式 */
.circle, .triangle, .line {
  position: absolute;
  background-color: rgba(255, 111, 0, 0.3);
  border-radius: 50%;
  animation: move 10s infinite linear;
}

.circle {
  width: 100px;
  height: 100px;
  top: 50px;
  left: 100px;
}

.triangle {
  width: 0;
  height: 0;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-bottom: 100px solid rgba(0, 180, 255, 0.3);
  top: 200px;
  left: 300px;
  background-color: transparent;
}

.line {
  width: 200px;
  height: 20px;
  top: 350px;
  left: 500px;
  animation: moveLine 8s infinite linear;
}

/* 移动动画 */
@keyframes move {
  from {
    transform: translateX(0) translateY(0);
  }
  to {
    transform: translateX(300px) translateY(300px);
  }
}

@keyframes moveLine {
  from {
    transform: translateX(0) translateY(0);
  }
  to {
    transform: translateX(-300px) translateY(-300px);
  }
}

/* 代码示例样式 */
pre code {
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
  background-color: #2d2d2d;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 5px;
  font-size: 0.9rem;
}

/* 折叠区域样式 */
.details {
  margin-bottom: 20px;
}

.details summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--primary-color);
  padding: 10px;
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  background-color: #fff;
  transition: background-color var(--transition-speed) ease;
}

.details summary:hover {
  background-color: var(--accent-color-1);
  color: #fff;
}

.details[open] summary {
  background-color: var(--accent-color-2);
  color: #fff;
}

.details details-content {
  padding: 10px;
  border-left: 3px solid var(--accent-color-1);
}

/* 提示信息样式 */
.notice {
  background-color: var(--accent-color-1);
  color: #fff;
  padding: 15px;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  margin: 20px 0;
  box-shadow: var(--box-shadow);
}

/* 图片组合样式 */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.image-gallery img {
  width: calc(25% - 15px);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

@media (max-width: 768px) {
  .image-gallery img {
    width: calc(50% - 15px);
  }
}

@media (max-width: 480px) {
  .image-gallery img {
    width: 100%;
  }
}

