
/* 主色调定义 */
:root {
  --primary-color: #2C3E50; /* 深蓝色，用于主背景和导航栏 */
  --secondary-color: #34495E; /* 深灰色，用于次要背景和边框 */
  --accent-color: #3498DB; /* 浅蓝色，用于按钮和链接的高亮 */
  --highlight-color: #E67E22; /* 橙色，用于强调和关键点 */
  --background-color: #F4F6F8; /* 淡灰色，用于整体背景 */
  --text-color: #2C3E50; /* 主要文字颜色 */
  --light-text-color: #7F8C8D; /* 次要文字颜色 */
}

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

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.3s ease;
}

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

/* 头部横幅样式 */
.header {
  padding: 120px 20px 60px; /* 顶部留白避免被导航栏遮挡 */
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.header p {
  font-size: 1.2rem;
}

/* 主容器样式 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 40px;
  padding: 60px 40px;
}

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

.module:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

.module h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.module p {
  font-size: 1rem;
  color: var(--light-text-color);
}

.module ul {
  list-style: inside disc;
  padding-left: 20px;
}

.module ul li {
  margin-bottom: 10px;
}

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

.module img:hover {
  transform: scale(1.05);
}

/* 按钮样式 */
.button {
  display: inline-block;
  padding: 10px 25px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

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

/* 代码块样式 */
code {
  display: block;
  background: #f4f4f4;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  position: relative;
}

code::before {
  content: "代码示例";
  position: absolute;
  top: -20px;
  left: 10px;
  background: #2C3E50;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* 脚注样式 */
.footer {
  background: var(--secondary-color);
  color: #fff;
  padding: 40px 20px;
  text-align: center;
}

.footer a {
  color: var(--accent-color);
  text-decoration: none;
  margin: 0 10px;
}

.footer a:hover {
  color: var(--highlight-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    padding: 40px 20px;
  }
}

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

.module {
  animation: fadeIn 1s ease-in-out;
}

/* 面包屑导航样式 */
.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 10px 0;
}

.breadcrumb li + li:before {
  content: ">";
  padding: 0 8px;
  color: var(--secondary-color);
}

.breadcrumb a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--highlight-color);
}

/* 表单样式 */
form {
  display: flex;
  flex-direction: column;
}

form input, form textarea {
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--secondary-color);
  border-radius: 5px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input:focus, form textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 5px var(--accent-color);
}

form input:valid {
  border-color: var(--highlight-color);
}

form input:invalid {
  border-color: #E74C3C;
}

/* 折叠区域样式 */
.collapsible {
  background: var(--background-color);
  color: var(--text-color);
  cursor: pointer;
  padding: 15px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1rem;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.collapsible:hover {
  background: #ecf0f1;
}

.collapsible:after {
  content: '\002B';
  font-size: 1.2rem;
  float: right;
}

.collapsible.active:after {
  content: "\2212";
}

.content {
  padding: 0 15px;
  display: none;
  overflow: hidden;
  background: #fafafa;
  border-radius: 5px;
  margin-bottom: 10px;
}

