
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
  background: linear-gradient(135deg, #A1C4FD 0%, #C2E9FB 100%); /* 主色调渐变背景 */
  color: #333333; /* 主要文字颜色 */
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* 导航栏样式 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8); /* 半透明背景 */
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 15px 30px; /* 导航栏内边距 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

nav .logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #333333;
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  text-decoration: none;
  color: #333333;
  font-size: 1em;
  position: relative;
  transition: color 0.3s ease;
}

nav ul li a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  background: #FF9F43; /* 点缀色 */
  left: 0;
  bottom: -5px;
  transition: width 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
}

@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    display: none;
  }

  nav ul.active {
    display: flex;
  }

  nav .menu-toggle {
    display: block;
    cursor: pointer;
    font-size: 1.2em;
  }
}

/* 主要内容区样式 */
.main-container {
  padding: 100px 20px 50px 20px; /* 顶部留出导航栏空间 */
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.section {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  padding: 30px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.section img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.section img:hover {
  transform: scale(1.05);
}

.section h2, .section h3, .section h4 {
  color: #333333;
  margin-top: 20px;
}

.section p {
  color: #555555;
  font-size: 16px;
  margin-top: 10px;
}

/* 按钮样式 */
.button {
  background: linear-gradient(45deg, #FF9F43, #2EDC76); /* 辅色渐变 */
  border: none;
  border-radius: 12px;
  color: #fff;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 16px;
}

.button:hover {
  background: linear-gradient(45deg, #2EDC76, #FF9F43);
}

/* 代码块样式 */
pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 20px;
  border-radius: 8px;
  overflow: auto;
  position: relative;
}

pre code {
  font-family: 'Courier New', Courier, monospace;
  color: #2d2d2d;
  font-size: 14px;
}

pre code::before {
  content: '代码示例';
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 12px;
  color: #555555;
}

/* 图片装饰样式 */
.decorative-images {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.decorative-images img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.decorative-images img:hover {
  transform: scale(1.1);
}

/* 响应式布局 */
@media (min-width: 768px) {
  .main-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .main-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 提示信息样式 */
.reference-note {
  text-align: center;
  font-size: 18px;
  color: #FF9F43; /* 点缀色 */
  margin-bottom: 40px;
  font-weight: bold;
}

/* 折叠内容样式 */
.collapsible {
  background-color: rgba(255, 255, 255, 0.3);
  color: #333333;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

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

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

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 2s ease-in-out;
}

/* 链接样式 */
a {
  color: #2EDC76; /* 辅色 */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 优化导航栏 */
.nav-links {
  display: flex;
  gap: 20px;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 60px;
    right: 30px;
    width: 200px;
    padding: 20px;
    border-radius: 8px;
  }

  .menu-toggle {
    display: block;
    cursor: pointer;
    font-size: 1.5em;
  }
}

