
/* 
整体页面样式设置
采用响应式设计，确保在不同设备上的良好展示。
主色调为深蓝色和银灰色，辅以橙色和绿色作为点缀色。
使用现代无衬线字体Roboto，确保文本的清晰度和易读性。
*/

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

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1A237E 70%, #B0BEC5 25%, #FF9800 5%);
  color: #333;
  line-height: 1.6;
  font-size: 16px;
}

/* 固定导航栏 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(26, 35, 126, 0.9);
  padding: 15px 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.navbar li {
  margin-left: 20px;
}

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

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

/* 主内容区域 */
.container {
  max-width: 1200px;
  margin: 100px auto 50px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

/* 章节导航 */
.sidebar {
  position: fixed;
  top: 80px;
  left: 20px;
  width: 200px;
}

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

.sidebar li {
  margin-bottom: 15px;
}

.sidebar a {
  color: #1A237E;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* 文章内容 */
article {
  grid-column: 1 / -1;
}

article h2 {
  font-size: 24px;
  color: #1A237E;
  margin-top: 40px;
}

article h3 {
  font-size: 20px;
  color: #FF9800;
  margin-top: 30px;
}

article p {
  margin: 15px 0;
  font-size: 16px;
  color: #333;
}

article pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}

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

/* 强调文字 */
strong {
  color: #4CAF50;
}

/* 卡片样式 */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.2);
}

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

.button:hover {
  background-color: #F57C00;
  transform: scale(1.05);
}

/* 图片样式 */
img.decorative {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .navbar ul {
    justify-content: center;
  }
  
  .container {
    grid-template-columns: 1fr;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 2s ease-in;
}

/* 分隔线样式 */
.separator {
  height: 2px;
  background: linear-gradient(to right, #1A237E, #FF9800);
  margin: 40px 0;
  border: none;
}

/* 数据可视化容器 */
.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: #f5f5f5;
  border-radius: 10px;
  overflow: hidden;
}

/* 额外的微交互动效 */
a.internal-link {
  position: relative;
  color: #4CAF50;
  text-decoration: none;
}

a.internal-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  display: block;
  background: #4CAF50;
  transition: width 0.3s;
}

a.internal-link:hover::after {
  width: 100%;
}

/* 提示文字样式 */
.prompt {
  text-align: center;
  font-size: 18px;
  color: #FF9800;
  margin: 20px 0;
  font-weight: bold;
}

/* 高亮代码块 */
.highlighted-code {
  background: #e0f7fa;
  padding: 10px;
  border-left: 4px solid #4CAF50;
  border-radius: 5px;
}

/* 制作无外部链接 */
a {
  pointer-events: auto;
}

/* 禁止外部链接 */
a[rel="nofollow"]::after {
  content: none;
}

