
/* 
  网页整体样式设计
  使用HTML5和CSS3技术，结合响应式布局和高级视觉效果，打造融合未来感与高级质感的网页。
*/

/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

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

body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #e0e1dd; /* 主色调，柔和的浅色文字 */
  background: linear-gradient(135deg, #0d1b2a, #1b263b, #415a77, #778da9, #e0e1dd);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite; /* 背景渐变动画 */
  overflow-x: hidden; /* 防止水平滚动条 */
}

/* 渐变动画关键帧 */
@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 容器样式 */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  transition: backdrop-filter 0.3s ease, background 0.3s ease;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar.scrolled {
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.6);
}

/* 导航链接样式 */
.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links li a {
  color: #e0e1dd;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: #00aaff;
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  z-index: 500;
}

.chapter-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chapter-nav ul li a {
  color: #e0e1dd;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
  color: #cc00ff;
}

/* 主要内容样式 */
article {
  background: rgba(0, 0, 0, 0.5);
  padding: 30px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

article h2, article h3, article h4 {
  color: #00aaff;
  margin-bottom: 20px;
}

article p {
  margin-bottom: 20px;
  color: #e0e1dd;
}

article pre {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
}

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

article img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* 提示信息样式 */
.notice {
  background: rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-left: 5px solid #cc00ff;
  border-radius: 5px;
  font-weight: bold;
}

/* 按钮样式 */
button {
  background: #00aaff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

button:hover {
  background: #cc00ff;
  transform: translateY(-3px);
}

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

.active, .collapsible:hover {
  background: rgba(255, 255, 255, 0.2);
}

.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

.content p {
  margin: 15px 0;
}

/* 图片布局网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.image-grid img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* 代码块样式 */
.code-block {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
}

.code-block code {
  color: #00aaff;
  font-family: 'Courier New', Courier, monospace;
}

/* 媒体查询 */
@media (max-width: 768px) {
  .navbar, .chapter-nav {
    padding: 10px 20px;
  }
  
  .chapter-nav {
    right: 10px;
  }
  
  article {
    padding: 20px;
  }
  
  .image-grid {
    grid-template-columns: 1fr;
  }
}

