
/* 
  本样式表定义了整个网页的视觉风格和布局，采用现代化的CSS3技术，结合Flexbox和Grid布局，使页面在不同设备上均具备良好的响应性和适配性。
*/

/* 定义颜色变量，便于全局管理和维护 */
:root {
  --primary-color: #032B44; /* 主色调，深蓝色，传递专业与科技感 */
  --background-color: #F5F7FA; /* 背景色，浅灰色，提供明亮的视觉基础 */
  --accent-color-orange: #FFA500; /* 辅助色，亮橙色，用于按钮和重点提示 */
  --accent-color-green: #34C759; /* 辅助色，绿色，用于图表和成功提示 */
  --text-color: #333333; /* 文字颜色，深灰色，确保高可读性 */
  --link-color: #032B44; /* 链接颜色，与主色调一致 */
  --code-bg-color: #272822; /* 代码块背景色，深色调，便于代码区分 */
  --code-text-color: #F8F8F2; /* 代码块文字色，浅色调，提升可读性 */
  --shadow-color: rgba(0, 0, 0, 0.1); /* 阴影颜色，用于视觉层次 */
}

/* 全局样式设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 设置全局字体和基础样式 */
body {
  font-family: 'Roboto', 'Arial', sans-serif; /* 现代无衬线字体，提升专业感 */
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
  font-size: 16px;
}

/* 设置主要的容器，采用Flex布局 */
.container {
  display: flex;
  min-height: 100vh;
  flex-direction: row;
}

/* 侧边栏样式，固定宽度并使用主色调背景 */
.sidebar {
  width: 250px;
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  overflow-y: auto;
  box-shadow: 2px 0 5px var(--shadow-color);
}

/* 主导航链接样式 */
.sidebar a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  margin: 15px 0;
  font-size: 16px;
  transition: color 0.3s ease;
}

.sidebar a:hover {
  color: var(--accent-color-orange);
}

/* 主内容区，留出侧边栏空间 */
.main-content {
  margin-left: 250px;
  padding: 20px;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-gap: 20px;
}

/* 顶部通知栏，突出显示信息 */
.notification {
  background: var(--accent-color-green);
  color: #ffffff;
  padding: 15px;
  text-align: center;
  font-size: 18px;
  border-radius: 5px;
  box-shadow: 0 2px 4px var(--shadow-color);
}

/* 文章区块样式 */
article {
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 8px var(--shadow-color);
}

/* 标题样式 */
article h2 {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 20px;
}

article h3 {
  font-size: 20px;
  color: var(--primary-color);
  margin-top: 20px;
  margin-bottom: 15px;
}

/* 段落样式 */
article p {
  margin-bottom: 15px;
  font-size: 16px;
  color: var(--text-color);
}

/* 强调颜色的文本样式 */
article span, article .color {
  color: var(--accent-color-orange);
}

/* 代码块样式，深色背景与浅色文字 */
pre {
  background-color: var(--code-bg-color);
  color: var(--code-text-color);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

/* 代码块内的注释样式 */
code {
  color: var(--code-text-color);
}

/* 图片样式，圆角和阴影 */
img {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 10px var(--shadow-color);
}

/* 表格样式，简洁明了 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

table th, table td {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

table th {
  background-color: var(--background-color);
  color: var(--primary-color);
}

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

/* 按钮样式，采用辅助色 */
.button {
  background-color: var(--accent-color-orange);
  border: none;
  color: #ffffff;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.button:hover {
  background-color: var(--accent-color-green);
  transform: scale(1.05);
}

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

.collapsible:hover {
  background-color: var(--primary-color);
  color: #ffffff;
}

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

/* 关键帧动画示例 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 应用于元素的淡入动画 */
.fade-in {
  animation: fadeIn 2s ease-in-out;
}

/* 响应式设计：平板及以下 */
@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }

  .main-content {
    margin-left: 200px;
  }

  article h2 {
    font-size: 22px;
  }

  article h3 {
    font-size: 18px;
  }

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

/* 响应式设计：手机及以下 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    box-shadow: none;
  }

  .main-content {
    margin-left: 0;
  }

  .notification {
    font-size: 16px;
  }

  img {
    max-width: 100%;
  }

  pre {
    font-size: 12px;
  }

  table th, table td {
    font-size: 14px;
  }
}

/* 特殊链接样式 */
a[rel="nofollow"] {
  color: var(--link-color);
  text-decoration: underline;
}

a[rel="nofollow"]:hover {
  color: var(--accent-color-orange);
}

/* 代码示例样式，与正文区分开 */
.code-example {
  background-color: var(--code-bg-color);
  color: var(--code-text-color);
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  margin-bottom: 20px;
}

.code-example:hover {
  box-shadow: 0 8px 16px var(--shadow-color);
}

/* 按钮的圆角和过渡效果 */
.button-rounded {
  border-radius: 50px;
  transition: all 0.3s ease;
}

.button-rounded:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px var(--shadow-color);
}

/* 页面底部样式 */
.footer {
  text-align: center;
  padding: 20px;
  background-color: var(--primary-color);
  color: #ffffff;
  margin-top: 40px;
}

/* 复杂的渐变背景 */
.gradient-background {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color-orange));
  color: #ffffff;
  padding: 50px;
  border-radius: 10px;
  text-align: center;
}

.gradient-background h1 {
  font-size: 36px;
  margin-bottom: 20px;
}

.gradient-background p {
  font-size: 18px;
}

/* 定义图标的基本样式 */
.icon {
  width: 24px;
  height: 24px;
  fill: var(--accent-color-green);
  transition: fill 0.3s ease;
}

.icon:hover {
  fill: var(--accent-color-orange);
}

/* 设置表单元素的样式，尽管页面中不包含表单 */
input, textarea, select, button {
  font-family: inherit;
  font-size: 16px;
}

/* 使所有图片都具有相同的尺寸和样式 */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.image-gallery img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px var(--shadow-color);
}

