
/* 
整体页面样式设计，融合未来感与高级质感，采用响应式布局，适配各种设备
主色调为科技蓝与深灰色，辅色调为亮橙色与鲜绿色，搭配渐变与阴影效果
使用Flexbox和Grid布局，实现不对称但有序的内容排列
添加微交互效果，如悬停动画、过渡效果，提升用户体验
*/

/* 定义CSS变量，便于统一管理色彩 */
:root {
  --tech-blue: #1E90FF; /* 主色调科技蓝 */
  --deep-gray: #2C3E50; /* 主色调深灰色 */
  --bright-orange: #FFA500; /* 辅色调亮橙色 */
  --fresh-green: #32CD32; /* 辅色调鲜绿色 */
  --light-gray: #f5f5f5; /* 背景浅灰色 */
  --text-color: #333333; /* 文字主色 */
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, var(--light-gray) 70%, var(--deep-gray) 30%);
  color: var(--text-color);
  line-height: 1.6;
}

/* 固定头部导航栏 */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--deep-gray);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
}

.header nav a {
  color: #ffffff;
  margin: 0 15px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.header nav a:hover {
  color: var(--bright-orange);
}

/* 切换按钮样式 */
.toggle-button {
  background-color: var(--tech-blue);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  color: #ffffff;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.toggle-button:hover {
  background-color: var(--fresh-green);
}

/* 隐藏式侧边栏 */
.sidebar {
  position: fixed;
  left: -250px;
  top: 0;
  width: 250px;
  height: 100%;
  background-color: var(--deep-gray);
  transition: left 0.3s ease;
  padding: 60px 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar.active {
  left: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  margin: 20px 0;
}

.sidebar ul li a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidebar ul li a:hover {
  color: var(--bright-orange);
}

/* 主容器样式 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 40px;
  padding: 120px 60px 60px 60px;
}

/* 文章内容样式 */
article {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 标题样式 */
h2 {
  font-size: 2em;
  color: var(--tech-blue);
  margin-bottom: 20px;
}

h3 {
  font-size: 1.5em;
  color: var(--bright-orange);
  margin-top: 30px;
  margin-bottom: 15px;
}

/* 段落样式 */
p {
  font-size: 1em;
  margin-bottom: 15px;
  text-align: justify;
}

/* 代码块样式 */
pre {
  background: #2C3E50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 5px;
  overflow: auto;
  position: relative;
  margin-bottom: 20px;
}

pre code::before {
  content: "示例代码";
  position: absolute;
  top: -25px;
  left: 0;
  background: var(--tech-blue);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px 5px 0 0;
  font-size: 0.9em;
}

/* 图像装饰样式 */
.image-decorator {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
  justify-content: center;
}

.image-decorator img {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-decorator img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* 加载动画样式 */
.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid var(--tech-blue);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

/* 关键帧动画 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 100px 20px 20px 20px;
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header nav {
    display: none;
  }

  .toggle-button {
    margin-top: 10px;
  }
}

/* 提示信息样式 */
.notice {
  background-color: var(--bright-orange);
  color: #ffffff;
  padding: 10px 20px;
  text-align: center;
  font-weight: bold;
  border-radius: 5px;
  margin: 20px 0;
}

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

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

.content {
  padding: 0 20px;
  display: none;
  overflow: hidden;
  background-color: var(--light-gray);
  border-radius: 5px;
  margin-bottom: 20px;
}

/* 动画显示内容 */
.content.show {
  display: block;
}

/* 按钮样式 */
.button-primary {
  background-color: var(--bright-orange);
  border: none;
  padding: 10px 20px;
  color: #ffffff;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s;
}

.button-primary:hover {
  background-color: var(--fresh-green);
  transform: translateY(-2px);
}

/* 工具提示样式 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 140px;
  background-color: var(--deep-gray);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;

  /* 定位 */
  position: absolute;
  z-index: 1;
  bottom: 125%; /* 上方 */
  left: 50%;
  margin-left: -70px;

  /* 动画 */
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

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

table, th, td {
  border: 1px solid var(--deep-gray);
}

th, td {
  padding: 10px;
  text-align: left;
}

th {
  background-color: var(--tech-blue);
  color: #ffffff;
}

td {
  background-color: #ffffff;
}

