
/* 
整体页面样式设计
采用现代化的CSS3技术，结合未来感与高级质感，通过线性渐变、阴影效果、关键帧动画等手段，打造一个色彩丰富、布局多元、交互流畅的响应式网页。页面设计遵循黄金比例配色法则，主色调为柔和的蓝紫色，辅以浅灰和白色，点缀色使用橙绿，增强视觉层次和重点突出效果。布局采用Flexbox和Grid，确保在各种设备上都能保持良好的展示效果，避免水平滚动条，内容完整可见。

*/

/* 根元素，定义全局变量 */
:root {
  --primary-color: #836FFF; /* 主色调蓝紫渐变 */
  --secondary-color: #4361EE; /* 次级色调 */
  --background-color: #F5F5F5; /* 浅灰背景 */
  --accent-color-1: #FFA07A; /* 点缀色1橙色 */
  --accent-color-2: #90EE90; /* 点缀色2绿色 */
  --text-color: #333333; /* 正文字体颜色 */
  --font-family: 'Roboto', sans-serif; /* 全局字体 */
}

/* 页面整体背景 */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-color);
  font-family: var(--font-family);
  transition: background 0.5s ease, color 0.5s ease;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.navbar a {
  text-decoration: none;
  color: var(--text-color);
  margin: 0 15px;
  font-size: 16px;
  position: relative;
}

.navbar a:hover::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--accent-color-1);
  bottom: -5px;
  left: 0;
}

/* 主内容区样式 */
.main-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding: 120px 60px 60px 60px; /* 顶部留出导航栏空间 */
}

/* 卡片样式 */
.card {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

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

.card img {
  width: 100%;
  height: auto;
  display: block;
}

.card-content {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.card-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
}

/* 按钮样式 */
.button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent-color-1);
  color: #ffffff;
  border-radius: 25px;
  text-decoration: none;
  transition: background 0.3s ease;
}

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

/* 渐变线条装饰 */
.decorative-line {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
  margin: 20px 0;
  border-radius: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-content {
    padding: 120px 30px 30px 30px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 15px 20px;
  }
  
  .navbar a {
    margin: 0 10px;
    font-size: 14px;
  }
  
  .main-content {
    padding: 120px 20px 20px 20px;
    grid-template-columns: 1fr;
  }
}

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

.card {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes ripple {
  from {
    transform: scale(0);
    opacity: 0.5;
  }
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: ripple 1.5s infinite;
}

/* 代码示例块样式 */
.code-sample {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 20px;
  border-radius: 10px;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: auto;
  margin: 20px 0;
}

.code-sample pre {
  margin: 0;
}

/* 折叠区域样式 */
.collapsible {
  background-color: var(--secondary-color);
  color: white;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.collapsible:hover {
  background-color: var(--accent-color-1);
}

.content {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #f1f1f1;
  border-radius: 0 0 5px 5px;
}


