
/* 
  全局样式设置
  这里定义了整个网页的基础样式，包括字体、颜色变量、盒模型等，以确保网页的整体一致性和美观性。
*/

/* 定义颜色变量 */
:root {
  --primary-color: #032B44; /* 主色调，深蓝色，传达信任与专业 */
  --background-color: #EAEAEA; /* 背景色，浅灰色，减轻视觉负担 */
  --accent-orange: #FFA500; /* 辅助色，亮橙色，增加活力与视觉吸引力 */
  --accent-green: #34C759; /* 辅助色，绿色，注入动感与现代感 */
  --text-color: #333333; /* 正文字体颜色，深灰色，提升可读性 */
  --card-background: #FFFFFF; /* 卡片背景色，白色，清晰分隔内容 */
  --navbar-color: #032B44; /* 导航栏背景色，深蓝色 */
  --link-color: #34C759; /* 链接颜色，绿色，突显互动元素 */
  --code-background: #F5F5F5; /* 代码块背景色，浅灰 */
  --code-border: #DDDDDD; /* 代码块边框色，灰色 */
}

/* 全局字体设置 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.navbar .logo {
  font-size: 1.5em;
  font-weight: bold;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.navbar li {
  position: relative;
}

.navbar a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 1em;
  transition: color 0.3s ease;
}

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

/* 下拉菜单样式 */
.dropdown {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  background-color: var(--navbar-color);
  padding: 10px 0;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown a {
  color: #FFFFFF;
  padding: 8px 20px;
  display: block;
  transition: background-color 0.3s ease;
}

.dropdown a:hover {
  background-color: var(--accent-green);
}

.navbar li:hover .dropdown {
  display: block;
}

/* 横幅样式 */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 500px;
  background: linear-gradient(135deg, var(--primary-color) 30%, var(--accent-orange) 90%);
  position: relative;
  margin-top: 60px; /* 预留导航栏高度 */
}

.banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center;
  background-size: contain;
  opacity: 0.8;
}

.banner .text {
  position: relative;
  color: #FFFFFF;
  text-align: center;
  z-index: 1;
}

.banner h1 {
  font-size: 3em;
  font-weight: bold;
  margin: 0;
}

.banner p {
  font-size: 1.2em;
  margin-top: 20px;
}

/* 章节导航样式 */
.sidebar {
  position: fixed;
  top: 80px;
  left: 20px;
  width: 200px;
}

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

.sidebar li {
  margin-bottom: 10px;
}

.sidebar a {
  color: var(--accent-green);
  text-decoration: none;
  font-size: 1em;
  transition: color 0.3s ease;
}

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

/* 主内容区样式 */
.container {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 20px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.content {
  grid-column: 2 / 3;
}

.content article {
  background-color: var(--card-background);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content h2, .content h3, .content h4 {
  color: var(--primary-color);
}

.content p {
  margin-bottom: 20px;
}

.content a {
  color: var(--link-color);
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content pre {
  background-color: var(--code-background);
  border: 1px solid var(--code-border);
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.content code {
  font-family: 'Courier New', Courier, monospace;
  color: var(--primary-color);
}

/* 卡片布局样式 */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card {
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 20px;
}

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

.card img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card h3 {
  font-size: 1.5em;
  margin-top: 15px;
}

.card p {
  color: #555555;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .sidebar {
    display: none;
  }
}

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

button:hover {
  background: linear-gradient(45deg, var(--accent-orange), var(--accent-green));
}

button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button.pulse {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 代码示例样式 */
.code-example {
  background-color: var(--code-background);
  border: 1px solid var(--code-border);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.code-example code {
  font-family: 'Courier New', Courier, monospace;
  color: var(--primary-color);
  display: block;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  opacity: 0;
  animation: fadeIn 1s forwards;
}

.section.visible {
  opacity: 1;
}

/* 图片样式 */
.image-decor {
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-decor:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 提示信息样式 */
.reference-note {
  background-color: var(--accent-orange);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  margin: 20px 0;
}

/* 链接样式，添加 rel="nofollow" */
a[rel="nofollow"] {
  color: var(--link-color);
  text-decoration: none;
}

a[rel="nofollow"]:hover {
  text-decoration: underline;
}

