
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #F5F5F5; /* 背景色为冷灰色 */
  color: #333333; /* 正文字体颜色 */
  line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
  background: linear-gradient(to right, #2D9CDB, #F2994A); /* 渐变背景 */
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.5s ease;
}

.navbar.scrolled {
  background: linear-gradient(to right, #27AE60, #2D9CDB);
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 10px 0;
  margin: 0;
}

.navbar li {
  margin: 0 15px;
}

.navbar a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 12px;
  transition: background 0.3s ease, color 0.3s ease;
}

.navbar a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #2D9CDB;
  border-radius: 4px;
}

/* 主要内容容器 */
.container {
  max-width: 1200px;
  margin: 100px auto 50px auto; /* 顶部留出导航栏空间 */
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 文章样式 */
article {
  background-color: #FFFFFF;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

article h2, article h3, article h4 {
  color: #2D9CDB;
  margin-bottom: 15px;
}

article p {
  margin-bottom: 20px;
}

article pre {
  background-color: #F0F0F0;
  padding: 15px;
  border-radius: 5px;
  overflow: visible;
  margin-bottom: 20px;
}

article code {
  font-family: 'Courier New', Courier, monospace;
}

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

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

/* 表格样式 */
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: #2D9CDB;
  color: #FFFFFF;
}

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

/* 按钮样式 */
.button-gradient {
  background: linear-gradient(45deg, #2D9CDB, #27AE60);
  border: none;
  padding: 12px 24px;
  color: #FFFFFF;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 16px;
  margin-top: 20px;
  display: inline-block;
}

.button-gradient:hover {
  background: linear-gradient(45deg, #27AE60, #F2994A);
}

/* 折叠内容样式 */
.collapsible {
  background-color: #EFEFEF;
  color: #333;
  cursor: pointer;
  padding: 15px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.collapsible:hover {
  background-color: #DCDCDC;
}

.content {
  padding: 0 15px;
  display: none;
  overflow: hidden;
  background-color: #F9F9F9;
  border-radius: 5px;
  margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    align-items: center;
  }

  .navbar li {
    margin: 10px 0;
  }

  .container {
    padding: 15px;
  }

  .service-item {
    flex: 1 1 100%;
  }

  img.decorative {
    max-width: 100%;
  }
}

/* CSS3代码示例样式 */
.code-example {
  background-color: #F0F0F0;
  padding: 20px;
  border-radius: 8px;
  overflow: visible;
  margin-bottom: 30px;
  font-family: 'Courier New', Courier, monospace;
  position: relative;
}

.code-example::before {
  content: "CSS3 示例代码";
  position: absolute;
  top: -20px;
  left: 10px;
  background-color: #2D9CDB;
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
}

/* 指示文字样式 */
.indicator {
  text-align: center;
  font-size: 18px;
  color: #E74C3C;
  margin-bottom: 30px;
  font-weight: bold;
}

