
/* 全局样式设置 */
/* 定义CSS变量，便于全局色彩统一管理 */
:root {
  --主色: #0A2463; /* 深蓝色，象征科技与稳重 */
  --渐变起始色: #7B1FA2; /* 渐变紫色起始 */
  --渐变结束色: #512DA8; /* 渐变紫色结束 */
  --点缀色: #FF9800; /* 橙色，用于高亮和重要信息 */
  --辅色: #FFFFFF; /* 白色，用于辅助内容 */
  --背景色: #1E1E1E; /* 深色背景，避免使用纯白 */
  --文字色: #F5F5F5; /* 浅色文字，确保可读性 */
  --阴影色: rgba(0, 0, 0, 0.2); /* 统一阴影颜色 */
  --过渡时间: 0.3s; /* 统一过渡时间 */
}

/* 页面背景设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, var(--主色), var(--渐变起始色));
  color: var(--文字色);
  overflow-x: hidden; /* 避免横向滚动条 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 36, 99, 0.8); /* 半透明深蓝色 */
  backdrop-filter: blur(10px); /* 背景模糊效果 */
  padding: 15px 30px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px var(--阴影色);
}

.navbar a {
  color: var(--文字色);
  margin: 0 15px;
  text-decoration: none;
  transition: color var(--过渡时间);
}

.navbar a:hover {
  color: var(--点缀色);
}

/* 主体内容容器 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 100px 40px 40px; /* 顶部留出导航栏空间 */
}

/* 卡片式设计 */
.card {
  background: rgba(255, 255, 255, 0.1); /* 半透明白色背景 */
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 16px var(--阴影色);
  transition: transform var(--过渡时间), box-shadow var(--过渡时间);
}

.card:hover {
  transform: translateY(-15px);
  box-shadow: 0 12px 24px var(--阴影色);
}

/* 图片样式 */
.card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px var(--阴影色);
  transition: transform var(--过渡时间), box-shadow var(--过渡时间);
}

.card img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px var(--阴影色);
}

/* 标题和文字样式 */
.card h2 {
  font-size: 1.8rem;
  margin-top: 15px;
  color: var(--文字色);
}

.card p {
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--文字色);
}

/* 按钮样式 */
.button {
  background: linear-gradient(45deg, var(--点缀色), #FFA726);
  color: var(--文字色);
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background var(--过渡时间), transform var(--过渡时间);
}

.button:hover {
  background: linear-gradient(45deg, #FF9800, #FFB74D);
  transform: scale(1.05);
}

/* 渐变线条装饰 */
.gradient-line {
  height: 4px;
  background: linear-gradient(90deg, var(--主色), var(--渐变起始色), var(--渐变结束色));
  border-radius: 2px;
  margin: 20px 0;
}

/* 关键帧动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 页面加载动画 */
.hero-section h1 {
  animation: fadeInUp 1s ease-out forwards;
}

/* 导航系统样式 */
.nav-links {
  list-style: none;
  display: flex;
}

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

.nav-links li a {
  color: var(--文字色);
  text-decoration: none;
  font-size: 1.6rem;
  transition: color var(--过渡时间);
}

.nav-links li a:hover {
  color: var(--点缀色);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 100px 20px 20px;
  }

  .navbar {
    padding: 10px 20px;
  }

  .navbar a {
    margin: 0 10px;
    font-size: 1.4rem;
  }

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

  .card p {
    font-size: 1.4rem;
  }

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

/* 折叠区域样式 */
.collapsible {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--文字色);
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1.6rem;
  transition: background var(--过渡时间);
  border-radius: 5px;
}

.active, .collapsible:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0 0 5px 5px;
}

.code-example {
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 15px 0;
}

.code-example code {
  color: #FFD700;
  font-family: 'Courier New', Courier, monospace;
}

/* 提示文字样式 */
.reference-note {
  font-size: 1.4rem;
  color: var(--点缀色);
  text-align: center;
  margin: 20px 0;
}

/* 视觉装饰元素 */
.decorative-element {
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--渐变起始色);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0.3;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.8);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg) scale(0.8);
  }
}

