
/* 
整体页面样式
- 使用CSS3的高级特性，如渐变、阴影、动画等
- 采用响应式设计，适配各种屏幕宽度
- 色彩搭配遵循黄金比例：70%主色调，25%辅色，5%点缀色
- 使用现代无衬线字体，提高可读性
*/

/* CSS变量定义 */
:root {
  --primary-color: #1E3A8A; /* 主色调蓝色 */
  --secondary-color: #4B5563; /* 辅色调灰色 */
  --accent-color: #F59E0B; /* 点缀色橙色 */
  --background-color: #F3F4F6; /* 背景颜色 */
  --text-color: #111827; /* 文字颜色 */
  --font-family: 'Roboto', sans-serif;
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--background-color), #E5E7EB);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  transition: background 0.5s ease;
}

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

/* 标题样式 */
h1, h2, h3, h4 {
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

h2 {
  font-size: 2em;
}

h3 {
  font-size: 1.75em;
}

h4 {
  font-size: 1.5em;
}

/* 段落样式 */
p {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 20px;
}

/* 链接样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* 图片样式 */
img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* 代码块样式 */
pre {
  background: #F3F4F6;
  padding: 20px;
  border-radius: 8px;
  overflow: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

code::before {
  content: "代码块";
  position: absolute;
  top: -1.5em;
  left: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75em;
}

/* 导航栏样式 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(30, 58, 138, 0.9);
  padding: 20px 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 40px;
  list-style: none;
}

nav ul li {
  position: relative;
}

nav ul li a {
  color: #fff;
  font-size: 16px;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--accent-color);
}

/* 主区域样式 */
.main-content {
  padding-top: 100px; /* 避免导航栏遮挡 */
}

/* 卡片式设计 */
.card {
  background: #fff;
  border-radius: 12px;
  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 6px 8px rgba(0,0,0,0.15);
}

/* 响应式布局 */
@media (max-width: 768px) {
  .container {
    padding: 20px 0;
  }

  nav ul {
    flex-direction: column;
    gap: 20px;
  }

  img {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5em;
  }

  h2 {
    font-size: 1.75em;
  }

  h3 {
    font-size: 1.5em;
  }

  h4 {
    font-size: 1.25em;
  }

  nav ul {
    gap: 15px;
  }
}

/* 按钮样式 */
.button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 8px;
  transition: background 0.3s ease, transform 0.3s ease;
}

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

/* 展开折叠区域 */
.details {
  border-top: 1px solid var(--secondary-color);
  padding-top: 20px;
  display: none;
}

.summary:hover + .details {
  display: block;
}

/* 渐变线条装饰 */
.decorative-line {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
  margin: 20px 0;
  animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* 面包屑导航 */
.breadcrumb {
  font-size: 14px;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--secondary-color);
  margin-right: 5px;
}

.breadcrumb a::after {
  content: "/";
  margin-left: 5px;
}

.breadcrumb a:last-child::after {
  content: "";
}

/* 按钮过渡效果 */
.button-transition {
  transition: all 0.3s ease;
}

.button-transition:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

