
/* 全局样式设置 */
:root {
  /* 颜色变量定义 */
  --primary-color: #1E90FF; /* 主色调：冷蓝色 */
  --secondary-color: #A9A9A9; /* 辅色调：灰色 */
  --accent-color: #FFA500; /* 点缀色：橙色 */
  --background-gradient: linear-gradient(135deg, #1E90FF, #A9A9A9);
  --font-family-primary: 'Roboto', sans-serif; /* 主字体 */
  --font-family-secondary: 'Arial', sans-serif; /* 辅字体 */
  --transition-speed: 0.3s; /* 过渡速度 */
}

/* 重置默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面背景设置 */
body {
  font-family: var(--font-family-primary);
  background: var(--secondary-color);
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.navbar .menu {
  display: flex;
  gap: 20px;
}

.navbar .menu a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
  transition: color var(--transition-speed) ease;
}

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

/* 浮动按钮样式 */
.floating-button {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
  z-index: 1000;
}

.floating-button:hover {
  background: #FF8C00;
  transform: scale(1.1);
}

/* 主要内容容器 */
.container {
  max-width: 1200px;
  margin: 100px auto 0; /* 顶部留出导航栏空间 */
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 章节样式 */
.section {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  transition: transform var(--transition-speed) ease;
}

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

/* 标题样式 */
h2, h3, h4 {
  font-family: var(--font-family-primary);
  color: var(--primary-color);
  margin-bottom: 20px;
}

h2 {
  font-size: 2em;
}

h3 {
  font-size: 1.75em;
}

h4 {
  font-size: 1.5em;
}

/* 段落样式 */
p {
  font-family: var(--font-family-secondary);
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
}

/* 图片样式 */
img.decorative {
  width: 100%;
  max-width: 320px;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

/* 代码块样式 */
pre code {
  display: block;
  padding: 20px;
  background: #f4f4f4;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  position: relative;
}

pre code::before {
  content: "代码块示例";
  position: absolute;
  top: -25px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 5px 10px;
  border-radius: 5px 5px 0 0;
  font-size: 14px;
}

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

table th, table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background-color: var(--primary-color);
  color: white;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .navbar .menu {
    flex-direction: column;
    gap: 10px;
  }

  .floating-button {
    bottom: 20px;
    right: 20px;
  }

  .section {
    padding: 20px;
  }

  h2 {
    font-size: 1.75em;
  }

  h3 {
    font-size: 1.5em;
  }

  h4 {
    font-size: 1.25em;
  }
}

@media (max-width: 480px) {
  .navbar .menu {
    display: none; /* 简化移动端导航 */
  }

  .floating-button {
    padding: 10px;
  }

  .section {
    padding: 15px;
  }

  h2 {
    font-size: 1.5em;
  }

  h3 {
    font-size: 1.25em;
  }

  h4 {
    font-size: 1em;
  }
}

/* 提示信息样式 */
.prompt-message {
  background: var(--accent-color);
  color: white;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2em;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

