
/* 
整体布局与排版样式设置
使用现代的Flexbox和Grid布局确保响应式设计
*/

/* 根元素，定义基础色彩与字体 */
:root {
  --primary-color: #1E273C; /* 深蓝色，主色调 */
  --background-color: #F5F7FA; /* 浅灰色，背景色 */
  --accent-orange: #FF9B00; /* 亮橙色，点缀色 */
  --accent-green: #3EC58D; /* 亮绿色，点缀色 */
  --font-family: 'Roboto', sans-serif; /* 统一使用Roboto字体 */
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--primary-color);
  font-family: var(--font-family);
  line-height: 1.6;
  /* 高级阴影效果 */
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

/* 容器设置，使用Grid布局 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

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

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

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

h4 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

/* 段落样式 */
p {
  font-size: 16px;
  margin-bottom: 15px;
  /* 平滑过渡效果 */
  transition: color 0.3s ease;
}

p:hover {
  color: var(--accent-green);
}

/* 强调文字 */
strong {
  color: var(--accent-orange);
}

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

.navbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 15px;
  position: relative;
}

.navbar a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  transition: width .3s;
}

.navbar a:hover::after {
  width: 100%;
}

/* 侧边栏样式 */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 250px;
  height: 100%;
  background-color: var(--background-color);
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
}

.sidebar li:hover {
  background-color: #f0f0f0;
}

/* 主内容区域 */
.main-content {
  margin-left: 270px;
  padding: 80px 20px 20px 20px;
}

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

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

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

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

/* 代码块样式 */
pre {
  background-color: #272822;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 14px;
  margin-bottom: 20px;
}

.code-highlight {
  background-color: #1E273C;
  padding: 10px;
  border-radius: 5px;
}

/* 按钮样式 */
.button {
  background-color: var(--accent-green);
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: var(--accent-orange);
}

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

.active, .collapsible:hover {
  background-color: var(--accent-green);
  color: #fff;
}

.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background-color: #f1f1f1;
  border-left: 3px solid var(--accent-orange);
}

.content p {
  margin: 10px 0;
}

/* 代码示例区分 */
.code-example {
  background-color: #2d2d2d;
  color: #ccc;
  padding: 20px;
  border-radius: 5px;
  font-family: 'Courier New', Courier, monospace;
  margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .main-content {
    margin-left: 0;
  }
  
  .sidebar {
    width: 200px;
  }
}
.nav-links {width:600px;}
.nav-links a{float:left;}


@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    transform: translateY(-100%);
  }
  
  .sidebar.open {
    transform: translateY(0);
  }
  
  .main-content {
    padding: 60px 10px 10px 10px;
  }
}

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

.fade-in {
  animation: fadeIn 2s ease-in-out;
}

/* 渐变线条装饰 */
.gradient-line {
  height: 4px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-green));
  margin: 20px 0;
  border-radius: 2px;
}

/* 信息提示样式 */
.alert {
  background-color: var(--accent-green);
  color: #fff;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  position: relative;
}

.alert::before {
  content: '信息提示';
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

