
/* 
全局样式设置，包括背景渐变、字体、颜色、边距和填充等基础样式。
确保整个页面具有一致的视觉风格和响应式布局。
*/
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #1A73E8, #9C27B0);
  font-family: 'Roboto', sans-serif;
  color: #333;
  line-height: 1.6;
}

/* 
导航栏样式，固定在页面顶部，包含多级菜单，使用阴影效果提升层次感。
导航链接在悬停时颜色变化，并带有过渡效果。
*/
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #1A73E8;
  padding: 15px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.navbar li {
  position: relative;
}

.navbar li ul {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  background-color: #fff;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar li:hover ul {
  display: block;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: #FF9800;
}

/* 
主容器样式，使用CSS Grid布局，确保模块化和响应式设计。
各个内容模块具有统一的间距和背景样式。
*/
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 20px;
  padding: 100px 20px 20px 20px;
}

/* 
内容项样式，包含背景色、边框圆角、阴影和过渡效果。
在悬停时轻微上移，增加互动性。
*/
.item {
  background-color: #F5F5F5;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* 
按钮样式，使用点缀色橙色，带有圆角和阴影效果。
悬停时颜色加深，并有轻微的位移动画。
*/
.button {
  background-color: #FFA726;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.button:hover {
  background-color: #FF9800;
  transform: translateY(-2px);
}

/* 
标题样式，使用较大字号和粗体，确保层次分明。
颜色使用主色调蓝色，增强视觉引导。
*/
h1, h2, h3, h4 {
  font-family: 'Roboto', sans-serif;
  color: #1A73E8;
  margin-bottom: 15px;
}

h1 {
  font-size: 2em;
}

h2 {
  font-size: 1.8em;
}

h3 {
  font-size: 1.6em;
}

h4 {
  font-size: 1.4em;
}

/* 
段落样式，确保良好的可读性和舒适的阅读体验。
适当的行间距和段落间距，提升内容的层次感。
*/
p {
  font-size: 16px;
  margin-bottom: 15px;
}

/* 
代码块样式，使用等宽字体，背景色与边框圆角处理。
内嵌代码块有浅色背景，突出代码内容。
*/
pre {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
}

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

/* 
表格样式，包含边框、背景色、间距和对齐。
标题行使用主色调背景，文字为白色，增强可读性。
*/
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

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

th {
  background-color: #1A73E8;
  color: white;
}

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

/* 
装饰图片样式，设置圆角、阴影和悬停放大效果。
确保图片作为装饰性元素，不影响主要内容展示。
*/
.decorative-image {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.decorative-image:hover {
  transform: scale(1.05);
}

/* 
响应式设计，确保在不同屏幕尺寸下布局自适应，内容保持清晰可见。
对于移动设备，调整导航栏和内容模块的布局，提升用户体验。
*/
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    gap: 10px;
  }
  
  .container {
    grid-template-columns: 1fr;
  }
}

