
/* 定义CSS变量，便于主题切换与色彩管理 */
:root {
  /* 主色调：米黄色，营造温暖复古氛围 */
  --main-bg-color: #F5F0E1;
  /* 辅色调：深灰色，增强层次感 */
  --secondary-bg-color: #3C3C3C;
  /* 点缀色：科技蓝 */
  --accent-blue: #1A73E8;
  /* 点缀色：科技紫 */
  --accent-purple: #6200EA;
  /* 字体设置 */
  --font-primary: 'Roboto', sans-serif;
  --font-secondary: 'Playfair Display', serif;
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--main-bg-color);
  color: var(--secondary-bg-color);
  font-family: var(--font-primary);
  line-height: 1.6;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* 固定导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background-color: var(--secondary-bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  z-index: 1000;
}

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

.navbar a:hover {
  color: var(--accent-blue);
  transform: scale(1.05);
}

/* 主内容区域样式 */
.content {
  margin-left: 250px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  color: var(--secondary-bg-color);
  margin-bottom: 10px;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 20px;
}

p {
  font-size: 16px;
  margin-bottom: 15px;
}

/* 图片样式 */
img.decorative {
  max-width: 650px;
  width: 100%;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  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.3);
}

/* 代码块样式 */
pre {
  background-color: #2d2d2d;
  padding: 15px;
  border-radius: 10px;
  overflow-x: auto;
}

code {
  color: #f8f8f2;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

/* 按钮样式 */
.button {
  background: var(--accent-blue);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  transition: background 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-purple);
  transform: scale(1.05);
}

/* 时间轴样式 */
.timeline {
  display: flex;
  overflow-x: auto;
  padding: 20px 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--secondary-bg-color);
}

.timeline-item {
  position: relative;
  flex: 0 0 auto;
  margin: 0 20px;
  text-align: center;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--accent-blue);
  border-radius: 50%;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  padding: 20px;
  margin: 10px 0;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
}

.card h3 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .navbar {
    width: 200px;
  }
  .content {
    margin-left: 200px;
  }
}

@media (max-width: 768px) {
  .navbar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
  }
  .content {
    margin-left: 0;
  }
  .timeline {
    flex-direction: column;
    align-items: center;
  }
}

/* 主题切换动画 */
body.modern {
  --main-bg-color: #ffffff;
  --secondary-bg-color: #000000;
  --accent-blue: #007BFF;
  --accent-purple: #6F42C1;
}

body {
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* 添加额外的装饰元素 */
.decorative-line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  margin: 20px 0;
}

/* 折叠区域样式 */
.collapsible {
  background-color: #f1f1f1;
  color: #444;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 5px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.collapsible:hover {
  background-color: var(--accent-blue);
  color: white;
}

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

.content-collapsible.show {
  display: block;
}

/* 提示文本样式 */
.alert {
  background-color: var(--accent-purple);
  color: white;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  margin: 20px 0;
  font-size: 18px;
}

/* 平滑过渡效果 */
.fade-in {
  animation: fadeIn 2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

