
/* 
  全局样式设置
  -----------------------------------
  定义根变量，用于颜色搭配，保持一致性和易于维护
*/
:root {
  --primary-color: #002B5B; /* 主色调，深蓝色，象征稳定与信赖 */
  --accent-color: #00AEEF;  /* 辅助色，电蓝色，用于按钮和强调元素 */
  --warning-color: #FF6F3C; /* 点缀色，橙色，用于警示和重点信息 */
  --background-gradient: linear-gradient(135deg, #f0f4f8, #d9e2ec); /* 背景渐变，营造未来科技氛围 */
  --text-color: #002B5B; /* 全局文本颜色 */
  --background-color: #f0f4f8; /* 页面背景色 */
  --card-background: #ffffff; /* 卡片背景色 */
}

/* 
  页面基础样式
*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--background-gradient);
  font-family: 'Roboto', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.5s ease, color 0.5s ease;
}

/* 
  导航栏样式
  -----------------------------------
  固定在顶部，包含主要页面链接和搜索功能
*/
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar a {
  color: #ffffff;
  margin: 0 15px;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

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

/* 
  章节导航样式
  -----------------------------------
  帮助用户快速定位到指定内容区域
*/
.chapter-nav {
  margin-top: 80px; /* 留出导航栏空间 */
  background: rgba(0, 43, 91, 0.8);
  padding: 10px 20px;
  position: sticky;
  top: 60px;
  z-index: 999;
}

.chapter-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.chapter-nav li {
  margin-right: 20px;
}

.chapter-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.chapter-nav a:hover {
  background: var(--accent-color);
}

/* 
  主要内容区域样式
*/
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 
  文章样式
*/
article {
  margin-top: 20px;
}

article h2, article h3, article h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

article h2 {
  font-size: 24px;
}

article h3 {
  font-size: 20px;
}

article h4 {
  font-size: 18px;
}

article p {
  font-size: 16px;
  margin-bottom: 20px;
  color: #333333;
}

/* 
  强调文本样式
*/
.highlight {
  color: var(--primary-color);
  font-weight: bold;
}

/* 
  代码块样式
  -----------------------------------
  美观的代码展示，区别于正文样式
*/
pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

pre code {
  display: block;
}

/* 
  图片样式
  -----------------------------------
  使用圆角、阴影、悬停效果美化图片展示
*/
img.decorative-image {
  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;
  margin: 10px 0;
}

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

/* 
  按钮样式
*/
.button {
  background: var(--accent-color);
  border: none;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
  background: #009ad6;
  transform: scale(1.05);
}

.button:active {
  transform: scale(0.95);
}

/* 
  响应式设计
  -----------------------------------
  确保网页在不同设备和屏幕尺寸下良好显示
*/
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .chapter-nav ul {
    flex-direction: column;
  }

  .chapter-nav li {
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 15px;
  }

  .chapter-nav ul {
    flex-direction: column;
  }

  .chapter-nav li {
    margin-bottom: 10px;
  }

  article h2 {
    font-size: 20px;
  }

  article h3 {
    font-size: 18px;
  }

  article h4 {
    font-size: 16px;
  }

  article p {
    font-size: 14px;
  }

  pre {
    font-size: 12px;
  }
}

/* 
  折叠区域样式
  -----------------------------------
  用于次要信息的显示和隐藏
*/
.collapsible {
  background-color: #e0e0e0;
  color: #444;
  cursor: pointer;
  padding: 10px 15px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 4px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

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

.collapsible:after {
  content: '\002B';
  font-size: 13px;
  float: right;
}

.collapsible.active:after {
  content: '\2212';
}

.content {
  padding: 0 15px;
  display: none;
  overflow: hidden;
  background-color: #f9f9f9;
  border-left: 4px solid var(--accent-color);
  margin-bottom: 20px;
  border-radius: 4px;
}

/* 
  底部样式
*/
.footer {
  background: var(--primary-color);
  color: #ffffff;
  padding: 40px 20px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

.footer a {
  color: #ffffff;
  text-decoration: none;
  margin: 5px 0;
  font-size: 14px;
}

.footer .section {
  flex: 1 1 200px;
  margin: 10px;
}

.footer .section h4 {
  margin-bottom: 15px;
  font-size: 18px;
}

.footer .section a:hover {
  color: var(--accent-color);
}

/* 
  提示信息样式
  -----------------------------------
  在页面显著位置显示提示信息
*/
#prompt {
  background: var(--accent-color);
  color: #ffffff;
  padding: 15px 20px;
  text-align: center;
  font-size: 18px;
  margin: 20px 0;
  border-radius: 5px;
}

/* 
  面包屑导航样式
*/
.breadcrumb {
  margin: 80px 20px 20px 20px;
  font-size: 14px;
  color: var(--accent-color);
}

/* 
  过渡与动画
*/
.fade-in {
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 
  链接过渡效果
*/
a.internal-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a.internal-link:hover {
  color: #009ad6;
}


