
/* 颜色变量定义 */
:root {
  --primary-color: #1a237e; /* 主色调：深蓝色 */
  --secondary-color: #424242; /* 辅色：灰色 */
  --accent-color: #ff9800; /* 点缀色：亮橙色 */
  --background-color: #f5f5f5; /* 页面背景色 */
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--secondary-color);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

/* 头部导航栏 */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  height: 60px;
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

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

/* 背景动态线条 */
.svg-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
}

.svg-lines line {
  stroke: var(--accent-color);
  stroke-width: 2;
  stroke-dasharray: 1000;
  animation: drawLines 5s linear forwards;
}

/* 动画关键帧 */
@keyframes drawLines {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* 内容容器 */
.container {
  max-width: 1200px;
  margin: 80px auto 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 40px;
}

/* 卡片样式 */
.card {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

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

/* 图片装饰样式 */
.decorative-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 文章内容样式 */
article {
  font-size: 16px;
  color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', sans-serif;
  color: var(--primary-color);
}

h2 {
  font-size: 2em;
  margin-bottom: 0.5em;
}

h3 {
  font-size: 1.75em;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

pre {
  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
}

code {
  font-family: 'Courier New', Courier, monospace;
  color: var(--primary-color);
}

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

table, th, td {
  border: 1px solid #e0e0e0;
}

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

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

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

/* 代码块样式 */
pre code {
  position: relative;
  display: block;
  padding-top: 1.5em;
}

pre code::before {
  content: '代码示例';
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 5px 10px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  font-size: 0.9em;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 600px) {
  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

